Generated Narrative: StructureMap CoreDataSetVSLibrary #xD; map "http://smart.who.int/ddcc/StructureMap/CoreDataSetVSLibrary" = "CoreDataSetVSLibrary"#xD; #xD; uses "http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSetVS" alias DDCCVS as source#xD; uses "http://hl7.org/fhir/StructureDefinition/Bundle" alias AddBundle as target#xD; uses "http://hl7.org/fhir/StructureDefinition/Patient" alias Patient as target#xD; uses "http://smart.who.int/ddcc/StructureDefinition/DDCCPatient" alias DDCCPatient as target#xD; uses "http://smart.who.int/ddcc/StructureDefinition/DDCCDocumentReferenceQR" alias DDCCDocRefQR as target#xD; uses "http://smart.who.int/ddcc/StructureDefinition/DDCCVSComposition" alias DDCCVSComposition as target#xD; uses "http://smart.who.int/ddcc/StructureDefinition/DDCCImmunization" alias DDCCImmunization as target#xD; uses "http://smart.who.int/ddcc/StructureDefinition/DDCCImmunizationRecommendation" alias DDCCImmRec as target#xD; #xD; imports "http://smart.who.int/ddcc/StructureMap/CoreDataSetLibrary"#xD; #xD; group VSToAddBundle(source ddcc : DDCCVS, target bundle : AddBundle) {#xD; ddcc -> bundle.type = 'transaction' "set bundle type";#xD; ddcc -> uuid() as pid, uuid() as compid, uuid() as iid, uuid() as irid, uuid() as qrwhoid, uuid() as qrdccid then {#xD; ddcc -> bundle.entry as entry, entry.fullUrl = append('urn:uuid:', pid), entry.request as request, request.method = 'PUT', request.url = append('Patient/', pid), create('http://smart.who.int/ddcc/StructureDefinition/DDCCPatient') as patient then {#xD; ddcc then DDCCToPatient(ddcc, patient, pid) "setup patient";#xD; ddcc -> entry.resource = patient "set patient resource";#xD; } "create patient resource";#xD; ddcc -> bundle.entry as entry, entry.fullUrl = append('urn:uuid:', compid), entry.request as request, request.method = 'PUT', request.url = append('Composition/', compid), create('http://smart.who.int/ddcc/StructureDefinition/DDCCVSComposition') as comp then {#xD; ddcc then DDCCToComposition(ddcc, comp, compid, pid) "setup composition";#xD; ddcc -> comp.category as category, category.coding as coding, coding.system = 'http://smart.who.int/ddcc/CodeSystem/DDCCCompositionCategoryCodeSystem', coding.code = 'ddcc-vs' "set category";#xD; ddcc -> comp.title = 'International Certificate of Vaccination or Prophylaxis' "set title";#xD; ddcc -> comp.section as section then {#xD; ddcc -> section.code as code, code.coding as coding, coding.system = 'http://loinc.org', coding.code = '11369-6' "set code";#xD; ddcc.certificate as certificate then {#xD; certificate.issuer as issuer -> section.author = issuer "set author";#xD; } "set certificate";#xD; // ddcc.certificate as certificate -> section.author as author then { certificate.issuer as issuer then { issuer.identifier as pha -> author.identifier as identifier, author.type = "Organization" then { pha.value as value -> identifier.value = value "set pha"; } "set author identifier"; } "set author ref"; } "set author";#xD; ddcc -> section.focus as focus, focus.reference = append('Immunization/', iid) "set focus";#xD; ddcc -> section.entry as entry, entry.reference = append('Immunization/', iid) "add Immunization entry";#xD; ddcc -> section.entry as entry, entry.reference = append('ImmunizationRecommendation/', irid) "add ImmunizationRecommendation entry";#xD; ddcc -> section.entry as entry, entry.reference = append('DocumentReference/', qrwhoid) "add WHO QR entry";#xD; ddcc -> section.entry as entry, entry.reference = append('DocumentReference/', qrdccid) "add DCC QR entry";#xD; } "set section";#xD; ddcc -> entry.resource = comp "set composition resource";#xD; } "create composition resource";#xD; ddcc -> bundle.entry as entry, entry.fullUrl = append('urn:uuid:', qrwhoid), entry.request as request, request.method = 'PUT', request.url = append('DocumentReference/', qrwhoid), create('http://smart.who.int/ddcc/StructureDefinition/DDCCDocumentReferenceQR') as qr then {#xD; ddcc then DDCCToDocumentReference(ddcc, qr, qrwhoid, pid) "setup WHO DocRef";#xD; ddcc -> qr.category as category, category.coding as coding, coding.system = 'http://smart.who.int/ddcc/CodeSystem/DDCCQRCategoryUsageCodeSystem', coding.code = 'who' "set category";#xD; ddcc -> qr.description = 'WHO QR code for COVID 19 Vaccine Certificate' "set description";#xD; ddcc -> entry.resource = qr "set WHO QR";#xD; } "create WHO QR Doc Ref";#xD; ddcc -> bundle.entry as entry, entry.fullUrl = append('urn:uuid:', qrdccid), entry.request as request, request.method = 'PUT', request.url = append('DocumentReference/', qrdccid), create('http://smart.who.int/ddcc/StructureDefinition/DDCCDocumentReferenceQR') as qr then {#xD; ddcc then DDCCToDocumentReference(ddcc, qr, qrdccid, pid) "setup DCC DocRef";#xD; ddcc -> qr.category as category, category.coding as coding, coding.system = 'http://smart.who.int/ddcc/CodeSystem/DDCCQRCategoryUsageCodeSystem', coding.code = 'dcc' "set category";#xD; ddcc -> qr.description = 'DCC QR code for COVID 19 Vaccine Certificate' "set description";#xD; ddcc -> entry.resource = qr "set DCC QR";#xD; } "create DCC QR Doc Ref";#xD; ddcc.vaccination first as vaccination -> bundle.entry as entry, entry.fullUrl = append('urn:uuid:', iid), entry.request as request, request.method = 'PUT', request.url = append('Immunization/', iid), create('http://smart.who.int/ddcc/StructureDefinition/DDCCImmunization') as immunization then {#xD; ddcc.certificate as certificate then DDCCToImmunization(vaccination, immunization, certificate, iid, pid) "setup immunization";#xD; ddcc -> entry.resource = immunization "set immunization resource";#xD; } "create immunization resource";#xD; ddcc.vaccination first as vaccination -> bundle.entry as entry, entry.fullUrl = append('urn:uuid:', irid), entry.request as request, request.method = 'PUT', request.url = append('ImmunizationRecommendation/', irid), create('http://smart.who.int/ddcc/StructureDefinition/DDCCImmunizationRecommendation') as immrec then {#xD; vaccination then DDCCToImmRec(vaccination, immrec, irid, iid, pid) "setup immunization recommendation";#xD; ddcc -> entry.resource = immrec "set immunization recommendation resource";#xD; } "create immunization recommendation resource";#xD; } "set uuids";#xD; }#xD; #xD; group DDCCToImmunization(source src, target immunization : DDCCImmunization, source certificate, source iid, source pid) {#xD; iid -> immunization.id = iid "set id";#xD; src.brand as brand -> immunization.extension as ext then {#xD; brand -> ext.url = 'http://smart.who.int/ddcc/StructureDefinition/DDCCVaccineBrand', ext.value = brand "set brand extension values";#xD; } "set brand extension";#xD; src.maholder as maholder -> immunization.extension as ext then {#xD; maholder -> ext.url = 'http://smart.who.int/ddcc/StructureDefinition/DDCCVaccineMarketAuthorization', ext.value = maholder "set MA Holder extension values";#xD; } "set maholder extension";#xD; src.country as country -> immunization.extension as ext then {#xD; country.code as code -> ext.url = 'http://smart.who.int/ddcc/StructureDefinition/DDCCCountryOfVaccination', ext.value = code "set country extension values";#xD; } "set country extension";#xD; src.validFrom as validFrom -> immunization.extension as ext then {#xD; validFrom -> ext.url = 'http://smart.who.int/ddcc/StructureDefinition/DDCCVaccineValidFrom', ext.value = validFrom "set valid from extension values";#xD; } "set vaccine valid extension";#xD; src -> immunization.status = 'completed' "set status";#xD; src.vaccine as vaccine -> immunization.vaccineCode as vacCode, vacCode.coding = vaccine "set vaccine";#xD; src -> immunization.patient as patient, patient.reference = append('Patient/', pid) "set patient";#xD; src.manufacturer as manufacturer -> immunization.manufacturer as tman, tman.identifier as ident then {#xD; manufacturer.system as system -> ident.system = system "set system";#xD; manufacturer.code as code -> ident.value = code "set value";#xD; } "set manufacturer identifier";#xD; src.lot as lot -> immunization.lotNumber = lot "set lot number";#xD; src.date as date -> immunization.occurrence = date "set occurrence date";#xD; src.centre as centre -> immunization.location as location then {#xD; centre -> location.display = centre "set location display";#xD; } "set location";#xD; src.practitioner as practitioner -> immunization.performer as performer then {#xD; practitioner.value as hw -> performer.actor as actor then {#xD; hw -> actor.type = 'Practitioner', actor.identifier as identifier then {#xD; hw -> identifier.value = hw "set hw identifier";#xD; } "set actor";#xD; } "set performer";#xD; } "set practitioner";#xD; src -> immunization.protocolApplied as protocol then {#xD; src -> protocol.authority as authority then {#xD; certificate.issuer as issuer -> authority.type = 'Organization' then {#xD; issuer.identifier as pha -> authority.identifier as identifier then {#xD; pha.value as value -> identifier.value = value "set pha";#xD; } "set issuer identifier";#xD; } "set issuer";#xD; } "set authority";#xD; src.disease as disease -> protocol.targetDisease as tdisease then {#xD; disease -> tdisease.coding = disease "set target disease code";#xD; } "set target disease";#xD; src.dose as dose -> protocol.doseNumber = dose "set dose number";#xD; src.totalDoses as totalDoses -> protocol.seriesDoses = totalDoses "set total doses";#xD; } "set protocolApplied";#xD; }#xD; #xD; group DDCCToImmRec(source src, target immrec : DDCCImmunizationRecommendation, source irid, source iid, source pid) {#xD; src.date as date -> immrec.date = date "set date";#xD; src -> immrec.patient as patient, patient.reference = append('Patient/', pid) "set patient";#xD; src -> immrec.recommendation as rec then {#xD; src.vaccine as vaccine -> rec.vaccineCode as vaccineCode then {#xD; vaccine -> vaccineCode.coding = vaccine "set vaccine code coding";#xD; } "set vaccine code";#xD; src.disease as disease -> rec.targetDisease as targetDisease then {#xD; disease -> targetDisease.coding = disease "set target disease coding";#xD; } "set target disease";#xD; src -> rec.forecastStatus as forecast then {#xD; src -> forecast.coding as coding then {#xD; src -> coding.system = 'http://terminology.hl7.org/2.1.0/CodeSystem-immunization-recommendation-status.html' "set forecast system";#xD; src -> coding.code = 'due' "set forecast code";#xD; } "set forecast status coding";#xD; } "set forecast status";#xD; src -> rec.dateCriterion as due_date then {#xD; src -> due_date.code as code then {#xD; src -> code.coding as coding then {#xD; src -> coding.system = 'http://loinc.org' "set due date code system";#xD; src -> coding.code = '30980-7' "set due date code code";#xD; } "set due date code coding";#xD; } "set due date code";#xD; src.nextDose as nextDose -> due_date.value = nextDose "set due date value";#xD; } "set date criterion";#xD; src.dose as dose -> rec.doseNumber = (dose.toInteger() + 1) "set dose number";#xD; src.totalDoses as totalDoses -> rec.seriesDoses = totalDoses "set total doses";#xD; src -> rec.supportingImmunization as imm, imm.reference = append('Immunization/', iid) "set supporting immunization";#xD; } "set recommendation";#xD; }#xD; #xD;
International Certificate of Vaccination or Prophylaxis
WHO QR code for COVID 19 Vaccine Certificate
DCC QR code for COVID 19 Vaccine Certificate
create immunization recommendation resource
set immunization recommendation resource