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

This is the continuous build for version 1.0.0. This version is based on the current content of https://github.com/WorldHealthOrganization/ddcc and changes regularly.

: SHCToCoreDataSetVS - XML Representation

Draft as of 2024-01-19

Raw xml | Download



<StructureMap xmlns="http://hl7.org/fhir">
  <id value="SHCToCoreDataSetVS"/>
  <meta>
    <versionId value="11"/>
    <lastUpdated value="2023-02-15T20:22:07.304+00:00"/>
  </meta>
  <text>
    <status value="generated"/>
    <div xmlns="http://www.w3.org/1999/xhtml"><pre>map &quot;http://smart.who.int/ddcc/StructureMap/SHCToCoreDataSetVS&quot; = &quot;SHCToCoreDataSetVS&quot;


uses &quot;http://hl7.org/fhir/uv/shc-vaccination/StructureDefinition/shc-vaccination-bundle-dm&quot; alias SHCVaccinationBundleDM as source
uses &quot;http://hl7.org/fhir/uv/shc-vaccination/StructureDefinition/shc-patient-general-dm&quot; alias SHCPatientDM as source
uses &quot;http://hl7.org/fhir/uv/shc-vaccination/StructureDefinition/shc-vaccination-dm&quot; alias SHCImmunizationDM as source
uses &quot;http://hl7.org/fhir/StructureDefinition/Bundle&quot; alias DDCCBundle as target
uses &quot;http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSet.VS&quot; alias DDCCVS as produced

group SHCToVS(source shc : SHCVaccinationBundleDM, target ddccBundle : DDCCBundle) {
  shc.entry as patientEntrySHC then {
    patientEntrySHC.resource : Patient first as patient then {
      shc.entry as entry then {
        // 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/DDCCCoreDataSet.VS') as ddcc then {
        entry.resource : Immunization as immunization -&gt;  ddccBundle.entry as outentry,  create('http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSet.VS') as ddcc then {
          immunization then PatientToDDCCVS(patient, ddcc) &quot;set patient&quot;;
          immunization -&gt; ddcc.vaccination as vaccination then ImmunizationToDDCC(immunization, vaccination) &quot;set vaccination&quot;;
          immunization -&gt; outentry.resource = ddcc &quot;set outentry&quot;;
        } &quot;immunizations&quot;;
      } &quot;entries&quot;;
    } &quot;get patient&quot;;
  } &quot;find patient&quot;;
}

group PatientToDDCCVS(source patient : SHCPatientDM, target tgt : DDCCVS) {
  patient.name as name then NameToText(name, tgt) &quot;set name&quot;;
  patient.birthDate as birthDate -&gt; tgt.birthDate = birthDate &quot;set birthDate&quot;;
  patient.identifier first as identifier -&gt; tgt.identifier = identifier &quot;set identifier&quot;;
}

group NameToText(source name : HumanName, target ddcc) {
  // append doesn't work until ddcc.name is set
  name.given first as given -&gt; ddcc.name = (given.replaceMatches('$', ' ')) &quot;set first name&quot;;
  // name.given not_first as other -&gt; ddcc.name as tName, ddcc.name = append( tName, other ) &quot;set other names&quot;;
  name.given not_first as other -&gt;  ddcc.name as tName,  (other.replaceMatches('$', ' ')) as spaced,  ddcc.name = append(tName, spaced) &quot;set other names&quot;;
  name.family as family -&gt;  ddcc.name as tName,  ddcc.name = append(tName, family) &quot;add family name&quot;;
  name.text as text -&gt; ddcc.name = text &quot;set full name&quot;;
}

group ImmunizationToDDCC(source immunization : SHCImmunizationDM, target vaccination) {
  immunization.vaccineCode as vaccine then {
    vaccine.coding as coding then {
      coding -&gt; vaccination.vaccine = coding &quot;set default vaccine&quot;;
      coding -&gt; vaccination.brand = coding &quot;set default brand&quot;;
      coding where coding.memberOf('http://smart.who.int/ddcc/ValueSet/vaccine-covid19-cvx') -&gt; vaccination.vaccine = translate(coding, 'http://smart.who.int/ddcc/ConceptMap/vaccine-covid19-cvx-to-icd11', 'Coding') &quot;translate COVID CVX vaccine&quot;;
      coding where coding.memberOf('http://smart.who.int/ddcc/ValueSet/vaccine-covid19-snomed') -&gt; vaccination.vaccine = translate(coding, 'http://smart.who.int/ddcc/ConceptMap/vaccine-covid19-snomed-to-icd11', 'Coding') &quot;translate COVID SNOMED vaccine&quot;;
    };
  };
  immunization.manufacturer as tman then {
    tman.identifier as identifier -&gt; vaccination.manufacturer as manufacturer then {
      identifier.system as system -&gt; manufacturer.system = system &quot;set manufacturer system&quot;;
      identifier.value as value -&gt; manufacturer.code = value &quot;set manufacturer value&quot;;
    } &quot;set manufacturer id&quot;;
  };
  immunization.lotNumber as lot -&gt; vaccination.lot = lot &quot;set lot&quot;;
  immunization.occurrence as date -&gt; vaccination.date = date &quot;set date&quot;;
  immunization.performer as performer then {
    performer.actor as actor then {
      actor.display as centre -&gt; vaccination.centre = centre &quot;set centre&quot;;
    };
  };
}

</pre></div>
  </text>
  <url value="http://smart.who.int/ddcc/StructureMap/SHCToCoreDataSetVS"/>
  <version value="1.0.0"/>
  <name value="SHCToCoreDataSetVS"/>
  <status value="draft"/>
  <date value="2024-01-19T16:18:21+00: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-vaccination-bundle-dm"/>
    <mode value="source"/>
    <alias value="SHCVaccinationBundleDM"/>
  </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-vaccination-dm"/>
    <mode value="source"/>
    <alias value="SHCImmunizationDM"/>
  </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.VS"/>
    <mode value="produced"/>
    <alias value="DDCCVS"/>
  </structure>
  <group>
    <name value="SHCToVS"/>
    <typeMode value="none"/>
    <input>
      <name value="shc"/>
      <type value="SHCVaccinationBundleDM"/>
      <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="immunizations"/>
            <source>
              <context value="entry"/>
              <type value="Immunization"/>
              <element value="resource"/>
              <variable value="immunization"/>
            </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/DDCCCoreDataSet.VS"/>
              </parameter>
            </target>
            <rule>
              <name value="set patient"/>
              <source>
                <context value="immunization"/>
              </source>
              <dependent>
                <name value="PatientToDDCCVS"/>
                <variable value="patient"/>
                <variable value="ddcc"/>
              </dependent>
            </rule>
            <rule>
              <name value="set vaccination"/>
              <source>
                <context value="immunization"/>
              </source>
              <target>
                <context value="ddcc"/>
                <contextType value="variable"/>
                <element value="vaccination"/>
                <variable value="vaccination"/>
              </target>
              <dependent>
                <name value="ImmunizationToDDCC"/>
                <variable value="immunization"/>
                <variable value="vaccination"/>
              </dependent>
            </rule>
            <rule>
              <name value="set outentry"/>
              <source>
                <context value="immunization"/>
              </source>
              <target>
                <context value="outentry"/>
                <contextType value="variable"/>
                <element value="resource"/>
                <transform value="copy"/>
                <parameter>
                  <valueId value="ddcc"/>
                </parameter>
              </target>
            </rule>
            <documentation
                           value="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/DDCCCoreDataSet.VS') as ddcc then {"/>
          </rule>
        </rule>
      </rule>
    </rule>
  </group>
  <group>
    <name value="PatientToDDCCVS"/>
    <typeMode value="none"/>
    <input>
      <name value="patient"/>
      <type value="SHCPatientDM"/>
      <mode value="source"/>
    </input>
    <input>
      <name value="tgt"/>
      <type value="DDCCVS"/>
      <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>
      <documentation value="append doesn't work until ddcc.name is set"/>
    </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>
      <documentation
                     value="name.given not_first as other -&gt; ddcc.name as tName, ddcc.name = append( tName, other ) &quot;set other names&quot;;"/>
    </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="ImmunizationToDDCC"/>
    <typeMode value="none"/>
    <input>
      <name value="immunization"/>
      <type value="SHCImmunizationDM"/>
      <mode value="source"/>
    </input>
    <input>
      <name value="vaccination"/>
      <mode value="target"/>
    </input>
    <rule>
      <name value="vaccineCode"/>
      <source>
        <context value="immunization"/>
        <element value="vaccineCode"/>
        <variable value="vaccine"/>
      </source>
      <rule>
        <name value="coding"/>
        <source>
          <context value="vaccine"/>
          <element value="coding"/>
          <variable value="coding"/>
        </source>
        <rule>
          <name value="set default vaccine"/>
          <source>
            <context value="coding"/>
          </source>
          <target>
            <context value="vaccination"/>
            <contextType value="variable"/>
            <element value="vaccine"/>
            <transform value="copy"/>
            <parameter>
              <valueId value="coding"/>
            </parameter>
          </target>
        </rule>
        <rule>
          <name value="set default brand"/>
          <source>
            <context value="coding"/>
          </source>
          <target>
            <context value="vaccination"/>
            <contextType value="variable"/>
            <element value="brand"/>
            <transform value="copy"/>
            <parameter>
              <valueId value="coding"/>
            </parameter>
          </target>
        </rule>
        <rule>
          <name value="translate COVID CVX vaccine"/>
          <source>
            <context value="coding"/>
            <condition
                       value="coding.memberOf('http://smart.who.int/ddcc/ValueSet/vaccine-covid19-cvx')"/>
          </source>
          <target>
            <context value="vaccination"/>
            <contextType value="variable"/>
            <element value="vaccine"/>
            <transform value="translate"/>
            <parameter>
              <valueId value="coding"/>
            </parameter>
            <parameter>
              <valueString
                           value="http://smart.who.int/ddcc/ConceptMap/vaccine-covid19-cvx-to-icd11"/>
            </parameter>
            <parameter>
              <valueString value="Coding"/>
            </parameter>
          </target>
        </rule>
        <rule>
          <name value="translate COVID SNOMED vaccine"/>
          <source>
            <context value="coding"/>
            <condition
                       value="coding.memberOf('http://smart.who.int/ddcc/ValueSet/vaccine-covid19-snomed')"/>
          </source>
          <target>
            <context value="vaccination"/>
            <contextType value="variable"/>
            <element value="vaccine"/>
            <transform value="translate"/>
            <parameter>
              <valueId value="coding"/>
            </parameter>
            <parameter>
              <valueString
                           value="http://smart.who.int/ddcc/ConceptMap/vaccine-covid19-snomed-to-icd11"/>
            </parameter>
            <parameter>
              <valueString value="Coding"/>
            </parameter>
          </target>
        </rule>
      </rule>
    </rule>
    <rule>
      <name value="manufacturer"/>
      <source>
        <context value="immunization"/>
        <element value="manufacturer"/>
        <variable value="tman"/>
      </source>
      <rule>
        <name value="set manufacturer id"/>
        <source>
          <context value="tman"/>
          <element value="identifier"/>
          <variable value="identifier"/>
        </source>
        <target>
          <context value="vaccination"/>
          <contextType value="variable"/>
          <element value="manufacturer"/>
          <variable value="manufacturer"/>
        </target>
        <rule>
          <name value="set manufacturer system"/>
          <source>
            <context value="identifier"/>
            <element value="system"/>
            <variable value="system"/>
          </source>
          <target>
            <context value="manufacturer"/>
            <contextType value="variable"/>
            <element value="system"/>
            <transform value="copy"/>
            <parameter>
              <valueId value="system"/>
            </parameter>
          </target>
        </rule>
        <rule>
          <name value="set manufacturer value"/>
          <source>
            <context value="identifier"/>
            <element value="value"/>
            <variable value="value"/>
          </source>
          <target>
            <context value="manufacturer"/>
            <contextType value="variable"/>
            <element value="code"/>
            <transform value="copy"/>
            <parameter>
              <valueId value="value"/>
            </parameter>
          </target>
        </rule>
      </rule>
    </rule>
    <rule>
      <name value="set lot"/>
      <source>
        <context value="immunization"/>
        <element value="lotNumber"/>
        <variable value="lot"/>
      </source>
      <target>
        <context value="vaccination"/>
        <contextType value="variable"/>
        <element value="lot"/>
        <transform value="copy"/>
        <parameter>
          <valueId value="lot"/>
        </parameter>
      </target>
    </rule>
    <rule>
      <name value="set date"/>
      <source>
        <context value="immunization"/>
        <element value="occurrence"/>
        <variable value="date"/>
      </source>
      <target>
        <context value="vaccination"/>
        <contextType value="variable"/>
        <element value="date"/>
        <transform value="copy"/>
        <parameter>
          <valueId value="date"/>
        </parameter>
      </target>
    </rule>
    <rule>
      <name value="performer"/>
      <source>
        <context value="immunization"/>
        <element value="performer"/>
        <variable value="performer"/>
      </source>
      <rule>
        <name value="actor"/>
        <source>
          <context value="performer"/>
          <element value="actor"/>
          <variable value="actor"/>
        </source>
        <rule>
          <name value="set centre"/>
          <source>
            <context value="actor"/>
            <element value="display"/>
            <variable value="centre"/>
          </source>
          <target>
            <context value="vaccination"/>
            <contextType value="variable"/>
            <element value="centre"/>
            <transform value="copy"/>
            <parameter>
              <valueId value="centre"/>
            </parameter>
          </target>
        </rule>
      </rule>
    </rule>
  </group>
</StructureMap>