WHO Digital Documentation of COVID-19 Certificates (DDCC)
1.0.1 - release
This page is part of the WHO Digital Documentation of COVID-19 Certificates (DDCC) (v1.0.1: 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
Draft as of 2024-12-18 |
<StructureMap xmlns="http://hl7.org/fhir">
<id value="ResourcesToVSCoreDataSet"/>
<text>
<status value="generated"/>
<div xmlns="http://www.w3.org/1999/xhtml"><p class="res-header-id"><b>Generated Narrative: StructureMap ResourcesToVSCoreDataSet</b></p><a name="ResourcesToVSCoreDataSet"> </a><a name="hcResourcesToVSCoreDataSet"> </a><a name="ResourcesToVSCoreDataSet-en-US"> </a><pre class="fml">
<b>map</b><span style="color: navy"> "</span>http://smart.who.int/ddcc/StructureMap/ResourcesToVSCoreDataSet<span style="color: navy">" = "</span>ResourcesToVSCoreDataSet<span style="color: navy">"
</span><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>Bundle <b>as </b><b>source</b>
<b>uses</b><span style="color: navy"> "</span><a href="http://hl7.org/fhir/R4/datatypes.html#HumanName" title="HumanName">http://hl7.org/fhir/StructureDefinition/HumanName</a><span style="color: navy">" </span><b>alias </b>HumanName <b>as </b><b>target</b>
<b>uses</b><span style="color: navy"> "</span><a href="StructureDefinition-DDCCPatient.html" title="DDCC Patient">http://smart.who.int/ddcc/StructureDefinition/DDCCPatient</a><span style="color: navy">" </span><b>alias </b>DDCCPatient <b>as </b><b>source</b>
<b>uses</b><span style="color: navy"> "</span><a href="StructureDefinition-DDCCImmunization.html" title="DDCC Immunization">http://smart.who.int/ddcc/StructureDefinition/DDCCImmunization</a><span style="color: navy">" </span><b>alias </b>DDCCImmunization <b>as </b><b>source</b>
<b>uses</b><span style="color: navy"> "</span><a href="StructureDefinition-DDCCImmunizationRecommendation.html" title="DDCC Immunization Recommendation">http://smart.who.int/ddcc/StructureDefinition/DDCCImmunizationRecommendation</a><span style="color: navy">" </span><b>alias </b>DDCCImmunizationRecommendation <b>as </b><b>source</b>
<b>uses</b><span style="color: navy"> "</span><a href="StructureDefinition-DDCCVSComposition.html" title="DDCC:VS Composition">http://smart.who.int/ddcc/StructureDefinition/DDCCVSComposition</a><span style="color: navy">" </span><b>alias </b>DDCCVSComposition <b>as </b><b>source</b>
<b>uses</b><span style="color: navy"> "</span><a href="StructureDefinition-DDCCCoreDataSetVSPoV.html" title="DDCC Core Data Set Logical Model - Vaccination Status - Proof of Vaccination">http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSetVSPoV</a><span style="color: navy">" </span><b>alias </b>DDCCPoV <b>as </b><b>target</b>
<b>group </b>ResourcesToCoreDataSet<span style="color: navy">(</span><b>source</b> <span style="color: maroon">bundle</span><span style="color: navy"> : </span>Bundle, <b>target</b> <span style="color: maroon">ddcc</span><span style="color: navy"> : </span>DDCCPoV<span style="color: navy">)</span><span style="color: navy"> {
</span> bundle<span style="color: navy"><b> -> </b></span> ddcc.vaccination<b> as </b><span style="color: maroon">vaccination</span><span style="color: navy">, </span> ddcc.certificate<b> as </b><span style="color: maroon">certificate</span><b> then</b><span style="color: navy"> {
</span> bundle.link first<b> as </b><span style="color: maroon">link</span><span style="color: navy"><b> -> </b></span>certificate.hcid<b> as </b><span style="color: maroon">hcid</span><b> then</b><span style="color: navy"> {
</span> <span style="color: navy">// </span><span style="color: green">There's got to be a better way to do this</span>
link.url<b> as </b><span style="color: maroon">url</span><span style="color: navy"><b> -> </b></span>hcid.value = <span style="color: navy">(</span>url.replaceMatches('[Uu][Rr][Nn]:[Hh][Cc][Ii][Dd]:', '')<span style="color: navy">)</span> <i>"set hcid value"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"set hcid"</i><span style="color: navy">;</span>
bundle.id<b> as </b><span style="color: maroon">id</span><span style="color: navy"><b> -> </b></span> certificate.ddccid<b> as </b><span style="color: maroon">ddccid</span><span style="color: navy">, </span> ddccid.value = <span style="color: maroon">id</span> <i>"set ddcc id value"</i><span style="color: navy">;</span>
bundle.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>Patient first<b> as </b><span style="color: maroon">patient</span><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 details"</i><span style="color: navy">;</span>
entry.resource<span style="color: navy"> : </span>Immunization first<b> as </b><span style="color: maroon">immunization</span><b> then </b>ImmunizationToDDCCVS<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><span style="color: maroon">certificate</span><span style="color: navy">)</span> <i>"set immunization"</i><span style="color: navy">;</span>
entry.resource<span style="color: navy"> : </span>ImmunizationRecommendation first<b> as </b><span style="color: maroon">immRec</span><b> then </b>ImmRecToDDCCVS<span style="color: navy">(</span><span style="color: maroon">immRec</span><span style="color: navy">, </span><span style="color: maroon">vaccination</span><span style="color: navy">)</span> <i>"set immunization recommendation"</i><span style="color: navy">;</span>
entry.resource<span style="color: navy"> : </span>Composition first<b> as </b><span style="color: maroon">composition</span><b> then </b>CompositionToDDCCVS<span style="color: navy">(</span><span style="color: maroon">composition</span><span style="color: navy">, </span><span style="color: maroon">certificate</span><span style="color: navy">)</span> <i>"set composition"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"set header from patient"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"setup ddcc"</i><span style="color: navy">;</span>
<span style="color: navy">// </span><span style="color: green">// entry.resource : DDCCPatient as patient entry.resource : Patient as patient then Decode-Patient-To-QR(patient,qr) "Patient"; };</span>
<span style="color: navy">// </span><span style="color: green">bundle as src then QRespToHeader( src, ddcc ) "set header content"; bundle as src -> ddcc.vaccination as vaccination then QRespToVaccination( src, vaccination ) "set vaccination content"; bundle as src -> ddcc.certificate as certificate then QRespToCertificate( src, certificate ) "set certificate content";</span>
<span style="color: navy">// </span><span style="color: green">then { a as item where linkId = 'name' -> ddcc.name = item "set name"; } "items";</span>
<span style="color: navy">}
</span><b>group </b>CompositionToDDCCVS<span style="color: navy">(</span><b>source</b> <span style="color: maroon">composition</span><span style="color: navy"> : </span>DDCCVSComposition, <b>target</b> <span style="color: maroon">certificate</span><span style="color: navy">)</span><span style="color: navy"> {
</span> composition<span style="color: navy"><b> -> </b></span>certificate.version = <span style="color: blue">'RC2'</span> <i>"set version"</i><span style="color: navy">;</span>
composition.event first<b> as </b><span style="color: maroon">event</span><b> then</b><span style="color: navy"> {
</span> event.period<b> as </b><span style="color: maroon">period</span><span style="color: navy"><b> -> </b></span>certificate.period<b> as </b><span style="color: maroon">tPeriod</span><b> then</b><span style="color: navy"> {
</span> period.start<b> as </b><span style="color: maroon">start</span><span style="color: navy"><b> -> </b></span>tPeriod.start = <span style="color: maroon">start</span> <i>"set period start"</i><span style="color: navy">;</span>
period.end<b> as </b><span style="color: maroon">end</span><span style="color: navy"><b> -> </b></span>tPeriod.end = <span style="color: maroon">end</span> <i>"set period end"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"set period"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"set certificate period"</i><span style="color: navy">;</span>
<span style="color: navy">}
</span><b>group </b>PatientToDDCCVS<span style="color: navy">(</span><b>source</b> <span style="color: maroon">patient</span><span style="color: navy"> : </span>DDCCPatient, <b>target</b> <span style="color: maroon">ddcc</span><span style="color: navy"> : </span>DDCCPoV<span style="color: navy">)</span><span style="color: navy"> {
</span> patient.name<b> as </b><span style="color: maroon">name</span><b> then </b>NameToText<span style="color: navy">(</span><span style="color: maroon">name</span><span style="color: navy">, </span><span style="color: maroon">ddcc</span><span style="color: navy">)</span> <i>"set name"</i><span style="color: navy">;</span>
patient.birthDate<b> as </b><span style="color: maroon">bday</span><span style="color: navy"><b> -> </b></span>ddcc.birthDate = <span style="color: maroon">bday</span> <i>"set birth date"</i><span style="color: navy">;</span>
patient.id<b> as </b><span style="color: maroon">id</span><span style="color: navy"><b> -> </b></span> ddcc.identifier<b> as </b><span style="color: maroon">identifier</span><span style="color: navy">, </span> identifier.value = <span style="color: maroon">id</span> <i>"set identifier from id"</i><span style="color: navy">;</span>
<span style="color: navy">// </span><span style="color: green">this will override what was set from id if it exists</span>
patient.identifier first<b> as </b><span style="color: maroon">sId</span><span style="color: navy"><b> -> </b></span>ddcc.identifier<b> as </b><span style="color: maroon">identifier</span><b> then</b><span style="color: navy"> {
</span> sId.value<b> as </b><span style="color: maroon">id</span><span style="color: navy"><b> -> </b></span>identifier.value = <span style="color: maroon">id</span> <i>"set identifier value"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"set identifier from identifier"</i><span style="color: navy">;</span>
patient.gender<b> as </b><span style="color: maroon">gender</span><span style="color: navy"><b> -> </b></span>ddcc.sex = <span style="color: maroon">gender</span> <i>"set sex"</i><span style="color: navy">;</span>
<span style="color: navy">}
</span><b>group </b>NameToText<span style="color: navy">(</span><b>source</b> <span style="color: maroon">name</span><span style="color: navy"> : </span>HumanName, <b>target</b> <span style="color: maroon">ddcc</span><span style="color: navy">)</span><span style="color: navy"> {
</span> <span style="color: navy">// </span><span style="color: green">annoying because append doesn't work until ddcc.name is set</span>
name.given first<b> as </b><span style="color: maroon">given</span><span style="color: navy"><b> -> </b></span>ddcc.name = <span style="color: navy">(</span>given.replaceMatches('$', ' ')<span style="color: navy">)</span> <i>"set first name"</i><span style="color: navy">;</span>
<span style="color: #b36b00" title="This element was not defined prior to R5">// name.given not_first as other -> ddcc.name as tName, ddcc.name = append( tName, other ) "set other names";</span>
name.given not_first<b> as </b><span style="color: maroon">other</span><span style="color: navy"><b> -> </b></span> ddcc.name<b> as </b><span style="color: maroon">tName</span><span style="color: navy">, </span> <span style="color: navy">(</span>other.replaceMatches('$', ' ')<span style="color: navy">)</span><b> as </b><span style="color: maroon">spaced</span><span style="color: navy">, </span> ddcc.name = <b>append</b><span style="color: navy">(</span><span style="color: maroon">tName</span><span style="color: navy">, </span><span style="color: maroon">spaced</span><span style="color: navy">)</span> <i>"set other names"</i><span style="color: navy">;</span>
name.family<b> as </b><span style="color: maroon">family</span><span style="color: navy"><b> -> </b></span> ddcc.name<b> as </b><span style="color: maroon">tName</span><span style="color: navy">, </span> ddcc.name = <b>append</b><span style="color: navy">(</span><span style="color: maroon">tName</span><span style="color: navy">, </span><span style="color: maroon">family</span><span style="color: navy">)</span> <i>"add family name"</i><span style="color: navy">;</span>
name.text<b> as </b><span style="color: maroon">text</span><span style="color: navy"><b> -> </b></span>ddcc.name = <span style="color: maroon">text</span> <i>"set full name"</i><span style="color: navy">;</span>
<span style="color: navy">}
</span><b>group </b>ImmunizationToDDCCVS<span style="color: navy">(</span><b>source</b> <span style="color: maroon">immunization</span><span style="color: navy"> : </span>DDCCImmunization, <b>target</b> <span style="color: maroon">vaccination</span>, <b>target</b> <span style="color: maroon">certificate</span><span style="color: navy">)</span><span style="color: navy"> {
</span> immunization.vaccineCode<b> as </b><span style="color: maroon">code</span><b> then</b><span style="color: navy"> {
</span> code.coding first<b> as </b><span style="color: maroon">coding</span><span style="color: navy"><b> -> </b></span>vaccination.vaccine = <span style="color: maroon">coding</span> <i>"set vaccine"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"set vaccine code"</i><span style="color: navy">;</span>
immunization.extension<b> as </b><span style="color: maroon">ext</span><b> then</b><span style="color: navy"> {
</span> ext first<b> as </b><span style="color: maroon">brand</span><b> where </b>ext.url = 'http://smart.who.int/ddcc/StructureDefinition/DDCCVaccineBrand'<b> then</b><span style="color: navy"> {
</span> brand.valueCoding<b> as </b><span style="color: maroon">coding</span><span style="color: navy"><b> -> </b></span>vaccination.brand = <span style="color: maroon">coding</span> <i>"set brand code"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"set brand"</i><span style="color: navy">;</span>
ext first<b> as </b><span style="color: maroon">maholder</span><b> where </b>ext.url = 'http://smart.who.int/ddcc/StructureDefinition/DDCCVaccineMarketAuthorization'<b> then</b><span style="color: navy"> {
</span> maholder.valueCoding<b> as </b><span style="color: maroon">coding</span><span style="color: navy"><b> -> </b></span>vaccination.maholder = <span style="color: maroon">coding</span> <i>"set maholder code"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"set maholder"</i><span style="color: navy">;</span>
ext first<b> as </b><span style="color: maroon">valid</span><b> where </b>ext.url = 'http://smart.who.int/ddcc/StructureDefinition/DDCCVaccineValidFrom'<b> then</b><span style="color: navy"> {
</span> valid.valueDateTime<b> as </b><span style="color: maroon">date</span><span style="color: navy"><b> -> </b></span>vaccination.validFrom = <span style="color: maroon">date</span> <i>"set validFrom date"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"set validFrom"</i><span style="color: navy">;</span>
ext first<b> as </b><span style="color: maroon">country</span><b> where </b>ext.url = 'http://smart.who.int/ddcc/StructureDefinition/DDCCCountryOfVaccination'<b> then</b><span style="color: navy"> {
</span> country.valueCode<b> as </b><span style="color: maroon">code</span><span style="color: navy"><b> -> </b></span> vaccination.country<b> as </b><span style="color: maroon">vCountry</span><span style="color: navy">, </span> vCountry.system = <span style="color: blue">'urn:iso:std:iso:3166'</span><span style="color: navy">, </span> vCountry.code = <span style="color: maroon">code</span> <i>"set country code"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"set country"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"set extensions"</i><span style="color: navy">;</span>
immunization.manufacturer<b> as </b><span style="color: maroon">manufacturer</span><b> then</b><span style="color: navy"> {
</span> manufacturer.identifier<b> as </b><span style="color: maroon">identifier</span><span style="color: navy"><b> -> </b></span>vaccination.manufacturer<b> as </b><span style="color: maroon">vMan</span><b> then</b><span style="color: navy"> {
</span> identifier.system<b> as </b><span style="color: maroon">system</span><span style="color: navy"><b> -> </b></span>vMan.system = <span style="color: maroon">system</span> <i>"set manufacturer system"</i><span style="color: navy">;</span>
identifier.value<b> as </b><span style="color: maroon">value</span><span style="color: navy"><b> -> </b></span>vMan.code = <span style="color: maroon">value</span> <i>"set manufactutuer code"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"set manufacturer id"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"set manufacturer"</i><span style="color: navy">;</span>
immunization.lotNumber<b> as </b><span style="color: maroon">lot</span><span style="color: navy"><b> -> </b></span>vaccination.lot = <span style="color: maroon">lot</span> <i>"set lot number"</i><span style="color: navy">;</span>
immunization.occurrence<b> as </b><span style="color: maroon">date</span><span style="color: navy"><b> -> </b></span>vaccination.date = <span style="color: maroon">date</span> <i>"set date"</i><span style="color: navy">;</span>
immunization.protocolApplied first<b> as </b><span style="color: maroon">protocol</span><b> then</b><span style="color: navy"> {
</span> protocol.doseNumber<b> as </b><span style="color: maroon">dose</span><span style="color: navy"><b> -> </b></span>vaccination.dose = <span style="color: maroon">dose</span> <i>"set dose"</i><span style="color: navy">;</span>
protocol.seriesDoses<b> as </b><span style="color: maroon">totalDoses</span><span style="color: navy"><b> -> </b></span>vaccination.totalDoses = <span style="color: maroon">totalDoses</span> <i>"set totalDoses"</i><span style="color: navy">;</span>
protocol.targetDisease first<b> as </b><span style="color: maroon">disease</span><b> then</b><span style="color: navy"> {
</span> disease.coding first<b> as </b><span style="color: maroon">coding</span><span style="color: navy"><b> -> </b></span>vaccination.disease = <span style="color: maroon">coding</span> <i>"set disease coding"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"set disease"</i><span style="color: navy">;</span>
protocol.authority<b> as </b><span style="color: maroon">authority</span><span style="color: navy"><b> -> </b></span>certificate.issuer<b> as </b><span style="color: maroon">issuer</span><b> then</b><span style="color: navy"> {
</span> authority.reference<b> as </b><span style="color: maroon">reference</span><span style="color: navy"><b> -> </b></span>issuer.identifier<b> as </b><span style="color: maroon">identifier</span><b> then</b><span style="color: navy"> {
</span> reference<span style="color: navy"><b> -> </b></span>identifier.value = <span style="color: maroon">reference</span> <i>"set reference"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"set issuer from reference"</i><span style="color: navy">;</span>
authority.identifier<b> as </b><span style="color: maroon">identifier</span><span style="color: navy"><b> -> </b></span>issuer.identifier = <span style="color: maroon">identifier</span> <i>"set issuer identifier"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"set issuer"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"set protocol applied"</i><span style="color: navy">;</span>
immunization.location<b> as </b><span style="color: maroon">location</span><b> then</b><span style="color: navy"> {
</span> location.reference<b> as </b><span style="color: maroon">reference</span><span style="color: navy"><b> -> </b></span>vaccination.centre = <span style="color: maroon">reference</span> <i>"set vaccination centre from reference"</i><span style="color: navy">;</span>
location.display<b> as </b><span style="color: maroon">centre</span><span style="color: navy"><b> -> </b></span>vaccination.centre = <span style="color: maroon">centre</span> <i>"set vaccination centre"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"set vaccination centre location"</i><span style="color: navy">;</span>
immunization.performer first<b> as </b><span style="color: maroon">performer</span><b> then</b><span style="color: navy"> {
</span> performer.actor<b> as </b><span style="color: maroon">actor</span><b> then</b><span style="color: navy"> {
</span> actor.identifier<b> as </b><span style="color: maroon">identifier</span><span style="color: navy"><b> -> </b></span>vaccination.practitioner = <span style="color: maroon">identifier</span> <i>"set practitioner"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"set actor"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"set performer"</i><span style="color: navy">;</span>
<span style="color: navy">}
</span><b>group </b>ImmRecToDDCCVS<span style="color: navy">(</span><b>source</b> <span style="color: maroon">immRec</span><span style="color: navy"> : </span>DDCCImmunizationRecommendation, <b>target</b> <span style="color: maroon">vaccination</span><span style="color: navy">)</span><span style="color: navy"> {
</span> immRec.recommendation<b> as </b><span style="color: maroon">rec</span><b> then</b><span style="color: navy"> {
</span> rec.dateCriterion first<b> as </b><span style="color: maroon">due_date</span><b> then</b><span style="color: navy"> {
</span> due_date.value<b> as </b><span style="color: maroon">date</span><span style="color: navy"><b> -> </b></span>vaccination.nextDose = <span style="color: maroon">date</span> <i>"set due date"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"get date criterion"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"get recommendation"</i><span style="color: navy">;</span>
<span style="color: navy">}
</span></pre></div>
</text>
<url
value="http://smart.who.int/ddcc/StructureMap/ResourcesToVSCoreDataSet"/>
<version value="1.0.1"/>
<name value="ResourcesToVSCoreDataSet"/>
<status value="draft"/>
<date value="2024-12-18T16:46:48+01: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/StructureDefinition/Bundle"/>
<mode value="source"/>
<alias value="Bundle"/>
</structure>
<structure>
<url value="http://hl7.org/fhir/StructureDefinition/HumanName"/>
<mode value="target"/>
<alias value="HumanName"/>
</structure>
<structure>
<url value="http://smart.who.int/ddcc/StructureDefinition/DDCCPatient"/>
<mode value="source"/>
<alias value="DDCCPatient"/>
</structure>
<structure>
<url
value="http://smart.who.int/ddcc/StructureDefinition/DDCCImmunization"/>
<mode value="source"/>
<alias value="DDCCImmunization"/>
</structure>
<structure>
<url
value="http://smart.who.int/ddcc/StructureDefinition/DDCCImmunizationRecommendation"/>
<mode value="source"/>
<alias value="DDCCImmunizationRecommendation"/>
</structure>
<structure>
<url
value="http://smart.who.int/ddcc/StructureDefinition/DDCCVSComposition"/>
<mode value="source"/>
<alias value="DDCCVSComposition"/>
</structure>
<structure>
<url
value="http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSetVSPoV"/>
<mode value="target"/>
<alias value="DDCCPoV"/>
</structure>
<group>
<name value="ResourcesToCoreDataSet"/>
<typeMode value="none"/>
<input>
<name value="bundle"/>
<type value="Bundle"/>
<mode value="source"/>
</input>
<input>
<name value="ddcc"/>
<type value="DDCCPoV"/>
<mode value="target"/>
</input>
<rule>
<name value="setup ddcc"/>
<source>
<context value="bundle"/>
</source>
<target>
<context value="ddcc"/>
<contextType value="variable"/>
<element value="vaccination"/>
<variable value="vaccination"/>
</target>
<target>
<context value="ddcc"/>
<contextType value="variable"/>
<element value="certificate"/>
<variable value="certificate"/>
</target>
<rule>
<name value="set hcid"/>
<source>
<context value="bundle"/>
<element value="link"/>
<listMode value="first"/>
<variable value="link"/>
</source>
<target>
<context value="certificate"/>
<contextType value="variable"/>
<element value="hcid"/>
<variable value="hcid"/>
</target>
<rule>
<name value="set hcid value"/>
<source>
<context value="link"/>
<element value="url"/>
<variable value="url"/>
</source>
<target>
<context value="hcid"/>
<contextType value="variable"/>
<element value="value"/>
<transform value="evaluate"/>
<parameter>
<valueString
value="url.replaceMatches('[Uu][Rr][Nn]:[Hh][Cc][Ii][Dd]:', '')"/>
</parameter>
</target>
</rule>
</rule>
<rule>
<name value="set ddcc id value"/>
<source>
<context value="bundle"/>
<element value="id"/>
<variable value="id"/>
</source>
<target>
<context value="certificate"/>
<contextType value="variable"/>
<element value="ddccid"/>
<variable value="ddccid"/>
</target>
<target>
<context value="ddccid"/>
<contextType value="variable"/>
<element value="value"/>
<transform value="copy"/>
<parameter>
<valueId value="id"/>
</parameter>
</target>
</rule>
<rule>
<name value="set header from patient"/>
<source>
<context value="bundle"/>
<element value="entry"/>
<variable value="entry"/>
</source>
<rule>
<name value="set patient details"/>
<source>
<context value="entry"/>
<type value="Patient"/>
<element value="resource"/>
<listMode value="first"/>
<variable value="patient"/>
</source>
<dependent>
<name value="PatientToDDCCVS"/>
<variable value="patient"/>
<variable value="ddcc"/>
</dependent>
</rule>
<rule>
<name value="set immunization"/>
<source>
<context value="entry"/>
<type value="Immunization"/>
<element value="resource"/>
<listMode value="first"/>
<variable value="immunization"/>
</source>
<dependent>
<name value="ImmunizationToDDCCVS"/>
<variable value="immunization"/>
<variable value="vaccination"/>
<variable value="certificate"/>
</dependent>
</rule>
<rule>
<name value="set immunization recommendation"/>
<source>
<context value="entry"/>
<type value="ImmunizationRecommendation"/>
<element value="resource"/>
<listMode value="first"/>
<variable value="immRec"/>
</source>
<dependent>
<name value="ImmRecToDDCCVS"/>
<variable value="immRec"/>
<variable value="vaccination"/>
</dependent>
</rule>
<rule>
<name value="set composition"/>
<source>
<context value="entry"/>
<type value="Composition"/>
<element value="resource"/>
<listMode value="first"/>
<variable value="composition"/>
</source>
<dependent>
<name value="CompositionToDDCCVS"/>
<variable value="composition"/>
<variable value="certificate"/>
</dependent>
</rule>
</rule>
</rule>
</group>
<group>
<name value="CompositionToDDCCVS"/>
<typeMode value="none"/>
<input>
<name value="composition"/>
<type value="DDCCVSComposition"/>
<mode value="source"/>
</input>
<input>
<name value="certificate"/>
<mode value="target"/>
</input>
<rule>
<name value="set version"/>
<source>
<context value="composition"/>
</source>
<target>
<context value="certificate"/>
<contextType value="variable"/>
<element value="version"/>
<transform value="copy"/>
<parameter>
<valueString value="RC2"/>
</parameter>
</target>
</rule>
<rule>
<name value="set certificate period"/>
<source>
<context value="composition"/>
<element value="event"/>
<listMode value="first"/>
<variable value="event"/>
</source>
<rule>
<name value="set period"/>
<source>
<context value="event"/>
<element value="period"/>
<variable value="period"/>
</source>
<target>
<context value="certificate"/>
<contextType value="variable"/>
<element value="period"/>
<variable value="tPeriod"/>
</target>
<rule>
<name value="set period start"/>
<source>
<context value="period"/>
<element value="start"/>
<variable value="start"/>
</source>
<target>
<context value="tPeriod"/>
<contextType value="variable"/>
<element value="start"/>
<transform value="copy"/>
<parameter>
<valueId value="start"/>
</parameter>
</target>
</rule>
<rule>
<name value="set period end"/>
<source>
<context value="period"/>
<element value="end"/>
<variable value="end"/>
</source>
<target>
<context value="tPeriod"/>
<contextType value="variable"/>
<element value="end"/>
<transform value="copy"/>
<parameter>
<valueId value="end"/>
</parameter>
</target>
</rule>
</rule>
</rule>
</group>
<group>
<name value="PatientToDDCCVS"/>
<typeMode value="none"/>
<input>
<name value="patient"/>
<type value="DDCCPatient"/>
<mode value="source"/>
</input>
<input>
<name value="ddcc"/>
<type value="DDCCPoV"/>
<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="ddcc"/>
</dependent>
</rule>
<rule>
<name value="set birth date"/>
<source>
<context value="patient"/>
<element value="birthDate"/>
<variable value="bday"/>
</source>
<target>
<context value="ddcc"/>
<contextType value="variable"/>
<element value="birthDate"/>
<transform value="copy"/>
<parameter>
<valueId value="bday"/>
</parameter>
</target>
</rule>
<rule>
<name value="set identifier from id"/>
<source>
<context value="patient"/>
<element value="id"/>
<variable value="id"/>
</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="id"/>
</parameter>
</target>
</rule>
<rule>
<name value="set identifier from identifier"/>
<source>
<context value="patient"/>
<element value="identifier"/>
<listMode value="first"/>
<variable value="sId"/>
</source>
<target>
<context value="ddcc"/>
<contextType value="variable"/>
<element value="identifier"/>
<variable value="identifier"/>
</target>
<rule>
<name value="set identifier value"/>
<source>
<context value="sId"/>
<element value="value"/>
<variable value="id"/>
</source>
<target>
<context value="identifier"/>
<contextType value="variable"/>
<element value="value"/>
<transform value="copy"/>
<parameter>
<valueId value="id"/>
</parameter>
</target>
</rule>
</rule>
<rule>
<name value="set sex"/>
<source>
<context value="patient"/>
<element value="gender"/>
<variable value="gender"/>
</source>
<target>
<context value="ddcc"/>
<contextType value="variable"/>
<element value="sex"/>
<transform value="copy"/>
<parameter>
<valueId value="gender"/>
</parameter>
</target>
</rule>
</group>
<group>
<name value="NameToText"/>
<typeMode value="none"/>
<input>
<name value="name"/>
<type value="HumanName"/>
<mode value="source"/>
</input>
<input>
<name value="ddcc"/>
<mode value="target"/>
</input>
<rule>
<name value="set first name"/>
<source>
<context value="name"/>
<element value="given"/>
<listMode value="first"/>
<variable value="given"/>
</source>
<target>
<context value="ddcc"/>
<contextType value="variable"/>
<element value="name"/>
<transform value="evaluate"/>
<parameter>
<valueString value="given.replaceMatches('$', ' ')"/>
</parameter>
</target>
</rule>
<rule>
<name value="set other names"/>
<source>
<context value="name"/>
<element value="given"/>
<listMode value="not_first"/>
<variable value="other"/>
</source>
<target>
<context value="ddcc"/>
<contextType value="variable"/>
<element value="name"/>
<variable value="tName"/>
</target>
<target>
<contextType value="variable"/>
<variable value="spaced"/>
<transform value="evaluate"/>
<parameter>
<valueString value="other.replaceMatches('$', ' ')"/>
</parameter>
</target>
<target>
<context value="ddcc"/>
<contextType value="variable"/>
<element value="name"/>
<transform value="append"/>
<parameter>
<valueId value="tName"/>
</parameter>
<parameter>
<valueId value="spaced"/>
</parameter>
</target>
</rule>
<rule>
<name value="add family name"/>
<source>
<context value="name"/>
<element value="family"/>
<variable value="family"/>
</source>
<target>
<context value="ddcc"/>
<contextType value="variable"/>
<element value="name"/>
<variable value="tName"/>
</target>
<target>
<context value="ddcc"/>
<contextType value="variable"/>
<element value="name"/>
<transform value="append"/>
<parameter>
<valueId value="tName"/>
</parameter>
<parameter>
<valueId value="family"/>
</parameter>
</target>
</rule>
<rule>
<name value="set full name"/>
<source>
<context value="name"/>
<element value="text"/>
<variable value="text"/>
</source>
<target>
<context value="ddcc"/>
<contextType value="variable"/>
<element value="name"/>
<transform value="copy"/>
<parameter>
<valueId value="text"/>
</parameter>
</target>
</rule>
</group>
<group>
<name value="ImmunizationToDDCCVS"/>
<typeMode value="none"/>
<input>
<name value="immunization"/>
<type value="DDCCImmunization"/>
<mode value="source"/>
</input>
<input>
<name value="vaccination"/>
<mode value="target"/>
</input>
<input>
<name value="certificate"/>
<mode value="target"/>
</input>
<rule>
<name value="set vaccine code"/>
<source>
<context value="immunization"/>
<element value="vaccineCode"/>
<variable value="code"/>
</source>
<rule>
<name value="set vaccine"/>
<source>
<context value="code"/>
<element value="coding"/>
<listMode value="first"/>
<variable value="coding"/>
</source>
<target>
<context value="vaccination"/>
<contextType value="variable"/>
<element value="vaccine"/>
<transform value="copy"/>
<parameter>
<valueId value="coding"/>
</parameter>
</target>
</rule>
</rule>
<rule>
<name value="set extensions"/>
<source>
<context value="immunization"/>
<element value="extension"/>
<variable value="ext"/>
</source>
<rule>
<name value="set brand"/>
<source>
<context value="ext"/>
<listMode value="first"/>
<variable value="brand"/>
<condition
value="ext.url = 'http://smart.who.int/ddcc/StructureDefinition/DDCCVaccineBrand'"/>
</source>
<rule>
<name value="set brand code"/>
<source>
<context value="brand"/>
<element value="valueCoding"/>
<variable value="coding"/>
</source>
<target>
<context value="vaccination"/>
<contextType value="variable"/>
<element value="brand"/>
<transform value="copy"/>
<parameter>
<valueId value="coding"/>
</parameter>
</target>
</rule>
</rule>
<rule>
<name value="set maholder"/>
<source>
<context value="ext"/>
<listMode value="first"/>
<variable value="maholder"/>
<condition
value="ext.url = 'http://smart.who.int/ddcc/StructureDefinition/DDCCVaccineMarketAuthorization'"/>
</source>
<rule>
<name value="set maholder code"/>
<source>
<context value="maholder"/>
<element value="valueCoding"/>
<variable value="coding"/>
</source>
<target>
<context value="vaccination"/>
<contextType value="variable"/>
<element value="maholder"/>
<transform value="copy"/>
<parameter>
<valueId value="coding"/>
</parameter>
</target>
</rule>
</rule>
<rule>
<name value="set validFrom"/>
<source>
<context value="ext"/>
<listMode value="first"/>
<variable value="valid"/>
<condition
value="ext.url = 'http://smart.who.int/ddcc/StructureDefinition/DDCCVaccineValidFrom'"/>
</source>
<rule>
<name value="set validFrom date"/>
<source>
<context value="valid"/>
<element value="valueDateTime"/>
<variable value="date"/>
</source>
<target>
<context value="vaccination"/>
<contextType value="variable"/>
<element value="validFrom"/>
<transform value="copy"/>
<parameter>
<valueId value="date"/>
</parameter>
</target>
</rule>
</rule>
<rule>
<name value="set country"/>
<source>
<context value="ext"/>
<listMode value="first"/>
<variable value="country"/>
<condition
value="ext.url = 'http://smart.who.int/ddcc/StructureDefinition/DDCCCountryOfVaccination'"/>
</source>
<rule>
<name value="set country code"/>
<source>
<context value="country"/>
<element value="valueCode"/>
<variable value="code"/>
</source>
<target>
<context value="vaccination"/>
<contextType value="variable"/>
<element value="country"/>
<variable value="vCountry"/>
</target>
<target>
<context value="vCountry"/>
<contextType value="variable"/>
<element value="system"/>
<transform value="copy"/>
<parameter>
<valueString value="urn:iso:std:iso:3166"/>
</parameter>
</target>
<target>
<context value="vCountry"/>
<contextType value="variable"/>
<element value="code"/>
<transform value="copy"/>
<parameter>
<valueId value="code"/>
</parameter>
</target>
</rule>
</rule>
</rule>
<rule>
<name value="set manufacturer"/>
<source>
<context value="immunization"/>
<element value="manufacturer"/>
<variable value="manufacturer"/>
</source>
<rule>
<name value="set manufacturer id"/>
<source>
<context value="manufacturer"/>
<element value="identifier"/>
<variable value="identifier"/>
</source>
<target>
<context value="vaccination"/>
<contextType value="variable"/>
<element value="manufacturer"/>
<variable value="vMan"/>
</target>
<rule>
<name value="set manufacturer system"/>
<source>
<context value="identifier"/>
<element value="system"/>
<variable value="system"/>
</source>
<target>
<context value="vMan"/>
<contextType value="variable"/>
<element value="system"/>
<transform value="copy"/>
<parameter>
<valueId value="system"/>
</parameter>
</target>
</rule>
<rule>
<name value="set manufactutuer code"/>
<source>
<context value="identifier"/>
<element value="value"/>
<variable value="value"/>
</source>
<target>
<context value="vMan"/>
<contextType value="variable"/>
<element value="code"/>
<transform value="copy"/>
<parameter>
<valueId value="value"/>
</parameter>
</target>
</rule>
</rule>
</rule>
<rule>
<name value="set lot number"/>
<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="set protocol applied"/>
<source>
<context value="immunization"/>
<element value="protocolApplied"/>
<listMode value="first"/>
<variable value="protocol"/>
</source>
<rule>
<name value="set dose"/>
<source>
<context value="protocol"/>
<element value="doseNumber"/>
<variable value="dose"/>
</source>
<target>
<context value="vaccination"/>
<contextType value="variable"/>
<element value="dose"/>
<transform value="copy"/>
<parameter>
<valueId value="dose"/>
</parameter>
</target>
</rule>
<rule>
<name value="set totalDoses"/>
<source>
<context value="protocol"/>
<element value="seriesDoses"/>
<variable value="totalDoses"/>
</source>
<target>
<context value="vaccination"/>
<contextType value="variable"/>
<element value="totalDoses"/>
<transform value="copy"/>
<parameter>
<valueId value="totalDoses"/>
</parameter>
</target>
</rule>
<rule>
<name value="set disease"/>
<source>
<context value="protocol"/>
<element value="targetDisease"/>
<listMode value="first"/>
<variable value="disease"/>
</source>
<rule>
<name value="set disease coding"/>
<source>
<context value="disease"/>
<element value="coding"/>
<listMode value="first"/>
<variable value="coding"/>
</source>
<target>
<context value="vaccination"/>
<contextType value="variable"/>
<element value="disease"/>
<transform value="copy"/>
<parameter>
<valueId value="coding"/>
</parameter>
</target>
</rule>
</rule>
<rule>
<name value="set issuer"/>
<source>
<context value="protocol"/>
<element value="authority"/>
<variable value="authority"/>
</source>
<target>
<context value="certificate"/>
<contextType value="variable"/>
<element value="issuer"/>
<variable value="issuer"/>
</target>
<rule>
<name value="set issuer from reference"/>
<source>
<context value="authority"/>
<element value="reference"/>
<variable value="reference"/>
</source>
<target>
<context value="issuer"/>
<contextType value="variable"/>
<element value="identifier"/>
<variable value="identifier"/>
</target>
<rule>
<name value="set reference"/>
<source>
<context value="reference"/>
</source>
<target>
<context value="identifier"/>
<contextType value="variable"/>
<element value="value"/>
<transform value="copy"/>
<parameter>
<valueId value="reference"/>
</parameter>
</target>
</rule>
</rule>
<rule>
<name value="set issuer identifier"/>
<source>
<context value="authority"/>
<element value="identifier"/>
<variable value="identifier"/>
</source>
<target>
<context value="issuer"/>
<contextType value="variable"/>
<element value="identifier"/>
<transform value="copy"/>
<parameter>
<valueId value="identifier"/>
</parameter>
</target>
</rule>
</rule>
</rule>
<rule>
<name value="set vaccination centre location"/>
<source>
<context value="immunization"/>
<element value="location"/>
<variable value="location"/>
</source>
<rule>
<name value="set vaccination centre from reference"/>
<source>
<context value="location"/>
<element value="reference"/>
<variable value="reference"/>
</source>
<target>
<context value="vaccination"/>
<contextType value="variable"/>
<element value="centre"/>
<transform value="copy"/>
<parameter>
<valueId value="reference"/>
</parameter>
</target>
</rule>
<rule>
<name value="set vaccination centre"/>
<source>
<context value="location"/>
<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>
<name value="set performer"/>
<source>
<context value="immunization"/>
<element value="performer"/>
<listMode value="first"/>
<variable value="performer"/>
</source>
<rule>
<name value="set actor"/>
<source>
<context value="performer"/>
<element value="actor"/>
<variable value="actor"/>
</source>
<rule>
<name value="set practitioner"/>
<source>
<context value="actor"/>
<element value="identifier"/>
<variable value="identifier"/>
</source>
<target>
<context value="vaccination"/>
<contextType value="variable"/>
<element value="practitioner"/>
<transform value="copy"/>
<parameter>
<valueId value="identifier"/>
</parameter>
</target>
</rule>
</rule>
</rule>
</group>
<group>
<name value="ImmRecToDDCCVS"/>
<typeMode value="none"/>
<input>
<name value="immRec"/>
<type value="DDCCImmunizationRecommendation"/>
<mode value="source"/>
</input>
<input>
<name value="vaccination"/>
<mode value="target"/>
</input>
<rule>
<name value="get recommendation"/>
<source>
<context value="immRec"/>
<element value="recommendation"/>
<variable value="rec"/>
</source>
<rule>
<name value="get date criterion"/>
<source>
<context value="rec"/>
<element value="dateCriterion"/>
<listMode value="first"/>
<variable value="due_date"/>
</source>
<rule>
<name value="set due date"/>
<source>
<context value="due_date"/>
<element value="value"/>
<variable value="date"/>
</source>
<target>
<context value="vaccination"/>
<contextType value="variable"/>
<element value="nextDose"/>
<transform value="copy"/>
<parameter>
<valueId value="date"/>
</parameter>
</target>
</rule>
</rule>
</rule>
</group>
</StructureMap>