WHO Digital Documentation of COVID-19 Certificates (DDCC)
1.0.0 - CI Build
WHO Digital Documentation of COVID-19 Certificates (DDCC), published by WHO. This guide is not an authorized publication; it is the continuous build for version 1.0.0 built by the FHIR (HL7® FHIR® Standard) CI Build. This version is based on the current content of https://github.com/WorldHealthOrganization/ddcc/ and changes regularly. See the Directory of published versions
Draft as of 2024-10-17 |
<StructureMap xmlns="http://hl7.org/fhir">
<id value="CertSHCtoCoreDataSet"/>
<text>
<status value="generated"/>
<div xmlns="http://www.w3.org/1999/xhtml"><p class="res-header-id"><b>Generated Narrative: StructureMap CertSHCtoCoreDataSet</b></p><a name="CertSHCtoCoreDataSet"> </a><a name="hcCertSHCtoCoreDataSet"> </a><a name="CertSHCtoCoreDataSet-en-US"> </a><pre class="fml">
<b>map</b><span style="color: navy"> "</span>http://smart.who.int/ddcc/StructureMap/CertSHCtoCoreDataSet<span style="color: navy">" = "</span>CertSHCtoCoreDataSet<span style="color: navy">"
</span><span style="color: navy">// </span><span style="color: green">Structure map transforming CertSHC logical model to bundle of Core Data Set logical model</span>
<b>uses</b><span style="color: navy"> "</span><a href="StructureDefinition-CertSHC.html" title="Certificate - Smart Health Card's JSon Web Token Logical Model">http://smart.who.int/ddcc/StructureDefinition/CertSHC</a><span style="color: navy">" </span><b>alias </b>JWTPayload <b>as </b><b>source</b>
<b>uses</b><span style="color: navy"> "</span><a href="http://hl7.org/fhir/R4/bundle.html" title="Bundle">http://hl7.org/fhir/StructureDefinition/Bundle</a><span style="color: navy">" </span><b>alias </b>DDCCBundle <b>as </b><b>target</b>
<b>uses</b><span style="color: navy"> "</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">" </span><b>alias </b>DDCC <b>as </b><b>target</b>
<b>uses</b><span style="color: navy"> "</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">" </span><b>alias </b>DDCCVS <b>as </b><b>target</b>
<b>imports</b><span style="color: navy"> "</span><a href="StructureMap-SHCToCoreDataSetVS.html" title="SHCToCoreDataSetVS">http://smart.who.int/ddcc/StructureMap/SHCToCoreDataSetVS</a><span style="color: navy">"
</span><b>imports</b><span style="color: navy"> "</span><a href="StructureMap-SHCToCoreDataSetTR.html" title="SHCToCoreDataSetTR">http://smart.who.int/ddcc/StructureMap/SHCToCoreDataSetTR</a><span style="color: navy">"
</span>
<b>group </b>CertSHCtoCoreDataSetBundle<span style="color: navy">(</span><b>source</b> <span style="color: maroon">src</span><span style="color: navy"> : </span>JWTPayload, <b>target</b> <span style="color: maroon">ddccBundle</span><span style="color: navy"> : </span>Bundle<span style="color: navy">)</span><span style="color: navy"> {
</span> src.vc<b> as </b><span style="color: maroon">vc</span><b> then</b><span style="color: navy"> {
</span> vc.credentialSubject<b> as </b><span style="color: maroon">credentialSubject</span><b> then</b><span style="color: navy"> {
</span> credentialSubject.fhirBundle<b> as </b><span style="color: maroon">fhirBundle</span><b> then</b><span style="color: navy"> {
</span> fhirBundle.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> fhirBundle.entry<b> as </b><span style="color: maroon">entry</span><b> then</b><span style="color: navy"> {
</span> entry.resource<span style="color: navy"> : </span>Immunization<b> as </b><span style="color: maroon">immunization</span><span style="color: navy"><b> -> </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> immunization<b> then </b>PatientToDDCCVS<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>"set patient"</i><span style="color: navy">;</span>
immunization<span style="color: navy"><b> -> </b></span>ddcc.vaccination<b> as </b><span style="color: maroon">vaccination</span><b> then </b>ImmunizationToDDCC<span style="color: navy">(</span><span style="color: maroon">immunization</span><span style="color: navy">, </span><span style="color: maroon">vaccination</span><span style="color: navy">)</span> <i>"set vaccination"</i><span style="color: navy">;</span>
immunization<b> then </b>CertSHCtoCoreDataSet<span style="color: navy">(</span><span style="color: maroon">src</span><span style="color: navy">, </span><span style="color: maroon">ddcc</span><span style="color: navy">)</span> <i>"set ddcc"</i><span style="color: navy">;</span>
immunization<span style="color: navy"><b> -> </b></span>outentry.resource = <span style="color: maroon">ddcc</span> <i>"set outentry"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"immunizations"</i><span style="color: navy">;</span>
entry.resource<span style="color: navy"> : </span>Observation<b> as </b><span style="color: maroon">lab</span><span style="color: navy"><b> -> </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>"set patient"</i><span style="color: navy">;</span>
lab<span style="color: navy"><b> -> </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>"set test"</i><span style="color: navy">;</span>
lab<b> then </b>CertSHCtoCoreDataSet<span style="color: navy">(</span><span style="color: maroon">src</span><span style="color: navy">, </span><span style="color: maroon">ddcc</span><span style="color: navy">)</span> <i>"set ddcc"</i><span style="color: navy">;</span>
lab<span style="color: navy"><b> -> </b></span>outentry.resource = <span style="color: maroon">ddcc</span> <i>"set outentry"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"labs"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"entries"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"get patient"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"find patient"</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>CertSHCtoCoreDataSet<span style="color: navy">(</span><b>source</b> <span style="color: maroon">src</span><span style="color: navy"> : </span>JWTPayload, <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> src<span style="color: navy"><b> -> </b></span>ddcc.certificate<b> as </b><span style="color: maroon">cert</span><b> then</b><span style="color: navy"> {
</span> src.iss<span style="color: navy"><b> -> </b></span>cert.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><b> then</b><span style="color: navy"> {
</span> src.iss<b> as </b><span style="color: maroon">iss</span><span style="color: navy"><b> -> </b></span>issuer.reference = <span style="color: maroon">iss</span> <i>"set issuer"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"issuer"</i><span style="color: navy">;</span>
src<span style="color: navy"><b> -> </b></span>cert.period = <b>create</b><span style="color: navy">(</span><span style="color: blue">'Period'</span><span style="color: navy">)</span><b> as </b><span style="color: maroon">period</span><b> then</b><span style="color: navy"> {
</span> src<b> then </b>JwtToPeriod<span style="color: navy">(</span><span style="color: maroon">src</span><span style="color: navy">, </span><span style="color: maroon">period</span><span style="color: navy">)</span> <i>"set period"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"period"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"certificate"</i><span style="color: navy">;</span>
<span style="color: navy">}
</span><b>group </b>JwtToPeriod<span style="color: navy">(</span><b>source</b> <span style="color: maroon">src</span><span style="color: navy"> : </span>JWTPayload, <b>target</b> <span style="color: maroon">tgt</span><span style="color: navy"> : </span>Period<span style="color: navy">)</span><span style="color: navy"> {
</span> src.nbf<b> as </b><span style="color: maroon">nbf</span><span style="color: navy"><b> -> </b></span> <b>append</b><span style="color: navy">(</span><span style="color: maroon">nbf</span><span style="color: navy">, </span><span style="color: blue">' seconds'</span><span style="color: navy">)</span><b> as </b><span style="color: maroon">epoch</span><span style="color: navy">, </span> tgt.start = <span style="color: navy">(</span>@1970-01-01T00:00:00.000+00:00 + epoch.toQuantity()<span style="color: navy">)</span> <i>"set period start to notBefore"</i><span style="color: navy">;</span>
src.iat<b> as </b><span style="color: maroon">iat</span><span style="color: navy"><b> -> </b></span> <b>append</b><span style="color: navy">(</span><span style="color: maroon">iat</span><span style="color: navy">, </span><span style="color: blue">' seconds'</span><span style="color: navy">)</span><b> as </b><span style="color: maroon">epoch</span><span style="color: navy">, </span> tgt.start = <span style="color: navy">(</span>@1970-01-01T00:00:00.000+00:00 + epoch.toQuantity()<span style="color: navy">)</span> <i>"set period start to issuedAt"</i><span style="color: navy">;</span>
src.exp<b> as </b><span style="color: maroon">exp</span><span style="color: navy"><b> -> </b></span> <b>append</b><span style="color: navy">(</span><span style="color: maroon">exp</span><span style="color: navy">, </span><span style="color: blue">' seconds'</span><span style="color: navy">)</span><b> as </b><span style="color: maroon">epoch</span><span style="color: navy">, </span> tgt.end = <span style="color: navy">(</span>@1970-01-01T00:00:00.000+00:00 + epoch.toQuantity()<span style="color: navy">)</span> <i>"set period end"</i><span style="color: navy">;</span>
<span style="color: navy">}
</span></pre></div>
</text>
<url value="http://smart.who.int/ddcc/StructureMap/CertSHCtoCoreDataSet"/>
<version value="1.0.0"/>
<name value="CertSHCtoCoreDataSet"/>
<status value="draft"/>
<date value="2024-10-17T05:03:04+00:00"/>
<publisher value="WHO"/>
<contact>
<name value="WHO"/>
<telecom>
<system value="url"/>
<value value="http://who.int"/>
</telecom>
</contact>
<description
value="Structure map transforming CertSHC 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/CertSHC"/>
<mode value="source"/>
<alias value="JWTPayload"/>
</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>
<import value="http://smart.who.int/ddcc/StructureMap/SHCToCoreDataSetVS"/>
<import value="http://smart.who.int/ddcc/StructureMap/SHCToCoreDataSetTR"/>
<group>
<name value="CertSHCtoCoreDataSetBundle"/>
<typeMode value="none"/>
<input>
<name value="src"/>
<type value="JWTPayload"/>
<mode value="source"/>
</input>
<input>
<name value="ddccBundle"/>
<type value="Bundle"/>
<mode value="target"/>
</input>
<rule>
<name value="vc"/>
<source>
<context value="src"/>
<element value="vc"/>
<variable value="vc"/>
</source>
<rule>
<name value="credentialSubject"/>
<source>
<context value="vc"/>
<element value="credentialSubject"/>
<variable value="credentialSubject"/>
</source>
<rule>
<name value="fhirBundle"/>
<source>
<context value="credentialSubject"/>
<element value="fhirBundle"/>
<variable value="fhirBundle"/>
</source>
<rule>
<name value="find patient"/>
<source>
<context value="fhirBundle"/>
<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="fhirBundle"/>
<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/DDCCCoreDataSetVS"/>
</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 ddcc"/>
<source>
<context value="immunization"/>
</source>
<dependent>
<name value="CertSHCtoCoreDataSet"/>
<variable value="src"/>
<variable value="ddcc"/>
</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>
</rule>
<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 ddcc"/>
<source>
<context value="lab"/>
</source>
<dependent>
<name value="CertSHCtoCoreDataSet"/>
<variable value="src"/>
<variable value="ddcc"/>
</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>
</rule>
</rule>
</rule>
</group>
<group>
<name value="CertSHCtoCoreDataSet"/>
<typeMode value="none"/>
<input>
<name value="src"/>
<type value="JWTPayload"/>
<mode value="source"/>
</input>
<input>
<name value="ddcc"/>
<type value="DDCC"/>
<mode value="target"/>
</input>
<rule>
<name value="certificate"/>
<source>
<context value="src"/>
</source>
<target>
<context value="ddcc"/>
<contextType value="variable"/>
<element value="certificate"/>
<variable value="cert"/>
</target>
<rule>
<name value="issuer"/>
<source>
<context value="src"/>
<element value="iss"/>
</source>
<target>
<context value="cert"/>
<contextType value="variable"/>
<element value="issuer"/>
<variable value="issuer"/>
<transform value="create"/>
<parameter>
<valueString value="Reference"/>
</parameter>
</target>
<rule>
<name value="set issuer"/>
<source>
<context value="src"/>
<element value="iss"/>
<variable value="iss"/>
</source>
<target>
<context value="issuer"/>
<contextType value="variable"/>
<element value="reference"/>
<transform value="copy"/>
<parameter>
<valueId value="iss"/>
</parameter>
</target>
</rule>
</rule>
<rule>
<name value="period"/>
<source>
<context value="src"/>
</source>
<target>
<context value="cert"/>
<contextType value="variable"/>
<element value="period"/>
<variable value="period"/>
<transform value="create"/>
<parameter>
<valueString value="Period"/>
</parameter>
</target>
<rule>
<name value="set period"/>
<source>
<context value="src"/>
</source>
<dependent>
<name value="JwtToPeriod"/>
<variable value="src"/>
<variable value="period"/>
</dependent>
</rule>
</rule>
</rule>
</group>
<group>
<name value="JwtToPeriod"/>
<typeMode value="none"/>
<input>
<name value="src"/>
<type value="JWTPayload"/>
<mode value="source"/>
</input>
<input>
<name value="tgt"/>
<type value="Period"/>
<mode value="target"/>
</input>
<rule>
<name value="set period start to notBefore"/>
<source>
<context value="src"/>
<element value="nbf"/>
<variable value="nbf"/>
</source>
<target>
<contextType value="variable"/>
<variable value="epoch"/>
<transform value="append"/>
<parameter>
<valueId value="nbf"/>
</parameter>
<parameter>
<valueString value=" seconds"/>
</parameter>
</target>
<target>
<context value="tgt"/>
<contextType value="variable"/>
<element value="start"/>
<transform value="evaluate"/>
<parameter>
<valueString
value="@1970-01-01T00:00:00.000+00:00 + epoch.toQuantity()"/>
</parameter>
</target>
</rule>
<rule>
<name value="set period start to issuedAt"/>
<source>
<context value="src"/>
<element value="iat"/>
<variable value="iat"/>
</source>
<target>
<contextType value="variable"/>
<variable value="epoch"/>
<transform value="append"/>
<parameter>
<valueId value="iat"/>
</parameter>
<parameter>
<valueString value=" seconds"/>
</parameter>
</target>
<target>
<context value="tgt"/>
<contextType value="variable"/>
<element value="start"/>
<transform value="evaluate"/>
<parameter>
<valueString
value="@1970-01-01T00:00:00.000+00:00 + epoch.toQuantity()"/>
</parameter>
</target>
</rule>
<rule>
<name value="set period end"/>
<source>
<context value="src"/>
<element value="exp"/>
<variable value="exp"/>
</source>
<target>
<contextType value="variable"/>
<variable value="epoch"/>
<transform value="append"/>
<parameter>
<valueId value="exp"/>
</parameter>
<parameter>
<valueString value=" seconds"/>
</parameter>
</target>
<target>
<context value="tgt"/>
<contextType value="variable"/>
<element value="end"/>
<transform value="evaluate"/>
<parameter>
<valueString
value="@1970-01-01T00:00:00.000+00:00 + epoch.toQuantity()"/>
</parameter>
</target>
</rule>
</group>
</StructureMap>