FHIR Mapping Language (FML), 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/mapping-language-ig/ and changes regularly. See the Directory of published versions
| Page standards status: Informative |
{
"resourceType" : "StructureMap",
"resourceDefinition" : "http://hl7.org/fhir/StructureDefinition/StructureMap|0.1.0",
"text" : {
"status" : "generated",
"div" : "<div xmlns=\"http://www.w3.org/1999/xhtml\"><p class=\"res-header-id\"><b>Generated Narrative: StructureMap StructArrayToProp</b></p><a name=\"StructArrayToProp\"> </a><a name=\"hcStructArrayToProp\"> </a><pre class=\"fml\">\r\n<span style=\"color: #cc00cc\">/// <b>url</b> = </span><span style=\"color: blue\">'http://hl7.org/fhir/uv/mapping-language/StructureMap/StructArrayToProp'</span>\r\n<span style=\"color: #cc00cc\">/// <b>name</b> = </span><span style=\"color: blue\">'StructArrayToProp'</span>\r\n<span style=\"color: #cc00cc\">/// <b>status</b> = </span><span style=\"color: blue\">'active'</span>\r\n<span style=\"color: #cc00cc\">/// <b>description</b> = </span><span style=\"color: blue\">'Example demonstrating extracting a single value from an array into a scalar property'</span>\r\n\r\n<b>uses</b><span style=\"color: navy\"> "</span><a href=\"http://hl7.org/fhir/6.0.0-ballot5/patient.html\" title=\"Patient\">http://hl7.org/fhir/StructureDefinition/Patient</a><span style=\"color: navy\">" </span><b>as </b><b>source</b>\r\n<b>uses</b><span style=\"color: navy\"> "</span><a href=\"http://hl7.org/fhir/6.0.0-ballot5/patient.html\" title=\"Patient\">http://hl7.org/fhir/StructureDefinition/Patient</a><span style=\"color: navy\">" </span><b>as </b><b>target</b>\r\n\r\n<b>group </b>StructArrayToProp<span style=\"color: navy\">(</span><b>source</b> <span style=\"color: maroon\">src</span><span style=\"color: navy\"> : </span>Patient, <b>target</b> <span style=\"color: maroon\">tgt</span><span style=\"color: navy\"> : </span>Patient<span style=\"color: navy\">)</span><span style=\"color: navy\"> {\r\n</span> <span style=\"color: navy\">// </span><span style=\"color: green\">take the first name's family and put it into the scalar id</span>\r\n src.name first<b> as </b><span style=\"color: maroon\">v</span><b> then</b><span style=\"color: navy\"> {\r\n</span> v.family<b> as </b><span style=\"color: maroon\">f</span><span style=\"color: navy\"><b> -> </b></span>tgt.id = <span style=\"color: maroon\">f</span> <i>"r1"</i><span style=\"color: navy\">;</span>\r\n <span style=\"color: navy\">}</span> <i>"r2"</i><span style=\"color: navy\">;</span>\r\n<span style=\"color: navy\">}\r\n\r\n</span></pre></div>"
},
"url" : "http://hl7.org/fhir/uv/mapping-language/StructureMap/StructArrayToProp",
"name" : "StructArrayToProp",
"status" : "active",
"description" : "Example demonstrating extracting a single value from an array into a scalar property",
"structure" : [
{
"url" : "http://hl7.org/fhir/StructureDefinition/Patient",
"mode" : "source"
},
{
"url" : "http://hl7.org/fhir/StructureDefinition/Patient",
"mode" : "target"
}
],
"group" : [
{
"name" : "StructArrayToProp",
"input" : [
{
"mode" : "source",
"name" : "src",
"type" : "Patient"
},
{
"mode" : "target",
"name" : "tgt",
"type" : "Patient"
}
],
"rule" : [
{
"source" : [
{
"context" : "src",
"element" : [
"name"
],
"listMode" : "first",
"variable" : "v"
}
],
"rule" : [
{
"source" : [
{
"context" : "v",
"element" : [
"family"
],
"variable" : "f"
}
],
"target" : [
{
"context" : "tgt",
"element" : [
"id"
],
"transform" : "copy",
"parameter" : [
{
"valueId" : "f"
}
]
}
],
"name" : "r1"
}
],
"documentation" : "take the first name's family and put it into the scalar id",
"name" : "r2"
}
]
}
],
"id" : "StructArrayToProp",
"language" : "en"
}