PreNUDGE FHIR® IG for Data Provider / Data from Apps (R4)
0.1.0 - ci-build

PreNUDGE FHIR® IG for Data Provider / Data from Apps (R4) - Local Development build (v0.1.0) built by the FHIR (HL7® FHIR® Standard) Build Tools. See the Directory of published versions

## : BMI Q to Body Height, Body Weight and BMI Observations Bundle - JSON Representation

Active as of 2026-06-25

Raw json | Download

    {
      "resourceType" : "StructureMap",
      "id" : "BmiQuestionnaireResponseToObservations",
      "text" : {
        "status" : "generated",
        "div" : "<div xmlns=\"http://www.w3.org/1999/xhtml\"><p class=\"res-header-id\"><b>Generated Narrative: StructureMap BmiQuestionnaireResponseToObservations</b></p><a name=\"BmiQuestionnaireResponseToObservations\"> </a><a name=\"hcBmiQuestionnaireResponseToObservations\"> </a><pre class=\"fml\">\r\n<b>map</b><span style=\"color: navy\"> &quot;</span>https://fhir.hl7.at/prenudge/appdata/r4/StructureMap/BmiQuestionnaireResponseToObservations<span style=\"color: navy\">&quot; = &quot;</span>BmiQuestionnaireResponseToObservations<span style=\"color: navy\">&quot;\r\n\r\n</span><span style=\"color: navy\">// </span><span style=\"color: green\">BMI Q to Body Height, Body Weight and BMI Observations Bundle</span>\r\n\r\n<b>uses</b><span style=\"color: navy\"> &quot;</span><a href=\"http://hl7.org/fhir/R4/questionnaireresponse.html\" title=\"QuestionnaireResponse\">http://hl7.org/fhir/StructureDefinition/QuestionnaireResponse</a><span style=\"color: navy\">&quot; </span><b>alias </b>QR <b>as </b><b>source</b>\r\n<b>uses</b><span style=\"color: navy\"> &quot;</span><a href=\"http://hl7.org/fhir/R4/bundle.html\" title=\"Bundle\">http://hl7.org/fhir/StructureDefinition/Bundle</a><span style=\"color: navy\">&quot; </span><b>alias </b>Bundle <b>as </b><b>target</b>\r\n<b>uses</b><span style=\"color: navy\"> &quot;</span><a href=\"http://hl7.org/fhir/R4/observation.html\" title=\"Observation\">http://hl7.org/fhir/StructureDefinition/Observation</a><span style=\"color: navy\">&quot; </span><b>alias </b>Obs <b>as </b><b>target</b>\r\n\r\n<b>group </b>BmiQuestionnaireResponseToObservations<span style=\"color: navy\">(</span><b>source</b> <span style=\"color: maroon\">src</span><span style=\"color: navy\"> : </span>QR, <b>target</b> <span style=\"color: maroon\">tgt</span><span style=\"color: navy\"> : </span>Bundle<span style=\"color: navy\">)</span><span style=\"color: navy\"> {\r\n</span>  src<span style=\"color: navy\"><b> -&gt; </b></span>tgt.type = <span style=\"color: blue\">'collection'</span> <i>&quot;SetBundleType&quot;</i><span style=\"color: navy\">;</span>\r\n  src<span style=\"color: navy\"><b> -&gt; </b></span> tgt.entry<b> as </b><span style=\"color: maroon\">heightEntry</span><span style=\"color: navy\">, </span> heightEntry.resource = <b>create</b><span style=\"color: navy\">(</span><span style=\"color: blue\">'Observation'</span><span style=\"color: navy\">)</span><b> as </b><span style=\"color: maroon\">heightObs</span><b> then</b><span style=\"color: navy\"> {\r\n</span>    src<b> then </b>MapBodyHeightObservation<span style=\"color: navy\">(</span><span style=\"color: maroon\">src</span><span style=\"color: navy\">, </span><span style=\"color: maroon\">heightObs</span><span style=\"color: navy\">)</span> <i>&quot;MapBodyHeightObservation&quot;</i><span style=\"color: navy\">;</span>\r\n  <span style=\"color: navy\">}</span> <i>&quot;CreateBodyHeightEntry&quot;</i><span style=\"color: navy\">;</span>\r\n  src<span style=\"color: navy\"><b> -&gt; </b></span> tgt.entry<b> as </b><span style=\"color: maroon\">weightEntry</span><span style=\"color: navy\">, </span> weightEntry.resource = <b>create</b><span style=\"color: navy\">(</span><span style=\"color: blue\">'Observation'</span><span style=\"color: navy\">)</span><b> as </b><span style=\"color: maroon\">weightObs</span><b> then</b><span style=\"color: navy\"> {\r\n</span>    src<b> then </b>MapBodyWeightObservation<span style=\"color: navy\">(</span><span style=\"color: maroon\">src</span><span style=\"color: navy\">, </span><span style=\"color: maroon\">weightObs</span><span style=\"color: navy\">)</span> <i>&quot;MapBodyWeightObservation&quot;</i><span style=\"color: navy\">;</span>\r\n  <span style=\"color: navy\">}</span> <i>&quot;CreateBodyWeightEntry&quot;</i><span style=\"color: navy\">;</span>\r\n  src<span style=\"color: navy\"><b> -&gt; </b></span> tgt.entry<b> as </b><span style=\"color: maroon\">bmiEntry</span><span style=\"color: navy\">, </span> bmiEntry.resource = <b>create</b><span style=\"color: navy\">(</span><span style=\"color: blue\">'Observation'</span><span style=\"color: navy\">)</span><b> as </b><span style=\"color: maroon\">bmiObs</span><b> then</b><span style=\"color: navy\"> {\r\n</span>    src<b> then </b>MapBodyMassIndexObservation<span style=\"color: navy\">(</span><span style=\"color: maroon\">src</span><span style=\"color: navy\">, </span><span style=\"color: maroon\">bmiObs</span><span style=\"color: navy\">)</span> <i>&quot;MapBodyMassIndexObservation&quot;</i><span style=\"color: navy\">;</span>\r\n  <span style=\"color: navy\">}</span> <i>&quot;CreateBmiEntry&quot;</i><span style=\"color: navy\">;</span>\r\n<span style=\"color: navy\">}\r\n\r\n</span><b>group </b>SetCommonObservationFields<span style=\"color: navy\">(</span><b>source</b> <span style=\"color: maroon\">src</span><span style=\"color: navy\"> : </span>QR, <b>target</b> <span style=\"color: maroon\">tgt</span><span style=\"color: navy\"> : </span>Obs<span style=\"color: navy\">)</span><span style=\"color: navy\"> {\r\n</span>  src<span style=\"color: navy\"><b> -&gt; </b></span>tgt.status = <span style=\"color: blue\">'final'</span> <i>&quot;setFinalStatus&quot;</i><span style=\"color: navy\">;</span>\r\n  src.subject<b> as </b><span style=\"color: maroon\">subject</span><span style=\"color: navy\"><b> -&gt; </b></span>tgt.subject = <span style=\"color: maroon\">subject</span> <i>&quot;copySubject&quot;</i><span style=\"color: navy\">;</span>\r\n  src.authored<b> as </b><span style=\"color: maroon\">authored</span><span style=\"color: navy\"><b> -&gt; </b></span>tgt.effective = <span style=\"color: maroon\">authored</span> <i>&quot;copyAuthoredToEffective&quot;</i><span style=\"color: navy\">;</span>\r\n  src.authored<b> as </b><span style=\"color: maroon\">authored</span><span style=\"color: navy\"><b> -&gt; </b></span>tgt.issued = <span style=\"color: maroon\">authored</span> <i>&quot;copyAuthoredToIssued&quot;</i><span style=\"color: navy\">;</span>\r\n  src<span style=\"color: navy\"><b> -&gt; </b></span>tgt.method = <b>cc</b><span style=\"color: navy\">(</span><span style=\"color: blue\">'http://snomed.info/sct'</span><span style=\"color: navy\">, </span><span style=\"color: blue\">'87982008'</span><span style=\"color: navy\">, </span><span style=\"color: blue\">'Manual'</span><span style=\"color: navy\">)</span> <i>&quot;setManualMethod&quot;</i><span style=\"color: navy\">;</span>\r\n  src.id<b> as </b><span style=\"color: maroon\">id</span><span style=\"color: navy\"><b> -&gt; </b></span>tgt.derivedFrom = <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\">reference</span><b> then</b><span style=\"color: navy\"> {\r\n</span>    id<span style=\"color: navy\"><b> -&gt; </b></span>reference.reference = <b>append</b><span style=\"color: navy\">(</span><span style=\"color: blue\">'QuestionnaireResponse/'</span><span style=\"color: navy\">, </span><span style=\"color: maroon\">id</span><span style=\"color: navy\">)</span> <i>&quot;setDerivedFromReference&quot;</i><span style=\"color: navy\">;</span>\r\n  <span style=\"color: navy\">}</span> <i>&quot;setDerivedFrom&quot;</i><span style=\"color: navy\">;</span>\r\n<span style=\"color: navy\">}\r\n\r\n</span><b>group </b>MapBodyHeightObservation<span style=\"color: navy\">(</span><b>source</b> <span style=\"color: maroon\">src</span><span style=\"color: navy\"> : </span>QR, <b>target</b> <span style=\"color: maroon\">tgt</span><span style=\"color: navy\"> : </span>Obs<span style=\"color: navy\">)</span><span style=\"color: navy\"> {\r\n</span>  src<b> then </b>SetCommonObservationFields<span style=\"color: navy\">(</span><span style=\"color: maroon\">src</span><span style=\"color: navy\">, </span><span style=\"color: maroon\">tgt</span><span style=\"color: navy\">)</span> <i>&quot;SetCommonFields&quot;</i><span style=\"color: navy\">;</span>\r\n  src<span style=\"color: navy\"><b> -&gt; </b></span> tgt.meta<b> as </b><span style=\"color: maroon\">meta</span><span style=\"color: navy\">, </span> meta.profile = <span style=\"color: blue\">'https://fhir.hl7.at/prenudge/appdata/r4/StructureDefinition/at-prenudge-bodyheight-observation'</span> <i>&quot;SetProfile&quot;</i><span style=\"color: navy\">;</span>\r\n  src<span style=\"color: navy\"><b> -&gt; </b></span>tgt.category = <b>cc</b><span style=\"color: navy\">(</span><span style=\"color: blue\">'http://terminology.hl7.org/CodeSystem/observation-category'</span><span style=\"color: navy\">, </span><span style=\"color: blue\">'vital-signs'</span><span style=\"color: navy\">, </span><span style=\"color: blue\">'Vital Signs'</span><span style=\"color: navy\">)</span> <i>&quot;SetCategory&quot;</i><span style=\"color: navy\">;</span>\r\n  src<span style=\"color: navy\"><b> -&gt; </b></span>tgt.code = <b>cc</b><span style=\"color: navy\">(</span><span style=\"color: blue\">'http://loinc.org'</span><span style=\"color: navy\">, </span><span style=\"color: blue\">'8302-2'</span><span style=\"color: navy\">, </span><span style=\"color: blue\">'Body height'</span><span style=\"color: navy\">)</span> <i>&quot;SetCode&quot;</i><span style=\"color: navy\">;</span>\r\n  src.identifier<b> as </b><span style=\"color: maroon\">identifier</span><span style=\"color: navy\"><b> -&gt; </b></span>tgt.identifier = <b>create</b><span style=\"color: navy\">(</span><span style=\"color: blue\">'Identifier'</span><span style=\"color: navy\">)</span><b> as </b><span style=\"color: maroon\">targetIdentifier</span><b> then</b><span style=\"color: navy\"> {\r\n</span>    identifier.system<b> as </b><span style=\"color: maroon\">system</span><span style=\"color: navy\"><b> -&gt; </b></span>targetIdentifier.system = <span style=\"color: maroon\">system</span> <i>&quot;SetIdentifierSystem&quot;</i><span style=\"color: navy\">;</span>\r\n    identifier.value<b> as </b><span style=\"color: maroon\">value</span><span style=\"color: navy\"><b> -&gt; </b></span>targetIdentifier.value = <b>append</b><span style=\"color: navy\">(</span><span style=\"color: maroon\">value</span><span style=\"color: navy\">, </span><span style=\"color: blue\">'-bodyheight'</span><span style=\"color: navy\">)</span> <i>&quot;SetIdentifierValue&quot;</i><span style=\"color: navy\">;</span>\r\n  <span style=\"color: navy\">}</span> <i>&quot;SetIdentifier&quot;</i><span style=\"color: navy\">;</span>\r\n  src.item<b> as </b><span style=\"color: maroon\">bmiGroup</span><b> where </b>bmiGroup.linkId = 'bmi'<b> then</b><span style=\"color: navy\"> {\r\n</span>    bmiGroup.item<b> as </b><span style=\"color: maroon\">heightItem</span><b> where </b>heightItem.linkId = 'height-cm'<b> then</b><span style=\"color: navy\"> {\r\n</span>      heightItem.answer<b> as </b><span style=\"color: maroon\">answer</span><b> then</b><span style=\"color: navy\"> {\r\n</span>        answer.value<b> as </b><span style=\"color: maroon\">val</span><b> then</b><span style=\"color: navy\"> {\r\n</span>          val.value<b> as </b><span style=\"color: maroon\">numVal</span><span style=\"color: navy\"><b> -&gt; </b></span> tgt.value = <b>create</b><span style=\"color: navy\">(</span><span style=\"color: blue\">'Quantity'</span><span style=\"color: navy\">)</span><b> as </b><span style=\"color: maroon\">qty</span><span style=\"color: navy\">, </span> qty.value = <span style=\"color: maroon\">numVal</span><span style=\"color: navy\">, </span> qty.unit = <span style=\"color: blue\">'cm'</span><span style=\"color: navy\">, </span> qty.system = <span style=\"color: blue\">'http://unitsofmeasure.org'</span><span style=\"color: navy\">, </span> qty.code = <span style=\"color: blue\">'cm'</span> <i>&quot;SetValue&quot;</i><span style=\"color: navy\">;</span>\r\n        <span style=\"color: navy\">}</span> <i>&quot;ExtractPrimitiveValue&quot;</i><span style=\"color: navy\">;</span>\r\n      <span style=\"color: navy\">}</span> <i>&quot;ProcessAnswer&quot;</i><span style=\"color: navy\">;</span>\r\n    <span style=\"color: navy\">}</span> <i>&quot;ProcessHeightItem&quot;</i><span style=\"color: navy\">;</span>\r\n  <span style=\"color: navy\">}</span> <i>&quot;ProcessBmiGroup&quot;</i><span style=\"color: navy\">;</span>\r\n<span style=\"color: navy\">}\r\n\r\n</span><b>group </b>MapBodyWeightObservation<span style=\"color: navy\">(</span><b>source</b> <span style=\"color: maroon\">src</span><span style=\"color: navy\"> : </span>QR, <b>target</b> <span style=\"color: maroon\">tgt</span><span style=\"color: navy\"> : </span>Obs<span style=\"color: navy\">)</span><span style=\"color: navy\"> {\r\n</span>  src<b> then </b>SetCommonObservationFields<span style=\"color: navy\">(</span><span style=\"color: maroon\">src</span><span style=\"color: navy\">, </span><span style=\"color: maroon\">tgt</span><span style=\"color: navy\">)</span> <i>&quot;SetCommonFields&quot;</i><span style=\"color: navy\">;</span>\r\n  src<span style=\"color: navy\"><b> -&gt; </b></span> tgt.meta<b> as </b><span style=\"color: maroon\">meta</span><span style=\"color: navy\">, </span> meta.profile = <span style=\"color: blue\">'https://fhir.hl7.at/prenudge/appdata/r4/StructureDefinition/at-prenudge-bodyweight-observation'</span> <i>&quot;SetProfile&quot;</i><span style=\"color: navy\">;</span>\r\n  src<span style=\"color: navy\"><b> -&gt; </b></span>tgt.category = <b>cc</b><span style=\"color: navy\">(</span><span style=\"color: blue\">'http://terminology.hl7.org/CodeSystem/observation-category'</span><span style=\"color: navy\">, </span><span style=\"color: blue\">'vital-signs'</span><span style=\"color: navy\">, </span><span style=\"color: blue\">'Vital Signs'</span><span style=\"color: navy\">)</span> <i>&quot;SetCategory&quot;</i><span style=\"color: navy\">;</span>\r\n  src<span style=\"color: navy\"><b> -&gt; </b></span>tgt.code = <b>cc</b><span style=\"color: navy\">(</span><span style=\"color: blue\">'http://loinc.org'</span><span style=\"color: navy\">, </span><span style=\"color: blue\">'29463-7'</span><span style=\"color: navy\">, </span><span style=\"color: blue\">'Body weight'</span><span style=\"color: navy\">)</span> <i>&quot;SetCode&quot;</i><span style=\"color: navy\">;</span>\r\n  src.identifier<b> as </b><span style=\"color: maroon\">identifier</span><span style=\"color: navy\"><b> -&gt; </b></span>tgt.identifier = <b>create</b><span style=\"color: navy\">(</span><span style=\"color: blue\">'Identifier'</span><span style=\"color: navy\">)</span><b> as </b><span style=\"color: maroon\">targetIdentifier</span><b> then</b><span style=\"color: navy\"> {\r\n</span>    identifier.system<b> as </b><span style=\"color: maroon\">system</span><span style=\"color: navy\"><b> -&gt; </b></span>targetIdentifier.system = <span style=\"color: maroon\">system</span> <i>&quot;SetIdentifierSystem&quot;</i><span style=\"color: navy\">;</span>\r\n    identifier.value<b> as </b><span style=\"color: maroon\">value</span><span style=\"color: navy\"><b> -&gt; </b></span>targetIdentifier.value = <b>append</b><span style=\"color: navy\">(</span><span style=\"color: maroon\">value</span><span style=\"color: navy\">, </span><span style=\"color: blue\">'-bodyweight'</span><span style=\"color: navy\">)</span> <i>&quot;SetIdentifierValue&quot;</i><span style=\"color: navy\">;</span>\r\n  <span style=\"color: navy\">}</span> <i>&quot;SetIdentifier&quot;</i><span style=\"color: navy\">;</span>\r\n  src.item<b> as </b><span style=\"color: maroon\">bmiGroup</span><b> where </b>bmiGroup.linkId = 'bmi'<b> then</b><span style=\"color: navy\"> {\r\n</span>    bmiGroup.item<b> as </b><span style=\"color: maroon\">weightItem</span><b> where </b>weightItem.linkId = 'weight-kg'<b> then</b><span style=\"color: navy\"> {\r\n</span>      weightItem.answer<b> as </b><span style=\"color: maroon\">answer</span><b> then</b><span style=\"color: navy\"> {\r\n</span>        answer.value<b> as </b><span style=\"color: maroon\">val</span><b> then</b><span style=\"color: navy\"> {\r\n</span>          val.value<b> as </b><span style=\"color: maroon\">numVal</span><span style=\"color: navy\"><b> -&gt; </b></span> tgt.value = <b>create</b><span style=\"color: navy\">(</span><span style=\"color: blue\">'Quantity'</span><span style=\"color: navy\">)</span><b> as </b><span style=\"color: maroon\">qty</span><span style=\"color: navy\">, </span> qty.value = <span style=\"color: maroon\">numVal</span><span style=\"color: navy\">, </span> qty.unit = <span style=\"color: blue\">'kg'</span><span style=\"color: navy\">, </span> qty.system = <span style=\"color: blue\">'http://unitsofmeasure.org'</span><span style=\"color: navy\">, </span> qty.code = <span style=\"color: blue\">'kg'</span> <i>&quot;SetValue&quot;</i><span style=\"color: navy\">;</span>\r\n        <span style=\"color: navy\">}</span> <i>&quot;ExtractPrimitiveValue&quot;</i><span style=\"color: navy\">;</span>\r\n      <span style=\"color: navy\">}</span> <i>&quot;ProcessAnswer&quot;</i><span style=\"color: navy\">;</span>\r\n    <span style=\"color: navy\">}</span> <i>&quot;ProcessWeightItem&quot;</i><span style=\"color: navy\">;</span>\r\n  <span style=\"color: navy\">}</span> <i>&quot;ProcessBmiGroup&quot;</i><span style=\"color: navy\">;</span>\r\n<span style=\"color: navy\">}\r\n\r\n</span><b>group </b>MapBodyMassIndexObservation<span style=\"color: navy\">(</span><b>source</b> <span style=\"color: maroon\">src</span><span style=\"color: navy\"> : </span>QR, <b>target</b> <span style=\"color: maroon\">tgt</span><span style=\"color: navy\"> : </span>Obs<span style=\"color: navy\">)</span><span style=\"color: navy\"> {\r\n</span>  src<b> then </b>SetCommonObservationFields<span style=\"color: navy\">(</span><span style=\"color: maroon\">src</span><span style=\"color: navy\">, </span><span style=\"color: maroon\">tgt</span><span style=\"color: navy\">)</span> <i>&quot;SetCommonFields&quot;</i><span style=\"color: navy\">;</span>\r\n  src<span style=\"color: navy\"><b> -&gt; </b></span> tgt.meta<b> as </b><span style=\"color: maroon\">meta</span><span style=\"color: navy\">, </span> meta.profile = <span style=\"color: blue\">'https://fhir.hl7.at/prenudge/appdata/r4/StructureDefinition/at-prenudge-bmi-observation'</span> <i>&quot;SetProfile&quot;</i><span style=\"color: navy\">;</span>\r\n  src<span style=\"color: navy\"><b> -&gt; </b></span>tgt.category = <b>cc</b><span style=\"color: navy\">(</span><span style=\"color: blue\">'http://terminology.hl7.org/CodeSystem/observation-category'</span><span style=\"color: navy\">, </span><span style=\"color: blue\">'vital-signs'</span><span style=\"color: navy\">, </span><span style=\"color: blue\">'Vital Signs'</span><span style=\"color: navy\">)</span> <i>&quot;SetCategory&quot;</i><span style=\"color: navy\">;</span>\r\n  src<span style=\"color: navy\"><b> -&gt; </b></span>tgt.code = <b>cc</b><span style=\"color: navy\">(</span><span style=\"color: blue\">'http://loinc.org'</span><span style=\"color: navy\">, </span><span style=\"color: blue\">'39156-5'</span><span style=\"color: navy\">, </span><span style=\"color: blue\">'Body mass index (BMI) [Ratio]'</span><span style=\"color: navy\">)</span> <i>&quot;SetCode&quot;</i><span style=\"color: navy\">;</span>\r\n  src.identifier<b> as </b><span style=\"color: maroon\">identifier</span><span style=\"color: navy\"><b> -&gt; </b></span>tgt.identifier = <b>create</b><span style=\"color: navy\">(</span><span style=\"color: blue\">'Identifier'</span><span style=\"color: navy\">)</span><b> as </b><span style=\"color: maroon\">targetIdentifier</span><b> then</b><span style=\"color: navy\"> {\r\n</span>    identifier.system<b> as </b><span style=\"color: maroon\">system</span><span style=\"color: navy\"><b> -&gt; </b></span>targetIdentifier.system = <span style=\"color: maroon\">system</span> <i>&quot;SetIdentifierSystem&quot;</i><span style=\"color: navy\">;</span>\r\n    identifier.value<b> as </b><span style=\"color: maroon\">value</span><span style=\"color: navy\"><b> -&gt; </b></span>targetIdentifier.value = <b>append</b><span style=\"color: navy\">(</span><span style=\"color: maroon\">value</span><span style=\"color: navy\">, </span><span style=\"color: blue\">'-bmi'</span><span style=\"color: navy\">)</span> <i>&quot;SetIdentifierValue&quot;</i><span style=\"color: navy\">;</span>\r\n  <span style=\"color: navy\">}</span> <i>&quot;SetIdentifier&quot;</i><span style=\"color: navy\">;</span>\r\n  src.item<b> as </b><span style=\"color: maroon\">bmiGroup</span><b> where </b>bmiGroup.linkId = 'bmi'<b> then</b><span style=\"color: navy\"> {\r\n</span>    bmiGroup.item<b> as </b><span style=\"color: maroon\">bmiItem</span><b> where </b>bmiItem.linkId = 'bmi-kg-m2'<b> then</b><span style=\"color: navy\"> {\r\n</span>      bmiItem.answer<b> as </b><span style=\"color: maroon\">answer</span><b> then</b><span style=\"color: navy\"> {\r\n</span>        answer.value<b> as </b><span style=\"color: maroon\">val</span><b> then</b><span style=\"color: navy\"> {\r\n</span>          val.value<b> as </b><span style=\"color: maroon\">numVal</span><span style=\"color: navy\"><b> -&gt; </b></span> tgt.value = <b>create</b><span style=\"color: navy\">(</span><span style=\"color: blue\">'Quantity'</span><span style=\"color: navy\">)</span><b> as </b><span style=\"color: maroon\">qty</span><span style=\"color: navy\">, </span> qty.value = <span style=\"color: maroon\">numVal</span><span style=\"color: navy\">, </span> qty.unit = <span style=\"color: blue\">'kg/m2'</span><span style=\"color: navy\">, </span> qty.system = <span style=\"color: blue\">'http://unitsofmeasure.org'</span><span style=\"color: navy\">, </span> qty.code = <span style=\"color: blue\">'kg/m2'</span> <i>&quot;SetValue&quot;</i><span style=\"color: navy\">;</span>\r\n        <span style=\"color: navy\">}</span> <i>&quot;ExtractPrimitiveValue&quot;</i><span style=\"color: navy\">;</span>\r\n      <span style=\"color: navy\">}</span> <i>&quot;ProcessAnswer&quot;</i><span style=\"color: navy\">;</span>\r\n    <span style=\"color: navy\">}</span> <i>&quot;ProcessBmiItem&quot;</i><span style=\"color: navy\">;</span>\r\n  <span style=\"color: navy\">}</span> <i>&quot;ProcessBmiGroup&quot;</i><span style=\"color: navy\">;</span>\r\n<span style=\"color: navy\">}\r\n\r\n</span></pre></div>"
      },
      "url" : "https://fhir.hl7.at/prenudge/appdata/r4/StructureMap/BmiQuestionnaireResponseToObservations",
      "version" : "0.1.0",
      "name" : "BmiQuestionnaireResponseToObservations",
      "title" : "BMI Q to Body Height, Body Weight and BMI Observations Bundle",
      "status" : "active",
      "date" : "2026-06-25T12:51:02+00:00",
      "publisher" : "The PreNUDGE Consortium",
      "contact" : [
        {
          "name" : "The PreNUDGE Consortium",
          "telecom" : [
            {
              "system" : "url",
              "value" : "https://prenudge.at"
            }
          ]
        },
        {
          "name" : "The PreNUDGE Consortium",
          "telecom" : [
            {
              "system" : "url",
              "value" : "https://prenudge.at",
              "use" : "work"
            }
          ]
        }
      ],
      "description" : "BMI Q to Body Height, Body Weight and BMI Observations Bundle",
      "structure" : [
        {
          "url" : "http://hl7.org/fhir/StructureDefinition/QuestionnaireResponse",
          "mode" : "source",
          "alias" : "QR"
        },
        {
          "url" : "http://hl7.org/fhir/StructureDefinition/Bundle",
          "mode" : "target",
          "alias" : "Bundle"
        },
        {
          "url" : "http://hl7.org/fhir/StructureDefinition/Observation",
          "mode" : "target",
          "alias" : "Obs"
        }
      ],
      "group" : [
        {
          "name" : "BmiQuestionnaireResponseToObservations",
          "typeMode" : "none",
          "input" : [
            {
              "name" : "src",
              "type" : "QR",
              "mode" : "source"
            },
            {
              "name" : "tgt",
              "type" : "Bundle",
              "mode" : "target"
            }
          ],
          "rule" : [
            {
              "name" : "SetBundleType",
              "source" : [
                {
                  "context" : "src"
                }
              ],
              "target" : [
                {
                  "context" : "tgt",
                  "contextType" : "variable",
                  "element" : "type",
                  "transform" : "copy",
                  "parameter" : [
                    {
                      "valueString" : "collection"
                    }
                  ]
                }
              ]
            },
            {
              "name" : "CreateBodyHeightEntry",
              "source" : [
                {
                  "context" : "src"
                }
              ],
              "target" : [
                {
                  "context" : "tgt",
                  "contextType" : "variable",
                  "element" : "entry",
                  "variable" : "heightEntry"
                },
                {
                  "context" : "heightEntry",
                  "contextType" : "variable",
                  "element" : "resource",
                  "variable" : "heightObs",
                  "transform" : "create",
                  "parameter" : [
                    {
                      "valueString" : "Observation"
                    }
                  ]
                }
              ],
              "rule" : [
                {
                  "name" : "MapBodyHeightObservation",
                  "source" : [
                    {
                      "context" : "src"
                    }
                  ],
                  "dependent" : [
                    {
                      "name" : "MapBodyHeightObservation",
                      "variable" : [
                        "src",
                        "heightObs"
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "name" : "CreateBodyWeightEntry",
              "source" : [
                {
                  "context" : "src"
                }
              ],
              "target" : [
                {
                  "context" : "tgt",
                  "contextType" : "variable",
                  "element" : "entry",
                  "variable" : "weightEntry"
                },
                {
                  "context" : "weightEntry",
                  "contextType" : "variable",
                  "element" : "resource",
                  "variable" : "weightObs",
                  "transform" : "create",
                  "parameter" : [
                    {
                      "valueString" : "Observation"
                    }
                  ]
                }
              ],
              "rule" : [
                {
                  "name" : "MapBodyWeightObservation",
                  "source" : [
                    {
                      "context" : "src"
                    }
                  ],
                  "dependent" : [
                    {
                      "name" : "MapBodyWeightObservation",
                      "variable" : [
                        "src",
                        "weightObs"
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "name" : "CreateBmiEntry",
              "source" : [
                {
                  "context" : "src"
                }
              ],
              "target" : [
                {
                  "context" : "tgt",
                  "contextType" : "variable",
                  "element" : "entry",
                  "variable" : "bmiEntry"
                },
                {
                  "context" : "bmiEntry",
                  "contextType" : "variable",
                  "element" : "resource",
                  "variable" : "bmiObs",
                  "transform" : "create",
                  "parameter" : [
                    {
                      "valueString" : "Observation"
                    }
                  ]
                }
              ],
              "rule" : [
                {
                  "name" : "MapBodyMassIndexObservation",
                  "source" : [
                    {
                      "context" : "src"
                    }
                  ],
                  "dependent" : [
                    {
                      "name" : "MapBodyMassIndexObservation",
                      "variable" : [
                        "src",
                        "bmiObs"
                      ]
                    }
                  ]
                }
              ]
            }
          ]
        },
        {
          "name" : "SetCommonObservationFields",
          "typeMode" : "none",
          "input" : [
            {
              "name" : "src",
              "type" : "QR",
              "mode" : "source"
            },
            {
              "name" : "tgt",
              "type" : "Obs",
              "mode" : "target"
            }
          ],
          "rule" : [
            {
              "name" : "setFinalStatus",
              "source" : [
                {
                  "context" : "src"
                }
              ],
              "target" : [
                {
                  "context" : "tgt",
                  "contextType" : "variable",
                  "element" : "status",
                  "transform" : "copy",
                  "parameter" : [
                    {
                      "valueString" : "final"
                    }
                  ]
                }
              ]
            },
            {
              "name" : "copySubject",
              "source" : [
                {
                  "context" : "src",
                  "element" : "subject",
                  "variable" : "subject"
                }
              ],
              "target" : [
                {
                  "context" : "tgt",
                  "contextType" : "variable",
                  "element" : "subject",
                  "transform" : "copy",
                  "parameter" : [
                    {
                      "valueId" : "subject"
                    }
                  ]
                }
              ]
            },
            {
              "name" : "copyAuthoredToEffective",
              "source" : [
                {
                  "context" : "src",
                  "element" : "authored",
                  "variable" : "authored"
                }
              ],
              "target" : [
                {
                  "context" : "tgt",
                  "contextType" : "variable",
                  "element" : "effective",
                  "transform" : "copy",
                  "parameter" : [
                    {
                      "valueId" : "authored"
                    }
                  ]
                }
              ]
            },
            {
              "name" : "copyAuthoredToIssued",
              "source" : [
                {
                  "context" : "src",
                  "element" : "authored",
                  "variable" : "authored"
                }
              ],
              "target" : [
                {
                  "context" : "tgt",
                  "contextType" : "variable",
                  "element" : "issued",
                  "transform" : "copy",
                  "parameter" : [
                    {
                      "valueId" : "authored"
                    }
                  ]
                }
              ]
            },
            {
              "name" : "setManualMethod",
              "source" : [
                {
                  "context" : "src"
                }
              ],
              "target" : [
                {
                  "context" : "tgt",
                  "contextType" : "variable",
                  "element" : "method",
                  "transform" : "cc",
                  "parameter" : [
                    {
                      "valueString" : "http://snomed.info/sct"
                    },
                    {
                      "valueString" : "87982008"
                    },
                    {
                      "valueString" : "Manual"
                    }
                  ]
                }
              ]
            },
            {
              "name" : "setDerivedFrom",
              "source" : [
                {
                  "context" : "src",
                  "element" : "id",
                  "variable" : "id"
                }
              ],
              "target" : [
                {
                  "context" : "tgt",
                  "contextType" : "variable",
                  "element" : "derivedFrom",
                  "variable" : "reference",
                  "transform" : "create",
                  "parameter" : [
                    {
                      "valueString" : "Reference"
                    }
                  ]
                }
              ],
              "rule" : [
                {
                  "name" : "setDerivedFromReference",
                  "source" : [
                    {
                      "context" : "id"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "reference",
                      "contextType" : "variable",
                      "element" : "reference",
                      "transform" : "append",
                      "parameter" : [
                        {
                          "valueString" : "QuestionnaireResponse/"
                        },
                        {
                          "valueId" : "id"
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ]
        },
        {
          "name" : "MapBodyHeightObservation",
          "typeMode" : "none",
          "input" : [
            {
              "name" : "src",
              "type" : "QR",
              "mode" : "source"
            },
            {
              "name" : "tgt",
              "type" : "Obs",
              "mode" : "target"
            }
          ],
          "rule" : [
            {
              "name" : "SetCommonFields",
              "source" : [
                {
                  "context" : "src"
                }
              ],
              "dependent" : [
                {
                  "name" : "SetCommonObservationFields",
                  "variable" : [
                    "src",
                    "tgt"
                  ]
                }
              ]
            },
            {
              "name" : "SetProfile",
              "source" : [
                {
                  "context" : "src"
                }
              ],
              "target" : [
                {
                  "context" : "tgt",
                  "contextType" : "variable",
                  "element" : "meta",
                  "variable" : "meta"
                },
                {
                  "context" : "meta",
                  "contextType" : "variable",
                  "element" : "profile",
                  "transform" : "copy",
                  "parameter" : [
                    {
                      "valueString" : "https://fhir.hl7.at/prenudge/appdata/r4/StructureDefinition/at-prenudge-bodyheight-observation"
                    }
                  ]
                }
              ]
            },
            {
              "name" : "SetCategory",
              "source" : [
                {
                  "context" : "src"
                }
              ],
              "target" : [
                {
                  "context" : "tgt",
                  "contextType" : "variable",
                  "element" : "category",
                  "transform" : "cc",
                  "parameter" : [
                    {
                      "valueString" : "http://terminology.hl7.org/CodeSystem/observation-category"
                    },
                    {
                      "valueString" : "vital-signs"
                    },
                    {
                      "valueString" : "Vital Signs"
                    }
                  ]
                }
              ]
            },
            {
              "name" : "SetCode",
              "source" : [
                {
                  "context" : "src"
                }
              ],
              "target" : [
                {
                  "context" : "tgt",
                  "contextType" : "variable",
                  "element" : "code",
                  "transform" : "cc",
                  "parameter" : [
                    {
                      "valueString" : "http://loinc.org"
                    },
                    {
                      "valueString" : "8302-2"
                    },
                    {
                      "valueString" : "Body height"
                    }
                  ]
                }
              ]
            },
            {
              "name" : "SetIdentifier",
              "source" : [
                {
                  "context" : "src",
                  "element" : "identifier",
                  "variable" : "identifier"
                }
              ],
              "target" : [
                {
                  "context" : "tgt",
                  "contextType" : "variable",
                  "element" : "identifier",
                  "variable" : "targetIdentifier",
                  "transform" : "create",
                  "parameter" : [
                    {
                      "valueString" : "Identifier"
                    }
                  ]
                }
              ],
              "rule" : [
                {
                  "name" : "SetIdentifierSystem",
                  "source" : [
                    {
                      "context" : "identifier",
                      "element" : "system",
                      "variable" : "system"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "targetIdentifier",
                      "contextType" : "variable",
                      "element" : "system",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueId" : "system"
                        }
                      ]
                    }
                  ]
                },
                {
                  "name" : "SetIdentifierValue",
                  "source" : [
                    {
                      "context" : "identifier",
                      "element" : "value",
                      "variable" : "value"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "targetIdentifier",
                      "contextType" : "variable",
                      "element" : "value",
                      "transform" : "append",
                      "parameter" : [
                        {
                          "valueId" : "value"
                        },
                        {
                          "valueString" : "-bodyheight"
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "name" : "ProcessBmiGroup",
              "source" : [
                {
                  "context" : "src",
                  "element" : "item",
                  "variable" : "bmiGroup",
                  "condition" : "bmiGroup.linkId = 'bmi'"
                }
              ],
              "rule" : [
                {
                  "name" : "ProcessHeightItem",
                  "source" : [
                    {
                      "context" : "bmiGroup",
                      "element" : "item",
                      "variable" : "heightItem",
                      "condition" : "heightItem.linkId = 'height-cm'"
                    }
                  ],
                  "rule" : [
                    {
                      "name" : "ProcessAnswer",
                      "source" : [
                        {
                          "context" : "heightItem",
                          "element" : "answer",
                          "variable" : "answer"
                        }
                      ],
                      "rule" : [
                        {
                          "name" : "ExtractPrimitiveValue",
                          "source" : [
                            {
                              "context" : "answer",
                              "element" : "value",
                              "variable" : "val"
                            }
                          ],
                          "rule" : [
                            {
                              "name" : "SetValue",
                              "source" : [
                                {
                                  "context" : "val",
                                  "element" : "value",
                                  "variable" : "numVal"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "tgt",
                                  "contextType" : "variable",
                                  "element" : "value",
                                  "variable" : "qty",
                                  "transform" : "create",
                                  "parameter" : [
                                    {
                                      "valueString" : "Quantity"
                                    }
                                  ]
                                },
                                {
                                  "context" : "qty",
                                  "contextType" : "variable",
                                  "element" : "value",
                                  "transform" : "copy",
                                  "parameter" : [
                                    {
                                      "valueId" : "numVal"
                                    }
                                  ]
                                },
                                {
                                  "context" : "qty",
                                  "contextType" : "variable",
                                  "element" : "unit",
                                  "transform" : "copy",
                                  "parameter" : [
                                    {
                                      "valueString" : "cm"
                                    }
                                  ]
                                },
                                {
                                  "context" : "qty",
                                  "contextType" : "variable",
                                  "element" : "system",
                                  "transform" : "copy",
                                  "parameter" : [
                                    {
                                      "valueString" : "http://unitsofmeasure.org"
                                    }
                                  ]
                                },
                                {
                                  "context" : "qty",
                                  "contextType" : "variable",
                                  "element" : "code",
                                  "transform" : "copy",
                                  "parameter" : [
                                    {
                                      "valueString" : "cm"
                                    }
                                  ]
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ]
        },
        {
          "name" : "MapBodyWeightObservation",
          "typeMode" : "none",
          "input" : [
            {
              "name" : "src",
              "type" : "QR",
              "mode" : "source"
            },
            {
              "name" : "tgt",
              "type" : "Obs",
              "mode" : "target"
            }
          ],
          "rule" : [
            {
              "name" : "SetCommonFields",
              "source" : [
                {
                  "context" : "src"
                }
              ],
              "dependent" : [
                {
                  "name" : "SetCommonObservationFields",
                  "variable" : [
                    "src",
                    "tgt"
                  ]
                }
              ]
            },
            {
              "name" : "SetProfile",
              "source" : [
                {
                  "context" : "src"
                }
              ],
              "target" : [
                {
                  "context" : "tgt",
                  "contextType" : "variable",
                  "element" : "meta",
                  "variable" : "meta"
                },
                {
                  "context" : "meta",
                  "contextType" : "variable",
                  "element" : "profile",
                  "transform" : "copy",
                  "parameter" : [
                    {
                      "valueString" : "https://fhir.hl7.at/prenudge/appdata/r4/StructureDefinition/at-prenudge-bodyweight-observation"
                    }
                  ]
                }
              ]
            },
            {
              "name" : "SetCategory",
              "source" : [
                {
                  "context" : "src"
                }
              ],
              "target" : [
                {
                  "context" : "tgt",
                  "contextType" : "variable",
                  "element" : "category",
                  "transform" : "cc",
                  "parameter" : [
                    {
                      "valueString" : "http://terminology.hl7.org/CodeSystem/observation-category"
                    },
                    {
                      "valueString" : "vital-signs"
                    },
                    {
                      "valueString" : "Vital Signs"
                    }
                  ]
                }
              ]
            },
            {
              "name" : "SetCode",
              "source" : [
                {
                  "context" : "src"
                }
              ],
              "target" : [
                {
                  "context" : "tgt",
                  "contextType" : "variable",
                  "element" : "code",
                  "transform" : "cc",
                  "parameter" : [
                    {
                      "valueString" : "http://loinc.org"
                    },
                    {
                      "valueString" : "29463-7"
                    },
                    {
                      "valueString" : "Body weight"
                    }
                  ]
                }
              ]
            },
            {
              "name" : "SetIdentifier",
              "source" : [
                {
                  "context" : "src",
                  "element" : "identifier",
                  "variable" : "identifier"
                }
              ],
              "target" : [
                {
                  "context" : "tgt",
                  "contextType" : "variable",
                  "element" : "identifier",
                  "variable" : "targetIdentifier",
                  "transform" : "create",
                  "parameter" : [
                    {
                      "valueString" : "Identifier"
                    }
                  ]
                }
              ],
              "rule" : [
                {
                  "name" : "SetIdentifierSystem",
                  "source" : [
                    {
                      "context" : "identifier",
                      "element" : "system",
                      "variable" : "system"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "targetIdentifier",
                      "contextType" : "variable",
                      "element" : "system",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueId" : "system"
                        }
                      ]
                    }
                  ]
                },
                {
                  "name" : "SetIdentifierValue",
                  "source" : [
                    {
                      "context" : "identifier",
                      "element" : "value",
                      "variable" : "value"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "targetIdentifier",
                      "contextType" : "variable",
                      "element" : "value",
                      "transform" : "append",
                      "parameter" : [
                        {
                          "valueId" : "value"
                        },
                        {
                          "valueString" : "-bodyweight"
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "name" : "ProcessBmiGroup",
              "source" : [
                {
                  "context" : "src",
                  "element" : "item",
                  "variable" : "bmiGroup",
                  "condition" : "bmiGroup.linkId = 'bmi'"
                }
              ],
              "rule" : [
                {
                  "name" : "ProcessWeightItem",
                  "source" : [
                    {
                      "context" : "bmiGroup",
                      "element" : "item",
                      "variable" : "weightItem",
                      "condition" : "weightItem.linkId = 'weight-kg'"
                    }
                  ],
                  "rule" : [
                    {
                      "name" : "ProcessAnswer",
                      "source" : [
                        {
                          "context" : "weightItem",
                          "element" : "answer",
                          "variable" : "answer"
                        }
                      ],
                      "rule" : [
                        {
                          "name" : "ExtractPrimitiveValue",
                          "source" : [
                            {
                              "context" : "answer",
                              "element" : "value",
                              "variable" : "val"
                            }
                          ],
                          "rule" : [
                            {
                              "name" : "SetValue",
                              "source" : [
                                {
                                  "context" : "val",
                                  "element" : "value",
                                  "variable" : "numVal"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "tgt",
                                  "contextType" : "variable",
                                  "element" : "value",
                                  "variable" : "qty",
                                  "transform" : "create",
                                  "parameter" : [
                                    {
                                      "valueString" : "Quantity"
                                    }
                                  ]
                                },
                                {
                                  "context" : "qty",
                                  "contextType" : "variable",
                                  "element" : "value",
                                  "transform" : "copy",
                                  "parameter" : [
                                    {
                                      "valueId" : "numVal"
                                    }
                                  ]
                                },
                                {
                                  "context" : "qty",
                                  "contextType" : "variable",
                                  "element" : "unit",
                                  "transform" : "copy",
                                  "parameter" : [
                                    {
                                      "valueString" : "kg"
                                    }
                                  ]
                                },
                                {
                                  "context" : "qty",
                                  "contextType" : "variable",
                                  "element" : "system",
                                  "transform" : "copy",
                                  "parameter" : [
                                    {
                                      "valueString" : "http://unitsofmeasure.org"
                                    }
                                  ]
                                },
                                {
                                  "context" : "qty",
                                  "contextType" : "variable",
                                  "element" : "code",
                                  "transform" : "copy",
                                  "parameter" : [
                                    {
                                      "valueString" : "kg"
                                    }
                                  ]
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ]
        },
        {
          "name" : "MapBodyMassIndexObservation",
          "typeMode" : "none",
          "input" : [
            {
              "name" : "src",
              "type" : "QR",
              "mode" : "source"
            },
            {
              "name" : "tgt",
              "type" : "Obs",
              "mode" : "target"
            }
          ],
          "rule" : [
            {
              "name" : "SetCommonFields",
              "source" : [
                {
                  "context" : "src"
                }
              ],
              "dependent" : [
                {
                  "name" : "SetCommonObservationFields",
                  "variable" : [
                    "src",
                    "tgt"
                  ]
                }
              ]
            },
            {
              "name" : "SetProfile",
              "source" : [
                {
                  "context" : "src"
                }
              ],
              "target" : [
                {
                  "context" : "tgt",
                  "contextType" : "variable",
                  "element" : "meta",
                  "variable" : "meta"
                },
                {
                  "context" : "meta",
                  "contextType" : "variable",
                  "element" : "profile",
                  "transform" : "copy",
                  "parameter" : [
                    {
                      "valueString" : "https://fhir.hl7.at/prenudge/appdata/r4/StructureDefinition/at-prenudge-bmi-observation"
                    }
                  ]
                }
              ]
            },
            {
              "name" : "SetCategory",
              "source" : [
                {
                  "context" : "src"
                }
              ],
              "target" : [
                {
                  "context" : "tgt",
                  "contextType" : "variable",
                  "element" : "category",
                  "transform" : "cc",
                  "parameter" : [
                    {
                      "valueString" : "http://terminology.hl7.org/CodeSystem/observation-category"
                    },
                    {
                      "valueString" : "vital-signs"
                    },
                    {
                      "valueString" : "Vital Signs"
                    }
                  ]
                }
              ]
            },
            {
              "name" : "SetCode",
              "source" : [
                {
                  "context" : "src"
                }
              ],
              "target" : [
                {
                  "context" : "tgt",
                  "contextType" : "variable",
                  "element" : "code",
                  "transform" : "cc",
                  "parameter" : [
                    {
                      "valueString" : "http://loinc.org"
                    },
                    {
                      "valueString" : "39156-5"
                    },
                    {
                      "valueString" : "Body mass index (BMI) [Ratio]"
                    }
                  ]
                }
              ]
            },
            {
              "name" : "SetIdentifier",
              "source" : [
                {
                  "context" : "src",
                  "element" : "identifier",
                  "variable" : "identifier"
                }
              ],
              "target" : [
                {
                  "context" : "tgt",
                  "contextType" : "variable",
                  "element" : "identifier",
                  "variable" : "targetIdentifier",
                  "transform" : "create",
                  "parameter" : [
                    {
                      "valueString" : "Identifier"
                    }
                  ]
                }
              ],
              "rule" : [
                {
                  "name" : "SetIdentifierSystem",
                  "source" : [
                    {
                      "context" : "identifier",
                      "element" : "system",
                      "variable" : "system"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "targetIdentifier",
                      "contextType" : "variable",
                      "element" : "system",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueId" : "system"
                        }
                      ]
                    }
                  ]
                },
                {
                  "name" : "SetIdentifierValue",
                  "source" : [
                    {
                      "context" : "identifier",
                      "element" : "value",
                      "variable" : "value"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "targetIdentifier",
                      "contextType" : "variable",
                      "element" : "value",
                      "transform" : "append",
                      "parameter" : [
                        {
                          "valueId" : "value"
                        },
                        {
                          "valueString" : "-bmi"
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "name" : "ProcessBmiGroup",
              "source" : [
                {
                  "context" : "src",
                  "element" : "item",
                  "variable" : "bmiGroup",
                  "condition" : "bmiGroup.linkId = 'bmi'"
                }
              ],
              "rule" : [
                {
                  "name" : "ProcessBmiItem",
                  "source" : [
                    {
                      "context" : "bmiGroup",
                      "element" : "item",
                      "variable" : "bmiItem",
                      "condition" : "bmiItem.linkId = 'bmi-kg-m2'"
                    }
                  ],
                  "rule" : [
                    {
                      "name" : "ProcessAnswer",
                      "source" : [
                        {
                          "context" : "bmiItem",
                          "element" : "answer",
                          "variable" : "answer"
                        }
                      ],
                      "rule" : [
                        {
                          "name" : "ExtractPrimitiveValue",
                          "source" : [
                            {
                              "context" : "answer",
                              "element" : "value",
                              "variable" : "val"
                            }
                          ],
                          "rule" : [
                            {
                              "name" : "SetValue",
                              "source" : [
                                {
                                  "context" : "val",
                                  "element" : "value",
                                  "variable" : "numVal"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "tgt",
                                  "contextType" : "variable",
                                  "element" : "value",
                                  "variable" : "qty",
                                  "transform" : "create",
                                  "parameter" : [
                                    {
                                      "valueString" : "Quantity"
                                    }
                                  ]
                                },
                                {
                                  "context" : "qty",
                                  "contextType" : "variable",
                                  "element" : "value",
                                  "transform" : "copy",
                                  "parameter" : [
                                    {
                                      "valueId" : "numVal"
                                    }
                                  ]
                                },
                                {
                                  "context" : "qty",
                                  "contextType" : "variable",
                                  "element" : "unit",
                                  "transform" : "copy",
                                  "parameter" : [
                                    {
                                      "valueString" : "kg/m2"
                                    }
                                  ]
                                },
                                {
                                  "context" : "qty",
                                  "contextType" : "variable",
                                  "element" : "system",
                                  "transform" : "copy",
                                  "parameter" : [
                                    {
                                      "valueString" : "http://unitsofmeasure.org"
                                    }
                                  ]
                                },
                                {
                                  "context" : "qty",
                                  "contextType" : "variable",
                                  "element" : "code",
                                  "transform" : "copy",
                                  "parameter" : [
                                    {
                                      "valueString" : "kg/m2"
                                    }
                                  ]
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ]
        }
      ]
    }