German Practice Management FHIR Profiles (R4)
0.90.0 - STU1 Germany

German Practice Management FHIR Profiles (R4) - Local Development build (v0.90.0) built by the FHIR (HL7® FHIR® Standard) Build Tools. See the Directory of published versions

: Upper-arm injection Job StructureMap (example) - XML Representation

Active as of 2026-07-29

Raw xml | Download


<StructureMap xmlns="http://hl7.org/fhir">
  <id value="map-upper-arm-injection"/>
  <text>
    <status value="generated"/>
    <div xmlns="http://www.w3.org/1999/xhtml"><p class="res-header-id"><b>Generated Narrative: StructureMap map-upper-arm-injection</b></p><a name="map-upper-arm-injection"> </a><a name="hcmap-upper-arm-injection"> </a><pre class="fml">
<b>map</b><span style="color: navy"> &quot;</span>https://fhir.cognovis.de/praxis/StructureMap/map-upper-arm-injection<span style="color: navy">&quot; = &quot;</span>MapUpperArmInjection<span style="color: navy">&quot;

</span><span style="color: navy">// </span><span style="color: green">EXAMPLE-ONLY worked StructureMap for the upper-arm injection Job (GOÄ 252). Not a curated production binding discovery artifact. Executed by the bounded R4 StructureMap rule-tree interpreter. Composition/Condition/Observation/Procedure/ChargeItem candidates. QR.subject/.encounter/.author/.authored supply Composition context (never fabricated). ChargeItem.code is Job-fixed GOÄ 252 (http://fhir.de/CodeSystem/bäk/goä#252); definitionCanonical from cid.primary answer.valueUri only. Procedure carries instantiatesCanonical to the Job; basedOn only when a real ServiceRequest exists (separate fixture, not this map). Binding identity: (job-upper-arm-injection|0.90.0, q-upper-arm-injection|0.90.0, map-upper-arm-injection|0.90.0).</span>

<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>
<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>

<span style="color: navy">// </span><span style="color: green">Bind QuestionnaireResponse.subject/.encounter/.author/.authored (standard QR fields; not duplicated Questionnaire items), then invoke fillCondition / fillDocumentation / fillProcedure / fillChargeItems / fillComposition.</span>
<b>group </b>main<span style="color: navy">(</span><b>source</b> <span style="color: maroon">qr</span><span style="color: navy"> : </span>QuestionnaireResponse, <b>target</b> <span style="color: maroon">bundle</span><span style="color: navy"> : </span>Bundle<span style="color: navy">)</span><span style="color: navy"> {
</span>  qr<span style="color: navy"><b> -&gt; </b></span>bundle.type = <span style="color: blue">'collection'</span> <i>&quot;bundleType&quot;</i><span style="color: navy">;</span>
  qr.subject<b> as </b><span style="color: maroon">subjectRef</span><b> then</b><span style="color: navy"> {
</span>    qr.encounter<b> as </b><span style="color: maroon">encRef</span><b> then</b><span style="color: navy"> {
</span>      qr.author<b> as </b><span style="color: maroon">authorRef</span><b> then</b><span style="color: navy"> {
</span>        qr.authored<b> as </b><span style="color: maroon">authoredDt</span><b> then</b><span style="color: navy"> {
</span>          qr.item<b> as </b><span style="color: maroon">diagCodingItem</span><b> where </b><span style="color: navy">(</span>linkId = 'diag.icd'<span style="color: navy">)</span><b> then </b>fillCondition<span style="color: navy">(</span><span style="color: maroon">diagCodingItem</span><span style="color: navy">, </span><span style="color: maroon">bundle</span><span style="color: navy">, </span><span style="color: maroon">subjectRef</span><span style="color: navy">)</span> <i>&quot;invokeFillCondition&quot;</i><span style="color: navy">;</span>
          qr.item<b> as </b><span style="color: maroon">noteItem</span><b> where </b><span style="color: navy">(</span>linkId = 'doc.note'<span style="color: navy">)</span><b> then </b>fillDocumentation<span style="color: navy">(</span><span style="color: maroon">noteItem</span><span style="color: navy">, </span><span style="color: maroon">bundle</span><span style="color: navy">, </span><span style="color: maroon">subjectRef</span><span style="color: navy">)</span> <i>&quot;invokeFillDocumentation&quot;</i><span style="color: navy">;</span>
          qr.item<b> as </b><span style="color: maroon">perfItem</span><b> where </b><span style="color: navy">(</span>linkId = 'svc.performed' and answer.valueBoolean = true<span style="color: navy">)</span><b> then </b>fillProcedure<span style="color: navy">(</span><span style="color: maroon">qr</span><span style="color: navy">, </span><span style="color: maroon">bundle</span><span style="color: navy">, </span><span style="color: maroon">subjectRef</span><span style="color: navy">)</span> <i>&quot;invokeFillProcedure&quot;</i><span style="color: navy">;</span>
          qr<b> as </b><span style="color: maroon">qrForCharges</span><b> then </b>fillChargeItems<span style="color: navy">(</span><span style="color: maroon">qrForCharges</span><span style="color: navy">, </span><span style="color: maroon">bundle</span><span style="color: navy">, </span><span style="color: maroon">subjectRef</span><span style="color: navy">, </span><span style="color: maroon">encRef</span><span style="color: navy">)</span> <i>&quot;invokeFillChargeItems&quot;</i><span style="color: navy">;</span>
          qr<b> as </b><span style="color: maroon">qrForComp</span><b> then </b>fillComposition<span style="color: navy">(</span><span style="color: maroon">qrForComp</span><span style="color: navy">, </span><span style="color: maroon">bundle</span><span style="color: navy">, </span><span style="color: maroon">subjectRef</span><span style="color: navy">, </span><span style="color: maroon">encRef</span><span style="color: navy">, </span><span style="color: maroon">authorRef</span><span style="color: navy">, </span><span style="color: maroon">authoredDt</span><span style="color: navy">)</span> <i>&quot;invokeFillComposition&quot;</i><span style="color: navy">;</span>
        <span style="color: navy">}</span> <i>&quot;bindAuthoredFromQr&quot;</i><span style="color: navy">;</span>
      <span style="color: navy">}</span> <i>&quot;bindAuthorFromQr&quot;</i><span style="color: navy">;</span>
    <span style="color: navy">}</span> <i>&quot;bindEncounterFromQr&quot;</i><span style="color: navy">;</span>
  <span style="color: navy">}</span> <i>&quot;bindSubjectFromQr&quot;</i><span style="color: navy">;</span>
<span style="color: navy">}

</span><span style="color: navy">// </span><span style="color: green">diag.icd answer.valueCoding -&gt; Condition; verificationStatus=unconfirmed; subject from QR.subject.</span>
<b>group </b>fillCondition<span style="color: navy">(</span><b>source</b> <span style="color: maroon">diagItem</span>, <b>target</b> <span style="color: maroon">bundle</span><span style="color: navy"> : </span>Bundle, <b>source</b> <span style="color: maroon">subjectRef</span><span style="color: navy">)</span><span style="color: navy"> {
</span>  diagItem.answer<b> as </b><span style="color: maroon">ans</span><b> then</b><span style="color: navy"> {
</span>    ans.value<span style="color: navy"> : </span>Coding<b> as </b><span style="color: maroon">coding</span><span style="color: navy"><b> -&gt; </b></span> bundle.entry = <b>create</b><span style="color: navy">(</span><span style="color: navy">)</span><b> as </b><span style="color: maroon">condEntry</span><span style="color: navy">, </span> condEntry.fullUrl = <span style="color: blue">'urn:uuid:00000000-0000-4000-8000-000000000001'</span><span style="color: navy">, </span> condEntry.resource = <b>create</b><span style="color: navy">(</span><span style="color: blue">'Condition'</span><span style="color: navy">)</span><b> as </b><span style="color: maroon">cond</span><span style="color: navy">, </span> cond.code = <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">condCode</span><span style="color: navy">, </span> condCode.coding = <span style="color: maroon">coding</span><span style="color: navy">, </span> cond.verificationStatus = <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">ver</span><span style="color: navy">, </span> ver.coding = <b>create</b><span style="color: navy">(</span><span style="color: blue">'Coding'</span><span style="color: navy">)</span><b> as </b><span style="color: maroon">verCoding</span><span style="color: navy">, </span> verCoding.system = <span style="color: blue">'http://terminology.hl7.org/CodeSystem/condition-ver-status'</span><span style="color: navy">, </span> verCoding.code = <span style="color: blue">'unconfirmed'</span><span style="color: navy">, </span> cond.clinicalStatus = <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">clin</span><span style="color: navy">, </span> clin.coding = <b>create</b><span style="color: navy">(</span><span style="color: blue">'Coding'</span><span style="color: navy">)</span><b> as </b><span style="color: maroon">clinCoding</span><span style="color: navy">, </span> clinCoding.system = <span style="color: blue">'http://terminology.hl7.org/CodeSystem/condition-clinical'</span><span style="color: navy">, </span> clinCoding.code = <span style="color: blue">'active'</span><span style="color: navy">, </span> cond.subject = <span style="color: maroon">subjectRef</span> <i>&quot;codingValue&quot;</i><span style="color: navy">;</span>
  <span style="color: navy">}</span> <i>&quot;conditionFromValueCoding&quot;</i><span style="color: navy">;</span>
<span style="color: navy">}

</span><span style="color: navy">// </span><span style="color: green">doc.note answer.valueString -&gt; Observation.value (serialized as valueString) status=preliminary.</span>
<b>group </b>fillDocumentation<span style="color: navy">(</span><b>source</b> <span style="color: maroon">noteItem</span>, <b>target</b> <span style="color: maroon">bundle</span><span style="color: navy"> : </span>Bundle, <b>source</b> <span style="color: maroon">subjectRef</span><span style="color: navy">)</span><span style="color: navy"> {
</span>  noteItem.answer<b> as </b><span style="color: maroon">ans</span><b> then</b><span style="color: navy"> {
</span>    ans.value<span style="color: navy"> : </span>string<b> as </b><span style="color: maroon">text</span><span style="color: navy"><b> -&gt; </b></span> bundle.entry = <b>create</b><span style="color: navy">(</span><span style="color: navy">)</span><b> as </b><span style="color: maroon">obsEntry</span><span style="color: navy">, </span> obsEntry.fullUrl = <span style="color: blue">'urn:uuid:00000000-0000-4000-8000-000000000002'</span><span style="color: navy">, </span> obsEntry.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">obs</span><span style="color: navy">, </span> obs.status = <span style="color: blue">'preliminary'</span><span style="color: navy">, </span> obs.code = <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">obsCode</span><span style="color: navy">, </span> obsCode.coding = <b>create</b><span style="color: navy">(</span><span style="color: blue">'Coding'</span><span style="color: navy">)</span><b> as </b><span style="color: maroon">obsCoding</span><span style="color: navy">, </span> obsCoding.system = <span style="color: blue">'http://snomed.info/sct'</span><span style="color: navy">, </span> obsCoding.code = <span style="color: blue">'371524004'</span><span style="color: navy">, </span> obs.value = <span style="color: maroon">text</span><span style="color: navy">, </span> obs.subject = <span style="color: maroon">subjectRef</span> <i>&quot;stringValue&quot;</i><span style="color: navy">;</span>
  <span style="color: navy">}</span> <i>&quot;obsFromValueString&quot;</i><span style="color: navy">;</span>
<span style="color: navy">}

</span><span style="color: navy">// </span><span style="color: green">bodySiteFromValueCoding + SNOMED laterality; status=preparation; reasonReference from diag.condition.</span>
<b>group </b>fillProcedure<span style="color: navy">(</span><b>source</b> <span style="color: maroon">qr</span><span style="color: navy"> : </span>QuestionnaireResponse, <b>target</b> <span style="color: maroon">bundle</span><span style="color: navy"> : </span>Bundle, <b>source</b> <span style="color: maroon">subjectRef</span><span style="color: navy">)</span><span style="color: navy"> {
</span>  qr.item<b> as </b><span style="color: maroon">siteItem</span><b> where </b><span style="color: navy">(</span>linkId = 'site.bodySite'<span style="color: navy">)</span><span style="color: navy">, </span>qr.item<b> as </b><span style="color: maroon">latItem</span><b> where </b><span style="color: navy">(</span>linkId = 'site.laterality'<span style="color: navy">)</span><b> then</b><span style="color: navy"> {
</span>    siteItem.answer<b> as </b><span style="color: maroon">siteAns</span><b> then</b><span style="color: navy"> {
</span>      siteAns.value<span style="color: navy"> : </span>Coding<b> as </b><span style="color: maroon">siteCoding</span><b> then</b><span style="color: navy"> {
</span>        latItem.answer<b> as </b><span style="color: maroon">latAns</span><b> then</b><span style="color: navy"> {
</span>          latAns.value<span style="color: navy"> : </span>Coding<b> as </b><span style="color: maroon">latCoding</span><span style="color: navy"><b> -&gt; </b></span> bundle.entry = <b>create</b><span style="color: navy">(</span><span style="color: navy">)</span><b> as </b><span style="color: maroon">procEntry</span><span style="color: navy">, </span> procEntry.fullUrl = <span style="color: blue">'urn:uuid:00000000-0000-4000-8000-000000000003'</span><span style="color: navy">, </span> procEntry.resource = <b>create</b><span style="color: navy">(</span><span style="color: blue">'Procedure'</span><span style="color: navy">)</span><b> as </b><span style="color: maroon">proc</span><span style="color: navy">, </span> proc.status = <span style="color: blue">'preparation'</span><span style="color: navy">, </span> proc.code = <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">procCode</span><span style="color: navy">, </span> procCode.coding = <b>create</b><span style="color: navy">(</span><span style="color: blue">'Coding'</span><span style="color: navy">)</span><b> as </b><span style="color: maroon">procCoding</span><span style="color: navy">, </span> procCoding.system = <span style="color: blue">'http://snomed.info/sct'</span><span style="color: navy">, </span> procCoding.code = <span style="color: blue">'59108006'</span><span style="color: navy">, </span> proc.subject = <span style="color: maroon">subjectRef</span><span style="color: navy">, </span> proc.instantiatesCanonical = <span style="color: blue">'https://fhir.cognovis.de/praxis/PlanDefinition/job-upper-arm-injection|0.90.0'</span><span style="color: navy">, </span> proc.bodySite = <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">bs</span><span style="color: navy">, </span> bs.coding = <span style="color: maroon">siteCoding</span><span style="color: navy">, </span> bs.coding = <span style="color: maroon">latCoding</span><b> then</b><span style="color: navy"> {
</span>            qr.item<b> as </b><span style="color: maroon">diagRefItem</span><b> where </b><span style="color: navy">(</span>linkId = 'diag.condition'<span style="color: navy">)</span><b> then</b><span style="color: navy"> {
</span>              diagRefItem.answer<b> as </b><span style="color: maroon">drAns</span><b> then</b><span style="color: navy"> {
</span>                drAns.value<span style="color: navy"> : </span>Reference<b> as </b><span style="color: maroon">reasonRef</span><span style="color: navy"><b> -&gt; </b></span>proc.reasonReference = <span style="color: maroon">reasonRef</span> <i>&quot;diagRefValue&quot;</i><span style="color: navy">;</span>
              <span style="color: navy">}</span> <i>&quot;diagRefAnswer&quot;</i><span style="color: navy">;</span>
            <span style="color: navy">}</span> <i>&quot;reasonFromConditionRef&quot;</i><span style="color: navy">;</span>
          <span style="color: navy">}</span> <i>&quot;latValue&quot;</i><span style="color: navy">;</span>
        <span style="color: navy">}</span> <i>&quot;latAnswer&quot;</i><span style="color: navy">;</span>
      <span style="color: navy">}</span> <i>&quot;siteValue&quot;</i><span style="color: navy">;</span>
    <span style="color: navy">}</span> <i>&quot;siteAnswer&quot;</i><span style="color: navy">;</span>
  <span style="color: navy">}</span> <i>&quot;bodySiteFromValueCoding&quot;</i><span style="color: navy">;</span>
<span style="color: navy">}

</span><span style="color: navy">// </span><span style="color: green">One ChargeItem per runtime contract (cid.primary answer.valueUri). ChargeItem.code is the Job-fixed GOÄ 252 Coding (http://fhir.de/CodeSystem/bäk/goä), never derived from CID identity or service codes. context from QR.encounter; subject from QR.subject; 1:n service lineage when performed; supportingInformation from diag.condition.</span>
<b>group </b>fillChargeItems<span style="color: navy">(</span><b>source</b> <span style="color: maroon">qr</span><span style="color: navy"> : </span>QuestionnaireResponse, <b>target</b> <span style="color: maroon">bundle</span><span style="color: navy"> : </span>Bundle, <b>source</b> <span style="color: maroon">subjectRef</span>, <b>source</b> <span style="color: maroon">encRef</span><span style="color: navy">)</span><span style="color: navy"> {
</span>  qr.item<b> as </b><span style="color: maroon">cidItem</span><b> where </b><span style="color: navy">(</span>linkId = 'cid.primary'<span style="color: navy">)</span><b> then</b><span style="color: navy"> {
</span>    cidItem.answer<b> as </b><span style="color: maroon">cidAns</span><b> then</b><span style="color: navy"> {
</span>      cidAns.value<span style="color: navy"> : </span>uri<b> as </b><span style="color: maroon">primaryCid</span><span style="color: navy"><b> -&gt; </b></span> bundle.entry = <b>create</b><span style="color: navy">(</span><span style="color: navy">)</span><b> as </b><span style="color: maroon">chg1Entry</span><span style="color: navy">, </span> chg1Entry.fullUrl = <span style="color: blue">'urn:uuid:00000000-0000-4000-8000-000000000004'</span><span style="color: navy">, </span> chg1Entry.resource = <b>create</b><span style="color: navy">(</span><span style="color: blue">'ChargeItem'</span><span style="color: navy">)</span><b> as </b><span style="color: maroon">chg1</span><span style="color: navy">, </span> chg1.status = <span style="color: blue">'planned'</span><span style="color: navy">, </span> chg1.subject = <span style="color: maroon">subjectRef</span><span style="color: navy">, </span> chg1.context = <span style="color: maroon">encRef</span><span style="color: navy">, </span> chg1.code = <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">chgCode</span><span style="color: navy">, </span> chgCode.coding = <b>create</b><span style="color: navy">(</span><span style="color: blue">'Coding'</span><span style="color: navy">)</span><b> as </b><span style="color: maroon">fixedCoding</span><span style="color: navy">, </span> fixedCoding.system = <span style="color: blue">'http://fhir.de/CodeSystem/bäk/goä'</span><span style="color: navy">, </span> fixedCoding.code = <span style="color: blue">'252'</span><span style="color: navy">, </span> fixedCoding.display = <span style="color: blue">'Injektion, s.c./s.m./i.c./i.m.'</span><span style="color: navy">, </span> chg1.definitionCanonical = <span style="color: maroon">primaryCid</span><span style="color: navy">, </span> chg1.quantity = <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: blue">1</span><b> then</b><span style="color: navy"> {
</span>        qr.item<b> as </b><span style="color: maroon">amtItem</span><b> where </b><span style="color: navy">(</span>linkId = 'fee.amount'<span style="color: navy">)</span><span style="color: navy">, </span>qr.item<b> as </b><span style="color: maroon">curItem</span><b> where </b><span style="color: navy">(</span>linkId = 'fee.currency'<span style="color: navy">)</span><b> then</b><span style="color: navy"> {
</span>          amtItem.answer<b> as </b><span style="color: maroon">amtAns</span><b> then</b><span style="color: navy"> {
</span>            amtAns.value<span style="color: navy"> : </span>decimal<b> as </b><span style="color: maroon">amount</span><b> then</b><span style="color: navy"> {
</span>              curItem.answer<b> as </b><span style="color: maroon">curAns</span><b> then</b><span style="color: navy"> {
</span>                curAns.value<span style="color: navy"> : </span>Coding<b> as </b><span style="color: maroon">curCoding</span><b> then</b><span style="color: navy"> {
</span>                  curCoding.code<b> as </b><span style="color: maroon">currencyCode</span><span style="color: navy"><b> -&gt; </b></span> chg1.priceOverride = <b>create</b><span style="color: navy">(</span><span style="color: blue">'Money'</span><span style="color: navy">)</span><b> as </b><span style="color: maroon">money</span><span style="color: navy">, </span> money.value = <span style="color: maroon">amount</span><span style="color: navy">, </span> money.currency = <span style="color: maroon">currencyCode</span> <i>&quot;currencyCode&quot;</i><span style="color: navy">;</span>
                <span style="color: navy">}</span> <i>&quot;currencyValue&quot;</i><span style="color: navy">;</span>
              <span style="color: navy">}</span> <i>&quot;currencyAnswer&quot;</i><span style="color: navy">;</span>
            <span style="color: navy">}</span> <i>&quot;amountValue&quot;</i><span style="color: navy">;</span>
          <span style="color: navy">}</span> <i>&quot;amountAnswer&quot;</i><span style="color: navy">;</span>
        <span style="color: navy">}</span> <i>&quot;moneyFromParts&quot;</i><span style="color: navy">;</span>
        qr.item<b> as </b><span style="color: maroon">perfItem</span><b> where </b><span style="color: navy">(</span>linkId = 'svc.performed' and answer.valueBoolean = true<span style="color: navy">)</span><span style="color: navy"><b> -&gt; </b></span> chg1.service = <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">svcProc</span><span style="color: navy">, </span> svcProc.reference = <span style="color: blue">'urn:uuid:00000000-0000-4000-8000-000000000003'</span><span style="color: navy">, </span> chg1.service = <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">svcObs</span><span style="color: navy">, </span> svcObs.reference = <span style="color: blue">'urn:uuid:00000000-0000-4000-8000-000000000002'</span> <i>&quot;serviceWhenPerformedPrimary&quot;</i><span style="color: navy">;</span>
        qr.item<b> as </b><span style="color: maroon">diagRefItem2</span><b> where </b><span style="color: navy">(</span>linkId = 'diag.condition'<span style="color: navy">)</span><b> then</b><span style="color: navy"> {
</span>          diagRefItem2.answer<b> as </b><span style="color: maroon">dr2Ans</span><b> then</b><span style="color: navy"> {
</span>            dr2Ans.value<span style="color: navy"> : </span>Reference<b> as </b><span style="color: maroon">reasonRef2</span><span style="color: navy"><b> -&gt; </b></span>chg1.supportingInformation = <span style="color: maroon">reasonRef2</span> <i>&quot;dr2Value&quot;</i><span style="color: navy">;</span>
          <span style="color: navy">}</span> <i>&quot;dr2Answer&quot;</i><span style="color: navy">;</span>
        <span style="color: navy">}</span> <i>&quot;supportingInfoFromConditionRef&quot;</i><span style="color: navy">;</span>
      <span style="color: navy">}</span> <i>&quot;cidValue&quot;</i><span style="color: navy">;</span>
    <span style="color: navy">}</span> <i>&quot;cidAnswer&quot;</i><span style="color: navy">;</span>
  <span style="color: navy">}</span> <i>&quot;primaryFromValueUri&quot;</i><span style="color: navy">;</span>
<span style="color: navy">}

</span><span style="color: navy">// </span><span style="color: green">Composition proposal (status=preliminary). subject/encounter/author/date from QR.subject/.encounter/.author/.authored only — never fabricated. Sections Reference generated Observation/ChargeItem UUIDs; optional Procedure/Condition sections when those outputs are produced.</span>
<b>group </b>fillComposition<span style="color: navy">(</span><b>source</b> <span style="color: maroon">qr</span><span style="color: navy"> : </span>QuestionnaireResponse, <b>target</b> <span style="color: maroon">bundle</span><span style="color: navy"> : </span>Bundle, <b>source</b> <span style="color: maroon">subjectRef</span>, <b>source</b> <span style="color: maroon">encRef</span>, <b>source</b> <span style="color: maroon">authorRef</span>, <b>source</b> <span style="color: maroon">authoredDt</span><span style="color: navy">)</span><span style="color: navy"> {
</span>  qr<span style="color: navy"><b> -&gt; </b></span> bundle.entry = <b>create</b><span style="color: navy">(</span><span style="color: navy">)</span><b> as </b><span style="color: maroon">compEntry</span><span style="color: navy">, </span> compEntry.fullUrl = <span style="color: blue">'urn:uuid:00000000-0000-4000-8000-000000000006'</span><span style="color: navy">, </span> compEntry.resource = <b>create</b><span style="color: navy">(</span><span style="color: blue">'Composition'</span><span style="color: navy">)</span><b> as </b><span style="color: maroon">comp</span><span style="color: navy">, </span> comp.status = <span style="color: blue">'preliminary'</span><span style="color: navy">, </span> comp.type = <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">compType</span><span style="color: navy">, </span> compType.coding = <b>create</b><span style="color: navy">(</span><span style="color: blue">'Coding'</span><span style="color: navy">)</span><b> as </b><span style="color: maroon">compTypeCoding</span><span style="color: navy">, </span> compTypeCoding.system = <span style="color: blue">'http://loinc.org'</span><span style="color: navy">, </span> compTypeCoding.code = <span style="color: blue">'11506-3'</span><span style="color: navy">, </span> compTypeCoding.display = <span style="color: blue">'Progress note'</span><span style="color: navy">, </span> comp.title = <span style="color: blue">'Upper-arm injection visit - pre-approval proposal'</span><span style="color: navy">, </span> comp.subject = <span style="color: maroon">subjectRef</span><span style="color: navy">, </span> comp.encounter = <span style="color: maroon">encRef</span><span style="color: navy">, </span> comp.author = <span style="color: maroon">authorRef</span><span style="color: navy">, </span> comp.date = <span style="color: maroon">authoredDt</span><span style="color: navy">, </span> comp.section = <b>create</b><span style="color: navy">(</span><span style="color: navy">)</span><b> as </b><span style="color: maroon">secDoc</span><span style="color: navy">, </span> secDoc.title = <span style="color: blue">'Documentation'</span><span style="color: navy">, </span> secDoc.entry = <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">docEntry</span><span style="color: navy">, </span> docEntry.reference = <span style="color: blue">'urn:uuid:00000000-0000-4000-8000-000000000002'</span><span style="color: navy">, </span> comp.section = <b>create</b><span style="color: navy">(</span><span style="color: navy">)</span><b> as </b><span style="color: maroon">secBill</span><span style="color: navy">, </span> secBill.title = <span style="color: blue">'Billing proposal'</span><span style="color: navy">, </span> secBill.entry = <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">billEntry</span><span style="color: navy">, </span> billEntry.reference = <span style="color: blue">'urn:uuid:00000000-0000-4000-8000-000000000004'</span><b> then</b><span style="color: navy"> {
</span>    qr.item<b> as </b><span style="color: maroon">perfItem</span><b> where </b><span style="color: navy">(</span>linkId = 'svc.performed' and answer.valueBoolean = true<span style="color: navy">)</span><span style="color: navy"><b> -&gt; </b></span> comp.section = <b>create</b><span style="color: navy">(</span><span style="color: navy">)</span><b> as </b><span style="color: maroon">secProc</span><span style="color: navy">, </span> secProc.title = <span style="color: blue">'Procedure proposal'</span><span style="color: navy">, </span> secProc.entry = <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">procEntryRef</span><span style="color: navy">, </span> procEntryRef.reference = <span style="color: blue">'urn:uuid:00000000-0000-4000-8000-000000000003'</span> <i>&quot;sectionProcedureWhenPerformed&quot;</i><span style="color: navy">;</span>
    qr.item<b> as </b><span style="color: maroon">diagCodingItem</span><b> where </b><span style="color: navy">(</span>linkId = 'diag.icd'<span style="color: navy">)</span><span style="color: navy"><b> -&gt; </b></span> comp.section = <b>create</b><span style="color: navy">(</span><span style="color: navy">)</span><b> as </b><span style="color: maroon">secDx</span><span style="color: navy">, </span> secDx.title = <span style="color: blue">'Diagnosis proposal'</span><span style="color: navy">, </span> secDx.entry = <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">dxEntry</span><span style="color: navy">, </span> dxEntry.reference = <span style="color: blue">'urn:uuid:00000000-0000-4000-8000-000000000001'</span> <i>&quot;sectionDiagnosisWhenCoding&quot;</i><span style="color: navy">;</span>
  <span style="color: navy">}</span> <i>&quot;compositionShell&quot;</i><span style="color: navy">;</span>
<span style="color: navy">}

</span></pre></div>
  </text>
  <url
       value="https://fhir.cognovis.de/praxis/StructureMap/map-upper-arm-injection"/>
  <identifier>
    <system value="urn:ietf:rfc:3986"/>
    <value value="urn:oid:2.16.840.1.113883.3.7985.43.1"/>
  </identifier>
  <version value="0.90.0"/>
  <name value="MapUpperArmInjection"/>
  <title
         value="Upper-arm injection Job — QuestionnaireResponse to pre-approval candidate Bundle"/>
  <status value="active"/>
  <experimental value="true"/>
  <date value="2026-07-29T13:00:36+02:00"/>
  <publisher value="cognovis GmbH"/>
  <contact>
    <name value="cognovis GmbH"/>
    <telecom>
      <system value="url"/>
      <value value="https://www.cognovis.de"/>
    </telecom>
    <telecom>
      <system value="email"/>
      <value value="info@cognovis.de"/>
    </telecom>
  </contact>
  <description
               value="EXAMPLE-ONLY worked StructureMap for the upper-arm injection Job (GOÄ 252). Not a curated production binding discovery artifact. Executed by the bounded R4 StructureMap rule-tree interpreter. Composition/Condition/Observation/Procedure/ChargeItem candidates. QR.subject/.encounter/.author/.authored supply Composition context (never fabricated). ChargeItem.code is Job-fixed GOÄ 252 (http://fhir.de/CodeSystem/bäk/goä#252); definitionCanonical from cid.primary answer.valueUri only. Procedure carries instantiatesCanonical to the Job; basedOn only when a real ServiceRequest exists (separate fixture, not this map). Binding identity: (job-upper-arm-injection|0.90.0, q-upper-arm-injection|0.90.0, map-upper-arm-injection|0.90.0)."/>
  <jurisdiction>
    <coding>
      <system value="urn:iso:std:iso:3166"/>
      <code value="DE"/>
      <display value="Germany"/>
    </coding>
  </jurisdiction>
  <structure>
    <url
         value="http://hl7.org/fhir/StructureDefinition/QuestionnaireResponse"/>
    <mode value="source"/>
    <alias value="qr"/>
  </structure>
  <structure>
    <url value="http://hl7.org/fhir/StructureDefinition/Bundle"/>
    <mode value="target"/>
    <alias value="bundle"/>
  </structure>
  <group>
    <name value="main"/>
    <typeMode value="none"/>
    <documentation
                   value="Bind QuestionnaireResponse.subject/.encounter/.author/.authored (standard QR fields; not duplicated Questionnaire items), then invoke fillCondition / fillDocumentation / fillProcedure / fillChargeItems / fillComposition."/>
    <input>
      <name value="qr"/>
      <type value="QuestionnaireResponse"/>
      <mode value="source"/>
    </input>
    <input>
      <name value="bundle"/>
      <type value="Bundle"/>
      <mode value="target"/>
    </input>
    <rule>
      <name value="bundleType"/>
      <source>
        <context value="qr"/>
      </source>
      <target>
        <context value="bundle"/>
        <contextType value="variable"/>
        <element value="type"/>
        <transform value="copy"/>
        <parameter>
          <valueString value="collection"/>
        </parameter>
      </target>
    </rule>
    <rule>
      <name value="bindSubjectFromQr"/>
      <source>
        <context value="qr"/>
        <element value="subject"/>
        <variable value="subjectRef"/>
      </source>
      <rule>
        <name value="bindEncounterFromQr"/>
        <source>
          <context value="qr"/>
          <element value="encounter"/>
          <variable value="encRef"/>
        </source>
        <rule>
          <name value="bindAuthorFromQr"/>
          <source>
            <context value="qr"/>
            <element value="author"/>
            <variable value="authorRef"/>
          </source>
          <rule>
            <name value="bindAuthoredFromQr"/>
            <source>
              <context value="qr"/>
              <element value="authored"/>
              <variable value="authoredDt"/>
            </source>
            <rule>
              <name value="invokeFillCondition"/>
              <source>
                <context value="qr"/>
                <element value="item"/>
                <variable value="diagCodingItem"/>
                <condition value="linkId = 'diag.icd'"/>
              </source>
              <dependent>
                <name value="fillCondition"/>
                <variable value="diagCodingItem"/>
                <variable value="bundle"/>
                <variable value="subjectRef"/>
              </dependent>
            </rule>
            <rule>
              <name value="invokeFillDocumentation"/>
              <source>
                <context value="qr"/>
                <element value="item"/>
                <variable value="noteItem"/>
                <condition value="linkId = 'doc.note'"/>
              </source>
              <dependent>
                <name value="fillDocumentation"/>
                <variable value="noteItem"/>
                <variable value="bundle"/>
                <variable value="subjectRef"/>
              </dependent>
            </rule>
            <rule>
              <name value="invokeFillProcedure"/>
              <source>
                <context value="qr"/>
                <element value="item"/>
                <variable value="perfItem"/>
                <condition
                           value="linkId = 'svc.performed' and answer.valueBoolean = true"/>
              </source>
              <dependent>
                <name value="fillProcedure"/>
                <variable value="qr"/>
                <variable value="bundle"/>
                <variable value="subjectRef"/>
              </dependent>
            </rule>
            <rule>
              <name value="invokeFillChargeItems"/>
              <source>
                <context value="qr"/>
                <variable value="qrForCharges"/>
              </source>
              <dependent>
                <name value="fillChargeItems"/>
                <variable value="qrForCharges"/>
                <variable value="bundle"/>
                <variable value="subjectRef"/>
                <variable value="encRef"/>
              </dependent>
            </rule>
            <rule>
              <name value="invokeFillComposition"/>
              <source>
                <context value="qr"/>
                <variable value="qrForComp"/>
              </source>
              <dependent>
                <name value="fillComposition"/>
                <variable value="qrForComp"/>
                <variable value="bundle"/>
                <variable value="subjectRef"/>
                <variable value="encRef"/>
                <variable value="authorRef"/>
                <variable value="authoredDt"/>
              </dependent>
            </rule>
          </rule>
        </rule>
      </rule>
    </rule>
  </group>
  <group>
    <name value="fillCondition"/>
    <typeMode value="none"/>
    <documentation
                   value="diag.icd answer.valueCoding -&gt; Condition; verificationStatus=unconfirmed; subject from QR.subject."/>
    <input>
      <name value="diagItem"/>
      <mode value="source"/>
    </input>
    <input>
      <name value="bundle"/>
      <type value="Bundle"/>
      <mode value="target"/>
    </input>
    <input>
      <name value="subjectRef"/>
      <mode value="source"/>
    </input>
    <rule>
      <name value="conditionFromValueCoding"/>
      <source>
        <context value="diagItem"/>
        <element value="answer"/>
        <variable value="ans"/>
      </source>
      <rule>
        <name value="codingValue"/>
        <source>
          <context value="ans"/>
          <type value="Coding"/>
          <element value="value"/>
          <variable value="coding"/>
        </source>
        <target>
          <context value="bundle"/>
          <contextType value="variable"/>
          <element value="entry"/>
          <variable value="condEntry"/>
          <transform value="create"/>
        </target>
        <target>
          <context value="condEntry"/>
          <contextType value="variable"/>
          <element value="fullUrl"/>
          <transform value="copy"/>
          <parameter>
            <valueString
                         value="urn:uuid:00000000-0000-4000-8000-000000000001"/>
          </parameter>
        </target>
        <target>
          <context value="condEntry"/>
          <contextType value="variable"/>
          <element value="resource"/>
          <variable value="cond"/>
          <transform value="create"/>
          <parameter>
            <valueString value="Condition"/>
          </parameter>
        </target>
        <target>
          <context value="cond"/>
          <contextType value="variable"/>
          <element value="code"/>
          <variable value="condCode"/>
          <transform value="create"/>
          <parameter>
            <valueString value="CodeableConcept"/>
          </parameter>
        </target>
        <target>
          <context value="condCode"/>
          <contextType value="variable"/>
          <element value="coding"/>
          <transform value="copy"/>
          <parameter>
            <valueId value="coding"/>
          </parameter>
        </target>
        <target>
          <context value="cond"/>
          <contextType value="variable"/>
          <element value="verificationStatus"/>
          <variable value="ver"/>
          <transform value="create"/>
          <parameter>
            <valueString value="CodeableConcept"/>
          </parameter>
        </target>
        <target>
          <context value="ver"/>
          <contextType value="variable"/>
          <element value="coding"/>
          <variable value="verCoding"/>
          <transform value="create"/>
          <parameter>
            <valueString value="Coding"/>
          </parameter>
        </target>
        <target>
          <context value="verCoding"/>
          <contextType value="variable"/>
          <element value="system"/>
          <transform value="copy"/>
          <parameter>
            <valueString
                         value="http://terminology.hl7.org/CodeSystem/condition-ver-status"/>
          </parameter>
        </target>
        <target>
          <context value="verCoding"/>
          <contextType value="variable"/>
          <element value="code"/>
          <transform value="copy"/>
          <parameter>
            <valueString value="unconfirmed"/>
          </parameter>
        </target>
        <target>
          <context value="cond"/>
          <contextType value="variable"/>
          <element value="clinicalStatus"/>
          <variable value="clin"/>
          <transform value="create"/>
          <parameter>
            <valueString value="CodeableConcept"/>
          </parameter>
        </target>
        <target>
          <context value="clin"/>
          <contextType value="variable"/>
          <element value="coding"/>
          <variable value="clinCoding"/>
          <transform value="create"/>
          <parameter>
            <valueString value="Coding"/>
          </parameter>
        </target>
        <target>
          <context value="clinCoding"/>
          <contextType value="variable"/>
          <element value="system"/>
          <transform value="copy"/>
          <parameter>
            <valueString
                         value="http://terminology.hl7.org/CodeSystem/condition-clinical"/>
          </parameter>
        </target>
        <target>
          <context value="clinCoding"/>
          <contextType value="variable"/>
          <element value="code"/>
          <transform value="copy"/>
          <parameter>
            <valueString value="active"/>
          </parameter>
        </target>
        <target>
          <context value="cond"/>
          <contextType value="variable"/>
          <element value="subject"/>
          <transform value="copy"/>
          <parameter>
            <valueId value="subjectRef"/>
          </parameter>
        </target>
      </rule>
    </rule>
  </group>
  <group>
    <name value="fillDocumentation"/>
    <typeMode value="none"/>
    <documentation
                   value="doc.note answer.valueString -&gt; Observation.value (serialized as valueString) status=preliminary."/>
    <input>
      <name value="noteItem"/>
      <mode value="source"/>
    </input>
    <input>
      <name value="bundle"/>
      <type value="Bundle"/>
      <mode value="target"/>
    </input>
    <input>
      <name value="subjectRef"/>
      <mode value="source"/>
    </input>
    <rule>
      <name value="obsFromValueString"/>
      <source>
        <context value="noteItem"/>
        <element value="answer"/>
        <variable value="ans"/>
      </source>
      <rule>
        <name value="stringValue"/>
        <source>
          <context value="ans"/>
          <type value="string"/>
          <element value="value"/>
          <variable value="text"/>
        </source>
        <target>
          <context value="bundle"/>
          <contextType value="variable"/>
          <element value="entry"/>
          <variable value="obsEntry"/>
          <transform value="create"/>
        </target>
        <target>
          <context value="obsEntry"/>
          <contextType value="variable"/>
          <element value="fullUrl"/>
          <transform value="copy"/>
          <parameter>
            <valueString
                         value="urn:uuid:00000000-0000-4000-8000-000000000002"/>
          </parameter>
        </target>
        <target>
          <context value="obsEntry"/>
          <contextType value="variable"/>
          <element value="resource"/>
          <variable value="obs"/>
          <transform value="create"/>
          <parameter>
            <valueString value="Observation"/>
          </parameter>
        </target>
        <target>
          <context value="obs"/>
          <contextType value="variable"/>
          <element value="status"/>
          <transform value="copy"/>
          <parameter>
            <valueString value="preliminary"/>
          </parameter>
        </target>
        <target>
          <context value="obs"/>
          <contextType value="variable"/>
          <element value="code"/>
          <variable value="obsCode"/>
          <transform value="create"/>
          <parameter>
            <valueString value="CodeableConcept"/>
          </parameter>
        </target>
        <target>
          <context value="obsCode"/>
          <contextType value="variable"/>
          <element value="coding"/>
          <variable value="obsCoding"/>
          <transform value="create"/>
          <parameter>
            <valueString value="Coding"/>
          </parameter>
        </target>
        <target>
          <context value="obsCoding"/>
          <contextType value="variable"/>
          <element value="system"/>
          <transform value="copy"/>
          <parameter>
            <valueString value="http://snomed.info/sct"/>
          </parameter>
        </target>
        <target>
          <context value="obsCoding"/>
          <contextType value="variable"/>
          <element value="code"/>
          <transform value="copy"/>
          <parameter>
            <valueString value="371524004"/>
          </parameter>
        </target>
        <target>
          <context value="obs"/>
          <contextType value="variable"/>
          <element value="value"/>
          <transform value="copy"/>
          <parameter>
            <valueId value="text"/>
          </parameter>
        </target>
        <target>
          <context value="obs"/>
          <contextType value="variable"/>
          <element value="subject"/>
          <transform value="copy"/>
          <parameter>
            <valueId value="subjectRef"/>
          </parameter>
        </target>
      </rule>
    </rule>
  </group>
  <group>
    <name value="fillProcedure"/>
    <typeMode value="none"/>
    <documentation
                   value="bodySiteFromValueCoding + SNOMED laterality; status=preparation; reasonReference from diag.condition."/>
    <input>
      <name value="qr"/>
      <type value="QuestionnaireResponse"/>
      <mode value="source"/>
    </input>
    <input>
      <name value="bundle"/>
      <type value="Bundle"/>
      <mode value="target"/>
    </input>
    <input>
      <name value="subjectRef"/>
      <mode value="source"/>
    </input>
    <rule>
      <name value="bodySiteFromValueCoding"/>
      <source>
        <context value="qr"/>
        <element value="item"/>
        <variable value="siteItem"/>
        <condition value="linkId = 'site.bodySite'"/>
      </source>
      <source>
        <context value="qr"/>
        <element value="item"/>
        <variable value="latItem"/>
        <condition value="linkId = 'site.laterality'"/>
      </source>
      <rule>
        <name value="siteAnswer"/>
        <source>
          <context value="siteItem"/>
          <element value="answer"/>
          <variable value="siteAns"/>
        </source>
        <rule>
          <name value="siteValue"/>
          <source>
            <context value="siteAns"/>
            <type value="Coding"/>
            <element value="value"/>
            <variable value="siteCoding"/>
          </source>
          <rule>
            <name value="latAnswer"/>
            <source>
              <context value="latItem"/>
              <element value="answer"/>
              <variable value="latAns"/>
            </source>
            <rule>
              <name value="latValue"/>
              <source>
                <context value="latAns"/>
                <type value="Coding"/>
                <element value="value"/>
                <variable value="latCoding"/>
              </source>
              <target>
                <context value="bundle"/>
                <contextType value="variable"/>
                <element value="entry"/>
                <variable value="procEntry"/>
                <transform value="create"/>
              </target>
              <target>
                <context value="procEntry"/>
                <contextType value="variable"/>
                <element value="fullUrl"/>
                <transform value="copy"/>
                <parameter>
                  <valueString
                               value="urn:uuid:00000000-0000-4000-8000-000000000003"/>
                </parameter>
              </target>
              <target>
                <context value="procEntry"/>
                <contextType value="variable"/>
                <element value="resource"/>
                <variable value="proc"/>
                <transform value="create"/>
                <parameter>
                  <valueString value="Procedure"/>
                </parameter>
              </target>
              <target>
                <context value="proc"/>
                <contextType value="variable"/>
                <element value="status"/>
                <transform value="copy"/>
                <parameter>
                  <valueString value="preparation"/>
                </parameter>
              </target>
              <target>
                <context value="proc"/>
                <contextType value="variable"/>
                <element value="code"/>
                <variable value="procCode"/>
                <transform value="create"/>
                <parameter>
                  <valueString value="CodeableConcept"/>
                </parameter>
              </target>
              <target>
                <context value="procCode"/>
                <contextType value="variable"/>
                <element value="coding"/>
                <variable value="procCoding"/>
                <transform value="create"/>
                <parameter>
                  <valueString value="Coding"/>
                </parameter>
              </target>
              <target>
                <context value="procCoding"/>
                <contextType value="variable"/>
                <element value="system"/>
                <transform value="copy"/>
                <parameter>
                  <valueString value="http://snomed.info/sct"/>
                </parameter>
              </target>
              <target>
                <context value="procCoding"/>
                <contextType value="variable"/>
                <element value="code"/>
                <transform value="copy"/>
                <parameter>
                  <valueString value="59108006"/>
                </parameter>
              </target>
              <target>
                <context value="proc"/>
                <contextType value="variable"/>
                <element value="subject"/>
                <transform value="copy"/>
                <parameter>
                  <valueId value="subjectRef"/>
                </parameter>
              </target>
              <target>
                <context value="proc"/>
                <contextType value="variable"/>
                <element value="instantiatesCanonical"/>
                <transform value="copy"/>
                <parameter>
                  <valueString
                               value="https://fhir.cognovis.de/praxis/PlanDefinition/job-upper-arm-injection|0.90.0"/>
                </parameter>
              </target>
              <target>
                <context value="proc"/>
                <contextType value="variable"/>
                <element value="bodySite"/>
                <variable value="bs"/>
                <transform value="create"/>
                <parameter>
                  <valueString value="CodeableConcept"/>
                </parameter>
              </target>
              <target>
                <context value="bs"/>
                <contextType value="variable"/>
                <element value="coding"/>
                <transform value="copy"/>
                <parameter>
                  <valueId value="siteCoding"/>
                </parameter>
              </target>
              <target>
                <context value="bs"/>
                <contextType value="variable"/>
                <element value="coding"/>
                <transform value="copy"/>
                <parameter>
                  <valueId value="latCoding"/>
                </parameter>
              </target>
              <rule>
                <name value="reasonFromConditionRef"/>
                <source>
                  <context value="qr"/>
                  <element value="item"/>
                  <variable value="diagRefItem"/>
                  <condition value="linkId = 'diag.condition'"/>
                </source>
                <rule>
                  <name value="diagRefAnswer"/>
                  <source>
                    <context value="diagRefItem"/>
                    <element value="answer"/>
                    <variable value="drAns"/>
                  </source>
                  <rule>
                    <name value="diagRefValue"/>
                    <source>
                      <context value="drAns"/>
                      <type value="Reference"/>
                      <element value="value"/>
                      <variable value="reasonRef"/>
                    </source>
                    <target>
                      <context value="proc"/>
                      <contextType value="variable"/>
                      <element value="reasonReference"/>
                      <transform value="copy"/>
                      <parameter>
                        <valueId value="reasonRef"/>
                      </parameter>
                    </target>
                  </rule>
                </rule>
              </rule>
            </rule>
          </rule>
        </rule>
      </rule>
    </rule>
  </group>
  <group>
    <name value="fillChargeItems"/>
    <typeMode value="none"/>
    <documentation
                   value="One ChargeItem per runtime contract (cid.primary answer.valueUri). ChargeItem.code is the Job-fixed GOÄ 252 Coding (http://fhir.de/CodeSystem/bäk/goä), never derived from CID identity or service codes. context from QR.encounter; subject from QR.subject; 1:n service lineage when performed; supportingInformation from diag.condition."/>
    <input>
      <name value="qr"/>
      <type value="QuestionnaireResponse"/>
      <mode value="source"/>
    </input>
    <input>
      <name value="bundle"/>
      <type value="Bundle"/>
      <mode value="target"/>
    </input>
    <input>
      <name value="subjectRef"/>
      <mode value="source"/>
    </input>
    <input>
      <name value="encRef"/>
      <mode value="source"/>
    </input>
    <rule>
      <name value="primaryFromValueUri"/>
      <source>
        <context value="qr"/>
        <element value="item"/>
        <variable value="cidItem"/>
        <condition value="linkId = 'cid.primary'"/>
      </source>
      <rule>
        <name value="cidAnswer"/>
        <source>
          <context value="cidItem"/>
          <element value="answer"/>
          <variable value="cidAns"/>
        </source>
        <rule>
          <name value="cidValue"/>
          <source>
            <context value="cidAns"/>
            <type value="uri"/>
            <element value="value"/>
            <variable value="primaryCid"/>
          </source>
          <target>
            <context value="bundle"/>
            <contextType value="variable"/>
            <element value="entry"/>
            <variable value="chg1Entry"/>
            <transform value="create"/>
          </target>
          <target>
            <context value="chg1Entry"/>
            <contextType value="variable"/>
            <element value="fullUrl"/>
            <transform value="copy"/>
            <parameter>
              <valueString
                           value="urn:uuid:00000000-0000-4000-8000-000000000004"/>
            </parameter>
          </target>
          <target>
            <context value="chg1Entry"/>
            <contextType value="variable"/>
            <element value="resource"/>
            <variable value="chg1"/>
            <transform value="create"/>
            <parameter>
              <valueString value="ChargeItem"/>
            </parameter>
          </target>
          <target>
            <context value="chg1"/>
            <contextType value="variable"/>
            <element value="status"/>
            <transform value="copy"/>
            <parameter>
              <valueString value="planned"/>
            </parameter>
          </target>
          <target>
            <context value="chg1"/>
            <contextType value="variable"/>
            <element value="subject"/>
            <transform value="copy"/>
            <parameter>
              <valueId value="subjectRef"/>
            </parameter>
          </target>
          <target>
            <context value="chg1"/>
            <contextType value="variable"/>
            <element value="context"/>
            <transform value="copy"/>
            <parameter>
              <valueId value="encRef"/>
            </parameter>
          </target>
          <target>
            <context value="chg1"/>
            <contextType value="variable"/>
            <element value="code"/>
            <variable value="chgCode"/>
            <transform value="create"/>
            <parameter>
              <valueString value="CodeableConcept"/>
            </parameter>
          </target>
          <target>
            <context value="chgCode"/>
            <contextType value="variable"/>
            <element value="coding"/>
            <variable value="fixedCoding"/>
            <transform value="create"/>
            <parameter>
              <valueString value="Coding"/>
            </parameter>
          </target>
          <target>
            <context value="fixedCoding"/>
            <contextType value="variable"/>
            <element value="system"/>
            <transform value="copy"/>
            <parameter>
              <valueString value="http://fhir.de/CodeSystem/bäk/goä"/>
            </parameter>
          </target>
          <target>
            <context value="fixedCoding"/>
            <contextType value="variable"/>
            <element value="code"/>
            <transform value="copy"/>
            <parameter>
              <valueString value="252"/>
            </parameter>
          </target>
          <target>
            <context value="fixedCoding"/>
            <contextType value="variable"/>
            <element value="display"/>
            <transform value="copy"/>
            <parameter>
              <valueString value="Injektion, s.c./s.m./i.c./i.m."/>
            </parameter>
          </target>
          <target>
            <context value="chg1"/>
            <contextType value="variable"/>
            <element value="definitionCanonical"/>
            <transform value="copy"/>
            <parameter>
              <valueId value="primaryCid"/>
            </parameter>
          </target>
          <target>
            <context value="chg1"/>
            <contextType value="variable"/>
            <element value="quantity"/>
            <variable value="qty"/>
            <transform value="create"/>
            <parameter>
              <valueString value="Quantity"/>
            </parameter>
          </target>
          <target>
            <context value="qty"/>
            <contextType value="variable"/>
            <element value="value"/>
            <transform value="copy"/>
            <parameter>
              <valueDecimal value="1"/>
            </parameter>
          </target>
          <rule>
            <name value="moneyFromParts"/>
            <source>
              <context value="qr"/>
              <element value="item"/>
              <variable value="amtItem"/>
              <condition value="linkId = 'fee.amount'"/>
            </source>
            <source>
              <context value="qr"/>
              <element value="item"/>
              <variable value="curItem"/>
              <condition value="linkId = 'fee.currency'"/>
            </source>
            <rule>
              <name value="amountAnswer"/>
              <source>
                <context value="amtItem"/>
                <element value="answer"/>
                <variable value="amtAns"/>
              </source>
              <rule>
                <name value="amountValue"/>
                <source>
                  <context value="amtAns"/>
                  <type value="decimal"/>
                  <element value="value"/>
                  <variable value="amount"/>
                </source>
                <rule>
                  <name value="currencyAnswer"/>
                  <source>
                    <context value="curItem"/>
                    <element value="answer"/>
                    <variable value="curAns"/>
                  </source>
                  <rule>
                    <name value="currencyValue"/>
                    <source>
                      <context value="curAns"/>
                      <type value="Coding"/>
                      <element value="value"/>
                      <variable value="curCoding"/>
                    </source>
                    <rule>
                      <name value="currencyCode"/>
                      <source>
                        <context value="curCoding"/>
                        <element value="code"/>
                        <variable value="currencyCode"/>
                      </source>
                      <target>
                        <context value="chg1"/>
                        <contextType value="variable"/>
                        <element value="priceOverride"/>
                        <variable value="money"/>
                        <transform value="create"/>
                        <parameter>
                          <valueString value="Money"/>
                        </parameter>
                      </target>
                      <target>
                        <context value="money"/>
                        <contextType value="variable"/>
                        <element value="value"/>
                        <transform value="copy"/>
                        <parameter>
                          <valueId value="amount"/>
                        </parameter>
                      </target>
                      <target>
                        <context value="money"/>
                        <contextType value="variable"/>
                        <element value="currency"/>
                        <transform value="copy"/>
                        <parameter>
                          <valueId value="currencyCode"/>
                        </parameter>
                      </target>
                    </rule>
                  </rule>
                </rule>
              </rule>
            </rule>
          </rule>
          <rule>
            <name value="serviceWhenPerformedPrimary"/>
            <source>
              <context value="qr"/>
              <element value="item"/>
              <variable value="perfItem"/>
              <condition
                         value="linkId = 'svc.performed' and answer.valueBoolean = true"/>
            </source>
            <target>
              <context value="chg1"/>
              <contextType value="variable"/>
              <element value="service"/>
              <variable value="svcProc"/>
              <transform value="create"/>
              <parameter>
                <valueString value="Reference"/>
              </parameter>
            </target>
            <target>
              <context value="svcProc"/>
              <contextType value="variable"/>
              <element value="reference"/>
              <transform value="copy"/>
              <parameter>
                <valueString
                             value="urn:uuid:00000000-0000-4000-8000-000000000003"/>
              </parameter>
            </target>
            <target>
              <context value="chg1"/>
              <contextType value="variable"/>
              <element value="service"/>
              <variable value="svcObs"/>
              <transform value="create"/>
              <parameter>
                <valueString value="Reference"/>
              </parameter>
            </target>
            <target>
              <context value="svcObs"/>
              <contextType value="variable"/>
              <element value="reference"/>
              <transform value="copy"/>
              <parameter>
                <valueString
                             value="urn:uuid:00000000-0000-4000-8000-000000000002"/>
              </parameter>
            </target>
          </rule>
          <rule>
            <name value="supportingInfoFromConditionRef"/>
            <source>
              <context value="qr"/>
              <element value="item"/>
              <variable value="diagRefItem2"/>
              <condition value="linkId = 'diag.condition'"/>
            </source>
            <rule>
              <name value="dr2Answer"/>
              <source>
                <context value="diagRefItem2"/>
                <element value="answer"/>
                <variable value="dr2Ans"/>
              </source>
              <rule>
                <name value="dr2Value"/>
                <source>
                  <context value="dr2Ans"/>
                  <type value="Reference"/>
                  <element value="value"/>
                  <variable value="reasonRef2"/>
                </source>
                <target>
                  <context value="chg1"/>
                  <contextType value="variable"/>
                  <element value="supportingInformation"/>
                  <transform value="copy"/>
                  <parameter>
                    <valueId value="reasonRef2"/>
                  </parameter>
                </target>
              </rule>
            </rule>
          </rule>
        </rule>
      </rule>
    </rule>
  </group>
  <group>
    <name value="fillComposition"/>
    <typeMode value="none"/>
    <documentation
                   value="Composition proposal (status=preliminary). subject/encounter/author/date from QR.subject/.encounter/.author/.authored only — never fabricated. Sections Reference generated Observation/ChargeItem UUIDs; optional Procedure/Condition sections when those outputs are produced."/>
    <input>
      <name value="qr"/>
      <type value="QuestionnaireResponse"/>
      <mode value="source"/>
    </input>
    <input>
      <name value="bundle"/>
      <type value="Bundle"/>
      <mode value="target"/>
    </input>
    <input>
      <name value="subjectRef"/>
      <mode value="source"/>
    </input>
    <input>
      <name value="encRef"/>
      <mode value="source"/>
    </input>
    <input>
      <name value="authorRef"/>
      <mode value="source"/>
    </input>
    <input>
      <name value="authoredDt"/>
      <mode value="source"/>
    </input>
    <rule>
      <name value="compositionShell"/>
      <source>
        <context value="qr"/>
      </source>
      <target>
        <context value="bundle"/>
        <contextType value="variable"/>
        <element value="entry"/>
        <variable value="compEntry"/>
        <transform value="create"/>
      </target>
      <target>
        <context value="compEntry"/>
        <contextType value="variable"/>
        <element value="fullUrl"/>
        <transform value="copy"/>
        <parameter>
          <valueString value="urn:uuid:00000000-0000-4000-8000-000000000006"/>
        </parameter>
      </target>
      <target>
        <context value="compEntry"/>
        <contextType value="variable"/>
        <element value="resource"/>
        <variable value="comp"/>
        <transform value="create"/>
        <parameter>
          <valueString value="Composition"/>
        </parameter>
      </target>
      <target>
        <context value="comp"/>
        <contextType value="variable"/>
        <element value="status"/>
        <transform value="copy"/>
        <parameter>
          <valueString value="preliminary"/>
        </parameter>
      </target>
      <target>
        <context value="comp"/>
        <contextType value="variable"/>
        <element value="type"/>
        <variable value="compType"/>
        <transform value="create"/>
        <parameter>
          <valueString value="CodeableConcept"/>
        </parameter>
      </target>
      <target>
        <context value="compType"/>
        <contextType value="variable"/>
        <element value="coding"/>
        <variable value="compTypeCoding"/>
        <transform value="create"/>
        <parameter>
          <valueString value="Coding"/>
        </parameter>
      </target>
      <target>
        <context value="compTypeCoding"/>
        <contextType value="variable"/>
        <element value="system"/>
        <transform value="copy"/>
        <parameter>
          <valueString value="http://loinc.org"/>
        </parameter>
      </target>
      <target>
        <context value="compTypeCoding"/>
        <contextType value="variable"/>
        <element value="code"/>
        <transform value="copy"/>
        <parameter>
          <valueString value="11506-3"/>
        </parameter>
      </target>
      <target>
        <context value="compTypeCoding"/>
        <contextType value="variable"/>
        <element value="display"/>
        <transform value="copy"/>
        <parameter>
          <valueString value="Progress note"/>
        </parameter>
      </target>
      <target>
        <context value="comp"/>
        <contextType value="variable"/>
        <element value="title"/>
        <transform value="copy"/>
        <parameter>
          <valueString
                       value="Upper-arm injection visit - pre-approval proposal"/>
        </parameter>
      </target>
      <target>
        <context value="comp"/>
        <contextType value="variable"/>
        <element value="subject"/>
        <transform value="copy"/>
        <parameter>
          <valueId value="subjectRef"/>
        </parameter>
      </target>
      <target>
        <context value="comp"/>
        <contextType value="variable"/>
        <element value="encounter"/>
        <transform value="copy"/>
        <parameter>
          <valueId value="encRef"/>
        </parameter>
      </target>
      <target>
        <context value="comp"/>
        <contextType value="variable"/>
        <element value="author"/>
        <transform value="copy"/>
        <parameter>
          <valueId value="authorRef"/>
        </parameter>
      </target>
      <target>
        <context value="comp"/>
        <contextType value="variable"/>
        <element value="date"/>
        <transform value="copy"/>
        <parameter>
          <valueId value="authoredDt"/>
        </parameter>
      </target>
      <target>
        <context value="comp"/>
        <contextType value="variable"/>
        <element value="section"/>
        <variable value="secDoc"/>
        <transform value="create"/>
      </target>
      <target>
        <context value="secDoc"/>
        <contextType value="variable"/>
        <element value="title"/>
        <transform value="copy"/>
        <parameter>
          <valueString value="Documentation"/>
        </parameter>
      </target>
      <target>
        <context value="secDoc"/>
        <contextType value="variable"/>
        <element value="entry"/>
        <variable value="docEntry"/>
        <transform value="create"/>
        <parameter>
          <valueString value="Reference"/>
        </parameter>
      </target>
      <target>
        <context value="docEntry"/>
        <contextType value="variable"/>
        <element value="reference"/>
        <transform value="copy"/>
        <parameter>
          <valueString value="urn:uuid:00000000-0000-4000-8000-000000000002"/>
        </parameter>
      </target>
      <target>
        <context value="comp"/>
        <contextType value="variable"/>
        <element value="section"/>
        <variable value="secBill"/>
        <transform value="create"/>
      </target>
      <target>
        <context value="secBill"/>
        <contextType value="variable"/>
        <element value="title"/>
        <transform value="copy"/>
        <parameter>
          <valueString value="Billing proposal"/>
        </parameter>
      </target>
      <target>
        <context value="secBill"/>
        <contextType value="variable"/>
        <element value="entry"/>
        <variable value="billEntry"/>
        <transform value="create"/>
        <parameter>
          <valueString value="Reference"/>
        </parameter>
      </target>
      <target>
        <context value="billEntry"/>
        <contextType value="variable"/>
        <element value="reference"/>
        <transform value="copy"/>
        <parameter>
          <valueString value="urn:uuid:00000000-0000-4000-8000-000000000004"/>
        </parameter>
      </target>
      <rule>
        <name value="sectionProcedureWhenPerformed"/>
        <source>
          <context value="qr"/>
          <element value="item"/>
          <variable value="perfItem"/>
          <condition
                     value="linkId = 'svc.performed' and answer.valueBoolean = true"/>
        </source>
        <target>
          <context value="comp"/>
          <contextType value="variable"/>
          <element value="section"/>
          <variable value="secProc"/>
          <transform value="create"/>
        </target>
        <target>
          <context value="secProc"/>
          <contextType value="variable"/>
          <element value="title"/>
          <transform value="copy"/>
          <parameter>
            <valueString value="Procedure proposal"/>
          </parameter>
        </target>
        <target>
          <context value="secProc"/>
          <contextType value="variable"/>
          <element value="entry"/>
          <variable value="procEntryRef"/>
          <transform value="create"/>
          <parameter>
            <valueString value="Reference"/>
          </parameter>
        </target>
        <target>
          <context value="procEntryRef"/>
          <contextType value="variable"/>
          <element value="reference"/>
          <transform value="copy"/>
          <parameter>
            <valueString
                         value="urn:uuid:00000000-0000-4000-8000-000000000003"/>
          </parameter>
        </target>
      </rule>
      <rule>
        <name value="sectionDiagnosisWhenCoding"/>
        <source>
          <context value="qr"/>
          <element value="item"/>
          <variable value="diagCodingItem"/>
          <condition value="linkId = 'diag.icd'"/>
        </source>
        <target>
          <context value="comp"/>
          <contextType value="variable"/>
          <element value="section"/>
          <variable value="secDx"/>
          <transform value="create"/>
        </target>
        <target>
          <context value="secDx"/>
          <contextType value="variable"/>
          <element value="title"/>
          <transform value="copy"/>
          <parameter>
            <valueString value="Diagnosis proposal"/>
          </parameter>
        </target>
        <target>
          <context value="secDx"/>
          <contextType value="variable"/>
          <element value="entry"/>
          <variable value="dxEntry"/>
          <transform value="create"/>
          <parameter>
            <valueString value="Reference"/>
          </parameter>
        </target>
        <target>
          <context value="dxEntry"/>
          <contextType value="variable"/>
          <element value="reference"/>
          <transform value="copy"/>
          <parameter>
            <valueString
                         value="urn:uuid:00000000-0000-4000-8000-000000000001"/>
          </parameter>
        </target>
      </rule>
    </rule>
  </group>
</StructureMap>