FHIR Cross-Version Mapping Pack
0.1.0 - Ballot for Release 5.1.0 International flag

FHIR Cross-Version Mapping Pack, published by HL7 International / FHIR Infrastructure. This guide is not an authorized publication; it is the continuous build for version 0.1.0 built by the FHIR (HL7® FHIR® Standard) CI Build. This version is based on the current content of https://github.com/HL7/fhir-cross-version/ and changes regularly. See the Directory of published versions

StructureMap: Patient Transforms: R4 to R3

Official URL: http://hl7.org/fhir/StructureMap/Patient4to3 Version: 0.1.0
Standards status: Draft Maturity Level: 1 Computable Name: Patient4to3

PatientTransformsR4toR3

/// url = 'http://hl7.org/fhir/StructureMap/Patient4to3'
/// name = 'Patient4to3'
/// title = 'Patient Transforms: R4 to R3'
/// status = 'active'

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

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

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);
}

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 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";
}

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

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