CDA to FHIR Maps, published by HL7 Italy. This guide is not an authorized publication; it is the continuous build for version 0.1.0 built by the FHIR (HL7® FHIR® Standard) CI Build. This version is based on the current content of https://github.com/hl7-it/cda2fhir/ and changes regularly. See the Directory of published versions
Draft as of 2024-09-15 |
{
"resourceType" : "StructureMap",
"id" : "cda2fhirVaccination",
"text" : {
"status" : "generated",
"div" : "<div xmlns=\"http://www.w3.org/1999/xhtml\">\n <pre>map "http://hl7.it/fhir/cda2fhir/StructureMap/cda2fhirVaccination" = "cda2fhirVaccination"\n\nuses "http://hl7.org/fhir/cda/StructureDefinition/ClinicalDocument" alias ClinicalDocument as source\nuses "http://hl7.org/fhir/cda/StructureDefinition/AssignedAuthor" alias AssignedAuthor as queried\nuses "http://hl7.org/fhir/cda/StructureDefinition/AssignedEntity" alias AssignedEntity as queried\nuses "http://hl7.org/fhir/cda/StructureDefinition/AssociatedEntity" alias AssociatedEntity as queried\nuses "http://hl7.org/fhir/cda/StructureDefinition/CustodianOrganization" alias CustodianOrganization as queried\nuses "http://hl7.org/fhir/cda/StructureDefinition/OrganizationPartOf" alias OrganizationPartOf as queried\nuses "http://hl7.org/fhir/cda/StructureDefinition/Organization" alias rapresentedOrganization as queried\nuses "http://hl7.org/fhir/cda/StructureDefinition/Section" alias Section as queried\nuses "http://hl7.org/fhir/cda/StructureDefinition/PatientRole" alias PatientRole as queried\nuses "http://hl7.org/fhir/cda/StructureDefinition/AD" alias AD as source\nuses "http://hl7.org/fhir/StructureDefinition/Bundle" alias Bundle as target\nuses "http://hl7.org/fhir/StructureDefinition/Composition" alias Composition as produced\nuses "http://hl7.org/fhir/StructureDefinition/Patient" alias Patient as produced\nuses "http://hl7.org/fhir/StructureDefinition/Encounter" alias Encounter as produced\nuses "http://hl7.org/fhir/StructureDefinition/Person" alias Patient as produced\nuses "http://hl7.org/fhir/StructureDefinition/Practitioner" alias Practitioner as produced\nuses "http://hl7.org/fhir/StructureDefinition/Organization" alias Organization as produced\nuses "http://hl7.org/fhir/cda/StructureDefinition/Act" alias Act as produced\nuses "http://hl7.org/fhir/cda/StructureDefinition/IVL-PQ" alias IVL_PQ as source\nuses "http://hl7.org/fhir/cda/StructureDefinition/PQ" alias PQ as source\nuses "http://hl7.org/fhir/StructureDefinition/SimpleQuantity" alias SimpleQuantity as target\nuses "http://hl7.org/fhir/StructureDefinition/Immunization" alias Immunization as target\n\nimports "http://hl7.it/fhir/cda2fhir/StructureMap/cda2fhirDataTypes"\nimports "http://hl7.it/fhir/cda2fhir/StructureMap/cda2fhirHeader"\n\ngroup CdaToBundle(source cda : ClinicalDocument, target bundle : Bundle) {\n cda -> bundle.entry as e, e.request = create('BackboneElement') as request, request.method = 'POST', e.resource = create('Composition') as composition, composition.id = uuid() as uuid1, e.fullUrl = append('https://example/Composition/', uuid1), request.url = 'Composition', bundle.entry as e2, e2.request = create('BackboneElement') as requestPAT, requestPAT.method = 'PUT', e2.resource = create('Patient') as patient, patient.id = uuid() as uuid2, e2.fullUrl = append('https://example/Patient/', uuid2), bundle.entry as e3, e3.request = create('BackboneElement') as request, request.method = 'POST', e3.resource = create('Encounter') as encounter, encounter.id = uuid() as uuid3, e3.fullUrl = append('https://example/Encounter/', uuid3), request.url = 'Encounter', bundle.entry as e5, e5.request = create('BackboneElement') as request, request.method = 'POST', e5.resource = create('DocumentReference') as DocumentReference, DocumentReference.id = uuid() as uuid5, e5.fullUrl = append('https://example/DocumentReference/', uuid5), request.url = 'DocumentReference' then {\n cda then ClinicalDocumentToBundle(cda, patient, composition, encounter, bundle, DocumentReference) "cdatobundle";\n cda.recordTarget as recordTarget then {\n recordTarget.patientRole as patient then {\n patient.id as id -> patient.identifier as identifier then {\n id.root as r -> identifier.system = translate(r, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri') "root1";\n id.extension as ext1 -> identifier.value = ext1 "value";\n id.assigningAuthorityName as s -> identifier.assigner as a, a.display = s;\n } "idfr";\n patient.id as id where (root = '2.16.840.1.113883.2.9.4.3.2') or (root = '2.16.840.1.113883.2.9.4.3.7') or (root = '2.16.840.1.113883.2.9.4.3.3') or (root = '2.16.840.1.113883.2.9.4.3.17') or (root = '2.16.840.1.113883.2.9.4.3.18') or (root = '2.16.840.1.113883.2.9.2.10.4.1.1') or (root = '2.16.840.1.113883.2.9.2.20.4.1.1') or (root = '2.16.840.1.113883.2.9.2.30.4.1.1') or (root = '2.16.840.1.113883.2.9.2.41.4.1.1') or (root = '2.16.840.1.113883.2.9.2.42.4.1.1') or (root = '2.16.840.1.113883.2.9.2.50.4.1.1') or (root = '2.16.840.1.113883.2.9.2.60.4.1.1') or (root = '2.16.840.1.113883.2.9.2.70.4.1.1') or (root = '2.16.840.1.113883.2.9.2.80.4.1.1') or (root = '2.16.840.1.113883.2.9.2.90.4.1.1') or (root = '2.16.840.1.113883.2.9.2.100.4.1.1') or (root = '2.16.840.1.113883.2.9.2.110.4.1.1') or (root = '2.16.840.1.113883.2.9.2.120.4.1.1') or (root = '2.16.840.1.113883.2.9.2.130.4.1.1') or (root = '2.16.840.1.113883.2.9.2.140.4.1.1') or (root = '2.16.840.1.113883.2.9.2.150.4.1.1') or (root = '2.16.840.1.113883.2.9.2.160.4.1.1') or (root = '2.16.840.1.113883.2.9.2.170.4.1.1') or (root = '2.16.840.1.113883.2.9.2.180.4.1.1') or (root = '2.16.840.1.113883.2.9.2.190.4.1.1') or (root = '2.16.840.1.113883.2.9.2.200.4.1.1') or (root = '2.16.840.1.113883.2.9.2.10.4.1') or (root = '2.16.840.1.113883.2.9.2.20.4.1') or (root = '2.16.840.1.113883.2.9.2.30.4.1') or (root = '2.16.840.1.113883.2.9.2.41.4.1') or (root = '2.16.840.1.113883.2.9.2.42.4.1') or (root = '2.16.840.1.113883.2.9.2.50.4.1') or (root = '2.16.840.1.113883.2.9.2.60.4.1') or (root = '2.16.840.1.113883.2.9.2.70.4.1') or (root = '2.16.840.1.113883.2.9.2.80.4.1') or (root = '2.16.840.1.113883.2.9.2.90.4.1') or (root = '2.16.840.1.113883.2.9.2.100.4.1') or (root = '2.16.840.1.113883.2.9.2.110.4.1') or (root = '2.16.840.1.113883.2.9.2.120.4.1') or (root = '2.16.840.1.113883.2.9.2.130.4.1') or (root = '2.16.840.1.113883.2.9.2.140.4.1') or (root = '2.16.840.1.113883.2.9.2.150.4.1') or (root = '2.16.840.1.113883.2.9.2.160.4.1') or (root = '2.16.840.1.113883.2.9.2.170.4.1') or (root = '2.16.840.1.113883.2.9.2.180.4.1') or (root = '2.16.840.1.113883.2.9.2.190.4.1') or (root = '2.16.840.1.113883.2.9.2.200.4.1') or (root = '2.16.840.1.113883.2.9.4.3.15') then {\n id.extension as ext -> requestPAT.url = append('Patient?identifier=', ext) "UUID";\n } "ext";\n } "record";\n } "recPat";\n } "ClinicalDocumentToBody";\n}\n\ngroup ClinicalDocumentToBundle(source cda : ClinicalDocument, target patient : Patient, target composition : Composition, target encounter : Encounter, target bundle : Bundle, target DocumentReference : DocumentReference) {\n cda -> encounter.status = 'finished' "finished";\n cda -> encounter.class = create('Coding') as coding then {\n cda -> coding.code = 'AMB' "amb";\n } "coding";\n cda -> bundle.id = uuid() "id";\n cda.id -> bundle.identifier "identifier";\n cda -> bundle.type = 'transaction' "type";\n cda -> bundle.timestamp = (timestamp.now()) "date";\n cda then ClinicalDocumentComposition(cda, composition, patient, encounter, bundle, DocumentReference) "composition";\n cda.component as component then {\n component.structuredBody as body then {\n body.component as component then {\n component.section as srcSection then {\n srcSection -> composition.section as tgtSection then ClinicalDocumentSection(cda, srcSection, patient, tgtSection, bundle, encounter) "TerapiaFarmacologicaAllaDimissione";\n };\n };\n } "body";\n };\n}\n\n// --------------------------------\ngroup ClinicalDocumentSection(source cda : ClinicalDocument, source src : Section, target patient : Patient, target tgt, target bundle : Bundle, target enc : Encounter) {\n src.title as t -> tgt.title = (t.dataString);\n src.code -> tgt.code;\n src.text as cdaText -> tgt.text as fhirText then {\n cdaText -> fhirText.status = 'generated' "narrativeStatus";\n cdaText as t -> fhirText.div = t "narrativeText";\n } "cdaText";\n src.entry as entry1 then {\n entry1.substanceAdministration as substance then {\n substance.templateId where (root = '2.16.840.1.113883.2.9.10.1.11.4.1') -> bundle.entry as e1, e1.request = create('BackboneElement') as request, request.method = 'POST', e1.resource = create('Immunization') as immunization, immunization.id = uuid() as uuid1, e1.fullUrl = append('https://example/Immunization/', uuid1), request.url = 'Immunization', tgt.entry = create('Reference') as reference, reference.reference = ('https://example/Immunization/' + %immunization.id) then {\n substance -> immunization.patient = create('Reference') as reference, reference.reference = ('https://example/Patient/' + %patient.id) "patientRef";\n // substance.templateId as tid -> immunization.identifier as idf then{\n substance.statusCode as statusc where (code = 'completed') -> immunization.status = 'completed';\n substance.statusCode as statusc where (code = 'aborted') -> immunization.status = 'final';\n substance.statusCode as statusc where (code = 'suspended') -> immunization.status = 'enterer-in-error';\n substance.statusCode as statusc where (code = 'cancelled') -> immunization.status = 'not-done';\n substance.effectiveTime as eff where (value.exists()) -> immunization.occurrence = create('dateTime') as value then TSDateTime(eff, value) "value1";\n substance.effectiveTime as eff where (low.exists()) -> immunization.occurrence = create('Period') as value then IVLTSPeriod(eff, value) "valuePeriod";\n substance.routeCode -> immunization.route "route";\n substance.approachSiteCode -> immunization.site "site";\n substance -> immunization.doseQuantity = create('SimpleQuantity') as quantity then {\n substance.doseQuantity as q then {\n q -> quantity.value = (q.value) "val";\n q -> quantity.unit = (q.unit) "uni";\n } "qua";\n } "q";\n substance.consumable as cons then {\n cons.manufacturedProduct as manufact then {\n manufact.manufacturedMaterial as manufactmat then {\n manufactmat.code -> immunization.vaccineCode;\n manufactmat.lotNumberText as t -> immunization.lotNumber = (t.dataString);\n } "manufactmat";\n manufact.manufacturerOrganization as manufactOrg -> bundle.entry as e1, e1.request = create('BackboneElement') as request, request.method = 'PUT', e1.resource = create('Organization') as organization then {\n manufactOrg -> organization.meta as meta then {\n manufactOrg -> meta.tag = create('Coding') as coding then {\n manufactOrg -> coding.system = 'http://algoritmodiscoring' "system";\n manufactOrg -> coding.code = 'ClinicalDocument/body/manufacturerOrganization' "code";\n } "coding";\n } "meta";\n manufactOrg.id as id -> organization.identifier as identifier then {\n id.root as r -> identifier.system = translate(r, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri') "root1";\n id.extension as ext -> identifier.value = ext then {\n ext -> request.url = append('Organization?identifier=', ext) "UUID";\n } "ext";\n id.assigningAuthorityName as s -> identifier.assigner as a, a.display = s;\n id.root as r then {\n id.extension as ext -> organization.id = (r + '-' + ext) as uuid5, e1.fullUrl = append('https://example/Organization/', uuid5), immunization.manufacturer = create('Reference') as reference, reference.reference = ('https://example/Organization/' + %uuid5);\n } "r";\n } "identifier";\n // manufactOrg.id as id then{\n manufactOrg.name as n -> organization.name = (n.other);\n } "manufactOrg";\n } "manufact";\n } "cons";\n substance.participant as part -> bundle.entry as e1, e1.request = create('BackboneElement') as request, request.method = 'PUT', e1.resource = create('Location') as location then {\n part -> location.meta as meta then {\n part -> meta.tag = create('Coding') as coding then {\n part -> coding.system = 'http://algoritmodiscoring' "system";\n part -> coding.code = 'ClinicalDocument/body/participant' "code";\n } "coding";\n } "meta";\n part.participantRole as partRole then {\n partRole.id as id -> location.identifier as identifier then {\n id.root as r -> identifier.system = translate(r, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri') "root1";\n id.extension as ext -> identifier.value = ext then {\n ext -> request.url = append('Location?identifier=', ext) "UUID";\n } "ext";\n id.assigningAuthorityName as s -> identifier.assigner as a, a.display = s;\n id.root as r then {\n id.extension as ext -> location.id = (r + '-' + ext) as uuid6, e1.fullUrl = append('https://example/Location/', uuid6), immunization.location = create('Reference') as reference, reference.reference = ('https://example/Location/' + %uuid6) "ref";\n } "r";\n } "identifier";\n } "role";\n } "part";\n cda -> immunization.protocolApplied as prot then {\n substance.entryRelationship as entrirel4 then {\n entrirel4.observation as obs then {\n obs.code where (code = '75323-6') then {\n obs.value -> prot.targetDisease;\n } "codeControl";\n } "entrirel2";\n entrirel4.observation as obsdosenumber then {\n obsdosenumber.code where (code = '30973-2') then {\n obsdosenumber.value as v then {\n v.value as int -> prot.doseNumber = (int.toString());\n } "v";\n } "codeControl";\n } "entrirel2";\n } "entrirel4";\n } "protocolAp";\n substance.entryRelationship as entrirel2 then {\n entrirel2.observation as obs then {\n obs.code where ((code = '59778-1') or (code = '30981-5') or (code = '30980-7') or (code = '59777-3')) then {\n obs.value as value then {\n value.high as h then {\n h.value as date -> immunization.expirationDate = truncate(date, 10);\n } "da";\n };\n } "codeControl";\n } "obs";\n } "entrirel2";\n substance.entryRelationship as entrirel3 then {\n entrirel3.observation as obs then {\n obs.code where (code = '95715-9') -> bundle.entry as e1, e1.request = create('BackboneElement') as request, request.method = 'POST', e1.resource = create('Observation') as observation, observation.id = uuid() as uuid1, e1.fullUrl = append('https://example/Observation/', uuid1), request.url = 'Observation', immunization.reasonReference = create('Reference') as reference, reference.reference = ('https://example/Observation/' + %observation.id) then {\n obs then Observation(entrirel3, patient, tgt, bundle, enc, observation) "observation";\n } "codeControl";\n } "obs";\n } "entrirel2";\n substance.entryRelationship as entrirel4 then {\n entrirel4.observation as obs then {\n obs.code where (code = '59785-6') -> bundle.entry as e1, e1.request = create('BackboneElement') as request, request.method = 'POST', e1.resource = create('Observation') as observation, observation.id = uuid() as uuid1, e1.fullUrl = append('https://example/Observation/', uuid1), request.url = 'Observation', immunization.reasonReference = create('Reference') as reference, reference.reference = ('https://example/Observation/' + %observation.id) then {\n obs then Observation1(entrirel4, patient, tgt, bundle, enc, observation) "observation";\n } "codeControl";\n } "obs";\n } "entrirel2";\n substance.entryRelationship as entrirel4 then {\n entrirel4.observation as obs then {\n obs.code where (code = '31044-1') -> bundle.entry as e1, e1.request = create('BackboneElement') as request, request.method = 'POST', e1.resource = create('Observation') as observation, observation.id = uuid() as uuid1, e1.fullUrl = append('https://example/Observation/', uuid1), request.url = 'Observation', immunization.reasonReference = create('Reference') as reference, reference.reference = ('https://example/Observation/' + %observation.id) then {\n obs then Observation1(entrirel4, patient, tgt, bundle, enc, observation) "observation";\n } "codeControl";\n } "obs";\n } "entrirel2";\n } "ControlloImmunization";\n substance.templateId where (root = '2.16.840.1.113883.2.9.10.1.11.4.2') -> bundle.entry as e1, e1.request = create('BackboneElement') as request, request.method = 'POST', e1.resource = create('Immunization') as immunization, immunization.id = uuid() as uuid1, e1.fullUrl = append('https://example/Immunization/', uuid1), request.url = 'Immunization', tgt.entry = create('Reference') as reference, reference.reference = ('https://example/Immunization/' + %immunization.id) then {\n substance -> immunization.patient = create('Reference') as reference, reference.reference = ('https://example/Patient/' + %patient.id) "patientRef";\n // substance.templateId as tid -> immunization.identifier as idf then{\n substance.statusCode as statusc where (code = 'completed') -> immunization.status = 'completed';\n substance.statusCode as statusc where (code = 'aborted') -> immunization.status = 'final';\n substance.statusCode as statusc where (code = 'suspended') -> immunization.status = 'enterer-in-error';\n substance.statusCode as statusc where (code = 'cancelled') -> immunization.status = 'not-done';\n substance.effectiveTime as eff where (value.exists()) -> immunization.occurrence = create('dateTime') as value then TSDateTime(eff, value) "value1";\n substance.effectiveTime as eff where (low.exists()) -> immunization.occurrence = create('Period') as value then IVLTSPeriod(eff, value) "valuePeriod";\n substance.consumable as cons then {\n cons.manufacturedProduct as manufact then {\n manufact.manufacturedMaterial as manufactmat then {\n manufactmat.code -> immunization.vaccineCode;\n manufactmat.lotNumberText as t -> immunization.lotNumber = (t.dataString);\n } "manufactmat";\n manufact.manufacturerOrganization as manufactOrg -> bundle.entry as e1, e1.request = create('BackboneElement') as request, request.method = 'PUT', e1.resource = create('Organization') as organization then {\n manufactOrg -> organization.meta as meta then {\n manufactOrg -> meta.tag = create('Coding') as coding then {\n manufactOrg -> coding.system = 'http://algoritmodiscoring' "system";\n manufactOrg -> coding.code = 'ClinicalDocument/body/manufacturerOrganization' "code";\n } "coding";\n } "meta";\n manufactOrg.id as id -> organization2.identifier as identifier then {\n id.root as r -> identifier.system = translate(r, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri') "root1";\n id.extension as ext -> identifier.value = ext then {\n manufactOrg -> request.url = append('Organization?identifier=', ext) "UUID";\n } "ext";\n id.assigningAuthorityName as s -> identifier.assigner as a, a.display = s;\n id.root as r then {\n id.extension as ext -> organization1.id = (r + '-' + ext) as uuid23, e1.fullUrl = append('https://example/Organization/', uuid23), immunization.manufacturer = create('Reference') as reference, reference.reference = ('https://example/Organization/' + %uuid23) "org";\n } "r";\n } "identifier";\n manufactOrg.name as n -> organization.name = (n.other);\n } "manufactOrg";\n } "manufact";\n } "cons";\n cda -> immunization.protocolApplied as prot then {\n substance.entryRelationship as entrirel4 then {\n entrirel4.observation as obs then {\n obs.code where (code = '75323-6') then {\n obs.value -> prot.targetDisease;\n } "codeControl";\n } "entrirel2";\n entrirel4.observation as obsdosenumber then {\n obsdosenumber.code where (code = '30973-2') then {\n obsdosenumber.value as v then {\n v.value as int -> prot.doseNumber = (int.toString());\n } "v";\n } "codeControl";\n } "entrirel2";\n } "entrirel4";\n } "protocolAp";\n substance.entryRelationship as entrirel1 then {\n entrirel1.observation as obs then {\n obs.code where (code = '85714-4') then {\n obs.code -> immunization.statusReason;\n } "codeControl";\n obs.code where (code = '59784-9') then {\n obs.value as val then {\n val.originalText as original -> immunization.statusReason = create('CodeableConcept') as cod then {\n original.reference as reff -> cod.text = (reff.value);\n } "cod";\n } "val";\n } "codeControl";\n } "obs";\n } "entrirel1";\n substance.participant as part -> bundle.entry as e1, e1.request = create('BackboneElement') as request, request.method = 'PUT', e1.resource = create('Location') as location then {\n part -> location.meta as meta then {\n part -> meta.tag = create('Coding') as coding then {\n part -> coding.system = 'http://algoritmodiscoring' "system";\n part -> coding.code = 'ClinicalDocument/body/participant' "code";\n } "coding";\n } "meta";\n part.participantRole as partRole then {\n partRole.id as id -> location.identifier as identifier then {\n id.root as r -> identifier.system = translate(r, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri') "root1";\n id.extension as ext -> identifier.value = ext then {\n ext -> request.url = append('Location?identifier=', ext) "UUID";\n } "ext";\n id.assigningAuthorityName as s -> identifier.assigner as a, a.display = s;\n id.root as r then {\n id.extension as ext -> location.id = (r + '-' + ext) as uuid7, e1.fullUrl = append('https://example/Location/', uuid7), immunization.location = create('Reference') as reference, reference.reference = ('https://example/Location/' + %uuid7) "ref";\n } "r";\n } "identifier";\n } "role";\n } "location";\n } "sub2";\n } "substance";\n };\n}\n\ngroup Observation(source entrirel2 : entryRelationship, target patient : Patient, target tgt, target bundle : Bundle, target enc : Encounter, target obs : Observation) {\n entrirel2.observation as observation then {\n // observation.templateId as tid -> obs.identifier as idf then{\n observation.code -> obs.code;\n observation.statusCode as statusc where (code = 'completed') -> obs.status = 'final';\n observation.statusCode as statusc where (code = 'active') -> obs.status = 'registered';\n observation.statusCode as statusc where (code = 'aborted') -> obs.status = 'cancelled';\n observation.statusCode as statusc where (code = 'suspended') -> obs.status = 'partial';\n observation -> obs.subject = create('Reference') as reference, reference.reference = ('https://example/Patient/' + %patient.id) "reference";\n observation -> obs.encounter = create('Reference') as reference, reference.reference = ('https://example/Encounter/' + %enc.id) "reference";\n observation -> obs.referenceRange as refRange then {\n observation.value -> refRange.appliesTo;\n observation -> refRange.text = 'string' "text";\n } "refRange";\n } "obs";\n}\n\ngroup Observation1(source entrirel4 : entryRelationship, target patient : Patient, target tgt, target bundle : Bundle, target enc : Encounter, target obs : Observation) {\n entrirel4.observation as observation then {\n // observation.templateId as tid -> obs.identifier as idf then{\n observation.code -> obs.code;\n observation.statusCode as statusc where (code = 'completed') -> obs.status = 'final';\n observation.statusCode as statusc where (code = 'active') -> obs.status = 'registered';\n observation.statusCode as statusc where (code = 'aborted') -> obs.status = 'cancelled';\n observation.statusCode as statusc where (code = 'suspended') -> obs.status = 'partial';\n observation -> obs.subject = create('Reference') as reference, reference.reference = ('https://example/Patient/' + %patient.id) "reference";\n observation -> obs.encounter = create('Reference') as reference, reference.reference = ('https://example/Encounter/' + %enc.id) "reference";\n observation.effectiveTime as eff where (value.exists()) -> obs.effective = create('dateTime') as value then TSDateTime(eff, value) "value1";\n observation.effectiveTime as eff -> obs.effective = create('Period') as period then IVLTSPeriod(eff, period) "period";\n observation -> obs.value = create('CodeableConcept') as concept then {\n observation.value -> concept.coding = create('Coding') as coding then {\n observation.value as v -> coding.code = (v.code);\n observation.value as v then {\n v.codeSystem as system -> coding.system = translate(system, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri');\n } "vv";\n observation.value as v -> coding.display = (v.displayName);\n } "coding";\n observation.value as valu then {\n valu.originalText as txt then {\n txt.reference as ref -> concept.text = (ref.value);\n } "txt";\n };\n } "refRange";\n } "obs";\n}\n\n</pre>\n </div>"
},
"url" : "http://hl7.it/fhir/cda2fhir/StructureMap/cda2fhirVaccination",
"version" : "0.1.0",
"name" : "cda2fhirVaccination",
"status" : "draft",
"date" : "2024-09-15T08:16:12+00:00",
"publisher" : "HL7 Italy",
"contact" : [
{
"name" : "HL7 Italy",
"telecom" : [
{
"system" : "url",
"value" : "http://hl7.it"
}
]
}
],
"jurisdiction" : [
{
"coding" : [
{
"system" : "urn:iso:std:iso:3166",
"code" : "IT",
"display" : "Italy"
}
]
}
],
"structure" : [
{
"url" : "http://hl7.org/fhir/cda/StructureDefinition/ClinicalDocument",
"mode" : "source",
"alias" : "ClinicalDocument"
},
{
"url" : "http://hl7.org/fhir/cda/StructureDefinition/AssignedAuthor",
"mode" : "queried",
"alias" : "AssignedAuthor"
},
{
"url" : "http://hl7.org/fhir/cda/StructureDefinition/AssignedEntity",
"mode" : "queried",
"alias" : "AssignedEntity"
},
{
"url" : "http://hl7.org/fhir/cda/StructureDefinition/AssociatedEntity",
"mode" : "queried",
"alias" : "AssociatedEntity"
},
{
"url" : "http://hl7.org/fhir/cda/StructureDefinition/CustodianOrganization",
"mode" : "queried",
"alias" : "CustodianOrganization"
},
{
"url" : "http://hl7.org/fhir/cda/StructureDefinition/OrganizationPartOf",
"mode" : "queried",
"alias" : "OrganizationPartOf"
},
{
"url" : "http://hl7.org/fhir/cda/StructureDefinition/Organization",
"mode" : "queried",
"alias" : "rapresentedOrganization"
},
{
"url" : "http://hl7.org/fhir/cda/StructureDefinition/Section",
"mode" : "queried",
"alias" : "Section"
},
{
"url" : "http://hl7.org/fhir/cda/StructureDefinition/PatientRole",
"mode" : "queried",
"alias" : "PatientRole"
},
{
"url" : "http://hl7.org/fhir/cda/StructureDefinition/AD",
"mode" : "source",
"alias" : "AD"
},
{
"url" : "http://hl7.org/fhir/StructureDefinition/Bundle",
"mode" : "target",
"alias" : "Bundle"
},
{
"url" : "http://hl7.org/fhir/StructureDefinition/Composition",
"mode" : "produced",
"alias" : "Composition"
},
{
"url" : "http://hl7.org/fhir/StructureDefinition/Patient",
"mode" : "produced",
"alias" : "Patient"
},
{
"url" : "http://hl7.org/fhir/StructureDefinition/Encounter",
"mode" : "produced",
"alias" : "Encounter"
},
{
"url" : "http://hl7.org/fhir/StructureDefinition/Person",
"mode" : "produced",
"alias" : "Patient"
},
{
"url" : "http://hl7.org/fhir/StructureDefinition/Practitioner",
"mode" : "produced",
"alias" : "Practitioner"
},
{
"url" : "http://hl7.org/fhir/StructureDefinition/Organization",
"mode" : "produced",
"alias" : "Organization"
},
{
"url" : "http://hl7.org/fhir/cda/StructureDefinition/Act",
"mode" : "produced",
"alias" : "Act"
},
{
"url" : "http://hl7.org/fhir/cda/StructureDefinition/IVL-PQ",
"mode" : "source",
"alias" : "IVL_PQ"
},
{
"url" : "http://hl7.org/fhir/cda/StructureDefinition/PQ",
"mode" : "source",
"alias" : "PQ"
},
{
"url" : "http://hl7.org/fhir/StructureDefinition/SimpleQuantity",
"mode" : "target",
"alias" : "SimpleQuantity"
},
{
"url" : "http://hl7.org/fhir/StructureDefinition/Immunization",
"mode" : "target",
"alias" : "Immunization"
}
],
"import" : [
🔗 "http://hl7.it/fhir/cda2fhir/StructureMap/cda2fhirDataTypes"🔗 ,
"http://hl7.it/fhir/cda2fhir/StructureMap/cda2fhirHeader"
],
"group" : [
{
"name" : "CdaToBundle",
"typeMode" : "none",
"input" : [
{
"name" : "cda",
"type" : "ClinicalDocument",
"mode" : "source"
},
{
"name" : "bundle",
"type" : "Bundle",
"mode" : "target"
}
],
"rule" : [
{
"name" : "ClinicalDocumentToBody",
"source" : [
{
"context" : "cda"
}
],
"target" : [
{
"context" : "bundle",
"contextType" : "variable",
"element" : "entry",
"variable" : "e"
},
{
"context" : "e",
"contextType" : "variable",
"element" : "request",
"variable" : "request",
"transform" : "create",
"parameter" : [
{
"valueString" : "BackboneElement"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "method",
"transform" : "copy",
"parameter" : [
{
"valueString" : "POST"
}
]
},
{
"context" : "e",
"contextType" : "variable",
"element" : "resource",
"variable" : "composition",
"transform" : "create",
"parameter" : [
{
"valueString" : "Composition"
}
]
},
{
"context" : "composition",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid1",
"transform" : "uuid"
},
{
"context" : "e",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "https://example/Composition/"
},
{
"valueId" : "uuid1"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "url",
"transform" : "copy",
"parameter" : [
{
"valueString" : "Composition"
}
]
},
{
"context" : "bundle",
"contextType" : "variable",
"element" : "entry",
"variable" : "e2"
},
{
"context" : "e2",
"contextType" : "variable",
"element" : "request",
"variable" : "requestPAT",
"transform" : "create",
"parameter" : [
{
"valueString" : "BackboneElement"
}
]
},
{
"context" : "requestPAT",
"contextType" : "variable",
"element" : "method",
"transform" : "copy",
"parameter" : [
{
"valueString" : "PUT"
}
]
},
{
"context" : "e2",
"contextType" : "variable",
"element" : "resource",
"variable" : "patient",
"transform" : "create",
"parameter" : [
{
"valueString" : "Patient"
}
]
},
{
"context" : "patient",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid2",
"transform" : "uuid"
},
{
"context" : "e2",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "https://example/Patient/"
},
{
"valueId" : "uuid2"
}
]
},
{
"context" : "bundle",
"contextType" : "variable",
"element" : "entry",
"variable" : "e3"
},
{
"context" : "e3",
"contextType" : "variable",
"element" : "request",
"variable" : "request",
"transform" : "create",
"parameter" : [
{
"valueString" : "BackboneElement"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "method",
"transform" : "copy",
"parameter" : [
{
"valueString" : "POST"
}
]
},
{
"context" : "e3",
"contextType" : "variable",
"element" : "resource",
"variable" : "encounter",
"transform" : "create",
"parameter" : [
{
"valueString" : "Encounter"
}
]
},
{
"context" : "encounter",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid3",
"transform" : "uuid"
},
{
"context" : "e3",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "https://example/Encounter/"
},
{
"valueId" : "uuid3"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "url",
"transform" : "copy",
"parameter" : [
{
"valueString" : "Encounter"
}
]
},
{
"context" : "bundle",
"contextType" : "variable",
"element" : "entry",
"variable" : "e5"
},
{
"context" : "e5",
"contextType" : "variable",
"element" : "request",
"variable" : "request",
"transform" : "create",
"parameter" : [
{
"valueString" : "BackboneElement"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "method",
"transform" : "copy",
"parameter" : [
{
"valueString" : "POST"
}
]
},
{
"context" : "e5",
"contextType" : "variable",
"element" : "resource",
"variable" : "DocumentReference",
"transform" : "create",
"parameter" : [
{
"valueString" : "DocumentReference"
}
]
},
{
"context" : "DocumentReference",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid5",
"transform" : "uuid"
},
{
"context" : "e5",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "https://example/DocumentReference/"
},
{
"valueId" : "uuid5"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "url",
"transform" : "copy",
"parameter" : [
{
"valueString" : "DocumentReference"
}
]
}
],
"rule" : [
{
"name" : "cdatobundle",
"source" : [
{
"context" : "cda"
}
],
"dependent" : [
{
"name" : "ClinicalDocumentToBundle",
"variable" : [
"cda",
"patient",
"composition",
"encounter",
"bundle",
"DocumentReference"
]
}
]
},
{
"name" : "recPat",
"source" : [
{
"context" : "cda",
"element" : "recordTarget",
"variable" : "recordTarget"
}
],
"rule" : [
{
"name" : "record",
"source" : [
{
"context" : "recordTarget",
"element" : "patientRole",
"variable" : "patient"
}
],
"rule" : [
{
"name" : "idfr",
"source" : [
{
"context" : "patient",
"element" : "id",
"variable" : "id"
}
],
"target" : [
{
"context" : "patient",
"contextType" : "variable",
"element" : "identifier",
"variable" : "identifier"
}
],
"rule" : [
{
"name" : "root1",
"source" : [
{
"context" : "id",
"element" : "root",
"variable" : "r"
}
],
"target" : [
{
"context" : "identifier",
"contextType" : "variable",
"element" : "system",
"transform" : "translate",
"parameter" : [
{
"valueId" : "r"
},
{
"valueString" : "http://hl7.org/fhir/ConceptMap/special-oid2uri"
},
{
"valueString" : "uri"
}
]
}
]
},
{
"name" : "value",
"source" : [
{
"context" : "id",
"element" : "extension",
"variable" : "ext1"
}
],
"target" : [
{
"context" : "identifier",
"contextType" : "variable",
"element" : "value",
"transform" : "copy",
"parameter" : [
{
"valueId" : "ext1"
}
]
}
]
},
{
"name" : "assigningAuthorityName",
"source" : [
{
"context" : "id",
"element" : "assigningAuthorityName",
"variable" : "s"
}
],
"target" : [
{
"context" : "identifier",
"contextType" : "variable",
"element" : "assigner",
"variable" : "a"
},
{
"context" : "a",
"contextType" : "variable",
"element" : "display",
"transform" : "copy",
"parameter" : [
{
"valueId" : "s"
}
]
}
]
}
]
},
{
"name" : "ext",
"source" : [
{
"context" : "patient",
"element" : "id",
"variable" : "id",
"condition" : "(root = '2.16.840.1.113883.2.9.4.3.2') or (root = '2.16.840.1.113883.2.9.4.3.7') or (root = '2.16.840.1.113883.2.9.4.3.3') or (root = '2.16.840.1.113883.2.9.4.3.17') or (root = '2.16.840.1.113883.2.9.4.3.18') or (root = '2.16.840.1.113883.2.9.2.10.4.1.1') or (root = '2.16.840.1.113883.2.9.2.20.4.1.1') or (root = '2.16.840.1.113883.2.9.2.30.4.1.1') or (root = '2.16.840.1.113883.2.9.2.41.4.1.1') or (root = '2.16.840.1.113883.2.9.2.42.4.1.1') or (root = '2.16.840.1.113883.2.9.2.50.4.1.1') or (root = '2.16.840.1.113883.2.9.2.60.4.1.1') or (root = '2.16.840.1.113883.2.9.2.70.4.1.1') or (root = '2.16.840.1.113883.2.9.2.80.4.1.1') or (root = '2.16.840.1.113883.2.9.2.90.4.1.1') or (root = '2.16.840.1.113883.2.9.2.100.4.1.1') or (root = '2.16.840.1.113883.2.9.2.110.4.1.1') or (root = '2.16.840.1.113883.2.9.2.120.4.1.1') or (root = '2.16.840.1.113883.2.9.2.130.4.1.1') or (root = '2.16.840.1.113883.2.9.2.140.4.1.1') or (root = '2.16.840.1.113883.2.9.2.150.4.1.1') or (root = '2.16.840.1.113883.2.9.2.160.4.1.1') or (root = '2.16.840.1.113883.2.9.2.170.4.1.1') or (root = '2.16.840.1.113883.2.9.2.180.4.1.1') or (root = '2.16.840.1.113883.2.9.2.190.4.1.1') or (root = '2.16.840.1.113883.2.9.2.200.4.1.1') or (root = '2.16.840.1.113883.2.9.2.10.4.1') or (root = '2.16.840.1.113883.2.9.2.20.4.1') or (root = '2.16.840.1.113883.2.9.2.30.4.1') or (root = '2.16.840.1.113883.2.9.2.41.4.1') or (root = '2.16.840.1.113883.2.9.2.42.4.1') or (root = '2.16.840.1.113883.2.9.2.50.4.1') or (root = '2.16.840.1.113883.2.9.2.60.4.1') or (root = '2.16.840.1.113883.2.9.2.70.4.1') or (root = '2.16.840.1.113883.2.9.2.80.4.1') or (root = '2.16.840.1.113883.2.9.2.90.4.1') or (root = '2.16.840.1.113883.2.9.2.100.4.1') or (root = '2.16.840.1.113883.2.9.2.110.4.1') or (root = '2.16.840.1.113883.2.9.2.120.4.1') or (root = '2.16.840.1.113883.2.9.2.130.4.1') or (root = '2.16.840.1.113883.2.9.2.140.4.1') or (root = '2.16.840.1.113883.2.9.2.150.4.1') or (root = '2.16.840.1.113883.2.9.2.160.4.1') or (root = '2.16.840.1.113883.2.9.2.170.4.1') or (root = '2.16.840.1.113883.2.9.2.180.4.1') or (root = '2.16.840.1.113883.2.9.2.190.4.1') or (root = '2.16.840.1.113883.2.9.2.200.4.1') or (root = '2.16.840.1.113883.2.9.4.3.15')"
}
],
"rule" : [
{
"name" : "UUID",
"source" : [
{
"context" : "id",
"element" : "extension",
"variable" : "ext"
}
],
"target" : [
{
"context" : "requestPAT",
"contextType" : "variable",
"element" : "url",
"transform" : "append",
"parameter" : [
{
"valueString" : "Patient?identifier="
},
{
"valueId" : "ext"
}
]
}
]
}
]
}
]
}
]
}
]
}
]
},
{
"name" : "ClinicalDocumentToBundle",
"typeMode" : "none",
"input" : [
{
"name" : "cda",
"type" : "ClinicalDocument",
"mode" : "source"
},
{
"name" : "patient",
"type" : "Patient",
"mode" : "target"
},
{
"name" : "composition",
"type" : "Composition",
"mode" : "target"
},
{
"name" : "encounter",
"type" : "Encounter",
"mode" : "target"
},
{
"name" : "bundle",
"type" : "Bundle",
"mode" : "target"
},
{
"name" : "DocumentReference",
"type" : "DocumentReference",
"mode" : "target"
}
],
"rule" : [
{
"name" : "finished",
"source" : [
{
"context" : "cda"
}
],
"target" : [
{
"context" : "encounter",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "finished"
}
]
}
]
},
{
"name" : "coding",
"source" : [
{
"context" : "cda"
}
],
"target" : [
{
"context" : "encounter",
"contextType" : "variable",
"element" : "class",
"variable" : "coding",
"transform" : "create",
"parameter" : [
{
"valueString" : "Coding"
}
]
}
],
"rule" : [
{
"name" : "amb",
"source" : [
{
"context" : "cda"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "code",
"transform" : "copy",
"parameter" : [
{
"valueString" : "AMB"
}
]
}
]
}
]
},
{
"name" : "id",
"source" : [
{
"context" : "cda"
}
],
"target" : [
{
"context" : "bundle",
"contextType" : "variable",
"element" : "id",
"transform" : "uuid"
}
]
},
{
"name" : "identifier",
"source" : [
{
"context" : "cda",
"element" : "id",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "bundle",
"contextType" : "variable",
"element" : "identifier",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "type",
"source" : [
{
"context" : "cda"
}
],
"target" : [
{
"context" : "bundle",
"contextType" : "variable",
"element" : "type",
"transform" : "copy",
"parameter" : [
{
"valueString" : "transaction"
}
]
}
]
},
{
"name" : "date",
"source" : [
{
"context" : "cda"
}
],
"target" : [
{
"context" : "bundle",
"contextType" : "variable",
"element" : "timestamp",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "timestamp.now()"
}
]
}
]
},
{
"name" : "composition",
"source" : [
{
"context" : "cda"
}
],
"dependent" : [
{
"name" : "ClinicalDocumentComposition",
"variable" : [
"cda",
"composition",
"patient",
"encounter",
"bundle",
"DocumentReference"
]
}
]
},
{
"name" : "component",
"source" : [
{
"context" : "cda",
"element" : "component",
"variable" : "component"
}
],
"rule" : [
{
"name" : "body",
"source" : [
{
"context" : "component",
"element" : "structuredBody",
"variable" : "body"
}
],
"rule" : [
{
"name" : "component",
"source" : [
{
"context" : "body",
"element" : "component",
"variable" : "component"
}
],
"rule" : [
{
"name" : "section",
"source" : [
{
"context" : "component",
"element" : "section",
"variable" : "srcSection"
}
],
"rule" : [
{
"name" : "TerapiaFarmacologicaAllaDimissione",
"source" : [
{
"context" : "srcSection"
}
],
"target" : [
{
"context" : "composition",
"contextType" : "variable",
"element" : "section",
"variable" : "tgtSection"
}
],
"dependent" : [
{
"name" : "ClinicalDocumentSection",
"variable" : [
"cda",
"srcSection",
"patient",
"tgtSection",
"bundle",
"encounter"
]
}
]
}
]
}
]
}
]
}
]
}
]
},
{
"name" : "ClinicalDocumentSection",
"typeMode" : "none",
"documentation" : "--------------------------------",
"input" : [
{
"name" : "cda",
"type" : "ClinicalDocument",
"mode" : "source"
},
{
"name" : "src",
"type" : "Section",
"mode" : "source"
},
{
"name" : "patient",
"type" : "Patient",
"mode" : "target"
},
{
"name" : "tgt",
"mode" : "target"
},
{
"name" : "bundle",
"type" : "Bundle",
"mode" : "target"
},
{
"name" : "enc",
"type" : "Encounter",
"mode" : "target"
}
],
"rule" : [
{
"name" : "title",
"source" : [
{
"context" : "src",
"element" : "title",
"variable" : "t"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "title",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "t.dataString"
}
]
}
]
},
{
"name" : "code",
"source" : [
{
"context" : "src",
"element" : "code",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "code",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "cdaText",
"source" : [
{
"context" : "src",
"element" : "text",
"variable" : "cdaText"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "text",
"variable" : "fhirText"
}
],
"rule" : [
{
"name" : "narrativeStatus",
"source" : [
{
"context" : "cdaText"
}
],
"target" : [
{
"context" : "fhirText",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "generated"
}
]
}
]
},
{
"name" : "narrativeText",
"source" : [
{
"context" : "cdaText",
"variable" : "t"
}
],
"target" : [
{
"context" : "fhirText",
"contextType" : "variable",
"element" : "div",
"transform" : "copy",
"parameter" : [
{
"valueId" : "t"
}
]
}
]
}
]
},
{
"name" : "entry",
"source" : [
{
"context" : "src",
"element" : "entry",
"variable" : "entry1"
}
],
"rule" : [
{
"name" : "substance",
"source" : [
{
"context" : "entry1",
"element" : "substanceAdministration",
"variable" : "substance"
}
],
"rule" : [
{
"name" : "ControlloImmunization",
"source" : [
{
"context" : "substance",
"element" : "templateId",
"condition" : "(root = '2.16.840.1.113883.2.9.10.1.11.4.1')"
}
],
"target" : [
{
"context" : "bundle",
"contextType" : "variable",
"element" : "entry",
"variable" : "e1"
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "request",
"variable" : "request",
"transform" : "create",
"parameter" : [
{
"valueString" : "BackboneElement"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "method",
"transform" : "copy",
"parameter" : [
{
"valueString" : "POST"
}
]
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "resource",
"variable" : "immunization",
"transform" : "create",
"parameter" : [
{
"valueString" : "Immunization"
}
]
},
{
"context" : "immunization",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid1",
"transform" : "uuid"
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "https://example/Immunization/"
},
{
"valueId" : "uuid1"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "url",
"transform" : "copy",
"parameter" : [
{
"valueString" : "Immunization"
}
]
},
{
"context" : "tgt",
"contextType" : "variable",
"element" : "entry",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Immunization/' + %immunization.id"
}
]
}
],
"rule" : [
{
"name" : "patientRef",
"source" : [
{
"context" : "substance"
}
],
"target" : [
{
"context" : "immunization",
"contextType" : "variable",
"element" : "patient",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Patient/' + %patient.id"
}
]
}
]
},
{
"name" : "statusCode",
"source" : [
{
"context" : "substance",
"element" : "statusCode",
"variable" : "statusc",
"condition" : "(code = 'completed')"
}
],
"target" : [
{
"context" : "immunization",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "completed"
}
]
}
],
"documentation" : "substance.templateId as tid -> immunization.identifier as idf then{"
},
{
"name" : "statusCode",
"source" : [
{
"context" : "substance",
"element" : "statusCode",
"variable" : "statusc",
"condition" : "(code = 'aborted')"
}
],
"target" : [
{
"context" : "immunization",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "final"
}
]
}
]
},
{
"name" : "statusCode",
"source" : [
{
"context" : "substance",
"element" : "statusCode",
"variable" : "statusc",
"condition" : "(code = 'suspended')"
}
],
"target" : [
{
"context" : "immunization",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "enterer-in-error"
}
]
}
]
},
{
"name" : "statusCode",
"source" : [
{
"context" : "substance",
"element" : "statusCode",
"variable" : "statusc",
"condition" : "(code = 'cancelled')"
}
],
"target" : [
{
"context" : "immunization",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "not-done"
}
]
}
]
},
{
"name" : "value1",
"source" : [
{
"context" : "substance",
"element" : "effectiveTime",
"variable" : "eff",
"condition" : "(value.exists())"
}
],
"target" : [
{
"context" : "immunization",
"contextType" : "variable",
"element" : "occurrence",
"variable" : "value",
"transform" : "create",
"parameter" : [
{
"valueString" : "dateTime"
}
]
}
],
"dependent" : [
{
"name" : "TSDateTime",
"variable" : [
"eff",
"value"
]
}
]
},
{
"name" : "valuePeriod",
"source" : [
{
"context" : "substance",
"element" : "effectiveTime",
"variable" : "eff",
"condition" : "(low.exists())"
}
],
"target" : [
{
"context" : "immunization",
"contextType" : "variable",
"element" : "occurrence",
"variable" : "value",
"transform" : "create",
"parameter" : [
{
"valueString" : "Period"
}
]
}
],
"dependent" : [
{
"name" : "IVLTSPeriod",
"variable" : [
"eff",
"value"
]
}
]
},
{
"name" : "route",
"source" : [
{
"context" : "substance",
"element" : "routeCode",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "immunization",
"contextType" : "variable",
"element" : "route",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "site",
"source" : [
{
"context" : "substance",
"element" : "approachSiteCode",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "immunization",
"contextType" : "variable",
"element" : "site",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "q",
"source" : [
{
"context" : "substance"
}
],
"target" : [
{
"context" : "immunization",
"contextType" : "variable",
"element" : "doseQuantity",
"variable" : "quantity",
"transform" : "create",
"parameter" : [
{
"valueString" : "SimpleQuantity"
}
]
}
],
"rule" : [
{
"name" : "qua",
"source" : [
{
"context" : "substance",
"element" : "doseQuantity",
"variable" : "q"
}
],
"rule" : [
{
"name" : "val",
"source" : [
{
"context" : "q"
}
],
"target" : [
{
"context" : "quantity",
"contextType" : "variable",
"element" : "value",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "q.value"
}
]
}
]
},
{
"name" : "uni",
"source" : [
{
"context" : "q"
}
],
"target" : [
{
"context" : "quantity",
"contextType" : "variable",
"element" : "unit",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "q.unit"
}
]
}
]
}
]
}
]
},
{
"name" : "cons",
"source" : [
{
"context" : "substance",
"element" : "consumable",
"variable" : "cons"
}
],
"rule" : [
{
"name" : "manufact",
"source" : [
{
"context" : "cons",
"element" : "manufacturedProduct",
"variable" : "manufact"
}
],
"rule" : [
{
"name" : "manufactmat",
"source" : [
{
"context" : "manufact",
"element" : "manufacturedMaterial",
"variable" : "manufactmat"
}
],
"rule" : [
{
"name" : "code",
"source" : [
{
"context" : "manufactmat",
"element" : "code",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "immunization",
"contextType" : "variable",
"element" : "vaccineCode",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "lotNumberText",
"source" : [
{
"context" : "manufactmat",
"element" : "lotNumberText",
"variable" : "t"
}
],
"target" : [
{
"context" : "immunization",
"contextType" : "variable",
"element" : "lotNumber",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "t.dataString"
}
]
}
]
}
]
},
{
"name" : "manufactOrg",
"source" : [
{
"context" : "manufact",
"element" : "manufacturerOrganization",
"variable" : "manufactOrg"
}
],
"target" : [
{
"context" : "bundle",
"contextType" : "variable",
"element" : "entry",
"variable" : "e1"
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "request",
"variable" : "request",
"transform" : "create",
"parameter" : [
{
"valueString" : "BackboneElement"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "method",
"transform" : "copy",
"parameter" : [
{
"valueString" : "PUT"
}
]
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "resource",
"variable" : "organization",
"transform" : "create",
"parameter" : [
{
"valueString" : "Organization"
}
]
}
],
"rule" : [
{
"name" : "meta",
"source" : [
{
"context" : "manufactOrg"
}
],
"target" : [
{
"context" : "organization",
"contextType" : "variable",
"element" : "meta",
"variable" : "meta"
}
],
"rule" : [
{
"name" : "coding",
"source" : [
{
"context" : "manufactOrg"
}
],
"target" : [
{
"context" : "meta",
"contextType" : "variable",
"element" : "tag",
"variable" : "coding",
"transform" : "create",
"parameter" : [
{
"valueString" : "Coding"
}
]
}
],
"rule" : [
{
"name" : "system",
"source" : [
{
"context" : "manufactOrg"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "system",
"transform" : "copy",
"parameter" : [
{
"valueString" : "http://algoritmodiscoring"
}
]
}
]
},
{
"name" : "code",
"source" : [
{
"context" : "manufactOrg"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "code",
"transform" : "copy",
"parameter" : [
{
"valueString" : "ClinicalDocument/body/manufacturerOrganization"
}
]
}
]
}
]
}
]
},
{
"name" : "identifier",
"source" : [
{
"context" : "manufactOrg",
"element" : "id",
"variable" : "id"
}
],
"target" : [
{
"context" : "organization",
"contextType" : "variable",
"element" : "identifier",
"variable" : "identifier"
}
],
"rule" : [
{
"name" : "root1",
"source" : [
{
"context" : "id",
"element" : "root",
"variable" : "r"
}
],
"target" : [
{
"context" : "identifier",
"contextType" : "variable",
"element" : "system",
"transform" : "translate",
"parameter" : [
{
"valueId" : "r"
},
{
"valueString" : "http://hl7.org/fhir/ConceptMap/special-oid2uri"
},
{
"valueString" : "uri"
}
]
}
]
},
{
"name" : "ext",
"source" : [
{
"context" : "id",
"element" : "extension",
"variable" : "ext"
}
],
"target" : [
{
"context" : "identifier",
"contextType" : "variable",
"element" : "value",
"transform" : "copy",
"parameter" : [
{
"valueId" : "ext"
}
]
}
],
"rule" : [
{
"name" : "UUID",
"source" : [
{
"context" : "ext"
}
],
"target" : [
{
"context" : "request",
"contextType" : "variable",
"element" : "url",
"transform" : "append",
"parameter" : [
{
"valueString" : "Organization?identifier="
},
{
"valueId" : "ext"
}
]
}
]
}
]
},
{
"name" : "assigningAuthorityName",
"source" : [
{
"context" : "id",
"element" : "assigningAuthorityName",
"variable" : "s"
}
],
"target" : [
{
"context" : "identifier",
"contextType" : "variable",
"element" : "assigner",
"variable" : "a"
},
{
"context" : "a",
"contextType" : "variable",
"element" : "display",
"transform" : "copy",
"parameter" : [
{
"valueId" : "s"
}
]
}
]
},
{
"name" : "r",
"source" : [
{
"context" : "id",
"element" : "root",
"variable" : "r"
}
],
"rule" : [
{
"name" : "extension",
"source" : [
{
"context" : "id",
"element" : "extension",
"variable" : "ext"
}
],
"target" : [
{
"context" : "organization",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid5",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "r + '-' + ext"
}
]
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "https://example/Organization/"
},
{
"valueId" : "uuid5"
}
]
},
{
"context" : "immunization",
"contextType" : "variable",
"element" : "manufacturer",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Organization/' + %uuid5"
}
]
}
]
}
]
}
]
},
{
"name" : "name",
"source" : [
{
"context" : "manufactOrg",
"element" : "name",
"variable" : "n"
}
],
"target" : [
{
"context" : "organization",
"contextType" : "variable",
"element" : "name",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "n.other"
}
]
}
],
"documentation" : "manufactOrg.id as id then{"
}
]
}
]
}
]
},
{
"name" : "part",
"source" : [
{
"context" : "substance",
"element" : "participant",
"variable" : "part"
}
],
"target" : [
{
"context" : "bundle",
"contextType" : "variable",
"element" : "entry",
"variable" : "e1"
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "request",
"variable" : "request",
"transform" : "create",
"parameter" : [
{
"valueString" : "BackboneElement"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "method",
"transform" : "copy",
"parameter" : [
{
"valueString" : "PUT"
}
]
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "resource",
"variable" : "location",
"transform" : "create",
"parameter" : [
{
"valueString" : "Location"
}
]
}
],
"rule" : [
{
"name" : "meta",
"source" : [
{
"context" : "part"
}
],
"target" : [
{
"context" : "location",
"contextType" : "variable",
"element" : "meta",
"variable" : "meta"
}
],
"rule" : [
{
"name" : "coding",
"source" : [
{
"context" : "part"
}
],
"target" : [
{
"context" : "meta",
"contextType" : "variable",
"element" : "tag",
"variable" : "coding",
"transform" : "create",
"parameter" : [
{
"valueString" : "Coding"
}
]
}
],
"rule" : [
{
"name" : "system",
"source" : [
{
"context" : "part"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "system",
"transform" : "copy",
"parameter" : [
{
"valueString" : "http://algoritmodiscoring"
}
]
}
]
},
{
"name" : "code",
"source" : [
{
"context" : "part"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "code",
"transform" : "copy",
"parameter" : [
{
"valueString" : "ClinicalDocument/body/participant"
}
]
}
]
}
]
}
]
},
{
"name" : "role",
"source" : [
{
"context" : "part",
"element" : "participantRole",
"variable" : "partRole"
}
],
"rule" : [
{
"name" : "identifier",
"source" : [
{
"context" : "partRole",
"element" : "id",
"variable" : "id"
}
],
"target" : [
{
"context" : "location",
"contextType" : "variable",
"element" : "identifier",
"variable" : "identifier"
}
],
"rule" : [
{
"name" : "root1",
"source" : [
{
"context" : "id",
"element" : "root",
"variable" : "r"
}
],
"target" : [
{
"context" : "identifier",
"contextType" : "variable",
"element" : "system",
"transform" : "translate",
"parameter" : [
{
"valueId" : "r"
},
{
"valueString" : "http://hl7.org/fhir/ConceptMap/special-oid2uri"
},
{
"valueString" : "uri"
}
]
}
]
},
{
"name" : "ext",
"source" : [
{
"context" : "id",
"element" : "extension",
"variable" : "ext"
}
],
"target" : [
{
"context" : "identifier",
"contextType" : "variable",
"element" : "value",
"transform" : "copy",
"parameter" : [
{
"valueId" : "ext"
}
]
}
],
"rule" : [
{
"name" : "UUID",
"source" : [
{
"context" : "ext"
}
],
"target" : [
{
"context" : "request",
"contextType" : "variable",
"element" : "url",
"transform" : "append",
"parameter" : [
{
"valueString" : "Location?identifier="
},
{
"valueId" : "ext"
}
]
}
]
}
]
},
{
"name" : "assigningAuthorityName",
"source" : [
{
"context" : "id",
"element" : "assigningAuthorityName",
"variable" : "s"
}
],
"target" : [
{
"context" : "identifier",
"contextType" : "variable",
"element" : "assigner",
"variable" : "a"
},
{
"context" : "a",
"contextType" : "variable",
"element" : "display",
"transform" : "copy",
"parameter" : [
{
"valueId" : "s"
}
]
}
]
},
{
"name" : "r",
"source" : [
{
"context" : "id",
"element" : "root",
"variable" : "r"
}
],
"rule" : [
{
"name" : "ref",
"source" : [
{
"context" : "id",
"element" : "extension",
"variable" : "ext"
}
],
"target" : [
{
"context" : "location",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid6",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "r + '-' + ext"
}
]
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "https://example/Location/"
},
{
"valueId" : "uuid6"
}
]
},
{
"context" : "immunization",
"contextType" : "variable",
"element" : "location",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Location/' + %uuid6"
}
]
}
]
}
]
}
]
}
]
}
]
},
{
"name" : "protocolAp",
"source" : [
{
"context" : "cda"
}
],
"target" : [
{
"context" : "immunization",
"contextType" : "variable",
"element" : "protocolApplied",
"variable" : "prot"
}
],
"rule" : [
{
"name" : "entrirel4",
"source" : [
{
"context" : "substance",
"element" : "entryRelationship",
"variable" : "entrirel4"
}
],
"rule" : [
{
"name" : "entrirel2",
"source" : [
{
"context" : "entrirel4",
"element" : "observation",
"variable" : "obs"
}
],
"rule" : [
{
"name" : "codeControl",
"source" : [
{
"context" : "obs",
"element" : "code",
"condition" : "(code = '75323-6')"
}
],
"rule" : [
{
"name" : "value",
"source" : [
{
"context" : "obs",
"element" : "value",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "prot",
"contextType" : "variable",
"element" : "targetDisease",
"variable" : "vvv",
"transform" : "create"
}
]
}
]
}
]
},
{
"name" : "entrirel2",
"source" : [
{
"context" : "entrirel4",
"element" : "observation",
"variable" : "obsdosenumber"
}
],
"rule" : [
{
"name" : "codeControl",
"source" : [
{
"context" : "obsdosenumber",
"element" : "code",
"condition" : "(code = '30973-2')"
}
],
"rule" : [
{
"name" : "v",
"source" : [
{
"context" : "obsdosenumber",
"element" : "value",
"variable" : "v"
}
],
"rule" : [
{
"name" : "value",
"source" : [
{
"context" : "v",
"element" : "value",
"variable" : "int"
}
],
"target" : [
{
"context" : "prot",
"contextType" : "variable",
"element" : "doseNumber",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "int.toString()"
}
]
}
]
}
]
}
]
}
]
}
]
}
]
},
{
"name" : "entrirel2",
"source" : [
{
"context" : "substance",
"element" : "entryRelationship",
"variable" : "entrirel2"
}
],
"rule" : [
{
"name" : "obs",
"source" : [
{
"context" : "entrirel2",
"element" : "observation",
"variable" : "obs"
}
],
"rule" : [
{
"name" : "codeControl",
"source" : [
{
"context" : "obs",
"element" : "code",
"condition" : "((code = '59778-1') or (code = '30981-5') or (code = '30980-7') or (code = '59777-3'))"
}
],
"rule" : [
{
"name" : "value",
"source" : [
{
"context" : "obs",
"element" : "value",
"variable" : "value"
}
],
"rule" : [
{
"name" : "da",
"source" : [
{
"context" : "value",
"element" : "high",
"variable" : "h"
}
],
"rule" : [
{
"name" : "value",
"source" : [
{
"context" : "h",
"element" : "value",
"variable" : "date"
}
],
"target" : [
{
"context" : "immunization",
"contextType" : "variable",
"element" : "expirationDate",
"transform" : "truncate",
"parameter" : [
{
"valueId" : "date"
},
{
"valueInteger" : 10
}
]
}
]
}
]
}
]
}
]
}
]
}
]
},
{
"name" : "entrirel2",
"source" : [
{
"context" : "substance",
"element" : "entryRelationship",
"variable" : "entrirel3"
}
],
"rule" : [
{
"name" : "obs",
"source" : [
{
"context" : "entrirel3",
"element" : "observation",
"variable" : "obs"
}
],
"rule" : [
{
"name" : "codeControl",
"source" : [
{
"context" : "obs",
"element" : "code",
"condition" : "(code = '95715-9')"
}
],
"target" : [
{
"context" : "bundle",
"contextType" : "variable",
"element" : "entry",
"variable" : "e1"
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "request",
"variable" : "request",
"transform" : "create",
"parameter" : [
{
"valueString" : "BackboneElement"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "method",
"transform" : "copy",
"parameter" : [
{
"valueString" : "POST"
}
]
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "resource",
"variable" : "observation",
"transform" : "create",
"parameter" : [
{
"valueString" : "Observation"
}
]
},
{
"context" : "observation",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid1",
"transform" : "uuid"
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "https://example/Observation/"
},
{
"valueId" : "uuid1"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "url",
"transform" : "copy",
"parameter" : [
{
"valueString" : "Observation"
}
]
},
{
"context" : "immunization",
"contextType" : "variable",
"element" : "reasonReference",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Observation/' + %observation.id"
}
]
}
],
"rule" : [
{
"name" : "observation",
"source" : [
{
"context" : "obs"
}
],
"dependent" : [
{
"name" : "Observation",
"variable" : [
"entrirel3",
"patient",
"tgt",
"bundle",
"enc",
"observation"
]
}
]
}
]
}
]
}
]
},
{
"name" : "entrirel2",
"source" : [
{
"context" : "substance",
"element" : "entryRelationship",
"variable" : "entrirel4"
}
],
"rule" : [
{
"name" : "obs",
"source" : [
{
"context" : "entrirel4",
"element" : "observation",
"variable" : "obs"
}
],
"rule" : [
{
"name" : "codeControl",
"source" : [
{
"context" : "obs",
"element" : "code",
"condition" : "(code = '59785-6')"
}
],
"target" : [
{
"context" : "bundle",
"contextType" : "variable",
"element" : "entry",
"variable" : "e1"
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "request",
"variable" : "request",
"transform" : "create",
"parameter" : [
{
"valueString" : "BackboneElement"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "method",
"transform" : "copy",
"parameter" : [
{
"valueString" : "POST"
}
]
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "resource",
"variable" : "observation",
"transform" : "create",
"parameter" : [
{
"valueString" : "Observation"
}
]
},
{
"context" : "observation",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid1",
"transform" : "uuid"
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "https://example/Observation/"
},
{
"valueId" : "uuid1"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "url",
"transform" : "copy",
"parameter" : [
{
"valueString" : "Observation"
}
]
},
{
"context" : "immunization",
"contextType" : "variable",
"element" : "reasonReference",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Observation/' + %observation.id"
}
]
}
],
"rule" : [
{
"name" : "observation",
"source" : [
{
"context" : "obs"
}
],
"dependent" : [
{
"name" : "Observation1",
"variable" : [
"entrirel4",
"patient",
"tgt",
"bundle",
"enc",
"observation"
]
}
]
}
]
}
]
}
]
},
{
"name" : "entrirel2",
"source" : [
{
"context" : "substance",
"element" : "entryRelationship",
"variable" : "entrirel4"
}
],
"rule" : [
{
"name" : "obs",
"source" : [
{
"context" : "entrirel4",
"element" : "observation",
"variable" : "obs"
}
],
"rule" : [
{
"name" : "codeControl",
"source" : [
{
"context" : "obs",
"element" : "code",
"condition" : "(code = '31044-1')"
}
],
"target" : [
{
"context" : "bundle",
"contextType" : "variable",
"element" : "entry",
"variable" : "e1"
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "request",
"variable" : "request",
"transform" : "create",
"parameter" : [
{
"valueString" : "BackboneElement"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "method",
"transform" : "copy",
"parameter" : [
{
"valueString" : "POST"
}
]
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "resource",
"variable" : "observation",
"transform" : "create",
"parameter" : [
{
"valueString" : "Observation"
}
]
},
{
"context" : "observation",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid1",
"transform" : "uuid"
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "https://example/Observation/"
},
{
"valueId" : "uuid1"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "url",
"transform" : "copy",
"parameter" : [
{
"valueString" : "Observation"
}
]
},
{
"context" : "immunization",
"contextType" : "variable",
"element" : "reasonReference",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Observation/' + %observation.id"
}
]
}
],
"rule" : [
{
"name" : "observation",
"source" : [
{
"context" : "obs"
}
],
"dependent" : [
{
"name" : "Observation1",
"variable" : [
"entrirel4",
"patient",
"tgt",
"bundle",
"enc",
"observation"
]
}
]
}
]
}
]
}
]
}
]
},
{
"name" : "sub2",
"source" : [
{
"context" : "substance",
"element" : "templateId",
"condition" : "(root = '2.16.840.1.113883.2.9.10.1.11.4.2')"
}
],
"target" : [
{
"context" : "bundle",
"contextType" : "variable",
"element" : "entry",
"variable" : "e1"
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "request",
"variable" : "request",
"transform" : "create",
"parameter" : [
{
"valueString" : "BackboneElement"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "method",
"transform" : "copy",
"parameter" : [
{
"valueString" : "POST"
}
]
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "resource",
"variable" : "immunization",
"transform" : "create",
"parameter" : [
{
"valueString" : "Immunization"
}
]
},
{
"context" : "immunization",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid1",
"transform" : "uuid"
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "https://example/Immunization/"
},
{
"valueId" : "uuid1"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "url",
"transform" : "copy",
"parameter" : [
{
"valueString" : "Immunization"
}
]
},
{
"context" : "tgt",
"contextType" : "variable",
"element" : "entry",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Immunization/' + %immunization.id"
}
]
}
],
"rule" : [
{
"name" : "patientRef",
"source" : [
{
"context" : "substance"
}
],
"target" : [
{
"context" : "immunization",
"contextType" : "variable",
"element" : "patient",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Patient/' + %patient.id"
}
]
}
]
},
{
"name" : "statusCode",
"source" : [
{
"context" : "substance",
"element" : "statusCode",
"variable" : "statusc",
"condition" : "(code = 'completed')"
}
],
"target" : [
{
"context" : "immunization",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "completed"
}
]
}
],
"documentation" : "substance.templateId as tid -> immunization.identifier as idf then{"
},
{
"name" : "statusCode",
"source" : [
{
"context" : "substance",
"element" : "statusCode",
"variable" : "statusc",
"condition" : "(code = 'aborted')"
}
],
"target" : [
{
"context" : "immunization",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "final"
}
]
}
]
},
{
"name" : "statusCode",
"source" : [
{
"context" : "substance",
"element" : "statusCode",
"variable" : "statusc",
"condition" : "(code = 'suspended')"
}
],
"target" : [
{
"context" : "immunization",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "enterer-in-error"
}
]
}
]
},
{
"name" : "statusCode",
"source" : [
{
"context" : "substance",
"element" : "statusCode",
"variable" : "statusc",
"condition" : "(code = 'cancelled')"
}
],
"target" : [
{
"context" : "immunization",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "not-done"
}
]
}
]
},
{
"name" : "value1",
"source" : [
{
"context" : "substance",
"element" : "effectiveTime",
"variable" : "eff",
"condition" : "(value.exists())"
}
],
"target" : [
{
"context" : "immunization",
"contextType" : "variable",
"element" : "occurrence",
"variable" : "value",
"transform" : "create",
"parameter" : [
{
"valueString" : "dateTime"
}
]
}
],
"dependent" : [
{
"name" : "TSDateTime",
"variable" : [
"eff",
"value"
]
}
]
},
{
"name" : "valuePeriod",
"source" : [
{
"context" : "substance",
"element" : "effectiveTime",
"variable" : "eff",
"condition" : "(low.exists())"
}
],
"target" : [
{
"context" : "immunization",
"contextType" : "variable",
"element" : "occurrence",
"variable" : "value",
"transform" : "create",
"parameter" : [
{
"valueString" : "Period"
}
]
}
],
"dependent" : [
{
"name" : "IVLTSPeriod",
"variable" : [
"eff",
"value"
]
}
]
},
{
"name" : "cons",
"source" : [
{
"context" : "substance",
"element" : "consumable",
"variable" : "cons"
}
],
"rule" : [
{
"name" : "manufact",
"source" : [
{
"context" : "cons",
"element" : "manufacturedProduct",
"variable" : "manufact"
}
],
"rule" : [
{
"name" : "manufactmat",
"source" : [
{
"context" : "manufact",
"element" : "manufacturedMaterial",
"variable" : "manufactmat"
}
],
"rule" : [
{
"name" : "code",
"source" : [
{
"context" : "manufactmat",
"element" : "code",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "immunization",
"contextType" : "variable",
"element" : "vaccineCode",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "lotNumberText",
"source" : [
{
"context" : "manufactmat",
"element" : "lotNumberText",
"variable" : "t"
}
],
"target" : [
{
"context" : "immunization",
"contextType" : "variable",
"element" : "lotNumber",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "t.dataString"
}
]
}
]
}
]
},
{
"name" : "manufactOrg",
"source" : [
{
"context" : "manufact",
"element" : "manufacturerOrganization",
"variable" : "manufactOrg"
}
],
"target" : [
{
"context" : "bundle",
"contextType" : "variable",
"element" : "entry",
"variable" : "e1"
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "request",
"variable" : "request",
"transform" : "create",
"parameter" : [
{
"valueString" : "BackboneElement"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "method",
"transform" : "copy",
"parameter" : [
{
"valueString" : "PUT"
}
]
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "resource",
"variable" : "organization",
"transform" : "create",
"parameter" : [
{
"valueString" : "Organization"
}
]
}
],
"rule" : [
{
"name" : "meta",
"source" : [
{
"context" : "manufactOrg"
}
],
"target" : [
{
"context" : "organization",
"contextType" : "variable",
"element" : "meta",
"variable" : "meta"
}
],
"rule" : [
{
"name" : "coding",
"source" : [
{
"context" : "manufactOrg"
}
],
"target" : [
{
"context" : "meta",
"contextType" : "variable",
"element" : "tag",
"variable" : "coding",
"transform" : "create",
"parameter" : [
{
"valueString" : "Coding"
}
]
}
],
"rule" : [
{
"name" : "system",
"source" : [
{
"context" : "manufactOrg"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "system",
"transform" : "copy",
"parameter" : [
{
"valueString" : "http://algoritmodiscoring"
}
]
}
]
},
{
"name" : "code",
"source" : [
{
"context" : "manufactOrg"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "code",
"transform" : "copy",
"parameter" : [
{
"valueString" : "ClinicalDocument/body/manufacturerOrganization"
}
]
}
]
}
]
}
]
},
{
"name" : "identifier",
"source" : [
{
"context" : "manufactOrg",
"element" : "id",
"variable" : "id"
}
],
"target" : [
{
"context" : "organization2",
"contextType" : "variable",
"element" : "identifier",
"variable" : "identifier"
}
],
"rule" : [
{
"name" : "root1",
"source" : [
{
"context" : "id",
"element" : "root",
"variable" : "r"
}
],
"target" : [
{
"context" : "identifier",
"contextType" : "variable",
"element" : "system",
"transform" : "translate",
"parameter" : [
{
"valueId" : "r"
},
{
"valueString" : "http://hl7.org/fhir/ConceptMap/special-oid2uri"
},
{
"valueString" : "uri"
}
]
}
]
},
{
"name" : "ext",
"source" : [
{
"context" : "id",
"element" : "extension",
"variable" : "ext"
}
],
"target" : [
{
"context" : "identifier",
"contextType" : "variable",
"element" : "value",
"transform" : "copy",
"parameter" : [
{
"valueId" : "ext"
}
]
}
],
"rule" : [
{
"name" : "UUID",
"source" : [
{
"context" : "manufactOrg"
}
],
"target" : [
{
"context" : "request",
"contextType" : "variable",
"element" : "url",
"transform" : "append",
"parameter" : [
{
"valueString" : "Organization?identifier="
},
{
"valueId" : "ext"
}
]
}
]
}
]
},
{
"name" : "assigningAuthorityName",
"source" : [
{
"context" : "id",
"element" : "assigningAuthorityName",
"variable" : "s"
}
],
"target" : [
{
"context" : "identifier",
"contextType" : "variable",
"element" : "assigner",
"variable" : "a"
},
{
"context" : "a",
"contextType" : "variable",
"element" : "display",
"transform" : "copy",
"parameter" : [
{
"valueId" : "s"
}
]
}
]
},
{
"name" : "r",
"source" : [
{
"context" : "id",
"element" : "root",
"variable" : "r"
}
],
"rule" : [
{
"name" : "org",
"source" : [
{
"context" : "id",
"element" : "extension",
"variable" : "ext"
}
],
"target" : [
{
"context" : "organization1",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid23",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "r + '-' + ext"
}
]
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "https://example/Organization/"
},
{
"valueId" : "uuid23"
}
]
},
{
"context" : "immunization",
"contextType" : "variable",
"element" : "manufacturer",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Organization/' + %uuid23"
}
]
}
]
}
]
}
]
},
{
"name" : "name",
"source" : [
{
"context" : "manufactOrg",
"element" : "name",
"variable" : "n"
}
],
"target" : [
{
"context" : "organization",
"contextType" : "variable",
"element" : "name",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "n.other"
}
]
}
]
}
]
}
]
}
]
},
{
"name" : "protocolAp",
"source" : [
{
"context" : "cda"
}
],
"target" : [
{
"context" : "immunization",
"contextType" : "variable",
"element" : "protocolApplied",
"variable" : "prot"
}
],
"rule" : [
{
"name" : "entrirel4",
"source" : [
{
"context" : "substance",
"element" : "entryRelationship",
"variable" : "entrirel4"
}
],
"rule" : [
{
"name" : "entrirel2",
"source" : [
{
"context" : "entrirel4",
"element" : "observation",
"variable" : "obs"
}
],
"rule" : [
{
"name" : "codeControl",
"source" : [
{
"context" : "obs",
"element" : "code",
"condition" : "(code = '75323-6')"
}
],
"rule" : [
{
"name" : "value",
"source" : [
{
"context" : "obs",
"element" : "value",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "prot",
"contextType" : "variable",
"element" : "targetDisease",
"variable" : "vvv",
"transform" : "create"
}
]
}
]
}
]
},
{
"name" : "entrirel2",
"source" : [
{
"context" : "entrirel4",
"element" : "observation",
"variable" : "obsdosenumber"
}
],
"rule" : [
{
"name" : "codeControl",
"source" : [
{
"context" : "obsdosenumber",
"element" : "code",
"condition" : "(code = '30973-2')"
}
],
"rule" : [
{
"name" : "v",
"source" : [
{
"context" : "obsdosenumber",
"element" : "value",
"variable" : "v"
}
],
"rule" : [
{
"name" : "value",
"source" : [
{
"context" : "v",
"element" : "value",
"variable" : "int"
}
],
"target" : [
{
"context" : "prot",
"contextType" : "variable",
"element" : "doseNumber",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "int.toString()"
}
]
}
]
}
]
}
]
}
]
}
]
}
]
},
{
"name" : "entrirel1",
"source" : [
{
"context" : "substance",
"element" : "entryRelationship",
"variable" : "entrirel1"
}
],
"rule" : [
{
"name" : "obs",
"source" : [
{
"context" : "entrirel1",
"element" : "observation",
"variable" : "obs"
}
],
"rule" : [
{
"name" : "codeControl",
"source" : [
{
"context" : "obs",
"element" : "code",
"condition" : "(code = '85714-4')"
}
],
"rule" : [
{
"name" : "code",
"source" : [
{
"context" : "obs",
"element" : "code",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "immunization",
"contextType" : "variable",
"element" : "statusReason",
"variable" : "vvv",
"transform" : "create"
}
]
}
]
},
{
"name" : "codeControl",
"source" : [
{
"context" : "obs",
"element" : "code",
"condition" : "(code = '59784-9')"
}
],
"rule" : [
{
"name" : "val",
"source" : [
{
"context" : "obs",
"element" : "value",
"variable" : "val"
}
],
"rule" : [
{
"name" : "cod",
"source" : [
{
"context" : "val",
"element" : "originalText",
"variable" : "original"
}
],
"target" : [
{
"context" : "immunization",
"contextType" : "variable",
"element" : "statusReason",
"variable" : "cod",
"transform" : "create",
"parameter" : [
{
"valueString" : "CodeableConcept"
}
]
}
],
"rule" : [
{
"name" : "reference",
"source" : [
{
"context" : "original",
"element" : "reference",
"variable" : "reff"
}
],
"target" : [
{
"context" : "cod",
"contextType" : "variable",
"element" : "text",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "reff.value"
}
]
}
]
}
]
}
]
}
]
}
]
}
]
},
{
"name" : "location",
"source" : [
{
"context" : "substance",
"element" : "participant",
"variable" : "part"
}
],
"target" : [
{
"context" : "bundle",
"contextType" : "variable",
"element" : "entry",
"variable" : "e1"
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "request",
"variable" : "request",
"transform" : "create",
"parameter" : [
{
"valueString" : "BackboneElement"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "method",
"transform" : "copy",
"parameter" : [
{
"valueString" : "PUT"
}
]
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "resource",
"variable" : "location",
"transform" : "create",
"parameter" : [
{
"valueString" : "Location"
}
]
}
],
"rule" : [
{
"name" : "meta",
"source" : [
{
"context" : "part"
}
],
"target" : [
{
"context" : "location",
"contextType" : "variable",
"element" : "meta",
"variable" : "meta"
}
],
"rule" : [
{
"name" : "coding",
"source" : [
{
"context" : "part"
}
],
"target" : [
{
"context" : "meta",
"contextType" : "variable",
"element" : "tag",
"variable" : "coding",
"transform" : "create",
"parameter" : [
{
"valueString" : "Coding"
}
]
}
],
"rule" : [
{
"name" : "system",
"source" : [
{
"context" : "part"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "system",
"transform" : "copy",
"parameter" : [
{
"valueString" : "http://algoritmodiscoring"
}
]
}
]
},
{
"name" : "code",
"source" : [
{
"context" : "part"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "code",
"transform" : "copy",
"parameter" : [
{
"valueString" : "ClinicalDocument/body/participant"
}
]
}
]
}
]
}
]
},
{
"name" : "role",
"source" : [
{
"context" : "part",
"element" : "participantRole",
"variable" : "partRole"
}
],
"rule" : [
{
"name" : "identifier",
"source" : [
{
"context" : "partRole",
"element" : "id",
"variable" : "id"
}
],
"target" : [
{
"context" : "location",
"contextType" : "variable",
"element" : "identifier",
"variable" : "identifier"
}
],
"rule" : [
{
"name" : "root1",
"source" : [
{
"context" : "id",
"element" : "root",
"variable" : "r"
}
],
"target" : [
{
"context" : "identifier",
"contextType" : "variable",
"element" : "system",
"transform" : "translate",
"parameter" : [
{
"valueId" : "r"
},
{
"valueString" : "http://hl7.org/fhir/ConceptMap/special-oid2uri"
},
{
"valueString" : "uri"
}
]
}
]
},
{
"name" : "ext",
"source" : [
{
"context" : "id",
"element" : "extension",
"variable" : "ext"
}
],
"target" : [
{
"context" : "identifier",
"contextType" : "variable",
"element" : "value",
"transform" : "copy",
"parameter" : [
{
"valueId" : "ext"
}
]
}
],
"rule" : [
{
"name" : "UUID",
"source" : [
{
"context" : "ext"
}
],
"target" : [
{
"context" : "request",
"contextType" : "variable",
"element" : "url",
"transform" : "append",
"parameter" : [
{
"valueString" : "Location?identifier="
},
{
"valueId" : "ext"
}
]
}
]
}
]
},
{
"name" : "assigningAuthorityName",
"source" : [
{
"context" : "id",
"element" : "assigningAuthorityName",
"variable" : "s"
}
],
"target" : [
{
"context" : "identifier",
"contextType" : "variable",
"element" : "assigner",
"variable" : "a"
},
{
"context" : "a",
"contextType" : "variable",
"element" : "display",
"transform" : "copy",
"parameter" : [
{
"valueId" : "s"
}
]
}
]
},
{
"name" : "r",
"source" : [
{
"context" : "id",
"element" : "root",
"variable" : "r"
}
],
"rule" : [
{
"name" : "ref",
"source" : [
{
"context" : "id",
"element" : "extension",
"variable" : "ext"
}
],
"target" : [
{
"context" : "location",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid7",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "r + '-' + ext"
}
]
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "https://example/Location/"
},
{
"valueId" : "uuid7"
}
]
},
{
"context" : "immunization",
"contextType" : "variable",
"element" : "location",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Location/' + %uuid7"
}
]
}
]
}
]
}
]
}
]
}
]
}
]
}
]
}
]
}
]
},
{
"name" : "Observation",
"typeMode" : "none",
"input" : [
{
"name" : "entrirel2",
"type" : "entryRelationship",
"mode" : "source"
},
{
"name" : "patient",
"type" : "Patient",
"mode" : "target"
},
{
"name" : "tgt",
"mode" : "target"
},
{
"name" : "bundle",
"type" : "Bundle",
"mode" : "target"
},
{
"name" : "enc",
"type" : "Encounter",
"mode" : "target"
},
{
"name" : "obs",
"type" : "Observation",
"mode" : "target"
}
],
"rule" : [
{
"name" : "obs",
"source" : [
{
"context" : "entrirel2",
"element" : "observation",
"variable" : "observation"
}
],
"rule" : [
{
"name" : "code",
"source" : [
{
"context" : "observation",
"element" : "code",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "obs",
"contextType" : "variable",
"element" : "code",
"variable" : "vvv",
"transform" : "create"
}
],
"documentation" : "observation.templateId as tid -> obs.identifier as idf then{"
},
{
"name" : "statusCode",
"source" : [
{
"context" : "observation",
"element" : "statusCode",
"variable" : "statusc",
"condition" : "(code = 'completed')"
}
],
"target" : [
{
"context" : "obs",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "final"
}
]
}
]
},
{
"name" : "statusCode",
"source" : [
{
"context" : "observation",
"element" : "statusCode",
"variable" : "statusc",
"condition" : "(code = 'active')"
}
],
"target" : [
{
"context" : "obs",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "registered"
}
]
}
]
},
{
"name" : "statusCode",
"source" : [
{
"context" : "observation",
"element" : "statusCode",
"variable" : "statusc",
"condition" : "(code = 'aborted')"
}
],
"target" : [
{
"context" : "obs",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "cancelled"
}
]
}
]
},
{
"name" : "statusCode",
"source" : [
{
"context" : "observation",
"element" : "statusCode",
"variable" : "statusc",
"condition" : "(code = 'suspended')"
}
],
"target" : [
{
"context" : "obs",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "partial"
}
]
}
]
},
{
"name" : "reference",
"source" : [
{
"context" : "observation"
}
],
"target" : [
{
"context" : "obs",
"contextType" : "variable",
"element" : "subject",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Patient/' + %patient.id"
}
]
}
]
},
{
"name" : "reference",
"source" : [
{
"context" : "observation"
}
],
"target" : [
{
"context" : "obs",
"contextType" : "variable",
"element" : "encounter",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Encounter/' + %enc.id"
}
]
}
]
},
{
"name" : "refRange",
"source" : [
{
"context" : "observation"
}
],
"target" : [
{
"context" : "obs",
"contextType" : "variable",
"element" : "referenceRange",
"variable" : "refRange"
}
],
"rule" : [
{
"name" : "value",
"source" : [
{
"context" : "observation",
"element" : "value",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "refRange",
"contextType" : "variable",
"element" : "appliesTo",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "text",
"source" : [
{
"context" : "observation"
}
],
"target" : [
{
"context" : "refRange",
"contextType" : "variable",
"element" : "text",
"transform" : "copy",
"parameter" : [
{
"valueString" : "string"
}
]
}
]
}
]
}
]
}
]
},
{
"name" : "Observation1",
"typeMode" : "none",
"input" : [
{
"name" : "entrirel4",
"type" : "entryRelationship",
"mode" : "source"
},
{
"name" : "patient",
"type" : "Patient",
"mode" : "target"
},
{
"name" : "tgt",
"mode" : "target"
},
{
"name" : "bundle",
"type" : "Bundle",
"mode" : "target"
},
{
"name" : "enc",
"type" : "Encounter",
"mode" : "target"
},
{
"name" : "obs",
"type" : "Observation",
"mode" : "target"
}
],
"rule" : [
{
"name" : "obs",
"source" : [
{
"context" : "entrirel4",
"element" : "observation",
"variable" : "observation"
}
],
"rule" : [
{
"name" : "code",
"source" : [
{
"context" : "observation",
"element" : "code",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "obs",
"contextType" : "variable",
"element" : "code",
"variable" : "vvv",
"transform" : "create"
}
],
"documentation" : "observation.templateId as tid -> obs.identifier as idf then{"
},
{
"name" : "statusCode",
"source" : [
{
"context" : "observation",
"element" : "statusCode",
"variable" : "statusc",
"condition" : "(code = 'completed')"
}
],
"target" : [
{
"context" : "obs",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "final"
}
]
}
]
},
{
"name" : "statusCode",
"source" : [
{
"context" : "observation",
"element" : "statusCode",
"variable" : "statusc",
"condition" : "(code = 'active')"
}
],
"target" : [
{
"context" : "obs",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "registered"
}
]
}
]
},
{
"name" : "statusCode",
"source" : [
{
"context" : "observation",
"element" : "statusCode",
"variable" : "statusc",
"condition" : "(code = 'aborted')"
}
],
"target" : [
{
"context" : "obs",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "cancelled"
}
]
}
]
},
{
"name" : "statusCode",
"source" : [
{
"context" : "observation",
"element" : "statusCode",
"variable" : "statusc",
"condition" : "(code = 'suspended')"
}
],
"target" : [
{
"context" : "obs",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "partial"
}
]
}
]
},
{
"name" : "reference",
"source" : [
{
"context" : "observation"
}
],
"target" : [
{
"context" : "obs",
"contextType" : "variable",
"element" : "subject",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Patient/' + %patient.id"
}
]
}
]
},
{
"name" : "reference",
"source" : [
{
"context" : "observation"
}
],
"target" : [
{
"context" : "obs",
"contextType" : "variable",
"element" : "encounter",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Encounter/' + %enc.id"
}
]
}
]
},
{
"name" : "value1",
"source" : [
{
"context" : "observation",
"element" : "effectiveTime",
"variable" : "eff",
"condition" : "(value.exists())"
}
],
"target" : [
{
"context" : "obs",
"contextType" : "variable",
"element" : "effective",
"variable" : "value",
"transform" : "create",
"parameter" : [
{
"valueString" : "dateTime"
}
]
}
],
"dependent" : [
{
"name" : "TSDateTime",
"variable" : [
"eff",
"value"
]
}
]
},
{
"name" : "period",
"source" : [
{
"context" : "observation",
"element" : "effectiveTime",
"variable" : "eff"
}
],
"target" : [
{
"context" : "obs",
"contextType" : "variable",
"element" : "effective",
"variable" : "period",
"transform" : "create",
"parameter" : [
{
"valueString" : "Period"
}
]
}
],
"dependent" : [
{
"name" : "IVLTSPeriod",
"variable" : [
"eff",
"period"
]
}
]
},
{
"name" : "refRange",
"source" : [
{
"context" : "observation"
}
],
"target" : [
{
"context" : "obs",
"contextType" : "variable",
"element" : "value",
"variable" : "concept",
"transform" : "create",
"parameter" : [
{
"valueString" : "CodeableConcept"
}
]
}
],
"rule" : [
{
"name" : "coding",
"source" : [
{
"context" : "observation",
"element" : "value"
}
],
"target" : [
{
"context" : "concept",
"contextType" : "variable",
"element" : "coding",
"variable" : "coding",
"transform" : "create",
"parameter" : [
{
"valueString" : "Coding"
}
]
}
],
"rule" : [
{
"name" : "value",
"source" : [
{
"context" : "observation",
"element" : "value",
"variable" : "v"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "code",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "v.code"
}
]
}
]
},
{
"name" : "vv",
"source" : [
{
"context" : "observation",
"element" : "value",
"variable" : "v"
}
],
"rule" : [
{
"name" : "codeSystem",
"source" : [
{
"context" : "v",
"element" : "codeSystem",
"variable" : "system"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "system",
"transform" : "translate",
"parameter" : [
{
"valueId" : "system"
},
{
"valueString" : "http://hl7.org/fhir/ConceptMap/special-oid2uri"
},
{
"valueString" : "uri"
}
]
}
]
}
]
},
{
"name" : "value",
"source" : [
{
"context" : "observation",
"element" : "value",
"variable" : "v"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "display",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "v.displayName"
}
]
}
]
}
]
},
{
"name" : "value",
"source" : [
{
"context" : "observation",
"element" : "value",
"variable" : "valu"
}
],
"rule" : [
{
"name" : "txt",
"source" : [
{
"context" : "valu",
"element" : "originalText",
"variable" : "txt"
}
],
"rule" : [
{
"name" : "reference",
"source" : [
{
"context" : "txt",
"element" : "reference",
"variable" : "ref"
}
],
"target" : [
{
"context" : "concept",
"contextType" : "variable",
"element" : "text",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "ref.value"
}
]
}
]
}
]
}
]
}
]
}
]
}
]
}
]
}