WHO Digital Documentation of COVID-19 Certificates (DDCC)
1.0.0 - CI Build International flag

This page is part of the WHO Digital Documentation of COVID-19 Certificates (DDCC) (v1.0.0: releases Draft) based on FHIR (HL7® FHIR® Standard) R4. This is the current published version. For a full list of available versions, see the Directory of published versions

: null - XML Representation

Draft as of 2024-10-15

Raw xml | Download


<StructureMap xmlns="http://hl7.org/fhir">
  <id value="SHCToCoreDataSetTR"/>
  <text>
    <status value="generated"/>
    <div xmlns="http://www.w3.org/1999/xhtml"><p class="res-header-id"><b>Generated Narrative: StructureMap SHCToCoreDataSetTR</b></p><a name="SHCToCoreDataSetTR"> </a><a name="hcSHCToCoreDataSetTR"> </a><a name="SHCToCoreDataSetTR-en-US"> </a><pre class="fml">
<b>map</b><span style="color: navy"> &quot;</span>http://smart.who.int/ddcc/StructureMap/SHCToCoreDataSetTR<span style="color: navy">&quot; = &quot;</span>SHCToCoreDataSetTR<span style="color: navy">&quot;

</span><b>uses</b><span style="color: navy"> &quot;</span>http://hl7.org/fhir/uv/shc-vaccination/StructureDefinition/shc-infectious-disease-laboratory-bundle-dm<span style="color: navy">&quot; </span><b>alias </b>SHCLabBundleDM <b>as </b><b>source</b>
<b>uses</b><span style="color: navy"> &quot;</span>http://hl7.org/fhir/uv/shc-vaccination/StructureDefinition/shc-patient-general-dm<span style="color: navy">&quot; </span><b>alias </b>SHCPatientDM <b>as </b><b>source</b>
<b>uses</b><span style="color: navy"> &quot;</span>http://hl7.org/fhir/uv/shc-vaccination/StructureDefinition/shc-infectious-disease-laboratory-result-observation-dm<span style="color: navy">&quot; </span><b>alias </b>SHCLabDM <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>DDCCBundle <b>as </b><b>target</b>
<b>uses</b><span style="color: navy"> &quot;</span><a href="StructureDefinition-DDCCCoreDataSetTR.html" title="DDCC Core Data Set Logical Model for Test Result">http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSetTR</a><span style="color: navy">&quot; </span><b>alias </b>DDCCTR <b>as </b><b>target</b>

<b>group </b>SHCToTR<span style="color: navy">(</span><b>source</b> <span style="color: maroon">shc</span><span style="color: navy"> : </span>SHCLabBundleDM, <b>target</b> <span style="color: maroon">ddccBundle</span><span style="color: navy"> : </span>DDCCBundle<span style="color: navy">)</span><span style="color: navy"> {
</span>  shc.entry<b> as </b><span style="color: maroon">patientEntrySHC</span><b> then</b><span style="color: navy"> {
</span>    patientEntrySHC.resource<span style="color: navy"> : </span>Patient first<b> as </b><span style="color: maroon">patient</span><b> then</b><span style="color: navy"> {
</span>      shc.entry<b> as </b><span style="color: maroon">entry</span><b> then</b><span style="color: navy"> {
</span>        <span style="color: navy">// </span><span style="color: green">entry.resource : Immunization as immunization where vaccineCode.memberOf('http://smart.who.int/ddcc/ValueSet/who-ddcc-allowed-vaccines-covid-19') -&gt;  ddccBundle.entry as outentry,  create('http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSetVS') as ddcc then {</span>
        entry.resource<span style="color: navy"> : </span>Observation<b> as </b><span style="color: maroon">lab</span><span style="color: navy"><b> -&gt; </b></span> ddccBundle.entry<b> as </b><span style="color: maroon">outentry</span><span style="color: navy">, </span> <b>create</b><span style="color: navy">(</span><span style="color: blue">'http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSetTR'</span><span style="color: navy">)</span><b> as </b><span style="color: maroon">ddcc</span><b> then</b><span style="color: navy"> {
</span>          lab<b> then </b>PatientToDDCCTR<span style="color: navy">(</span><span style="color: maroon">patient</span><span style="color: navy">, </span><span style="color: maroon">ddcc</span><span style="color: navy">)</span> <i>&quot;set patient&quot;</i><span style="color: navy">;</span>
          lab<span style="color: navy"><b> -&gt; </b></span>ddcc.test<b> as </b><span style="color: maroon">test</span><b> then </b>LabToDDCC<span style="color: navy">(</span><span style="color: maroon">lab</span><span style="color: navy">, </span><span style="color: maroon">test</span><span style="color: navy">)</span> <i>&quot;set test&quot;</i><span style="color: navy">;</span>
          lab<span style="color: navy"><b> -&gt; </b></span>outentry.resource = <span style="color: maroon">ddcc</span> <i>&quot;set outentry&quot;</i><span style="color: navy">;</span>
        <span style="color: navy">}</span> <i>&quot;labs&quot;</i><span style="color: navy">;</span>
      <span style="color: navy">}</span> <i>&quot;entries&quot;</i><span style="color: navy">;</span>
    <span style="color: navy">}</span> <i>&quot;get patient&quot;</i><span style="color: navy">;</span>
  <span style="color: navy">}</span> <i>&quot;find patient&quot;</i><span style="color: navy">;</span>
<span style="color: navy">}

</span><b>group </b>PatientToDDCCTR<span style="color: navy">(</span><b>source</b> <span style="color: maroon">patient</span><span style="color: navy"> : </span>SHCPatientDM, <b>target</b> <span style="color: maroon">tgt</span><span style="color: navy"> : </span>DDCCTR<span style="color: navy">)</span><span style="color: navy"> {
</span>  patient.name<b> as </b><span style="color: maroon">name</span><b> then </b>NameToText<span style="color: navy">(</span><span style="color: maroon">name</span><span style="color: navy">, </span><span style="color: maroon">tgt</span><span style="color: navy">)</span> <i>&quot;set name&quot;</i><span style="color: navy">;</span>
  patient.birthDate<b> as </b><span style="color: maroon">birthDate</span><span style="color: navy"><b> -&gt; </b></span>tgt.birthDate = <span style="color: maroon">birthDate</span> <i>&quot;set birthDate&quot;</i><span style="color: navy">;</span>
  patient.identifier first<b> as </b><span style="color: maroon">identifier</span><span style="color: navy"><b> -&gt; </b></span>tgt.identifier = <span style="color: maroon">identifier</span> <i>&quot;set identifier&quot;</i><span style="color: navy">;</span>
<span style="color: navy">}

</span><b>group </b>NameToText<span style="color: navy">(</span><b>source</b> <span style="color: maroon">name</span><span style="color: navy"> : </span>HumanName, <b>target</b> <span style="color: maroon">ddcc</span><span style="color: navy">)</span><span style="color: navy"> {
</span>  <span style="color: navy">// </span><span style="color: green">append doesn't work until ddcc.name is set</span>
  name.given first<b> as </b><span style="color: maroon">given</span><span style="color: navy"><b> -&gt; </b></span>ddcc.name = <span style="color: navy">(</span>given.replaceMatches('$', ' ')<span style="color: navy">)</span> <i>&quot;set first name&quot;</i><span style="color: navy">;</span>
  <span style="color: #b36b00" title="This element was not defined prior to R5">// name.given not_first as other -&gt; ddcc.name as tName, ddcc.name = append( tName, other ) &quot;set other names&quot;;</span>
  name.given not_first<b> as </b><span style="color: maroon">other</span><span style="color: navy"><b> -&gt; </b></span> ddcc.name<b> as </b><span style="color: maroon">tName</span><span style="color: navy">, </span> <span style="color: navy">(</span>other.replaceMatches('$', ' ')<span style="color: navy">)</span><b> as </b><span style="color: maroon">spaced</span><span style="color: navy">, </span> ddcc.name = <b>append</b><span style="color: navy">(</span><span style="color: maroon">tName</span><span style="color: navy">, </span><span style="color: maroon">spaced</span><span style="color: navy">)</span> <i>&quot;set other names&quot;</i><span style="color: navy">;</span>
  name.family<b> as </b><span style="color: maroon">family</span><span style="color: navy"><b> -&gt; </b></span> ddcc.name<b> as </b><span style="color: maroon">tName</span><span style="color: navy">, </span> ddcc.name = <b>append</b><span style="color: navy">(</span><span style="color: maroon">tName</span><span style="color: navy">, </span><span style="color: maroon">family</span><span style="color: navy">)</span> <i>&quot;add family name&quot;</i><span style="color: navy">;</span>
  name.text<b> as </b><span style="color: maroon">text</span><span style="color: navy"><b> -&gt; </b></span>ddcc.name = <span style="color: maroon">text</span> <i>&quot;set full name&quot;</i><span style="color: navy">;</span>
<span style="color: navy">}

</span><b>group </b>LabToDDCC<span style="color: navy">(</span><b>source</b> <span style="color: maroon">lab</span><span style="color: navy"> : </span>SHCLabDM, <b>target</b> <span style="color: maroon">test</span><span style="color: navy">)</span><span style="color: navy"> {
</span>  lab.code<b> as </b><span style="color: maroon">code</span><b> then</b><span style="color: navy"> {
</span>    code.coding first<b> as </b><span style="color: maroon">labType</span><b> then</b><span style="color: navy"> {
</span>      labType<span style="color: navy"><b> -&gt; </b></span>test.type = <span style="color: maroon">labType</span> <i>&quot;set default type&quot;</i><span style="color: navy">;</span>
      labType<b> where </b>labType.memberOf('http://smart.who.int/ddcc/ValueSet/lab-test-type-covid19-loinc')<span style="color: navy"><b> -&gt; </b></span>test.type = <b>translate</b><span style="color: navy">(</span><span style="color: maroon">labType</span><span style="color: navy">, </span><span style="color: blue">'http://smart.who.int/ddcc/ConceptMap/lab-test-type-covid19-loinc-to-icd11'</span><span style="color: navy">, </span><span style="color: blue">'Coding'</span><span style="color: navy">)</span> <i>&quot;translate loinc type&quot;</i><span style="color: navy">;</span>
      labType<b> where </b>labType.memberOf('http://smart.who.int/ddcc/ValueSet/lab-test-type-covid19-loinc')<span style="color: navy"><b> -&gt; </b></span>test.pathogen = <b>c</b><span style="color: navy">(</span><span style="color: blue">'http://id.who.int/icd11/mms'</span><span style="color: navy">, </span><span style="color: blue">'XN109'</span><span style="color: navy">)</span> <i>&quot;set pathogen to COVID&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>
  lab.effectiveDateTime<b> as </b><span style="color: maroon">date</span><span style="color: navy"><b> -&gt; </b></span>test.date = <span style="color: maroon">date</span> <i>&quot;set date&quot;</i><span style="color: navy">;</span>
  lab.valueCodeableConcept<b> as </b><span style="color: maroon">value</span><b> then</b><span style="color: navy"> {
</span>    value.coding first<b> as </b><span style="color: maroon">result</span><b> then</b><span style="color: navy"> {
</span>      result<span style="color: navy"><b> -&gt; </b></span>test.result = <span style="color: maroon">result</span> <i>&quot;set default result&quot;</i><span style="color: navy">;</span>
      result<b> where </b>result.memberOf('http://smart.who.int/ddcc/ValueSet/lab-test-qual-result-snomed')<span style="color: navy"><b> -&gt; </b></span>test.result = <b>translate</b><span style="color: navy">(</span><span style="color: maroon">result</span><span style="color: navy">, </span><span style="color: blue">'http://smart.who.int/ddcc/ConceptMap/lab-test-qual-result-snomed-to-icd11'</span><span style="color: navy">)</span> <i>&quot;translate snomed result&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: green">no target for result valueQuantity (for Ab titers) or valueString (for unmapped text)</span>
<span style="color: navy">// </span><span style="color: green">pathogen and country are required, no source in SHC</span>
<span style="color: navy">}

</span></pre></div>
  </text>
  <url value="http://smart.who.int/ddcc/StructureMap/SHCToCoreDataSetTR"/>
  <version value="1.0.0"/>
  <name value="SHCToCoreDataSetTR"/>
  <status value="draft"/>
  <date value="2024-10-15T11:00:36+02:00"/>
  <publisher value="WHO"/>
  <contact>
    <name value="WHO"/>
    <telecom>
      <system value="url"/>
      <value value="http://who.int"/>
    </telecom>
  </contact>
  <jurisdiction>
    <coding>
      <system value="http://unstats.un.org/unsd/methods/m49/m49.htm"/>
      <code value="001"/>
    </coding>
  </jurisdiction>
  <structure>
    <url
         value="http://hl7.org/fhir/uv/shc-vaccination/StructureDefinition/shc-infectious-disease-laboratory-bundle-dm"/>
    <mode value="source"/>
    <alias value="SHCLabBundleDM"/>
  </structure>
  <structure>
    <url
         value="http://hl7.org/fhir/uv/shc-vaccination/StructureDefinition/shc-patient-general-dm"/>
    <mode value="source"/>
    <alias value="SHCPatientDM"/>
  </structure>
  <structure>
    <url
         value="http://hl7.org/fhir/uv/shc-vaccination/StructureDefinition/shc-infectious-disease-laboratory-result-observation-dm"/>
    <mode value="source"/>
    <alias value="SHCLabDM"/>
  </structure>
  <structure>
    <url value="http://hl7.org/fhir/StructureDefinition/Bundle"/>
    <mode value="target"/>
    <alias value="DDCCBundle"/>
  </structure>
  <structure>
    <url
         value="http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSetTR"/>
    <mode value="target"/>
    <alias value="DDCCTR"/>
  </structure>
  <group>
    <name value="SHCToTR"/>
    <typeMode value="none"/>
    <input>
      <name value="shc"/>
      <type value="SHCLabBundleDM"/>
      <mode value="source"/>
    </input>
    <input>
      <name value="ddccBundle"/>
      <type value="DDCCBundle"/>
      <mode value="target"/>
    </input>
    <rule>
      <name value="find patient"/>
      <source>
        <context value="shc"/>
        <element value="entry"/>
        <variable value="patientEntrySHC"/>
      </source>
      <rule>
        <name value="get patient"/>
        <source>
          <context value="patientEntrySHC"/>
          <type value="Patient"/>
          <element value="resource"/>
          <listMode value="first"/>
          <variable value="patient"/>
        </source>
        <rule>
          <name value="entries"/>
          <source>
            <context value="shc"/>
            <element value="entry"/>
            <variable value="entry"/>
          </source>
          <rule>
            <name value="labs"/>
            <source>
              <context value="entry"/>
              <type value="Observation"/>
              <element value="resource"/>
              <variable value="lab"/>
            </source>
            <target>
              <context value="ddccBundle"/>
              <contextType value="variable"/>
              <element value="entry"/>
              <variable value="outentry"/>
            </target>
            <target>
              <contextType value="variable"/>
              <variable value="ddcc"/>
              <transform value="create"/>
              <parameter>
                <valueString
                             value="http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSetTR"/>
              </parameter>
            </target>
            <rule>
              <name value="set patient"/>
              <source>
                <context value="lab"/>
              </source>
              <dependent>
                <name value="PatientToDDCCTR"/>
                <variable value="patient"/>
                <variable value="ddcc"/>
              </dependent>
            </rule>
            <rule>
              <name value="set test"/>
              <source>
                <context value="lab"/>
              </source>
              <target>
                <context value="ddcc"/>
                <contextType value="variable"/>
                <element value="test"/>
                <variable value="test"/>
              </target>
              <dependent>
                <name value="LabToDDCC"/>
                <variable value="lab"/>
                <variable value="test"/>
              </dependent>
            </rule>
            <rule>
              <name value="set outentry"/>
              <source>
                <context value="lab"/>
              </source>
              <target>
                <context value="outentry"/>
                <contextType value="variable"/>
                <element value="resource"/>
                <transform value="copy"/>
                <parameter>
                  <valueId value="ddcc"/>
                </parameter>
              </target>
            </rule>
          </rule>
        </rule>
      </rule>
    </rule>
  </group>
  <group>
    <name value="PatientToDDCCTR"/>
    <typeMode value="none"/>
    <input>
      <name value="patient"/>
      <type value="SHCPatientDM"/>
      <mode value="source"/>
    </input>
    <input>
      <name value="tgt"/>
      <type value="DDCCTR"/>
      <mode value="target"/>
    </input>
    <rule>
      <name value="set name"/>
      <source>
        <context value="patient"/>
        <element value="name"/>
        <variable value="name"/>
      </source>
      <dependent>
        <name value="NameToText"/>
        <variable value="name"/>
        <variable value="tgt"/>
      </dependent>
    </rule>
    <rule>
      <name value="set birthDate"/>
      <source>
        <context value="patient"/>
        <element value="birthDate"/>
        <variable value="birthDate"/>
      </source>
      <target>
        <context value="tgt"/>
        <contextType value="variable"/>
        <element value="birthDate"/>
        <transform value="copy"/>
        <parameter>
          <valueId value="birthDate"/>
        </parameter>
      </target>
    </rule>
    <rule>
      <name value="set identifier"/>
      <source>
        <context value="patient"/>
        <element value="identifier"/>
        <listMode value="first"/>
        <variable value="identifier"/>
      </source>
      <target>
        <context value="tgt"/>
        <contextType value="variable"/>
        <element value="identifier"/>
        <transform value="copy"/>
        <parameter>
          <valueId value="identifier"/>
        </parameter>
      </target>
    </rule>
  </group>
  <group>
    <name value="NameToText"/>
    <typeMode value="none"/>
    <input>
      <name value="name"/>
      <type value="HumanName"/>
      <mode value="source"/>
    </input>
    <input>
      <name value="ddcc"/>
      <mode value="target"/>
    </input>
    <rule>
      <name value="set first name"/>
      <source>
        <context value="name"/>
        <element value="given"/>
        <listMode value="first"/>
        <variable value="given"/>
      </source>
      <target>
        <context value="ddcc"/>
        <contextType value="variable"/>
        <element value="name"/>
        <transform value="evaluate"/>
        <parameter>
          <valueString value="given.replaceMatches('$', ' ')"/>
        </parameter>
      </target>
    </rule>
    <rule>
      <name value="set other names"/>
      <source>
        <context value="name"/>
        <element value="given"/>
        <listMode value="not_first"/>
        <variable value="other"/>
      </source>
      <target>
        <context value="ddcc"/>
        <contextType value="variable"/>
        <element value="name"/>
        <variable value="tName"/>
      </target>
      <target>
        <contextType value="variable"/>
        <variable value="spaced"/>
        <transform value="evaluate"/>
        <parameter>
          <valueString value="other.replaceMatches('$', ' ')"/>
        </parameter>
      </target>
      <target>
        <context value="ddcc"/>
        <contextType value="variable"/>
        <element value="name"/>
        <transform value="append"/>
        <parameter>
          <valueId value="tName"/>
        </parameter>
        <parameter>
          <valueId value="spaced"/>
        </parameter>
      </target>
    </rule>
    <rule>
      <name value="add family name"/>
      <source>
        <context value="name"/>
        <element value="family"/>
        <variable value="family"/>
      </source>
      <target>
        <context value="ddcc"/>
        <contextType value="variable"/>
        <element value="name"/>
        <variable value="tName"/>
      </target>
      <target>
        <context value="ddcc"/>
        <contextType value="variable"/>
        <element value="name"/>
        <transform value="append"/>
        <parameter>
          <valueId value="tName"/>
        </parameter>
        <parameter>
          <valueId value="family"/>
        </parameter>
      </target>
    </rule>
    <rule>
      <name value="set full name"/>
      <source>
        <context value="name"/>
        <element value="text"/>
        <variable value="text"/>
      </source>
      <target>
        <context value="ddcc"/>
        <contextType value="variable"/>
        <element value="name"/>
        <transform value="copy"/>
        <parameter>
          <valueId value="text"/>
        </parameter>
      </target>
    </rule>
  </group>
  <group>
    <name value="LabToDDCC"/>
    <typeMode value="none"/>
    <input>
      <name value="lab"/>
      <type value="SHCLabDM"/>
      <mode value="source"/>
    </input>
    <input>
      <name value="test"/>
      <mode value="target"/>
    </input>
    <rule>
      <name value="code"/>
      <source>
        <context value="lab"/>
        <element value="code"/>
        <variable value="code"/>
      </source>
      <rule>
        <name value="coding"/>
        <source>
          <context value="code"/>
          <element value="coding"/>
          <listMode value="first"/>
          <variable value="labType"/>
        </source>
        <rule>
          <name value="set default type"/>
          <source>
            <context value="labType"/>
          </source>
          <target>
            <context value="test"/>
            <contextType value="variable"/>
            <element value="type"/>
            <transform value="copy"/>
            <parameter>
              <valueId value="labType"/>
            </parameter>
          </target>
        </rule>
        <rule>
          <name value="translate loinc type"/>
          <source>
            <context value="labType"/>
            <condition
                       value="labType.memberOf('http://smart.who.int/ddcc/ValueSet/lab-test-type-covid19-loinc')"/>
          </source>
          <target>
            <context value="test"/>
            <contextType value="variable"/>
            <element value="type"/>
            <transform value="translate"/>
            <parameter>
              <valueId value="labType"/>
            </parameter>
            <parameter>
              <valueString
                           value="http://smart.who.int/ddcc/ConceptMap/lab-test-type-covid19-loinc-to-icd11"/>
            </parameter>
            <parameter>
              <valueString value="Coding"/>
            </parameter>
          </target>
        </rule>
        <rule>
          <name value="set pathogen to COVID"/>
          <source>
            <context value="labType"/>
            <condition
                       value="labType.memberOf('http://smart.who.int/ddcc/ValueSet/lab-test-type-covid19-loinc')"/>
          </source>
          <target>
            <context value="test"/>
            <contextType value="variable"/>
            <element value="pathogen"/>
            <transform value="c"/>
            <parameter>
              <valueString value="http://id.who.int/icd11/mms"/>
            </parameter>
            <parameter>
              <valueString value="XN109"/>
            </parameter>
          </target>
        </rule>
      </rule>
    </rule>
    <rule>
      <name value="set date"/>
      <source>
        <context value="lab"/>
        <element value="effectiveDateTime"/>
        <variable value="date"/>
      </source>
      <target>
        <context value="test"/>
        <contextType value="variable"/>
        <element value="date"/>
        <transform value="copy"/>
        <parameter>
          <valueId value="date"/>
        </parameter>
      </target>
    </rule>
    <rule>
      <name value="valueCodeableConcept"/>
      <source>
        <context value="lab"/>
        <element value="valueCodeableConcept"/>
        <variable value="value"/>
      </source>
      <rule>
        <name value="coding"/>
        <source>
          <context value="value"/>
          <element value="coding"/>
          <listMode value="first"/>
          <variable value="result"/>
        </source>
        <rule>
          <name value="set default result"/>
          <source>
            <context value="result"/>
          </source>
          <target>
            <context value="test"/>
            <contextType value="variable"/>
            <element value="result"/>
            <transform value="copy"/>
            <parameter>
              <valueId value="result"/>
            </parameter>
          </target>
        </rule>
        <rule>
          <name value="translate snomed result"/>
          <source>
            <context value="result"/>
            <condition
                       value="result.memberOf('http://smart.who.int/ddcc/ValueSet/lab-test-qual-result-snomed')"/>
          </source>
          <target>
            <context value="test"/>
            <contextType value="variable"/>
            <element value="result"/>
            <transform value="translate"/>
            <parameter>
              <valueId value="result"/>
            </parameter>
            <parameter>
              <valueString
                           value="http://smart.who.int/ddcc/ConceptMap/lab-test-qual-result-snomed-to-icd11"/>
            </parameter>
          </target>
        </rule>
      </rule>
    </rule>
  </group>
</StructureMap>