WHO Digital Documentation of COVID-19 Certificates (DDCC)
1.0.0 - CI Build
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
Draft as of 2024-10-15 |
{
"resourceType" : "StructureMap",
"id" : "SHCToCoreDataSetTR",
"text" : {
"status" : "generated",
"div" : "<div xmlns=\"http://www.w3.org/1999/xhtml\"><p class=\"res-header-id\"><b>Generated Narrative: StructureMap SHCToCoreDataSetTR</b></p><a name=\"SHCToCoreDataSetTR\"> </a><a name=\"hcSHCToCoreDataSetTR\"> </a><a name=\"SHCToCoreDataSetTR-en-US\"> </a><pre class=\"fml\">\r\n<b>map</b><span style=\"color: navy\"> "</span>http://smart.who.int/ddcc/StructureMap/SHCToCoreDataSetTR<span style=\"color: navy\">" = "</span>SHCToCoreDataSetTR<span style=\"color: navy\">"\r\n\r\n</span><b>uses</b><span style=\"color: navy\"> "</span>http://hl7.org/fhir/uv/shc-vaccination/StructureDefinition/shc-infectious-disease-laboratory-bundle-dm<span style=\"color: navy\">" </span><b>alias </b>SHCLabBundleDM <b>as </b><b>source</b>\r\n<b>uses</b><span style=\"color: navy\"> "</span>http://hl7.org/fhir/uv/shc-vaccination/StructureDefinition/shc-patient-general-dm<span style=\"color: navy\">" </span><b>alias </b>SHCPatientDM <b>as </b><b>source</b>\r\n<b>uses</b><span style=\"color: navy\"> "</span>http://hl7.org/fhir/uv/shc-vaccination/StructureDefinition/shc-infectious-disease-laboratory-result-observation-dm<span style=\"color: navy\">" </span><b>alias </b>SHCLabDM <b>as </b><b>source</b>\r\n<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>\r\n<b>uses</b><span style=\"color: navy\"> "</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\">" </span><b>alias </b>DDCCTR <b>as </b><b>target</b>\r\n\r\n<b>group </b>SHCToTR<span style=\"color: navy\">(</span><b>source</b> <span style=\"color: maroon\">shc</span><span style=\"color: navy\"> : </span>SHCLabBundleDM, <b>target</b> <span style=\"color: maroon\">ddccBundle</span><span style=\"color: navy\"> : </span>DDCCBundle<span style=\"color: navy\">)</span><span style=\"color: navy\"> {\r\n</span> shc.entry<b> as </b><span style=\"color: maroon\">patientEntrySHC</span><b> then</b><span style=\"color: navy\"> {\r\n</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\"> {\r\n</span> shc.entry<b> as </b><span style=\"color: maroon\">entry</span><b> then</b><span style=\"color: navy\"> {\r\n</span> <span style=\"color: navy\">// </span><span style=\"color: green\">entry.resource : Immunization as immunization where vaccineCode.memberOf('http://smart.who.int/ddcc/ValueSet/who-ddcc-allowed-vaccines-covid-19') -> ddccBundle.entry as outentry, create('http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSetVS') as ddcc then {</span>\r\n 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\"> {\r\n</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>\r\n 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>\r\n 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>\r\n <span style=\"color: navy\">}</span> <i>"labs"</i><span style=\"color: navy\">;</span>\r\n <span style=\"color: navy\">}</span> <i>"entries"</i><span style=\"color: navy\">;</span>\r\n <span style=\"color: navy\">}</span> <i>"get patient"</i><span style=\"color: navy\">;</span>\r\n <span style=\"color: navy\">}</span> <i>"find patient"</i><span style=\"color: navy\">;</span>\r\n<span style=\"color: navy\">}\r\n\r\n</span><b>group </b>PatientToDDCCTR<span style=\"color: navy\">(</span><b>source</b> <span style=\"color: maroon\">patient</span><span style=\"color: navy\"> : </span>SHCPatientDM, <b>target</b> <span style=\"color: maroon\">tgt</span><span style=\"color: navy\"> : </span>DDCCTR<span style=\"color: navy\">)</span><span style=\"color: navy\"> {\r\n</span> patient.name<b> as </b><span style=\"color: maroon\">name</span><b> then </b>NameToText<span style=\"color: navy\">(</span><span style=\"color: maroon\">name</span><span style=\"color: navy\">, </span><span style=\"color: maroon\">tgt</span><span style=\"color: navy\">)</span> <i>"set name"</i><span style=\"color: navy\">;</span>\r\n patient.birthDate<b> as </b><span style=\"color: maroon\">birthDate</span><span style=\"color: navy\"><b> -> </b></span>tgt.birthDate = <span style=\"color: maroon\">birthDate</span> <i>"set birthDate"</i><span style=\"color: navy\">;</span>\r\n patient.identifier first<b> as </b><span style=\"color: maroon\">identifier</span><span style=\"color: navy\"><b> -> </b></span>tgt.identifier = <span style=\"color: maroon\">identifier</span> <i>"set identifier"</i><span style=\"color: navy\">;</span>\r\n<span style=\"color: navy\">}\r\n\r\n</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\"> {\r\n</span> <span style=\"color: navy\">// </span><span style=\"color: green\">append doesn't work until ddcc.name is set</span>\r\n 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>\r\n <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>\r\n 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>\r\n 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>\r\n 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>\r\n<span style=\"color: navy\">}\r\n\r\n</span><b>group </b>LabToDDCC<span style=\"color: navy\">(</span><b>source</b> <span style=\"color: maroon\">lab</span><span style=\"color: navy\"> : </span>SHCLabDM, <b>target</b> <span style=\"color: maroon\">test</span><span style=\"color: navy\">)</span><span style=\"color: navy\"> {\r\n</span> lab.code<b> as </b><span style=\"color: maroon\">code</span><b> then</b><span style=\"color: navy\"> {\r\n</span> code.coding first<b> as </b><span style=\"color: maroon\">labType</span><b> then</b><span style=\"color: navy\"> {\r\n</span> labType<span style=\"color: navy\"><b> -> </b></span>test.type = <span style=\"color: maroon\">labType</span> <i>"set default type"</i><span style=\"color: navy\">;</span>\r\n labType<b> where </b>labType.memberOf('http://smart.who.int/ddcc/ValueSet/lab-test-type-covid19-loinc')<span style=\"color: navy\"><b> -> </b></span>test.type = <b>translate</b><span style=\"color: navy\">(</span><span style=\"color: maroon\">labType</span><span style=\"color: navy\">, </span><span style=\"color: blue\">'http://smart.who.int/ddcc/ConceptMap/lab-test-type-covid19-loinc-to-icd11'</span><span style=\"color: navy\">, </span><span style=\"color: blue\">'Coding'</span><span style=\"color: navy\">)</span> <i>"translate loinc type"</i><span style=\"color: navy\">;</span>\r\n labType<b> where </b>labType.memberOf('http://smart.who.int/ddcc/ValueSet/lab-test-type-covid19-loinc')<span style=\"color: navy\"><b> -> </b></span>test.pathogen = <b>c</b><span style=\"color: navy\">(</span><span style=\"color: blue\">'http://id.who.int/icd11/mms'</span><span style=\"color: navy\">, </span><span style=\"color: blue\">'XN109'</span><span style=\"color: navy\">)</span> <i>"set pathogen to COVID"</i><span style=\"color: navy\">;</span>\r\n <span style=\"color: navy\">}</span><span style=\"color: navy\">;</span>\r\n <span style=\"color: navy\">}</span><span style=\"color: navy\">;</span>\r\n lab.effectiveDateTime<b> as </b><span style=\"color: maroon\">date</span><span style=\"color: navy\"><b> -> </b></span>test.date = <span style=\"color: maroon\">date</span> <i>"set date"</i><span style=\"color: navy\">;</span>\r\n lab.valueCodeableConcept<b> as </b><span style=\"color: maroon\">value</span><b> then</b><span style=\"color: navy\"> {\r\n</span> value.coding first<b> as </b><span style=\"color: maroon\">result</span><b> then</b><span style=\"color: navy\"> {\r\n</span> result<span style=\"color: navy\"><b> -> </b></span>test.result = <span style=\"color: maroon\">result</span> <i>"set default result"</i><span style=\"color: navy\">;</span>\r\n result<b> where </b>result.memberOf('http://smart.who.int/ddcc/ValueSet/lab-test-qual-result-snomed')<span style=\"color: navy\"><b> -> </b></span>test.result = <b>translate</b><span style=\"color: navy\">(</span><span style=\"color: maroon\">result</span><span style=\"color: navy\">, </span><span style=\"color: blue\">'http://smart.who.int/ddcc/ConceptMap/lab-test-qual-result-snomed-to-icd11'</span><span style=\"color: navy\">)</span> <i>"translate snomed result"</i><span style=\"color: navy\">;</span>\r\n <span style=\"color: navy\">}</span><span style=\"color: navy\">;</span>\r\n <span style=\"color: navy\">}</span><span style=\"color: navy\">;</span>\r\n<span style=\"color: navy\">// </span><span style=\"color: green\">no target for result valueQuantity (for Ab titers) or valueString (for unmapped text)</span>\r\n<span style=\"color: navy\">// </span><span style=\"color: green\">pathogen and country are required, no source in SHC</span>\r\n<span style=\"color: navy\">}\r\n\r\n</span></pre></div>"
},
"url" : "http://smart.who.int/ddcc/StructureMap/SHCToCoreDataSetTR",
"version" : "1.0.0",
"name" : "SHCToCoreDataSetTR",
"status" : "draft",
"date" : "2024-10-15T11:00:36+02:00",
"publisher" : "WHO",
"contact" : [
{
"name" : "WHO",
"telecom" : [
{
"system" : "url",
"value" : "http://who.int"
}
]
}
],
"jurisdiction" : [
{
"coding" : [
{
"system" : "http://unstats.un.org/unsd/methods/m49/m49.htm",
"code" : "001"
}
]
}
],
"structure" : [
{
"url" : "http://hl7.org/fhir/uv/shc-vaccination/StructureDefinition/shc-infectious-disease-laboratory-bundle-dm",
"mode" : "source",
"alias" : "SHCLabBundleDM"
},
{
"url" : "http://hl7.org/fhir/uv/shc-vaccination/StructureDefinition/shc-patient-general-dm",
"mode" : "source",
"alias" : "SHCPatientDM"
},
{
"url" : "http://hl7.org/fhir/uv/shc-vaccination/StructureDefinition/shc-infectious-disease-laboratory-result-observation-dm",
"mode" : "source",
"alias" : "SHCLabDM"
},
{
"url" : "http://hl7.org/fhir/StructureDefinition/Bundle",
"mode" : "target",
"alias" : "DDCCBundle"
},
{
"url" : "http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSetTR",
"mode" : "target",
"alias" : "DDCCTR"
}
],
"group" : [
{
"name" : "SHCToTR",
"typeMode" : "none",
"input" : [
{
"name" : "shc",
"type" : "SHCLabBundleDM",
"mode" : "source"
},
{
"name" : "ddccBundle",
"type" : "DDCCBundle",
"mode" : "target"
}
],
"rule" : [
{
"name" : "find patient",
"source" : [
{
"context" : "shc",
"element" : "entry",
"variable" : "patientEntrySHC"
}
],
"rule" : [
{
"name" : "get patient",
"source" : [
{
"context" : "patientEntrySHC",
"type" : "Patient",
"element" : "resource",
"listMode" : "first",
"variable" : "patient"
}
],
"rule" : [
{
"name" : "entries",
"source" : [
{
"context" : "shc",
"element" : "entry",
"variable" : "entry"
}
],
"rule" : [
{
"name" : "labs",
"source" : [
{
"context" : "entry",
"type" : "Observation",
"element" : "resource",
"variable" : "lab"
}
],
"target" : [
{
"context" : "ddccBundle",
"contextType" : "variable",
"element" : "entry",
"variable" : "outentry"
},
{
"contextType" : "variable",
"variable" : "ddcc",
"transform" : "create",
"parameter" : [
{
"valueString" : "http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSetTR"
}
]
}
],
"rule" : [
{
"name" : "set patient",
"source" : [
{
"context" : "lab"
}
],
"dependent" : [
{
"name" : "PatientToDDCCTR",
"variable" : [
"patient",
"ddcc"
]
}
]
},
{
"name" : "set test",
"source" : [
{
"context" : "lab"
}
],
"target" : [
{
"context" : "ddcc",
"contextType" : "variable",
"element" : "test",
"variable" : "test"
}
],
"dependent" : [
{
"name" : "LabToDDCC",
"variable" : [
"lab",
"test"
]
}
]
},
{
"name" : "set outentry",
"source" : [
{
"context" : "lab"
}
],
"target" : [
{
"context" : "outentry",
"contextType" : "variable",
"element" : "resource",
"transform" : "copy",
"parameter" : [
{
"valueId" : "ddcc"
}
]
}
]
}
]
}
]
}
]
}
]
}
]
},
{
"name" : "PatientToDDCCTR",
"typeMode" : "none",
"input" : [
{
"name" : "patient",
"type" : "SHCPatientDM",
"mode" : "source"
},
{
"name" : "tgt",
"type" : "DDCCTR",
"mode" : "target"
}
],
"rule" : [
{
"name" : "set name",
"source" : [
{
"context" : "patient",
"element" : "name",
"variable" : "name"
}
],
"dependent" : [
{
"name" : "NameToText",
"variable" : [
"name",
"tgt"
]
}
]
},
{
"name" : "set birthDate",
"source" : [
{
"context" : "patient",
"element" : "birthDate",
"variable" : "birthDate"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "birthDate",
"transform" : "copy",
"parameter" : [
{
"valueId" : "birthDate"
}
]
}
]
},
{
"name" : "set identifier",
"source" : [
{
"context" : "patient",
"element" : "identifier",
"listMode" : "first",
"variable" : "identifier"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "identifier",
"transform" : "copy",
"parameter" : [
{
"valueId" : "identifier"
}
]
}
]
}
]
},
{
"name" : "NameToText",
"typeMode" : "none",
"input" : [
{
"name" : "name",
"type" : "HumanName",
"mode" : "source"
},
{
"name" : "ddcc",
"mode" : "target"
}
],
"rule" : [
{
"name" : "set first name",
"source" : [
{
"context" : "name",
"element" : "given",
"listMode" : "first",
"variable" : "given"
}
],
"target" : [
{
"context" : "ddcc",
"contextType" : "variable",
"element" : "name",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "given.replaceMatches('$', ' ')"
}
]
}
]
},
{
"name" : "set other names",
"source" : [
{
"context" : "name",
"element" : "given",
"listMode" : "not_first",
"variable" : "other"
}
],
"target" : [
{
"context" : "ddcc",
"contextType" : "variable",
"element" : "name",
"variable" : "tName"
},
{
"contextType" : "variable",
"variable" : "spaced",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "other.replaceMatches('$', ' ')"
}
]
},
{
"context" : "ddcc",
"contextType" : "variable",
"element" : "name",
"transform" : "append",
"parameter" : [
{
"valueId" : "tName"
},
{
"valueId" : "spaced"
}
]
}
]
},
{
"name" : "add family name",
"source" : [
{
"context" : "name",
"element" : "family",
"variable" : "family"
}
],
"target" : [
{
"context" : "ddcc",
"contextType" : "variable",
"element" : "name",
"variable" : "tName"
},
{
"context" : "ddcc",
"contextType" : "variable",
"element" : "name",
"transform" : "append",
"parameter" : [
{
"valueId" : "tName"
},
{
"valueId" : "family"
}
]
}
]
},
{
"name" : "set full name",
"source" : [
{
"context" : "name",
"element" : "text",
"variable" : "text"
}
],
"target" : [
{
"context" : "ddcc",
"contextType" : "variable",
"element" : "name",
"transform" : "copy",
"parameter" : [
{
"valueId" : "text"
}
]
}
]
}
]
},
{
"name" : "LabToDDCC",
"typeMode" : "none",
"input" : [
{
"name" : "lab",
"type" : "SHCLabDM",
"mode" : "source"
},
{
"name" : "test",
"mode" : "target"
}
],
"rule" : [
{
"name" : "code",
"source" : [
{
"context" : "lab",
"element" : "code",
"variable" : "code"
}
],
"rule" : [
{
"name" : "coding",
"source" : [
{
"context" : "code",
"element" : "coding",
"listMode" : "first",
"variable" : "labType"
}
],
"rule" : [
{
"name" : "set default type",
"source" : [
{
"context" : "labType"
}
],
"target" : [
{
"context" : "test",
"contextType" : "variable",
"element" : "type",
"transform" : "copy",
"parameter" : [
{
"valueId" : "labType"
}
]
}
]
},
{
"name" : "translate loinc type",
"source" : [
{
"context" : "labType",
"condition" : "labType.memberOf('http://smart.who.int/ddcc/ValueSet/lab-test-type-covid19-loinc')"
}
],
"target" : [
{
"context" : "test",
"contextType" : "variable",
"element" : "type",
"transform" : "translate",
"parameter" : [
{
"valueId" : "labType"
},
{
"valueString" : "http://smart.who.int/ddcc/ConceptMap/lab-test-type-covid19-loinc-to-icd11"
},
{
"valueString" : "Coding"
}
]
}
]
},
{
"name" : "set pathogen to COVID",
"source" : [
{
"context" : "labType",
"condition" : "labType.memberOf('http://smart.who.int/ddcc/ValueSet/lab-test-type-covid19-loinc')"
}
],
"target" : [
{
"context" : "test",
"contextType" : "variable",
"element" : "pathogen",
"transform" : "c",
"parameter" : [
{
"valueString" : "http://id.who.int/icd11/mms"
},
{
"valueString" : "XN109"
}
]
}
]
}
]
}
]
},
{
"name" : "set date",
"source" : [
{
"context" : "lab",
"element" : "effectiveDateTime",
"variable" : "date"
}
],
"target" : [
{
"context" : "test",
"contextType" : "variable",
"element" : "date",
"transform" : "copy",
"parameter" : [
{
"valueId" : "date"
}
]
}
]
},
{
"name" : "valueCodeableConcept",
"source" : [
{
"context" : "lab",
"element" : "valueCodeableConcept",
"variable" : "value"
}
],
"rule" : [
{
"name" : "coding",
"source" : [
{
"context" : "value",
"element" : "coding",
"listMode" : "first",
"variable" : "result"
}
],
"rule" : [
{
"name" : "set default result",
"source" : [
{
"context" : "result"
}
],
"target" : [
{
"context" : "test",
"contextType" : "variable",
"element" : "result",
"transform" : "copy",
"parameter" : [
{
"valueId" : "result"
}
]
}
]
},
{
"name" : "translate snomed result",
"source" : [
{
"context" : "result",
"condition" : "result.memberOf('http://smart.who.int/ddcc/ValueSet/lab-test-qual-result-snomed')"
}
],
"target" : [
{
"context" : "test",
"contextType" : "variable",
"element" : "result",
"transform" : "translate",
"parameter" : [
{
"valueId" : "result"
},
{
"valueString" : "http://smart.who.int/ddcc/ConceptMap/lab-test-qual-result-snomed-to-icd11"
}
]
}
]
}
]
}
]
}
]
}
]
}