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 - TTL Representation

Draft as of 2025-10-01

Raw ttl | Download

    @prefix fhir: <http://hl7.org/fhir/> .
    @prefix owl: <http://www.w3.org/2002/07/owl#> .
    @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
    @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
    @prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

    # - resource -------------------------------------------------------------------

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