CDA to FHIR Maps
0.1.0 - ci-build

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

## : CDA to FHIR - VAC - JSON Representation

Draft as of 2025-10-01

Raw json | Download

    {
      "resourceType" : "StructureMap",
      "id" : "cda2fhirVaccination",
      "text" : {
        "status" : "generated",
        "div" : "<div xmlns=\"http://www.w3.org/1999/xhtml\">\n         <pre>map &quot;http://hl7.it/fhir/cda2fhir/StructureMap/cda2fhirVaccination&quot; = &quot;cda2fhirVaccination&quot;\n\nuses &quot;http://hl7.org/fhir/cda/StructureDefinition/ClinicalDocument&quot; alias ClinicalDocument as source\nuses &quot;http://hl7.org/fhir/cda/StructureDefinition/AssignedAuthor&quot; alias AssignedAuthor as queried\nuses &quot;http://hl7.org/fhir/cda/StructureDefinition/AssignedEntity&quot; alias AssignedEntity as queried\nuses &quot;http://hl7.org/fhir/cda/StructureDefinition/AssociatedEntity&quot; alias AssociatedEntity as queried\nuses &quot;http://hl7.org/fhir/cda/StructureDefinition/CustodianOrganization&quot; alias CustodianOrganization as queried\nuses &quot;http://hl7.org/fhir/cda/StructureDefinition/OrganizationPartOf&quot; alias OrganizationPartOf as queried\nuses &quot;http://hl7.org/fhir/cda/StructureDefinition/Organization&quot; alias rapresentedOrganization as queried\nuses &quot;http://hl7.org/fhir/cda/StructureDefinition/Section&quot; alias Section as queried\nuses &quot;http://hl7.org/fhir/cda/StructureDefinition/PatientRole&quot; alias PatientRole as queried\nuses &quot;http://hl7.org/fhir/cda/StructureDefinition/AD&quot; alias AD as source\nuses &quot;http://hl7.org/fhir/StructureDefinition/Bundle&quot; alias Bundle as target\nuses &quot;http://hl7.org/fhir/StructureDefinition/Composition&quot; alias Composition as produced\nuses &quot;http://hl7.org/fhir/StructureDefinition/Patient&quot; alias Patient as produced\nuses &quot;http://hl7.org/fhir/StructureDefinition/Encounter&quot; alias Encounter as produced\nuses &quot;http://hl7.org/fhir/StructureDefinition/Person&quot; alias Patient as produced\nuses &quot;http://hl7.org/fhir/StructureDefinition/Practitioner&quot; alias Practitioner as produced\nuses &quot;http://hl7.org/fhir/StructureDefinition/Organization&quot; alias Organization as produced\nuses &quot;http://hl7.org/fhir/cda/StructureDefinition/Act&quot; alias Act as produced\nuses &quot;http://hl7.org/fhir/cda/StructureDefinition/IVL-PQ&quot; alias IVL_PQ as source\nuses &quot;http://hl7.org/fhir/cda/StructureDefinition/PQ&quot; alias PQ as source\nuses &quot;http://hl7.org/fhir/StructureDefinition/SimpleQuantity&quot; alias SimpleQuantity as target\nuses &quot;http://hl7.org/fhir/StructureDefinition/Immunization&quot; alias Immunization as target\n\nimports &quot;http://hl7.it/fhir/cda2fhir/StructureMap/cda2fhirDataTypes&quot;\nimports &quot;http://hl7.it/fhir/cda2fhir/StructureMap/cda2fhirHeader&quot;\n\ngroup CdaToBundle(source cda : ClinicalDocument, target bundle : Bundle) {\n  cda -&gt;  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) &quot;cdatobundle&quot;;\n    cda.recordTarget as recordTarget then {\n      recordTarget.patientRole as patient then {\n        patient.id as id -&gt; patient.identifier as identifier then {\n          id.root as r -&gt; identifier.system = translate(r, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri') &quot;root1&quot;;\n          id.extension as ext1 -&gt; identifier.value = ext1 &quot;value&quot;;\n          id.assigningAuthorityName as s -&gt;  identifier.assigner as a,  a.display = s;\n        } &quot;idfr&quot;;\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 -&gt; requestPAT.url = append('Patient?identifier=', ext) &quot;UUID&quot;;\n        } &quot;ext&quot;;\n      } &quot;record&quot;;\n    } &quot;recPat&quot;;\n  } &quot;ClinicalDocumentToBody&quot;;\n}\n\ngroup ClinicalDocumentToBundle(source cda : ClinicalDocument, target patient : Patient, target composition : Composition, target encounter : Encounter, target bundle : Bundle, target DocumentReference : DocumentReference) {\n  cda -&gt; encounter.status = 'finished' &quot;finished&quot;;\n  cda -&gt; encounter.class = create('Coding') as coding then {\n    cda -&gt; coding.code = 'AMB' &quot;amb&quot;;\n  } &quot;coding&quot;;\n  cda -&gt; bundle.id = uuid() &quot;id&quot;;\n  cda.id -&gt; bundle.identifier &quot;identifier&quot;;\n  cda -&gt; bundle.type = 'transaction' &quot;type&quot;;\n  cda -&gt; bundle.timestamp = (timestamp.now()) &quot;date&quot;;\n  cda then ClinicalDocumentComposition(cda, composition, patient, encounter, bundle, DocumentReference) &quot;composition&quot;;\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 -&gt; composition.section as tgtSection then ClinicalDocumentSection(cda, srcSection, patient, tgtSection, bundle, encounter) &quot;TerapiaFarmacologicaAllaDimissione&quot;;\n        };\n      };\n    } &quot;body&quot;;\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 -&gt; tgt.title = (t.dataString);\n  src.code -&gt; tgt.code;\n  src.text as cdaText -&gt; tgt.text as fhirText then {\n    cdaText -&gt; fhirText.status = 'generated' &quot;narrativeStatus&quot;;\n    cdaText as t -&gt; fhirText.div = t &quot;narrativeText&quot;;\n  } &quot;cdaText&quot;;\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') -&gt;  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 -&gt;  immunization.patient = create('Reference') as reference,  reference.reference = ('https://example/Patient/' + %patient.id) &quot;patientRef&quot;;\n        // substance.templateId as tid -&gt; immunization.identifier as idf then{\n        substance.statusCode as statusc where (code = 'completed') -&gt; immunization.status = 'completed';\n        substance.statusCode as statusc where (code = 'aborted') -&gt; immunization.status = 'final';\n        substance.statusCode as statusc where (code = 'suspended') -&gt; immunization.status = 'enterer-in-error';\n        substance.statusCode as statusc where (code = 'cancelled') -&gt; immunization.status = 'not-done';\n        substance.effectiveTime as eff where (value.exists()) -&gt; immunization.occurrence = create('dateTime') as value then TSDateTime(eff, value) &quot;value1&quot;;\n        substance.effectiveTime as eff where (low.exists()) -&gt; immunization.occurrence = create('Period') as value then IVLTSPeriod(eff, value) &quot;valuePeriod&quot;;\n        substance.routeCode -&gt; immunization.route &quot;route&quot;;\n        substance.approachSiteCode -&gt; immunization.site &quot;site&quot;;\n        substance -&gt; immunization.doseQuantity = create('SimpleQuantity') as quantity then {\n          substance.doseQuantity as q then {\n            q -&gt; quantity.value = (q.value) &quot;val&quot;;\n            q -&gt; quantity.unit = (q.unit) &quot;uni&quot;;\n          } &quot;qua&quot;;\n        } &quot;q&quot;;\n        substance.consumable as cons then {\n          cons.manufacturedProduct as manufact then {\n            manufact.manufacturedMaterial as manufactmat then {\n              manufactmat.code -&gt; immunization.vaccineCode;\n              manufactmat.lotNumberText as t -&gt; immunization.lotNumber = (t.dataString);\n            } &quot;manufactmat&quot;;\n            manufact.manufacturerOrganization as manufactOrg -&gt;  bundle.entry as e1,  e1.request = create('BackboneElement') as request,  request.method = 'PUT',  e1.resource = create('Organization') as organization then {\n              manufactOrg -&gt; organization.meta as meta then {\n                manufactOrg -&gt; meta.tag = create('Coding') as coding then {\n                  manufactOrg -&gt; coding.system = 'http://algoritmodiscoring' &quot;system&quot;;\n                  manufactOrg -&gt; coding.code = 'ClinicalDocument/body/manufacturerOrganization' &quot;code&quot;;\n                } &quot;coding&quot;;\n              } &quot;meta&quot;;\n              manufactOrg.id as id -&gt; organization.identifier as identifier then {\n                id.root as r -&gt; identifier.system = translate(r, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri') &quot;root1&quot;;\n                id.extension as ext -&gt; identifier.value = ext then {\n                  ext -&gt; request.url = append('Organization?identifier=', ext) &quot;UUID&quot;;\n                } &quot;ext&quot;;\n                id.assigningAuthorityName as s -&gt;  identifier.assigner as a,  a.display = s;\n                id.root as r then {\n                  id.extension as ext -&gt;  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                } &quot;r&quot;;\n              } &quot;identifier&quot;;\n              // manufactOrg.id as id then{\n              manufactOrg.name as n -&gt; organization.name = (n.other);\n            } &quot;manufactOrg&quot;;\n          } &quot;manufact&quot;;\n        } &quot;cons&quot;;\n        substance.participant as part -&gt;  bundle.entry as e1,  e1.request = create('BackboneElement') as request,  request.method = 'PUT',  e1.resource = create('Location') as location then {\n          part -&gt; location.meta as meta then {\n            part -&gt; meta.tag = create('Coding') as coding then {\n              part -&gt; coding.system = 'http://algoritmodiscoring' &quot;system&quot;;\n              part -&gt; coding.code = 'ClinicalDocument/body/participant' &quot;code&quot;;\n            } &quot;coding&quot;;\n          } &quot;meta&quot;;\n          part.participantRole as partRole then {\n            partRole.id as id -&gt; location.identifier as identifier then {\n              id.root as r -&gt; identifier.system = translate(r, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri') &quot;root1&quot;;\n              id.extension as ext -&gt; identifier.value = ext then {\n                ext -&gt; request.url = append('Location?identifier=', ext) &quot;UUID&quot;;\n              } &quot;ext&quot;;\n              id.assigningAuthorityName as s -&gt;  identifier.assigner as a,  a.display = s;\n              id.root as r then {\n                id.extension as ext -&gt;  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) &quot;ref&quot;;\n              } &quot;r&quot;;\n            } &quot;identifier&quot;;\n          } &quot;role&quot;;\n        } &quot;part&quot;;\n        cda -&gt; 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 -&gt; prot.targetDisease;\n              } &quot;codeControl&quot;;\n            } &quot;entrirel2&quot;;\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 -&gt; prot.doseNumber = (int.toString());\n                } &quot;v&quot;;\n              } &quot;codeControl&quot;;\n            } &quot;entrirel2&quot;;\n          } &quot;entrirel4&quot;;\n        } &quot;protocolAp&quot;;\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 -&gt; immunization.expirationDate = truncate(date, 10);\n                } &quot;da&quot;;\n              };\n            } &quot;codeControl&quot;;\n          } &quot;obs&quot;;\n        } &quot;entrirel2&quot;;\n        substance.entryRelationship as entrirel3 then {\n          entrirel3.observation as obs then {\n            obs.code where (code = '95715-9') -&gt;  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) &quot;observation&quot;;\n            } &quot;codeControl&quot;;\n          } &quot;obs&quot;;\n        } &quot;entrirel2&quot;;\n        substance.entryRelationship as entrirel4 then {\n          entrirel4.observation as obs then {\n            obs.code where (code = '59785-6') -&gt;  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) &quot;observation&quot;;\n            } &quot;codeControl&quot;;\n          } &quot;obs&quot;;\n        } &quot;entrirel2&quot;;\n        substance.entryRelationship as entrirel4 then {\n          entrirel4.observation as obs then {\n            obs.code where (code = '31044-1') -&gt;  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) &quot;observation&quot;;\n            } &quot;codeControl&quot;;\n          } &quot;obs&quot;;\n        } &quot;entrirel2&quot;;\n      } &quot;ControlloImmunization&quot;;\n      substance.templateId where (root = '2.16.840.1.113883.2.9.10.1.11.4.2') -&gt;  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 -&gt;  immunization.patient = create('Reference') as reference,  reference.reference = ('https://example/Patient/' + %patient.id) &quot;patientRef&quot;;\n        // substance.templateId as tid -&gt; immunization.identifier as idf then{\n        substance.statusCode as statusc where (code = 'completed') -&gt; immunization.status = 'completed';\n        substance.statusCode as statusc where (code = 'aborted') -&gt; immunization.status = 'final';\n        substance.statusCode as statusc where (code = 'suspended') -&gt; immunization.status = 'enterer-in-error';\n        substance.statusCode as statusc where (code = 'cancelled') -&gt; immunization.status = 'not-done';\n        substance.effectiveTime as eff where (value.exists()) -&gt; immunization.occurrence = create('dateTime') as value then TSDateTime(eff, value) &quot;value1&quot;;\n        substance.effectiveTime as eff where (low.exists()) -&gt; immunization.occurrence = create('Period') as value then IVLTSPeriod(eff, value) &quot;valuePeriod&quot;;\n        substance.consumable as cons then {\n          cons.manufacturedProduct as manufact then {\n            manufact.manufacturedMaterial as manufactmat then {\n              manufactmat.code -&gt; immunization.vaccineCode;\n              manufactmat.lotNumberText as t -&gt; immunization.lotNumber = (t.dataString);\n            } &quot;manufactmat&quot;;\n            manufact.manufacturerOrganization as manufactOrg -&gt;  bundle.entry as e1,  e1.request = create('BackboneElement') as request,  request.method = 'PUT',  e1.resource = create('Organization') as organization then {\n              manufactOrg -&gt; organization.meta as meta then {\n                manufactOrg -&gt; meta.tag = create('Coding') as coding then {\n                  manufactOrg -&gt; coding.system = 'http://algoritmodiscoring' &quot;system&quot;;\n                  manufactOrg -&gt; coding.code = 'ClinicalDocument/body/manufacturerOrganization' &quot;code&quot;;\n                } &quot;coding&quot;;\n              } &quot;meta&quot;;\n              manufactOrg.id as id -&gt; organization2.identifier as identifier then {\n                id.root as r -&gt; identifier.system = translate(r, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri') &quot;root1&quot;;\n                id.extension as ext -&gt; identifier.value = ext then {\n                  manufactOrg -&gt; request.url = append('Organization?identifier=', ext) &quot;UUID&quot;;\n                } &quot;ext&quot;;\n                id.assigningAuthorityName as s -&gt;  identifier.assigner as a,  a.display = s;\n                id.root as r then {\n                  id.extension as ext -&gt;  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) &quot;org&quot;;\n                } &quot;r&quot;;\n              } &quot;identifier&quot;;\n              manufactOrg.name as n -&gt; organization.name = (n.other);\n            } &quot;manufactOrg&quot;;\n          } &quot;manufact&quot;;\n        } &quot;cons&quot;;\n        cda -&gt; 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 -&gt; prot.targetDisease;\n              } &quot;codeControl&quot;;\n            } &quot;entrirel2&quot;;\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 -&gt; prot.doseNumber = (int.toString());\n                } &quot;v&quot;;\n              } &quot;codeControl&quot;;\n            } &quot;entrirel2&quot;;\n          } &quot;entrirel4&quot;;\n        } &quot;protocolAp&quot;;\n        substance.entryRelationship as entrirel1 then {\n          entrirel1.observation as obs then {\n            obs.code where (code = '85714-4') then {\n              obs.code -&gt; immunization.statusReason;\n            } &quot;codeControl&quot;;\n            obs.code where (code = '59784-9') then {\n              obs.value as val then {\n                val.originalText as original -&gt; immunization.statusReason = create('CodeableConcept') as cod then {\n                  original.reference as reff -&gt; cod.text = (reff.value);\n                } &quot;cod&quot;;\n              } &quot;val&quot;;\n            } &quot;codeControl&quot;;\n          } &quot;obs&quot;;\n        } &quot;entrirel1&quot;;\n        substance.participant as part -&gt;  bundle.entry as e1,  e1.request = create('BackboneElement') as request,  request.method = 'PUT',  e1.resource = create('Location') as location then {\n          part -&gt; location.meta as meta then {\n            part -&gt; meta.tag = create('Coding') as coding then {\n              part -&gt; coding.system = 'http://algoritmodiscoring' &quot;system&quot;;\n              part -&gt; coding.code = 'ClinicalDocument/body/participant' &quot;code&quot;;\n            } &quot;coding&quot;;\n          } &quot;meta&quot;;\n          part.participantRole as partRole then {\n            partRole.id as id -&gt; location.identifier as identifier then {\n              id.root as r -&gt; identifier.system = translate(r, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri') &quot;root1&quot;;\n              id.extension as ext -&gt; identifier.value = ext then {\n                ext -&gt; request.url = append('Location?identifier=', ext) &quot;UUID&quot;;\n              } &quot;ext&quot;;\n              id.assigningAuthorityName as s -&gt;  identifier.assigner as a,  a.display = s;\n              id.root as r then {\n                id.extension as ext -&gt;  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) &quot;ref&quot;;\n              } &quot;r&quot;;\n            } &quot;identifier&quot;;\n          } &quot;role&quot;;\n        } &quot;location&quot;;\n      } &quot;sub2&quot;;\n    } &quot;substance&quot;;\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 -&gt; obs.identifier as idf then{\n    observation.code -&gt; obs.code;\n    observation.statusCode as statusc where (code = 'completed') -&gt; obs.status = 'final';\n    observation.statusCode as statusc where (code = 'active') -&gt; obs.status = 'registered';\n    observation.statusCode as statusc where (code = 'aborted') -&gt; obs.status = 'cancelled';\n    observation.statusCode as statusc where (code = 'suspended') -&gt; obs.status = 'partial';\n    observation -&gt;  obs.subject = create('Reference') as reference,  reference.reference = ('https://example/Patient/' + %patient.id) &quot;reference&quot;;\n    observation -&gt;  obs.encounter = create('Reference') as reference,  reference.reference = ('https://example/Encounter/' + %enc.id) &quot;reference&quot;;\n    observation -&gt; obs.referenceRange as refRange then {\n      observation.value -&gt; refRange.appliesTo;\n      observation -&gt; refRange.text = 'string' &quot;text&quot;;\n    } &quot;refRange&quot;;\n  } &quot;obs&quot;;\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 -&gt; obs.identifier as idf then{\n    observation.code -&gt; obs.code;\n    observation.statusCode as statusc where (code = 'completed') -&gt; obs.status = 'final';\n    observation.statusCode as statusc where (code = 'active') -&gt; obs.status = 'registered';\n    observation.statusCode as statusc where (code = 'aborted') -&gt; obs.status = 'cancelled';\n    observation.statusCode as statusc where (code = 'suspended') -&gt; obs.status = 'partial';\n    observation -&gt;  obs.subject = create('Reference') as reference,  reference.reference = ('https://example/Patient/' + %patient.id) &quot;reference&quot;;\n    observation -&gt;  obs.encounter = create('Reference') as reference,  reference.reference = ('https://example/Encounter/' + %enc.id) &quot;reference&quot;;\n    observation.effectiveTime as eff where (value.exists()) -&gt; obs.effective = create('dateTime') as value then TSDateTime(eff, value) &quot;value1&quot;;\n    observation.effectiveTime as eff -&gt; obs.effective = create('Period') as period then IVLTSPeriod(eff, period) &quot;period&quot;;\n    observation -&gt; obs.value = create('CodeableConcept') as concept then {\n      observation.value -&gt; concept.coding = create('Coding') as coding then {\n        observation.value as v -&gt; coding.code = (v.code);\n        observation.value as v then {\n          v.codeSystem as system -&gt; coding.system = translate(system, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri');\n        } &quot;vv&quot;;\n        observation.value as v -&gt; coding.display = (v.displayName);\n      } &quot;coding&quot;;\n      observation.value as valu then {\n        valu.originalText as txt then {\n          txt.reference as ref -&gt; concept.text = (ref.value);\n        } &quot;txt&quot;;\n      };\n    } &quot;refRange&quot;;\n  } &quot;obs&quot;;\n}\n\n</pre>\n      </div>"
      },
      "url" : "http://hl7.it/fhir/cda2fhir/StructureMap/cda2fhirVaccination",
      "version" : "0.1.0",
      "name" : "cda2fhirVaccination",
      "status" : "draft",
      "date" : "2025-10-01T07:14:02+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"
                                    }
                                  ]
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ]
        }
      ]
    }