Release 5 Ballot

This page is part of the FHIR Specification (v5.0.0-ballot: FHIR R5 Ballot Preview). The current version which supercedes this version is 5.0.0. For a full list of available versions, see the Directory of published versions . Page versions: R5 R4B R4 R3

Patient Care Work GroupMaturity Level: N/AStandards Status: InformativeSecurity Category: Patient Compartments: Encounter, Patient, Practitioner, RelatedPerson

R4 : R5 Conversion maps for CarePlan.

Functional status for this map: 11 tests that all execute ok. All tests pass round-trip testing and 10 r3 resources are invalid (0 errors). (see documentation)

map "http://hl7.org/fhir/StructureMap/CarePlan3to4" = "R3 to R4 Conversions for CarePlan"

uses "http://hl7.org/fhir/3.0/StructureDefinition/CarePlan" alias CarePlanR3 as source
uses "http://hl7.org/fhir/StructureDefinition/CarePlan" alias CarePlan as target

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

group CarePlan(source src : CarePlanR3, target tgt : CarePlan) extends DomainResource <<type+>> {
  src.identifier -> tgt.identifier;
  src.definition -> tgt.instantiatesCanonical;
  src.basedOn -> tgt.basedOn;
  src.replaces -> tgt.replaces;
  src.partOf -> tgt.partOf;
  src.status -> tgt.status;
  src.intent -> tgt.intent;
  src.category -> tgt.category;
  src.title -> tgt.title;
  src.description -> tgt.description;
  src.subject -> tgt.subject;
  src.context -> tgt.encounter;
  src.period -> tgt.period;
  src.author -> tgt.author;
  src.contributor -> tgt.contributor;
  src.careTeam -> tgt.careTeam;
  src.addresses -> tgt.addresses;
  src.supportingInfo -> tgt.supportingInfo;
  src.goal -> tgt.goal;
  src.activity as vs -> tgt.activity as vt then activity(vs, vt);
  src.note -> tgt.note;
}

group activity(source src, target tgt) extends BackboneElement {
  src.outcomeCodeableConcept -> tgt.outcomeCodeableConcept;
  src.outcomeReference -> tgt.outcomeReference;
  src.progress -> tgt.progress;
  src.reference -> tgt.reference;
  src.detail as vs -> tgt.detail as vt then detail(vs, vt);
}

group detail(source src, target tgt) extends BackboneElement {
  src.category as v ->  tgt.extension as vt,  vt.url = 'http://hl7.org/fhir/3.0/StructureDefinition/extension-CarePlan.activity.detail.category',  vt.value = v;
  src.definition -> tgt.instantiatesCanonical;
  src.code -> tgt.code;
  src.reasonCode -> tgt.reasonCode;
  src.reasonReference -> tgt.reasonReference;
  src.goal -> tgt.goal;
  src.status -> tgt.status;
  src.statusReason as s ->  tgt.statusReason as t,  t.text = s;
  src.prohibited -> tgt.doNotPerform;
  src.scheduled : Timing as s -> tgt.scheduled = create('Timing') as t then Timing(s, t);
  src.scheduled : Period as s -> tgt.scheduled = create('Period') as t then Period(s, t);
  src.scheduled : string as s -> tgt.scheduled = create('string') as t then string(s, t);
  src.location -> tgt.location;
  src.performer -> tgt.performer;
  src.product : CodeableConcept as s -> tgt.product = create('CodeableConcept') as t then CodeableConcept(s, t);
  src.product : Reference as s -> tgt.product = create('Reference') as t then Reference(s, t);
  src.dailyAmount -> tgt.dailyAmount;
  src.quantity -> tgt.quantity;
  src.description -> tgt.description;
}


map "http://hl7.org/fhir/StructureMap/CarePlan4to3" = "R4 to R3 Conversion for CarePlan"

uses "http://hl7.org/fhir/StructureDefinition/CarePlan" alias CarePlan as source
uses "http://hl7.org/fhir/3.0/StructureDefinition/CarePlan" alias CarePlanR3 as target

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

group CarePlan(source src : CarePlan, target tgt : CarePlanR3) extends DomainResource <<type+>> {
  src.identifier -> tgt.identifier;
  src.instantiatesCanonical -> tgt.definition;
  src.basedOn -> tgt.basedOn;
  src.replaces -> tgt.replaces;
  src.partOf -> tgt.partOf;
  src.status -> tgt.status;
  src.intent -> tgt.intent;
  src.category -> tgt.category;
  src.title -> tgt.title;
  src.description -> tgt.description;
  src.subject -> tgt.subject;
  src.encounter -> tgt.context;
  src.period -> tgt.period;
  src.author -> tgt.author;
  src.contributor -> tgt.contributor;
  src.careTeam -> tgt.careTeam;
  src.addresses -> tgt.addresses;
  src.supportingInfo -> tgt.supportingInfo;
  src.goal -> tgt.goal;
  src.activity as vs -> tgt.activity as vt then activity(vs, vt);
  src.note -> tgt.note;
}

group activity(source src, target tgt) extends BackboneElement {
  src.outcomeCodeableConcept -> tgt.outcomeCodeableConcept;
  src.outcomeReference -> tgt.outcomeReference;
  src.progress -> tgt.progress;
  src.reference -> tgt.reference;
  src.detail as vs -> tgt.detail as vt then detail(vs, vt);
}

group detail(source src, target tgt) extends BackboneElement {
  src.extension as e where url = 'http://hl7.org/fhir/3.0/StructureDefinition/extension-CarePlan.activity.detail.category' then {
    e.value -> tgt.category;
  };
  src.instantiatesCanonical -> tgt.definition;
  src.code -> tgt.code;
  src.reasonCode -> tgt.reasonCode;
  src.reasonReference -> tgt.reasonReference;
  src.goal -> tgt.goal;
  src.status -> tgt.status;
  src.statusReason as s then {
    s.text -> tgt.statusReason;
  };
  src.doNotPerform -> tgt.prohibited;
  src.scheduled : Timing as s -> tgt.scheduled = create('Timing') as t then Timing(s, t);
  src.scheduled : Period as s -> tgt.scheduled = create('Period') as t then Period(s, t);
  src.scheduled : string as s -> tgt.scheduled = create('string') as t then string(s, t);
  src.location -> tgt.location;
  src.performer -> tgt.performer;
  src.product : CodeableConcept as s -> tgt.product = create('CodeableConcept') as t then CodeableConcept(s, t);
  src.product : Reference as s -> tgt.product = create('Reference') as t then Reference(s, t);
  src.dailyAmount -> tgt.dailyAmount;
  src.quantity -> tgt.quantity;
  src.description -> tgt.description;
}


<p>No validation errors - all conversions are clean</p>