Ethiopia FHIR Implementation Guide - HIV Treatment & Care Services
1.0.1 - ci-build Ethiopia flag

Ethiopia FHIR Implementation Guide - HIV Treatment & Care Services, published by Jembi Health Systems. This guide is not an authorized publication; it is the continuous build for version 1.0.1 built by the FHIR (HL7® FHIR® Standard) CI Build. This version is based on the current content of https://github.com/jembi/ethiopia-hiv/ and changes regularly. See the Directory of published versions

: Map Breastfeeding Question to an Observation - XML Representation

Draft as of 2024-10-14

Raw xml | Download


<StructureMap xmlns="http://hl7.org/fhir">
  <id value="BreastfeedingStatusToObservation"/>
  <text>
    <status value="generated"/>
    <div xmlns="http://www.w3.org/1999/xhtml"><p class="res-header-id"><b>Generated Narrative: StructureMap BreastfeedingStatusToObservation</b></p><a name="BreastfeedingStatusToObservation"> </a><a name="hcBreastfeedingStatusToObservation"> </a><a name="BreastfeedingStatusToObservation-en-US"> </a><pre class="fml">
<b>map</b><span style="color: navy"> &quot;</span>http://moh.gov.et/fhir/hiv/StructureMap/BreastfeedingStatusToObservation<span style="color: navy">&quot; = &quot;</span>BreastfeedingStatusToObservation<span style="color: navy">&quot;

</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>as </b><b>source</b>
<b>uses</b><span style="color: navy"> &quot;</span><a href="StructureDefinition-breastfeeding-status-observation.html" title="Observation - Breastfeeding Status">http://moh.gov.et/fhir/hiv/StructureDefinition/breastfeeding-status-observation</a><span style="color: navy">&quot; </span><b>as </b><b>target</b>

<b>group </b>BreastfeedingStatusToObservation<span style="color: navy">(</span><b>source</b> <span style="color: maroon">src</span><span style="color: navy"> : </span>QuestionnaireResponse, <b>target</b> <span style="color: maroon">tgt</span><span style="color: navy"> : </span>Observation<span style="color: navy">)</span><span style="color: navy"> {
</span>  src<span style="color: navy"><b> -&gt; </b></span>tgt.id = <b>uuid</b><span style="color: navy">(</span><span style="color: navy">)</span> <i>&quot;SetObservationId&quot;</i><span style="color: navy">;</span>
  src<span style="color: navy"><b> -&gt; </b></span>tgt.status = <span style="color: blue">'final'</span> <i>&quot;SetStatusCodeValue&quot;</i><span style="color: navy">;</span>
  src<span style="color: navy"><b> -&gt; </b></span>tgt.code = <b>cc</b><span style="color: navy">(</span><span style="color: blue">'http://loinc.org'</span><span style="color: navy">, </span><span style="color: blue">'63895-7'</span><span style="color: navy">)</span> <i>&quot;SetCodeCodeableConcept&quot;</i><span style="color: navy">;</span>
  src.authored<b> as </b><span style="color: maroon">authored</span><span style="color: navy"><b> -&gt; </b></span>tgt.effective = <b>create</b><span style="color: navy">(</span><span style="color: blue">'dateTime'</span><span style="color: navy">)</span><b> as </b><span style="color: maroon">observationDate</span><b> then</b><span style="color: navy"> {
</span>    authored<b> as </b><span style="color: maroon">authoredDate</span><span style="color: navy"><b> -&gt; </b></span>observationDate = <span style="color: maroon">authoredDate</span> <i>&quot;SetObservationDate&quot;</i><span style="color: navy">;</span>
  <span style="color: navy">}</span> <i>&quot;ProcessObservationDate&quot;</i><span style="color: navy">;</span>
  src<span style="color: navy"><b> -&gt; </b></span>tgt.category = <b>cc</b><span style="color: navy">(</span><span style="color: blue">'http://hl7.org/fhir/observation-category'</span><span style="color: navy">, </span><span style="color: blue">'exam'</span><span style="color: navy">)</span> <i>&quot;SetCategoryCodeableConcept&quot;</i><span style="color: navy">;</span>
  src.subject<b> as </b><span style="color: maroon">patient</span><span style="color: navy"><b> -&gt; </b></span>tgt.subject = <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">subject</span><b> then</b><span style="color: navy"> {
</span>    patient<b> as </b><span style="color: maroon">pat</span><span style="color: navy"><b> -&gt; </b></span>subject.reference = <span style="color: maroon">pat</span> <i>&quot;SetPatientReference&quot;</i><span style="color: navy">;</span>
  <span style="color: navy">}</span> <i>&quot;ProcessPatientReference&quot;</i><span style="color: navy">;</span>
  src.author<b> as </b><span style="color: maroon">author</span><span style="color: navy"><b> -&gt; </b></span>tgt.performer = <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">performer</span><b> then</b><span style="color: navy"> {
</span>    author<b> as </b><span style="color: maroon">auth</span><span style="color: navy"><b> -&gt; </b></span>performer.reference = <span style="color: maroon">auth</span> <i>&quot;SetAuthorReference&quot;</i><span style="color: navy">;</span>
  <span style="color: navy">}</span> <i>&quot;ProcessAuthorReference&quot;</i><span style="color: navy">;</span>
  src.encounter<b> as </b><span style="color: maroon">QREncounter</span><span style="color: navy"><b> -&gt; </b></span>tgt.encounter = <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">ObsEncounter</span><b> then</b><span style="color: navy"> {
</span>    QREncounter<b> as </b><span style="color: maroon">enc</span><span style="color: navy"><b> -&gt; </b></span>ObsEncounter.reference = <span style="color: maroon">enc</span> <i>&quot;SetEncounterReference&quot;</i><span style="color: navy">;</span>
  <span style="color: navy">}</span> <i>&quot;ProcessAuthorReference&quot;</i><span style="color: navy">;</span>
  src.item<b> as </b><span style="color: maroon">item</span><b> where </b>(linkId = 'is-breast-feeding')<b> then</b><span style="color: navy"> {
</span>    item.answer first<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">breastfeeding</span><span style="color: navy"><b> -&gt; </b></span>tgt.value = <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">breastfeedingValue</span><b> then</b><span style="color: navy"> {
</span>        breastfeeding<span style="color: navy"><b> -&gt; </b></span>breastfeedingValue = <b>translate</b><span style="color: navy">(</span><span style="color: maroon">breastfeeding</span><span style="color: navy">, </span><span style="color: blue">'http://moh.gov.et/fhir/hiv/ConceptMap/LOINCCodesToProprietary'</span><span style="color: navy">, </span><span style="color: blue">'code'</span><span style="color: navy">)</span> <i>&quot;SeBbreastfeedingCoding&quot;</i><span style="color: navy">;</span>
      <span style="color: navy">}</span><span style="color: navy">;</span>
    <span style="color: navy">}</span><span style="color: navy">;</span>
  <span style="color: navy">}</span><span style="color: navy">;</span>
<span style="color: navy">}

</span></pre></div>
  </text>
  <url
       value="http://moh.gov.et/fhir/hiv/StructureMap/BreastfeedingStatusToObservation"/>
  <version value="1.0.1"/>
  <name value="BreastfeedingStatusToObservation"/>
  <status value="draft"/>
  <date value="2024-10-14T10:58:37+00:00"/>
  <publisher value="Jembi Health Systems"/>
  <contact>
    <name value="Jembi Health Systems"/>
    <telecom>
      <system value="url"/>
      <value value="https://www.jembi.org"/>
    </telecom>
    <telecom>
      <system value="email"/>
      <value value="info@jembi.org"/>
    </telecom>
  </contact>
  <contact>
    <name value="Jembi Health Systems"/>
    <telecom>
      <system value="email"/>
      <value value="info@jembi.org"/>
      <use value="work"/>
    </telecom>
  </contact>
  <jurisdiction>
    <coding>
      <system value="urn:iso:std:iso:3166"/>
      <code value="ET"/>
      <display value="Ethiopia"/>
    </coding>
  </jurisdiction>
  <structure>
    <url
         value="http://hl7.org/fhir/StructureDefinition/QuestionnaireResponse"/>
    <mode value="source"/>
  </structure>
  <structure>
    <url
         value="http://moh.gov.et/fhir/hiv/StructureDefinition/breastfeeding-status-observation"/>
    <mode value="target"/>
  </structure>
  <group>
    <name value="BreastfeedingStatusToObservation"/>
    <typeMode value="none"/>
    <input>
      <name value="src"/>
      <type value="QuestionnaireResponse"/>
      <mode value="source"/>
    </input>
    <input>
      <name value="tgt"/>
      <type value="Observation"/>
      <mode value="target"/>
    </input>
    <rule>
      <name value="SetObservationId"/>
      <source>
        <context value="src"/>
      </source>
      <target>
        <context value="tgt"/>
        <contextType value="variable"/>
        <element value="id"/>
        <transform value="uuid"/>
      </target>
    </rule>
    <rule>
      <name value="SetStatusCodeValue"/>
      <source>
        <context value="src"/>
      </source>
      <target>
        <context value="tgt"/>
        <contextType value="variable"/>
        <element value="status"/>
        <transform value="copy"/>
        <parameter>
          <valueString value="final"/>
        </parameter>
      </target>
    </rule>
    <rule>
      <name value="SetCodeCodeableConcept"/>
      <source>
        <context value="src"/>
      </source>
      <target>
        <context value="tgt"/>
        <contextType value="variable"/>
        <element value="code"/>
        <transform value="cc"/>
        <parameter>
          <valueString value="http://loinc.org"/>
        </parameter>
        <parameter>
          <valueString value="63895-7"/>
        </parameter>
      </target>
    </rule>
    <rule>
      <name value="ProcessObservationDate"/>
      <source>
        <context value="src"/>
        <element value="authored"/>
        <variable value="authored"/>
      </source>
      <target>
        <context value="tgt"/>
        <contextType value="variable"/>
        <element value="effective"/>
        <variable value="observationDate"/>
        <transform value="create"/>
        <parameter>
          <valueString value="dateTime"/>
        </parameter>
      </target>
      <rule>
        <name value="SetObservationDate"/>
        <source>
          <context value="authored"/>
          <variable value="authoredDate"/>
        </source>
        <target>
          <context value="observationDate"/>
          <contextType value="variable"/>
          <transform value="copy"/>
          <parameter>
            <valueId value="authoredDate"/>
          </parameter>
        </target>
      </rule>
    </rule>
    <rule>
      <name value="SetCategoryCodeableConcept"/>
      <source>
        <context value="src"/>
      </source>
      <target>
        <context value="tgt"/>
        <contextType value="variable"/>
        <element value="category"/>
        <transform value="cc"/>
        <parameter>
          <valueString value="http://hl7.org/fhir/observation-category"/>
        </parameter>
        <parameter>
          <valueString value="exam"/>
        </parameter>
      </target>
    </rule>
    <rule>
      <name value="ProcessPatientReference"/>
      <source>
        <context value="src"/>
        <element value="subject"/>
        <variable value="patient"/>
      </source>
      <target>
        <context value="tgt"/>
        <contextType value="variable"/>
        <element value="subject"/>
        <variable value="subject"/>
        <transform value="create"/>
        <parameter>
          <valueString value="Reference"/>
        </parameter>
      </target>
      <rule>
        <name value="SetPatientReference"/>
        <source>
          <context value="patient"/>
          <variable value="pat"/>
        </source>
        <target>
          <context value="subject"/>
          <contextType value="variable"/>
          <element value="reference"/>
          <transform value="copy"/>
          <parameter>
            <valueId value="pat"/>
          </parameter>
        </target>
      </rule>
    </rule>
    <rule>
      <name value="ProcessAuthorReference"/>
      <source>
        <context value="src"/>
        <element value="author"/>
        <variable value="author"/>
      </source>
      <target>
        <context value="tgt"/>
        <contextType value="variable"/>
        <element value="performer"/>
        <variable value="performer"/>
        <transform value="create"/>
        <parameter>
          <valueString value="Reference"/>
        </parameter>
      </target>
      <rule>
        <name value="SetAuthorReference"/>
        <source>
          <context value="author"/>
          <variable value="auth"/>
        </source>
        <target>
          <context value="performer"/>
          <contextType value="variable"/>
          <element value="reference"/>
          <transform value="copy"/>
          <parameter>
            <valueId value="auth"/>
          </parameter>
        </target>
      </rule>
    </rule>
    <rule>
      <name value="ProcessAuthorReference"/>
      <source>
        <context value="src"/>
        <element value="encounter"/>
        <variable value="QREncounter"/>
      </source>
      <target>
        <context value="tgt"/>
        <contextType value="variable"/>
        <element value="encounter"/>
        <variable value="ObsEncounter"/>
        <transform value="create"/>
        <parameter>
          <valueString value="Reference"/>
        </parameter>
      </target>
      <rule>
        <name value="SetEncounterReference"/>
        <source>
          <context value="QREncounter"/>
          <variable value="enc"/>
        </source>
        <target>
          <context value="ObsEncounter"/>
          <contextType value="variable"/>
          <element value="reference"/>
          <transform value="copy"/>
          <parameter>
            <valueId value="enc"/>
          </parameter>
        </target>
      </rule>
    </rule>
    <rule>
      <name value="item"/>
      <source>
        <context value="src"/>
        <element value="item"/>
        <variable value="item"/>
        <condition value="(linkId = 'is-breast-feeding')"/>
      </source>
      <rule>
        <name value="answer"/>
        <source>
          <context value="item"/>
          <element value="answer"/>
          <listMode value="first"/>
          <variable value="ans"/>
        </source>
        <rule>
          <name value="valueCoding"/>
          <source>
            <context value="ans"/>
            <type value="Coding"/>
            <element value="value"/>
            <variable value="breastfeeding"/>
          </source>
          <target>
            <context value="tgt"/>
            <contextType value="variable"/>
            <element value="value"/>
            <variable value="breastfeedingValue"/>
            <transform value="create"/>
            <parameter>
              <valueString value="CodeableConcept"/>
            </parameter>
          </target>
          <rule>
            <name value="SeBbreastfeedingCoding"/>
            <source>
              <context value="breastfeeding"/>
            </source>
            <target>
              <context value="breastfeedingValue"/>
              <contextType value="variable"/>
              <transform value="translate"/>
              <parameter>
                <valueId value="breastfeeding"/>
              </parameter>
              <parameter>
                <valueString
                             value="http://moh.gov.et/fhir/hiv/ConceptMap/LOINCCodesToProprietary"/>
              </parameter>
              <parameter>
                <valueString value="code"/>
              </parameter>
            </target>
          </rule>
        </rule>
      </rule>
    </rule>
  </group>
</StructureMap>