WHO Clinical Care in Crisis Implementation Guide for Children
0.1.0 - ci-build

WHO Clinical Care in Crisis Implementation Guide for Children - Local Development build (v0.1.0). See the Directory of published versions

: che.ab.registration.p - XML Representation

Active as of 2023-10-04

Raw xml | Download



<StructureMap xmlns="http://hl7.org/fhir">
  <id value="che.ab.registration.p"/>
  <text>
    <status value="generated"/>
    <div xmlns="http://www.w3.org/1999/xhtml"><pre>map &quot;https://fhir.dk.swisstph-mis.ch/matchbox/fhir/StructureMap/che.ab.registration.p&quot; = &quot;che.ab.registration.p&quot;


uses &quot;http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaireresponse&quot; alias 'questionnaireResponse' as source
uses &quot;http://hl7.org/fhir/StructureDefinition/Bundle&quot; alias 'Bundle' as target
uses &quot;https://fhir.dk.swisstph-mis.ch/matchbox/fhir/StructureDefinition/patient&quot; alias 'Patient' as target
uses &quot;https://fhir.dk.swisstph-mis.ch/matchbox/fhir/StructureDefinition/relatedperson&quot; alias 'RelatedPerson' as target
uses &quot;https://fhir.dk.swisstph-mis.ch/matchbox/fhir/StructureDefinition/chepatient&quot; alias 'CHE Patient' as produced
uses &quot;https://fhir.dk.swisstph-mis.ch/matchbox/fhir/StructureDefinition/relatedperson&quot; alias 'RelatedPerson' as produced

group bundletrans(source src : questionnaireResponse, target bundle : Bundle) {
  src -&gt; bundle.id = uuid() &quot;id&quot;;
  src -&gt; bundle.type = 'batch' &quot;type&quot;;
  src -&gt; bundle.entry as entry then {
    src.subject as subject then {
      subject.id as idval -&gt;  entry.request as request,  request.method = 'PUT',  request.url = append('/Patient/', idval) &quot;1153aa45&quot;;
    } &quot;cf5b2513&quot;;
    src -&gt; entry.resource = create('Patient') as tgt then {
      src -&gt; tgt then chepatient(src, tgt) &quot;aeaea6b3&quot;;
    } &quot;650d46f5&quot;;
  } &quot;put-chepatient&quot;;
  src.item first as itm1 where linkId = 'CHE.A.DE21.1' then {
    itm1.item first as item where (linkId = 'relatedpersonid') and answer.exists() then {
      src -&gt;  bundle.entry as entry,  entry.request as request,  request.method = 'POST',  entry.resource = create('RelatedPerson') as tgt then {
        src -&gt; tgt then relatedperson(src, tgt) &quot;8f0b9602&quot;;
        item.answer first as a then {
          a.value as val -&gt; request.url = append('/RelatedPerson/', val) &quot;78d8bc69&quot;;
        } &quot;eec70023&quot;;
      } &quot;00574b8e&quot;;
    } &quot;74cc3511&quot;;
  } &quot;8d1e77b2&quot;;
}

group SetOfficalGivenNamechepatient(source src, target tgt) {
  src -&gt; tgt.use = 'official' then {
    src.item first as item where (linkId = 'CHE.A.DE06') and answer.exists() then {
      item.answer first as a then {
        a.value as val -&gt; tgt.family = val &quot;77d1bd4f&quot;;
      } &quot;e0827d5d&quot;;
    } &quot;05f39f04&quot;;
    src.item first as item where (linkId = 'CHE.A.DE04') and answer.exists() then {
      item.answer first as a then {
        a.value as val -&gt; tgt.given = val &quot;5d3d44f6&quot;;
      } &quot;18edd234&quot;;
    } &quot;56b027a8&quot;;
    src.item first as item where (linkId = 'CHE.A.DE05') and answer.exists() then {
      item.answer first as a then {
        a.value as val -&gt; tgt.given = val &quot;5d3d44f6&quot;;
      } &quot;18edd234&quot;;
    } &quot;c5614af6&quot;;
  } &quot;58cbfc0e&quot;;
}

group chepatient(source src : questionnaireResponse, target tgt : Patient) {
  src.item first as item where (linkId = 'CHE.A.DE01') and answer.exists() then {
    item.answer first as a then {
      a.value as val -&gt; tgt.identifier = create('Identifier') as identifier then {
        val -&gt;  identifier.value = val,  identifier.use = 'official' &quot;id&quot;;
      } &quot;acheade01&quot;;
    } &quot;acheade01&quot;;
  } &quot;902cc63a&quot;;
  src.item first as item where (linkId = 'CHE.A.DE03') and answer.exists() then {
    item.answer first as a -&gt;  tgt.extension = create('Extension') as ext,  ext.url = 'https://fhir.dk.swisstph-mis.ch/matchbox/fhir/StructureDefinition/anonymous',  ext.value = true &quot;acheade03&quot;;
  } &quot;b340c8a7&quot;;
  src.item first as item where (linkId = 'CHE.A.DE06') or (linkId = 'CHE.A.DE04') or ((linkId = 'CHE.A.DE05') and answer.exists()) then {
    src -&gt;  tgt as target,  target.name as name then SetOfficalGivenNamechepatient(src, name) &quot;0417ff44&quot;;
  } &quot;8f5be461&quot;;
  src.item first as item where (linkId = 'CHE.A.DE12') and answer.exists() then {
    item.answer first as a then {
      a.value as val -&gt;  tgt.extension = create('Extension') as ext,  ext.url = 'https://fhir.dk.swisstph-mis.ch/matchbox/fhir/StructureDefinition/birthDateEstimator',  ext.value = val &quot;acheade12&quot;;
    } &quot;acheade12&quot;;
  } &quot;25a5a38f&quot;;
  src.item first as item where (linkId = 'CHE.A.DE08') and answer.exists() then {
    item.answer first as a then {
      a.value as val -&gt; tgt.birthDate = val &quot;acheade08&quot;;
    } &quot;acheade08&quot;;
  } &quot;0906a0f7&quot;;
  src.item first as item where (linkId = 'CHE.A.DE09') and answer.exists() then {
    item.answer first as a then {
      a.value as val -&gt;  tgt.extension = create('Extension') as ext,  ext.url = 'https://fhir.dk.swisstph-mis.ch/matchbox/fhir/Extension/hourofbirth',  ext.value = val &quot;acheade09&quot;;
    } &quot;acheade09&quot;;
  } &quot;7c2b1795&quot;;
  src.item first as item where (linkId = 'CHE.A.DE16') and answer.exists() then {
    item.answer first as a then MapValueSetExtCodecheade16(a, tgt) &quot;e48fa315&quot;;
  } &quot;842c1fa2&quot;;
  src.item first as item where (linkId = 'CHE.A.DE48') and answer.exists() then {
    item.answer first as a -&gt;  tgt.extension = create('Extension') as ext,  ext.url = 'https://fhir.dk.swisstph-mis.ch/matchbox/fhir/StructureDefinition/primarycaregiver',  ext.value = create('Reference') as ref,  ref.reference = 'relatated-person-id' &quot;acheade48&quot;;
  } &quot;50e8f3b4&quot;;
  src.item first as item where (linkId = 'CHE.A.DE31') and answer.exists() then {
    item.answer first as a then {
      a.value as val -&gt;  tgt.extension = create('Extension') as ext,  ext.url = 'https://fhir.dk.swisstph-mis.ch/matchbox/fhir/Extension/motherVitalStatus',  ext.value = val &quot;acheade31&quot;;
    } &quot;acheade31&quot;;
  } &quot;29bdd7f8&quot;;
}

group SetOfficalGivenNamerelatedperson(source src, target tgt) {
  src -&gt; tgt.use = 'official' then {
    src.item first as itm1 where linkId = 'CHE.A.DE21.1' then {
      itm1.item first as item where (linkId = 'CHE.A.DE23') and answer.exists() then {
        item.answer first as a then {
          a.value as val -&gt; tgt.family = val &quot;77d1bd4f&quot;;
        } &quot;e0827d5d&quot;;
      } &quot;96a1f6a1&quot;;
    } &quot;c5b295d3&quot;;
    src.item first as itm1 where linkId = 'CHE.A.DE21.1' then {
      itm1.item first as item where (linkId = 'CHE.A.DE21') and answer.exists() then {
        item.answer first as a then {
          a.value as val -&gt; tgt.given = val &quot;5d3d44f6&quot;;
        } &quot;18edd234&quot;;
      } &quot;beeb4341&quot;;
    } &quot;61b58988&quot;;
    src.item first as itm1 where linkId = 'CHE.A.DE21.1' then {
      itm1.item first as item where (linkId = 'CHE.A.DE22') and answer.exists() then {
        item.answer first as a then {
          a.value as val -&gt; tgt.given = val &quot;5d3d44f6&quot;;
        } &quot;18edd234&quot;;
      } &quot;5f1009c5&quot;;
    } &quot;0600eedb&quot;;
  } &quot;bf3c2d7c&quot;;
}

group MapValueSetExtCodecheade24(source src, target tgt) {
  src -&gt; tgt then {
    src -&gt;  tgt.relationship = create('CodeableConcept') as cc,  cc.coding = create('Coding') as coding &quot;f8b67f8d&quot;;
  } &quot;8ba0311a&quot;;
}

group relatedperson(source src : questionnaireResponse, target tgt : RelatedPerson) {
  src.item first as item where (linkId = 'CHErelatedpersoncaregiverid') and answer.exists() then {
    item.answer first as a then {
      a.value as val -&gt;  tgt.extension = create('Extension') as ext,  ext.url = 'https://fhir.dk.swisstph-mis.ch/matchbox/fhir/StructureDefinition/primary-caregiver',  ext.value = create('Reference') as ref,  ref.reference = append('/RelatedPerson/', val) &quot;acherelatedpersoncaregiverid&quot;;
    } &quot;acherelatedpersoncaregiverid&quot;;
  } &quot;8162f965&quot;;
  src.item first as itm1 where linkId = 'CHE.A.DE21.1' then {
    itm1.item first as item where (linkId = 'CHE.A.DE23') or (linkId = 'CHE.A.DE21') or ((linkId = 'CHE.A.DE22') and answer.exists()) then {
      src -&gt;  tgt as target,  target.name as name then SetOfficalGivenNamerelatedperson(src, name) &quot;8e1455ea&quot;;
    } &quot;dddc7053&quot;;
  } &quot;a89a14fb&quot;;
  src.item first as item where (linkId = 'CHE.A.DE24') and answer.exists() then {
    item.answer first as a then MapValueSetExtCodecheade24(a, tgt) &quot;ede36463&quot;;
  } &quot;387fd192&quot;;
  src.item first as itm1 where linkId = 'CHE.A.DE21.1' then {
    itm1.item first as item where (linkId = 'relatedpersonid') and answer.exists() then {
      item.answer first as a -&gt; tgt then {
        src.subject as subject -&gt; tgt.patient = subject &quot;patient&quot;;
      } &quot;arelatedpersonid&quot;;
    } &quot;d79d72db&quot;;
  } &quot;88cbce55&quot;;
  src.item first as itm1 where linkId = 'CHE.A.DE21.1' then {
    itm1.item first as item where (linkId = 'CHE.A.DE35') and answer.exists() then {
      item.answer first as a then {
        a.value as val -&gt;  tgt.telecom = create('ContactPoint') as tel,  tel.system = 'phone',  tel.use = 'mobile',  tel.value = val,  tel.rank = 1 &quot;acheade35&quot;;
      } &quot;acheade35&quot;;
    } &quot;3c5d318c&quot;;
  } &quot;9b9bbd1a&quot;;
  src.item first as itm1 where linkId = 'CHE.A.DE21.1' then {
    itm1.item first as item where (linkId = 'CHE.A.DE36') and answer.exists() then {
      item.answer first as a then {
        a.value as val -&gt;  tgt.telecom = create('ContactPoint') as tel,  tel.system = 'phone',  tel.use = 'mobile',  tel.value = val,  tel.rank = 2 &quot;acheade36&quot;;
      } &quot;acheade36&quot;;
    } &quot;17b42518&quot;;
  } &quot;15079f58&quot;;
  src.item first as itm1 where linkId = 'CHE.A.DE21.1' then {
    itm1.item first as item where (linkId = 'CHE.A.DE37') and answer.exists() then {
      item.answer first as a then {
        a.value as val -&gt;  tgt.telecom = create('ContactPoint') as tel,  tel.system = 'phone',  tel.use = 'mobile',  tel.value = val,  tel.rank = 3 &quot;acheade37&quot;;
      } &quot;acheade37&quot;;
    } &quot;8395c849&quot;;
  } &quot;36230b88&quot;;
}

</pre></div>
  </text>
  <url
       value="https://fhir.dk.swisstph-mis.ch/matchbox/fhir/StructureMap/che.ab.registration.p"/>
  <version value="0.1.0"/>
  <name value="che.ab.registration.p"/>
  <status value="active"/>
  <date value="2023-10-04T12:32:21+00:00"/>
  <publisher value="WHO"/>
  <contact>
    <name value="WHO"/>
    <telecom>
      <system value="url"/>
      <value value="http://who.int"/>
    </telecom>
  </contact>
  <structure>
    <url
         value="http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaireresponse"/>
    <mode value="source"/>
    <alias value="'questionnaireResponse'"/>
  </structure>
  <structure>
    <url value="http://hl7.org/fhir/StructureDefinition/Bundle"/>
    <mode value="target"/>
    <alias value="'Bundle'"/>
  </structure>
  <structure>
    <url
         value="https://fhir.dk.swisstph-mis.ch/matchbox/fhir/StructureDefinition/patient"/>
    <mode value="target"/>
    <alias value="'Patient'"/>
  </structure>
  <structure>
    <url
         value="https://fhir.dk.swisstph-mis.ch/matchbox/fhir/StructureDefinition/relatedperson"/>
    <mode value="target"/>
    <alias value="'RelatedPerson'"/>
  </structure>
  <structure>
    <url
         value="https://fhir.dk.swisstph-mis.ch/matchbox/fhir/StructureDefinition/chepatient"/>
    <mode value="produced"/>
    <alias value="'CHE Patient'"/>
  </structure>
  <structure>
    <url
         value="https://fhir.dk.swisstph-mis.ch/matchbox/fhir/StructureDefinition/relatedperson"/>
    <mode value="produced"/>
    <alias value="'RelatedPerson'"/>
  </structure>
  <group>
    <name value="bundletrans"/>
    <typeMode value="none"/>
    <input>
      <name value="src"/>
      <type value="questionnaireResponse"/>
      <mode value="source"/>
    </input>
    <input>
      <name value="bundle"/>
      <type value="Bundle"/>
      <mode value="target"/>
    </input>
    <rule>
      <name value="id"/>
      <source>
        <context value="src"/>
      </source>
      <target>
        <context value="bundle"/>
        <contextType value="variable"/>
        <element value="id"/>
        <transform value="uuid"/>
      </target>
    </rule>
    <rule>
      <name value="type"/>
      <source>
        <context value="src"/>
      </source>
      <target>
        <context value="bundle"/>
        <contextType value="variable"/>
        <element value="type"/>
        <transform value="copy"/>
        <parameter>
          <valueString value="batch"/>
        </parameter>
      </target>
    </rule>
    <rule>
      <name value="put-chepatient"/>
      <source>
        <context value="src"/>
      </source>
      <target>
        <context value="bundle"/>
        <contextType value="variable"/>
        <element value="entry"/>
        <variable value="entry"/>
      </target>
      <rule>
        <name value="cf5b2513"/>
        <source>
          <context value="src"/>
          <element value="subject"/>
          <variable value="subject"/>
        </source>
        <rule>
          <name value="1153aa45"/>
          <source>
            <context value="subject"/>
            <element value="id"/>
            <variable value="idval"/>
          </source>
          <target>
            <context value="entry"/>
            <contextType value="variable"/>
            <element value="request"/>
            <variable value="request"/>
          </target>
          <target>
            <context value="request"/>
            <contextType value="variable"/>
            <element value="method"/>
            <transform value="copy"/>
            <parameter>
              <valueString value="PUT"/>
            </parameter>
          </target>
          <target>
            <context value="request"/>
            <contextType value="variable"/>
            <element value="url"/>
            <transform value="append"/>
            <parameter>
              <valueString value="/Patient/"/>
            </parameter>
            <parameter>
              <valueId value="idval"/>
            </parameter>
          </target>
        </rule>
      </rule>
      <rule>
        <name value="650d46f5"/>
        <source>
          <context value="src"/>
        </source>
        <target>
          <context value="entry"/>
          <contextType value="variable"/>
          <element value="resource"/>
          <variable value="tgt"/>
          <transform value="create"/>
          <parameter>
            <valueString value="Patient"/>
          </parameter>
        </target>
        <rule>
          <name value="aeaea6b3"/>
          <source>
            <context value="src"/>
          </source>
          <target>
            <contextType value="variable"/>
            <transform value="copy"/>
            <parameter>
              <valueId value="tgt"/>
            </parameter>
          </target>
          <dependent>
            <name value="chepatient"/>
            <variable value="src"/>
            <variable value="tgt"/>
          </dependent>
        </rule>
      </rule>
    </rule>
    <rule>
      <name value="8d1e77b2"/>
      <source>
        <context value="src"/>
        <element value="item"/>
        <listMode value="first"/>
        <variable value="itm1"/>
        <condition value="linkId = 'CHE.A.DE21.1'"/>
      </source>
      <rule>
        <name value="74cc3511"/>
        <source>
          <context value="itm1"/>
          <element value="item"/>
          <listMode value="first"/>
          <variable value="item"/>
          <condition
                     value="(linkId = 'relatedpersonid') and answer.exists()"/>
        </source>
        <rule>
          <name value="00574b8e"/>
          <source>
            <context value="src"/>
          </source>
          <target>
            <context value="bundle"/>
            <contextType value="variable"/>
            <element value="entry"/>
            <variable value="entry"/>
          </target>
          <target>
            <context value="entry"/>
            <contextType value="variable"/>
            <element value="request"/>
            <variable value="request"/>
          </target>
          <target>
            <context value="request"/>
            <contextType value="variable"/>
            <element value="method"/>
            <transform value="copy"/>
            <parameter>
              <valueString value="POST"/>
            </parameter>
          </target>
          <target>
            <context value="entry"/>
            <contextType value="variable"/>
            <element value="resource"/>
            <variable value="tgt"/>
            <transform value="create"/>
            <parameter>
              <valueString value="RelatedPerson"/>
            </parameter>
          </target>
          <rule>
            <name value="8f0b9602"/>
            <source>
              <context value="src"/>
            </source>
            <target>
              <contextType value="variable"/>
              <transform value="copy"/>
              <parameter>
                <valueId value="tgt"/>
              </parameter>
            </target>
            <dependent>
              <name value="relatedperson"/>
              <variable value="src"/>
              <variable value="tgt"/>
            </dependent>
          </rule>
          <rule>
            <name value="eec70023"/>
            <source>
              <context value="item"/>
              <element value="answer"/>
              <listMode value="first"/>
              <variable value="a"/>
            </source>
            <rule>
              <name value="78d8bc69"/>
              <source>
                <context value="a"/>
                <element value="value"/>
                <variable value="val"/>
              </source>
              <target>
                <context value="request"/>
                <contextType value="variable"/>
                <element value="url"/>
                <transform value="append"/>
                <parameter>
                  <valueString value="/RelatedPerson/"/>
                </parameter>
                <parameter>
                  <valueId value="val"/>
                </parameter>
              </target>
            </rule>
          </rule>
        </rule>
      </rule>
    </rule>
  </group>
  <group>
    <name value="SetOfficalGivenNamechepatient"/>
    <typeMode value="none"/>
    <input>
      <name value="src"/>
      <mode value="source"/>
    </input>
    <input>
      <name value="tgt"/>
      <mode value="target"/>
    </input>
    <rule>
      <name value="58cbfc0e"/>
      <source>
        <context value="src"/>
      </source>
      <target>
        <context value="tgt"/>
        <contextType value="variable"/>
        <element value="use"/>
        <transform value="copy"/>
        <parameter>
          <valueString value="official"/>
        </parameter>
      </target>
      <rule>
        <name value="05f39f04"/>
        <source>
          <context value="src"/>
          <element value="item"/>
          <listMode value="first"/>
          <variable value="item"/>
          <condition value="(linkId = 'CHE.A.DE06') and answer.exists()"/>
        </source>
        <rule>
          <name value="e0827d5d"/>
          <source>
            <context value="item"/>
            <element value="answer"/>
            <listMode value="first"/>
            <variable value="a"/>
          </source>
          <rule>
            <name value="77d1bd4f"/>
            <source>
              <context value="a"/>
              <element value="value"/>
              <variable value="val"/>
            </source>
            <target>
              <context value="tgt"/>
              <contextType value="variable"/>
              <element value="family"/>
              <transform value="copy"/>
              <parameter>
                <valueId value="val"/>
              </parameter>
            </target>
          </rule>
        </rule>
      </rule>
      <rule>
        <name value="56b027a8"/>
        <source>
          <context value="src"/>
          <element value="item"/>
          <listMode value="first"/>
          <variable value="item"/>
          <condition value="(linkId = 'CHE.A.DE04') and answer.exists()"/>
        </source>
        <rule>
          <name value="18edd234"/>
          <source>
            <context value="item"/>
            <element value="answer"/>
            <listMode value="first"/>
            <variable value="a"/>
          </source>
          <rule>
            <name value="5d3d44f6"/>
            <source>
              <context value="a"/>
              <element value="value"/>
              <variable value="val"/>
            </source>
            <target>
              <context value="tgt"/>
              <contextType value="variable"/>
              <element value="given"/>
              <transform value="copy"/>
              <parameter>
                <valueId value="val"/>
              </parameter>
            </target>
          </rule>
        </rule>
      </rule>
      <rule>
        <name value="c5614af6"/>
        <source>
          <context value="src"/>
          <element value="item"/>
          <listMode value="first"/>
          <variable value="item"/>
          <condition value="(linkId = 'CHE.A.DE05') and answer.exists()"/>
        </source>
        <rule>
          <name value="18edd234"/>
          <source>
            <context value="item"/>
            <element value="answer"/>
            <listMode value="first"/>
            <variable value="a"/>
          </source>
          <rule>
            <name value="5d3d44f6"/>
            <source>
              <context value="a"/>
              <element value="value"/>
              <variable value="val"/>
            </source>
            <target>
              <context value="tgt"/>
              <contextType value="variable"/>
              <element value="given"/>
              <transform value="copy"/>
              <parameter>
                <valueId value="val"/>
              </parameter>
            </target>
          </rule>
        </rule>
      </rule>
    </rule>
  </group>
  <group>
    <name value="chepatient"/>
    <typeMode value="none"/>
    <input>
      <name value="src"/>
      <type value="questionnaireResponse"/>
      <mode value="source"/>
    </input>
    <input>
      <name value="tgt"/>
      <type value="Patient"/>
      <mode value="target"/>
    </input>
    <rule>
      <name value="902cc63a"/>
      <source>
        <context value="src"/>
        <element value="item"/>
        <listMode value="first"/>
        <variable value="item"/>
        <condition value="(linkId = 'CHE.A.DE01') and answer.exists()"/>
      </source>
      <rule>
        <name value="acheade01"/>
        <source>
          <context value="item"/>
          <element value="answer"/>
          <listMode value="first"/>
          <variable value="a"/>
        </source>
        <rule>
          <name value="acheade01"/>
          <source>
            <context value="a"/>
            <element value="value"/>
            <variable value="val"/>
          </source>
          <target>
            <context value="tgt"/>
            <contextType value="variable"/>
            <element value="identifier"/>
            <variable value="identifier"/>
            <transform value="create"/>
            <parameter>
              <valueString value="Identifier"/>
            </parameter>
          </target>
          <rule>
            <name value="id"/>
            <source>
              <context value="val"/>
            </source>
            <target>
              <context value="identifier"/>
              <contextType value="variable"/>
              <element value="value"/>
              <transform value="copy"/>
              <parameter>
                <valueId value="val"/>
              </parameter>
            </target>
            <target>
              <context value="identifier"/>
              <contextType value="variable"/>
              <element value="use"/>
              <transform value="copy"/>
              <parameter>
                <valueString value="official"/>
              </parameter>
            </target>
          </rule>
        </rule>
      </rule>
    </rule>
    <rule>
      <name value="b340c8a7"/>
      <source>
        <context value="src"/>
        <element value="item"/>
        <listMode value="first"/>
        <variable value="item"/>
        <condition value="(linkId = 'CHE.A.DE03') and answer.exists()"/>
      </source>
      <rule>
        <name value="acheade03"/>
        <source>
          <context value="item"/>
          <element value="answer"/>
          <listMode value="first"/>
          <variable value="a"/>
        </source>
        <target>
          <context value="tgt"/>
          <contextType value="variable"/>
          <element value="extension"/>
          <variable value="ext"/>
          <transform value="create"/>
          <parameter>
            <valueString value="Extension"/>
          </parameter>
        </target>
        <target>
          <context value="ext"/>
          <contextType value="variable"/>
          <element value="url"/>
          <transform value="copy"/>
          <parameter>
            <valueString
                         value="https://fhir.dk.swisstph-mis.ch/matchbox/fhir/StructureDefinition/anonymous"/>
          </parameter>
        </target>
        <target>
          <context value="ext"/>
          <contextType value="variable"/>
          <element value="value"/>
          <transform value="copy"/>
          <parameter>
            <valueBoolean value="true"/>
          </parameter>
        </target>
      </rule>
    </rule>
    <rule>
      <name value="8f5be461"/>
      <source>
        <context value="src"/>
        <element value="item"/>
        <listMode value="first"/>
        <variable value="item"/>
        <condition
                   value="(linkId = 'CHE.A.DE06') or (linkId = 'CHE.A.DE04') or ((linkId = 'CHE.A.DE05') and answer.exists())"/>
      </source>
      <rule>
        <name value="0417ff44"/>
        <source>
          <context value="src"/>
        </source>
        <target>
          <contextType value="variable"/>
          <variable value="target"/>
          <transform value="copy"/>
          <parameter>
            <valueId value="tgt"/>
          </parameter>
        </target>
        <target>
          <context value="target"/>
          <contextType value="variable"/>
          <element value="name"/>
          <variable value="name"/>
        </target>
        <dependent>
          <name value="SetOfficalGivenNamechepatient"/>
          <variable value="src"/>
          <variable value="name"/>
        </dependent>
      </rule>
    </rule>
    <rule>
      <name value="25a5a38f"/>
      <source>
        <context value="src"/>
        <element value="item"/>
        <listMode value="first"/>
        <variable value="item"/>
        <condition value="(linkId = 'CHE.A.DE12') and answer.exists()"/>
      </source>
      <rule>
        <name value="acheade12"/>
        <source>
          <context value="item"/>
          <element value="answer"/>
          <listMode value="first"/>
          <variable value="a"/>
        </source>
        <rule>
          <name value="acheade12"/>
          <source>
            <context value="a"/>
            <element value="value"/>
            <variable value="val"/>
          </source>
          <target>
            <context value="tgt"/>
            <contextType value="variable"/>
            <element value="extension"/>
            <variable value="ext"/>
            <transform value="create"/>
            <parameter>
              <valueString value="Extension"/>
            </parameter>
          </target>
          <target>
            <context value="ext"/>
            <contextType value="variable"/>
            <element value="url"/>
            <transform value="copy"/>
            <parameter>
              <valueString
                           value="https://fhir.dk.swisstph-mis.ch/matchbox/fhir/StructureDefinition/birthDateEstimator"/>
            </parameter>
          </target>
          <target>
            <context value="ext"/>
            <contextType value="variable"/>
            <element value="value"/>
            <transform value="copy"/>
            <parameter>
              <valueId value="val"/>
            </parameter>
          </target>
        </rule>
      </rule>
    </rule>
    <rule>
      <name value="0906a0f7"/>
      <source>
        <context value="src"/>
        <element value="item"/>
        <listMode value="first"/>
        <variable value="item"/>
        <condition value="(linkId = 'CHE.A.DE08') and answer.exists()"/>
      </source>
      <rule>
        <name value="acheade08"/>
        <source>
          <context value="item"/>
          <element value="answer"/>
          <listMode value="first"/>
          <variable value="a"/>
        </source>
        <rule>
          <name value="acheade08"/>
          <source>
            <context value="a"/>
            <element value="value"/>
            <variable value="val"/>
          </source>
          <target>
            <context value="tgt"/>
            <contextType value="variable"/>
            <element value="birthDate"/>
            <transform value="copy"/>
            <parameter>
              <valueId value="val"/>
            </parameter>
          </target>
        </rule>
      </rule>
    </rule>
    <rule>
      <name value="7c2b1795"/>
      <source>
        <context value="src"/>
        <element value="item"/>
        <listMode value="first"/>
        <variable value="item"/>
        <condition value="(linkId = 'CHE.A.DE09') and answer.exists()"/>
      </source>
      <rule>
        <name value="acheade09"/>
        <source>
          <context value="item"/>
          <element value="answer"/>
          <listMode value="first"/>
          <variable value="a"/>
        </source>
        <rule>
          <name value="acheade09"/>
          <source>
            <context value="a"/>
            <element value="value"/>
            <variable value="val"/>
          </source>
          <target>
            <context value="tgt"/>
            <contextType value="variable"/>
            <element value="extension"/>
            <variable value="ext"/>
            <transform value="create"/>
            <parameter>
              <valueString value="Extension"/>
            </parameter>
          </target>
          <target>
            <context value="ext"/>
            <contextType value="variable"/>
            <element value="url"/>
            <transform value="copy"/>
            <parameter>
              <valueString
                           value="https://fhir.dk.swisstph-mis.ch/matchbox/fhir/Extension/hourofbirth"/>
            </parameter>
          </target>
          <target>
            <context value="ext"/>
            <contextType value="variable"/>
            <element value="value"/>
            <transform value="copy"/>
            <parameter>
              <valueId value="val"/>
            </parameter>
          </target>
        </rule>
      </rule>
    </rule>
    <rule>
      <name value="842c1fa2"/>
      <source>
        <context value="src"/>
        <element value="item"/>
        <listMode value="first"/>
        <variable value="item"/>
        <condition value="(linkId = 'CHE.A.DE16') and answer.exists()"/>
      </source>
      <rule>
        <name value="e48fa315"/>
        <source>
          <context value="item"/>
          <element value="answer"/>
          <listMode value="first"/>
          <variable value="a"/>
        </source>
        <dependent>
          <name value="MapValueSetExtCodecheade16"/>
          <variable value="a"/>
          <variable value="tgt"/>
        </dependent>
      </rule>
    </rule>
    <rule>
      <name value="50e8f3b4"/>
      <source>
        <context value="src"/>
        <element value="item"/>
        <listMode value="first"/>
        <variable value="item"/>
        <condition value="(linkId = 'CHE.A.DE48') and answer.exists()"/>
      </source>
      <rule>
        <name value="acheade48"/>
        <source>
          <context value="item"/>
          <element value="answer"/>
          <listMode value="first"/>
          <variable value="a"/>
        </source>
        <target>
          <context value="tgt"/>
          <contextType value="variable"/>
          <element value="extension"/>
          <variable value="ext"/>
          <transform value="create"/>
          <parameter>
            <valueString value="Extension"/>
          </parameter>
        </target>
        <target>
          <context value="ext"/>
          <contextType value="variable"/>
          <element value="url"/>
          <transform value="copy"/>
          <parameter>
            <valueString
                         value="https://fhir.dk.swisstph-mis.ch/matchbox/fhir/StructureDefinition/primarycaregiver"/>
          </parameter>
        </target>
        <target>
          <context value="ext"/>
          <contextType value="variable"/>
          <element value="value"/>
          <variable value="ref"/>
          <transform value="create"/>
          <parameter>
            <valueString value="Reference"/>
          </parameter>
        </target>
        <target>
          <context value="ref"/>
          <contextType value="variable"/>
          <element value="reference"/>
          <transform value="copy"/>
          <parameter>
            <valueString value="relatated-person-id"/>
          </parameter>
        </target>
      </rule>
    </rule>
    <rule>
      <name value="29bdd7f8"/>
      <source>
        <context value="src"/>
        <element value="item"/>
        <listMode value="first"/>
        <variable value="item"/>
        <condition value="(linkId = 'CHE.A.DE31') and answer.exists()"/>
      </source>
      <rule>
        <name value="acheade31"/>
        <source>
          <context value="item"/>
          <element value="answer"/>
          <listMode value="first"/>
          <variable value="a"/>
        </source>
        <rule>
          <name value="acheade31"/>
          <source>
            <context value="a"/>
            <element value="value"/>
            <variable value="val"/>
          </source>
          <target>
            <context value="tgt"/>
            <contextType value="variable"/>
            <element value="extension"/>
            <variable value="ext"/>
            <transform value="create"/>
            <parameter>
              <valueString value="Extension"/>
            </parameter>
          </target>
          <target>
            <context value="ext"/>
            <contextType value="variable"/>
            <element value="url"/>
            <transform value="copy"/>
            <parameter>
              <valueString
                           value="https://fhir.dk.swisstph-mis.ch/matchbox/fhir/Extension/motherVitalStatus"/>
            </parameter>
          </target>
          <target>
            <context value="ext"/>
            <contextType value="variable"/>
            <element value="value"/>
            <transform value="copy"/>
            <parameter>
              <valueId value="val"/>
            </parameter>
          </target>
        </rule>
      </rule>
    </rule>
  </group>
  <group>
    <name value="SetOfficalGivenNamerelatedperson"/>
    <typeMode value="none"/>
    <input>
      <name value="src"/>
      <mode value="source"/>
    </input>
    <input>
      <name value="tgt"/>
      <mode value="target"/>
    </input>
    <rule>
      <name value="bf3c2d7c"/>
      <source>
        <context value="src"/>
      </source>
      <target>
        <context value="tgt"/>
        <contextType value="variable"/>
        <element value="use"/>
        <transform value="copy"/>
        <parameter>
          <valueString value="official"/>
        </parameter>
      </target>
      <rule>
        <name value="c5b295d3"/>
        <source>
          <context value="src"/>
          <element value="item"/>
          <listMode value="first"/>
          <variable value="itm1"/>
          <condition value="linkId = 'CHE.A.DE21.1'"/>
        </source>
        <rule>
          <name value="96a1f6a1"/>
          <source>
            <context value="itm1"/>
            <element value="item"/>
            <listMode value="first"/>
            <variable value="item"/>
            <condition value="(linkId = 'CHE.A.DE23') and answer.exists()"/>
          </source>
          <rule>
            <name value="e0827d5d"/>
            <source>
              <context value="item"/>
              <element value="answer"/>
              <listMode value="first"/>
              <variable value="a"/>
            </source>
            <rule>
              <name value="77d1bd4f"/>
              <source>
                <context value="a"/>
                <element value="value"/>
                <variable value="val"/>
              </source>
              <target>
                <context value="tgt"/>
                <contextType value="variable"/>
                <element value="family"/>
                <transform value="copy"/>
                <parameter>
                  <valueId value="val"/>
                </parameter>
              </target>
            </rule>
          </rule>
        </rule>
      </rule>
      <rule>
        <name value="61b58988"/>
        <source>
          <context value="src"/>
          <element value="item"/>
          <listMode value="first"/>
          <variable value="itm1"/>
          <condition value="linkId = 'CHE.A.DE21.1'"/>
        </source>
        <rule>
          <name value="beeb4341"/>
          <source>
            <context value="itm1"/>
            <element value="item"/>
            <listMode value="first"/>
            <variable value="item"/>
            <condition value="(linkId = 'CHE.A.DE21') and answer.exists()"/>
          </source>
          <rule>
            <name value="18edd234"/>
            <source>
              <context value="item"/>
              <element value="answer"/>
              <listMode value="first"/>
              <variable value="a"/>
            </source>
            <rule>
              <name value="5d3d44f6"/>
              <source>
                <context value="a"/>
                <element value="value"/>
                <variable value="val"/>
              </source>
              <target>
                <context value="tgt"/>
                <contextType value="variable"/>
                <element value="given"/>
                <transform value="copy"/>
                <parameter>
                  <valueId value="val"/>
                </parameter>
              </target>
            </rule>
          </rule>
        </rule>
      </rule>
      <rule>
        <name value="0600eedb"/>
        <source>
          <context value="src"/>
          <element value="item"/>
          <listMode value="first"/>
          <variable value="itm1"/>
          <condition value="linkId = 'CHE.A.DE21.1'"/>
        </source>
        <rule>
          <name value="5f1009c5"/>
          <source>
            <context value="itm1"/>
            <element value="item"/>
            <listMode value="first"/>
            <variable value="item"/>
            <condition value="(linkId = 'CHE.A.DE22') and answer.exists()"/>
          </source>
          <rule>
            <name value="18edd234"/>
            <source>
              <context value="item"/>
              <element value="answer"/>
              <listMode value="first"/>
              <variable value="a"/>
            </source>
            <rule>
              <name value="5d3d44f6"/>
              <source>
                <context value="a"/>
                <element value="value"/>
                <variable value="val"/>
              </source>
              <target>
                <context value="tgt"/>
                <contextType value="variable"/>
                <element value="given"/>
                <transform value="copy"/>
                <parameter>
                  <valueId value="val"/>
                </parameter>
              </target>
            </rule>
          </rule>
        </rule>
      </rule>
    </rule>
  </group>
  <group>
    <name value="MapValueSetExtCodecheade24"/>
    <typeMode value="none"/>
    <input>
      <name value="src"/>
      <mode value="source"/>
    </input>
    <input>
      <name value="tgt"/>
      <mode value="target"/>
    </input>
    <rule>
      <name value="8ba0311a"/>
      <source>
        <context value="src"/>
      </source>
      <target>
        <contextType value="variable"/>
        <transform value="copy"/>
        <parameter>
          <valueId value="tgt"/>
        </parameter>
      </target>
      <rule>
        <name value="f8b67f8d"/>
        <source>
          <context value="src"/>
        </source>
        <target>
          <context value="tgt"/>
          <contextType value="variable"/>
          <element value="relationship"/>
          <variable value="cc"/>
          <transform value="create"/>
          <parameter>
            <valueString value="CodeableConcept"/>
          </parameter>
        </target>
        <target>
          <context value="cc"/>
          <contextType value="variable"/>
          <element value="coding"/>
          <variable value="coding"/>
          <transform value="create"/>
          <parameter>
            <valueString value="Coding"/>
          </parameter>
        </target>
      </rule>
    </rule>
  </group>
  <group>
    <name value="relatedperson"/>
    <typeMode value="none"/>
    <input>
      <name value="src"/>
      <type value="questionnaireResponse"/>
      <mode value="source"/>
    </input>
    <input>
      <name value="tgt"/>
      <type value="RelatedPerson"/>
      <mode value="target"/>
    </input>
    <rule>
      <name value="8162f965"/>
      <source>
        <context value="src"/>
        <element value="item"/>
        <listMode value="first"/>
        <variable value="item"/>
        <condition
                   value="(linkId = 'CHErelatedpersoncaregiverid') and answer.exists()"/>
      </source>
      <rule>
        <name value="acherelatedpersoncaregiverid"/>
        <source>
          <context value="item"/>
          <element value="answer"/>
          <listMode value="first"/>
          <variable value="a"/>
        </source>
        <rule>
          <name value="acherelatedpersoncaregiverid"/>
          <source>
            <context value="a"/>
            <element value="value"/>
            <variable value="val"/>
          </source>
          <target>
            <context value="tgt"/>
            <contextType value="variable"/>
            <element value="extension"/>
            <variable value="ext"/>
            <transform value="create"/>
            <parameter>
              <valueString value="Extension"/>
            </parameter>
          </target>
          <target>
            <context value="ext"/>
            <contextType value="variable"/>
            <element value="url"/>
            <transform value="copy"/>
            <parameter>
              <valueString
                           value="https://fhir.dk.swisstph-mis.ch/matchbox/fhir/StructureDefinition/primary-caregiver"/>
            </parameter>
          </target>
          <target>
            <context value="ext"/>
            <contextType value="variable"/>
            <element value="value"/>
            <variable value="ref"/>
            <transform value="create"/>
            <parameter>
              <valueString value="Reference"/>
            </parameter>
          </target>
          <target>
            <context value="ref"/>
            <contextType value="variable"/>
            <element value="reference"/>
            <transform value="append"/>
            <parameter>
              <valueString value="/RelatedPerson/"/>
            </parameter>
            <parameter>
              <valueId value="val"/>
            </parameter>
          </target>
        </rule>
      </rule>
    </rule>
    <rule>
      <name value="a89a14fb"/>
      <source>
        <context value="src"/>
        <element value="item"/>
        <listMode value="first"/>
        <variable value="itm1"/>
        <condition value="linkId = 'CHE.A.DE21.1'"/>
      </source>
      <rule>
        <name value="dddc7053"/>
        <source>
          <context value="itm1"/>
          <element value="item"/>
          <listMode value="first"/>
          <variable value="item"/>
          <condition
                     value="(linkId = 'CHE.A.DE23') or (linkId = 'CHE.A.DE21') or ((linkId = 'CHE.A.DE22') and answer.exists())"/>
        </source>
        <rule>
          <name value="8e1455ea"/>
          <source>
            <context value="src"/>
          </source>
          <target>
            <contextType value="variable"/>
            <variable value="target"/>
            <transform value="copy"/>
            <parameter>
              <valueId value="tgt"/>
            </parameter>
          </target>
          <target>
            <context value="target"/>
            <contextType value="variable"/>
            <element value="name"/>
            <variable value="name"/>
          </target>
          <dependent>
            <name value="SetOfficalGivenNamerelatedperson"/>
            <variable value="src"/>
            <variable value="name"/>
          </dependent>
        </rule>
      </rule>
    </rule>
    <rule>
      <name value="387fd192"/>
      <source>
        <context value="src"/>
        <element value="item"/>
        <listMode value="first"/>
        <variable value="item"/>
        <condition value="(linkId = 'CHE.A.DE24') and answer.exists()"/>
      </source>
      <rule>
        <name value="ede36463"/>
        <source>
          <context value="item"/>
          <element value="answer"/>
          <listMode value="first"/>
          <variable value="a"/>
        </source>
        <dependent>
          <name value="MapValueSetExtCodecheade24"/>
          <variable value="a"/>
          <variable value="tgt"/>
        </dependent>
      </rule>
    </rule>
    <rule>
      <name value="88cbce55"/>
      <source>
        <context value="src"/>
        <element value="item"/>
        <listMode value="first"/>
        <variable value="itm1"/>
        <condition value="linkId = 'CHE.A.DE21.1'"/>
      </source>
      <rule>
        <name value="d79d72db"/>
        <source>
          <context value="itm1"/>
          <element value="item"/>
          <listMode value="first"/>
          <variable value="item"/>
          <condition
                     value="(linkId = 'relatedpersonid') and answer.exists()"/>
        </source>
        <rule>
          <name value="arelatedpersonid"/>
          <source>
            <context value="item"/>
            <element value="answer"/>
            <listMode value="first"/>
            <variable value="a"/>
          </source>
          <target>
            <contextType value="variable"/>
            <transform value="copy"/>
            <parameter>
              <valueId value="tgt"/>
            </parameter>
          </target>
          <rule>
            <name value="patient"/>
            <source>
              <context value="src"/>
              <element value="subject"/>
              <variable value="subject"/>
            </source>
            <target>
              <context value="tgt"/>
              <contextType value="variable"/>
              <element value="patient"/>
              <transform value="copy"/>
              <parameter>
                <valueId value="subject"/>
              </parameter>
            </target>
          </rule>
        </rule>
      </rule>
    </rule>
    <rule>
      <name value="9b9bbd1a"/>
      <source>
        <context value="src"/>
        <element value="item"/>
        <listMode value="first"/>
        <variable value="itm1"/>
        <condition value="linkId = 'CHE.A.DE21.1'"/>
      </source>
      <rule>
        <name value="3c5d318c"/>
        <source>
          <context value="itm1"/>
          <element value="item"/>
          <listMode value="first"/>
          <variable value="item"/>
          <condition value="(linkId = 'CHE.A.DE35') and answer.exists()"/>
        </source>
        <rule>
          <name value="acheade35"/>
          <source>
            <context value="item"/>
            <element value="answer"/>
            <listMode value="first"/>
            <variable value="a"/>
          </source>
          <rule>
            <name value="acheade35"/>
            <source>
              <context value="a"/>
              <element value="value"/>
              <variable value="val"/>
            </source>
            <target>
              <context value="tgt"/>
              <contextType value="variable"/>
              <element value="telecom"/>
              <variable value="tel"/>
              <transform value="create"/>
              <parameter>
                <valueString value="ContactPoint"/>
              </parameter>
            </target>
            <target>
              <context value="tel"/>
              <contextType value="variable"/>
              <element value="system"/>
              <transform value="copy"/>
              <parameter>
                <valueString value="phone"/>
              </parameter>
            </target>
            <target>
              <context value="tel"/>
              <contextType value="variable"/>
              <element value="use"/>
              <transform value="copy"/>
              <parameter>
                <valueString value="mobile"/>
              </parameter>
            </target>
            <target>
              <context value="tel"/>
              <contextType value="variable"/>
              <element value="value"/>
              <transform value="copy"/>
              <parameter>
                <valueId value="val"/>
              </parameter>
            </target>
            <target>
              <context value="tel"/>
              <contextType value="variable"/>
              <element value="rank"/>
              <transform value="copy"/>
              <parameter>
                <valueInteger value="1"/>
              </parameter>
            </target>
          </rule>
        </rule>
      </rule>
    </rule>
    <rule>
      <name value="15079f58"/>
      <source>
        <context value="src"/>
        <element value="item"/>
        <listMode value="first"/>
        <variable value="itm1"/>
        <condition value="linkId = 'CHE.A.DE21.1'"/>
      </source>
      <rule>
        <name value="17b42518"/>
        <source>
          <context value="itm1"/>
          <element value="item"/>
          <listMode value="first"/>
          <variable value="item"/>
          <condition value="(linkId = 'CHE.A.DE36') and answer.exists()"/>
        </source>
        <rule>
          <name value="acheade36"/>
          <source>
            <context value="item"/>
            <element value="answer"/>
            <listMode value="first"/>
            <variable value="a"/>
          </source>
          <rule>
            <name value="acheade36"/>
            <source>
              <context value="a"/>
              <element value="value"/>
              <variable value="val"/>
            </source>
            <target>
              <context value="tgt"/>
              <contextType value="variable"/>
              <element value="telecom"/>
              <variable value="tel"/>
              <transform value="create"/>
              <parameter>
                <valueString value="ContactPoint"/>
              </parameter>
            </target>
            <target>
              <context value="tel"/>
              <contextType value="variable"/>
              <element value="system"/>
              <transform value="copy"/>
              <parameter>
                <valueString value="phone"/>
              </parameter>
            </target>
            <target>
              <context value="tel"/>
              <contextType value="variable"/>
              <element value="use"/>
              <transform value="copy"/>
              <parameter>
                <valueString value="mobile"/>
              </parameter>
            </target>
            <target>
              <context value="tel"/>
              <contextType value="variable"/>
              <element value="value"/>
              <transform value="copy"/>
              <parameter>
                <valueId value="val"/>
              </parameter>
            </target>
            <target>
              <context value="tel"/>
              <contextType value="variable"/>
              <element value="rank"/>
              <transform value="copy"/>
              <parameter>
                <valueInteger value="2"/>
              </parameter>
            </target>
          </rule>
        </rule>
      </rule>
    </rule>
    <rule>
      <name value="36230b88"/>
      <source>
        <context value="src"/>
        <element value="item"/>
        <listMode value="first"/>
        <variable value="itm1"/>
        <condition value="linkId = 'CHE.A.DE21.1'"/>
      </source>
      <rule>
        <name value="8395c849"/>
        <source>
          <context value="itm1"/>
          <element value="item"/>
          <listMode value="first"/>
          <variable value="item"/>
          <condition value="(linkId = 'CHE.A.DE37') and answer.exists()"/>
        </source>
        <rule>
          <name value="acheade37"/>
          <source>
            <context value="item"/>
            <element value="answer"/>
            <listMode value="first"/>
            <variable value="a"/>
          </source>
          <rule>
            <name value="acheade37"/>
            <source>
              <context value="a"/>
              <element value="value"/>
              <variable value="val"/>
            </source>
            <target>
              <context value="tgt"/>
              <contextType value="variable"/>
              <element value="telecom"/>
              <variable value="tel"/>
              <transform value="create"/>
              <parameter>
                <valueString value="ContactPoint"/>
              </parameter>
            </target>
            <target>
              <context value="tel"/>
              <contextType value="variable"/>
              <element value="system"/>
              <transform value="copy"/>
              <parameter>
                <valueString value="phone"/>
              </parameter>
            </target>
            <target>
              <context value="tel"/>
              <contextType value="variable"/>
              <element value="use"/>
              <transform value="copy"/>
              <parameter>
                <valueString value="mobile"/>
              </parameter>
            </target>
            <target>
              <context value="tel"/>
              <contextType value="variable"/>
              <element value="value"/>
              <transform value="copy"/>
              <parameter>
                <valueId value="val"/>
              </parameter>
            </target>
            <target>
              <context value="tel"/>
              <contextType value="variable"/>
              <element value="rank"/>
              <transform value="copy"/>
              <parameter>
                <valueInteger value="3"/>
              </parameter>
            </target>
          </rule>
        </rule>
      </rule>
    </rule>
  </group>
</StructureMap>