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
Page standards status: Draft | Maturity Level: 1 |
{
"resourceType" : "StructureMap",
"id" : "MedicationStatement3to4",
"text" : {
"status" : "generated",
"div" : "<div xmlns=\"http://www.w3.org/1999/xhtml\"><pre class=\"fml\">\r\n<span style=\"color: #cc00cc\">/// <b>url</b> = </span><span style=\"color: blue\">'http://hl7.org/fhir/StructureMap/MedicationStatement3to4'</span>\r\n<span style=\"color: #cc00cc\">/// <b>name</b> = </span><span style=\"color: blue\">'MedicationStatement3to4'</span>\r\n<span style=\"color: #cc00cc\">/// <b>title</b> = </span><span style=\"color: blue\">'MedicationStatement Transforms: R3 to R4'</span>\r\n<span style=\"color: #cc00cc\">/// <b>status</b> = </span><span style=\"color: blue\">'active'</span>\r\n\r\n<b>uses</b><span style=\"color: navy\"> "</span>http://hl7.org/fhir/3.0/MedicationStatement<span style=\"color: navy\">" </span><b>alias </b>MedicationStatementR3 <b>as </b><b>source</b>\r\n<b>uses</b><span style=\"color: navy\"> "</span>http://hl7.org/fhir/4.0/MedicationStatement<span style=\"color: navy\">" </span><b>alias </b>MedicationStatement <b>as </b><b>target</b>\r\n\r\n<b>imports</b><span style=\"color: navy\"> "</span>http://hl7.org/fhir/StructureMap/*3to4<span style=\"color: navy\">"\r\n</span>\r\n<b>group </b>MedicationStatement<span style=\"color: navy\">(</span><b>source</b> <span style=\"color: maroon\">src</span><span style=\"color: navy\"> : </span>MedicationStatementR3, <b>target</b> <span style=\"color: maroon\">tgt</span><span style=\"color: navy\"> : </span>MedicationStatement<span style=\"color: navy\">)</span><b> extends </b>DomainResource<b> <<type+>></b><span style=\"color: navy\"> {\r\n</span> src.identifier<span style=\"color: navy\"><b> -> </b></span>tgt.identifier<span style=\"color: navy\">;</span>\r\n src.basedOn<span style=\"color: navy\"><b> -> </b></span>tgt.basedOn<span style=\"color: navy\">;</span>\r\n src.partOf<span style=\"color: navy\"><b> -> </b></span>tgt.partOf<span style=\"color: navy\">;</span>\r\n src.context<span style=\"color: navy\"><b> -> </b></span>tgt.context<span style=\"color: navy\">;</span>\r\n src.status<b> as </b><span style=\"color: maroon\">v</span><span style=\"color: navy\"><b> -> </b></span> tgt.extension<b> as </b><span style=\"color: maroon\">vt</span><span style=\"color: navy\">, </span> vt.url = <span style=\"color: blue\">'http://hl7.org/fhir/3.0/StructureDefinition/extension-MedicationStatement.status'</span><span style=\"color: navy\">, </span> vt.value = <span style=\"color: maroon\">v</span><span style=\"color: navy\">;</span>\r\n src.taken<b> as </b><span style=\"color: maroon\">v</span><span style=\"color: navy\"><b> -> </b></span> tgt.extension<b> as </b><span style=\"color: maroon\">vt</span><span style=\"color: navy\">, </span> vt.url = <span style=\"color: blue\">'http://hl7.org/fhir/3.0/StructureDefinition/extension-MedicationStatement.taken'</span><span style=\"color: navy\">, </span> vt.value = <span style=\"color: maroon\">v</span><span style=\"color: navy\">;</span>\r\n src.status<b> where </b>(src.taken in ('n' | 'unk')).not()<span style=\"color: navy\"><b> -> </b></span>tgt.status<span style=\"color: navy\">;</span>\r\n src.taken<b> where </b>value = 'n'<span style=\"color: navy\"><b> -> </b></span>tgt.status = <span style=\"color: blue\">'not-taken'</span><span style=\"color: navy\">;</span>\r\n src.taken<b> where </b>value = 'unk'<span style=\"color: navy\"><b> -> </b></span>tgt.status = <span style=\"color: blue\">'unknown'</span><span style=\"color: navy\">;</span>\r\n src.category<span style=\"color: navy\"><b> -> </b></span>tgt.category<span style=\"color: navy\">;</span>\r\n src.medication<span style=\"color: navy\"> : </span>CodeableConcept<b> as </b><span style=\"color: maroon\">vs</span><span style=\"color: navy\"><b> -> </b></span>tgt.medication = <b>create</b><span style=\"color: navy\">(</span><span style=\"color: blue\">'CodeableConcept'</span><span style=\"color: navy\">)</span><b> as </b><span style=\"color: maroon\">vt</span><b> then </b>CodeableConcept<span style=\"color: navy\">(</span><span style=\"color: maroon\">vs</span><span style=\"color: navy\">, </span><span style=\"color: maroon\">vt</span><span style=\"color: navy\">)</span><span style=\"color: navy\">;</span>\r\n src.medication<span style=\"color: navy\"> : </span>Reference<b> as </b><span style=\"color: maroon\">vs</span><span style=\"color: navy\"><b> -> </b></span>tgt.medication = <b>create</b><span style=\"color: navy\">(</span><span style=\"color: blue\">'Reference'</span><span style=\"color: navy\">)</span><b> as </b><span style=\"color: maroon\">vt</span><b> then </b>Reference<span style=\"color: navy\">(</span><span style=\"color: maroon\">vs</span><span style=\"color: navy\">, </span><span style=\"color: maroon\">vt</span><span style=\"color: navy\">)</span><span style=\"color: navy\">;</span>\r\n src.effective<span style=\"color: navy\"> : </span>dateTime<b> as </b><span style=\"color: maroon\">vs</span><span style=\"color: navy\"><b> -> </b></span>tgt.effective = <b>create</b><span style=\"color: navy\">(</span><span style=\"color: blue\">'dateTime'</span><span style=\"color: navy\">)</span><b> as </b><span style=\"color: maroon\">vt</span><b> then </b>dateTime<span style=\"color: navy\">(</span><span style=\"color: maroon\">vs</span><span style=\"color: navy\">, </span><span style=\"color: maroon\">vt</span><span style=\"color: navy\">)</span><span style=\"color: navy\">;</span>\r\n src.effective<span style=\"color: navy\"> : </span>Period<b> as </b><span style=\"color: maroon\">vs</span><span style=\"color: navy\"><b> -> </b></span>tgt.effective = <b>create</b><span style=\"color: navy\">(</span><span style=\"color: blue\">'Period'</span><span style=\"color: navy\">)</span><b> as </b><span style=\"color: maroon\">vt</span><b> then </b>Period<span style=\"color: navy\">(</span><span style=\"color: maroon\">vs</span><span style=\"color: navy\">, </span><span style=\"color: maroon\">vt</span><span style=\"color: navy\">)</span><span style=\"color: navy\">;</span>\r\n src.dateAsserted<span style=\"color: navy\"><b> -> </b></span>tgt.dateAsserted<span style=\"color: navy\">;</span>\r\n src.informationSource<span style=\"color: navy\"><b> -> </b></span>tgt.informationSource<span style=\"color: navy\">;</span>\r\n src.subject<span style=\"color: navy\"><b> -> </b></span>tgt.subject<span style=\"color: navy\">;</span>\r\n src.derivedFrom<span style=\"color: navy\"><b> -> </b></span>tgt.derivedFrom<span style=\"color: navy\">;</span>\r\n src.reasonNotTaken<span style=\"color: navy\"><b> -> </b></span>tgt.reasonCode<span style=\"color: navy\">;</span>\r\n src.reasonCode<span style=\"color: navy\"><b> -> </b></span>tgt.reasonCode<span style=\"color: navy\">;</span>\r\n src.reasonReference<span style=\"color: navy\"><b> -> </b></span>tgt.reasonReference<span style=\"color: navy\">;</span>\r\n src.note<span style=\"color: navy\"><b> -> </b></span>tgt.note<span style=\"color: navy\">;</span>\r\n src.dosage<span style=\"color: navy\"><b> -> </b></span>tgt.dosage<span style=\"color: navy\">;</span>\r\n<span style=\"color: navy\">}\r\n\r\n</span></pre></div>"
},
"extension" : [
{
"url" : "http://hl7.org/fhir/StructureDefinition/structuredefinition-wg",
"valueCode" : "fhir"
},
{
"url" : "http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm",
"valueInteger" : 1,
"_valueInteger" : {
"extension" : [
{
"url" : "http://hl7.org/fhir/StructureDefinition/structuredefinition-conformance-derivedFrom",
"valueCanonical" : "http://hl7.org/fhir/extensions/ImplementationGuide/hl7.fhir.uv.xver"
}
]
}
},
{
"url" : "http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status",
"valueCode" : "draft",
"_valueCode" : {
"extension" : [
{
"url" : "http://hl7.org/fhir/StructureDefinition/structuredefinition-conformance-derivedFrom",
"valueCanonical" : "http://hl7.org/fhir/extensions/ImplementationGuide/hl7.fhir.uv.xver"
}
]
}
}
],
"url" : "http://hl7.org/fhir/StructureMap/MedicationStatement3to4",
"version" : "0.1.0",
"name" : "MedicationStatement3to4",
"title" : "MedicationStatement Transforms: R3 to R4",
"status" : "active",
"date" : "2024-02-22T03:16:50+00:00",
"publisher" : "HL7 International / FHIR Infrastructure",
"contact" : [
{
"telecom" : [
{
"system" : "url",
"value" : "http://www.hl7.org/Special/committees/fiwg"
}
]
}
],
"description" : "MedicationStatementTransformsR3toR4",
"jurisdiction" : [
{
"coding" : [
{
"system" : "http://unstats.un.org/unsd/methods/m49/m49.htm",
"code" : "001"
}
]
}
],
"structure" : [
{
"url" : "http://hl7.org/fhir/3.0/MedicationStatement",
"mode" : "source",
"alias" : "MedicationStatementR3"
},
{
"url" : "http://hl7.org/fhir/4.0/MedicationStatement",
"mode" : "target",
"alias" : "MedicationStatement"
}
],
"import" : [
"http://hl7.org/fhir/StructureMap/*3to4"
],
"group" : [
{
"name" : "MedicationStatement",
"extends" : "DomainResource",
"typeMode" : "type-and-types",
"input" : [
{
"name" : "src",
"type" : "MedicationStatementR3",
"mode" : "source"
},
{
"name" : "tgt",
"type" : "MedicationStatement",
"mode" : "target"
}
],
"rule" : [
{
"name" : "identifier",
"source" : [
{
"context" : "src",
"element" : "identifier",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "tgt",
"element" : "identifier",
"variable" : "vvv",
"transform" : "create"
}
],
"dependent" : [
{
"name" : "DefaultMappingGroupAnonymousAlias",
"parameter" : [
{
"valueId" : "vvv"
},
{
"valueId" : "vvv"
}
]
}
]
},
{
"name" : "basedOn",
"source" : [
{
"context" : "src",
"element" : "basedOn",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "tgt",
"element" : "basedOn",
"variable" : "vvv",
"transform" : "create"
}
],
"dependent" : [
{
"name" : "DefaultMappingGroupAnonymousAlias",
"parameter" : [
{
"valueId" : "vvv"
},
{
"valueId" : "vvv"
}
]
}
]
},
{
"name" : "partOf",
"source" : [
{
"context" : "src",
"element" : "partOf",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "tgt",
"element" : "partOf",
"variable" : "vvv",
"transform" : "create"
}
],
"dependent" : [
{
"name" : "DefaultMappingGroupAnonymousAlias",
"parameter" : [
{
"valueId" : "vvv"
},
{
"valueId" : "vvv"
}
]
}
]
},
{
"name" : "context",
"source" : [
{
"context" : "src",
"element" : "context",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "tgt",
"element" : "context",
"variable" : "vvv",
"transform" : "create"
}
],
"dependent" : [
{
"name" : "DefaultMappingGroupAnonymousAlias",
"parameter" : [
{
"valueId" : "vvv"
},
{
"valueId" : "vvv"
}
]
}
]
},
{
"name" : "status",
"source" : [
{
"context" : "src",
"element" : "status",
"variable" : "v"
}
],
"target" : [
{
"context" : "tgt",
"element" : "extension",
"variable" : "vt"
},
{
"context" : "vt",
"element" : "url",
"transform" : "copy",
"parameter" : [
{
"valueString" : "http://hl7.org/fhir/3.0/StructureDefinition/extension-MedicationStatement.status"
}
]
},
{
"context" : "vt",
"element" : "value",
"transform" : "copy",
"parameter" : [
{
"valueId" : "v"
}
]
}
]
},
{
"name" : "taken",
"source" : [
{
"context" : "src",
"element" : "taken",
"variable" : "v"
}
],
"target" : [
{
"context" : "tgt",
"element" : "extension",
"variable" : "vt"
},
{
"context" : "vt",
"element" : "url",
"transform" : "copy",
"parameter" : [
{
"valueString" : "http://hl7.org/fhir/3.0/StructureDefinition/extension-MedicationStatement.taken"
}
]
},
{
"context" : "vt",
"element" : "value",
"transform" : "copy",
"parameter" : [
{
"valueId" : "v"
}
]
}
]
},
{
"name" : "status",
"source" : [
{
"context" : "src",
"element" : "status",
"variable" : "vvv",
"condition" : "(src.taken in ('n' | 'unk')).not()"
}
],
"target" : [
{
"context" : "tgt",
"element" : "status",
"variable" : "vvv",
"transform" : "create"
}
],
"dependent" : [
{
"name" : "DefaultMappingGroupAnonymousAlias",
"parameter" : [
{
"valueId" : "vvv"
},
{
"valueId" : "vvv"
}
]
}
]
},
{
"name" : "taken",
"source" : [
{
"context" : "src",
"element" : "taken",
"condition" : "value = 'n'"
}
],
"target" : [
{
"context" : "tgt",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "not-taken"
}
]
}
]
},
{
"name" : "taken",
"source" : [
{
"context" : "src",
"element" : "taken",
"condition" : "value = 'unk'"
}
],
"target" : [
{
"context" : "tgt",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "unknown"
}
]
}
]
},
{
"name" : "category",
"source" : [
{
"context" : "src",
"element" : "category",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "tgt",
"element" : "category",
"variable" : "vvv",
"transform" : "create"
}
],
"dependent" : [
{
"name" : "DefaultMappingGroupAnonymousAlias",
"parameter" : [
{
"valueId" : "vvv"
},
{
"valueId" : "vvv"
}
]
}
]
},
{
"name" : "medicationCodeableConcept",
"source" : [
{
"context" : "src",
"type" : "CodeableConcept",
"element" : "medication",
"variable" : "vs"
}
],
"target" : [
{
"context" : "tgt",
"element" : "medication",
"variable" : "vt",
"transform" : "create",
"parameter" : [
{
"valueString" : "CodeableConcept"
}
]
}
],
"dependent" : [
{
"name" : "CodeableConcept",
"parameter" : [
{
"valueId" : "vs"
},
{
"valueId" : "vt"
}
]
}
]
},
{
"name" : "medicationReference",
"source" : [
{
"context" : "src",
"type" : "Reference",
"element" : "medication",
"variable" : "vs"
}
],
"target" : [
{
"context" : "tgt",
"element" : "medication",
"variable" : "vt",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
}
],
"dependent" : [
{
"name" : "Reference",
"parameter" : [
{
"valueId" : "vs"
},
{
"valueId" : "vt"
}
]
}
]
},
{
"name" : "effectiveDateTime",
"source" : [
{
"context" : "src",
"type" : "dateTime",
"element" : "effective",
"variable" : "vs"
}
],
"target" : [
{
"context" : "tgt",
"element" : "effective",
"variable" : "vt",
"transform" : "create",
"parameter" : [
{
"valueString" : "dateTime"
}
]
}
],
"dependent" : [
{
"name" : "dateTime",
"parameter" : [
{
"valueId" : "vs"
},
{
"valueId" : "vt"
}
]
}
]
},
{
"name" : "effectivePeriod",
"source" : [
{
"context" : "src",
"type" : "Period",
"element" : "effective",
"variable" : "vs"
}
],
"target" : [
{
"context" : "tgt",
"element" : "effective",
"variable" : "vt",
"transform" : "create",
"parameter" : [
{
"valueString" : "Period"
}
]
}
],
"dependent" : [
{
"name" : "Period",
"parameter" : [
{
"valueId" : "vs"
},
{
"valueId" : "vt"
}
]
}
]
},
{
"name" : "dateAsserted",
"source" : [
{
"context" : "src",
"element" : "dateAsserted",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "tgt",
"element" : "dateAsserted",
"variable" : "vvv",
"transform" : "create"
}
],
"dependent" : [
{
"name" : "DefaultMappingGroupAnonymousAlias",
"parameter" : [
{
"valueId" : "vvv"
},
{
"valueId" : "vvv"
}
]
}
]
},
{
"name" : "informationSource",
"source" : [
{
"context" : "src",
"element" : "informationSource",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "tgt",
"element" : "informationSource",
"variable" : "vvv",
"transform" : "create"
}
],
"dependent" : [
{
"name" : "DefaultMappingGroupAnonymousAlias",
"parameter" : [
{
"valueId" : "vvv"
},
{
"valueId" : "vvv"
}
]
}
]
},
{
"name" : "subject",
"source" : [
{
"context" : "src",
"element" : "subject",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "tgt",
"element" : "subject",
"variable" : "vvv",
"transform" : "create"
}
],
"dependent" : [
{
"name" : "DefaultMappingGroupAnonymousAlias",
"parameter" : [
{
"valueId" : "vvv"
},
{
"valueId" : "vvv"
}
]
}
]
},
{
"name" : "derivedFrom",
"source" : [
{
"context" : "src",
"element" : "derivedFrom",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "tgt",
"element" : "derivedFrom",
"variable" : "vvv",
"transform" : "create"
}
],
"dependent" : [
{
"name" : "DefaultMappingGroupAnonymousAlias",
"parameter" : [
{
"valueId" : "vvv"
},
{
"valueId" : "vvv"
}
]
}
]
},
{
"name" : "reasonNotTaken",
"source" : [
{
"context" : "src",
"element" : "reasonNotTaken",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "tgt",
"element" : "reasonCode",
"variable" : "vvv",
"transform" : "create"
}
],
"dependent" : [
{
"name" : "DefaultMappingGroupAnonymousAlias",
"parameter" : [
{
"valueId" : "vvv"
},
{
"valueId" : "vvv"
}
]
}
]
},
{
"name" : "reasonCode",
"source" : [
{
"context" : "src",
"element" : "reasonCode",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "tgt",
"element" : "reasonCode",
"variable" : "vvv",
"transform" : "create"
}
],
"dependent" : [
{
"name" : "DefaultMappingGroupAnonymousAlias",
"parameter" : [
{
"valueId" : "vvv"
},
{
"valueId" : "vvv"
}
]
}
]
},
{
"name" : "reasonReference",
"source" : [
{
"context" : "src",
"element" : "reasonReference",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "tgt",
"element" : "reasonReference",
"variable" : "vvv",
"transform" : "create"
}
],
"dependent" : [
{
"name" : "DefaultMappingGroupAnonymousAlias",
"parameter" : [
{
"valueId" : "vvv"
},
{
"valueId" : "vvv"
}
]
}
]
},
{
"name" : "note",
"source" : [
{
"context" : "src",
"element" : "note",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "tgt",
"element" : "note",
"variable" : "vvv",
"transform" : "create"
}
],
"dependent" : [
{
"name" : "DefaultMappingGroupAnonymousAlias",
"parameter" : [
{
"valueId" : "vvv"
},
{
"valueId" : "vvv"
}
]
}
]
},
{
"name" : "dosage",
"source" : [
{
"context" : "src",
"element" : "dosage",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "tgt",
"element" : "dosage",
"variable" : "vvv",
"transform" : "create"
}
],
"dependent" : [
{
"name" : "DefaultMappingGroupAnonymousAlias",
"parameter" : [
{
"valueId" : "vvv"
},
{
"valueId" : "vvv"
}
]
}
]
}
]
}
]
}