FHIR Release 3 (STU) Current Build
This page is part of FHIR STU 3 (v3.0.1) in it's permanent home (it will always be available at this URL). It has been superceded by R4 . For a full list of available versions, see the Directory of published versions .
Patient Administration Work Group Maturity Level : N/A Ballot Standards Status : Informative Security Category : Patient Compartments : Patient , Practitioner , RelatedPerson

R2 : R3 Converson : R4 Conversion maps for Patient.

Functional status for this map: 18 16 tests that all execute ok. All tests pass round-trip testing and 6 all r3 resources are invalid (12 errors). valid. ( see documentation)

map "http://hl7.org/fhir/StructureMap/Patient2to3" = "R2 to R3 Conversions for Patient"
map "http://hl7.org/fhir/StructureMap/Patient3to4" = "R3 to R4 Conversions for Patient"
uses "http://hl7.org/fhir/DSTU2/StructureDefinition/Patient" alias PatientR2 as source

uses "http://hl7.org/fhir/3.0/StructureDefinition/Patient" alias PatientR3 as source

uses "http://hl7.org/fhir/StructureDefinition/Patient" alias Patient as target
imports "http://hl7.org/fhir/StructureMap/*2to3"
group for type+types  Patient extends DomainResource
  input src : PatientR2 as source
  input tgt : Patient as target

imports "http://hl7.org/fhir/StructureMap/*3to4"

  "Patient-identifier" : for src.identifier make tgt.identifier
  "Patient-active" : for src.active make tgt.active
  "Patient-name" : for src.name make tgt.name
  "Patient-telecom" : for src.telecom make tgt.telecom
  "Patient-gender" : for src.gender make tgt.gender
  "Patient-birthDate" : for src.birthDate make tgt.birthDate
  "Patient-deceased" : for src.deceased make tgt.deceased 
  "Patient-address" : for src.address make tgt.address
  "Patient-maritalStatus" : for src.maritalStatus make tgt.maritalStatus
  "Patient-multipleBirth" : for src.multipleBirth make tgt.multipleBirth 
  "Patient-photo" : for src.photo make tgt.photo
  "Patient-contact" : for src.contact as vs0 make tgt.contact as vt0 then patContact(vs0, vt0) 
  "Patient-animal" : for src.animal as vs0 make tgt.animal as vt0 then patAnimal(vs0, vt0) 
  "Patient-communication" : for src.communication as vs0 make tgt.communication as vt0 then patCommunication(vs0, vt0) 
  "Patient-generalPractitioner" : for src.careProvider make tgt.generalPractitioner
  "Patient-managingOrganization" : for src.managingOrganization make tgt.managingOrganization
  "Patient-link" : for src.link as vs0 make tgt.link as vt0 then patLink(vs0, vt0)
endgroup

group Patient(source src : PatientR3, target tgt : Patient) extends DomainResource <<type+>> {
  src.identifier -> tgt.identifier;
  src.active -> tgt.active;
  src.name -> tgt.name;
  src.telecom -> tgt.telecom;
  src.gender -> tgt.gender;
  src.birthDate -> tgt.birthDate;
  src.deceased : boolean as vs -> tgt.deceased = create('boolean') as vt then boolean(vs, vt);
  src.deceased : dateTime as vs -> tgt.deceased = create('dateTime') as vt then dateTime(vs, vt);
  src.address -> tgt.address;
  src.maritalStatus -> tgt.maritalStatus;
  src.multipleBirth : boolean as vs -> tgt.multipleBirth = create('boolean') as vt then boolean(vs, vt);
  src.multipleBirth : integer as vs -> tgt.multipleBirth = create('integer') as vt then integer(vs, vt);
  src.photo -> tgt.photo;
  src.contact as vs0 -> tgt.contact as vt0 then contact(vs0, vt0);
  src.animal as vs0 -> tgt.extension as vt0 then animal(vs0, vt0);
  src.communication as vs0 -> tgt.communication as vt0 then communication(vs0, vt0);
  src.generalPractitioner -> tgt.generalPractitioner;
  src.managingOrganization -> tgt.managingOrganization;
  src.link as vs0 -> tgt.link as vt0 then link(vs0, vt0);
}

group patContact extends BackboneElement
  input src as source
  input tgt as target

group contact(source src, target tgt) extends BackboneElement {
  src.relationship -> tgt.relationship;
  src.name -> tgt.name;
  src.telecom -> tgt.telecom;
  src.address -> tgt.address;
  src.gender -> tgt.gender;
  src.organization -> tgt.organization;
  src.period -> tgt.period;
}

  "Patient.contact-relationship" : for src.relationship make tgt.relationship
  "Patient.contact-name" : for src.name make tgt.name
  "Patient.contact-telecom" : for src.telecom make tgt.telecom
  "Patient.contact-address" : for src.address make tgt.address
  "Patient.contact-gender" : for src.gender make tgt.gender
  "Patient.contact-organization" : for src.organization make tgt.organization
  "Patient.contact-period" : for src.period make tgt.period
endgroup
  
group patCommunication extends BackboneElement
  input src as source
  input tgt as target

group animal(source src, target tgt) extends Element {
  src -> tgt.url = 'http://hl7.org/fhir/StructureDefinition/patient-animal' "animal";
  src.species as vs ->  tgt.extension as ext,  ext.url = 'species',  ext.value = vs;
  src.breed as vs ->  tgt.extension as ext,  ext.url = 'breed',  ext.value = vs;
  src.genderStatus as vs ->  tgt.extension as ext,  ext.url = 'genderStatus',  ext.value = vs;
}

  "Patient.communication-language" : for src.language make tgt.language
  "Patient.communication-preferred" : for src.preferred make tgt.preferred
endgroup
  
group patAnimal extends BackboneElement
  input src as source
  input tgt as target

group communication(source src, target tgt) extends BackboneElement {
  src.language -> tgt.language;
  src.preferred -> tgt.preferred;
}

  "Patient.communication-species" : for src.species make tgt.species
  "Patient.communication-breed" : for src.breed make tgt.breed
  "Patient.communication-genderStatus" : for src.genderStatus make tgt.genderStatus
endgroup
    
group patLink extends BackboneElement
  input src as source
  input tgt as target

group link(source src, target tgt) extends BackboneElement {
  src.other -> tgt.other;
  src.type -> tgt.type;
}

  "Patient.link-other" : for src.other make tgt.other
  "Patient.link-type" : for src.type make tgt.type
endgroup

map "http://hl7.org/fhir/StructureMap/Patient3to2" = "R3 to R2 Conversion for Patient"
map "http://hl7.org/fhir/StructureMap/Patient4to3" = "R4 to R3 Conversion for Patient"
uses "http://hl7.org/fhir/StructureDefinition/Patient" alias Patient as source
uses "http://hl7.org/fhir/DSTU2/StructureDefinition/Patient" alias PatientR2 as target
imports "http://hl7.org/fhir/StructureMap/*3to2"
group for type+types  Patient extends DomainResource
  input src : Patient as source
  input tgt : PatientR2 as target

uses "http://hl7.org/fhir/3.0/StructureDefinition/Patient" alias PatientR3 as target

  "Patient-identifier" : for src.identifier make tgt.identifier
  "Patient-active" : for src.active make tgt.active
  "Patient-name" : for src.name make tgt.name
  "Patient-telecom" : for src.telecom make tgt.telecom
  "Patient-gender" : for src.gender make tgt.gender
  "Patient-birthDate" : for src.birthDate make tgt.birthDate
  "Patient-deceased-boolean" : for src.deceased : boolean as vs make tgt.deceased = create("boolean") as vt then boolean(vs, vt)
  "Patient-deceased-dateTime" : for src.deceased : dateTime as vs make tgt.deceased = create("dateTime") as vt then dateTime(vs, vt)
  "Patient-address" : for src.address make tgt.address
  "Patient-maritalStatus" : for src.maritalStatus make tgt.maritalStatus
  "Patient-multipleBirth-boolean" : for src.multipleBirth : boolean as vs make tgt.multipleBirth = create("boolean") as vt then boolean(vs, vt)
  "Patient-multipleBirth-integer" : for src.multipleBirth : integer as vs make tgt.multipleBirth = create("integer") as vt then integer(vs, vt)
  "Patient-photo" : for src.photo make tgt.photo
  "Patient-contact" : for src.contact as vs0 make tgt.contact as vt0 then patContact(vs0, vt0) 
  "Patient-animal" : for src.animal as vs0 make tgt.animal as vt0 then patAnimal(vs0, vt0) 
  "Patient-communication" : for src.communication as vs0 make tgt.communication as vt0 then patCommunication(vs0, vt0) 
  "Patient-careProvider" : for src.generalPractitioner make tgt.careProvider
  "Patient-managingOrganization" : for src.managingOrganization make tgt.managingOrganization
  "Patient-link" : for src.link as vs0 make tgt.link as vt0 then patLink(vs0, vt0)
endgroup

imports "http://hl7.org/fhir/StructureMap/*4to3"

group patContact extends BackboneElement
  input src as source
  input tgt as target

group Patient(source src : Patient, target tgt : PatientR3) extends DomainResource <<type+>> {
  src.identifier -> tgt.identifier;
  src.active -> tgt.active;
  src.name -> tgt.name;
  src.telecom -> tgt.telecom;
  src.gender -> tgt.gender;
  src.birthDate -> tgt.birthDate;
  src.deceased : boolean as vs -> tgt.deceased = create('boolean') as vt then boolean(vs, vt);
  src.deceased : dateTime as vs -> tgt.deceased = create('dateTime') as vt then dateTime(vs, vt);
  src.address -> tgt.address;
  src.maritalStatus -> tgt.maritalStatus;
  src.multipleBirth : boolean as vs -> tgt.multipleBirth = create('boolean') as vt then boolean(vs, vt);
  src.multipleBirth : integer as vs -> tgt.multipleBirth = create('integer') as vt then integer(vs, vt);
  src.photo -> tgt.photo;
  src.contact as vs0 -> tgt.contact as vt0 then contact(vs0, vt0);
  src.extension as vs0 where url = 'http://hl7.org/fhir/StructureDefinition/patient-animal' -> tgt.animal as vt0 then animal(vs0, vt0) "animal";
  src.communication as vs0 -> tgt.communication as vt0 then communication(vs0, vt0);
  src.generalPractitioner -> tgt.generalPractitioner;
  src.managingOrganization -> tgt.managingOrganization;
  src.link as vs0 -> tgt.link as vt0 then link(vs0, vt0);
}

  "Patient.contact-relationship" : for src.relationship make tgt.relationship
  "Patient.contact-name" : for src.name make tgt.name
  "Patient.contact-telecom" : for src.telecom make tgt.telecom
  "Patient.contact-address" : for src.address make tgt.address
  "Patient.contact-gender" : for src.gender make tgt.gender
  "Patient.contact-organization" : for src.organization make tgt.organization
  "Patient.contact-period" : for src.period make tgt.period
endgroup

group contact(source src, target tgt) extends BackboneElement {
  src.relationship -> tgt.relationship;
  src.name -> tgt.name;
  src.telecom -> tgt.telecom;
  src.address -> tgt.address;
  src.gender -> tgt.gender;
  src.organization -> tgt.organization;
  src.period -> tgt.period;
}

group patCommunication extends BackboneElement
  input src as source
  input tgt as target

group animal(source src, target tgt) {
  src.extension as ext where url = 'species' then {
    ext.value as vs0 -> tgt.species = vs0 "species2";
  } "species";
  src.extension as ext where url = 'breed' then {
    ext.value as vs0 -> tgt.breed = vs0 "breed";
  } "breed";
  src.extension as ext where url = 'genderStatus' then {
    ext.value as vs0 -> tgt.genderStatus = vs0 "genderStatus";
  } "genderStatus";
}

  "Patient.communication-language" : for src.language make tgt.language
  "Patient.communication-preferred" : for src.preferred make tgt.preferred
endgroup
    
group patAnimal extends BackboneElement
  input src as source
  input tgt as target

group communication(source src, target tgt) extends BackboneElement {
  src.language -> tgt.language;
  src.preferred -> tgt.preferred;
}

  "Patient.communication-species" : for src.species make tgt.species
  "Patient.communication-breed" : for src.breed make tgt.breed
  "Patient.communication-genderStatus" : for src.genderStatus make tgt.genderStatus
endgroup
    
  
group patLink extends BackboneElement
  input src as source
  input tgt as target

group link(source src, target tgt) extends BackboneElement {
  src.other -> tgt.other;
  src.type -> tgt.type;
}

  "Patient.link-other" : for src.other make tgt.other
  "Patient.link-type" : for src.type make tgt.type
endgroup

example ERROR @ Patient.contact.name.extension: The extension http://hl7.org/fhir/StructureDefinition/HumanName-familyRepeat is unknown, and not allowed here (src = InstanceValidator) patient-example ERROR @ Patient.extension[1]: The extension http://hl7.org/fhir/StructureDefinition/us-core-race is unknown, and not allowed here (src = InstanceValidator) ERROR @ Patient.extension[2]: The extension http://hl7.org/fhir/StructureDefinition/us-core-ethnicity is unknown, and not allowed here (src = InstanceValidator) proband ERROR @ Patient.extension: The extension http://hl7.org/fhir/StructureDefinition/us-core-race is unknown, and not allowed here (src = InstanceValidator) us01 ERROR @ Patient.extension[1]: The extension http://hl7.org/fhir/StructureDefinition/us-core-race is unknown, and not allowed here (src = InstanceValidator) ERROR @ Patient.extension[2]: The extension http://hl7.org/fhir/StructureDefinition/us-core-ethnicity is unknown, and not allowed here (src = InstanceValidator) ERROR @ Patient.telecom[2].extension: The extension http://hl7.org/fhir/StructureDefinition/us-core-direct is unknown, and not allowed here (src = InstanceValidator) ERROR @ Patient.address.extension: The extension http://hl7.org/fhir/StructureDefinition/us-core-county is unknown, and not allowed here (src = InstanceValidator) patient-uslab-example1 ERROR @ Patient.extension[1]: The extension http://hl7.org/fhir/StructureDefinition/us-core-race is unknown, and not allowed here (src = InstanceValidator) ERROR @ Patient.extension[2]: The extension http://hl7.org/fhir/StructureDefinition/us-core-ethnicity is unknown, and not allowed here (src = InstanceValidator) patient-uslab-example2 ERROR @ Patient.extension[1]: The extension http://hl7.org/fhir/StructureDefinition/us-core-race is unknown, and not allowed here (src = InstanceValidator) ERROR @ Patient.extension[2]: The extension http://hl7.org/fhir/StructureDefinition/us-core-ethnicity is unknown, and not allowed here (src = InstanceValidator) <p>No validation errors - all conversions are clean</p>