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: FamilyMemberHistory Transforms: R3 to R4

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

FamilyMemberHistoryTransformsR3toR4

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

uses "http://hl7.org/fhir/3.0/FamilyMemberHistory" alias FamilyMemberHistoryR3 as source
uses "http://hl7.org/fhir/4.0/FamilyMemberHistory" alias FamilyMemberHistory as target

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

group FamilyMemberHistory(source src : FamilyMemberHistoryR3, target tgt : FamilyMemberHistory) extends DomainResource <<type+>> {
  src.identifier -> tgt.identifier;
  src.definition -> tgt.instantiatesCanonical;
  src.status -> tgt.status;
  src.notDone as v ->  tgt.extension as vt,  vt.url = 'http://hl7.org/fhir/3.0/StructureDefinition/extension-FamilyMemberHistory.notDone',  vt.value = v;
  src.notDoneReason -> tgt.dataAbsentReason;
  src.patient -> tgt.patient;
  src.date -> tgt.date;
  src.name -> tgt.name;
  src.relationship -> tgt.relationship;
  src.gender as v ->  tgt.sex as cc,  cc.coding as c,  c.system = 'http://hl7.org/fhir/administrative-gender',  c.code = v;
  src.born : Period as vs -> tgt.born = create('Period') as vt then Period(vs, vt);
  src.born : Date as vs -> tgt.born = create('date') as vt then Date(vs, vt);
  src.born : string as vs -> tgt.born = create('string') as vt then string(vs, vt);
  src.age : Age as vs -> tgt.age = create('Age') as vt then Age(vs, vt);
  src.age : Range as vs -> tgt.age = create('Range') as vt then Range(vs, vt);
  src.age : string as vs -> tgt.age = create('string') as vt then string(vs, vt);
  src.estimatedAge -> tgt.estimatedAge;
  src.deceased : boolean as vs -> tgt.deceased = create('boolean') as vt then boolean(vs, vt);
  src.deceased : Age as vs -> tgt.deceased = create('Age') as vt then Age(vs, vt);
  src.deceased : Range as vs -> tgt.deceased = create('Range') as vt then Range(vs, vt);
  src.deceased : Date as vs -> tgt.deceased = create('date') as vt then Date(vs, vt);
  src.deceased : string as vs -> tgt.deceased = create('string') as vt then string(vs, vt);
  src.reasonCode -> tgt.reasonCode;
  src.reasonReference -> tgt.reasonReference;
  src.note -> tgt.note;
  src.condition as s -> tgt.condition as t then condition(s, t);
}

group condition(source src, target tgt) extends BackboneElement {
  src.code -> tgt.code;
  src.outcome -> tgt.outcome;
  src.onset : string as vs -> tgt.onset = create('string') as vt then string(vs, vt);
  src.onset : Age as vs -> tgt.onset = create('Age') as vt then Age(vs, vt);
  src.onset : Range as vs -> tgt.onset = create('Range') as vt then Range(vs, vt);
  src.onset : Period as vs -> tgt.onset = create('Period') as vt then Period(vs, vt);
  src.note -> tgt.note;
}