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

</span><span style="color: navy">// </span><span style="color: green">Structure map transforming CertICAO logical model to bundle of Core Data Set logical model</span>

<b>uses</b><span style="color: navy"> &quot;</span>http://smart.who.int/ddcc/StructureDefinition/CertICAOVDS<span style="color: navy">&quot; </span><b>alias </b>VDS <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-DDCCCoreDataSet.html" title="DDCC Core Data Set Logical Model">http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSet</a><span style="color: navy">&quot; </span><b>alias </b>DDCC <b>as </b><b>target</b>
<b>uses</b><span style="color: navy"> &quot;</span><a href="StructureDefinition-DDCCCoreDataSetVS.html" title="DDCC Core Data Set Logical Model for Vaccination Status">http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSetVS</a><span style="color: navy">&quot; </span><b>alias </b>DDCCVS <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>CertICAOtoCoreDataSet<span style="color: navy">(</span><b>source</b> <span style="color: maroon">src</span><span style="color: navy"> : </span>VDS, <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>  src.data<b> as </b><span style="color: maroon">data</span><b> then</b><span style="color: navy"> {
</span>    data.msg<b> as </b><span style="color: maroon">msg</span><b> then</b><span style="color: navy"> {
</span>      msg.ve<b> as </b><span style="color: maroon">ve</span><b> then</b><span style="color: navy"> {
</span>        ve.vd<b> as </b><span style="color: maroon">vd</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/DDCCCoreDataSetVS'</span><span style="color: navy">)</span><b> as </b><span style="color: maroon">ddcc</span><b> then</b><span style="color: navy"> {
</span>          data.hdr<b> as </b><span style="color: maroon">hdr</span><span style="color: navy"><b> -&gt; </b></span>ddcc.certificate<b> as </b><span style="color: maroon">certificate</span><b> then </b>VDStoCoreDataSetCertificate<span style="color: navy">(</span><span style="color: maroon">hdr</span><span style="color: navy">, </span><span style="color: maroon">msg</span><span style="color: navy">, </span><span style="color: maroon">certificate</span><span style="color: navy">)</span> <i>&quot;set certificate&quot;</i><span style="color: navy">;</span>
          msg.pid<b> as </b><span style="color: maroon">pid</span><b> then </b>ExtractPatient<span style="color: navy">(</span><span style="color: maroon">pid</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>
          vd<span style="color: navy"><b> -&gt; </b></span>ddcc.vaccination<b> as </b><span style="color: maroon">vaccination</span><b> then </b>ExtractVaccine<span style="color: navy">(</span><span style="color: maroon">ve</span><span style="color: navy">, </span><span style="color: maroon">vd</span><span style="color: navy">, </span><span style="color: maroon">vaccination</span><span style="color: navy">)</span> <i>&quot;set vaccination&quot;</i><span style="color: navy">;</span>
          vd<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><span style="color: navy">;</span>
      <span style="color: navy">}</span><span style="color: navy">;</span>
      msg.tr<b> as </b><span style="color: maroon">tr</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>        data.hdr<b> as </b><span style="color: maroon">hdr</span><span style="color: navy"><b> -&gt; </b></span>ddcc.certificate<b> as </b><span style="color: maroon">certificate</span><b> then </b>VDStoCoreDataSetCertificate<span style="color: navy">(</span><span style="color: maroon">hdr</span><span style="color: navy">, </span><span style="color: maroon">msg</span><span style="color: navy">, </span><span style="color: maroon">certificate</span><span style="color: navy">)</span> <i>&quot;set certificate&quot;</i><span style="color: navy">;</span>
        msg.pid<b> as </b><span style="color: maroon">pid</span><b> then </b>ExtractPatient<span style="color: navy">(</span><span style="color: maroon">pid</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>
        msg.sp<b> as </b><span style="color: maroon">sp</span><b> then</b><span style="color: navy"> {
</span>          msg.dat<b> as </b><span style="color: maroon">dat</span><span style="color: navy"><b> -&gt; </b></span>ddcc.test<b> as </b><span style="color: maroon">test</span><b> then </b>ExtractTest<span style="color: navy">(</span><span style="color: maroon">sp</span><span style="color: navy">, </span><span style="color: maroon">dat</span><span style="color: navy">, </span><span style="color: maroon">tr</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>
        <span style="color: navy">}</span><span style="color: navy">;</span>
        tr<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><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><b>group </b>VDStoCoreDataSetCertificate<span style="color: navy">(</span><b>source</b> <span style="color: maroon">hdr</span>, <b>source</b> <span style="color: maroon">msg</span>, <b>target</b> <span style="color: maroon">certificate</span><span style="color: navy">)</span><span style="color: navy"> {
</span>  hdr.v<b> as </b><span style="color: maroon">v</span><span style="color: navy"><b> -&gt; </b></span>certificate.version = <span style="color: maroon">v</span> <i>&quot;set version&quot;</i><span style="color: navy">;</span>
  msg.uvci<b> as </b><span style="color: maroon">uvci</span><span style="color: navy"><b> -&gt; </b></span> certificate.hcid<b> as </b><span style="color: maroon">hcid</span><span style="color: navy">, </span> hcid.value = <span style="color: maroon">uvci</span> <i>&quot;set hcid from uvci&quot;</i><span style="color: navy">;</span>
  msg.utci<b> as </b><span style="color: maroon">utci</span><span style="color: navy"><b> -&gt; </b></span> certificate.hcid<b> as </b><span style="color: maroon">hcid</span><span style="color: navy">, </span> hcid.value = <span style="color: maroon">utci</span> <i>&quot;set hcid from utci&quot;</i><span style="color: navy">;</span>
  hdr.is<b> as </b><span style="color: maroon">is</span><span style="color: navy"><b> -&gt; </b></span> certificate.issuer = <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">issuer</span><span style="color: navy">, </span> issuer.display = <span style="color: maroon">is</span> <i>&quot;set issuer&quot;</i><span style="color: navy">;</span>
<span style="color: navy">}

</span><b>group </b>ExtractPatient<span style="color: navy">(</span><b>source</b> <span style="color: maroon">pid</span>, <b>target</b> <span style="color: maroon">ddcc</span><span style="color: navy"> : </span>DDCC<span style="color: navy">)</span><span style="color: navy"> {
</span>  pid.n<b> as </b><span style="color: maroon">name</span><span style="color: navy"><b> -&gt; </b></span>ddcc.name = <span style="color: maroon">name</span> <i>&quot;set name&quot;</i><span style="color: navy">;</span>
  pid.dob<b> as </b><span style="color: maroon">birthDate</span><span style="color: navy"><b> -&gt; </b></span>ddcc.birthDate = <span style="color: maroon">birthDate</span> <i>&quot;set birthDate&quot;</i><span style="color: navy">;</span>
  pid.i<b> as </b><span style="color: maroon">priorityIdentifier</span><span style="color: navy"><b> -&gt; </b></span> ddcc.identifier<b> as </b><span style="color: maroon">identifier</span><span style="color: navy">, </span> identifier.value = <span style="color: maroon">priorityIdentifier</span> <i>&quot;set priorityIdentifier&quot;</i><span style="color: navy">;</span>
  pid.dn<span style="color: navy"><b> -&gt; </b></span>ddcc.identifier<b> as </b><span style="color: maroon">identifier</span><b> then </b>ExtractDocumentTypeNumber<span style="color: navy">(</span><span style="color: maroon">pid</span><span style="color: navy">, </span><span style="color: maroon">identifier</span><span style="color: navy">)</span> <i>&quot;set Document Type Number&quot;</i><span style="color: navy">;</span>
<span style="color: navy">}

</span><b>group </b>ExtractDocumentTypeNumber<span style="color: navy">(</span><b>source</b> <span style="color: maroon">src</span>, <b>target</b> <span style="color: maroon">identif</span><span style="color: navy"> : </span>Identifier<span style="color: navy">)</span><span style="color: navy"> {
</span>  src.dn<b> as </b><span style="color: maroon">docNumber</span><span style="color: navy"><b> -&gt; </b></span>identif.value = <span style="color: maroon">docNumber</span> <i>&quot;set doc number&quot;</i><span style="color: navy">;</span>
  src.dt<b> as </b><span style="color: maroon">docType</span><b> where </b>(docType = 'P')<span style="color: navy"><b> -&gt; </b></span>identif.system = <span style="color: blue">'PPN'</span> <i>&quot;set doc number P&quot;</i><span style="color: navy">;</span> <span style="color: navy">// </span><span style="color: green">P – Passport (Doc 9303-4)</span>
  src.dt<b> as </b><span style="color: maroon">docType</span><b> where </b>(docType = 'A')<span style="color: navy"><b> -&gt; </b></span>identif.system = <span style="color: blue">'DL'</span> <i>&quot;set doc number A&quot;</i><span style="color: navy">;</span> <span style="color: navy">// </span><span style="color: green">A – ID Card (Doc 9303-5)</span>
  src.dt<b> as </b><span style="color: maroon">docType</span><b> where </b>(docType = 'C')<span style="color: navy"><b> -&gt; </b></span>identif.system = <span style="color: blue">'DL'</span> <i>&quot;set doc number C&quot;</i><span style="color: navy">;</span> <span style="color: navy">// </span><span style="color: green">C – ID Card (Doc 9303-5)</span>
  src.dt<b> as </b><span style="color: maroon">docType</span><b> where </b>(docType = 'I')<span style="color: navy"><b> -&gt; </b></span>identif.system = <span style="color: blue">'DL'</span> <i>&quot;set doc number I&quot;</i><span style="color: navy">;</span> <span style="color: navy">// </span><span style="color: green">I – ID Card Doc 9303-5)</span>
  src.dt<b> as </b><span style="color: maroon">docType</span><b> where </b>(docType = 'AC')<span style="color: navy"><b> -&gt; </b></span>identif.system = <span style="color: blue">'EN'</span> <i>&quot;set doc number AC&quot;</i><span style="color: navy">;</span> <span style="color: navy">// </span><span style="color: green">AC - Crew Member Certificate (Doc 9303-5)</span>
  src.dt<b> as </b><span style="color: maroon">docType</span><b> where </b>(docType = 'V')<span style="color: navy"><b> -&gt; </b></span>identif.system = <span style="color: blue">'ACSN'</span> <i>&quot;set doc number V&quot;</i><span style="color: navy">;</span> <span style="color: navy">// </span><span style="color: green">V – Visa (Doc 9303-7)</span>
  src.dt<b> as </b><span style="color: maroon">docType</span><b> where </b>(docType = 'D')<span style="color: navy"><b> -&gt; </b></span>identif.system = <span style="color: blue">'DL'</span> <i>&quot;set doc number D&quot;</i><span style="color: navy">;</span> <span style="color: navy">// </span><span style="color: green">D – Driving License (ISO18013-1)</span>
<span style="color: navy">}

</span><b>group </b>ExtractVaccine<span style="color: navy">(</span><b>source</b> <span style="color: maroon">ve</span>, <b>source</b> <span style="color: maroon">vd</span>, <b>target</b> <span style="color: maroon">vaccination</span><span style="color: navy">)</span><span style="color: navy"> {
</span>  ve.des<b> as </b><span style="color: maroon">des</span><span style="color: navy"><b> -&gt; </b></span> vaccination.vaccine<b> as </b><span style="color: maroon">coding</span><span style="color: navy">, </span> coding.system = <span style="color: blue">'http://id.who.int/icd11/mms'</span><span style="color: navy">, </span> coding.code = <span style="color: maroon">des</span> <i>&quot;set vaccine&quot;</i><span style="color: navy">;</span>
  ve.nam<b> as </b><span style="color: maroon">nam</span><span style="color: navy"><b> -&gt; </b></span> vaccination.brand<b> as </b><span style="color: maroon">coding</span><span style="color: navy">, </span> coding.code = <span style="color: maroon">nam</span> <i>&quot;set brand&quot;</i><span style="color: navy">;</span>
  ve.dis<b> as </b><span style="color: maroon">dis</span><span style="color: navy"><b> -&gt; </b></span> vaccination.disease<b> as </b><span style="color: maroon">coding</span><span style="color: navy">, </span> coding.system = <span style="color: blue">'http://id.who.int/icd11/mms'</span><span style="color: navy">, </span> coding.code = <span style="color: maroon">dis</span> <i>&quot;set target disease&quot;</i><span style="color: navy">;</span>
  vd.dvc<b> as </b><span style="color: maroon">dvc</span><span style="color: navy"><b> -&gt; </b></span>vaccination.date = <span style="color: maroon">dvc</span> <i>&quot;set date&quot;</i><span style="color: navy">;</span>
  vd.seq<b> as </b><span style="color: maroon">seq</span><span style="color: navy"><b> -&gt; </b></span>vaccination.dose = <span style="color: maroon">seq</span> <i>&quot;set dose&quot;</i><span style="color: navy">;</span>
  vd.dvn<b> as </b><span style="color: maroon">dvn</span><span style="color: navy"><b> -&gt; </b></span>vaccination.nextDose = <span style="color: maroon">dvn</span> <i>&quot;set nextDose&quot;</i><span style="color: navy">;</span>
  vd.ctr<b> as </b><span style="color: maroon">ctr</span><span style="color: navy"><b> -&gt; </b></span>vaccination.country<b> as </b><span style="color: maroon">coding</span><b> then</b><span style="color: navy"> {
</span>    ctr<b> then </b>ExtractCountry<span style="color: navy">(</span><span style="color: maroon">ctr</span><span style="color: navy">, </span><span style="color: maroon">coding</span><span style="color: navy">)</span> <i>&quot;set country&quot;</i><span style="color: navy">;</span>
  <span style="color: navy">}</span><span style="color: navy">;</span>
  vd.adm<b> as </b><span style="color: maroon">adm</span><span style="color: navy"><b> -&gt; </b></span>vaccination.centre = <span style="color: maroon">adm</span> <i>&quot;set centre&quot;</i><span style="color: navy">;</span>
  vd.lot<b> as </b><span style="color: maroon">lot</span><span style="color: navy"><b> -&gt; </b></span>vaccination.lot = <span style="color: maroon">lot</span> <i>&quot;set lot&quot;</i><span style="color: navy">;</span>
<span style="color: navy">}

</span><b>group </b>ExtractTest<span style="color: navy">(</span><b>source</b> <span style="color: maroon">sp</span>, <b>source</b> <span style="color: maroon">dat</span>, <b>source</b> <span style="color: maroon">tr</span>, <b>target</b> <span style="color: maroon">test</span><span style="color: navy">)</span><span style="color: navy"> {
</span>  tr<span style="color: navy"><b> -&gt; </b></span> test.pathogen<b> as </b><span style="color: maroon">coding</span><span style="color: navy">, </span> coding.system = <span style="color: blue">'http://id.who.int/icd11/mms'</span><span style="color: navy">, </span> coding.code = <span style="color: blue">'XN109'</span> <i>&quot;set pathogen&quot;</i><span style="color: navy">;</span>
  tr.tc<b> as </b><span style="color: maroon">tc</span><b> then</b><span style="color: navy"> {
</span>    tc<span style="color: navy"><b> -&gt; </b></span> test.type<b> as </b><span style="color: maroon">coding</span><span style="color: navy">, </span> coding.code = <span style="color: maroon">tc</span> <i>&quot;set default type&quot;</i><span style="color: navy">;</span>
    tc<span style="color: navy"><b> -&gt; </b></span><b>c</b><span style="color: navy">(</span><span style="color: blue">'http://smart.who.int/ddcc/CodeSystem/lab-test-type-icao'</span><span style="color: navy">, </span><span style="color: maroon">tc</span><span style="color: navy">)</span><b> as </b><span style="color: maroon">coded</span><b> then</b><span style="color: navy"> {
</span>      tc<b> where </b>coded.memberOf('http://smart.who.int/ddcc/ValueSet/lab-test-type-icao')<span style="color: navy"><b> -&gt; </b></span>test.type = <b>translate</b><span style="color: navy">(</span><span style="color: maroon">coded</span><span style="color: navy">, </span><span style="color: blue">'http://smart.who.int/ddcc/ConceptMap/lab-test-type-icao-to-icd11'</span><span style="color: navy">, </span><span style="color: blue">'Coding'</span><span style="color: navy">)</span> <i>&quot;translate ICAO type&quot;</i><span style="color: navy">;</span>
    <span style="color: navy">}</span> <i>&quot;coding&quot;</i><span style="color: navy">;</span>
  <span style="color: navy">}</span><span style="color: navy">;</span>
  tr.m<b> as </b><span style="color: maroon">m</span><b> then</b><span style="color: navy"> {
</span>    m<span style="color: navy"><b> -&gt; </b></span> test.origin<b> as </b><span style="color: maroon">coding</span><span style="color: navy">, </span> coding.code = <span style="color: maroon">m</span> <i>&quot;set default origin&quot;</i><span style="color: navy">;</span>
    m<span style="color: navy"><b> -&gt; </b></span><b>c</b><span style="color: navy">(</span><span style="color: blue">'http://smart.who.int/ddcc/CodeSystem/lab-test-sample-origin-icao'</span><span style="color: navy">, </span><span style="color: maroon">m</span><span style="color: navy">)</span><b> as </b><span style="color: maroon">coded</span><b> then</b><span style="color: navy"> {
</span>      m<b> where </b>coded.memberOf('http://smart.who.int/ddcc/ValueSet/lab-test-sample-origin-icao')<span style="color: navy"><b> -&gt; </b></span>test.origin = <b>translate</b><span style="color: navy">(</span><span style="color: maroon">coded</span><span style="color: navy">, </span><span style="color: blue">'http://smart.who.int/ddcc/ConceptMap/lab-test-sample-origin-icao-to-icd11'</span><span style="color: navy">, </span><span style="color: blue">'Coding'</span><span style="color: navy">)</span> <i>&quot;translate ICAO origin&quot;</i><span style="color: navy">;</span>
    <span style="color: navy">}</span> <i>&quot;coding&quot;</i><span style="color: navy">;</span>
  <span style="color: navy">}</span><span style="color: navy">;</span>
  dat.sc<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>
  tr.r<b> as </b><span style="color: maroon">r</span><b> then</b><span style="color: navy"> {
</span>    r<span style="color: navy"><b> -&gt; </b></span> test.result<b> as </b><span style="color: maroon">coding</span><span style="color: navy">, </span> coding.code = <span style="color: maroon">r</span> <i>&quot;set default result&quot;</i><span style="color: navy">;</span>
    r<span style="color: navy"><b> -&gt; </b></span><b>c</b><span style="color: navy">(</span><span style="color: blue">'http://smart.who.int/ddcc/CodeSystem/lab-test-qual-result-icao'</span><span style="color: navy">, </span><span style="color: maroon">r</span><span style="color: navy">)</span><b> as </b><span style="color: maroon">coded</span><b> then</b><span style="color: navy"> {
</span>      r<b> where </b>coded.memberOf('http://smart.who.int/ddcc/ValueSet/lab-test-qual-result-icao')<span style="color: navy"><b> -&gt; </b></span>test.result = <b>translate</b><span style="color: navy">(</span><span style="color: maroon">coded</span><span style="color: navy">, </span><span style="color: blue">'http://smart.who.int/ddcc/ConceptMap/lab-test-qual-result-icao-to-icd11'</span><span style="color: navy">, </span><span style="color: blue">'Coding'</span><span style="color: navy">)</span> <i>&quot;translate ICAO result&quot;</i><span style="color: navy">;</span>
    <span style="color: navy">}</span> <i>&quot;coding&quot;</i><span style="color: navy">;</span>
  <span style="color: navy">}</span><span style="color: navy">;</span>
  sp.spn<b> as </b><span style="color: maroon">spn</span><span style="color: navy"><b> -&gt; </b></span> test.centre<b> as </b><span style="color: maroon">coding</span><span style="color: navy">, </span> coding.code = <span style="color: maroon">spn</span> <i>&quot;set centre&quot;</i><span style="color: navy">;</span>
  sp.ctr<b> as </b><span style="color: maroon">ctr</span><span style="color: navy"><b> -&gt; </b></span>test.country<b> as </b><span style="color: maroon">coding</span><b> then</b><span style="color: navy"> {
</span>    ctr<b> then </b>ExtractCountry<span style="color: navy">(</span><span style="color: maroon">ctr</span><span style="color: navy">, </span><span style="color: maroon">coding</span><span style="color: navy">)</span> <i>&quot;set country&quot;</i><span style="color: navy">;</span>
  <span style="color: navy">}</span><span style="color: navy">;</span>
<span style="color: navy">}

</span><b>group </b>ExtractCountry<span style="color: navy">(</span><b>source</b> <span style="color: maroon">country</span>, <b>target</b> <span style="color: maroon">coding</span><span style="color: navy">)</span><span style="color: navy"> {
</span>  <span style="color: navy">// </span><span style="color: green">ICAO Doc 9303-1 country codes are a superset of ISO 3166 3 letter codes</span>
  country<span style="color: navy"><b> -&gt; </b></span>coding.code = <span style="color: maroon">country</span> <i>&quot;set default country&quot;</i><span style="color: navy">;</span>
  country<span style="color: navy"><b> -&gt; </b></span><b>c</b><span style="color: navy">(</span><span style="color: blue">'urn:iso:std:iso:3166'</span><span style="color: navy">, </span><span style="color: maroon">country</span><span style="color: navy">)</span><b> as </b><span style="color: maroon">coded</span><b> then</b><span style="color: navy"> {
</span>    country<b> where </b>coded.memberOf('http://hl7.org/fhir/ValueSet/iso3166-1-3')<span style="color: navy"><b> -&gt; </b></span> coding.code = <span style="color: maroon">country</span><span style="color: navy">, </span> coding.system = <span style="color: blue">'urn:iso:std:iso:3166'</span> <i>&quot;set country with system&quot;</i><span style="color: navy">;</span>
  <span style="color: navy">}</span> <i>&quot;coded&quot;</i><span style="color: navy">;</span>
<span style="color: navy">}

</span></pre></div>
  </text>
  <url value="http://smart.who.int/ddcc/StructureMap/CertICAOtoCoreDataSet"/>
  <version value="1.0.0"/>
  <name value="CertICAOtoCoreDataSet"/>
  <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>
  <description
               value="Structure map transforming CertICAO logical model to bundle of Core Data Set logical model"/>
  <jurisdiction>
    <coding>
      <system value="http://unstats.un.org/unsd/methods/m49/m49.htm"/>
      <code value="001"/>
    </coding>
  </jurisdiction>
  <structure>
    <url value="http://smart.who.int/ddcc/StructureDefinition/CertICAOVDS"/>
    <mode value="source"/>
    <alias value="VDS"/>
  </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/DDCCCoreDataSet"/>
    <mode value="target"/>
    <alias value="DDCC"/>
  </structure>
  <structure>
    <url
         value="http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSetVS"/>
    <mode value="target"/>
    <alias value="DDCCVS"/>
  </structure>
  <structure>
    <url
         value="http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSetTR"/>
    <mode value="target"/>
    <alias value="DDCCTR"/>
  </structure>
  <group>
    <name value="CertICAOtoCoreDataSet"/>
    <typeMode value="none"/>
    <input>
      <name value="src"/>
      <type value="VDS"/>
      <mode value="source"/>
    </input>
    <input>
      <name value="ddccBundle"/>
      <type value="DDCCBundle"/>
      <mode value="target"/>
    </input>
    <rule>
      <name value="data"/>
      <source>
        <context value="src"/>
        <element value="data"/>
        <variable value="data"/>
      </source>
      <rule>
        <name value="msg"/>
        <source>
          <context value="data"/>
          <element value="msg"/>
          <variable value="msg"/>
        </source>
        <rule>
          <name value="ve"/>
          <source>
            <context value="msg"/>
            <element value="ve"/>
            <variable value="ve"/>
          </source>
          <rule>
            <name value="vd"/>
            <source>
              <context value="ve"/>
              <element value="vd"/>
              <variable value="vd"/>
            </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/DDCCCoreDataSetVS"/>
              </parameter>
            </target>
            <rule>
              <name value="set certificate"/>
              <source>
                <context value="data"/>
                <element value="hdr"/>
                <variable value="hdr"/>
              </source>
              <target>
                <context value="ddcc"/>
                <contextType value="variable"/>
                <element value="certificate"/>
                <variable value="certificate"/>
              </target>
              <dependent>
                <name value="VDStoCoreDataSetCertificate"/>
                <variable value="hdr"/>
                <variable value="msg"/>
                <variable value="certificate"/>
              </dependent>
            </rule>
            <rule>
              <name value="set patient"/>
              <source>
                <context value="msg"/>
                <element value="pid"/>
                <variable value="pid"/>
              </source>
              <dependent>
                <name value="ExtractPatient"/>
                <variable value="pid"/>
                <variable value="ddcc"/>
              </dependent>
            </rule>
            <rule>
              <name value="set vaccination"/>
              <source>
                <context value="vd"/>
              </source>
              <target>
                <context value="ddcc"/>
                <contextType value="variable"/>
                <element value="vaccination"/>
                <variable value="vaccination"/>
              </target>
              <dependent>
                <name value="ExtractVaccine"/>
                <variable value="ve"/>
                <variable value="vd"/>
                <variable value="vaccination"/>
              </dependent>
            </rule>
            <rule>
              <name value="set outentry"/>
              <source>
                <context value="vd"/>
              </source>
              <target>
                <context value="outentry"/>
                <contextType value="variable"/>
                <element value="resource"/>
                <transform value="copy"/>
                <parameter>
                  <valueId value="ddcc"/>
                </parameter>
              </target>
            </rule>
          </rule>
        </rule>
        <rule>
          <name value="tr"/>
          <source>
            <context value="msg"/>
            <element value="tr"/>
            <variable value="tr"/>
          </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 certificate"/>
            <source>
              <context value="data"/>
              <element value="hdr"/>
              <variable value="hdr"/>
            </source>
            <target>
              <context value="ddcc"/>
              <contextType value="variable"/>
              <element value="certificate"/>
              <variable value="certificate"/>
            </target>
            <dependent>
              <name value="VDStoCoreDataSetCertificate"/>
              <variable value="hdr"/>
              <variable value="msg"/>
              <variable value="certificate"/>
            </dependent>
          </rule>
          <rule>
            <name value="set patient"/>
            <source>
              <context value="msg"/>
              <element value="pid"/>
              <variable value="pid"/>
            </source>
            <dependent>
              <name value="ExtractPatient"/>
              <variable value="pid"/>
              <variable value="ddcc"/>
            </dependent>
          </rule>
          <rule>
            <name value="sp"/>
            <source>
              <context value="msg"/>
              <element value="sp"/>
              <variable value="sp"/>
            </source>
            <rule>
              <name value="set test"/>
              <source>
                <context value="msg"/>
                <element value="dat"/>
                <variable value="dat"/>
              </source>
              <target>
                <context value="ddcc"/>
                <contextType value="variable"/>
                <element value="test"/>
                <variable value="test"/>
              </target>
              <dependent>
                <name value="ExtractTest"/>
                <variable value="sp"/>
                <variable value="dat"/>
                <variable value="tr"/>
                <variable value="test"/>
              </dependent>
            </rule>
          </rule>
          <rule>
            <name value="set outentry"/>
            <source>
              <context value="tr"/>
            </source>
            <target>
              <context value="outentry"/>
              <contextType value="variable"/>
              <element value="resource"/>
              <transform value="copy"/>
              <parameter>
                <valueId value="ddcc"/>
              </parameter>
            </target>
          </rule>
        </rule>
      </rule>
    </rule>
  </group>
  <group>
    <name value="VDStoCoreDataSetCertificate"/>
    <typeMode value="none"/>
    <input>
      <name value="hdr"/>
      <mode value="source"/>
    </input>
    <input>
      <name value="msg"/>
      <mode value="source"/>
    </input>
    <input>
      <name value="certificate"/>
      <mode value="target"/>
    </input>
    <rule>
      <name value="set version"/>
      <source>
        <context value="hdr"/>
        <element value="v"/>
        <variable value="v"/>
      </source>
      <target>
        <context value="certificate"/>
        <contextType value="variable"/>
        <element value="version"/>
        <transform value="copy"/>
        <parameter>
          <valueId value="v"/>
        </parameter>
      </target>
    </rule>
    <rule>
      <name value="set hcid from uvci"/>
      <source>
        <context value="msg"/>
        <element value="uvci"/>
        <variable value="uvci"/>
      </source>
      <target>
        <context value="certificate"/>
        <contextType value="variable"/>
        <element value="hcid"/>
        <variable value="hcid"/>
      </target>
      <target>
        <context value="hcid"/>
        <contextType value="variable"/>
        <element value="value"/>
        <transform value="copy"/>
        <parameter>
          <valueId value="uvci"/>
        </parameter>
      </target>
    </rule>
    <rule>
      <name value="set hcid from utci"/>
      <source>
        <context value="msg"/>
        <element value="utci"/>
        <variable value="utci"/>
      </source>
      <target>
        <context value="certificate"/>
        <contextType value="variable"/>
        <element value="hcid"/>
        <variable value="hcid"/>
      </target>
      <target>
        <context value="hcid"/>
        <contextType value="variable"/>
        <element value="value"/>
        <transform value="copy"/>
        <parameter>
          <valueId value="utci"/>
        </parameter>
      </target>
    </rule>
    <rule>
      <name value="set issuer"/>
      <source>
        <context value="hdr"/>
        <element value="is"/>
        <variable value="is"/>
      </source>
      <target>
        <context value="certificate"/>
        <contextType value="variable"/>
        <element value="issuer"/>
        <variable value="issuer"/>
        <transform value="create"/>
        <parameter>
          <valueString value="Reference"/>
        </parameter>
      </target>
      <target>
        <context value="issuer"/>
        <contextType value="variable"/>
        <element value="display"/>
        <transform value="copy"/>
        <parameter>
          <valueId value="is"/>
        </parameter>
      </target>
    </rule>
  </group>
  <group>
    <name value="ExtractPatient"/>
    <typeMode value="none"/>
    <input>
      <name value="pid"/>
      <mode value="source"/>
    </input>
    <input>
      <name value="ddcc"/>
      <type value="DDCC"/>
      <mode value="target"/>
    </input>
    <rule>
      <name value="set name"/>
      <source>
        <context value="pid"/>
        <element value="n"/>
        <variable value="name"/>
      </source>
      <target>
        <context value="ddcc"/>
        <contextType value="variable"/>
        <element value="name"/>
        <transform value="copy"/>
        <parameter>
          <valueId value="name"/>
        </parameter>
      </target>
    </rule>
    <rule>
      <name value="set birthDate"/>
      <source>
        <context value="pid"/>
        <element value="dob"/>
        <variable value="birthDate"/>
      </source>
      <target>
        <context value="ddcc"/>
        <contextType value="variable"/>
        <element value="birthDate"/>
        <transform value="copy"/>
        <parameter>
          <valueId value="birthDate"/>
        </parameter>
      </target>
    </rule>
    <rule>
      <name value="set priorityIdentifier"/>
      <source>
        <context value="pid"/>
        <element value="i"/>
        <variable value="priorityIdentifier"/>
      </source>
      <target>
        <context value="ddcc"/>
        <contextType value="variable"/>
        <element value="identifier"/>
        <variable value="identifier"/>
      </target>
      <target>
        <context value="identifier"/>
        <contextType value="variable"/>
        <element value="value"/>
        <transform value="copy"/>
        <parameter>
          <valueId value="priorityIdentifier"/>
        </parameter>
      </target>
    </rule>
    <rule>
      <name value="set Document Type Number"/>
      <source>
        <context value="pid"/>
        <element value="dn"/>
      </source>
      <target>
        <context value="ddcc"/>
        <contextType value="variable"/>
        <element value="identifier"/>
        <variable value="identifier"/>
      </target>
      <dependent>
        <name value="ExtractDocumentTypeNumber"/>
        <variable value="pid"/>
        <variable value="identifier"/>
      </dependent>
    </rule>
  </group>
  <group>
    <name value="ExtractDocumentTypeNumber"/>
    <typeMode value="none"/>
    <input>
      <name value="src"/>
      <mode value="source"/>
    </input>
    <input>
      <name value="identif"/>
      <type value="Identifier"/>
      <mode value="target"/>
    </input>
    <rule>
      <name value="set doc number"/>
      <source>
        <context value="src"/>
        <element value="dn"/>
        <variable value="docNumber"/>
      </source>
      <target>
        <context value="identif"/>
        <contextType value="variable"/>
        <element value="value"/>
        <transform value="copy"/>
        <parameter>
          <valueId value="docNumber"/>
        </parameter>
      </target>
    </rule>
    <rule>
      <name value="set doc number P"/>
      <source>
        <context value="src"/>
        <element value="dt"/>
        <variable value="docType"/>
        <condition value="(docType = 'P')"/>
      </source>
      <target>
        <context value="identif"/>
        <contextType value="variable"/>
        <element value="system"/>
        <transform value="copy"/>
        <parameter>
          <valueString value="PPN"/>
        </parameter>
      </target>
      <documentation value="P – Passport (Doc 9303-4)"/>
    </rule>
    <rule>
      <name value="set doc number A"/>
      <source>
        <context value="src"/>
        <element value="dt"/>
        <variable value="docType"/>
        <condition value="(docType = 'A')"/>
      </source>
      <target>
        <context value="identif"/>
        <contextType value="variable"/>
        <element value="system"/>
        <transform value="copy"/>
        <parameter>
          <valueString value="DL"/>
        </parameter>
      </target>
      <documentation value="A – ID Card (Doc 9303-5)"/>
    </rule>
    <rule>
      <name value="set doc number C"/>
      <source>
        <context value="src"/>
        <element value="dt"/>
        <variable value="docType"/>
        <condition value="(docType = 'C')"/>
      </source>
      <target>
        <context value="identif"/>
        <contextType value="variable"/>
        <element value="system"/>
        <transform value="copy"/>
        <parameter>
          <valueString value="DL"/>
        </parameter>
      </target>
      <documentation value="C – ID Card (Doc 9303-5)"/>
    </rule>
    <rule>
      <name value="set doc number I"/>
      <source>
        <context value="src"/>
        <element value="dt"/>
        <variable value="docType"/>
        <condition value="(docType = 'I')"/>
      </source>
      <target>
        <context value="identif"/>
        <contextType value="variable"/>
        <element value="system"/>
        <transform value="copy"/>
        <parameter>
          <valueString value="DL"/>
        </parameter>
      </target>
      <documentation value="I – ID Card Doc 9303-5)"/>
    </rule>
    <rule>
      <name value="set doc number AC"/>
      <source>
        <context value="src"/>
        <element value="dt"/>
        <variable value="docType"/>
        <condition value="(docType = 'AC')"/>
      </source>
      <target>
        <context value="identif"/>
        <contextType value="variable"/>
        <element value="system"/>
        <transform value="copy"/>
        <parameter>
          <valueString value="EN"/>
        </parameter>
      </target>
      <documentation value="AC - Crew Member Certificate (Doc 9303-5)"/>
    </rule>
    <rule>
      <name value="set doc number V"/>
      <source>
        <context value="src"/>
        <element value="dt"/>
        <variable value="docType"/>
        <condition value="(docType = 'V')"/>
      </source>
      <target>
        <context value="identif"/>
        <contextType value="variable"/>
        <element value="system"/>
        <transform value="copy"/>
        <parameter>
          <valueString value="ACSN"/>
        </parameter>
      </target>
      <documentation value="V – Visa (Doc 9303-7)"/>
    </rule>
    <rule>
      <name value="set doc number D"/>
      <source>
        <context value="src"/>
        <element value="dt"/>
        <variable value="docType"/>
        <condition value="(docType = 'D')"/>
      </source>
      <target>
        <context value="identif"/>
        <contextType value="variable"/>
        <element value="system"/>
        <transform value="copy"/>
        <parameter>
          <valueString value="DL"/>
        </parameter>
      </target>
      <documentation value="D – Driving License (ISO18013-1)"/>
    </rule>
  </group>
  <group>
    <name value="ExtractVaccine"/>
    <typeMode value="none"/>
    <input>
      <name value="ve"/>
      <mode value="source"/>
    </input>
    <input>
      <name value="vd"/>
      <mode value="source"/>
    </input>
    <input>
      <name value="vaccination"/>
      <mode value="target"/>
    </input>
    <rule>
      <name value="set vaccine"/>
      <source>
        <context value="ve"/>
        <element value="des"/>
        <variable value="des"/>
      </source>
      <target>
        <context value="vaccination"/>
        <contextType value="variable"/>
        <element value="vaccine"/>
        <variable value="coding"/>
      </target>
      <target>
        <context value="coding"/>
        <contextType value="variable"/>
        <element value="system"/>
        <transform value="copy"/>
        <parameter>
          <valueString value="http://id.who.int/icd11/mms"/>
        </parameter>
      </target>
      <target>
        <context value="coding"/>
        <contextType value="variable"/>
        <element value="code"/>
        <transform value="copy"/>
        <parameter>
          <valueId value="des"/>
        </parameter>
      </target>
    </rule>
    <rule>
      <name value="set brand"/>
      <source>
        <context value="ve"/>
        <element value="nam"/>
        <variable value="nam"/>
      </source>
      <target>
        <context value="vaccination"/>
        <contextType value="variable"/>
        <element value="brand"/>
        <variable value="coding"/>
      </target>
      <target>
        <context value="coding"/>
        <contextType value="variable"/>
        <element value="code"/>
        <transform value="copy"/>
        <parameter>
          <valueId value="nam"/>
        </parameter>
      </target>
    </rule>
    <rule>
      <name value="set target disease"/>
      <source>
        <context value="ve"/>
        <element value="dis"/>
        <variable value="dis"/>
      </source>
      <target>
        <context value="vaccination"/>
        <contextType value="variable"/>
        <element value="disease"/>
        <variable value="coding"/>
      </target>
      <target>
        <context value="coding"/>
        <contextType value="variable"/>
        <element value="system"/>
        <transform value="copy"/>
        <parameter>
          <valueString value="http://id.who.int/icd11/mms"/>
        </parameter>
      </target>
      <target>
        <context value="coding"/>
        <contextType value="variable"/>
        <element value="code"/>
        <transform value="copy"/>
        <parameter>
          <valueId value="dis"/>
        </parameter>
      </target>
    </rule>
    <rule>
      <name value="set date"/>
      <source>
        <context value="vd"/>
        <element value="dvc"/>
        <variable value="dvc"/>
      </source>
      <target>
        <context value="vaccination"/>
        <contextType value="variable"/>
        <element value="date"/>
        <transform value="copy"/>
        <parameter>
          <valueId value="dvc"/>
        </parameter>
      </target>
    </rule>
    <rule>
      <name value="set dose"/>
      <source>
        <context value="vd"/>
        <element value="seq"/>
        <variable value="seq"/>
      </source>
      <target>
        <context value="vaccination"/>
        <contextType value="variable"/>
        <element value="dose"/>
        <transform value="copy"/>
        <parameter>
          <valueId value="seq"/>
        </parameter>
      </target>
    </rule>
    <rule>
      <name value="set nextDose"/>
      <source>
        <context value="vd"/>
        <element value="dvn"/>
        <variable value="dvn"/>
      </source>
      <target>
        <context value="vaccination"/>
        <contextType value="variable"/>
        <element value="nextDose"/>
        <transform value="copy"/>
        <parameter>
          <valueId value="dvn"/>
        </parameter>
      </target>
    </rule>
    <rule>
      <name value="ctr"/>
      <source>
        <context value="vd"/>
        <element value="ctr"/>
        <variable value="ctr"/>
      </source>
      <target>
        <context value="vaccination"/>
        <contextType value="variable"/>
        <element value="country"/>
        <variable value="coding"/>
      </target>
      <rule>
        <name value="set country"/>
        <source>
          <context value="ctr"/>
        </source>
        <dependent>
          <name value="ExtractCountry"/>
          <variable value="ctr"/>
          <variable value="coding"/>
        </dependent>
      </rule>
    </rule>
    <rule>
      <name value="set centre"/>
      <source>
        <context value="vd"/>
        <element value="adm"/>
        <variable value="adm"/>
      </source>
      <target>
        <context value="vaccination"/>
        <contextType value="variable"/>
        <element value="centre"/>
        <transform value="copy"/>
        <parameter>
          <valueId value="adm"/>
        </parameter>
      </target>
    </rule>
    <rule>
      <name value="set lot"/>
      <source>
        <context value="vd"/>
        <element value="lot"/>
        <variable value="lot"/>
      </source>
      <target>
        <context value="vaccination"/>
        <contextType value="variable"/>
        <element value="lot"/>
        <transform value="copy"/>
        <parameter>
          <valueId value="lot"/>
        </parameter>
      </target>
    </rule>
  </group>
  <group>
    <name value="ExtractTest"/>
    <typeMode value="none"/>
    <input>
      <name value="sp"/>
      <mode value="source"/>
    </input>
    <input>
      <name value="dat"/>
      <mode value="source"/>
    </input>
    <input>
      <name value="tr"/>
      <mode value="source"/>
    </input>
    <input>
      <name value="test"/>
      <mode value="target"/>
    </input>
    <rule>
      <name value="set pathogen"/>
      <source>
        <context value="tr"/>
      </source>
      <target>
        <context value="test"/>
        <contextType value="variable"/>
        <element value="pathogen"/>
        <variable value="coding"/>
      </target>
      <target>
        <context value="coding"/>
        <contextType value="variable"/>
        <element value="system"/>
        <transform value="copy"/>
        <parameter>
          <valueString value="http://id.who.int/icd11/mms"/>
        </parameter>
      </target>
      <target>
        <context value="coding"/>
        <contextType value="variable"/>
        <element value="code"/>
        <transform value="copy"/>
        <parameter>
          <valueString value="XN109"/>
        </parameter>
      </target>
    </rule>
    <rule>
      <name value="tc"/>
      <source>
        <context value="tr"/>
        <element value="tc"/>
        <variable value="tc"/>
      </source>
      <rule>
        <name value="set default type"/>
        <source>
          <context value="tc"/>
        </source>
        <target>
          <context value="test"/>
          <contextType value="variable"/>
          <element value="type"/>
          <variable value="coding"/>
        </target>
        <target>
          <context value="coding"/>
          <contextType value="variable"/>
          <element value="code"/>
          <transform value="copy"/>
          <parameter>
            <valueId value="tc"/>
          </parameter>
        </target>
      </rule>
      <rule>
        <name value="coding"/>
        <source>
          <context value="tc"/>
        </source>
        <target>
          <contextType value="variable"/>
          <variable value="coded"/>
          <transform value="c"/>
          <parameter>
            <valueString
                         value="http://smart.who.int/ddcc/CodeSystem/lab-test-type-icao"/>
          </parameter>
          <parameter>
            <valueId value="tc"/>
          </parameter>
        </target>
        <rule>
          <name value="translate ICAO type"/>
          <source>
            <context value="tc"/>
            <condition
                       value="coded.memberOf('http://smart.who.int/ddcc/ValueSet/lab-test-type-icao')"/>
          </source>
          <target>
            <context value="test"/>
            <contextType value="variable"/>
            <element value="type"/>
            <transform value="translate"/>
            <parameter>
              <valueId value="coded"/>
            </parameter>
            <parameter>
              <valueString
                           value="http://smart.who.int/ddcc/ConceptMap/lab-test-type-icao-to-icd11"/>
            </parameter>
            <parameter>
              <valueString value="Coding"/>
            </parameter>
          </target>
        </rule>
      </rule>
    </rule>
    <rule>
      <name value="m"/>
      <source>
        <context value="tr"/>
        <element value="m"/>
        <variable value="m"/>
      </source>
      <rule>
        <name value="set default origin"/>
        <source>
          <context value="m"/>
        </source>
        <target>
          <context value="test"/>
          <contextType value="variable"/>
          <element value="origin"/>
          <variable value="coding"/>
        </target>
        <target>
          <context value="coding"/>
          <contextType value="variable"/>
          <element value="code"/>
          <transform value="copy"/>
          <parameter>
            <valueId value="m"/>
          </parameter>
        </target>
      </rule>
      <rule>
        <name value="coding"/>
        <source>
          <context value="m"/>
        </source>
        <target>
          <contextType value="variable"/>
          <variable value="coded"/>
          <transform value="c"/>
          <parameter>
            <valueString
                         value="http://smart.who.int/ddcc/CodeSystem/lab-test-sample-origin-icao"/>
          </parameter>
          <parameter>
            <valueId value="m"/>
          </parameter>
        </target>
        <rule>
          <name value="translate ICAO origin"/>
          <source>
            <context value="m"/>
            <condition
                       value="coded.memberOf('http://smart.who.int/ddcc/ValueSet/lab-test-sample-origin-icao')"/>
          </source>
          <target>
            <context value="test"/>
            <contextType value="variable"/>
            <element value="origin"/>
            <transform value="translate"/>
            <parameter>
              <valueId value="coded"/>
            </parameter>
            <parameter>
              <valueString
                           value="http://smart.who.int/ddcc/ConceptMap/lab-test-sample-origin-icao-to-icd11"/>
            </parameter>
            <parameter>
              <valueString value="Coding"/>
            </parameter>
          </target>
        </rule>
      </rule>
    </rule>
    <rule>
      <name value="set date"/>
      <source>
        <context value="dat"/>
        <element value="sc"/>
        <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="r"/>
      <source>
        <context value="tr"/>
        <element value="r"/>
        <variable value="r"/>
      </source>
      <rule>
        <name value="set default result"/>
        <source>
          <context value="r"/>
        </source>
        <target>
          <context value="test"/>
          <contextType value="variable"/>
          <element value="result"/>
          <variable value="coding"/>
        </target>
        <target>
          <context value="coding"/>
          <contextType value="variable"/>
          <element value="code"/>
          <transform value="copy"/>
          <parameter>
            <valueId value="r"/>
          </parameter>
        </target>
      </rule>
      <rule>
        <name value="coding"/>
        <source>
          <context value="r"/>
        </source>
        <target>
          <contextType value="variable"/>
          <variable value="coded"/>
          <transform value="c"/>
          <parameter>
            <valueString
                         value="http://smart.who.int/ddcc/CodeSystem/lab-test-qual-result-icao"/>
          </parameter>
          <parameter>
            <valueId value="r"/>
          </parameter>
        </target>
        <rule>
          <name value="translate ICAO result"/>
          <source>
            <context value="r"/>
            <condition
                       value="coded.memberOf('http://smart.who.int/ddcc/ValueSet/lab-test-qual-result-icao')"/>
          </source>
          <target>
            <context value="test"/>
            <contextType value="variable"/>
            <element value="result"/>
            <transform value="translate"/>
            <parameter>
              <valueId value="coded"/>
            </parameter>
            <parameter>
              <valueString
                           value="http://smart.who.int/ddcc/ConceptMap/lab-test-qual-result-icao-to-icd11"/>
            </parameter>
            <parameter>
              <valueString value="Coding"/>
            </parameter>
          </target>
        </rule>
      </rule>
    </rule>
    <rule>
      <name value="set centre"/>
      <source>
        <context value="sp"/>
        <element value="spn"/>
        <variable value="spn"/>
      </source>
      <target>
        <context value="test"/>
        <contextType value="variable"/>
        <element value="centre"/>
        <variable value="coding"/>
      </target>
      <target>
        <context value="coding"/>
        <contextType value="variable"/>
        <element value="code"/>
        <transform value="copy"/>
        <parameter>
          <valueId value="spn"/>
        </parameter>
      </target>
    </rule>
    <rule>
      <name value="ctr"/>
      <source>
        <context value="sp"/>
        <element value="ctr"/>
        <variable value="ctr"/>
      </source>
      <target>
        <context value="test"/>
        <contextType value="variable"/>
        <element value="country"/>
        <variable value="coding"/>
      </target>
      <rule>
        <name value="set country"/>
        <source>
          <context value="ctr"/>
        </source>
        <dependent>
          <name value="ExtractCountry"/>
          <variable value="ctr"/>
          <variable value="coding"/>
        </dependent>
      </rule>
    </rule>
  </group>
  <group>
    <name value="ExtractCountry"/>
    <typeMode value="none"/>
    <input>
      <name value="country"/>
      <mode value="source"/>
    </input>
    <input>
      <name value="coding"/>
      <mode value="target"/>
    </input>
    <rule>
      <name value="set default country"/>
      <source>
        <context value="country"/>
      </source>
      <target>
        <context value="coding"/>
        <contextType value="variable"/>
        <element value="code"/>
        <transform value="copy"/>
        <parameter>
          <valueId value="country"/>
        </parameter>
      </target>
    </rule>
    <rule>
      <name value="coded"/>
      <source>
        <context value="country"/>
      </source>
      <target>
        <contextType value="variable"/>
        <variable value="coded"/>
        <transform value="c"/>
        <parameter>
          <valueString value="urn:iso:std:iso:3166"/>
        </parameter>
        <parameter>
          <valueId value="country"/>
        </parameter>
      </target>
      <rule>
        <name value="set country with system"/>
        <source>
          <context value="country"/>
          <condition
                     value="coded.memberOf('http://hl7.org/fhir/ValueSet/iso3166-1-3')"/>
        </source>
        <target>
          <context value="coding"/>
          <contextType value="variable"/>
          <element value="code"/>
          <transform value="copy"/>
          <parameter>
            <valueId value="country"/>
          </parameter>
        </target>
        <target>
          <context value="coding"/>
          <contextType value="variable"/>
          <element value="system"/>
          <transform value="copy"/>
          <parameter>
            <valueString value="urn:iso:std:iso:3166"/>
          </parameter>
        </target>
      </rule>
    </rule>
  </group>
</StructureMap>