CDA to FHIR Maps
0.1.0 - ci-build IT

CDA to FHIR Maps - Local Development build (v0.1.0) built by the FHIR (HL7® FHIR® Standard) Build Tools. See the Directory of published versions

: CDA to FHIR - PSS - TTL Representation

Draft as of 2024-04-11

Raw ttl | Download

@prefix fhir: <http://hl7.org/fhir/> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@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 "cda2fhirPs"] ; # 
  fhir:text [
fhir:status [ fhir:v "generated" ] ;
fhir:div "<div xmlns=\"http://www.w3.org/1999/xhtml\">\n         <pre>map &quot;http://hl7.it/fhir/cda2fhir/StructureMap/cda2fhirPs&quot; = &quot;cda2fhirPs&quot;\n\nuses &quot;http://hl7.org/fhir/cda/StructureDefinition/ClinicalDocument&quot; alias ClinicalDocument as source\nuses &quot;http://hl7.org/fhir/cda/StructureDefinition/AssignedAuthor&quot; alias AssignedAuthor as queried\nuses &quot;http://hl7.org/fhir/cda/StructureDefinition/AssignedEntity&quot; alias AssignedEntity as queried\nuses &quot;http://hl7.org/fhir/cda/StructureDefinition/AssociatedEntity&quot; alias AssociatedEntity as queried\nuses &quot;http://hl7.org/fhir/cda/StructureDefinition/CustodianOrganization&quot; alias CustodianOrganization as queried\nuses &quot;http://hl7.org/fhir/cda/StructureDefinition/OrganizationPartOf&quot; alias OrganizationPartOf as queried\nuses &quot;http://hl7.org/fhir/cda/StructureDefinition/Organization&quot; alias rapresentedOrganization as queried\nuses &quot;http://hl7.org/fhir/cda/StructureDefinition/Section&quot; alias Section as queried\nuses &quot;http://hl7.org/fhir/cda/StructureDefinition/PatientRole&quot; alias PatientRole as queried\nuses &quot;http://hl7.org/fhir/cda/StructureDefinition/AD&quot; alias AD as source\nuses &quot;http://hl7.org/fhir/StructureDefinition/Bundle&quot; alias Bundle as target\nuses &quot;http://hl7.org/fhir/StructureDefinition/Composition&quot; alias Composition as produced\nuses &quot;http://hl7.org/fhir/StructureDefinition/Patient&quot; alias Patient as produced\nuses &quot;http://hl7.org/fhir/StructureDefinition/Encounter&quot; alias Encounter as produced\nuses &quot;http://hl7.org/fhir/StructureDefinition/Person&quot; alias Patient as produced\nuses &quot;http://hl7.org/fhir/StructureDefinition/List&quot; alias List as produced\nuses &quot;http://hl7.org/fhir/StructureDefinition/Practitioner&quot; alias Practitioner as produced\nuses &quot;http://hl7.org/fhir/StructureDefinition/Organization&quot; alias Organization as produced\nuses &quot;http://hl7.org/fhir/cda/StructureDefinition/Act&quot; alias Act as produced\nuses &quot;http://hl7.org/fhir/cda/StructureDefinition/IVL-PQ&quot; alias IVL_PQ as source\nuses &quot;http://hl7.org/fhir/cda/StructureDefinition/PQ&quot; alias PQ as source\nuses &quot;http://hl7.org/fhir/StructureDefinition/SimpleQuantity&quot; alias SimpleQuantity as target\n\nimports &quot;http://hl7.it/fhir/cda2fhir/StructureMap/cda2fhirDataTypes&quot;\nimports &quot;http://hl7.it/fhir/cda2fhir/StructureMap/cda2fhirHeader&quot;\n\ngroup CdaToBundle(source cda : ClinicalDocument, target bundle : Bundle) {\n  cda -&gt;  bundle.entry as e,  e.request = create('BackboneElement') as request,  request.method = 'POST',  e.resource = create('Composition') as composition,  composition.id = uuid() as uuid1,  e.fullUrl = append('https://example/Composition/', uuid1),  request.url = 'Composition',  bundle.entry as e2,  e2.request = create('BackboneElement') as requestPAT,  requestPAT.method = 'PUT',  e2.resource = create('Patient') as patient,  patient.id = uuid() as uuid2,  e2.fullUrl = append('https://example/Patient/', uuid2),  bundle.entry as e3,  e3.request = create('BackboneElement') as request,  request.method = 'POST',  e3.resource = create('Encounter') as encounter,  encounter.id = uuid() as uuid3,  e3.fullUrl = append('https://example/Encounter/', uuid3),  request.url = 'Encounter',  bundle.entry as e4,  e4.request = create('BackboneElement') as request,  request.method = 'POST',  e4.resource = create('DocumentReference') as DocumentReference,  DocumentReference.id = uuid() as uuid4,  e4.fullUrl = append('https://example/DocumentReference/', uuid4),  request.url = 'DocumentReference' then {\n    cda then ClinicalDocumentToBundle(cda, patient, composition, encounter, bundle, DocumentReference) &quot;cdatobundle&quot;;\n    cda.recordTarget as recordTarget then {\n      recordTarget.patientRole as patient then {\n        patient.id as id -&gt; patient.identifier as identifier then {\n          id.root as r -&gt; identifier.system = translate(r, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri') &quot;root1&quot;;\n          id.extension as ext1 -&gt; identifier.value = ext1 &quot;value&quot;;\n          id.assigningAuthorityName as s -&gt;  identifier.assigner as a,  a.display = s;\n        } &quot;idfr&quot;;\n        patient.id as id where (root = '2.16.840.1.113883.2.9.4.3.2') or (root = '2.16.840.1.113883.2.9.4.3.7') or (root = '2.16.840.1.113883.2.9.4.3.3') or (root = '2.16.840.1.113883.2.9.4.3.17') or (root = '2.16.840.1.113883.2.9.4.3.18') or (root = '2.16.840.1.113883.2.9.2.10.4.1.1') or (root = '2.16.840.1.113883.2.9.2.20.4.1.1') or (root = '2.16.840.1.113883.2.9.2.30.4.1.1') or (root = '2.16.840.1.113883.2.9.2.41.4.1.1') or (root = '2.16.840.1.113883.2.9.2.42.4.1.1') or (root = '2.16.840.1.113883.2.9.2.50.4.1.1') or (root = '2.16.840.1.113883.2.9.2.60.4.1.1') or (root = '2.16.840.1.113883.2.9.2.70.4.1.1') or (root = '2.16.840.1.113883.2.9.2.80.4.1.1') or (root = '2.16.840.1.113883.2.9.2.90.4.1.1') or (root = '2.16.840.1.113883.2.9.2.100.4.1.1') or (root = '2.16.840.1.113883.2.9.2.110.4.1.1') or (root = '2.16.840.1.113883.2.9.2.120.4.1.1') or (root = '2.16.840.1.113883.2.9.2.130.4.1.1') or (root = '2.16.840.1.113883.2.9.2.140.4.1.1') or (root = '2.16.840.1.113883.2.9.2.150.4.1.1') or (root = '2.16.840.1.113883.2.9.2.160.4.1.1') or (root = '2.16.840.1.113883.2.9.2.170.4.1.1') or (root = '2.16.840.1.113883.2.9.2.180.4.1.1') or (root = '2.16.840.1.113883.2.9.2.190.4.1.1') or (root = '2.16.840.1.113883.2.9.2.200.4.1.1') or (root = '2.16.840.1.113883.2.9.2.10.4.1') or (root = '2.16.840.1.113883.2.9.2.20.4.1') or (root = '2.16.840.1.113883.2.9.2.30.4.1') or (root = '2.16.840.1.113883.2.9.2.41.4.1') or (root = '2.16.840.1.113883.2.9.2.42.4.1') or (root = '2.16.840.1.113883.2.9.2.50.4.1') or (root = '2.16.840.1.113883.2.9.2.60.4.1') or (root = '2.16.840.1.113883.2.9.2.70.4.1') or (root = '2.16.840.1.113883.2.9.2.80.4.1') or (root = '2.16.840.1.113883.2.9.2.90.4.1') or (root = '2.16.840.1.113883.2.9.2.100.4.1') or (root = '2.16.840.1.113883.2.9.2.110.4.1') or (root = '2.16.840.1.113883.2.9.2.120.4.1') or (root = '2.16.840.1.113883.2.9.2.130.4.1') or (root = '2.16.840.1.113883.2.9.2.140.4.1') or (root = '2.16.840.1.113883.2.9.2.150.4.1') or (root = '2.16.840.1.113883.2.9.2.160.4.1') or (root = '2.16.840.1.113883.2.9.2.170.4.1') or (root = '2.16.840.1.113883.2.9.2.180.4.1') or (root = '2.16.840.1.113883.2.9.2.190.4.1') or (root = '2.16.840.1.113883.2.9.2.200.4.1') or (root = '2.16.840.1.113883.2.9.4.3.15') then {\n          id.extension as ext -&gt; requestPAT.url = append('Patient?identifier=', ext) &quot;UUID&quot;;\n        } &quot;ext&quot;;\n      } &quot;recPat&quot;;\n    } &quot;patient&quot;;\n  } &quot;ClinicalDocumentToBody&quot;;\n}\n\ngroup ClinicalDocumentToBundle(source cda : ClinicalDocument, target patient : Patient, target composition : Composition, target encounter : Encounter, target bundle : Bundle, target DocumentReference : DocumentReference) {\n  cda -&gt; encounter.status = 'finished' &quot;finished&quot;;\n  cda -&gt; encounter.class = create('Coding') as coding then {\n    cda -&gt; coding.code = 'summary' &quot;code&quot;;\n  } &quot;coding&quot;;\n  cda -&gt; bundle.id = uuid() &quot;id&quot;;\n  cda.id -&gt; bundle.identifier &quot;identifier&quot;;\n  cda -&gt; bundle.type = 'transaction' &quot;type&quot;;\n  // cda.effectiveTime -&gt; bundle.timestamp;\n  cda -&gt; bundle.timestamp = (timestamp.now()) &quot;date&quot;;\n  cda then ClinicalDocumentComposition(cda, composition, patient, encounter, bundle, DocumentReference) &quot;composition&quot;;\n  cda.component as component then {\n    component.structuredBody as body then {\n      body.component as component then {\n        component.section as srcSection then {\n          srcSection.code -&gt; composition.section as tgtSection then ClinicalDocumentSection(cda, srcSection, patient, tgtSection, bundle, encounter, composition);\n        };\n      };\n    } &quot;body&quot;;\n  } &quot;diagnostic&quot;;\n}\n\ngroup ClinicalDocumentSection(source cda : ClinicalDocument, source src : Section, target patient : Patient, target tgt, target bundle : Bundle, target enc : Encounter, target composition : Composition) {\n  src.title as t -&gt; tgt.title = (t.dataString);\n  src.code -&gt; tgt.code;\n  src.entry as entry then {\n    src.text as cdaText -&gt; tgt.text as fhirText then {\n      cdaText -&gt; fhirText.status = 'generated' &quot;narrativeStatus&quot;;\n      cdaText as t -&gt; fhirText.div = t &quot;narrativeText&quot;;\n    } &quot;cdaText&quot;;\n    // sezioni che sono strutturate\n    src.code where (code = '30954-2') then {\n      entry.organizer as organizer -&gt;  bundle.entry as e0,  e0.request = create('BackboneElement') as request,  request.method = 'POST',  e0.resource = create('DiagnosticReport') as dia,  dia.id = uuid() as uuid0,  e0.fullUrl = append('https://example/DiagnosticReport/', uuid0),  request.url = 'DiagnosticReport',  tgt.entry = create('Reference') as reference,  reference.reference = ('https://example/DiagnosticReport/' + %dia.id) then DiagnosticReportFunction(organizer, patient, enc, dia, bundle) &quot;diagnostic&quot;;\n    } &quot;entryObs&quot;;\n    src.code where (code = '29762-2') or (code = '10162-6') then {\n      entry.observation as observation -&gt;  bundle.entry as e1,  e1.request = create('BackboneElement') as request,  request.method = 'POST',  e1.resource = create('Observation') as obs1,  obs1.id = uuid() as uuid1,  e1.fullUrl = append('https://example/Observation/', uuid1),  request.url = 'Observation',  tgt.entry = create('Reference') as reference,  reference.reference = ('https://example/Observation/' + %obs1.id) then Observation(observation, patient, enc, obs1, bundle) &quot;obs1&quot;;\n    } &quot;entryObs&quot;;\n    src.code where (code = '8716-3') or (code = '47420-5') then {\n      entry.organizer as organizer -&gt;  bundle.entry as e2,  e2.request = create('BackboneElement') as request,  request.method = 'POST',  e2.resource = create('Observation') as obs2,  obs2.id = uuid() as uuid2,  e2.fullUrl = append('https://example/Observation/', uuid2),  request.url = 'Observation',  tgt.entry = create('Reference') as reference,  reference.reference = ('https://example/Observation/' + %obs2.id) then ObservationOrganizer(src, organizer, patient, enc, obs2, bundle) &quot;obs2&quot;;\n      entry.observation as organizer -&gt;  bundle.entry as e2,  e2.request = create('BackboneElement') as request,  request.method = 'POST',  e2.resource = create('Observation') as obs2,  obs2.id = uuid() as uuid2,  e2.fullUrl = append('https://example/Observation/', uuid2),  request.url = 'Observation',  tgt.entry = create('Reference') as reference,  reference.reference = ('https://example/Observation/' + %obs2.id) then ObservationOrganizer(src, organizer, patient, enc, obs2, bundle) &quot;obs2&quot;;\n    } &quot;organizer&quot;;\n    src.code where code = '11450-4' then {\n      entry.act as act -&gt;  bundle.entry as e3,  e3.request = create('BackboneElement') as request,  request.method = 'POST',  e3.resource = create('Condition') as condition,  condition.id = uuid() as uuid3,  e3.fullUrl = append('https://example/Condition/', uuid3),  request.url = 'Condition',  tgt.entry = create('Reference') as reference,  reference.reference = ('https://example/Condition/' + %condition.id) then ConditionFunction(act, condition, patient, enc, bundle) &quot;condition&quot;;\n    } &quot;listaDeiProblemi&quot;;\n    src.code where (code = '48765-2') then {\n      entry.act as act -&gt;  bundle.entry as e5,  e5.request = create('BackboneElement') as request,  request.method = 'POST',  e5.resource = create('AllergyIntolerance') as allergy,  allergy.id = uuid() as uuid5,  e5.fullUrl = append('https://example/AllergyIntolerance/', uuid5),  request.url = 'AllergyIntolerance',  tgt.entry = create('Reference') as reference,  reference.reference = ('https://example/AllergyIntolerance/' + %allergy.id) then allergyFunction(act, allergy, patient, enc) &quot;allergy&quot;;\n    } &quot;entryAct&quot;;\n    src.code where code = '10160-0' then {\n      entry.substanceAdministration as subAdmin -&gt;  bundle.entry as e6,  e6.request = create('BackboneElement') as request,  request.method = 'POST',  e6.resource = create('MedicationStatement') as medicationstatement,  medicationstatement.id = uuid() as uuid6,  e6.fullUrl = append('https://example/MedicationStatement/', uuid6),  request.url = 'MedicationStatement',  tgt.entry = create('Reference') as reference,  reference.reference = ('https://example/MedicationStatement/' + %medicationstatement.id) then MedicationStatement(subAdmin, medicationstatement, patient, enc, bundle) &quot;TerapiaFarmacologica&quot;;\n    } &quot;terapia&quot;;\n    src.code where code = '11369-6' then {\n      entry.substanceAdministration as subVACC -&gt;  bundle.entry as e7,  e7.request = create('BackboneElement') as request,  request.method = 'POST',  e7.resource = create('Immunization') as immunization,  immunization.id = uuid() as uuid7,  e7.fullUrl = append('https://example/Immunization/', uuid7),  request.url = 'Immunization',  tgt.entry = create('Reference') as reference,  reference.reference = ('https://example/Immunization/' + %immunization.id) then Immunization(subVACC, patient, enc, immunization, bundle) &quot;immunization&quot;;\n    } &quot;vacc&quot;;\n    src.code where code = '10157-6' then {\n      entry.organizer as organizer -&gt;  bundle.entry as e12,  e12.request = create('BackboneElement') as request,  request.method = 'POST',  e12.resource = create('FamilyMemberHistory') as familyMember,  familyMember.id = uuid() as uuid12,  e12.fullUrl = append('https://example/FamilyMemberHistory/', uuid12),  request.url = 'FamilyMemberHistory',  tgt.entry = create('Reference') as reference,  reference.reference = ('https://example/FamilyMemberHistory/' + %familyMember.id) then FamilyMemberFunction(organizer, familyMember, patient) &quot;family&quot;;\n    } &quot;family&quot;;\n    src.code where code = '46264-8' then {\n      entry.supply as supply -&gt;  bundle.entry as e8,  e8.request = create('BackboneElement') as request,  request.method = 'POST',  e8.resource = create('Procedure') as procedure,  procedure.id = uuid() as uuid8,  e8.fullUrl = append('https://example/Procedure/', uuid8),  request.url = 'Procedure',  tgt.entry = create('Reference') as reference,  reference.reference = ('https://example/Procedure/' + %procedure.id) then Procedure(supply, patient, enc, procedure, bundle) &quot;protesi&quot;;\n    } &quot;impianti&quot;;\n    src.code where code = '47519-4' then {\n      entry.procedure as procedure -&gt;  bundle.entry as e9,  e9.request = create('BackboneElement') as request,  request.method = 'POST',  e9.resource = create('Procedure') as procedure2,  procedure2.id = uuid() as uuid9,  e9.fullUrl = append('https://example/Procedure/', uuid9),  request.url = 'Procedure',  tgt.entry = create('Reference') as reference,  reference.reference = ('https://example/Procedure/' + %procedure2.id) then Procedure(procedure, patient, enc, procedure2, bundle) &quot;tratt&quot;;\n    } &quot;trattamentiProcedure&quot;;\n    src.code where code = '46240-8' then {\n      // entry.encounter as encounter -&gt; enc then{\n      entry.encounter as encounter -&gt;  bundle.entry as e9,  e9.request = create('BackboneElement') as request,  request.method = 'POST',  e9.resource = create('Encounter') as encounterF,  encounterF.id = uuid() as uuid9,  e9.fullUrl = append('https://example/Encounter/', uuid9),  request.url = 'Encounter',  tgt.entry = create('Reference') as reference,  reference.reference = ('https://example/Encounter/' + %encounterF.id) then EncounterFunction(encounter, patient, enc, encounterF, bundle);\n    } &quot;visiteRicoveri&quot;;\n    src.code where code = '57827-8' then {\n      entry.act as act -&gt;  bundle.entry as e13,  e13.request = create('BackboneElement') as request,  request.method = 'POST',  e13.resource = create('Coverage') as coverage,  coverage.id = uuid() as uuid13,  e13.fullUrl = append('https://example/Coverage/', uuid13),  request.url = 'Coverage',  tgt.entry = create('Reference') as reference,  reference.reference = ('https://example/Coverage/' + %coverage.id) then Coverage(act, patient, enc, coverage, bundle) &quot;esen&quot;;\n    } &quot;esenzioni&quot;;\n    src.code where code = 'PSSIT99' then {\n      entry.act as act -&gt;  bundle.entry as e14,  e14.request = create('BackboneElement') as request,  request.method = 'POST',  e14.resource = create('OrganizationAffiliation') as affiliation,  affiliation.id = uuid() as uuid14,  e14.fullUrl = append('https://example/OrganizationAffiliation/', uuid14),  request.url = 'OrganizationAffiliation',  tgt.entry = create('Reference') as reference,  reference.reference = ('https://example/OrganizationAffiliation/' + %affiliation.id) then OrganizationAffiliation(act, patient, enc, affiliation, bundle) &quot;OrgAffiliation&quot;;\n    } &quot;retiPatologia&quot;;\n  };\n  src where src.entry.exists() then {\n    src.code where code = '18776-5' then {\n      src -&gt;  bundle.entry as e11,  e11.request = create('BackboneElement') as request,  request.method = 'POST',  e11.resource = create('CarePlan') as careplan,  careplan.id = uuid() as uuid11,  e11.fullUrl = append('https://example/CarePlan/', uuid11),  request.url = 'CarePlan',  tgt.entry = create('Reference') as reference,  reference.reference = ('https://example/CarePlan/' + %careplan.id) then {\n        src.entry as entry then CarePlanFunction(entry, careplan, patient, enc, bundle) &quot;prestazioni&quot;;\n      } &quot;pianiCura&quot;;\n    } &quot;raccoglitore&quot;;\n  } &quot;esiste&quot;;\n  src where src.entry.exists().not() then {\n    // Anmanesi Familiare narrativa\n    src.code where code = '10157-6' then {\n      src.text as text -&gt;  bundle.entry as e12,  e12.request = create('BackboneElement') as request,  request.method = 'POST',  e12.resource = create('FamilyMemberHistory') as familyMember,  familyMember.id = uuid() as uuid12,  e12.fullUrl = append('https://example/FamilyMemberHistory/', uuid12),  request.url = 'FamilyMemberHistory',  tgt.entry = create('Reference') as reference,  reference.reference = ('https://example/FamilyMemberHistory/' + %familyMember.id) then {\n        src -&gt;  familyMember.patient = create('Reference') as reference,  reference.reference = ('https://example/Patient/' + %patient.id) &quot;reference&quot;;\n        src -&gt; familyMember.status = 'health-unknown' &quot;statusS&quot;;\n        text -&gt; familyMember.note as note then {\n          text as t -&gt; note.text = t &quot;reference&quot;;\n        } &quot;reference&quot;;\n        text -&gt; familyMember.relationship = create('CodeableConcept') as relation then {\n          text as txt -&gt; relation.text = txt &quot;text&quot;;\n        } &quot;medication&quot;;\n      } &quot;family&quot;;\n    } &quot;familyraccoglitore&quot;;\n    // Piano di cura narrativa\n    src.code where code = '18776-5' then {\n      src.text as text -&gt;  bundle.entry as e11,  e11.request = create('BackboneElement') as request,  request.method = 'POST',  e11.resource = create('CarePlan') as careplan,  careplan.id = uuid() as uuid11,  e11.fullUrl = append('https://example/CarePlan/', uuid11),  request.url = 'CarePlan',  tgt.entry = create('Reference') as reference,  reference.reference = ('https://example/CarePlan/' + %careplan.id) then {\n        src -&gt;  careplan.subject = create('Reference') as reference,  reference.reference = ('https://example/Patient/' + %patient.id) &quot;reference&quot;;\n        // src-&gt; careplan.encounter=create('Reference') as reference,  reference.reference = ('https://example/Encounter/' + %enc.id) &quot;reference&quot;;\n        src -&gt; careplan.status = 'active' &quot;status&quot;;\n        src -&gt; careplan.intent = 'order' &quot;intent&quot;;\n        text -&gt; careplan.note as note then {\n          text as t -&gt; note.text = t &quot;reference&quot;;\n        } &quot;reference&quot;;\n      } &quot;pianiCura&quot;;\n    } &quot;raccoglitore&quot;;\n    // sezioni che sono narrative\n    src.code where (code = '30954-2') or (code = '29762-2') or (code = '8716-3') or (code = '47420-5') or (code = '42348-3') then {\n      src.text as text -&gt;  bundle.entry as e13,  e13.request = create('BackboneElement') as request,  request.method = 'POST',  e13.resource = create('Observation') as obs1,  obs1.id = uuid() as uuid13,  e13.fullUrl = append('https://example/Observation/', uuid13),  request.url = 'Observation',  tgt.entry = create('Reference') as reference,  reference.reference = ('https://example/Observation/' + %obs1.id) then {\n        src -&gt;  obs1.subject = create('Reference') as reference,  reference.reference = ('https://example/Patient/' + %patient.id) &quot;reference&quot;;\n        // src -&gt; obs1.encounter=create('Reference') as reference,  reference.reference = ('https://example/Encounter/' + %enc.id) &quot;reference&quot;;\n        src -&gt; obs1.status = 'preliminary' &quot;obsst&quot;;\n        src.code -&gt; obs1.code &quot;obscde&quot;;\n        src -&gt; obs1.status = 'final' &quot;statusS&quot;;\n        text -&gt; obs1.note as note then {\n          text as t -&gt; note.text = create('string') as textNote then EDstring(t, textNote) &quot;note&quot;;\n        } &quot;narrative&quot;;\n      } &quot;txtsec&quot;;\n    } &quot;narrative&quot;;\n  } &quot;code&quot;;\n  src.component as component then {\n    component.section as sec -&gt; tgt.section as tgtSection then ClinicalDocumentSection(cda, sec, patient, tgtSection, bundle, enc, dReport);\n  };\n}\n\ngroup Procedure(source src : cdaElement, target patient : Patient, target encounter : Encounter, target tgt : Procedure, target bundle : Bundle) {\n  // toASK\n  src.text as tx -&gt; tgt.note as note then {\n    tx.reference as reff -&gt; note.text = (reff.value) &quot;r&quot;;\n  } &quot;tx&quot;;\n  src.templateId where root = '2.16.840.1.113883.2.9.10.1.4.3.10.3' then {\n    src.effectiveTime as effectiveTime -&gt; tgt.performed = (effectiveTime.value);\n    src.code -&gt; tgt.code;\n  } &quot;ref&quot;;\n  src -&gt;  tgt.subject = create('Reference') as reference,  reference.reference = ('https://example/Patient/' + %patient.id) &quot;reference&quot;;\n  // src -&gt; tgt.encounter=create('Reference') as reference,  reference.reference = ('https://example/Encounter/' + %encounter.id) &quot;reference&quot;;\n  src.statusCode as s then {\n    s.code as cos -&gt; tgt.status = translate(cos, '#EventStatus', 'code') &quot;codeS&quot;;\n  } &quot;status&quot;;\n  src where statusCode.exists().not() -&gt; tgt.status = 'unknown' &quot;status2&quot;;\n  src.templateId where root = '2.16.840.1.113883.2.9.10.1.4.3.9.1' then {\n    src -&gt;  bundle.entry as e1,  e1.request = create('BackboneElement') as request,  request.method = 'POST',  e1.resource = create('Device') as deviceRes,  deviceRes.id = uuid() as uuid1,  e1.fullUrl = append('https://example/Device/', uuid1),  request.url = 'Device',  tgt.usedReference = create('Reference') as reference,  reference.reference = ('https://example/Device/' + %deviceRes.id) then {\n      src -&gt;  deviceRes.patient = create('Reference') as reference,  reference.reference = ('https://example/Patient/' + %patient.id) &quot;reference&quot;;\n      src.code -&gt; deviceRes.type;\n    } &quot;device&quot;;\n    src.effectiveTime as effectiveTime where (value.exists()) -&gt; tgt.performed = create('dateTime') as value then TSDateTime(effectiveTime, value) &quot;value1&quot;;\n    src.effectiveTime as effectiveTime where (low.exists()) -&gt; tgt.performed = create('Period') as value then IVLTSPeriod(effectiveTime, value) &quot;valuePeriod&quot;;\n  } &quot;presenzaProtesiImpianto&quot;;\n  src.templateId where root = '2.16.840.1.113883.2.9.10.1.4.3.9.2' then {\n    src.code as code -&gt; tgt.note as note then {\n      code.displayName as displayName -&gt; note.text = (displayName) &quot;text&quot;;\n    } &quot;note&quot;;\n  } &quot;assenza&quot;;\n  src.templateId where root = '2.16.840.1.113883.2.9.10.1.4.3.11.1' then {\n    src.id -&gt; tgt.identifier;\n    src.code -&gt; tgt.code;\n    src.effectiveTime as effectiveTime where (value.exists()) -&gt; tgt.performed = create('dateTime') as value then TSDateTime(effectiveTime, value) &quot;value1&quot;;\n    src.effectiveTime as effectiveTime where (low.exists()) -&gt; tgt.performed = create('Period') as value then IVLTSPeriod(effectiveTime, value) &quot;valuePeriod&quot;;\n    src.entryRelationship as entryR then {\n      entryR.observation as observation -&gt;  bundle.entry as e3,  e3.request = create('BackboneElement') as request,  request.method = 'POST',  e3.resource = create('Observation') as obs1,  obs1.id = uuid() as uuid3,  e3.fullUrl = append('https://example/Observation/', uuid3),  request.url = 'Observation',  tgt.reasonReference = create('Reference') as reference,  reference.reference = ('https://example/Observation/' + %obs1.id) then Observation(observation, patient, encounter, obs1, bundle);\n    } &quot;entryRelProcedure&quot;;\n  } &quot;procedureTrattamenti&quot;;\n}\n\ngroup Observation(source cda, target patient : Patient, target encounter : Encounter, target ob : Observation, target bundle : Bundle) {\n  cda -&gt;  ob.subject = create('Reference') as reference,  reference.reference = ('https://example/Patient/' + %patient.id) &quot;reference&quot;;\n  // cda-&gt; ob.encounter=create('Reference') as reference,  reference.reference = ('https://example/Encounter/' + %encounter.id) &quot;reference&quot;;\n  cda.id -&gt; ob.identifier;\n  cda.code -&gt; ob.code;\n  cda -&gt; ob.status = 'final' &quot;Stats&quot;;\n  // value datatype\n  cda.value : ST as st -&gt;  ob.value = create('string'),  ob.value = (st.dataString);\n  cda.value : BL as boolean -&gt; ob.value = (boolean.value) &quot;boolean&quot;;\n  cda.value : INT as int -&gt; ob.value = (int.value) &quot;intval&quot;;\n  cda.value : CE as val then {\n    val -&gt; ob.value = create('CodeableConcept') as ce then {\n      val.originalText as originalText then {\n        originalText.reference as reference -&gt; ce.text = (reference.value);\n      };\n      val -&gt; ce.coding as coding then {\n        val.code as code -&gt; coding.code = cast(code, 'string');\n        val.codeSystem as system -&gt; coding.system = translate(system, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri');\n        val.displayName as display -&gt; coding.display = cast(display, 'string');\n      } &quot;code&quot;;\n      val.translation as translation -&gt; ce.coding as coding then {\n        translation.code as code -&gt; coding.code = cast(code, 'string');\n        translation.codeSystem as system -&gt; coding.system = translate(system, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri');\n        translation.displayName as display -&gt; coding.display = cast(display, 'string');\n        translation.qualifier as qualifier then {\n          qualifier.value as value -&gt; ce.coding as coding then {\n            value.code as code -&gt; coding.code = cast(code, 'string');\n            value.codeSystem as system -&gt; coding.system = translate(system, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri');\n            value.displayName as display -&gt; coding.display = cast(display, 'string');\n          };\n        };\n      };\n    } &quot;coding&quot;;\n  } &quot;val&quot;;\n  cda.value : CD as val then {\n    val -&gt; ob.value = create('CodeableConcept') as ce then {\n      val.originalText as originalText then {\n        originalText.reference as reference -&gt; ce.text = (reference.value);\n      };\n      val -&gt; ce.coding as coding then {\n        val.code as code -&gt; coding.code = cast(code, 'string');\n        val.codeSystem as system -&gt; coding.system = translate(system, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri');\n        val.displayName as display -&gt; coding.display = cast(display, 'string');\n      } &quot;code&quot;;\n      val.translation as translation -&gt; ce.coding as coding then {\n        translation.code as code -&gt; coding.code = cast(code, 'string');\n        translation.codeSystem as system -&gt; coding.system = translate(system, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri');\n        translation.displayName as display -&gt; coding.display = cast(display, 'string');\n        translation.qualifier as qualifier then {\n          qualifier.value as value -&gt; ce.coding as coding then {\n            value.code as code -&gt; coding.code = cast(code, 'string');\n            value.codeSystem as system -&gt; coding.system = translate(system, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri');\n            value.displayName as display -&gt; coding.display = cast(display, 'string');\n          };\n        };\n      };\n    } &quot;coding&quot;;\n  } &quot;val&quot;;\n  cda.value : PQ as val then {\n    val -&gt; ob.value = create('Quantity') as quantity then {\n      val.value as value -&gt; quantity.value = value;\n      val.unit as unit -&gt; quantity.unit = unit;\n    } &quot;quantity&quot;;\n  } &quot;valueQuantity&quot;;\n  cda.effectiveTime as effectiveTime where (value.exists()) -&gt; ob.effective = create('dateTime') as value then TSDateTime(effectiveTime, value) &quot;value1&quot;;\n  cda.effectiveTime as effectiveTime where (low.exists()) -&gt; ob.effective = create('Period') as value then IVLTSPeriod(effectiveTime, value) &quot;valuePeriod&quot;;\n  cda.text as text -&gt; ob.note as note then {\n    text.reference as reference -&gt; note.text = (reference.value) &quot;text&quot;;\n  } &quot;note&quot;;\n  cda.statusCode as s then {\n    s.code as cos -&gt; ob.status = translate(cos, '#OBSstatus', 'code') &quot;codeS&quot;;\n  } &quot;status&quot;;\n  // toASK è giusto siano invertiti?\n  cda.methodCode -&gt; ob.method;\n  cda.interpretationCode -&gt; ob.interpretation;\n  cda.targetSiteCode -&gt; ob.bodySite;\n  // added\n  cda.referenceRange as refrange then {\n    refrange.observationRange as obsrange then {\n      obsrange.value as val -&gt; ob.referenceRange = create('BackboneElement') as refrangeFH then {\n        val -&gt; refrangeFH.low = create('SimpleQuantity') as lowfhir then {\n          val.low as l -&gt; lowfhir.value = (l.value) &quot;val&quot;;\n          val.low as l -&gt; lowfhir.unit = (l.unit) &quot;val&quot;;\n        } &quot;de&quot;;\n        val -&gt; refrangeFH.high = create('SimpleQuantity') as highfhir then {\n          val.high as h -&gt; highfhir.value = (h.value) &quot;val&quot;;\n          val.high as h -&gt; highfhir.unit = (h.unit) &quot;val&quot;;\n        } &quot;de&quot;;\n      } &quot;refFhir&quot;;\n    } &quot;obsrange&quot;;\n  } &quot;regrange&quot;;\n}\n\ngroup ObservationOrganizer(source section : section, source cda : organizer, target patient : Patient, target encounter : Encounter, target ob : Observation, target bundle : Bundle) {\n  cda -&gt;  ob.subject = create('Reference') as reference,  reference.reference = ('https://example/Patient/' + %patient.id) &quot;reference&quot;;\n  // cda-&gt; ob.encounter=create('Reference') as reference,  reference.reference = ('https://example/Encounter/' + %encounter.id) &quot;reference&quot;;\n  cda.id -&gt; ob.identifier;\n  section.code -&gt; ob.code;\n  cda -&gt; ob.status = 'final' &quot;Stats&quot;;\n  cda.effectiveTime as effectiveTime where (value.exists()) -&gt; ob.effective = create('dateTime') as value then TSDateTime(effectiveTime, value) &quot;value1&quot;;\n  cda.effectiveTime as effectiveTime where (low.exists()) -&gt; ob.effective = create('Period') as value then IVLTSPeriod(effectiveTime, value) &quot;valuePeriod&quot;;\n  cda.text as text -&gt; ob.note as note then {\n    text.reference as reference -&gt; note.text = (reference.value) &quot;text&quot;;\n  } &quot;note&quot;;\n  cda.statusCode as s then {\n    s.code as cos -&gt; ob.status = translate(cos, '#OBSstatus', 'code') &quot;codeS&quot;;\n  } &quot;status&quot;;\n  cda.component as component then {\n    component.observation as observation -&gt;  bundle.entry as ei,  ei.request = create('BackboneElement') as request,  request.method = 'POST',  ei.resource = create('Observation') as obsi,  obsi.id = uuid() as uuidi,  ei.fullUrl = append('https://example/Observation/', uuidi),  request.url = 'Observation',  ob.hasMember = create('Reference') as reference,  reference.reference = ('https://example/Observation/' + %obsi.id) then Observation(observation, patient, encounter, obsi, bundle) &quot;hasMember&quot;;\n  };\n}\n\ngroup Coverage(source src : act, target patient : Patient, target encounter : Encounter, target tgt : Coverage, target bundle : Bundle) {\n  src -&gt;  tgt.beneficiary = create('Reference') as reference,  reference.reference = ('https://example/Patient/' + %patient.id) &quot;reference&quot;;\n  src -&gt;  tgt.payor = create('Reference') as reference,  reference.reference = ('https://example/Patient/' + %patient.id) &quot;reference&quot;;\n  src.id as id -&gt; tgt.identifier as idf then {\n    id -&gt; idf.value = (id.root) &quot;ID&quot;;\n  };\n  src.code -&gt; tgt.type;\n  src.statusCode as statusCode then {\n    statusCode.code as s -&gt; tgt.status = translate(s, '#FinancialStatus', 'code') &quot;status&quot;;\n  } &quot;sc&quot;;\n  src where statusCode.exists().not() -&gt; tgt.status = 'active' &quot;statusAbsent&quot;;\n  // src.effectiveTime as effectiveTime -&gt; tgt.period as period then{\n  src.effectiveTime as effectiveTime where (value.exists()) -&gt; tgt.period = create('dateTime') as value then TSDateTime(effectiveTime, value) &quot;value1&quot;;\n  src.effectiveTime as effectiveTime where (low.exists()) -&gt; tgt.period = create('Period') as value then IVLTSPeriod(effectiveTime, value) &quot;valuePeriod&quot;;\n  src.entryRelationship as entryRelationship then {\n    entryRelationship.act as ac -&gt; tgt.class as class then {\n      ac.text as text -&gt; class.type as type then {\n        text.reference as reference -&gt; type.text = (reference.value) &quot;value&quot;;\n      } &quot;ref&quot;;\n      ac -&gt; class.value = 'commenti' &quot;note&quot;;\n    } &quot;QUI&quot;;\n  } &quot;entryr&quot;;\n}\n\ngroup allergyFunction(source src : cdaElement, target tgt : AllergyIntolerance, target patient : Patient, target encounter : Encounter) {\n  src -&gt;  tgt.patient = create('Reference') as reference,  reference.reference = ('https://example/Patient/' + %patient.id) &quot;reference&quot;;\n  // src -&gt; tgt.encounter=create('Reference') as reference,  reference.reference = ('https://example/Encounter/' + %encounter.id) &quot;reference&quot;;\n  src.effectiveTime as effTime then {\n    effTime.low as l -&gt; tgt.recordedDate as r then TSDateTime(l, r) &quot;value&quot;;\n  } &quot;efftime&quot;;\n  src.entryRelationship as entryRelationship1 then {\n    entryRelationship1.observation as observation1 then {\n      observation1.id -&gt; tgt.identifier;\n      observation1.templateId where root = '2.16.840.1.113883.2.9.10.1.4.3.1.4' -&gt; tgt.code as code then {\n        observation1 -&gt; code.coding as coding then {\n          observation1 -&gt; coding.code = 'No known allergy' &quot;code&quot;;\n        } &quot;code&quot;;\n        src.effectiveTime as effectiveTime where (value.exists()) -&gt; tgt.onset = create('dateTime') as value then TSDateTime(effectiveTime, value) &quot;value1&quot;;\n        src.effectiveTime as effectiveTime -&gt; tgt.onset = create('Period') as value then IVLTSPeriod(effectiveTime, value) &quot;valuePeriod&quot;;\n      } &quot;Noallergy&quot;;\n      observation1.effectiveTime as effectiveTime where (value.exists()) -&gt; tgt.onset = create('dateTime') as value then TSDateTime(effectiveTime, value) &quot;value1&quot;;\n      observation1.effectiveTime as effectiveTime -&gt; tgt.onset = create('Period') as value then IVLTSPeriod(effectiveTime, value) &quot;valuePeriod&quot;;\n      observation1.value as code then {\n        code.code as code1 -&gt; tgt.type = translate(code1, '#AllergyTypeMap', 'code') &quot;type&quot;;\n        code.code as code1 -&gt; tgt.category = translate(code1, '#AllergyCategoryMap', 'code') &quot;category&quot;;\n      } &quot;code&quot;;\n      // toASK qui dovrei fare un controllo sul code\n      observation1.value -&gt; tgt.code;\n      observation1.participant as participant -&gt; tgt.reaction as reaction then {\n        observation1.entryRelationship as entryRelationship2 where (typeCode = 'MFST') then {\n          entryRelationship2.observation as observation2 then {\n            observation2.value -&gt; reaction.manifestation &quot;manifestation&quot;;\n            observation2.code -&gt; reaction.manifestation &quot;manifestation&quot;;\n            observation2.text as tx then {\n              tx.reference as reff -&gt; reaction.description = (reff.value) &quot;tx&quot;;\n            } &quot;tx&quot;;\n            observation2.effectiveTime as effectiveTime then {\n              effectiveTime.low as low -&gt; reaction.onset = create('dateTime') as value then TSDateTime(low, value) &quot;valuePeriodLow&quot;;\n              effectiveTime.high as high -&gt; tgt.lastOccurrence = create('dateTime') as value then TSDateTime(high, value) &quot;valuePeriodHigh&quot;;\n            } &quot;low&quot;;\n          } &quot;observ2&quot;;\n        } &quot;entryR2&quot;;\n        participant.participantRole as participantRole then {\n          participantRole.playingEntity as playingEntity then {\n            playingEntity.code -&gt; reaction.substance &quot;reaction&quot;;\n          };\n        };\n      };\n      observation1.entryRelationship as entryRelationship2 where (typeCode = 'MFST') then {\n        entryRelationship2.observation as observation2 where observation1.participant.exists().not() -&gt; tgt.reaction as reaction then {\n          observation2.value -&gt; reaction.manifestation &quot;manifestation&quot;;\n          observation2.text as tx then {\n            tx.reference as reff -&gt; reaction.description = (reff.value) &quot;tx&quot;;\n          } &quot;tx&quot;;\n          observation2.effectiveTime as effectiveTime then {\n            effectiveTime.low as low -&gt; reaction.onset = create('dateTime') as value then TSDateTime(low, value) &quot;valuePeriodLow&quot;;\n          } &quot;low&quot;;\n        } &quot;observ2&quot;;\n      } &quot;entryR2&quot;;\n      observation1.entryRelationship as entryRelationship3 where (typeCode = 'SUBJ') then {\n        entryRelationship3.observation as observation3 then {\n          observation3.value as value then {\n            value.code as c -&gt; tgt.criticality = translate(c, '#CricalityMap', 'code') &quot;value&quot;;\n          } &quot;criticality&quot;;\n        } &quot;observ3&quot;;\n        entryRelationship3.act as act -&gt; tgt.note as note then {\n          act.text as text then {\n            text.reference as reference -&gt; note.text = (reference.value);\n          } &quot;note&quot;;\n        };\n      } &quot;entryR3&quot;;\n      observation1.entryRelationship as entryRelationship4 where (typeCode = 'REFR') then {\n        entryRelationship4.observation as observation4 then {\n          observation4 -&gt; tgt.clinicalStatus as clinicalStatus then {\n            observation4.value as value then {\n              value as valu -&gt; clinicalStatus.coding = create('Coding') as coding then {\n                valu where (code = 'LA9041-0') -&gt; coding.code = 'resolved' &quot;code&quot;;\n                valu where (code = 'LA18632-2') -&gt; coding.code = 'inactive' &quot;code&quot;;\n                valu where (code = 'LA16666-2') -&gt; coding.code = 'active' &quot;code&quot;;\n                valu -&gt; coding.system = 'http://terminology.hl7.org/CodeSystem/allergyintolerance-clinical' &quot;system&quot;;\n                valu.displayName as display -&gt; coding.display = cast(display, 'string') &quot;display&quot;;\n              } &quot;coding&quot;;\n            };\n            observation4.text as tx then {\n              tx.reference as ref -&gt; clinicalStatus.text = (ref.value);\n            } &quot;tx&quot;;\n          } &quot;clinicalStatus&quot;;\n        } &quot;observ4&quot;;\n      } &quot;entryR4&quot;;\n    };\n  } &quot;entryrelationship&quot;;\n}\n\ngroup MedicationStatement(source src : substanceAdministration, target tgt : MedicationStatement, target patient : Patient, target encounter : Encounter, target bundle : Bundle) {\n  src -&gt;  tgt.subject = create('Reference') as reference,  reference.reference = ('https://example/Patient/' + %patient.id) &quot;reference&quot;;\n  // src -&gt; tgt.context = create('Reference') as reference,  reference.reference = ('https://example/Encounter/' + %encounter.id) &quot;reference&quot;;\n  src.statusCode -&gt; tgt.status &quot;status&quot;;\n  src.id -&gt; tgt.identifier;\n  src.text as text -&gt; tgt.note as note then {\n    text.reference as reference -&gt; note.text = (reference.value) &quot;text&quot;;\n  } &quot;note&quot;;\n  src.effectiveTime as eff where (value.exists()) -&gt; tgt.effective = create('dateTime') as value then TSDateTime(eff, value) &quot;value1&quot;;\n  src.effectiveTime : IVL_TS as eff -&gt; tgt.effective = create('Period') as value then IVLTSPeriod(eff, value) &quot;valuePeriod&quot;;\n  src -&gt; tgt.dosage = create('Dosage') as dosage then {\n    src.effectiveTime : PIVL_TS as eff then {\n      eff -&gt; dosage.timing = create('Timing') as timing then periodTiming(eff, timing) &quot;cod&quot;;\n    } &quot;eff&quot;;\n    src where (src.doseQuantity.exists() or src.rateQuantity.exists() or src.routeCode.exists() or src.approachSiteCode.exists()) then {\n      src.doseQuantity as doseQuant then {\n        doseQuant.originalText as ot then {\n          ot.reference -&gt; dosage.text;\n        } &quot;ot&quot;;\n        doseQuant -&gt; dosage.doseAndRate as dosageRate then {\n          doseQuant -&gt; dosageRate.dose = create('Range') as d then {\n            doseQuant -&gt; d.low = create('SimpleQuantity') as l then {\n              doseQuant.low as lo -&gt; l.value = (lo.value);\n              doseQuant.low as lo -&gt; l.unit = (lo.unit);\n            } &quot;low&quot;;\n            doseQuant -&gt; d.high = create('SimpleQuantity') as h then {\n              doseQuant.high as hi -&gt; h.value = (hi.value);\n              doseQuant.high as hi -&gt; h.unit = (hi.unit);\n            } &quot;low&quot;;\n          } &quot;d&quot;;\n        } &quot;dosageRate&quot;;\n      };\n      src.rateQuantity as rateQuantity then {\n        rateQuantity.originalText as ot then {\n          ot.reference -&gt; dosage.text;\n        } &quot;ot&quot;;\n        rateQuantity -&gt; dosage.doseAndRate as dosageRate then {\n          rateQuantity -&gt; dosageRate.rate = create('Range') as d then {\n            rateQuantity -&gt; d.low = create('SimpleQuantity') as l then {\n              rateQuantity.low as lo -&gt; l.value = (lo.value);\n              rateQuantity.low as lo -&gt; l.unit = (lo.unit);\n            } &quot;low&quot;;\n            rateQuantity -&gt; d.high = create('SimpleQuantity') as h then {\n              rateQuantity.high as hi -&gt; h.value = (hi.value);\n              rateQuantity.high as hi -&gt; h.unit = (hi.unit);\n            } &quot;high&quot;;\n          } &quot;r&quot;;\n        } &quot;dosageRate&quot;;\n      } &quot;rate&quot;;\n      src.routeCode -&gt; dosage.route &quot;route&quot;;\n      src.approachSiteCode -&gt; dosage.site &quot;site&quot;;\n      src.targetSiteCode -&gt; dosage.site &quot;site&quot;;\n    } &quot;route&quot;;\n  } &quot;dos&quot;;\n  src.consumable as consumable then {\n    consumable.manufacturedProduct as manufacturedProduct -&gt;  bundle.entry as e1,  e1.request = create('BackboneElement') as request,  request.method = 'POST',  e1.resource = create('Medication') as medication,  medication.id = uuid() as uuid1,  e1.fullUrl = append('https://example/Medication/', uuid1),  request.url = 'Medication',  tgt.medication = create('Reference') as medref,  medref.reference = ('https://example/Medication/' + %medication.id) then Medication(src, medication, patient, bundle) &quot;medication&quot;;\n  };\n}\n\ngroup periodTiming(source effectiveTime : PIVL_TS, target timing : Timing) {\n  effectiveTime -&gt; timing.repeat as r then {\n    effectiveTime.period as p -&gt; r.period = (p.value);\n    effectiveTime.period as p -&gt; r.periodUnit = (p.unit);\n  } &quot;repeat&quot;;\n}\n\ngroup Medication(source src : substanceAdministration, target tgt : Medication, target patient : Patient, target bundle : Bundle) {\n  src.consumable as consumable then {\n    consumable.manufacturedProduct as manufacturedProduct then {\n      manufacturedProduct.manufacturedMaterial as manufacturedMaterial then {\n        manufacturedMaterial.code -&gt; tgt.code &quot;CE&quot;;\n        src.administrationUnitCode -&gt; tgt.form &quot;form&quot;;\n      } &quot;material&quot;;\n    } &quot;product&quot;;\n  };\n  src.entryRelationship as entryR then {\n    entryR.observation as observation then {\n      observation.code where displayName = 'Grammatura' -&gt; tgt.ingredient as ingredient then {\n        src.consumable as consumable then {\n          consumable.manufacturedProduct as manufacturedProduct then {\n            manufacturedProduct.manufacturedMaterial as manufacturedMaterial then {\n              manufacturedMaterial.code as code -&gt; ingredient.item = create('CodeableConcept') as value then CECodeableConcept(code, value) &quot;CE&quot;;\n            } &quot;material&quot;;\n          } &quot;product&quot;;\n        };\n        observation.value as value -&gt; ingredient.strength as strength then {\n          value -&gt; strength.numerator as numerator then {\n            value -&gt; numerator.value = (value.value) &quot;valueN&quot;;\n          } &quot;numerator&quot;;\n          value -&gt; strength.denominator as denominator then {\n            value -&gt; denominator.value = 1 &quot;valueD&quot;;\n          } &quot;denominator&quot;;\n        } &quot;strenght&quot;;\n      } &quot;ingredient&quot;;\n      observation.code where displayName = 'Quantità nella Confezione' then {\n        observation.value as value -&gt; tgt.amount as amount then {\n          value -&gt; amount.numerator as numerator then {\n            value -&gt; numerator.value = (value.value) &quot;valueN&quot;;\n          } &quot;numerator&quot;;\n          value -&gt; amount.denominator as denominator then {\n            value -&gt; denominator.value = 1 &quot;valueD&quot;;\n          } &quot;denominator&quot;;\n        } &quot;amount&quot;;\n      } &quot;quantita&quot;;\n    } &quot;obs&quot;;\n  } &quot;entryR&quot;;\n}\n\ngroup Immunization(source substance : substanceAdministration, target patient : Patient, target encounter : Encounter, target tgt : Immunization, target bundle : Bundle) {\n  substance -&gt;  tgt.patient = create('Reference') as reference,  reference.reference = ('https://example/Patient/' + %patient.id) &quot;patientRef&quot;;\n  // substance -&gt; tgt.encounter  = create('Reference') as reference,  reference.reference = ('https://example/Encounter/' + %encounter.id) &quot;encounterRef&quot;;\n  substance.id as id -&gt; tgt.identifier as idf then {\n    id.root as r -&gt; idf.system = translate(r, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri') &quot;root1&quot;;\n  };\n  substance.text as text -&gt; tgt.note as note then {\n    text.reference as reference -&gt; note.text = (reference.value) &quot;text&quot;;\n  } &quot;note&quot;;\n  substance.statusCode as statusc where (code = 'completed') -&gt; tgt.status = 'completed';\n  substance.statusCode as statusc where (code = 'aborted') -&gt; tgt.status = 'final';\n  substance.statusCode as statusc where (code = 'suspended') -&gt; tgt.status = 'enterer-in-error';\n  substance.statusCode as statusc where (code = 'cancelled') -&gt; tgt.status = 'not-done';\n  substance.effectiveTime as time -&gt; tgt.occurrence = create('dateTime') as value then TSDateTime(time, value) &quot;efftime&quot;;\n  substance.routeCode -&gt; tgt.route;\n  substance.approachSiteCode -&gt; tgt.site;\n  substance -&gt; tgt.doseQuantity = create('SimpleQuantity') as quantity then {\n    substance.doseQuantity as q then {\n      q -&gt; quantity.value = (q.value) &quot;val&quot;;\n      q -&gt; quantity.unit = (q.unit) &quot;uni&quot;;\n    } &quot;qua&quot;;\n  } &quot;q&quot;;\n  substance.consumable as cons then {\n    cons.manufacturedProduct as manufact then {\n      manufact.manufacturedMaterial as manufactmat then {\n        manufactmat.code -&gt; tgt.vaccineCode;\n        manufactmat.lotNumberText as t -&gt; tgt.lotNumber = (t.dataString);\n      } &quot;manufactmat&quot;;\n      manufact.manufacturerOrganization as manufactOrg -&gt;  bundle.entry as e1,  e1.request = create('BackboneElement') as request,  request.method = 'PUT',  e1.resource = create('Organization') as organization then {\n        manufactOrg.id as id -&gt; organization.identifier as identifier then {\n          id.root as r -&gt; identifier.system = translate(r, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri') &quot;root1&quot;;\n          id.extension as ext -&gt; identifier.value = ext then {\n            manufactOrg -&gt; request.url = append('Organization?identifier=', ext) &quot;UUID&quot;;\n          } &quot;ext&quot;;\n          id.assigningAuthorityName as s -&gt;  identifier.assigner as a,  a.display = s;\n          id.root as r then {\n            id.extension as ext -&gt;  organization.id = (r + '-' + ext) as uuid,  e1.fullUrl = append('https://example/', uuid),  tgt.manufacturer = create('Reference') as reference,  reference.reference = ('https://example/' + %organization.id) &quot;idasi&quot;;\n          } &quot;r&quot;;\n        } &quot;identifier&quot;;\n        manufactOrg.name as n -&gt; organization.name = (n.other);\n        manufactOrg -&gt; organization.meta as meta then {\n          manufactOrg -&gt; meta.tag = create('Coding') as coding then {\n            manufactOrg -&gt; coding.system = 'http://algoritmodiscoring' &quot;system&quot;;\n            manufactOrg -&gt; coding.code = 'ClinicalDocument/body/Vaccinazioni/manufacturerOrganization' &quot;code&quot;;\n          } &quot;coding&quot;;\n        } &quot;meta&quot;;\n      } &quot;manufactOrg&quot;;\n    } &quot;manufact&quot;;\n  } &quot;cons&quot;;\n  substance.participant as part -&gt;  bundle.entry as e1,  e1.request = create('BackboneElement') as request,  request.method = 'PUT',  e1.resource = create('Location') as location,  location.id = uuid() as uuid1 then {\n    part -&gt; location.meta as meta then {\n      part -&gt; meta.tag = create('Coding') as coding then {\n        part -&gt; coding.system = 'http://algoritmodiscoring' &quot;system&quot;;\n        part -&gt; coding.code = 'ClinicalDocument/body/Vaccinazione/participant' &quot;code&quot;;\n      } &quot;coding&quot;;\n    } &quot;meta&quot;;\n    part.participantRole as partRole then {\n      partRole.id as id -&gt; location.identifier as identifier then {\n        id.root as r -&gt; identifier.system = translate(r, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri') &quot;root1&quot;;\n        id.extension as ext -&gt; identifier.value = ext then {\n          partRole -&gt; request.url = append('Location?identifier=', ext) &quot;UUID&quot;;\n        } &quot;ext&quot;;\n        id.assigningAuthorityName as s -&gt;  identifier.assigner as a,  a.display = s;\n        id.root as r then {\n          id.extension as ext -&gt;  location.id = (r + '-' + ext) as uuid,  e1.fullUrl = append('https://example/Location', uuid),  tgt.location = create('Reference') as reference,  reference.reference = ('https://example/' + %location.id) &quot;idasi&quot;;\n        } &quot;r&quot;;\n      } &quot;identifier&quot;;\n    } &quot;role&quot;;\n  } &quot;part&quot;;\n  substance.entryRelationship as entrirel1 then {\n    entrirel1.observation as obs then {\n      obs.code where (code = '30973-2') then {\n        obs -&gt; tgt.protocolApplied = create('BackboneElement') as prot then {\n          obs.value as v then {\n            v.value as int -&gt; prot.doseNumber = (int.toString());\n          };\n        } &quot;val&quot;;\n      } &quot;codecontrol&quot;;\n    } &quot;obs&quot;;\n  } &quot;entrirel1&quot;;\n  substance.entryRelationship as entrirel2 then {\n    entrirel2.observation as obs then {\n      obs.code where (code = '59781-5') then {\n        obs.value as value then {\n          value.high as h then {\n            h.value as value -&gt; tgt.expirationDate = truncate(value, 10);\n          } &quot;val&quot;;\n        };\n      } &quot;codecontrol&quot;;\n    } &quot;obs&quot;;\n  } &quot;entrirel2&quot;;\n  substance.entryRelationship as entrirel4 then {\n    entrirel4.observation as obs then {\n      obs.code where (code = '59785-6') -&gt;  bundle.entry as e1,  e1.request = create('BackboneElement') as request,  request.method = 'POST',  e1.resource = create('Observation') as observation,  observation.id = uuid() as uuid1,  e1.fullUrl = append('https://example/Observation/', uuid1),  request.url = 'Observation',  tgt.reasonReference = create('Reference') as reference,  reference.reference = ('https://example/Observation/' + %observation.id) then {\n        obs then Observation1(entrirel4, patient, tgt, bundle, enc, observation) &quot;observation&quot;;\n      } &quot;codecontrol&quot;;\n    } &quot;obs&quot;;\n  } &quot;entrirel4&quot;;\n  substance.entryRelationship as entrirel5 then {\n    entrirel5.observation as obs then {\n      obs.code where (code = '75321-0') or (code = '5321-0') -&gt; tgt.reaction as reaction then {\n        obs -&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',  reaction.detail = create('Reference') as reference,  reference.reference = ('https://example/Observation/' + %observation.id) then Observation(obs, patient, encounter, observation, bundle) &quot;observation&quot;;\n      } &quot;codecontrol&quot;;\n    } &quot;obs&quot;;\n  } &quot;entrirel5&quot;;\n  substance.entryRelationship as entrirel5 then {\n    entrirel5.act as act then {\n      act.text as tx -&gt; tgt.note as note then {\n        tx.reference as reference -&gt; note.text = (reference.value) &quot;text&quot;;\n      } &quot;note&quot;;\n    } &quot;obs&quot;;\n  } &quot;entrirel5&quot;;\n}\n\ngroup ConditionFunction(source src : cdaElement, target tgt : Condition, target patient : patient, target encounter : encounter, target bundle : Bundle) {\n  src.id -&gt; tgt.identifier;\n  src -&gt;  tgt.subject = create('Reference') as reference,  reference.reference = ('https://example/Patient/' + %patient.id) &quot;reference&quot;;\n  // src -&gt; tgt.encounter=create('Reference') as reference,  reference.reference = ('https://example/Encounter/' + %encounter.id) &quot;reference&quot;;\n  src.statusCode as stscode -&gt; tgt.verificationStatus as verifstatus then {\n    stscode as codeS -&gt; verifstatus.coding = create('Coding') as coding then {\n      codeS.code -&gt; coding.code = 'confirmed';\n      codeS -&gt; coding.system = 'http://terminology.hl7.org/CodeSystem/condition-ver-status' &quot;system&quot;;\n      codeS -&gt; coding.display = cast('Confirmed', 'string') &quot;display&quot;;\n    } &quot;coding&quot;;\n  } &quot;verifstatus&quot;;\n  src where entryRelationship.exists().not() then {\n    src.effectiveTime as effectiveTime where (value.exists()) -&gt; tgt.onset = create('dateTime') as value then TSDateTime(effectiveTime, value) &quot;value1&quot;;\n    src.effectiveTime as effectiveTime -&gt; tgt.onset = create('Period') as value then IVLTSPeriod(effectiveTime, value) &quot;valuePeriod&quot;;\n  } &quot;onset&quot;;\n  src.entryRelationship as entryRelationship then {\n    entryRelationship.observation as obsentry then {\n      // toASK\n      obsentry.value -&gt; tgt.code;\n      obsentry.code -&gt; tgt.category;\n      obsentry.effectiveTime as effectiveTime where (value.exists()) -&gt; tgt.onset = create('dateTime') as value then TSDateTime(effectiveTime, value) &quot;value1&quot;;\n      obsentry.effectiveTime as effectiveTime -&gt; tgt.onset = create('Period') as value then IVLTSPeriod(effectiveTime, value) &quot;valuePeriod&quot;;\n      obsentry.text as text -&gt; tgt.note as note then {\n        text.reference as reference -&gt; note.text = (reference.value) &quot;text&quot;;\n      } &quot;note&quot;;\n      obsentry.entryRelationship as entryR2 then {\n        entryR2.observation as obsentry2 then {\n          obsentry2.code where code = '89261-2' then {\n            obsentry2 -&gt;  tgt.evidence as evidence,  bundle.entry as e1,  e1.request = create('BackboneElement') as request,  request.method = 'POST',  e1.resource = create('Observation') as obsy,  obsy.id = uuid() as uuid1,  e1.fullUrl = append('https://example/Observation/', uuid1),  request.url = 'Observation',  evidence.detail = create('Reference') as reference,  reference.reference = ('https://example/Observation/' + %obsy.id) then Observation(obsentry2, patient, encounter, obsy, bundle) &quot;observation&quot;;\n          } &quot;observation&quot;;\n          obsentry2.code where code = '33999-4' then {\n            obsentry2.value as value -&gt; tgt.clinicalStatus as clinicalstatus then {\n              value as val -&gt; clinicalstatus.coding = create('Coding') as coding then {\n                val where (code = 'LA9041-0') -&gt; coding.code = 'resolved' &quot;code&quot;;\n                val where (code = 'LA18632-2') -&gt; coding.code = 'inactive' &quot;code&quot;;\n                val where (code = 'LA16666-2') -&gt; coding.code = 'active' &quot;code&quot;;\n                val -&gt; coding.system = 'http://terminology.hl7.org/CodeSystem/condition-clinical' &quot;system&quot;;\n                val.displayName as display -&gt; coding.display = cast(display, 'string') &quot;display&quot;;\n              } &quot;coding&quot;;\n              obsentry2.text as text then {\n                text.reference as reference -&gt; clinicalstatus.text = (reference.value) &quot;text&quot;;\n              };\n            } &quot;clinicalstatus&quot;;\n          } &quot;clinicalStatus2&quot;;\n          obsentry2.code where code = 'SEV' then {\n            obsentry2.value -&gt; tgt.severity;\n          } &quot;severity&quot;;\n        };\n        entryR2.act as act then {\n          act.text as text -&gt; tgt.note as note then {\n            text.reference as reference -&gt; note.text = (reference.value) &quot;text&quot;;\n          } &quot;note&quot;;\n        };\n      } &quot;entryR&quot;;\n    } &quot;EntryRelObsevation&quot;;\n  } &quot;entryR&quot;;\n}\n\ngroup FamilyMemberFunction(source src : organizer, target tgt : FamilyMemberHistory, target patient : patient) {\n  src -&gt;  tgt.patient = create('Reference') as reference,  reference.reference = ('https://example/Patient/' + %patient.id) &quot;patReference&quot;;\n  src.id -&gt; tgt.identifier;\n  src.statusCode -&gt; tgt.status;\n  src.effectiveTime as effectiveTime -&gt; tgt.date = create('date') as value then TSDate(effectiveTime, value) &quot;date&quot;;\n  src.subject as subject then {\n    subject.relatedSubject as relatedSubject then {\n      relatedSubject.code -&gt; tgt.relationship &quot;relationshipCode&quot;;\n      relatedSubject.subject as subject -&gt; tgt.sex as sex then {\n        subject.administrativeGenderCode as administrativeGenderCode -&gt; sex.coding as coding then {\n          administrativeGenderCode.code as sexCode -&gt; coding.code = translate(sexCode, '#cm-v3-administrative-gender', 'code') &quot;gender&quot;;\n          administrativeGenderCode -&gt; coding.system = 'http://hl7.org/fhir/administrative-gender' &quot;system&quot;;\n          administrativeGenderCode.displayName as dn -&gt; coding.display = dn;\n        } &quot;coding&quot;;\n      };\n    } &quot;relatedSub&quot;;\n  } &quot;relationship&quot;;\n  src.component as component -&gt; tgt.condition as condition then {\n    component.observation as observation then {\n      observation.code -&gt; condition.code;\n      observation.text as text -&gt; tgt.note as note then {\n        text.reference as reference -&gt; note.text = (reference.value) &quot;value&quot;;\n      } &quot;reference&quot;;\n      observation.statusCode -&gt; tgt.status;\n      // observation.effectiveTime as effectiveTime -&gt; condition.onset = create('Period') as value then IVLTSPeriod(effectiveTime, value) &quot;valuePeriod&quot;;\n      observation.value -&gt; condition.outcome &quot;codeable&quot;;\n      observation.entryRelationship as entryR then {\n        entryR.observation as obs then {\n          obs where (code.code = '35267-4') then {\n            obs.value as value -&gt; condition.onset = create('Age') as Age then {\n              value.value as valueAge -&gt; Age.value = valueAge &quot;age&quot;;\n              value.unit as unit -&gt; Age.code = unit;\n              value.unit as unit -&gt; Age.unit = unit;\n              value -&gt; Age.system = 'http://unitsofmeasure.org' &quot;system&quot;;\n            };\n          } &quot;insorgenza&quot;;\n          obs where (code.code = '39016-1') then {\n            obs.value as value -&gt; tgt.deceased = create('Age') as Age then {\n              value.value as valueAge -&gt; Age.value = valueAge &quot;age&quot;;\n              value.unit as unit -&gt; Age.code = unit;\n              value.unit as unit -&gt; Age.unit = unit;\n              value -&gt; Age.system = 'http://unitsofmeasure.org' &quot;system&quot;;\n            };\n          } &quot;death&quot;;\n        } &quot;obser&quot;;\n      } &quot;EntryRel&quot;;\n    };\n  };\n}\n\ngroup Practitioner(source src : performer, target tgt : Encounter, target bundle : Bundle) {\n  src -&gt;  bundle.entry as e22,  e22.request = create('BackboneElement') as request,  request.method = 'PUT',  e22.resource = create('Practitioner') as practitioner1 then {\n    src.assignedEntity as assignedEntity -&gt; tgt.participant as participant then {\n      src.time as time where (value.exists()) -&gt; participant.period = create('dateTime') as value then TSDateTime(time, value) &quot;value1&quot;;\n      src.time as time where (low.exists()) -&gt; participant.period = create('Period') as value then IVLTSPeriod(time, value) &quot;valuePeriod&quot;;\n      // src.time as time -&gt; participant.period as period then{\n      assignedEntity.id as id -&gt; practitioner1.identifier as identifier then {\n        id.root as r -&gt; identifier.system = translate(r, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri') &quot;root1&quot;;\n        id.extension as ext -&gt; identifier.value = ext &quot;ext&quot;;\n        id.assigningAuthorityName as s -&gt;  identifier.assigner as a,  a.display = s;\n        id.root as r then {\n          id.extension as ext -&gt;  practitioner1.id = (r + '-' + ext) as uuid22,  e22.fullUrl = append('https://example/Practitioner/', uuid22),  participant.individual = create('Reference') as reference,  reference.reference = ('https://example/Practitioner/' + %practitioner1.id) &quot;id&quot;;\n        } &quot;r&quot;;\n      } &quot;identifier&quot;;\n      assignedEntity.id as id where (root = '2.16.840.1.113883.2.9.4.3.2') then {\n        id.extension as ext -&gt; request.url = append('Practitioner?identifier=', ext) &quot;UUID&quot;;\n      } &quot;2&quot;;\n      assignedEntity.id as id where (root != '2.16.840.1.113883.2.9.4.3.2') then {\n        id.extension as ext -&gt; request.url = append('Practitioner?identifier=', ext) &quot;UUID&quot;;\n      } &quot;diverso&quot;;\n      assignedEntity -&gt; practitioner1.meta as meta then {\n        src -&gt; meta.tag = create('Coding') as coding then {\n          src -&gt; coding.system = 'http://algoritmodiscoring' &quot;system&quot;;\n          src -&gt; coding.code = 'ClinicalDocument/body/VisiteRicoveri/performer/' &quot;code&quot;;\n        } &quot;coding&quot;;\n      } &quot;meta&quot;;\n      assignedEntity.addr -&gt; practitioner1.address;\n      assignedEntity.telecom -&gt; practitioner1.telecom;\n      assignedEntity.assignedPerson as person then {\n        person.name -&gt; practitioner1.name;\n        person.birthTime -&gt; practitioner1.birthDate;\n      } &quot;partname&quot;;\n    } &quot;participant&quot;;\n  } &quot;resurceCreation&quot;;\n}\n\ngroup CarePlanFunction(source src : entry, target tgt : CarePlan, target patient : Patient, target encounter : Encounter, target bundle : Bundle) {\n  src -&gt;  tgt.subject = create('Reference') as reference,  reference.reference = ('https://example/Patient/' + %patient.id) &quot;reference&quot;;\n  src -&gt; tgt.status = 'unknown' &quot;status&quot;;\n  src -&gt; tgt.intent = 'plan' &quot;intent&quot;;\n  src -&gt; tgt.activity as activity then {\n    src -&gt; activity.detail as detail then {\n      src.observation as observation then {\n        observation then {\n          observation -&gt; detail.status = 'unknown' &quot;status&quot;;\n          observation -&gt;  bundle.entry as e1,  e1.request = create('BackboneElement') as request,  request.method = 'POST',  e1.resource = create('Observation') as obs1,  obs1.id = uuid() as uuid1,  e1.fullUrl = append('https://example/Observation/', uuid1),  request.url = 'Observation',  detail.reasonReference = create('Reference') as reference,  reference.reference = ('https://example/Observation/' + %obs1.id) then Observation(observation, patient, encounter, obs1, bundle) &quot;obs1&quot;;\n        } &quot;activity&quot;;\n      } &quot;entryObs&quot;;\n      src.substanceAdministration as substanceAdministration -&gt; tgt.activity as activity then {\n        substanceAdministration -&gt;  bundle.entry as e2,  e2.request = create('BackboneElement') as request,  request.method = 'POST',  e2.resource = create('MedicationRequest') as medre1,  medre1.id = uuid() as uuid2,  e2.fullUrl = append('https://example/MedicationRequest/', uuid2),  request.url = 'MedicationRequest',  activity.reference = create('Reference') as reference,  reference.reference = ('https://example/MedicationRequest/' + %medre1.id) then MedicationRequest(substanceAdministration, patient, encounter, medre1, bundle) &quot;Terapie&quot;;\n      } &quot;entrySub&quot;;\n      src.procedure as procedureC -&gt;  bundle.entry as e8,  e8.request = create('BackboneElement') as request,  request.method = 'POST',  e8.resource = create('Procedure') as procedure,  procedure.id = uuid() as uuid8,  e8.fullUrl = append('https://example/Procedure/', uuid8),  request.url = 'Procedure',  activity.outcomeReference = create('Reference') as reference,  reference.reference = ('https://example/Procedure/' + %procedure.id) then Procedure(procedureC, patient, encounter, procedure, bundle) &quot;proc&quot;;\n      src.encounter as encounterCDA -&gt;  bundle.entry as e3,  e3.request = create('BackboneElement') as request,  request.method = 'POST',  e3.resource = create('Encounter') as encounterFHIR,  encounterFHIR.id = uuid() as uuid3,  e3.fullUrl = append('https://example/Encounter/', uuid3),  request.url = 'Encounter',  tgt.encounter = create('Reference') as reference,  reference.reference = ('https://example/Encounter/' + %encounterFHIR.id) then {\n        // encounterCDA -&gt; encounterFHIR.partOf = create('Reference') as reference,  reference.reference = ('https://example/Encounter/' + %encounter.id) &quot;encounterHeader&quot;;\n        encounterCDA -&gt;  encounterFHIR.subject = create('Reference') as reference,  reference.reference = ('https://example/Patient/' + %patient.id) &quot;refPatient&quot;;\n        encounterCDA.id -&gt; encounterFHIR.identifier;\n        encounterCDA.statusCode -&gt; encounterFHIR.status;\n        encounterCDA where statusCode.exists().not() -&gt; encounterFHIR.status = 'unknown' &quot;status&quot;;\n        encounterCDA.code as code -&gt; encounterFHIR.class as class then {\n          code.code as code -&gt; class.code = cast(code, 'string');\n          code.codeSystem as system -&gt; class.system = translate(system, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri');\n          code.displayName as display -&gt; class.display = cast(display, 'string');\n        } &quot;class&quot;;\n        encounterCDA.text as text -&gt; encounterFHIR.type as type then {\n          text.reference as reference -&gt; type.text = (reference.value) &quot;value&quot;;\n        };\n        encounterCDA.effectiveTime as effectiveTime -&gt; encounterFHIR.period = create('Period') as period then {\n          effectiveTime -&gt; period.start = create('dateTime') as start then TSDateTime(effectiveTime, start) &quot;val&quot;;\n        } &quot;efft&quot;;\n      } &quot;viste&quot;;\n      src.act as act then {\n        act.id -&gt; tgt.identifier;\n        act.code -&gt; activity.outcomeCodeableConcept;\n        act.text as text -&gt; activity.progress = create('Annotation') as progress then {\n          text.reference as reference -&gt; progress.text = (reference.value) &quot;value&quot;;\n        };\n        act.effectiveTime as effectiveTime -&gt; detail.scheduled = create('Period') as period then {\n          effectiveTime -&gt; period.start = create('dateTime') as start then TSDateTime(effectiveTime, start) &quot;val&quot;;\n        } &quot;efft&quot;;\n        act -&gt; detail.status = 'completed' &quot;status&quot;;\n      };\n    } &quot;detail&quot;;\n  } &quot;activityIni&quot;;\n}\n\ngroup MedicationRequest(source src : substanceAdministration, target patient : Patient, target encounter : Encounter, target tgt : MedicationRequest, target bundle : Bundle) {\n  // default  + mandatory\n  src -&gt;  tgt.subject = create('Reference') as reference,  reference.reference = ('https://example/Patient/' + %patient.id) &quot;reference&quot;;\n  // src -&gt; tgt.encounter = create('Reference') as reference,  reference.reference = ('https://example/Encounter/' + %encounter.id) &quot;reference&quot;;\n  src -&gt; tgt.intent = 'order' &quot;intent&quot;;\n  src where statusCode.exists().not() -&gt; tgt.status = 'unknown' &quot;st&quot;;\n  src.statusCode as sc then {\n    sc.code as cos -&gt; tgt.status = translate(cos, '#MedicationStatusMap', 'code') &quot;codeS&quot;;\n  } &quot;status&quot;;\n  src.id -&gt; tgt.identifier;\n  src.text as txt -&gt; tgt.note as note then {\n    txt.reference as reference -&gt; note.text = (reference.value) &quot;text&quot;;\n  } &quot;note&quot;;\n  src.effectiveTime : IVL_TS as eff -&gt; tgt.dosageInstruction = create('Dosage') as dosage then {\n    eff -&gt; dosage.timing = create('Timing') as timing then {\n      eff -&gt; timing.repeat as rep then {\n        eff -&gt; rep.bounds = create('Period') as value then IVLTSPeriod(eff, value) &quot;valuePeriod&quot;;\n      } &quot;rep&quot;;\n    } &quot;timing&quot;;\n  } &quot;period&quot;;\n  src.effectiveTime : EIVL_TS as effe -&gt; tgt.dosageInstruction = create('Dosage') as dosage then {\n    effe -&gt; dosage.timing = create('Timing') as timing then {\n      effe -&gt; timing.repeat as rep then {\n        effe.eventCode as ev -&gt; rep.when = (ev.code);\n      } &quot;rep&quot;;\n    } &quot;timing&quot;;\n  } &quot;period&quot;;\n  src.effectiveTime : IVL_TS as eff -&gt;  tgt.dosageInstruction = create('Dosage') as dosage,  dosage.timing = create('Timing') as timing,  timing.event = (eff.value) &quot;tim&quot;;\n  src.effectiveTime : PIVL_TS as eff -&gt; tgt.dosageInstruction = create('Dosage') as dosage then {\n    eff -&gt; dosage.timing = create('Timing') as timing then periodTiming(eff, timing) &quot;cod&quot;;\n  } &quot;eff&quot;;\n  src where (src.doseQuantity.exists() or src.rateQuantity.exists()) then {\n    src -&gt; tgt.dosageInstruction = create('Dosage') as dosageInstruction then {\n      src.doseQuantity as doseQuant then {\n        doseQuant.originalText as ot then {\n          ot.reference -&gt; dosageInstruction.text;\n        } &quot;ot&quot;;\n        doseQuant -&gt; dosageInstruction.doseAndRate as dosageRate then {\n          doseQuant -&gt; dosageRate.dose = create('Range') as d then {\n            doseQuant -&gt; d.low = create('SimpleQuantity') as l then {\n              doseQuant.low as lo -&gt; l.value = (lo.value);\n              doseQuant.low as lo -&gt; l.unit = (lo.unit);\n            } &quot;low&quot;;\n            doseQuant -&gt; d.high = create('SimpleQuantity') as h then {\n              doseQuant.high as hi -&gt; h.value = (hi.value);\n              doseQuant.high as hi -&gt; h.unit = (hi.unit);\n            } &quot;low&quot;;\n          } &quot;d&quot;;\n        } &quot;dosageRate&quot;;\n      };\n      src.rateQuantity as rateQuantity then {\n        rateQuantity.originalText as ot then {\n          ot.reference -&gt; dosageInstruction.text;\n        } &quot;ot&quot;;\n        rateQuantity -&gt; dosageInstruction.doseAndRate as dosageRate then {\n          rateQuantity -&gt; dosageRate.rate = create('Range') as d then {\n            rateQuantity -&gt; d.low = create('SimpleQuantity') as l then {\n              rateQuantity.low as lo -&gt; l.value = (lo.value);\n              rateQuantity.low as lo -&gt; l.unit = (lo.unit);\n            } &quot;low&quot;;\n            rateQuantity -&gt; d.high = create('SimpleQuantity') as h then {\n              rateQuantity.high as hi -&gt; h.value = (hi.value);\n              rateQuantity.high as hi -&gt; h.unit = (hi.unit);\n            } &quot;high&quot;;\n          } &quot;r&quot;;\n        } &quot;dosageRate&quot;;\n      } &quot;rate&quot;;\n      src.routeCode -&gt; dosageInstruction.route &quot;route&quot;;\n      src.approachSiteCode -&gt; dosageInstruction.site &quot;site&quot;;\n      src.targetSiteCode -&gt; dosageInstruction.site &quot;site&quot;;\n    } &quot;dosageIn&quot;;\n  } &quot;condition&quot;;\n  src.consumable as consumable -&gt;  bundle.entry as e1,  e1.request = create('BackboneElement') as request,  request.method = 'POST',  e1.resource = create('Medication') as medication,  medication.id = uuid() as uuid1,  e1.fullUrl = append('https://example/Medication/', uuid1),  request.url = 'Medication',  tgt.medication = create('Reference') as medref,  medref.reference = ('https://example/Medication/' + %medication.id) then Medication(src, medication, patient, bundle) &quot;medication&quot;;\n  src.entryRelationship as entryRelationship then {\n    entryRelationship.supply as supply -&gt; tgt.dispenseRequest as dispenseRequest then {\n      supply.quantity as quantityCDA -&gt; dispenseRequest.quantity as quantityFHIR then {\n        quantityCDA -&gt; quantityFHIR.value = (quantityCDA.value) &quot;value&quot;;\n      };\n    };\n  } &quot;entryR&quot;;\n  src.participant as participant then {\n    participant then Practitioner(participant, tgt, bundle) &quot;function&quot;;\n    participant.effectiveTime -&gt; tgt.authoredOn &quot;autor&quot;;\n  } &quot;Partecipant&quot;;\n}\n\ngroup OrganizationAffiliation(source src : act, target patient : Patient, target enc : Encounter, target tgt : OrganizationAffiliation, target bundle : Bundle) {\n  src.id -&gt; tgt.identifier;\n  // src.code -&gt; tgt.specialty as specialty then{\n  src.statusCode where code = 'active' -&gt; tgt.active = true;\n  src.statusCode where (code = 'active').not() -&gt; tgt.active = false;\n  src.effectiveTime as eff -&gt; tgt.period;\n  // src.code -&gt; tgt.specialty;\n  src -&gt; tgt.specialty = create('CodeableConcept') as spec then {\n    src.code as code then {\n      code -&gt; spec.coding = create('Coding') as cd then {\n        code -&gt; cd.code = (code.code) &quot;code&quot;;\n        code -&gt; cd.display = (code.displayName) &quot;code&quot;;\n        code.codeSystem as r -&gt; cd.system = translate(r, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri') &quot;root1&quot;;\n      } &quot;cd&quot;;\n    } &quot;spec&quot;;\n    src.entryRelationship as entry then {\n      entry.act as a then {\n        a.text as tx then {\n          tx.reference as reff -&gt; spec.text = (reff.value);\n        } &quot;ref&quot;;\n      };\n    } &quot;entry&quot;;\n  } &quot;a&quot;;\n}\n\ngroup DiagnosticReportFunction(source src : organizer, target patient : Patient, target enc : Encounter, target tgt : DiagnosticReport, target bundle : Bundle) {\n  src -&gt;  tgt.subject = create('Reference') as reference,  reference.reference = ('https://example/Patient/' + %patient.id) &quot;reference&quot;;\n  // src -&gt; tgt.encounter=create('Reference') as reference,  reference.reference = ('https://example/Encounter/' + %enc.id) &quot;reference&quot;;\n  src.code -&gt; tgt.code;\n  src.statusCode where code = 'completed' -&gt; tgt.status = 'final';\n  src.effectiveTime as eff where (value.exists()) -&gt; tgt.effective = create('dateTime') as value then TSDateTime(eff, value) &quot;value1&quot;;\n  src.effectiveTime as eff where (low.exists()) -&gt; tgt.effective = create('Period') as value then IVLTSPeriod(effectiveTime, value) &quot;valuePeriod&quot;;\n  src.component as component then {\n    component.observation as observation -&gt;  bundle.entry as ei,  ei.request = create('BackboneElement') as request,  request.method = 'POST',  ei.resource = create('Observation') as obsi,  obsi.id = uuid() as uuidi,  ei.fullUrl = append('https://example/Observation/', uuidi),  request.url = 'Observation',  tgt.result = create('Reference') as reference,  reference.reference = ('https://example/Observation/' + %obsi.id) then Observation(observation, patient, enc, obsi, bundle) &quot;hasMember&quot;;\n  };\n}\n\ngroup EncounterFunction(source src : cdaElement, target patient : Patient, target encounter : Encounter, target tgt : Encounter, target bundle : Bundle) {\n  src.id -&gt; tgt.identifier;\n  src.statusCode -&gt; tgt.status;\n  src where statusCode.exists().not() -&gt; tgt.status = 'unknown' &quot;status&quot;;\n  src.code as code -&gt; tgt.class as class then {\n    code -&gt; class.code = (code.code) &quot;code&quot;;\n    code -&gt; class.display = (code.displayName) &quot;display&quot;;\n    code.codeSystem as r -&gt; class.system = translate(r, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri') &quot;root1&quot;;\n  } &quot;co&quot;;\n  // src.effectiveTime as effective -&gt; tgt.period as period then{\n  src where effectiveTime.low.exists() or effectiveTime.high.exists() then {\n    src.effectiveTime as eff -&gt; tgt.period = create('Period') as period then IVLTSPeriod(eff, period);\n  } &quot;where&quot;;\n  // effectiveTime = time-stamp\n  src where effectiveTime.low.exists().not() or effectiveTime.high.exists().not() then {\n    src.effectiveTime as effectivetime1 -&gt; tgt.period = create('Period') as period then {\n      effectivetime1 -&gt; period.start = create('dateTime') as start then TSDateTime(effectivetime1, start) &quot;val&quot;;\n    } &quot;efft&quot;;\n  } &quot;where&quot;;\n  // src.effectiveTime as eff where (value.exists()) -&gt; tgt.period = create('dateTime') as value then TSDateTime(eff, value) &quot;value1&quot;;\n  src.text as tx -&gt; tgt.type as ty then {\n    tx.reference as reff -&gt; ty.text = (reff.value) &quot;textType&quot;;\n  };\n  src.performer as performer -&gt; tgt.participant as part then {\n    performer -&gt; part.period as period then {\n      performer.time as time -&gt; period.start as start then TSDateTime(time, start) &quot;val&quot;;\n    } &quot;period&quot;;\n    performer.assignedEntity as assentity -&gt;  bundle.entry as e1,  e1.request = create('BackboneElement') as request,  request.method = 'POST',  e1.resource = create('PractitionerRole') as practitionerRole,  practitionerRole.id = uuid() as uuid1,  e1.fullUrl = append('https://example/PractitionerRole/', uuid1),  request.url = 'PractitionerRole',  tgt.participant = create('BackboneElement') as participant1,  participant1.individual = create('Reference') as referencepart,  referencepart.reference = ('https://example/PractitionerRole/' + %practitionerRole.id) then {\n      assentity.code -&gt; practitionerRole.code;\n      assentity -&gt;  bundle.entry as e2,  e2.request = create('BackboneElement') as request,  request.method = 'PUT',  e2.resource = create('Practitioner') as practitioner then {\n        assentity -&gt; practitioner.meta as meta then {\n          assentity -&gt; meta.tag = create('Coding') as coding then {\n            assentity -&gt; coding.system = 'http://algoritmodiscoring' &quot;system&quot;;\n            assentity -&gt; coding.code = 'ClinicalDocument/body/encounter/performer' &quot;code&quot;;\n          } &quot;coding&quot;;\n        } &quot;meta&quot;;\n        assentity.id as id -&gt; practitioner.identifier as identifier then {\n          id.root as r -&gt; identifier.system = translate(r, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri') &quot;root1&quot;;\n          id.extension as ext -&gt; identifier.value = ext then {\n            assentity -&gt; request.url = append('Practitioner?identifier=', ext) &quot;UUID&quot;;\n          } &quot;ext&quot;;\n          id.assigningAuthorityName as s -&gt;  identifier.assigner as a,  a.display = s;\n          id.root as r then {\n            id.extension as ext -&gt;  practitioner.id = (r + '-' + ext) as uuid2,  e2.fullUrl = append('https://example/Practitioner/', uuid2),  practitionerRole.practitioner = create('Reference') as reference,  reference.reference = ('https://example/Practitioner/' + %practitioner.id) &quot;performer&quot;;\n          } &quot;r&quot;;\n        } &quot;identifier&quot;;\n        assentity.id as id where (root = '2.16.840.1.113883.2.9.4.3.2') then {\n          id.extension as ext -&gt; request.url = append('Practitioner?identifier=', ext) &quot;UUID&quot;;\n        } &quot;2&quot;;\n        assentity.id as id where (root != '2.16.840.1.113883.2.9.4.3.2') then {\n          id.extension as ext -&gt; request.url = append('Practitioner?identifier=', ext) &quot;UUID&quot;;\n        } &quot;2&quot;;\n        assentity.addr -&gt; practitioner.address;\n        assentity.telecom -&gt; practitioner.telecom;\n        assentity.assignedPerson as person then {\n          person.name -&gt; practitioner.name;\n          person.birthTime as birthTime then {\n            birthTime.value as date -&gt; practitioner.birthDate = truncate(date, 10);\n          } &quot;birth&quot;;\n        } &quot;name&quot;;\n      } &quot;assignedEntity&quot;;\n    } &quot;performer&quot;;\n  } &quot;01&quot;;\n}\n\n</pre>\n      </div>"
  ] ; # 
  fhir:url [ fhir:v "http://hl7.it/fhir/cda2fhir/StructureMap/cda2fhirPs"^^xsd:anyURI] ; # 
  fhir:version [ fhir:v "0.1.0"] ; # 
  fhir:name [ fhir:v "cda2fhirPs"] ; # 
  fhir:status [ fhir:v "draft"] ; # 
  fhir:date [ fhir:v "2024-04-11T15:38:19+02: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/List"^^xsd:anyURI ;
fhir:link <http://hl7.org/fhir/StructureDefinition/List>     ] ;
fhir:mode [ fhir:v "produced" ] ;
fhir:alias [ fhir:v "List" ]
  ] [
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: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 [ 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 [ 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 [ 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 [ fhir:v "https://example/Composition/" ]         ] [
fhir:value [ 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 [ 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 [ 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 [ 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 [ 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 [ fhir:v "https://example/Patient/" ]         ] [
fhir:value [ 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 [ 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 [ 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 [ 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 [ fhir:v "https://example/Encounter/" ]         ] [
fhir:value [ 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 [ fhir:v "Encounter" ]         ] )       ] [
fhir:context [ fhir:v "bundle" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "entry" ] ;
fhir:variable [ fhir:v "e4" ]       ] [
fhir:context [ fhir:v "e4" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "request" ] ;
fhir:variable [ fhir:v "request" ] ;
fhir:transform [ fhir:v "create" ] ;
        ( fhir:parameter [
fhir:value [ 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 [ fhir:v "POST" ]         ] )       ] [
fhir:context [ fhir:v "e4" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "resource" ] ;
fhir:variable [ fhir:v "DocumentReference" ] ;
fhir:transform [ fhir:v "create" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "DocumentReference" ]         ] )       ] [
fhir:context [ fhir:v "DocumentReference" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "id" ] ;
fhir:variable [ fhir:v "uuid4" ] ;
fhir:transform [ fhir:v "uuid" ]       ] [
fhir:context [ fhir:v "e4" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "fullUrl" ] ;
fhir:transform [ fhir:v "append" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "https://example/DocumentReference/" ]         ] [
fhir:value [ fhir:v "uuid4" ]         ] )       ] [
fhir:context [ fhir:v "request" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "url" ] ;
fhir:transform [ fhir:v "copy" ] ;
        ( fhir:parameter [
fhir:value [ 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 "patient" ] ;
        ( fhir:source [
fhir:context [ fhir:v "cda" ] ;
fhir:element [ fhir:v "recordTarget" ] ;
fhir:variable [ fhir:v "recordTarget" ]         ] ) ;
        ( fhir:rule [
fhir:name [ fhir:v "recPat" ] ;
          ( 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 [ fhir:v "r" ]                 ] [
fhir:value [ fhir:v "http://hl7.org/fhir/ConceptMap/special-oid2uri" ]                 ] [
fhir:value [ 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 [ 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 [ 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 [ fhir:v "Patient?identifier=" ]                 ] [
fhir:value [ 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 [ 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 [ fhir:v "Coding" ]         ] )       ] ) ;
      ( fhir:rule [
fhir:name [ fhir:v "code" ] ;
        ( 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 [ fhir:v "summary" ]           ] )         ] )       ] )     ] [
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 [ 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 [ fhir:v "timestamp.now()" ]         ] )       ] ) ;
fhir:documentation [ fhir:v "cda.effectiveTime -> bundle.timestamp;" ]     ] [
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 "diagnostic" ] ;
      ( 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 "code" ] ;
              ( fhir:source [
fhir:context [ fhir:v "srcSection" ] ;
fhir:element [ fhir:v "code" ]               ] ) ;
              ( 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:v "composition" ] )               ] )             ] )           ] )         ] )       ] )     ] )
  ] [
fhir:name [ fhir:v "ClinicalDocumentSection" ] ;
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 "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:name [ fhir:v "composition" ] ;
fhir:type [ fhir:v "Composition" ] ;
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 [ 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 "entry" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "entry" ] ;
fhir:variable [ fhir:v "entry" ]       ] ) ;
      ( fhir:rule [
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 [ 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 [ fhir:v "t" ]             ] )           ] )         ] )       ] [
fhir:name [ fhir:v "entryObs" ] ;
        ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:condition [ fhir:v "(code = '30954-2')" ]         ] ) ;
        ( fhir:rule [
fhir:name [ fhir:v "diagnostic" ] ;
          ( fhir:source [
fhir:context [ fhir:v "entry" ] ;
fhir:element [ fhir:v "organizer" ] ;
fhir:variable [ fhir:v "organizer" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "bundle" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "entry" ] ;
fhir:variable [ fhir:v "e0" ]           ] [
fhir:context [ fhir:v "e0" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "request" ] ;
fhir:variable [ fhir:v "request" ] ;
fhir:transform [ fhir:v "create" ] ;
            ( fhir:parameter [
fhir:value [ 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 [ fhir:v "POST" ]             ] )           ] [
fhir:context [ fhir:v "e0" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "resource" ] ;
fhir:variable [ fhir:v "dia" ] ;
fhir:transform [ fhir:v "create" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "DiagnosticReport" ]             ] )           ] [
fhir:context [ fhir:v "dia" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "id" ] ;
fhir:variable [ fhir:v "uuid0" ] ;
fhir:transform [ fhir:v "uuid" ]           ] [
fhir:context [ fhir:v "e0" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "fullUrl" ] ;
fhir:transform [ fhir:v "append" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "https://example/DiagnosticReport/" ]             ] [
fhir:value [ fhir:v "uuid0" ]             ] )           ] [
fhir:context [ fhir:v "request" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "url" ] ;
fhir:transform [ fhir:v "copy" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "DiagnosticReport" ]             ] )           ] [
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 [ 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 [ fhir:v "'https://example/DiagnosticReport/' + %dia.id" ]             ] )           ] ) ;
          ( fhir:dependent [
fhir:name [ fhir:v "DiagnosticReportFunction" ] ;
            ( fhir:variable [ fhir:v "organizer" ] [ fhir:v "patient" ] [ fhir:v "enc" ] [ fhir:v "dia" ] [ fhir:v "bundle" ] )           ] )         ] ) ;
fhir:documentation [ fhir:v "sezioni che sono strutturate" ]       ] [
fhir:name [ fhir:v "entryObs" ] ;
        ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:condition [ fhir:v "(code = '29762-2') or (code = '10162-6')" ]         ] ) ;
        ( fhir:rule [
fhir:name [ fhir:v "obs1" ] ;
          ( fhir:source [
fhir:context [ fhir:v "entry" ] ;
fhir:element [ fhir:v "observation" ] ;
fhir:variable [ fhir:v "observation" ]           ] ) ;
          ( 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 [ 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 [ fhir:v "POST" ]             ] )           ] [
fhir:context [ fhir:v "e1" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "resource" ] ;
fhir:variable [ fhir:v "obs1" ] ;
fhir:transform [ fhir:v "create" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "Observation" ]             ] )           ] [
fhir:context [ fhir:v "obs1" ] ;
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 [ fhir:v "https://example/Observation/" ]             ] [
fhir:value [ 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 [ fhir:v "Observation" ]             ] )           ] [
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 [ 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 [ fhir:v "'https://example/Observation/' + %obs1.id" ]             ] )           ] ) ;
          ( fhir:dependent [
fhir:name [ fhir:v "Observation" ] ;
            ( fhir:variable [ fhir:v "observation" ] [ fhir:v "patient" ] [ fhir:v "enc" ] [ fhir:v "obs1" ] [ fhir:v "bundle" ] )           ] )         ] )       ] [
fhir:name [ fhir:v "organizer" ] ;
        ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:condition [ fhir:v "(code = '8716-3') or (code = '47420-5')" ]         ] ) ;
        ( fhir:rule [
fhir:name [ fhir:v "obs2" ] ;
          ( fhir:source [
fhir:context [ fhir:v "entry" ] ;
fhir:element [ fhir:v "organizer" ] ;
fhir:variable [ fhir:v "organizer" ]           ] ) ;
          ( fhir:target [
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 "request" ] ;
fhir:transform [ fhir:v "create" ] ;
            ( fhir:parameter [
fhir:value [ 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 [ fhir:v "POST" ]             ] )           ] [
fhir:context [ fhir:v "e2" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "resource" ] ;
fhir:variable [ fhir:v "obs2" ] ;
fhir:transform [ fhir:v "create" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "Observation" ]             ] )           ] [
fhir:context [ fhir:v "obs2" ] ;
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 [ fhir:v "https://example/Observation/" ]             ] [
fhir:value [ fhir:v "uuid2" ]             ] )           ] [
fhir:context [ fhir:v "request" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "url" ] ;
fhir:transform [ fhir:v "copy" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "Observation" ]             ] )           ] [
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 [ 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 [ fhir:v "'https://example/Observation/' + %obs2.id" ]             ] )           ] ) ;
          ( fhir:dependent [
fhir:name [ fhir:v "ObservationOrganizer" ] ;
            ( fhir:variable [ fhir:v "src" ] [ fhir:v "organizer" ] [ fhir:v "patient" ] [ fhir:v "enc" ] [ fhir:v "obs2" ] [ fhir:v "bundle" ] )           ] )         ] [
fhir:name [ fhir:v "obs2" ] ;
          ( fhir:source [
fhir:context [ fhir:v "entry" ] ;
fhir:element [ fhir:v "observation" ] ;
fhir:variable [ fhir:v "organizer" ]           ] ) ;
          ( fhir:target [
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 "request" ] ;
fhir:transform [ fhir:v "create" ] ;
            ( fhir:parameter [
fhir:value [ 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 [ fhir:v "POST" ]             ] )           ] [
fhir:context [ fhir:v "e2" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "resource" ] ;
fhir:variable [ fhir:v "obs2" ] ;
fhir:transform [ fhir:v "create" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "Observation" ]             ] )           ] [
fhir:context [ fhir:v "obs2" ] ;
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 [ fhir:v "https://example/Observation/" ]             ] [
fhir:value [ fhir:v "uuid2" ]             ] )           ] [
fhir:context [ fhir:v "request" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "url" ] ;
fhir:transform [ fhir:v "copy" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "Observation" ]             ] )           ] [
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 [ 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 [ fhir:v "'https://example/Observation/' + %obs2.id" ]             ] )           ] ) ;
          ( fhir:dependent [
fhir:name [ fhir:v "ObservationOrganizer" ] ;
            ( fhir:variable [ fhir:v "src" ] [ fhir:v "organizer" ] [ fhir:v "patient" ] [ fhir:v "enc" ] [ fhir:v "obs2" ] [ fhir:v "bundle" ] )           ] )         ] )       ] [
fhir:name [ fhir:v "listaDeiProblemi" ] ;
        ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:condition [ fhir:v "code = '11450-4'" ]         ] ) ;
        ( fhir:rule [
fhir:name [ fhir:v "condition" ] ;
          ( fhir:source [
fhir:context [ fhir:v "entry" ] ;
fhir:element [ fhir:v "act" ] ;
fhir:variable [ fhir:v "act" ]           ] ) ;
          ( fhir:target [
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 [ 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 [ fhir:v "POST" ]             ] )           ] [
fhir:context [ fhir:v "e3" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "resource" ] ;
fhir:variable [ fhir:v "condition" ] ;
fhir:transform [ fhir:v "create" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "Condition" ]             ] )           ] [
fhir:context [ fhir:v "condition" ] ;
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 [ fhir:v "https://example/Condition/" ]             ] [
fhir:value [ 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 [ fhir:v "Condition" ]             ] )           ] [
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 [ 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 [ fhir:v "'https://example/Condition/' + %condition.id" ]             ] )           ] ) ;
          ( fhir:dependent [
fhir:name [ fhir:v "ConditionFunction" ] ;
            ( fhir:variable [ fhir:v "act" ] [ fhir:v "condition" ] [ fhir:v "patient" ] [ fhir:v "enc" ] [ fhir:v "bundle" ] )           ] )         ] )       ] [
fhir:name [ fhir:v "entryAct" ] ;
        ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:condition [ fhir:v "(code = '48765-2')" ]         ] ) ;
        ( fhir:rule [
fhir:name [ fhir:v "allergy" ] ;
          ( fhir:source [
fhir:context [ fhir:v "entry" ] ;
fhir:element [ fhir:v "act" ] ;
fhir:variable [ fhir:v "act" ]           ] ) ;
          ( fhir:target [
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 [ 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 [ fhir:v "POST" ]             ] )           ] [
fhir:context [ fhir:v "e5" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "resource" ] ;
fhir:variable [ fhir:v "allergy" ] ;
fhir:transform [ fhir:v "create" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "AllergyIntolerance" ]             ] )           ] [
fhir:context [ fhir:v "allergy" ] ;
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 [ fhir:v "https://example/AllergyIntolerance/" ]             ] [
fhir:value [ 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 [ fhir:v "AllergyIntolerance" ]             ] )           ] [
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 [ 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 [ fhir:v "'https://example/AllergyIntolerance/' + %allergy.id" ]             ] )           ] ) ;
          ( fhir:dependent [
fhir:name [ fhir:v "allergyFunction" ] ;
            ( fhir:variable [ fhir:v "act" ] [ fhir:v "allergy" ] [ fhir:v "patient" ] [ fhir:v "enc" ] )           ] )         ] )       ] [
fhir:name [ fhir:v "terapia" ] ;
        ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:condition [ fhir:v "code = '10160-0'" ]         ] ) ;
        ( fhir:rule [
fhir:name [ fhir:v "TerapiaFarmacologica" ] ;
          ( fhir:source [
fhir:context [ fhir:v "entry" ] ;
fhir:element [ fhir:v "substanceAdministration" ] ;
fhir:variable [ fhir:v "subAdmin" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "bundle" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "entry" ] ;
fhir:variable [ fhir:v "e6" ]           ] [
fhir:context [ fhir:v "e6" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "request" ] ;
fhir:variable [ fhir:v "request" ] ;
fhir:transform [ fhir:v "create" ] ;
            ( fhir:parameter [
fhir:value [ 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 [ fhir:v "POST" ]             ] )           ] [
fhir:context [ fhir:v "e6" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "resource" ] ;
fhir:variable [ fhir:v "medicationstatement" ] ;
fhir:transform [ fhir:v "create" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "MedicationStatement" ]             ] )           ] [
fhir:context [ fhir:v "medicationstatement" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "id" ] ;
fhir:variable [ fhir:v "uuid6" ] ;
fhir:transform [ fhir:v "uuid" ]           ] [
fhir:context [ fhir:v "e6" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "fullUrl" ] ;
fhir:transform [ fhir:v "append" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "https://example/MedicationStatement/" ]             ] [
fhir:value [ fhir:v "uuid6" ]             ] )           ] [
fhir:context [ fhir:v "request" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "url" ] ;
fhir:transform [ fhir:v "copy" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "MedicationStatement" ]             ] )           ] [
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 [ 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 [ fhir:v "'https://example/MedicationStatement/' + %medicationstatement.id" ]             ] )           ] ) ;
          ( fhir:dependent [
fhir:name [ fhir:v "MedicationStatement" ] ;
            ( fhir:variable [ fhir:v "subAdmin" ] [ fhir:v "medicationstatement" ] [ fhir:v "patient" ] [ fhir:v "enc" ] [ fhir:v "bundle" ] )           ] )         ] )       ] [
fhir:name [ fhir:v "vacc" ] ;
        ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:condition [ fhir:v "code = '11369-6'" ]         ] ) ;
        ( fhir:rule [
fhir:name [ fhir:v "immunization" ] ;
          ( fhir:source [
fhir:context [ fhir:v "entry" ] ;
fhir:element [ fhir:v "substanceAdministration" ] ;
fhir:variable [ fhir:v "subVACC" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "bundle" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "entry" ] ;
fhir:variable [ fhir:v "e7" ]           ] [
fhir:context [ fhir:v "e7" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "request" ] ;
fhir:variable [ fhir:v "request" ] ;
fhir:transform [ fhir:v "create" ] ;
            ( fhir:parameter [
fhir:value [ 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 [ fhir:v "POST" ]             ] )           ] [
fhir:context [ fhir:v "e7" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "resource" ] ;
fhir:variable [ fhir:v "immunization" ] ;
fhir:transform [ fhir:v "create" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "Immunization" ]             ] )           ] [
fhir:context [ fhir:v "immunization" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "id" ] ;
fhir:variable [ fhir:v "uuid7" ] ;
fhir:transform [ fhir:v "uuid" ]           ] [
fhir:context [ fhir:v "e7" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "fullUrl" ] ;
fhir:transform [ fhir:v "append" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "https://example/Immunization/" ]             ] [
fhir:value [ fhir:v "uuid7" ]             ] )           ] [
fhir:context [ fhir:v "request" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "url" ] ;
fhir:transform [ fhir:v "copy" ] ;
            ( fhir:parameter [
fhir:value [ 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 [ 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 [ fhir:v "'https://example/Immunization/' + %immunization.id" ]             ] )           ] ) ;
          ( fhir:dependent [
fhir:name [ fhir:v "Immunization" ] ;
            ( fhir:variable [ fhir:v "subVACC" ] [ fhir:v "patient" ] [ fhir:v "enc" ] [ fhir:v "immunization" ] [ fhir:v "bundle" ] )           ] )         ] )       ] [
fhir:name [ fhir:v "family" ] ;
        ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:condition [ fhir:v "code = '10157-6'" ]         ] ) ;
        ( fhir:rule [
fhir:name [ fhir:v "family" ] ;
          ( fhir:source [
fhir:context [ fhir:v "entry" ] ;
fhir:element [ fhir:v "organizer" ] ;
fhir:variable [ fhir:v "organizer" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "bundle" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "entry" ] ;
fhir:variable [ fhir:v "e12" ]           ] [
fhir:context [ fhir:v "e12" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "request" ] ;
fhir:variable [ fhir:v "request" ] ;
fhir:transform [ fhir:v "create" ] ;
            ( fhir:parameter [
fhir:value [ 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 [ fhir:v "POST" ]             ] )           ] [
fhir:context [ fhir:v "e12" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "resource" ] ;
fhir:variable [ fhir:v "familyMember" ] ;
fhir:transform [ fhir:v "create" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "FamilyMemberHistory" ]             ] )           ] [
fhir:context [ fhir:v "familyMember" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "id" ] ;
fhir:variable [ fhir:v "uuid12" ] ;
fhir:transform [ fhir:v "uuid" ]           ] [
fhir:context [ fhir:v "e12" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "fullUrl" ] ;
fhir:transform [ fhir:v "append" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "https://example/FamilyMemberHistory/" ]             ] [
fhir:value [ fhir:v "uuid12" ]             ] )           ] [
fhir:context [ fhir:v "request" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "url" ] ;
fhir:transform [ fhir:v "copy" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "FamilyMemberHistory" ]             ] )           ] [
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 [ 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 [ fhir:v "'https://example/FamilyMemberHistory/' + %familyMember.id" ]             ] )           ] ) ;
          ( fhir:dependent [
fhir:name [ fhir:v "FamilyMemberFunction" ] ;
            ( fhir:variable [ fhir:v "organizer" ] [ fhir:v "familyMember" ] [ fhir:v "patient" ] )           ] )         ] )       ] [
fhir:name [ fhir:v "impianti" ] ;
        ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:condition [ fhir:v "code = '46264-8'" ]         ] ) ;
        ( fhir:rule [
fhir:name [ fhir:v "protesi" ] ;
          ( fhir:source [
fhir:context [ fhir:v "entry" ] ;
fhir:element [ fhir:v "supply" ] ;
fhir:variable [ fhir:v "supply" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "bundle" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "entry" ] ;
fhir:variable [ fhir:v "e8" ]           ] [
fhir:context [ fhir:v "e8" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "request" ] ;
fhir:variable [ fhir:v "request" ] ;
fhir:transform [ fhir:v "create" ] ;
            ( fhir:parameter [
fhir:value [ 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 [ fhir:v "POST" ]             ] )           ] [
fhir:context [ fhir:v "e8" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "resource" ] ;
fhir:variable [ fhir:v "procedure" ] ;
fhir:transform [ fhir:v "create" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "Procedure" ]             ] )           ] [
fhir:context [ fhir:v "procedure" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "id" ] ;
fhir:variable [ fhir:v "uuid8" ] ;
fhir:transform [ fhir:v "uuid" ]           ] [
fhir:context [ fhir:v "e8" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "fullUrl" ] ;
fhir:transform [ fhir:v "append" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "https://example/Procedure/" ]             ] [
fhir:value [ fhir:v "uuid8" ]             ] )           ] [
fhir:context [ fhir:v "request" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "url" ] ;
fhir:transform [ fhir:v "copy" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "Procedure" ]             ] )           ] [
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 [ 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 [ fhir:v "'https://example/Procedure/' + %procedure.id" ]             ] )           ] ) ;
          ( fhir:dependent [
fhir:name [ fhir:v "Procedure" ] ;
            ( fhir:variable [ fhir:v "supply" ] [ fhir:v "patient" ] [ fhir:v "enc" ] [ fhir:v "procedure" ] [ fhir:v "bundle" ] )           ] )         ] )       ] [
fhir:name [ fhir:v "trattamentiProcedure" ] ;
        ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:condition [ fhir:v "code = '47519-4'" ]         ] ) ;
        ( fhir:rule [
fhir:name [ fhir:v "tratt" ] ;
          ( fhir:source [
fhir:context [ fhir:v "entry" ] ;
fhir:element [ fhir:v "procedure" ] ;
fhir:variable [ fhir:v "procedure" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "bundle" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "entry" ] ;
fhir:variable [ fhir:v "e9" ]           ] [
fhir:context [ fhir:v "e9" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "request" ] ;
fhir:variable [ fhir:v "request" ] ;
fhir:transform [ fhir:v "create" ] ;
            ( fhir:parameter [
fhir:value [ 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 [ fhir:v "POST" ]             ] )           ] [
fhir:context [ fhir:v "e9" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "resource" ] ;
fhir:variable [ fhir:v "procedure2" ] ;
fhir:transform [ fhir:v "create" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "Procedure" ]             ] )           ] [
fhir:context [ fhir:v "procedure2" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "id" ] ;
fhir:variable [ fhir:v "uuid9" ] ;
fhir:transform [ fhir:v "uuid" ]           ] [
fhir:context [ fhir:v "e9" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "fullUrl" ] ;
fhir:transform [ fhir:v "append" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "https://example/Procedure/" ]             ] [
fhir:value [ fhir:v "uuid9" ]             ] )           ] [
fhir:context [ fhir:v "request" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "url" ] ;
fhir:transform [ fhir:v "copy" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "Procedure" ]             ] )           ] [
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 [ 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 [ fhir:v "'https://example/Procedure/' + %procedure2.id" ]             ] )           ] ) ;
          ( fhir:dependent [
fhir:name [ fhir:v "Procedure" ] ;
            ( fhir:variable [ fhir:v "procedure" ] [ fhir:v "patient" ] [ fhir:v "enc" ] [ fhir:v "procedure2" ] [ fhir:v "bundle" ] )           ] )         ] )       ] [
fhir:name [ fhir:v "visiteRicoveri" ] ;
        ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:condition [ fhir:v "code = '46240-8'" ]         ] ) ;
        ( fhir:rule [
fhir:name [ fhir:v "encounter" ] ;
          ( fhir:source [
fhir:context [ fhir:v "entry" ] ;
fhir:element [ fhir:v "encounter" ] ;
fhir:variable [ fhir:v "encounter" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "bundle" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "entry" ] ;
fhir:variable [ fhir:v "e9" ]           ] [
fhir:context [ fhir:v "e9" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "request" ] ;
fhir:variable [ fhir:v "request" ] ;
fhir:transform [ fhir:v "create" ] ;
            ( fhir:parameter [
fhir:value [ 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 [ fhir:v "POST" ]             ] )           ] [
fhir:context [ fhir:v "e9" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "resource" ] ;
fhir:variable [ fhir:v "encounterF" ] ;
fhir:transform [ fhir:v "create" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "Encounter" ]             ] )           ] [
fhir:context [ fhir:v "encounterF" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "id" ] ;
fhir:variable [ fhir:v "uuid9" ] ;
fhir:transform [ fhir:v "uuid" ]           ] [
fhir:context [ fhir:v "e9" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "fullUrl" ] ;
fhir:transform [ fhir:v "append" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "https://example/Encounter/" ]             ] [
fhir:value [ fhir:v "uuid9" ]             ] )           ] [
fhir:context [ fhir:v "request" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "url" ] ;
fhir:transform [ fhir:v "copy" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "Encounter" ]             ] )           ] [
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 [ 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 [ fhir:v "'https://example/Encounter/' + %encounterF.id" ]             ] )           ] ) ;
          ( fhir:dependent [
fhir:name [ fhir:v "EncounterFunction" ] ;
            ( fhir:variable [ fhir:v "encounter" ] [ fhir:v "patient" ] [ fhir:v "enc" ] [ fhir:v "encounterF" ] [ fhir:v "bundle" ] )           ] ) ;
fhir:documentation [ fhir:v "entry.encounter as encounter -> enc then{" ]         ] )       ] [
fhir:name [ fhir:v "esenzioni" ] ;
        ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:condition [ fhir:v "code = '57827-8'" ]         ] ) ;
        ( fhir:rule [
fhir:name [ fhir:v "esen" ] ;
          ( fhir:source [
fhir:context [ fhir:v "entry" ] ;
fhir:element [ fhir:v "act" ] ;
fhir:variable [ fhir:v "act" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "bundle" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "entry" ] ;
fhir:variable [ fhir:v "e13" ]           ] [
fhir:context [ fhir:v "e13" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "request" ] ;
fhir:variable [ fhir:v "request" ] ;
fhir:transform [ fhir:v "create" ] ;
            ( fhir:parameter [
fhir:value [ 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 [ fhir:v "POST" ]             ] )           ] [
fhir:context [ fhir:v "e13" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "resource" ] ;
fhir:variable [ fhir:v "coverage" ] ;
fhir:transform [ fhir:v "create" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "Coverage" ]             ] )           ] [
fhir:context [ fhir:v "coverage" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "id" ] ;
fhir:variable [ fhir:v "uuid13" ] ;
fhir:transform [ fhir:v "uuid" ]           ] [
fhir:context [ fhir:v "e13" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "fullUrl" ] ;
fhir:transform [ fhir:v "append" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "https://example/Coverage/" ]             ] [
fhir:value [ fhir:v "uuid13" ]             ] )           ] [
fhir:context [ fhir:v "request" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "url" ] ;
fhir:transform [ fhir:v "copy" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "Coverage" ]             ] )           ] [
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 [ 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 [ fhir:v "'https://example/Coverage/' + %coverage.id" ]             ] )           ] ) ;
          ( fhir:dependent [
fhir:name [ fhir:v "Coverage" ] ;
            ( fhir:variable [ fhir:v "act" ] [ fhir:v "patient" ] [ fhir:v "enc" ] [ fhir:v "coverage" ] [ fhir:v "bundle" ] )           ] )         ] )       ] [
fhir:name [ fhir:v "retiPatologia" ] ;
        ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:condition [ fhir:v "code = 'PSSIT99'" ]         ] ) ;
        ( fhir:rule [
fhir:name [ fhir:v "OrgAffiliation" ] ;
          ( fhir:source [
fhir:context [ fhir:v "entry" ] ;
fhir:element [ fhir:v "act" ] ;
fhir:variable [ fhir:v "act" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "bundle" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "entry" ] ;
fhir:variable [ fhir:v "e14" ]           ] [
fhir:context [ fhir:v "e14" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "request" ] ;
fhir:variable [ fhir:v "request" ] ;
fhir:transform [ fhir:v "create" ] ;
            ( fhir:parameter [
fhir:value [ 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 [ fhir:v "POST" ]             ] )           ] [
fhir:context [ fhir:v "e14" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "resource" ] ;
fhir:variable [ fhir:v "affiliation" ] ;
fhir:transform [ fhir:v "create" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "OrganizationAffiliation" ]             ] )           ] [
fhir:context [ fhir:v "affiliation" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "id" ] ;
fhir:variable [ fhir:v "uuid14" ] ;
fhir:transform [ fhir:v "uuid" ]           ] [
fhir:context [ fhir:v "e14" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "fullUrl" ] ;
fhir:transform [ fhir:v "append" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "https://example/OrganizationAffiliation/" ]             ] [
fhir:value [ fhir:v "uuid14" ]             ] )           ] [
fhir:context [ fhir:v "request" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "url" ] ;
fhir:transform [ fhir:v "copy" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "OrganizationAffiliation" ]             ] )           ] [
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 [ 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 [ fhir:v "'https://example/OrganizationAffiliation/' + %affiliation.id" ]             ] )           ] ) ;
          ( fhir:dependent [
fhir:name [ fhir:v "OrganizationAffiliation" ] ;
            ( fhir:variable [ fhir:v "act" ] [ fhir:v "patient" ] [ fhir:v "enc" ] [ fhir:v "affiliation" ] [ fhir:v "bundle" ] )           ] )         ] )       ] )     ] [
fhir:name [ fhir:v "esiste" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:condition [ fhir:v "src.entry.exists()" ]       ] ) ;
      ( fhir:rule [
fhir:name [ fhir:v "raccoglitore" ] ;
        ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:condition [ fhir:v "code = '18776-5'" ]         ] ) ;
        ( fhir:rule [
fhir:name [ fhir:v "pianiCura" ] ;
          ( fhir:source [
fhir:context [ fhir:v "src" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "bundle" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "entry" ] ;
fhir:variable [ fhir:v "e11" ]           ] [
fhir:context [ fhir:v "e11" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "request" ] ;
fhir:variable [ fhir:v "request" ] ;
fhir:transform [ fhir:v "create" ] ;
            ( fhir:parameter [
fhir:value [ 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 [ fhir:v "POST" ]             ] )           ] [
fhir:context [ fhir:v "e11" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "resource" ] ;
fhir:variable [ fhir:v "careplan" ] ;
fhir:transform [ fhir:v "create" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "CarePlan" ]             ] )           ] [
fhir:context [ fhir:v "careplan" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "id" ] ;
fhir:variable [ fhir:v "uuid11" ] ;
fhir:transform [ fhir:v "uuid" ]           ] [
fhir:context [ fhir:v "e11" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "fullUrl" ] ;
fhir:transform [ fhir:v "append" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "https://example/CarePlan/" ]             ] [
fhir:value [ fhir:v "uuid11" ]             ] )           ] [
fhir:context [ fhir:v "request" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "url" ] ;
fhir:transform [ fhir:v "copy" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "CarePlan" ]             ] )           ] [
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 [ 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 [ fhir:v "'https://example/CarePlan/' + %careplan.id" ]             ] )           ] ) ;
          ( fhir:rule [
fhir:name [ fhir:v "prestazioni" ] ;
            ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "entry" ] ;
fhir:variable [ fhir:v "entry" ]             ] ) ;
            ( fhir:dependent [
fhir:name [ fhir:v "CarePlanFunction" ] ;
              ( fhir:variable [ fhir:v "entry" ] [ fhir:v "careplan" ] [ fhir:v "patient" ] [ fhir:v "enc" ] [ fhir:v "bundle" ] )             ] )           ] )         ] )       ] )     ] [
fhir:name [ fhir:v "code" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:condition [ fhir:v "src.entry.exists().not()" ]       ] ) ;
      ( fhir:rule [
fhir:name [ fhir:v "familyraccoglitore" ] ;
        ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:condition [ fhir:v "code = '10157-6'" ]         ] ) ;
        ( fhir:rule [
fhir:name [ fhir:v "family" ] ;
          ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "text" ] ;
fhir:variable [ fhir:v "text" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "bundle" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "entry" ] ;
fhir:variable [ fhir:v "e12" ]           ] [
fhir:context [ fhir:v "e12" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "request" ] ;
fhir:variable [ fhir:v "request" ] ;
fhir:transform [ fhir:v "create" ] ;
            ( fhir:parameter [
fhir:value [ 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 [ fhir:v "POST" ]             ] )           ] [
fhir:context [ fhir:v "e12" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "resource" ] ;
fhir:variable [ fhir:v "familyMember" ] ;
fhir:transform [ fhir:v "create" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "FamilyMemberHistory" ]             ] )           ] [
fhir:context [ fhir:v "familyMember" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "id" ] ;
fhir:variable [ fhir:v "uuid12" ] ;
fhir:transform [ fhir:v "uuid" ]           ] [
fhir:context [ fhir:v "e12" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "fullUrl" ] ;
fhir:transform [ fhir:v "append" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "https://example/FamilyMemberHistory/" ]             ] [
fhir:value [ fhir:v "uuid12" ]             ] )           ] [
fhir:context [ fhir:v "request" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "url" ] ;
fhir:transform [ fhir:v "copy" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "FamilyMemberHistory" ]             ] )           ] [
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 [ 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 [ fhir:v "'https://example/FamilyMemberHistory/' + %familyMember.id" ]             ] )           ] ) ;
          ( fhir:rule [
fhir:name [ fhir:v "reference" ] ;
            ( fhir:source [
fhir:context [ fhir:v "src" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "familyMember" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "patient" ] ;
fhir:variable [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "create" ] ;
              ( fhir:parameter [
fhir:value [ 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 [ fhir:v "'https://example/Patient/' + %patient.id" ]               ] )             ] )           ] [
fhir:name [ fhir:v "statusS" ] ;
            ( fhir:source [
fhir:context [ fhir:v "src" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "familyMember" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "status" ] ;
fhir:transform [ fhir:v "copy" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "health-unknown" ]               ] )             ] )           ] [
fhir:name [ fhir:v "reference" ] ;
            ( fhir:source [
fhir:context [ fhir:v "text" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "familyMember" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "note" ] ;
fhir:variable [ fhir:v "note" ]             ] ) ;
            ( fhir:rule [
fhir:name [ fhir:v "reference" ] ;
              ( fhir:source [
fhir:context [ fhir:v "text" ] ;
fhir:variable [ fhir:v "t" ]               ] ) ;
              ( fhir:target [
fhir:context [ fhir:v "note" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "text" ] ;
fhir:transform [ fhir:v "copy" ] ;
                ( fhir:parameter [
fhir:value [ fhir:v "t" ]                 ] )               ] )             ] )           ] [
fhir:name [ fhir:v "medication" ] ;
            ( fhir:source [
fhir:context [ fhir:v "text" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "familyMember" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "relationship" ] ;
fhir:variable [ fhir:v "relation" ] ;
fhir:transform [ fhir:v "create" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "CodeableConcept" ]               ] )             ] ) ;
            ( fhir:rule [
fhir:name [ fhir:v "text" ] ;
              ( fhir:source [
fhir:context [ fhir:v "text" ] ;
fhir:variable [ fhir:v "txt" ]               ] ) ;
              ( fhir:target [
fhir:context [ fhir:v "relation" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "text" ] ;
fhir:transform [ fhir:v "copy" ] ;
                ( fhir:parameter [
fhir:value [ fhir:v "txt" ]                 ] )               ] )             ] )           ] )         ] ) ;
fhir:documentation [ fhir:v "Anmanesi Familiare narrativa" ]       ] [
fhir:name [ fhir:v "raccoglitore" ] ;
        ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:condition [ fhir:v "code = '18776-5'" ]         ] ) ;
        ( fhir:rule [
fhir:name [ fhir:v "pianiCura" ] ;
          ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "text" ] ;
fhir:variable [ fhir:v "text" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "bundle" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "entry" ] ;
fhir:variable [ fhir:v "e11" ]           ] [
fhir:context [ fhir:v "e11" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "request" ] ;
fhir:variable [ fhir:v "request" ] ;
fhir:transform [ fhir:v "create" ] ;
            ( fhir:parameter [
fhir:value [ 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 [ fhir:v "POST" ]             ] )           ] [
fhir:context [ fhir:v "e11" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "resource" ] ;
fhir:variable [ fhir:v "careplan" ] ;
fhir:transform [ fhir:v "create" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "CarePlan" ]             ] )           ] [
fhir:context [ fhir:v "careplan" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "id" ] ;
fhir:variable [ fhir:v "uuid11" ] ;
fhir:transform [ fhir:v "uuid" ]           ] [
fhir:context [ fhir:v "e11" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "fullUrl" ] ;
fhir:transform [ fhir:v "append" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "https://example/CarePlan/" ]             ] [
fhir:value [ fhir:v "uuid11" ]             ] )           ] [
fhir:context [ fhir:v "request" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "url" ] ;
fhir:transform [ fhir:v "copy" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "CarePlan" ]             ] )           ] [
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 [ 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 [ fhir:v "'https://example/CarePlan/' + %careplan.id" ]             ] )           ] ) ;
          ( fhir:rule [
fhir:name [ fhir:v "reference" ] ;
            ( fhir:source [
fhir:context [ fhir:v "src" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "careplan" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "subject" ] ;
fhir:variable [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "create" ] ;
              ( fhir:parameter [
fhir:value [ 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 [ fhir:v "'https://example/Patient/' + %patient.id" ]               ] )             ] )           ] [
fhir:name [ fhir:v "status" ] ;
            ( fhir:source [
fhir:context [ fhir:v "src" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "careplan" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "status" ] ;
fhir:transform [ fhir:v "copy" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "active" ]               ] )             ] ) ;
fhir:documentation [ fhir:v "src-> careplan.encounter=create('Reference') as reference,  reference.reference = ('https://example/Encounter/' + %enc.id) \"reference\";" ]           ] [
fhir:name [ fhir:v "intent" ] ;
            ( fhir:source [
fhir:context [ fhir:v "src" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "careplan" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "intent" ] ;
fhir:transform [ fhir:v "copy" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "order" ]               ] )             ] )           ] [
fhir:name [ fhir:v "reference" ] ;
            ( fhir:source [
fhir:context [ fhir:v "text" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "careplan" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "note" ] ;
fhir:variable [ fhir:v "note" ]             ] ) ;
            ( fhir:rule [
fhir:name [ fhir:v "reference" ] ;
              ( fhir:source [
fhir:context [ fhir:v "text" ] ;
fhir:variable [ fhir:v "t" ]               ] ) ;
              ( fhir:target [
fhir:context [ fhir:v "note" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "text" ] ;
fhir:transform [ fhir:v "copy" ] ;
                ( fhir:parameter [
fhir:value [ fhir:v "t" ]                 ] )               ] )             ] )           ] )         ] ) ;
fhir:documentation [ fhir:v "Piano di cura narrativa" ]       ] [
fhir:name [ fhir:v "narrative" ] ;
        ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:condition [ fhir:v "(code = '30954-2') or (code = '29762-2') or (code = '8716-3') or (code = '47420-5') or (code = '42348-3')" ]         ] ) ;
        ( fhir:rule [
fhir:name [ fhir:v "txtsec" ] ;
          ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "text" ] ;
fhir:variable [ fhir:v "text" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "bundle" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "entry" ] ;
fhir:variable [ fhir:v "e13" ]           ] [
fhir:context [ fhir:v "e13" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "request" ] ;
fhir:variable [ fhir:v "request" ] ;
fhir:transform [ fhir:v "create" ] ;
            ( fhir:parameter [
fhir:value [ 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 [ fhir:v "POST" ]             ] )           ] [
fhir:context [ fhir:v "e13" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "resource" ] ;
fhir:variable [ fhir:v "obs1" ] ;
fhir:transform [ fhir:v "create" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "Observation" ]             ] )           ] [
fhir:context [ fhir:v "obs1" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "id" ] ;
fhir:variable [ fhir:v "uuid13" ] ;
fhir:transform [ fhir:v "uuid" ]           ] [
fhir:context [ fhir:v "e13" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "fullUrl" ] ;
fhir:transform [ fhir:v "append" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "https://example/Observation/" ]             ] [
fhir:value [ fhir:v "uuid13" ]             ] )           ] [
fhir:context [ fhir:v "request" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "url" ] ;
fhir:transform [ fhir:v "copy" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "Observation" ]             ] )           ] [
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 [ 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 [ fhir:v "'https://example/Observation/' + %obs1.id" ]             ] )           ] ) ;
          ( fhir:rule [
fhir:name [ fhir:v "reference" ] ;
            ( fhir:source [
fhir:context [ fhir:v "src" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "obs1" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "subject" ] ;
fhir:variable [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "create" ] ;
              ( fhir:parameter [
fhir:value [ 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 [ fhir:v "'https://example/Patient/' + %patient.id" ]               ] )             ] )           ] [
fhir:name [ fhir:v "obsst" ] ;
            ( fhir:source [
fhir:context [ fhir:v "src" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "obs1" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "status" ] ;
fhir:transform [ fhir:v "copy" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "preliminary" ]               ] )             ] ) ;
fhir:documentation [ fhir:v "src -> obs1.encounter=create('Reference') as reference,  reference.reference = ('https://example/Encounter/' + %enc.id) \"reference\";" ]           ] [
fhir:name [ fhir:v "obscde" ] ;
            ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "vvv" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "obs1" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "vvv" ] ;
fhir:transform [ fhir:v "create" ]             ] )           ] [
fhir:name [ fhir:v "statusS" ] ;
            ( fhir:source [
fhir:context [ fhir:v "src" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "obs1" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "status" ] ;
fhir:transform [ fhir:v "copy" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "final" ]               ] )             ] )           ] [
fhir:name [ fhir:v "narrative" ] ;
            ( fhir:source [
fhir:context [ fhir:v "text" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "obs1" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "note" ] ;
fhir:variable [ fhir:v "note" ]             ] ) ;
            ( fhir:rule [
fhir:name [ fhir:v "note" ] ;
              ( fhir:source [
fhir:context [ fhir:v "text" ] ;
fhir:variable [ fhir:v "t" ]               ] ) ;
              ( fhir:target [
fhir:context [ fhir:v "note" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "text" ] ;
fhir:variable [ fhir:v "textNote" ] ;
fhir:transform [ fhir:v "create" ] ;
                ( fhir:parameter [
fhir:value [ fhir:v "string" ]                 ] )               ] ) ;
              ( fhir:dependent [
fhir:name [ fhir:v "EDstring" ] ;
                ( fhir:variable [ fhir:v "t" ] [ fhir:v "textNote" ] )               ] )             ] )           ] )         ] ) ;
fhir:documentation [ fhir:v "sezioni che sono narrative" ]       ] )     ] [
fhir:name [ fhir:v "component" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ] ;
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 "sec" ]         ] ) ;
        ( fhir:target [
fhir:context [ fhir:v "tgt" ] ;
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 "sec" ] [ fhir:v "patient" ] [ fhir:v "tgtSection" ] [ fhir:v "bundle" ] [ fhir:v "enc" ] [ fhir:v "dReport" ] )         ] )       ] )     ] )
  ] [
fhir:name [ fhir:v "Procedure" ] ;
fhir:typeMode [ fhir:v "none" ] ;
    ( fhir:input [
fhir:name [ fhir:v "src" ] ;
fhir:type [ fhir:v "cdaElement" ] ;
fhir:mode [ fhir:v "source" ]     ] [
fhir:name [ fhir:v "patient" ] ;
fhir:type [ fhir:v "Patient" ] ;
fhir:mode [ fhir:v "target" ]     ] [
fhir:name [ fhir:v "encounter" ] ;
fhir:type [ fhir:v "Encounter" ] ;
fhir:mode [ fhir:v "target" ]     ] [
fhir:name [ fhir:v "tgt" ] ;
fhir:type [ fhir:v "Procedure" ] ;
fhir:mode [ fhir:v "target" ]     ] [
fhir:name [ fhir:v "bundle" ] ;
fhir:type [ fhir:v "Bundle" ] ;
fhir:mode [ fhir:v "target" ]     ] ) ;
    ( fhir:rule [
fhir:name [ fhir:v "tx" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "text" ] ;
fhir:variable [ fhir:v "tx" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "note" ] ;
fhir:variable [ fhir:v "note" ]       ] ) ;
      ( fhir:rule [
fhir:name [ fhir:v "r" ] ;
        ( fhir:source [
fhir:context [ fhir:v "tx" ] ;
fhir:element [ fhir:v "reference" ] ;
fhir:variable [ fhir:v "reff" ]         ] ) ;
        ( fhir:target [
fhir:context [ fhir:v "note" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "text" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "reff.value" ]           ] )         ] )       ] ) ;
fhir:documentation [ fhir:v "toASK" ]     ] [
fhir:name [ fhir:v "ref" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "templateId" ] ;
fhir:condition [ fhir:v "root = '2.16.840.1.113883.2.9.10.1.4.3.10.3'" ]       ] ) ;
      ( fhir:rule [
fhir:name [ fhir:v "effectiveTime" ] ;
        ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "effectiveTime" ] ;
fhir:variable [ fhir:v "effectiveTime" ]         ] ) ;
        ( fhir:target [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "performed" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "effectiveTime.value" ]           ] )         ] )       ] [
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 "reference" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "subject" ] ;
fhir:variable [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "create" ] ;
        ( fhir:parameter [
fhir:value [ 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 [ fhir:v "'https://example/Patient/' + %patient.id" ]         ] )       ] )     ] [
fhir:name [ fhir:v "status" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "statusCode" ] ;
fhir:variable [ fhir:v "s" ]       ] ) ;
      ( fhir:rule [
fhir:name [ fhir:v "codeS" ] ;
        ( fhir:source [
fhir:context [ fhir:v "s" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "cos" ]         ] ) ;
        ( fhir:target [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "status" ] ;
fhir:transform [ fhir:v "translate" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "cos" ]           ] [
fhir:value [ fhir:v "#EventStatus" ]           ] [
fhir:value [ fhir:v "code" ]           ] )         ] )       ] ) ;
fhir:documentation [ fhir:v "src -> tgt.encounter=create('Reference') as reference,  reference.reference = ('https://example/Encounter/' + %encounter.id) \"reference\";" ]     ] [
fhir:name [ fhir:v "status2" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:condition [ fhir:v "statusCode.exists().not()" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "status" ] ;
fhir:transform [ fhir:v "copy" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "unknown" ]         ] )       ] )     ] [
fhir:name [ fhir:v "presenzaProtesiImpianto" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "templateId" ] ;
fhir:condition [ fhir:v "root = '2.16.840.1.113883.2.9.10.1.4.3.9.1'" ]       ] ) ;
      ( fhir:rule [
fhir:name [ fhir:v "device" ] ;
        ( fhir:source [
fhir:context [ fhir:v "src" ]         ] ) ;
        ( 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 [ 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 [ fhir:v "POST" ]           ] )         ] [
fhir:context [ fhir:v "e1" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "resource" ] ;
fhir:variable [ fhir:v "deviceRes" ] ;
fhir:transform [ fhir:v "create" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "Device" ]           ] )         ] [
fhir:context [ fhir:v "deviceRes" ] ;
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 [ fhir:v "https://example/Device/" ]           ] [
fhir:value [ 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 [ fhir:v "Device" ]           ] )         ] [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "usedReference" ] ;
fhir:variable [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "create" ] ;
          ( fhir:parameter [
fhir:value [ 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 [ fhir:v "'https://example/Device/' + %deviceRes.id" ]           ] )         ] ) ;
        ( fhir:rule [
fhir:name [ fhir:v "reference" ] ;
          ( fhir:source [
fhir:context [ fhir:v "src" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "deviceRes" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "patient" ] ;
fhir:variable [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "create" ] ;
            ( fhir:parameter [
fhir:value [ 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 [ fhir:v "'https://example/Patient/' + %patient.id" ]             ] )           ] )         ] [
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 "deviceRes" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "type" ] ;
fhir:variable [ fhir:v "vvv" ] ;
fhir:transform [ fhir:v "create" ]           ] )         ] )       ] [
fhir:name [ fhir:v "value1" ] ;
        ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "effectiveTime" ] ;
fhir:variable [ fhir:v "effectiveTime" ] ;
fhir:condition [ fhir:v "(value.exists())" ]         ] ) ;
        ( fhir:target [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "performed" ] ;
fhir:variable [ fhir:v "value" ] ;
fhir:transform [ fhir:v "create" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "dateTime" ]           ] )         ] ) ;
        ( fhir:dependent [
fhir:name [ fhir:v "TSDateTime" ] ;
          ( fhir:variable [ fhir:v "effectiveTime" ] [ fhir:v "value" ] )         ] )       ] [
fhir:name [ fhir:v "valuePeriod" ] ;
        ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "effectiveTime" ] ;
fhir:variable [ fhir:v "effectiveTime" ] ;
fhir:condition [ fhir:v "(low.exists())" ]         ] ) ;
        ( fhir:target [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "performed" ] ;
fhir:variable [ fhir:v "value" ] ;
fhir:transform [ fhir:v "create" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "Period" ]           ] )         ] ) ;
        ( fhir:dependent [
fhir:name [ fhir:v "IVLTSPeriod" ] ;
          ( fhir:variable [ fhir:v "effectiveTime" ] [ fhir:v "value" ] )         ] )       ] )     ] [
fhir:name [ fhir:v "assenza" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "templateId" ] ;
fhir:condition [ fhir:v "root = '2.16.840.1.113883.2.9.10.1.4.3.9.2'" ]       ] ) ;
      ( fhir:rule [
fhir:name [ fhir:v "note" ] ;
        ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "code" ]         ] ) ;
        ( fhir:target [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "note" ] ;
fhir:variable [ fhir:v "note" ]         ] ) ;
        ( fhir:rule [
fhir:name [ fhir:v "text" ] ;
          ( fhir:source [
fhir:context [ fhir:v "code" ] ;
fhir:element [ fhir:v "displayName" ] ;
fhir:variable [ fhir:v "displayName" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "note" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "text" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "displayName" ]             ] )           ] )         ] )       ] )     ] [
fhir:name [ fhir:v "procedureTrattamenti" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "templateId" ] ;
fhir:condition [ fhir:v "root = '2.16.840.1.113883.2.9.10.1.4.3.11.1'" ]       ] ) ;
      ( fhir:rule [
fhir:name [ fhir:v "id" ] ;
        ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "id" ] ;
fhir:variable [ fhir:v "vvv" ]         ] ) ;
        ( fhir:target [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "identifier" ] ;
fhir:variable [ fhir:v "vvv" ] ;
fhir:transform [ fhir:v "create" ]         ] )       ] [
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 "value1" ] ;
        ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "effectiveTime" ] ;
fhir:variable [ fhir:v "effectiveTime" ] ;
fhir:condition [ fhir:v "(value.exists())" ]         ] ) ;
        ( fhir:target [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "performed" ] ;
fhir:variable [ fhir:v "value" ] ;
fhir:transform [ fhir:v "create" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "dateTime" ]           ] )         ] ) ;
        ( fhir:dependent [
fhir:name [ fhir:v "TSDateTime" ] ;
          ( fhir:variable [ fhir:v "effectiveTime" ] [ fhir:v "value" ] )         ] )       ] [
fhir:name [ fhir:v "valuePeriod" ] ;
        ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "effectiveTime" ] ;
fhir:variable [ fhir:v "effectiveTime" ] ;
fhir:condition [ fhir:v "(low.exists())" ]         ] ) ;
        ( fhir:target [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "performed" ] ;
fhir:variable [ fhir:v "value" ] ;
fhir:transform [ fhir:v "create" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "Period" ]           ] )         ] ) ;
        ( fhir:dependent [
fhir:name [ fhir:v "IVLTSPeriod" ] ;
          ( fhir:variable [ fhir:v "effectiveTime" ] [ fhir:v "value" ] )         ] )       ] [
fhir:name [ fhir:v "entryRelProcedure" ] ;
        ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "entryRelationship" ] ;
fhir:variable [ fhir:v "entryR" ]         ] ) ;
        ( fhir:rule [
fhir:name [ fhir:v "observation" ] ;
          ( fhir:source [
fhir:context [ fhir:v "entryR" ] ;
fhir:element [ fhir:v "observation" ] ;
fhir:variable [ fhir:v "observation" ]           ] ) ;
          ( fhir:target [
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 [ 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 [ fhir:v "POST" ]             ] )           ] [
fhir:context [ fhir:v "e3" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "resource" ] ;
fhir:variable [ fhir:v "obs1" ] ;
fhir:transform [ fhir:v "create" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "Observation" ]             ] )           ] [
fhir:context [ fhir:v "obs1" ] ;
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 [ fhir:v "https://example/Observation/" ]             ] [
fhir:value [ 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 [ fhir:v "Observation" ]             ] )           ] [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "reasonReference" ] ;
fhir:variable [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "create" ] ;
            ( fhir:parameter [
fhir:value [ 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 [ fhir:v "'https://example/Observation/' + %obs1.id" ]             ] )           ] ) ;
          ( fhir:dependent [
fhir:name [ fhir:v "Observation" ] ;
            ( fhir:variable [ fhir:v "observation" ] [ fhir:v "patient" ] [ fhir:v "encounter" ] [ fhir:v "obs1" ] [ fhir:v "bundle" ] )           ] )         ] )       ] )     ] )
  ] [
fhir:name [ fhir:v "Observation" ] ;
fhir:typeMode [ fhir:v "none" ] ;
    ( fhir:input [
fhir:name [ fhir:v "cda" ] ;
fhir:mode [ fhir:v "source" ]     ] [
fhir:name [ fhir:v "patient" ] ;
fhir:type [ fhir:v "Patient" ] ;
fhir:mode [ fhir:v "target" ]     ] [
fhir:name [ fhir:v "encounter" ] ;
fhir:type [ fhir:v "Encounter" ] ;
fhir:mode [ fhir:v "target" ]     ] [
fhir:name [ fhir:v "ob" ] ;
fhir:type [ fhir:v "Observation" ] ;
fhir:mode [ fhir:v "target" ]     ] [
fhir:name [ fhir:v "bundle" ] ;
fhir:type [ fhir:v "Bundle" ] ;
fhir:mode [ fhir:v "target" ]     ] ) ;
    ( fhir:rule [
fhir:name [ fhir:v "reference" ] ;
      ( fhir:source [
fhir:context [ fhir:v "cda" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "ob" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "subject" ] ;
fhir:variable [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "create" ] ;
        ( fhir:parameter [
fhir:value [ 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 [ fhir:v "'https://example/Patient/' + %patient.id" ]         ] )       ] )     ] [
fhir:name [ fhir:v "id" ] ;
      ( fhir:source [
fhir:context [ fhir:v "cda" ] ;
fhir:element [ fhir:v "id" ] ;
fhir:variable [ fhir:v "vvv" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "ob" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "identifier" ] ;
fhir:variable [ fhir:v "vvv" ] ;
fhir:transform [ fhir:v "create" ]       ] ) ;
fhir:documentation [ fhir:v "cda-> ob.encounter=create('Reference') as reference,  reference.reference = ('https://example/Encounter/' + %encounter.id) \"reference\";" ]     ] [
fhir:name [ fhir:v "code" ] ;
      ( fhir:source [
fhir:context [ fhir:v "cda" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "vvv" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "ob" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "vvv" ] ;
fhir:transform [ fhir:v "create" ]       ] )     ] [
fhir:name [ fhir:v "Stats" ] ;
      ( fhir:source [
fhir:context [ fhir:v "cda" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "ob" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "status" ] ;
fhir:transform [ fhir:v "copy" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "final" ]         ] )       ] )     ] [
fhir:name [ fhir:v "value" ] ;
      ( fhir:source [
fhir:context [ fhir:v "cda" ] ;
fhir:type [ fhir:v "ST" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:variable [ fhir:v "st" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "ob" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:transform [ fhir:v "create" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "string" ]         ] )       ] [
fhir:context [ fhir:v "ob" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "st.dataString" ]         ] )       ] ) ;
fhir:documentation [ fhir:v "value datatype" ]     ] [
fhir:name [ fhir:v "boolean" ] ;
      ( fhir:source [
fhir:context [ fhir:v "cda" ] ;
fhir:type [ fhir:v "BL" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:variable [ fhir:v "boolean" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "ob" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "boolean.value" ]         ] )       ] )     ] [
fhir:name [ fhir:v "intval" ] ;
      ( fhir:source [
fhir:context [ fhir:v "cda" ] ;
fhir:type [ fhir:v "INT" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:variable [ fhir:v "int" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "ob" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "int.value" ]         ] )       ] )     ] [
fhir:name [ fhir:v "val" ] ;
      ( fhir:source [
fhir:context [ fhir:v "cda" ] ;
fhir:type [ fhir:v "CE" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:variable [ fhir:v "val" ]       ] ) ;
      ( fhir:rule [
fhir:name [ fhir:v "coding" ] ;
        ( fhir:source [
fhir:context [ fhir:v "val" ]         ] ) ;
        ( fhir:target [
fhir:context [ fhir:v "ob" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:variable [ fhir:v "ce" ] ;
fhir:transform [ fhir:v "create" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "CodeableConcept" ]           ] )         ] ) ;
        ( fhir:rule [
fhir:name [ fhir:v "originalText" ] ;
          ( fhir:source [
fhir:context [ fhir:v "val" ] ;
fhir:element [ fhir:v "originalText" ] ;
fhir:variable [ fhir:v "originalText" ]           ] ) ;
          ( fhir:rule [
fhir:name [ fhir:v "reference" ] ;
            ( fhir:source [
fhir:context [ fhir:v "originalText" ] ;
fhir:element [ fhir:v "reference" ] ;
fhir:variable [ fhir:v "reference" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "ce" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "text" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "reference.value" ]               ] )             ] )           ] )         ] [
fhir:name [ fhir:v "code" ] ;
          ( fhir:source [
fhir:context [ fhir:v "val" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "ce" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "coding" ] ;
fhir:variable [ fhir:v "coding" ]           ] ) ;
          ( fhir:rule [
fhir:name [ fhir:v "code" ] ;
            ( fhir:source [
fhir:context [ fhir:v "val" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "code" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "coding" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:transform [ fhir:v "cast" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "code" ]               ] [
fhir:value [ fhir:v "string" ]               ] )             ] )           ] [
fhir:name [ fhir:v "codeSystem" ] ;
            ( fhir:source [
fhir:context [ fhir:v "val" ] ;
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 [ fhir:v "system" ]               ] [
fhir:value [ fhir:v "http://hl7.org/fhir/ConceptMap/special-oid2uri" ]               ] [
fhir:value [ fhir:v "uri" ]               ] )             ] )           ] [
fhir:name [ fhir:v "displayName" ] ;
            ( fhir:source [
fhir:context [ fhir:v "val" ] ;
fhir:element [ fhir:v "displayName" ] ;
fhir:variable [ fhir:v "display" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "coding" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "display" ] ;
fhir:transform [ fhir:v "cast" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "display" ]               ] [
fhir:value [ fhir:v "string" ]               ] )             ] )           ] )         ] [
fhir:name [ fhir:v "translation" ] ;
          ( fhir:source [
fhir:context [ fhir:v "val" ] ;
fhir:element [ fhir:v "translation" ] ;
fhir:variable [ fhir:v "translation" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "ce" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "coding" ] ;
fhir:variable [ fhir:v "coding" ]           ] ) ;
          ( fhir:rule [
fhir:name [ fhir:v "code" ] ;
            ( fhir:source [
fhir:context [ fhir:v "translation" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "code" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "coding" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:transform [ fhir:v "cast" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "code" ]               ] [
fhir:value [ fhir:v "string" ]               ] )             ] )           ] [
fhir:name [ fhir:v "codeSystem" ] ;
            ( fhir:source [
fhir:context [ fhir:v "translation" ] ;
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 [ fhir:v "system" ]               ] [
fhir:value [ fhir:v "http://hl7.org/fhir/ConceptMap/special-oid2uri" ]               ] [
fhir:value [ fhir:v "uri" ]               ] )             ] )           ] [
fhir:name [ fhir:v "displayName" ] ;
            ( fhir:source [
fhir:context [ fhir:v "translation" ] ;
fhir:element [ fhir:v "displayName" ] ;
fhir:variable [ fhir:v "display" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "coding" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "display" ] ;
fhir:transform [ fhir:v "cast" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "display" ]               ] [
fhir:value [ fhir:v "string" ]               ] )             ] )           ] [
fhir:name [ fhir:v "qualifier" ] ;
            ( fhir:source [
fhir:context [ fhir:v "translation" ] ;
fhir:element [ fhir:v "qualifier" ] ;
fhir:variable [ fhir:v "qualifier" ]             ] ) ;
            ( fhir:rule [
fhir:name [ fhir:v "value" ] ;
              ( fhir:source [
fhir:context [ fhir:v "qualifier" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:variable [ fhir:v "value" ]               ] ) ;
              ( fhir:target [
fhir:context [ fhir:v "ce" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "coding" ] ;
fhir:variable [ fhir:v "coding" ]               ] ) ;
              ( fhir:rule [
fhir:name [ fhir:v "code" ] ;
                ( fhir:source [
fhir:context [ fhir:v "value" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "code" ]                 ] ) ;
                ( fhir:target [
fhir:context [ fhir:v "coding" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:transform [ fhir:v "cast" ] ;
                  ( fhir:parameter [
fhir:value [ fhir:v "code" ]                   ] [
fhir:value [ fhir:v "string" ]                   ] )                 ] )               ] [
fhir:name [ fhir:v "codeSystem" ] ;
                ( fhir:source [
fhir:context [ fhir:v "value" ] ;
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 [ fhir:v "system" ]                   ] [
fhir:value [ fhir:v "http://hl7.org/fhir/ConceptMap/special-oid2uri" ]                   ] [
fhir:value [ fhir:v "uri" ]                   ] )                 ] )               ] [
fhir:name [ fhir:v "displayName" ] ;
                ( fhir:source [
fhir:context [ fhir:v "value" ] ;
fhir:element [ fhir:v "displayName" ] ;
fhir:variable [ fhir:v "display" ]                 ] ) ;
                ( fhir:target [
fhir:context [ fhir:v "coding" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "display" ] ;
fhir:transform [ fhir:v "cast" ] ;
                  ( fhir:parameter [
fhir:value [ fhir:v "display" ]                   ] [
fhir:value [ fhir:v "string" ]                   ] )                 ] )               ] )             ] )           ] )         ] )       ] )     ] [
fhir:name [ fhir:v "val" ] ;
      ( fhir:source [
fhir:context [ fhir:v "cda" ] ;
fhir:type [ fhir:v "CD" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:variable [ fhir:v "val" ]       ] ) ;
      ( fhir:rule [
fhir:name [ fhir:v "coding" ] ;
        ( fhir:source [
fhir:context [ fhir:v "val" ]         ] ) ;
        ( fhir:target [
fhir:context [ fhir:v "ob" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:variable [ fhir:v "ce" ] ;
fhir:transform [ fhir:v "create" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "CodeableConcept" ]           ] )         ] ) ;
        ( fhir:rule [
fhir:name [ fhir:v "originalText" ] ;
          ( fhir:source [
fhir:context [ fhir:v "val" ] ;
fhir:element [ fhir:v "originalText" ] ;
fhir:variable [ fhir:v "originalText" ]           ] ) ;
          ( fhir:rule [
fhir:name [ fhir:v "reference" ] ;
            ( fhir:source [
fhir:context [ fhir:v "originalText" ] ;
fhir:element [ fhir:v "reference" ] ;
fhir:variable [ fhir:v "reference" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "ce" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "text" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "reference.value" ]               ] )             ] )           ] )         ] [
fhir:name [ fhir:v "code" ] ;
          ( fhir:source [
fhir:context [ fhir:v "val" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "ce" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "coding" ] ;
fhir:variable [ fhir:v "coding" ]           ] ) ;
          ( fhir:rule [
fhir:name [ fhir:v "code" ] ;
            ( fhir:source [
fhir:context [ fhir:v "val" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "code" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "coding" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:transform [ fhir:v "cast" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "code" ]               ] [
fhir:value [ fhir:v "string" ]               ] )             ] )           ] [
fhir:name [ fhir:v "codeSystem" ] ;
            ( fhir:source [
fhir:context [ fhir:v "val" ] ;
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 [ fhir:v "system" ]               ] [
fhir:value [ fhir:v "http://hl7.org/fhir/ConceptMap/special-oid2uri" ]               ] [
fhir:value [ fhir:v "uri" ]               ] )             ] )           ] [
fhir:name [ fhir:v "displayName" ] ;
            ( fhir:source [
fhir:context [ fhir:v "val" ] ;
fhir:element [ fhir:v "displayName" ] ;
fhir:variable [ fhir:v "display" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "coding" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "display" ] ;
fhir:transform [ fhir:v "cast" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "display" ]               ] [
fhir:value [ fhir:v "string" ]               ] )             ] )           ] )         ] [
fhir:name [ fhir:v "translation" ] ;
          ( fhir:source [
fhir:context [ fhir:v "val" ] ;
fhir:element [ fhir:v "translation" ] ;
fhir:variable [ fhir:v "translation" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "ce" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "coding" ] ;
fhir:variable [ fhir:v "coding" ]           ] ) ;
          ( fhir:rule [
fhir:name [ fhir:v "code" ] ;
            ( fhir:source [
fhir:context [ fhir:v "translation" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "code" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "coding" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:transform [ fhir:v "cast" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "code" ]               ] [
fhir:value [ fhir:v "string" ]               ] )             ] )           ] [
fhir:name [ fhir:v "codeSystem" ] ;
            ( fhir:source [
fhir:context [ fhir:v "translation" ] ;
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 [ fhir:v "system" ]               ] [
fhir:value [ fhir:v "http://hl7.org/fhir/ConceptMap/special-oid2uri" ]               ] [
fhir:value [ fhir:v "uri" ]               ] )             ] )           ] [
fhir:name [ fhir:v "displayName" ] ;
            ( fhir:source [
fhir:context [ fhir:v "translation" ] ;
fhir:element [ fhir:v "displayName" ] ;
fhir:variable [ fhir:v "display" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "coding" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "display" ] ;
fhir:transform [ fhir:v "cast" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "display" ]               ] [
fhir:value [ fhir:v "string" ]               ] )             ] )           ] [
fhir:name [ fhir:v "qualifier" ] ;
            ( fhir:source [
fhir:context [ fhir:v "translation" ] ;
fhir:element [ fhir:v "qualifier" ] ;
fhir:variable [ fhir:v "qualifier" ]             ] ) ;
            ( fhir:rule [
fhir:name [ fhir:v "value" ] ;
              ( fhir:source [
fhir:context [ fhir:v "qualifier" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:variable [ fhir:v "value" ]               ] ) ;
              ( fhir:target [
fhir:context [ fhir:v "ce" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "coding" ] ;
fhir:variable [ fhir:v "coding" ]               ] ) ;
              ( fhir:rule [
fhir:name [ fhir:v "code" ] ;
                ( fhir:source [
fhir:context [ fhir:v "value" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "code" ]                 ] ) ;
                ( fhir:target [
fhir:context [ fhir:v "coding" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:transform [ fhir:v "cast" ] ;
                  ( fhir:parameter [
fhir:value [ fhir:v "code" ]                   ] [
fhir:value [ fhir:v "string" ]                   ] )                 ] )               ] [
fhir:name [ fhir:v "codeSystem" ] ;
                ( fhir:source [
fhir:context [ fhir:v "value" ] ;
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 [ fhir:v "system" ]                   ] [
fhir:value [ fhir:v "http://hl7.org/fhir/ConceptMap/special-oid2uri" ]                   ] [
fhir:value [ fhir:v "uri" ]                   ] )                 ] )               ] [
fhir:name [ fhir:v "displayName" ] ;
                ( fhir:source [
fhir:context [ fhir:v "value" ] ;
fhir:element [ fhir:v "displayName" ] ;
fhir:variable [ fhir:v "display" ]                 ] ) ;
                ( fhir:target [
fhir:context [ fhir:v "coding" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "display" ] ;
fhir:transform [ fhir:v "cast" ] ;
                  ( fhir:parameter [
fhir:value [ fhir:v "display" ]                   ] [
fhir:value [ fhir:v "string" ]                   ] )                 ] )               ] )             ] )           ] )         ] )       ] )     ] [
fhir:name [ fhir:v "valueQuantity" ] ;
      ( fhir:source [
fhir:context [ fhir:v "cda" ] ;
fhir:type [ fhir:v "PQ" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:variable [ fhir:v "val" ]       ] ) ;
      ( fhir:rule [
fhir:name [ fhir:v "quantity" ] ;
        ( fhir:source [
fhir:context [ fhir:v "val" ]         ] ) ;
        ( fhir:target [
fhir:context [ fhir:v "ob" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:variable [ fhir:v "quantity" ] ;
fhir:transform [ fhir:v "create" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "Quantity" ]           ] )         ] ) ;
        ( fhir:rule [
fhir:name [ fhir:v "value" ] ;
          ( fhir:source [
fhir:context [ fhir:v "val" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:variable [ fhir:v "value" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "quantity" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:transform [ fhir:v "copy" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "value" ]             ] )           ] )         ] [
fhir:name [ fhir:v "unit" ] ;
          ( fhir:source [
fhir:context [ fhir:v "val" ] ;
fhir:element [ fhir:v "unit" ] ;
fhir:variable [ fhir:v "unit" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "quantity" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "unit" ] ;
fhir:transform [ fhir:v "copy" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "unit" ]             ] )           ] )         ] )       ] )     ] [
fhir:name [ fhir:v "value1" ] ;
      ( fhir:source [
fhir:context [ fhir:v "cda" ] ;
fhir:element [ fhir:v "effectiveTime" ] ;
fhir:variable [ fhir:v "effectiveTime" ] ;
fhir:condition [ fhir:v "(value.exists())" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "ob" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "effective" ] ;
fhir:variable [ fhir:v "value" ] ;
fhir:transform [ fhir:v "create" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "dateTime" ]         ] )       ] ) ;
      ( fhir:dependent [
fhir:name [ fhir:v "TSDateTime" ] ;
        ( fhir:variable [ fhir:v "effectiveTime" ] [ fhir:v "value" ] )       ] )     ] [
fhir:name [ fhir:v "valuePeriod" ] ;
      ( fhir:source [
fhir:context [ fhir:v "cda" ] ;
fhir:element [ fhir:v "effectiveTime" ] ;
fhir:variable [ fhir:v "effectiveTime" ] ;
fhir:condition [ fhir:v "(low.exists())" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "ob" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "effective" ] ;
fhir:variable [ fhir:v "value" ] ;
fhir:transform [ fhir:v "create" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "Period" ]         ] )       ] ) ;
      ( fhir:dependent [
fhir:name [ fhir:v "IVLTSPeriod" ] ;
        ( fhir:variable [ fhir:v "effectiveTime" ] [ fhir:v "value" ] )       ] )     ] [
fhir:name [ fhir:v "note" ] ;
      ( fhir:source [
fhir:context [ fhir:v "cda" ] ;
fhir:element [ fhir:v "text" ] ;
fhir:variable [ fhir:v "text" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "ob" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "note" ] ;
fhir:variable [ fhir:v "note" ]       ] ) ;
      ( fhir:rule [
fhir:name [ fhir:v "text" ] ;
        ( fhir:source [
fhir:context [ fhir:v "text" ] ;
fhir:element [ fhir:v "reference" ] ;
fhir:variable [ fhir:v "reference" ]         ] ) ;
        ( fhir:target [
fhir:context [ fhir:v "note" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "text" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "reference.value" ]           ] )         ] )       ] )     ] [
fhir:name [ fhir:v "status" ] ;
      ( fhir:source [
fhir:context [ fhir:v "cda" ] ;
fhir:element [ fhir:v "statusCode" ] ;
fhir:variable [ fhir:v "s" ]       ] ) ;
      ( fhir:rule [
fhir:name [ fhir:v "codeS" ] ;
        ( fhir:source [
fhir:context [ fhir:v "s" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "cos" ]         ] ) ;
        ( fhir:target [
fhir:context [ fhir:v "ob" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "status" ] ;
fhir:transform [ fhir:v "translate" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "cos" ]           ] [
fhir:value [ fhir:v "#OBSstatus" ]           ] [
fhir:value [ fhir:v "code" ]           ] )         ] )       ] )     ] [
fhir:name [ fhir:v "methodCode" ] ;
      ( fhir:source [
fhir:context [ fhir:v "cda" ] ;
fhir:element [ fhir:v "methodCode" ] ;
fhir:variable [ fhir:v "vvv" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "ob" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "method" ] ;
fhir:variable [ fhir:v "vvv" ] ;
fhir:transform [ fhir:v "create" ]       ] ) ;
fhir:documentation [ fhir:v "toASK è giusto siano invertiti?" ]     ] [
fhir:name [ fhir:v "interpretationCode" ] ;
      ( fhir:source [
fhir:context [ fhir:v "cda" ] ;
fhir:element [ fhir:v "interpretationCode" ] ;
fhir:variable [ fhir:v "vvv" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "ob" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "interpretation" ] ;
fhir:variable [ fhir:v "vvv" ] ;
fhir:transform [ fhir:v "create" ]       ] )     ] [
fhir:name [ fhir:v "targetSiteCode" ] ;
      ( fhir:source [
fhir:context [ fhir:v "cda" ] ;
fhir:element [ fhir:v "targetSiteCode" ] ;
fhir:variable [ fhir:v "vvv" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "ob" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "bodySite" ] ;
fhir:variable [ fhir:v "vvv" ] ;
fhir:transform [ fhir:v "create" ]       ] )     ] [
fhir:name [ fhir:v "regrange" ] ;
      ( fhir:source [
fhir:context [ fhir:v "cda" ] ;
fhir:element [ fhir:v "referenceRange" ] ;
fhir:variable [ fhir:v "refrange" ]       ] ) ;
      ( fhir:rule [
fhir:name [ fhir:v "obsrange" ] ;
        ( fhir:source [
fhir:context [ fhir:v "refrange" ] ;
fhir:element [ fhir:v "observationRange" ] ;
fhir:variable [ fhir:v "obsrange" ]         ] ) ;
        ( fhir:rule [
fhir:name [ fhir:v "refFhir" ] ;
          ( fhir:source [
fhir:context [ fhir:v "obsrange" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:variable [ fhir:v "val" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "ob" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "referenceRange" ] ;
fhir:variable [ fhir:v "refrangeFH" ] ;
fhir:transform [ fhir:v "create" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "BackboneElement" ]             ] )           ] ) ;
          ( fhir:rule [
fhir:name [ fhir:v "de" ] ;
            ( fhir:source [
fhir:context [ fhir:v "val" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "refrangeFH" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "low" ] ;
fhir:variable [ fhir:v "lowfhir" ] ;
fhir:transform [ fhir:v "create" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "SimpleQuantity" ]               ] )             ] ) ;
            ( fhir:rule [
fhir:name [ fhir:v "val" ] ;
              ( fhir:source [
fhir:context [ fhir:v "val" ] ;
fhir:element [ fhir:v "low" ] ;
fhir:variable [ fhir:v "l" ]               ] ) ;
              ( fhir:target [
fhir:context [ fhir:v "lowfhir" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
                ( fhir:parameter [
fhir:value [ fhir:v "l.value" ]                 ] )               ] )             ] [
fhir:name [ fhir:v "val" ] ;
              ( fhir:source [
fhir:context [ fhir:v "val" ] ;
fhir:element [ fhir:v "low" ] ;
fhir:variable [ fhir:v "l" ]               ] ) ;
              ( fhir:target [
fhir:context [ fhir:v "lowfhir" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "unit" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
                ( fhir:parameter [
fhir:value [ fhir:v "l.unit" ]                 ] )               ] )             ] )           ] [
fhir:name [ fhir:v "de" ] ;
            ( fhir:source [
fhir:context [ fhir:v "val" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "refrangeFH" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "high" ] ;
fhir:variable [ fhir:v "highfhir" ] ;
fhir:transform [ fhir:v "create" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "SimpleQuantity" ]               ] )             ] ) ;
            ( fhir:rule [
fhir:name [ fhir:v "val" ] ;
              ( fhir:source [
fhir:context [ fhir:v "val" ] ;
fhir:element [ fhir:v "high" ] ;
fhir:variable [ fhir:v "h" ]               ] ) ;
              ( fhir:target [
fhir:context [ fhir:v "highfhir" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
                ( fhir:parameter [
fhir:value [ fhir:v "h.value" ]                 ] )               ] )             ] [
fhir:name [ fhir:v "val" ] ;
              ( fhir:source [
fhir:context [ fhir:v "val" ] ;
fhir:element [ fhir:v "high" ] ;
fhir:variable [ fhir:v "h" ]               ] ) ;
              ( fhir:target [
fhir:context [ fhir:v "highfhir" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "unit" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
                ( fhir:parameter [
fhir:value [ fhir:v "h.unit" ]                 ] )               ] )             ] )           ] )         ] )       ] ) ;
fhir:documentation [ fhir:v "added" ]     ] )
  ] [
fhir:name [ fhir:v "ObservationOrganizer" ] ;
fhir:typeMode [ fhir:v "none" ] ;
    ( fhir:input [
fhir:name [ fhir:v "section" ] ;
fhir:type [ fhir:v "section" ] ;
fhir:mode [ fhir:v "source" ]     ] [
fhir:name [ fhir:v "cda" ] ;
fhir:type [ fhir:v "organizer" ] ;
fhir:mode [ fhir:v "source" ]     ] [
fhir:name [ fhir:v "patient" ] ;
fhir:type [ fhir:v "Patient" ] ;
fhir:mode [ fhir:v "target" ]     ] [
fhir:name [ fhir:v "encounter" ] ;
fhir:type [ fhir:v "Encounter" ] ;
fhir:mode [ fhir:v "target" ]     ] [
fhir:name [ fhir:v "ob" ] ;
fhir:type [ fhir:v "Observation" ] ;
fhir:mode [ fhir:v "target" ]     ] [
fhir:name [ fhir:v "bundle" ] ;
fhir:type [ fhir:v "Bundle" ] ;
fhir:mode [ fhir:v "target" ]     ] ) ;
    ( fhir:rule [
fhir:name [ fhir:v "reference" ] ;
      ( fhir:source [
fhir:context [ fhir:v "cda" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "ob" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "subject" ] ;
fhir:variable [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "create" ] ;
        ( fhir:parameter [
fhir:value [ 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 [ fhir:v "'https://example/Patient/' + %patient.id" ]         ] )       ] )     ] [
fhir:name [ fhir:v "id" ] ;
      ( fhir:source [
fhir:context [ fhir:v "cda" ] ;
fhir:element [ fhir:v "id" ] ;
fhir:variable [ fhir:v "vvv" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "ob" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "identifier" ] ;
fhir:variable [ fhir:v "vvv" ] ;
fhir:transform [ fhir:v "create" ]       ] ) ;
fhir:documentation [ fhir:v "cda-> ob.encounter=create('Reference') as reference,  reference.reference = ('https://example/Encounter/' + %encounter.id) \"reference\";" ]     ] [
fhir:name [ fhir:v "code" ] ;
      ( fhir:source [
fhir:context [ fhir:v "section" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "vvv" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "ob" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "vvv" ] ;
fhir:transform [ fhir:v "create" ]       ] )     ] [
fhir:name [ fhir:v "Stats" ] ;
      ( fhir:source [
fhir:context [ fhir:v "cda" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "ob" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "status" ] ;
fhir:transform [ fhir:v "copy" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "final" ]         ] )       ] )     ] [
fhir:name [ fhir:v "value1" ] ;
      ( fhir:source [
fhir:context [ fhir:v "cda" ] ;
fhir:element [ fhir:v "effectiveTime" ] ;
fhir:variable [ fhir:v "effectiveTime" ] ;
fhir:condition [ fhir:v "(value.exists())" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "ob" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "effective" ] ;
fhir:variable [ fhir:v "value" ] ;
fhir:transform [ fhir:v "create" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "dateTime" ]         ] )       ] ) ;
      ( fhir:dependent [
fhir:name [ fhir:v "TSDateTime" ] ;
        ( fhir:variable [ fhir:v "effectiveTime" ] [ fhir:v "value" ] )       ] )     ] [
fhir:name [ fhir:v "valuePeriod" ] ;
      ( fhir:source [
fhir:context [ fhir:v "cda" ] ;
fhir:element [ fhir:v "effectiveTime" ] ;
fhir:variable [ fhir:v "effectiveTime" ] ;
fhir:condition [ fhir:v "(low.exists())" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "ob" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "effective" ] ;
fhir:variable [ fhir:v "value" ] ;
fhir:transform [ fhir:v "create" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "Period" ]         ] )       ] ) ;
      ( fhir:dependent [
fhir:name [ fhir:v "IVLTSPeriod" ] ;
        ( fhir:variable [ fhir:v "effectiveTime" ] [ fhir:v "value" ] )       ] )     ] [
fhir:name [ fhir:v "note" ] ;
      ( fhir:source [
fhir:context [ fhir:v "cda" ] ;
fhir:element [ fhir:v "text" ] ;
fhir:variable [ fhir:v "text" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "ob" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "note" ] ;
fhir:variable [ fhir:v "note" ]       ] ) ;
      ( fhir:rule [
fhir:name [ fhir:v "text" ] ;
        ( fhir:source [
fhir:context [ fhir:v "text" ] ;
fhir:element [ fhir:v "reference" ] ;
fhir:variable [ fhir:v "reference" ]         ] ) ;
        ( fhir:target [
fhir:context [ fhir:v "note" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "text" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "reference.value" ]           ] )         ] )       ] )     ] [
fhir:name [ fhir:v "status" ] ;
      ( fhir:source [
fhir:context [ fhir:v "cda" ] ;
fhir:element [ fhir:v "statusCode" ] ;
fhir:variable [ fhir:v "s" ]       ] ) ;
      ( fhir:rule [
fhir:name [ fhir:v "codeS" ] ;
        ( fhir:source [
fhir:context [ fhir:v "s" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "cos" ]         ] ) ;
        ( fhir:target [
fhir:context [ fhir:v "ob" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "status" ] ;
fhir:transform [ fhir:v "translate" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "cos" ]           ] [
fhir:value [ fhir:v "#OBSstatus" ]           ] [
fhir:value [ fhir:v "code" ]           ] )         ] )       ] )     ] [
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 "hasMember" ] ;
        ( fhir:source [
fhir:context [ fhir:v "component" ] ;
fhir:element [ fhir:v "observation" ] ;
fhir:variable [ fhir:v "observation" ]         ] ) ;
        ( fhir:target [
fhir:context [ fhir:v "bundle" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "entry" ] ;
fhir:variable [ fhir:v "ei" ]         ] [
fhir:context [ fhir:v "ei" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "request" ] ;
fhir:variable [ fhir:v "request" ] ;
fhir:transform [ fhir:v "create" ] ;
          ( fhir:parameter [
fhir:value [ 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 [ fhir:v "POST" ]           ] )         ] [
fhir:context [ fhir:v "ei" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "resource" ] ;
fhir:variable [ fhir:v "obsi" ] ;
fhir:transform [ fhir:v "create" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "Observation" ]           ] )         ] [
fhir:context [ fhir:v "obsi" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "id" ] ;
fhir:variable [ fhir:v "uuidi" ] ;
fhir:transform [ fhir:v "uuid" ]         ] [
fhir:context [ fhir:v "ei" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "fullUrl" ] ;
fhir:transform [ fhir:v "append" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "https://example/Observation/" ]           ] [
fhir:value [ fhir:v "uuidi" ]           ] )         ] [
fhir:context [ fhir:v "request" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "url" ] ;
fhir:transform [ fhir:v "copy" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "Observation" ]           ] )         ] [
fhir:context [ fhir:v "ob" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "hasMember" ] ;
fhir:variable [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "create" ] ;
          ( fhir:parameter [
fhir:value [ 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 [ fhir:v "'https://example/Observation/' + %obsi.id" ]           ] )         ] ) ;
        ( fhir:dependent [
fhir:name [ fhir:v "Observation" ] ;
          ( fhir:variable [ fhir:v "observation" ] [ fhir:v "patient" ] [ fhir:v "encounter" ] [ fhir:v "obsi" ] [ fhir:v "bundle" ] )         ] )       ] )     ] )
  ] [
fhir:name [ fhir:v "Coverage" ] ;
fhir:typeMode [ fhir:v "none" ] ;
    ( fhir:input [
fhir:name [ fhir:v "src" ] ;
fhir:type [ fhir:v "act" ] ;
fhir:mode [ fhir:v "source" ]     ] [
fhir:name [ fhir:v "patient" ] ;
fhir:type [ fhir:v "Patient" ] ;
fhir:mode [ fhir:v "target" ]     ] [
fhir:name [ fhir:v "encounter" ] ;
fhir:type [ fhir:v "Encounter" ] ;
fhir:mode [ fhir:v "target" ]     ] [
fhir:name [ fhir:v "tgt" ] ;
fhir:type [ fhir:v "Coverage" ] ;
fhir:mode [ fhir:v "target" ]     ] [
fhir:name [ fhir:v "bundle" ] ;
fhir:type [ fhir:v "Bundle" ] ;
fhir:mode [ fhir:v "target" ]     ] ) ;
    ( fhir:rule [
fhir:name [ fhir:v "reference" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "beneficiary" ] ;
fhir:variable [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "create" ] ;
        ( fhir:parameter [
fhir:value [ 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 [ fhir:v "'https://example/Patient/' + %patient.id" ]         ] )       ] )     ] [
fhir:name [ fhir:v "reference" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "payor" ] ;
fhir:variable [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "create" ] ;
        ( fhir:parameter [
fhir:value [ 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 [ fhir:v "'https://example/Patient/' + %patient.id" ]         ] )       ] )     ] [
fhir:name [ fhir:v "id" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "id" ] ;
fhir:variable [ fhir:v "id" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "identifier" ] ;
fhir:variable [ fhir:v "idf" ]       ] ) ;
      ( fhir:rule [
fhir:name [ fhir:v "ID" ] ;
        ( fhir:source [
fhir:context [ fhir:v "id" ]         ] ) ;
        ( fhir:target [
fhir:context [ fhir:v "idf" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "id.root" ]           ] )         ] )       ] )     ] [
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 "type" ] ;
fhir:variable [ fhir:v "vvv" ] ;
fhir:transform [ fhir:v "create" ]       ] )     ] [
fhir:name [ fhir:v "sc" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "statusCode" ] ;
fhir:variable [ fhir:v "statusCode" ]       ] ) ;
      ( fhir:rule [
fhir:name [ fhir:v "status" ] ;
        ( fhir:source [
fhir:context [ fhir:v "statusCode" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "s" ]         ] ) ;
        ( fhir:target [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "status" ] ;
fhir:transform [ fhir:v "translate" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "s" ]           ] [
fhir:value [ fhir:v "#FinancialStatus" ]           ] [
fhir:value [ fhir:v "code" ]           ] )         ] )       ] )     ] [
fhir:name [ fhir:v "statusAbsent" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:condition [ fhir:v "statusCode.exists().not()" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "status" ] ;
fhir:transform [ fhir:v "copy" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "active" ]         ] )       ] )     ] [
fhir:name [ fhir:v "value1" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "effectiveTime" ] ;
fhir:variable [ fhir:v "effectiveTime" ] ;
fhir:condition [ fhir:v "(value.exists())" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "period" ] ;
fhir:variable [ fhir:v "value" ] ;
fhir:transform [ fhir:v "create" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "dateTime" ]         ] )       ] ) ;
      ( fhir:dependent [
fhir:name [ fhir:v "TSDateTime" ] ;
        ( fhir:variable [ fhir:v "effectiveTime" ] [ fhir:v "value" ] )       ] ) ;
fhir:documentation [ fhir:v "src.effectiveTime as effectiveTime -> tgt.period as period then{" ]     ] [
fhir:name [ fhir:v "valuePeriod" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "effectiveTime" ] ;
fhir:variable [ fhir:v "effectiveTime" ] ;
fhir:condition [ fhir:v "(low.exists())" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "period" ] ;
fhir:variable [ fhir:v "value" ] ;
fhir:transform [ fhir:v "create" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "Period" ]         ] )       ] ) ;
      ( fhir:dependent [
fhir:name [ fhir:v "IVLTSPeriod" ] ;
        ( fhir:variable [ fhir:v "effectiveTime" ] [ fhir:v "value" ] )       ] )     ] [
fhir:name [ fhir:v "entryr" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "entryRelationship" ] ;
fhir:variable [ fhir:v "entryRelationship" ]       ] ) ;
      ( fhir:rule [
fhir:name [ fhir:v "QUI" ] ;
        ( fhir:source [
fhir:context [ fhir:v "entryRelationship" ] ;
fhir:element [ fhir:v "act" ] ;
fhir:variable [ fhir:v "ac" ]         ] ) ;
        ( fhir:target [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "class" ] ;
fhir:variable [ fhir:v "class" ]         ] ) ;
        ( fhir:rule [
fhir:name [ fhir:v "ref" ] ;
          ( fhir:source [
fhir:context [ fhir:v "ac" ] ;
fhir:element [ fhir:v "text" ] ;
fhir:variable [ fhir:v "text" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "class" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "type" ] ;
fhir:variable [ fhir:v "type" ]           ] ) ;
          ( fhir:rule [
fhir:name [ fhir:v "value" ] ;
            ( fhir:source [
fhir:context [ fhir:v "text" ] ;
fhir:element [ fhir:v "reference" ] ;
fhir:variable [ fhir:v "reference" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "type" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "text" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "reference.value" ]               ] )             ] )           ] )         ] [
fhir:name [ fhir:v "note" ] ;
          ( fhir:source [
fhir:context [ fhir:v "ac" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "class" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:transform [ fhir:v "copy" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "commenti" ]             ] )           ] )         ] )       ] )     ] )
  ] [
fhir:name [ fhir:v "allergyFunction" ] ;
fhir:typeMode [ fhir:v "none" ] ;
    ( fhir:input [
fhir:name [ fhir:v "src" ] ;
fhir:type [ fhir:v "cdaElement" ] ;
fhir:mode [ fhir:v "source" ]     ] [
fhir:name [ fhir:v "tgt" ] ;
fhir:type [ fhir:v "AllergyIntolerance" ] ;
fhir:mode [ fhir:v "target" ]     ] [
fhir:name [ fhir:v "patient" ] ;
fhir:type [ fhir:v "Patient" ] ;
fhir:mode [ fhir:v "target" ]     ] [
fhir:name [ fhir:v "encounter" ] ;
fhir:type [ fhir:v "Encounter" ] ;
fhir:mode [ fhir:v "target" ]     ] ) ;
    ( fhir:rule [
fhir:name [ fhir:v "reference" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "patient" ] ;
fhir:variable [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "create" ] ;
        ( fhir:parameter [
fhir:value [ 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 [ fhir:v "'https://example/Patient/' + %patient.id" ]         ] )       ] )     ] [
fhir:name [ fhir:v "efftime" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "effectiveTime" ] ;
fhir:variable [ fhir:v "effTime" ]       ] ) ;
      ( fhir:rule [
fhir:name [ fhir:v "value" ] ;
        ( fhir:source [
fhir:context [ fhir:v "effTime" ] ;
fhir:element [ fhir:v "low" ] ;
fhir:variable [ fhir:v "l" ]         ] ) ;
        ( fhir:target [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "recordedDate" ] ;
fhir:variable [ fhir:v "r" ]         ] ) ;
        ( fhir:dependent [
fhir:name [ fhir:v "TSDateTime" ] ;
          ( fhir:variable [ fhir:v "l" ] [ fhir:v "r" ] )         ] )       ] ) ;
fhir:documentation [ fhir:v "src -> tgt.encounter=create('Reference') as reference,  reference.reference = ('https://example/Encounter/' + %encounter.id) \"reference\";" ]     ] [
fhir:name [ fhir:v "entryrelationship" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "entryRelationship" ] ;
fhir:variable [ fhir:v "entryRelationship1" ]       ] ) ;
      ( fhir:rule [
fhir:name [ fhir:v "observation" ] ;
        ( fhir:source [
fhir:context [ fhir:v "entryRelationship1" ] ;
fhir:element [ fhir:v "observation" ] ;
fhir:variable [ fhir:v "observation1" ]         ] ) ;
        ( fhir:rule [
fhir:name [ fhir:v "id" ] ;
          ( fhir:source [
fhir:context [ fhir:v "observation1" ] ;
fhir:element [ fhir:v "id" ] ;
fhir:variable [ fhir:v "vvv" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "identifier" ] ;
fhir:variable [ fhir:v "vvv" ] ;
fhir:transform [ fhir:v "create" ]           ] )         ] [
fhir:name [ fhir:v "Noallergy" ] ;
          ( fhir:source [
fhir:context [ fhir:v "observation1" ] ;
fhir:element [ fhir:v "templateId" ] ;
fhir:condition [ fhir:v "root = '2.16.840.1.113883.2.9.10.1.4.3.1.4'" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "code" ]           ] ) ;
          ( fhir:rule [
fhir:name [ fhir:v "code" ] ;
            ( fhir:source [
fhir:context [ fhir:v "observation1" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "code" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "coding" ] ;
fhir:variable [ fhir:v "coding" ]             ] ) ;
            ( fhir:rule [
fhir:name [ fhir:v "code" ] ;
              ( fhir:source [
fhir:context [ fhir:v "observation1" ]               ] ) ;
              ( 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 [ fhir:v "No known allergy" ]                 ] )               ] )             ] )           ] [
fhir:name [ fhir:v "value1" ] ;
            ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "effectiveTime" ] ;
fhir:variable [ fhir:v "effectiveTime" ] ;
fhir:condition [ fhir:v "(value.exists())" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "onset" ] ;
fhir:variable [ fhir:v "value" ] ;
fhir:transform [ fhir:v "create" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "dateTime" ]               ] )             ] ) ;
            ( fhir:dependent [
fhir:name [ fhir:v "TSDateTime" ] ;
              ( fhir:variable [ fhir:v "effectiveTime" ] [ fhir:v "value" ] )             ] )           ] [
fhir:name [ fhir:v "valuePeriod" ] ;
            ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "effectiveTime" ] ;
fhir:variable [ fhir:v "effectiveTime" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "onset" ] ;
fhir:variable [ fhir:v "value" ] ;
fhir:transform [ fhir:v "create" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "Period" ]               ] )             ] ) ;
            ( fhir:dependent [
fhir:name [ fhir:v "IVLTSPeriod" ] ;
              ( fhir:variable [ fhir:v "effectiveTime" ] [ fhir:v "value" ] )             ] )           ] )         ] [
fhir:name [ fhir:v "value1" ] ;
          ( fhir:source [
fhir:context [ fhir:v "observation1" ] ;
fhir:element [ fhir:v "effectiveTime" ] ;
fhir:variable [ fhir:v "effectiveTime" ] ;
fhir:condition [ fhir:v "(value.exists())" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "onset" ] ;
fhir:variable [ fhir:v "value" ] ;
fhir:transform [ fhir:v "create" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "dateTime" ]             ] )           ] ) ;
          ( fhir:dependent [
fhir:name [ fhir:v "TSDateTime" ] ;
            ( fhir:variable [ fhir:v "effectiveTime" ] [ fhir:v "value" ] )           ] )         ] [
fhir:name [ fhir:v "valuePeriod" ] ;
          ( fhir:source [
fhir:context [ fhir:v "observation1" ] ;
fhir:element [ fhir:v "effectiveTime" ] ;
fhir:variable [ fhir:v "effectiveTime" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "onset" ] ;
fhir:variable [ fhir:v "value" ] ;
fhir:transform [ fhir:v "create" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "Period" ]             ] )           ] ) ;
          ( fhir:dependent [
fhir:name [ fhir:v "IVLTSPeriod" ] ;
            ( fhir:variable [ fhir:v "effectiveTime" ] [ fhir:v "value" ] )           ] )         ] [
fhir:name [ fhir:v "code" ] ;
          ( fhir:source [
fhir:context [ fhir:v "observation1" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:variable [ fhir:v "code" ]           ] ) ;
          ( fhir:rule [
fhir:name [ fhir:v "type" ] ;
            ( fhir:source [
fhir:context [ fhir:v "code" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "code1" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "type" ] ;
fhir:transform [ fhir:v "translate" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "code1" ]               ] [
fhir:value [ fhir:v "#AllergyTypeMap" ]               ] [
fhir:value [ fhir:v "code" ]               ] )             ] )           ] [
fhir:name [ fhir:v "category" ] ;
            ( fhir:source [
fhir:context [ fhir:v "code" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "code1" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "category" ] ;
fhir:transform [ fhir:v "translate" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "code1" ]               ] [
fhir:value [ fhir:v "#AllergyCategoryMap" ]               ] [
fhir:value [ fhir:v "code" ]               ] )             ] )           ] )         ] [
fhir:name [ fhir:v "value" ] ;
          ( fhir:source [
fhir:context [ fhir:v "observation1" ] ;
fhir:element [ fhir:v "value" ] ;
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:documentation [ fhir:v "toASK qui dovrei fare un controllo sul code" ]         ] [
fhir:name [ fhir:v "participant" ] ;
          ( fhir:source [
fhir:context [ fhir:v "observation1" ] ;
fhir:element [ fhir:v "participant" ] ;
fhir:variable [ fhir:v "participant" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "reaction" ] ;
fhir:variable [ fhir:v "reaction" ]           ] ) ;
          ( fhir:rule [
fhir:name [ fhir:v "entryR2" ] ;
            ( fhir:source [
fhir:context [ fhir:v "observation1" ] ;
fhir:element [ fhir:v "entryRelationship" ] ;
fhir:variable [ fhir:v "entryRelationship2" ] ;
fhir:condition [ fhir:v "(typeCode = 'MFST')" ]             ] ) ;
            ( fhir:rule [
fhir:name [ fhir:v "observ2" ] ;
              ( fhir:source [
fhir:context [ fhir:v "entryRelationship2" ] ;
fhir:element [ fhir:v "observation" ] ;
fhir:variable [ fhir:v "observation2" ]               ] ) ;
              ( fhir:rule [
fhir:name [ fhir:v "manifestation" ] ;
                ( fhir:source [
fhir:context [ fhir:v "observation2" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:variable [ fhir:v "vvv" ]                 ] ) ;
                ( fhir:target [
fhir:context [ fhir:v "reaction" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "manifestation" ] ;
fhir:variable [ fhir:v "vvv" ] ;
fhir:transform [ fhir:v "create" ]                 ] )               ] [
fhir:name [ fhir:v "manifestation" ] ;
                ( fhir:source [
fhir:context [ fhir:v "observation2" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "vvv" ]                 ] ) ;
                ( fhir:target [
fhir:context [ fhir:v "reaction" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "manifestation" ] ;
fhir:variable [ fhir:v "vvv" ] ;
fhir:transform [ fhir:v "create" ]                 ] )               ] [
fhir:name [ fhir:v "tx" ] ;
                ( fhir:source [
fhir:context [ fhir:v "observation2" ] ;
fhir:element [ fhir:v "text" ] ;
fhir:variable [ fhir:v "tx" ]                 ] ) ;
                ( fhir:rule [
fhir:name [ fhir:v "tx" ] ;
                  ( fhir:source [
fhir:context [ fhir:v "tx" ] ;
fhir:element [ fhir:v "reference" ] ;
fhir:variable [ fhir:v "reff" ]                   ] ) ;
                  ( fhir:target [
fhir:context [ fhir:v "reaction" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "description" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
                    ( fhir:parameter [
fhir:value [ fhir:v "reff.value" ]                     ] )                   ] )                 ] )               ] [
fhir:name [ fhir:v "low" ] ;
                ( fhir:source [
fhir:context [ fhir:v "observation2" ] ;
fhir:element [ fhir:v "effectiveTime" ] ;
fhir:variable [ fhir:v "effectiveTime" ]                 ] ) ;
                ( fhir:rule [
fhir:name [ fhir:v "valuePeriodLow" ] ;
                  ( fhir:source [
fhir:context [ fhir:v "effectiveTime" ] ;
fhir:element [ fhir:v "low" ] ;
fhir:variable [ fhir:v "low" ]                   ] ) ;
                  ( fhir:target [
fhir:context [ fhir:v "reaction" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "onset" ] ;
fhir:variable [ fhir:v "value" ] ;
fhir:transform [ fhir:v "create" ] ;
                    ( fhir:parameter [
fhir:value [ fhir:v "dateTime" ]                     ] )                   ] ) ;
                  ( fhir:dependent [
fhir:name [ fhir:v "TSDateTime" ] ;
                    ( fhir:variable [ fhir:v "low" ] [ fhir:v "value" ] )                   ] )                 ] [
fhir:name [ fhir:v "valuePeriodHigh" ] ;
                  ( fhir:source [
fhir:context [ fhir:v "effectiveTime" ] ;
fhir:element [ fhir:v "high" ] ;
fhir:variable [ fhir:v "high" ]                   ] ) ;
                  ( fhir:target [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "lastOccurrence" ] ;
fhir:variable [ fhir:v "value" ] ;
fhir:transform [ fhir:v "create" ] ;
                    ( fhir:parameter [
fhir:value [ fhir:v "dateTime" ]                     ] )                   ] ) ;
                  ( fhir:dependent [
fhir:name [ fhir:v "TSDateTime" ] ;
                    ( fhir:variable [ fhir:v "high" ] [ fhir:v "value" ] )                   ] )                 ] )               ] )             ] )           ] [
fhir:name [ fhir:v "participantRole" ] ;
            ( fhir:source [
fhir:context [ fhir:v "participant" ] ;
fhir:element [ fhir:v "participantRole" ] ;
fhir:variable [ fhir:v "participantRole" ]             ] ) ;
            ( fhir:rule [
fhir:name [ fhir:v "playingEntity" ] ;
              ( fhir:source [
fhir:context [ fhir:v "participantRole" ] ;
fhir:element [ fhir:v "playingEntity" ] ;
fhir:variable [ fhir:v "playingEntity" ]               ] ) ;
              ( fhir:rule [
fhir:name [ fhir:v "reaction" ] ;
                ( fhir:source [
fhir:context [ fhir:v "playingEntity" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "vvv" ]                 ] ) ;
                ( fhir:target [
fhir:context [ fhir:v "reaction" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "substance" ] ;
fhir:variable [ fhir:v "vvv" ] ;
fhir:transform [ fhir:v "create" ]                 ] )               ] )             ] )           ] )         ] [
fhir:name [ fhir:v "entryR2" ] ;
          ( fhir:source [
fhir:context [ fhir:v "observation1" ] ;
fhir:element [ fhir:v "entryRelationship" ] ;
fhir:variable [ fhir:v "entryRelationship2" ] ;
fhir:condition [ fhir:v "(typeCode = 'MFST')" ]           ] ) ;
          ( fhir:rule [
fhir:name [ fhir:v "observ2" ] ;
            ( fhir:source [
fhir:context [ fhir:v "entryRelationship2" ] ;
fhir:element [ fhir:v "observation" ] ;
fhir:variable [ fhir:v "observation2" ] ;
fhir:condition [ fhir:v "observation1.participant.exists().not()" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "reaction" ] ;
fhir:variable [ fhir:v "reaction" ]             ] ) ;
            ( fhir:rule [
fhir:name [ fhir:v "manifestation" ] ;
              ( fhir:source [
fhir:context [ fhir:v "observation2" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:variable [ fhir:v "vvv" ]               ] ) ;
              ( fhir:target [
fhir:context [ fhir:v "reaction" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "manifestation" ] ;
fhir:variable [ fhir:v "vvv" ] ;
fhir:transform [ fhir:v "create" ]               ] )             ] [
fhir:name [ fhir:v "tx" ] ;
              ( fhir:source [
fhir:context [ fhir:v "observation2" ] ;
fhir:element [ fhir:v "text" ] ;
fhir:variable [ fhir:v "tx" ]               ] ) ;
              ( fhir:rule [
fhir:name [ fhir:v "tx" ] ;
                ( fhir:source [
fhir:context [ fhir:v "tx" ] ;
fhir:element [ fhir:v "reference" ] ;
fhir:variable [ fhir:v "reff" ]                 ] ) ;
                ( fhir:target [
fhir:context [ fhir:v "reaction" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "description" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
                  ( fhir:parameter [
fhir:value [ fhir:v "reff.value" ]                   ] )                 ] )               ] )             ] [
fhir:name [ fhir:v "low" ] ;
              ( fhir:source [
fhir:context [ fhir:v "observation2" ] ;
fhir:element [ fhir:v "effectiveTime" ] ;
fhir:variable [ fhir:v "effectiveTime" ]               ] ) ;
              ( fhir:rule [
fhir:name [ fhir:v "valuePeriodLow" ] ;
                ( fhir:source [
fhir:context [ fhir:v "effectiveTime" ] ;
fhir:element [ fhir:v "low" ] ;
fhir:variable [ fhir:v "low" ]                 ] ) ;
                ( fhir:target [
fhir:context [ fhir:v "reaction" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "onset" ] ;
fhir:variable [ fhir:v "value" ] ;
fhir:transform [ fhir:v "create" ] ;
                  ( fhir:parameter [
fhir:value [ fhir:v "dateTime" ]                   ] )                 ] ) ;
                ( fhir:dependent [
fhir:name [ fhir:v "TSDateTime" ] ;
                  ( fhir:variable [ fhir:v "low" ] [ fhir:v "value" ] )                 ] )               ] )             ] )           ] )         ] [
fhir:name [ fhir:v "entryR3" ] ;
          ( fhir:source [
fhir:context [ fhir:v "observation1" ] ;
fhir:element [ fhir:v "entryRelationship" ] ;
fhir:variable [ fhir:v "entryRelationship3" ] ;
fhir:condition [ fhir:v "(typeCode = 'SUBJ')" ]           ] ) ;
          ( fhir:rule [
fhir:name [ fhir:v "observ3" ] ;
            ( fhir:source [
fhir:context [ fhir:v "entryRelationship3" ] ;
fhir:element [ fhir:v "observation" ] ;
fhir:variable [ fhir:v "observation3" ]             ] ) ;
            ( fhir:rule [
fhir:name [ fhir:v "criticality" ] ;
              ( fhir:source [
fhir:context [ fhir:v "observation3" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:variable [ fhir:v "value" ]               ] ) ;
              ( fhir:rule [
fhir:name [ fhir:v "value" ] ;
                ( fhir:source [
fhir:context [ fhir:v "value" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "c" ]                 ] ) ;
                ( fhir:target [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "criticality" ] ;
fhir:transform [ fhir:v "translate" ] ;
                  ( fhir:parameter [
fhir:value [ fhir:v "c" ]                   ] [
fhir:value [ fhir:v "#CricalityMap" ]                   ] [
fhir:value [ fhir:v "code" ]                   ] )                 ] )               ] )             ] )           ] [
fhir:name [ fhir:v "act" ] ;
            ( fhir:source [
fhir:context [ fhir:v "entryRelationship3" ] ;
fhir:element [ fhir:v "act" ] ;
fhir:variable [ fhir:v "act" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "note" ] ;
fhir:variable [ fhir:v "note" ]             ] ) ;
            ( fhir:rule [
fhir:name [ fhir:v "note" ] ;
              ( fhir:source [
fhir:context [ fhir:v "act" ] ;
fhir:element [ fhir:v "text" ] ;
fhir:variable [ fhir:v "text" ]               ] ) ;
              ( fhir:rule [
fhir:name [ fhir:v "reference" ] ;
                ( fhir:source [
fhir:context [ fhir:v "text" ] ;
fhir:element [ fhir:v "reference" ] ;
fhir:variable [ fhir:v "reference" ]                 ] ) ;
                ( fhir:target [
fhir:context [ fhir:v "note" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "text" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
                  ( fhir:parameter [
fhir:value [ fhir:v "reference.value" ]                   ] )                 ] )               ] )             ] )           ] )         ] [
fhir:name [ fhir:v "entryR4" ] ;
          ( fhir:source [
fhir:context [ fhir:v "observation1" ] ;
fhir:element [ fhir:v "entryRelationship" ] ;
fhir:variable [ fhir:v "entryRelationship4" ] ;
fhir:condition [ fhir:v "(typeCode = 'REFR')" ]           ] ) ;
          ( fhir:rule [
fhir:name [ fhir:v "observ4" ] ;
            ( fhir:source [
fhir:context [ fhir:v "entryRelationship4" ] ;
fhir:element [ fhir:v "observation" ] ;
fhir:variable [ fhir:v "observation4" ]             ] ) ;
            ( fhir:rule [
fhir:name [ fhir:v "clinicalStatus" ] ;
              ( fhir:source [
fhir:context [ fhir:v "observation4" ]               ] ) ;
              ( fhir:target [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "clinicalStatus" ] ;
fhir:variable [ fhir:v "clinicalStatus" ]               ] ) ;
              ( fhir:rule [
fhir:name [ fhir:v "value" ] ;
                ( fhir:source [
fhir:context [ fhir:v "observation4" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:variable [ fhir:v "value" ]                 ] ) ;
                ( fhir:rule [
fhir:name [ fhir:v "coding" ] ;
                  ( fhir:source [
fhir:context [ fhir:v "value" ] ;
fhir:variable [ fhir:v "valu" ]                   ] ) ;
                  ( fhir:target [
fhir:context [ fhir:v "clinicalStatus" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "coding" ] ;
fhir:variable [ fhir:v "coding" ] ;
fhir:transform [ fhir:v "create" ] ;
                    ( fhir:parameter [
fhir:value [ fhir:v "Coding" ]                     ] )                   ] ) ;
                  ( fhir:rule [
fhir:name [ fhir:v "code" ] ;
                    ( fhir:source [
fhir:context [ fhir:v "valu" ] ;
fhir:condition [ fhir:v "(code = 'LA9041-0')" ]                     ] ) ;
                    ( 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 [ fhir:v "resolved" ]                       ] )                     ] )                   ] [
fhir:name [ fhir:v "code" ] ;
                    ( fhir:source [
fhir:context [ fhir:v "valu" ] ;
fhir:condition [ fhir:v "(code = 'LA18632-2')" ]                     ] ) ;
                    ( 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 [ fhir:v "inactive" ]                       ] )                     ] )                   ] [
fhir:name [ fhir:v "code" ] ;
                    ( fhir:source [
fhir:context [ fhir:v "valu" ] ;
fhir:condition [ fhir:v "(code = 'LA16666-2')" ]                     ] ) ;
                    ( 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 [ fhir:v "active" ]                       ] )                     ] )                   ] [
fhir:name [ fhir:v "system" ] ;
                    ( fhir:source [
fhir:context [ fhir:v "valu" ]                     ] ) ;
                    ( 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 [ fhir:v "http://terminology.hl7.org/CodeSystem/allergyintolerance-clinical" ]                       ] )                     ] )                   ] [
fhir:name [ fhir:v "display" ] ;
                    ( fhir:source [
fhir:context [ fhir:v "valu" ] ;
fhir:element [ fhir:v "displayName" ] ;
fhir:variable [ fhir:v "display" ]                     ] ) ;
                    ( fhir:target [
fhir:context [ fhir:v "coding" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "display" ] ;
fhir:transform [ fhir:v "cast" ] ;
                      ( fhir:parameter [
fhir:value [ fhir:v "display" ]                       ] [
fhir:value [ fhir:v "string" ]                       ] )                     ] )                   ] )                 ] )               ] [
fhir:name [ fhir:v "tx" ] ;
                ( fhir:source [
fhir:context [ fhir:v "observation4" ] ;
fhir:element [ fhir:v "text" ] ;
fhir:variable [ fhir:v "tx" ]                 ] ) ;
                ( fhir:rule [
fhir:name [ fhir:v "reference" ] ;
                  ( fhir:source [
fhir:context [ fhir:v "tx" ] ;
fhir:element [ fhir:v "reference" ] ;
fhir:variable [ fhir:v "ref" ]                   ] ) ;
                  ( fhir:target [
fhir:context [ fhir:v "clinicalStatus" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "text" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
                    ( fhir:parameter [
fhir:value [ fhir:v "ref.value" ]                     ] )                   ] )                 ] )               ] )             ] )           ] )         ] )       ] )     ] )
  ] [
fhir:name [ fhir:v "MedicationStatement" ] ;
fhir:typeMode [ fhir:v "none" ] ;
    ( fhir:input [
fhir:name [ fhir:v "src" ] ;
fhir:type [ fhir:v "substanceAdministration" ] ;
fhir:mode [ fhir:v "source" ]     ] [
fhir:name [ fhir:v "tgt" ] ;
fhir:type [ fhir:v "MedicationStatement" ] ;
fhir:mode [ fhir:v "target" ]     ] [
fhir:name [ fhir:v "patient" ] ;
fhir:type [ fhir:v "Patient" ] ;
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:rule [
fhir:name [ fhir:v "reference" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "subject" ] ;
fhir:variable [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "create" ] ;
        ( fhir:parameter [
fhir:value [ 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 [ fhir:v "'https://example/Patient/' + %patient.id" ]         ] )       ] )     ] [
fhir:name [ fhir:v "status" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "statusCode" ] ;
fhir:variable [ fhir:v "vvv" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "status" ] ;
fhir:variable [ fhir:v "vvv" ] ;
fhir:transform [ fhir:v "create" ]       ] ) ;
fhir:documentation [ fhir:v "src -> tgt.context = create('Reference') as reference,  reference.reference = ('https://example/Encounter/' + %encounter.id) \"reference\";" ]     ] [
fhir:name [ fhir:v "id" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "id" ] ;
fhir:variable [ fhir:v "vvv" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "identifier" ] ;
fhir:variable [ fhir:v "vvv" ] ;
fhir:transform [ fhir:v "create" ]       ] )     ] [
fhir:name [ fhir:v "note" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "text" ] ;
fhir:variable [ fhir:v "text" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "note" ] ;
fhir:variable [ fhir:v "note" ]       ] ) ;
      ( fhir:rule [
fhir:name [ fhir:v "text" ] ;
        ( fhir:source [
fhir:context [ fhir:v "text" ] ;
fhir:element [ fhir:v "reference" ] ;
fhir:variable [ fhir:v "reference" ]         ] ) ;
        ( fhir:target [
fhir:context [ fhir:v "note" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "text" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "reference.value" ]           ] )         ] )       ] )     ] [
fhir:name [ fhir:v "value1" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "effectiveTime" ] ;
fhir:variable [ fhir:v "eff" ] ;
fhir:condition [ fhir:v "(value.exists())" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "effective" ] ;
fhir:variable [ fhir:v "value" ] ;
fhir:transform [ fhir:v "create" ] ;
        ( fhir:parameter [
fhir:value [ 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 "src" ] ;
fhir:type [ fhir:v "IVL_TS" ] ;
fhir:element [ fhir:v "effectiveTime" ] ;
fhir:variable [ fhir:v "eff" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "effective" ] ;
fhir:variable [ fhir:v "value" ] ;
fhir:transform [ fhir:v "create" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "Period" ]         ] )       ] ) ;
      ( fhir:dependent [
fhir:name [ fhir:v "IVLTSPeriod" ] ;
        ( fhir:variable [ fhir:v "eff" ] [ fhir:v "value" ] )       ] )     ] [
fhir:name [ fhir:v "dos" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "dosage" ] ;
fhir:variable [ fhir:v "dosage" ] ;
fhir:transform [ fhir:v "create" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "Dosage" ]         ] )       ] ) ;
      ( fhir:rule [
fhir:name [ fhir:v "eff" ] ;
        ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:type [ fhir:v "PIVL_TS" ] ;
fhir:element [ fhir:v "effectiveTime" ] ;
fhir:variable [ fhir:v "eff" ]         ] ) ;
        ( fhir:rule [
fhir:name [ fhir:v "cod" ] ;
          ( fhir:source [
fhir:context [ fhir:v "eff" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "dosage" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "timing" ] ;
fhir:variable [ fhir:v "timing" ] ;
fhir:transform [ fhir:v "create" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "Timing" ]             ] )           ] ) ;
          ( fhir:dependent [
fhir:name [ fhir:v "periodTiming" ] ;
            ( fhir:variable [ fhir:v "eff" ] [ fhir:v "timing" ] )           ] )         ] )       ] [
fhir:name [ fhir:v "route" ] ;
        ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:condition [ fhir:v "(src.doseQuantity.exists() or src.rateQuantity.exists() or src.routeCode.exists() or src.approachSiteCode.exists())" ]         ] ) ;
        ( fhir:rule [
fhir:name [ fhir:v "doseQuantity" ] ;
          ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "doseQuantity" ] ;
fhir:variable [ fhir:v "doseQuant" ]           ] ) ;
          ( fhir:rule [
fhir:name [ fhir:v "ot" ] ;
            ( fhir:source [
fhir:context [ fhir:v "doseQuant" ] ;
fhir:element [ fhir:v "originalText" ] ;
fhir:variable [ fhir:v "ot" ]             ] ) ;
            ( fhir:rule [
fhir:name [ fhir:v "reference" ] ;
              ( fhir:source [
fhir:context [ fhir:v "ot" ] ;
fhir:element [ fhir:v "reference" ] ;
fhir:variable [ fhir:v "vvv" ]               ] ) ;
              ( fhir:target [
fhir:context [ fhir:v "dosage" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "text" ] ;
fhir:variable [ fhir:v "vvv" ] ;
fhir:transform [ fhir:v "create" ]               ] )             ] )           ] [
fhir:name [ fhir:v "dosageRate" ] ;
            ( fhir:source [
fhir:context [ fhir:v "doseQuant" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "dosage" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "doseAndRate" ] ;
fhir:variable [ fhir:v "dosageRate" ]             ] ) ;
            ( fhir:rule [
fhir:name [ fhir:v "d" ] ;
              ( fhir:source [
fhir:context [ fhir:v "doseQuant" ]               ] ) ;
              ( fhir:target [
fhir:context [ fhir:v "dosageRate" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "dose" ] ;
fhir:variable [ fhir:v "d" ] ;
fhir:transform [ fhir:v "create" ] ;
                ( fhir:parameter [
fhir:value [ fhir:v "Range" ]                 ] )               ] ) ;
              ( fhir:rule [
fhir:name [ fhir:v "low" ] ;
                ( fhir:source [
fhir:context [ fhir:v "doseQuant" ]                 ] ) ;
                ( fhir:target [
fhir:context [ fhir:v "d" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "low" ] ;
fhir:variable [ fhir:v "l" ] ;
fhir:transform [ fhir:v "create" ] ;
                  ( fhir:parameter [
fhir:value [ fhir:v "SimpleQuantity" ]                   ] )                 ] ) ;
                ( fhir:rule [
fhir:name [ fhir:v "low" ] ;
                  ( fhir:source [
fhir:context [ fhir:v "doseQuant" ] ;
fhir:element [ fhir:v "low" ] ;
fhir:variable [ fhir:v "lo" ]                   ] ) ;
                  ( fhir:target [
fhir:context [ fhir:v "l" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
                    ( fhir:parameter [
fhir:value [ fhir:v "lo.value" ]                     ] )                   ] )                 ] [
fhir:name [ fhir:v "low" ] ;
                  ( fhir:source [
fhir:context [ fhir:v "doseQuant" ] ;
fhir:element [ fhir:v "low" ] ;
fhir:variable [ fhir:v "lo" ]                   ] ) ;
                  ( fhir:target [
fhir:context [ fhir:v "l" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "unit" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
                    ( fhir:parameter [
fhir:value [ fhir:v "lo.unit" ]                     ] )                   ] )                 ] )               ] [
fhir:name [ fhir:v "low" ] ;
                ( fhir:source [
fhir:context [ fhir:v "doseQuant" ]                 ] ) ;
                ( fhir:target [
fhir:context [ fhir:v "d" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "high" ] ;
fhir:variable [ fhir:v "h" ] ;
fhir:transform [ fhir:v "create" ] ;
                  ( fhir:parameter [
fhir:value [ fhir:v "SimpleQuantity" ]                   ] )                 ] ) ;
                ( fhir:rule [
fhir:name [ fhir:v "high" ] ;
                  ( fhir:source [
fhir:context [ fhir:v "doseQuant" ] ;
fhir:element [ fhir:v "high" ] ;
fhir:variable [ fhir:v "hi" ]                   ] ) ;
                  ( fhir:target [
fhir:context [ fhir:v "h" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
                    ( fhir:parameter [
fhir:value [ fhir:v "hi.value" ]                     ] )                   ] )                 ] [
fhir:name [ fhir:v "high" ] ;
                  ( fhir:source [
fhir:context [ fhir:v "doseQuant" ] ;
fhir:element [ fhir:v "high" ] ;
fhir:variable [ fhir:v "hi" ]                   ] ) ;
                  ( fhir:target [
fhir:context [ fhir:v "h" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "unit" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
                    ( fhir:parameter [
fhir:value [ fhir:v "hi.unit" ]                     ] )                   ] )                 ] )               ] )             ] )           ] )         ] [
fhir:name [ fhir:v "rate" ] ;
          ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "rateQuantity" ] ;
fhir:variable [ fhir:v "rateQuantity" ]           ] ) ;
          ( fhir:rule [
fhir:name [ fhir:v "ot" ] ;
            ( fhir:source [
fhir:context [ fhir:v "rateQuantity" ] ;
fhir:element [ fhir:v "originalText" ] ;
fhir:variable [ fhir:v "ot" ]             ] ) ;
            ( fhir:rule [
fhir:name [ fhir:v "reference" ] ;
              ( fhir:source [
fhir:context [ fhir:v "ot" ] ;
fhir:element [ fhir:v "reference" ] ;
fhir:variable [ fhir:v "vvv" ]               ] ) ;
              ( fhir:target [
fhir:context [ fhir:v "dosage" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "text" ] ;
fhir:variable [ fhir:v "vvv" ] ;
fhir:transform [ fhir:v "create" ]               ] )             ] )           ] [
fhir:name [ fhir:v "dosageRate" ] ;
            ( fhir:source [
fhir:context [ fhir:v "rateQuantity" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "dosage" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "doseAndRate" ] ;
fhir:variable [ fhir:v "dosageRate" ]             ] ) ;
            ( fhir:rule [
fhir:name [ fhir:v "r" ] ;
              ( fhir:source [
fhir:context [ fhir:v "rateQuantity" ]               ] ) ;
              ( fhir:target [
fhir:context [ fhir:v "dosageRate" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "rate" ] ;
fhir:variable [ fhir:v "d" ] ;
fhir:transform [ fhir:v "create" ] ;
                ( fhir:parameter [
fhir:value [ fhir:v "Range" ]                 ] )               ] ) ;
              ( fhir:rule [
fhir:name [ fhir:v "low" ] ;
                ( fhir:source [
fhir:context [ fhir:v "rateQuantity" ]                 ] ) ;
                ( fhir:target [
fhir:context [ fhir:v "d" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "low" ] ;
fhir:variable [ fhir:v "l" ] ;
fhir:transform [ fhir:v "create" ] ;
                  ( fhir:parameter [
fhir:value [ fhir:v "SimpleQuantity" ]                   ] )                 ] ) ;
                ( fhir:rule [
fhir:name [ fhir:v "low" ] ;
                  ( fhir:source [
fhir:context [ fhir:v "rateQuantity" ] ;
fhir:element [ fhir:v "low" ] ;
fhir:variable [ fhir:v "lo" ]                   ] ) ;
                  ( fhir:target [
fhir:context [ fhir:v "l" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
                    ( fhir:parameter [
fhir:value [ fhir:v "lo.value" ]                     ] )                   ] )                 ] [
fhir:name [ fhir:v "low" ] ;
                  ( fhir:source [
fhir:context [ fhir:v "rateQuantity" ] ;
fhir:element [ fhir:v "low" ] ;
fhir:variable [ fhir:v "lo" ]                   ] ) ;
                  ( fhir:target [
fhir:context [ fhir:v "l" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "unit" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
                    ( fhir:parameter [
fhir:value [ fhir:v "lo.unit" ]                     ] )                   ] )                 ] )               ] [
fhir:name [ fhir:v "high" ] ;
                ( fhir:source [
fhir:context [ fhir:v "rateQuantity" ]                 ] ) ;
                ( fhir:target [
fhir:context [ fhir:v "d" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "high" ] ;
fhir:variable [ fhir:v "h" ] ;
fhir:transform [ fhir:v "create" ] ;
                  ( fhir:parameter [
fhir:value [ fhir:v "SimpleQuantity" ]                   ] )                 ] ) ;
                ( fhir:rule [
fhir:name [ fhir:v "high" ] ;
                  ( fhir:source [
fhir:context [ fhir:v "rateQuantity" ] ;
fhir:element [ fhir:v "high" ] ;
fhir:variable [ fhir:v "hi" ]                   ] ) ;
                  ( fhir:target [
fhir:context [ fhir:v "h" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
                    ( fhir:parameter [
fhir:value [ fhir:v "hi.value" ]                     ] )                   ] )                 ] [
fhir:name [ fhir:v "high" ] ;
                  ( fhir:source [
fhir:context [ fhir:v "rateQuantity" ] ;
fhir:element [ fhir:v "high" ] ;
fhir:variable [ fhir:v "hi" ]                   ] ) ;
                  ( fhir:target [
fhir:context [ fhir:v "h" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "unit" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
                    ( fhir:parameter [
fhir:value [ fhir:v "hi.unit" ]                     ] )                   ] )                 ] )               ] )             ] )           ] )         ] [
fhir:name [ fhir:v "route" ] ;
          ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "routeCode" ] ;
fhir:variable [ fhir:v "vvv" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "dosage" ] ;
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 "src" ] ;
fhir:element [ fhir:v "approachSiteCode" ] ;
fhir:variable [ fhir:v "vvv" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "dosage" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "site" ] ;
fhir:variable [ fhir:v "vvv" ] ;
fhir:transform [ fhir:v "create" ]           ] )         ] [
fhir:name [ fhir:v "site" ] ;
          ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "targetSiteCode" ] ;
fhir:variable [ fhir:v "vvv" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "dosage" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "site" ] ;
fhir:variable [ fhir:v "vvv" ] ;
fhir:transform [ fhir:v "create" ]           ] )         ] )       ] )     ] [
fhir:name [ fhir:v "consumable" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "consumable" ] ;
fhir:variable [ fhir:v "consumable" ]       ] ) ;
      ( fhir:rule [
fhir:name [ fhir:v "medication" ] ;
        ( fhir:source [
fhir:context [ fhir:v "consumable" ] ;
fhir:element [ fhir:v "manufacturedProduct" ] ;
fhir:variable [ fhir:v "manufacturedProduct" ]         ] ) ;
        ( 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 [ 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 [ fhir:v "POST" ]           ] )         ] [
fhir:context [ fhir:v "e1" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "resource" ] ;
fhir:variable [ fhir:v "medication" ] ;
fhir:transform [ fhir:v "create" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "Medication" ]           ] )         ] [
fhir:context [ fhir:v "medication" ] ;
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 [ fhir:v "https://example/Medication/" ]           ] [
fhir:value [ 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 [ fhir:v "Medication" ]           ] )         ] [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "medication" ] ;
fhir:variable [ fhir:v "medref" ] ;
fhir:transform [ fhir:v "create" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "Reference" ]           ] )         ] [
fhir:context [ fhir:v "medref" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "'https://example/Medication/' + %medication.id" ]           ] )         ] ) ;
        ( fhir:dependent [
fhir:name [ fhir:v "Medication" ] ;
          ( fhir:variable [ fhir:v "src" ] [ fhir:v "medication" ] [ fhir:v "patient" ] [ fhir:v "bundle" ] )         ] )       ] )     ] )
  ] [
fhir:name [ fhir:v "periodTiming" ] ;
fhir:typeMode [ fhir:v "none" ] ;
    ( fhir:input [
fhir:name [ fhir:v "effectiveTime" ] ;
fhir:type [ fhir:v "PIVL_TS" ] ;
fhir:mode [ fhir:v "source" ]     ] [
fhir:name [ fhir:v "timing" ] ;
fhir:type [ fhir:v "Timing" ] ;
fhir:mode [ fhir:v "target" ]     ] ) ;
    ( fhir:rule [
fhir:name [ fhir:v "repeat" ] ;
      ( fhir:source [
fhir:context [ fhir:v "effectiveTime" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "timing" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "repeat" ] ;
fhir:variable [ fhir:v "r" ]       ] ) ;
      ( fhir:rule [
fhir:name [ fhir:v "period" ] ;
        ( fhir:source [
fhir:context [ fhir:v "effectiveTime" ] ;
fhir:element [ fhir:v "period" ] ;
fhir:variable [ fhir:v "p" ]         ] ) ;
        ( fhir:target [
fhir:context [ fhir:v "r" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "period" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "p.value" ]           ] )         ] )       ] [
fhir:name [ fhir:v "period" ] ;
        ( fhir:source [
fhir:context [ fhir:v "effectiveTime" ] ;
fhir:element [ fhir:v "period" ] ;
fhir:variable [ fhir:v "p" ]         ] ) ;
        ( fhir:target [
fhir:context [ fhir:v "r" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "periodUnit" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "p.unit" ]           ] )         ] )       ] )     ] )
  ] [
fhir:name [ fhir:v "Medication" ] ;
fhir:typeMode [ fhir:v "none" ] ;
    ( fhir:input [
fhir:name [ fhir:v "src" ] ;
fhir:type [ fhir:v "substanceAdministration" ] ;
fhir:mode [ fhir:v "source" ]     ] [
fhir:name [ fhir:v "tgt" ] ;
fhir:type [ fhir:v "Medication" ] ;
fhir:mode [ fhir:v "target" ]     ] [
fhir:name [ fhir:v "patient" ] ;
fhir:type [ fhir:v "Patient" ] ;
fhir:mode [ fhir:v "target" ]     ] [
fhir:name [ fhir:v "bundle" ] ;
fhir:type [ fhir:v "Bundle" ] ;
fhir:mode [ fhir:v "target" ]     ] ) ;
    ( fhir:rule [
fhir:name [ fhir:v "consumable" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "consumable" ] ;
fhir:variable [ fhir:v "consumable" ]       ] ) ;
      ( fhir:rule [
fhir:name [ fhir:v "product" ] ;
        ( fhir:source [
fhir:context [ fhir:v "consumable" ] ;
fhir:element [ fhir:v "manufacturedProduct" ] ;
fhir:variable [ fhir:v "manufacturedProduct" ]         ] ) ;
        ( fhir:rule [
fhir:name [ fhir:v "material" ] ;
          ( fhir:source [
fhir:context [ fhir:v "manufacturedProduct" ] ;
fhir:element [ fhir:v "manufacturedMaterial" ] ;
fhir:variable [ fhir:v "manufacturedMaterial" ]           ] ) ;
          ( fhir:rule [
fhir:name [ fhir:v "CE" ] ;
            ( fhir:source [
fhir:context [ fhir:v "manufacturedMaterial" ] ;
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 "form" ] ;
            ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "administrationUnitCode" ] ;
fhir:variable [ fhir:v "vvv" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "form" ] ;
fhir:variable [ fhir:v "vvv" ] ;
fhir:transform [ fhir:v "create" ]             ] )           ] )         ] )       ] )     ] [
fhir:name [ fhir:v "entryR" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "entryRelationship" ] ;
fhir:variable [ fhir:v "entryR" ]       ] ) ;
      ( fhir:rule [
fhir:name [ fhir:v "obs" ] ;
        ( fhir:source [
fhir:context [ fhir:v "entryR" ] ;
fhir:element [ fhir:v "observation" ] ;
fhir:variable [ fhir:v "observation" ]         ] ) ;
        ( fhir:rule [
fhir:name [ fhir:v "ingredient" ] ;
          ( fhir:source [
fhir:context [ fhir:v "observation" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:condition [ fhir:v "displayName = 'Grammatura'" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "ingredient" ] ;
fhir:variable [ fhir:v "ingredient" ]           ] ) ;
          ( fhir:rule [
fhir:name [ fhir:v "consumable" ] ;
            ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "consumable" ] ;
fhir:variable [ fhir:v "consumable" ]             ] ) ;
            ( fhir:rule [
fhir:name [ fhir:v "product" ] ;
              ( fhir:source [
fhir:context [ fhir:v "consumable" ] ;
fhir:element [ fhir:v "manufacturedProduct" ] ;
fhir:variable [ fhir:v "manufacturedProduct" ]               ] ) ;
              ( fhir:rule [
fhir:name [ fhir:v "material" ] ;
                ( fhir:source [
fhir:context [ fhir:v "manufacturedProduct" ] ;
fhir:element [ fhir:v "manufacturedMaterial" ] ;
fhir:variable [ fhir:v "manufacturedMaterial" ]                 ] ) ;
                ( fhir:rule [
fhir:name [ fhir:v "CE" ] ;
                  ( fhir:source [
fhir:context [ fhir:v "manufacturedMaterial" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "code" ]                   ] ) ;
                  ( fhir:target [
fhir:context [ fhir:v "ingredient" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "item" ] ;
fhir:variable [ fhir:v "value" ] ;
fhir:transform [ fhir:v "create" ] ;
                    ( fhir:parameter [
fhir:value [ fhir:v "CodeableConcept" ]                     ] )                   ] ) ;
                  ( fhir:dependent [
fhir:name [ fhir:v "CECodeableConcept" ] ;
                    ( fhir:variable [ fhir:v "code" ] [ fhir:v "value" ] )                   ] )                 ] )               ] )             ] )           ] [
fhir:name [ fhir:v "strenght" ] ;
            ( fhir:source [
fhir:context [ fhir:v "observation" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:variable [ fhir:v "value" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "ingredient" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "strength" ] ;
fhir:variable [ fhir:v "strength" ]             ] ) ;
            ( fhir:rule [
fhir:name [ fhir:v "numerator" ] ;
              ( fhir:source [
fhir:context [ fhir:v "value" ]               ] ) ;
              ( fhir:target [
fhir:context [ fhir:v "strength" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "numerator" ] ;
fhir:variable [ fhir:v "numerator" ]               ] ) ;
              ( fhir:rule [
fhir:name [ fhir:v "valueN" ] ;
                ( fhir:source [
fhir:context [ fhir:v "value" ]                 ] ) ;
                ( fhir:target [
fhir:context [ fhir:v "numerator" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
                  ( fhir:parameter [
fhir:value [ fhir:v "value.value" ]                   ] )                 ] )               ] )             ] [
fhir:name [ fhir:v "denominator" ] ;
              ( fhir:source [
fhir:context [ fhir:v "value" ]               ] ) ;
              ( fhir:target [
fhir:context [ fhir:v "strength" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "denominator" ] ;
fhir:variable [ fhir:v "denominator" ]               ] ) ;
              ( fhir:rule [
fhir:name [ fhir:v "valueD" ] ;
                ( fhir:source [
fhir:context [ fhir:v "value" ]                 ] ) ;
                ( fhir:target [
fhir:context [ fhir:v "denominator" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:transform [ fhir:v "copy" ] ;
                  ( fhir:parameter [
fhir:value [ fhir:v "1"^^xsd:integer ]                   ] )                 ] )               ] )             ] )           ] )         ] [
fhir:name [ fhir:v "quantita" ] ;
          ( fhir:source [
fhir:context [ fhir:v "observation" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:condition [ fhir:v "displayName = 'Quantità nella Confezione'" ]           ] ) ;
          ( fhir:rule [
fhir:name [ fhir:v "amount" ] ;
            ( fhir:source [
fhir:context [ fhir:v "observation" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:variable [ fhir:v "value" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "amount" ] ;
fhir:variable [ fhir:v "amount" ]             ] ) ;
            ( fhir:rule [
fhir:name [ fhir:v "numerator" ] ;
              ( fhir:source [
fhir:context [ fhir:v "value" ]               ] ) ;
              ( fhir:target [
fhir:context [ fhir:v "amount" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "numerator" ] ;
fhir:variable [ fhir:v "numerator" ]               ] ) ;
              ( fhir:rule [
fhir:name [ fhir:v "valueN" ] ;
                ( fhir:source [
fhir:context [ fhir:v "value" ]                 ] ) ;
                ( fhir:target [
fhir:context [ fhir:v "numerator" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
                  ( fhir:parameter [
fhir:value [ fhir:v "value.value" ]                   ] )                 ] )               ] )             ] [
fhir:name [ fhir:v "denominator" ] ;
              ( fhir:source [
fhir:context [ fhir:v "value" ]               ] ) ;
              ( fhir:target [
fhir:context [ fhir:v "amount" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "denominator" ] ;
fhir:variable [ fhir:v "denominator" ]               ] ) ;
              ( fhir:rule [
fhir:name [ fhir:v "valueD" ] ;
                ( fhir:source [
fhir:context [ fhir:v "value" ]                 ] ) ;
                ( fhir:target [
fhir:context [ fhir:v "denominator" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:transform [ fhir:v "copy" ] ;
                  ( fhir:parameter [
fhir:value [ fhir:v "1"^^xsd:integer ]                   ] )                 ] )               ] )             ] )           ] )         ] )       ] )     ] )
  ] [
fhir:name [ fhir:v "Immunization" ] ;
fhir:typeMode [ fhir:v "none" ] ;
    ( fhir:input [
fhir:name [ fhir:v "substance" ] ;
fhir:type [ fhir:v "substanceAdministration" ] ;
fhir:mode [ fhir:v "source" ]     ] [
fhir:name [ fhir:v "patient" ] ;
fhir:type [ fhir:v "Patient" ] ;
fhir:mode [ fhir:v "target" ]     ] [
fhir:name [ fhir:v "encounter" ] ;
fhir:type [ fhir:v "Encounter" ] ;
fhir:mode [ fhir:v "target" ]     ] [
fhir:name [ fhir:v "tgt" ] ;
fhir:type [ fhir:v "Immunization" ] ;
fhir:mode [ fhir:v "target" ]     ] [
fhir:name [ fhir:v "bundle" ] ;
fhir:type [ fhir:v "Bundle" ] ;
fhir:mode [ fhir:v "target" ]     ] ) ;
    ( fhir:rule [
fhir:name [ fhir:v "patientRef" ] ;
      ( fhir:source [
fhir:context [ fhir:v "substance" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "patient" ] ;
fhir:variable [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "create" ] ;
        ( fhir:parameter [
fhir:value [ 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 [ fhir:v "'https://example/Patient/' + %patient.id" ]         ] )       ] )     ] [
fhir:name [ fhir:v "id" ] ;
      ( fhir:source [
fhir:context [ fhir:v "substance" ] ;
fhir:element [ fhir:v "id" ] ;
fhir:variable [ fhir:v "id" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "identifier" ] ;
fhir:variable [ fhir:v "idf" ]       ] ) ;
      ( 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 "idf" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "system" ] ;
fhir:transform [ fhir:v "translate" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "r" ]           ] [
fhir:value [ fhir:v "http://hl7.org/fhir/ConceptMap/special-oid2uri" ]           ] [
fhir:value [ fhir:v "uri" ]           ] )         ] )       ] ) ;
fhir:documentation [ fhir:v "substance -> tgt.encounter  = create('Reference') as reference,  reference.reference = ('https://example/Encounter/' + %encounter.id) \"encounterRef\";" ]     ] [
fhir:name [ fhir:v "note" ] ;
      ( fhir:source [
fhir:context [ fhir:v "substance" ] ;
fhir:element [ fhir:v "text" ] ;
fhir:variable [ fhir:v "text" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "note" ] ;
fhir:variable [ fhir:v "note" ]       ] ) ;
      ( fhir:rule [
fhir:name [ fhir:v "text" ] ;
        ( fhir:source [
fhir:context [ fhir:v "text" ] ;
fhir:element [ fhir:v "reference" ] ;
fhir:variable [ fhir:v "reference" ]         ] ) ;
        ( fhir:target [
fhir:context [ fhir:v "note" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "text" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "reference.value" ]           ] )         ] )       ] )     ] [
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 "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "status" ] ;
fhir:transform [ fhir:v "copy" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "completed" ]         ] )       ] )     ] [
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 "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "status" ] ;
fhir:transform [ fhir:v "copy" ] ;
        ( fhir:parameter [
fhir:value [ 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 "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "status" ] ;
fhir:transform [ fhir:v "copy" ] ;
        ( fhir:parameter [
fhir:value [ 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 "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "status" ] ;
fhir:transform [ fhir:v "copy" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "not-done" ]         ] )       ] )     ] [
fhir:name [ fhir:v "efftime" ] ;
      ( fhir:source [
fhir:context [ fhir:v "substance" ] ;
fhir:element [ fhir:v "effectiveTime" ] ;
fhir:variable [ fhir:v "time" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "occurrence" ] ;
fhir:variable [ fhir:v "value" ] ;
fhir:transform [ fhir:v "create" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "dateTime" ]         ] )       ] ) ;
      ( fhir:dependent [
fhir:name [ fhir:v "TSDateTime" ] ;
        ( fhir:variable [ fhir:v "time" ] [ fhir:v "value" ] )       ] )     ] [
fhir:name [ fhir:v "routeCode" ] ;
      ( fhir:source [
fhir:context [ fhir:v "substance" ] ;
fhir:element [ fhir:v "routeCode" ] ;
fhir:variable [ fhir:v "vvv" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "route" ] ;
fhir:variable [ fhir:v "vvv" ] ;
fhir:transform [ fhir:v "create" ]       ] )     ] [
fhir:name [ fhir:v "approachSiteCode" ] ;
      ( fhir:source [
fhir:context [ fhir:v "substance" ] ;
fhir:element [ fhir:v "approachSiteCode" ] ;
fhir:variable [ fhir:v "vvv" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "tgt" ] ;
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 "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "doseQuantity" ] ;
fhir:variable [ fhir:v "quantity" ] ;
fhir:transform [ fhir:v "create" ] ;
        ( fhir:parameter [
fhir:value [ 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 [ 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 [ 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 "tgt" ] ;
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 "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "lotNumber" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
              ( fhir:parameter [
fhir:value [ 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 [ 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 [ 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 [ fhir:v "Organization" ]             ] )           ] ) ;
          ( fhir:rule [
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 [ fhir:v "r" ]                 ] [
fhir:value [ fhir:v "http://hl7.org/fhir/ConceptMap/special-oid2uri" ]                 ] [
fhir:value [ 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 [ 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 [ fhir:v "Organization?identifier=" ]                   ] [
fhir:value [ 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 [ 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 "idasi" ] ;
                ( 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 "uuid" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
                  ( fhir:parameter [
fhir:value [ 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 [ fhir:v "https://example/" ]                   ] [
fhir:value [ fhir:v "uuid" ]                   ] )                 ] [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "manufacturer" ] ;
fhir:variable [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "create" ] ;
                  ( fhir:parameter [
fhir:value [ 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 [ fhir:v "'https://example/' + %organization.id" ]                   ] )                 ] )               ] )             ] )           ] [
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 [ fhir:v "n.other" ]               ] )             ] )           ] [
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 [ 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 [ 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 [ fhir:v "ClinicalDocument/body/Vaccinazioni/manufacturerOrganization" ]                   ] )                 ] )               ] )             ] )           ] )         ] )       ] )     ] [
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 [ 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 [ 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 [ fhir:v "Location" ]         ] )       ] [
fhir:context [ fhir:v "location" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "id" ] ;
fhir:variable [ fhir:v "uuid1" ] ;
fhir:transform [ fhir:v "uuid" ]       ] ) ;
      ( 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 [ 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 [ 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 [ fhir:v "ClinicalDocument/body/Vaccinazione/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 [ fhir:v "r" ]               ] [
fhir:value [ fhir:v "http://hl7.org/fhir/ConceptMap/special-oid2uri" ]               ] [
fhir:value [ 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 [ fhir:v "ext" ]               ] )             ] ) ;
            ( fhir:rule [
fhir:name [ fhir:v "UUID" ] ;
              ( fhir:source [
fhir:context [ fhir:v "partRole" ]               ] ) ;
              ( 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 [ fhir:v "Location?identifier=" ]                 ] [
fhir:value [ 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 [ 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 "idasi" ] ;
              ( 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 "uuid" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
                ( fhir:parameter [
fhir:value [ 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 [ fhir:v "https://example/Location" ]                 ] [
fhir:value [ fhir:v "uuid" ]                 ] )               ] [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "location" ] ;
fhir:variable [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "create" ] ;
                ( fhir:parameter [
fhir:value [ 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 [ fhir:v "'https://example/' + %location.id" ]                 ] )               ] )             ] )           ] )         ] )       ] )     ] [
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 = '30973-2')" ]           ] ) ;
          ( fhir:rule [
fhir:name [ fhir:v "val" ] ;
            ( fhir:source [
fhir:context [ fhir:v "obs" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "protocolApplied" ] ;
fhir:variable [ fhir:v "prot" ] ;
fhir:transform [ fhir:v "create" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "BackboneElement" ]               ] )             ] ) ;
            ( fhir:rule [
fhir:name [ fhir:v "value" ] ;
              ( fhir:source [
fhir:context [ fhir:v "obs" ] ;
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 [ 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 = '59781-5')" ]           ] ) ;
          ( 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 "val" ] ;
              ( 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 "value" ]                 ] ) ;
                ( fhir:target [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "expirationDate" ] ;
fhir:transform [ fhir:v "truncate" ] ;
                  ( fhir:parameter [
fhir:value [ fhir:v "value" ]                   ] [
fhir:value [ fhir:v "10"^^xsd:integer ]                   ] )                 ] )               ] )             ] )           ] )         ] )       ] )     ] [
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 "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 [ 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 [ 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 [ 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 [ fhir:v "https://example/Observation/" ]             ] [
fhir:value [ 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 [ fhir:v "Observation" ]             ] )           ] [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "reasonReference" ] ;
fhir:variable [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "create" ] ;
            ( fhir:parameter [
fhir:value [ 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 [ 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 "entrirel5" ] ;
      ( fhir:source [
fhir:context [ fhir:v "substance" ] ;
fhir:element [ fhir:v "entryRelationship" ] ;
fhir:variable [ fhir:v "entrirel5" ]       ] ) ;
      ( fhir:rule [
fhir:name [ fhir:v "obs" ] ;
        ( fhir:source [
fhir:context [ fhir:v "entrirel5" ] ;
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 = '75321-0') or (code = '5321-0')" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "reaction" ] ;
fhir:variable [ fhir:v "reaction" ]           ] ) ;
          ( fhir:rule [
fhir:name [ fhir:v "observation" ] ;
            ( fhir:source [
fhir:context [ fhir:v "obs" ]             ] ) ;
            ( 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 [ 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 [ 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 [ 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 [ fhir:v "https://example/Observation/" ]               ] [
fhir:value [ 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 [ fhir:v "Observation" ]               ] )             ] [
fhir:context [ fhir:v "reaction" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "detail" ] ;
fhir:variable [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "create" ] ;
              ( fhir:parameter [
fhir:value [ 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 [ fhir:v "'https://example/Observation/' + %observation.id" ]               ] )             ] ) ;
            ( fhir:dependent [
fhir:name [ fhir:v "Observation" ] ;
              ( fhir:variable [ fhir:v "obs" ] [ fhir:v "patient" ] [ fhir:v "encounter" ] [ fhir:v "observation" ] [ fhir:v "bundle" ] )             ] )           ] )         ] )       ] )     ] [
fhir:name [ fhir:v "entrirel5" ] ;
      ( fhir:source [
fhir:context [ fhir:v "substance" ] ;
fhir:element [ fhir:v "entryRelationship" ] ;
fhir:variable [ fhir:v "entrirel5" ]       ] ) ;
      ( fhir:rule [
fhir:name [ fhir:v "obs" ] ;
        ( fhir:source [
fhir:context [ fhir:v "entrirel5" ] ;
fhir:element [ fhir:v "act" ] ;
fhir:variable [ fhir:v "act" ]         ] ) ;
        ( fhir:rule [
fhir:name [ fhir:v "note" ] ;
          ( fhir:source [
fhir:context [ fhir:v "act" ] ;
fhir:element [ fhir:v "text" ] ;
fhir:variable [ fhir:v "tx" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "note" ] ;
fhir:variable [ fhir:v "note" ]           ] ) ;
          ( fhir:rule [
fhir:name [ fhir:v "text" ] ;
            ( fhir:source [
fhir:context [ fhir:v "tx" ] ;
fhir:element [ fhir:v "reference" ] ;
fhir:variable [ fhir:v "reference" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "note" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "text" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "reference.value" ]               ] )             ] )           ] )         ] )       ] )     ] )
  ] [
fhir:name [ fhir:v "ConditionFunction" ] ;
fhir:typeMode [ fhir:v "none" ] ;
    ( fhir:input [
fhir:name [ fhir:v "src" ] ;
fhir:type [ fhir:v "cdaElement" ] ;
fhir:mode [ fhir:v "source" ]     ] [
fhir:name [ fhir:v "tgt" ] ;
fhir:type [ fhir:v "Condition" ] ;
fhir:mode [ fhir:v "target" ]     ] [
fhir:name [ fhir:v "patient" ] ;
fhir:type [ fhir:v "patient" ] ;
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:rule [
fhir:name [ fhir:v "id" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "id" ] ;
fhir:variable [ fhir:v "vvv" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "identifier" ] ;
fhir:variable [ fhir:v "vvv" ] ;
fhir:transform [ fhir:v "create" ]       ] )     ] [
fhir:name [ fhir:v "reference" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "subject" ] ;
fhir:variable [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "create" ] ;
        ( fhir:parameter [
fhir:value [ 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 [ fhir:v "'https://example/Patient/' + %patient.id" ]         ] )       ] )     ] [
fhir:name [ fhir:v "verifstatus" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "statusCode" ] ;
fhir:variable [ fhir:v "stscode" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "verificationStatus" ] ;
fhir:variable [ fhir:v "verifstatus" ]       ] ) ;
      ( fhir:rule [
fhir:name [ fhir:v "coding" ] ;
        ( fhir:source [
fhir:context [ fhir:v "stscode" ] ;
fhir:variable [ fhir:v "codeS" ]         ] ) ;
        ( fhir:target [
fhir:context [ fhir:v "verifstatus" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "coding" ] ;
fhir:variable [ fhir:v "coding" ] ;
fhir:transform [ fhir:v "create" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "Coding" ]           ] )         ] ) ;
        ( fhir:rule [
fhir:name [ fhir:v "code" ] ;
          ( fhir:source [
fhir:context [ fhir:v "codeS" ] ;
fhir:element [ fhir:v "code" ]           ] ) ;
          ( 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 [ fhir:v "confirmed" ]             ] )           ] )         ] [
fhir:name [ fhir:v "system" ] ;
          ( fhir:source [
fhir:context [ fhir:v "codeS" ]           ] ) ;
          ( 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 [ fhir:v "http://terminology.hl7.org/CodeSystem/condition-ver-status" ]             ] )           ] )         ] [
fhir:name [ fhir:v "display" ] ;
          ( fhir:source [
fhir:context [ fhir:v "codeS" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "coding" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "display" ] ;
fhir:transform [ fhir:v "cast" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "Confirmed" ]             ] [
fhir:value [ fhir:v "string" ]             ] )           ] )         ] )       ] ) ;
fhir:documentation [ fhir:v "src -> tgt.encounter=create('Reference') as reference,  reference.reference = ('https://example/Encounter/' + %encounter.id) \"reference\";" ]     ] [
fhir:name [ fhir:v "onset" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:condition [ fhir:v "entryRelationship.exists().not()" ]       ] ) ;
      ( fhir:rule [
fhir:name [ fhir:v "value1" ] ;
        ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "effectiveTime" ] ;
fhir:variable [ fhir:v "effectiveTime" ] ;
fhir:condition [ fhir:v "(value.exists())" ]         ] ) ;
        ( fhir:target [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "onset" ] ;
fhir:variable [ fhir:v "value" ] ;
fhir:transform [ fhir:v "create" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "dateTime" ]           ] )         ] ) ;
        ( fhir:dependent [
fhir:name [ fhir:v "TSDateTime" ] ;
          ( fhir:variable [ fhir:v "effectiveTime" ] [ fhir:v "value" ] )         ] )       ] [
fhir:name [ fhir:v "valuePeriod" ] ;
        ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "effectiveTime" ] ;
fhir:variable [ fhir:v "effectiveTime" ]         ] ) ;
        ( fhir:target [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "onset" ] ;
fhir:variable [ fhir:v "value" ] ;
fhir:transform [ fhir:v "create" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "Period" ]           ] )         ] ) ;
        ( fhir:dependent [
fhir:name [ fhir:v "IVLTSPeriod" ] ;
          ( fhir:variable [ fhir:v "effectiveTime" ] [ fhir:v "value" ] )         ] )       ] )     ] [
fhir:name [ fhir:v "entryR" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "entryRelationship" ] ;
fhir:variable [ fhir:v "entryRelationship" ]       ] ) ;
      ( fhir:rule [
fhir:name [ fhir:v "EntryRelObsevation" ] ;
        ( fhir:source [
fhir:context [ fhir:v "entryRelationship" ] ;
fhir:element [ fhir:v "observation" ] ;
fhir:variable [ fhir:v "obsentry" ]         ] ) ;
        ( fhir:rule [
fhir:name [ fhir:v "value" ] ;
          ( fhir:source [
fhir:context [ fhir:v "obsentry" ] ;
fhir:element [ fhir:v "value" ] ;
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:documentation [ fhir:v "toASK" ]         ] [
fhir:name [ fhir:v "code" ] ;
          ( fhir:source [
fhir:context [ fhir:v "obsentry" ] ;
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 "category" ] ;
fhir:variable [ fhir:v "vvv" ] ;
fhir:transform [ fhir:v "create" ]           ] )         ] [
fhir:name [ fhir:v "value1" ] ;
          ( fhir:source [
fhir:context [ fhir:v "obsentry" ] ;
fhir:element [ fhir:v "effectiveTime" ] ;
fhir:variable [ fhir:v "effectiveTime" ] ;
fhir:condition [ fhir:v "(value.exists())" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "onset" ] ;
fhir:variable [ fhir:v "value" ] ;
fhir:transform [ fhir:v "create" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "dateTime" ]             ] )           ] ) ;
          ( fhir:dependent [
fhir:name [ fhir:v "TSDateTime" ] ;
            ( fhir:variable [ fhir:v "effectiveTime" ] [ fhir:v "value" ] )           ] )         ] [
fhir:name [ fhir:v "valuePeriod" ] ;
          ( fhir:source [
fhir:context [ fhir:v "obsentry" ] ;
fhir:element [ fhir:v "effectiveTime" ] ;
fhir:variable [ fhir:v "effectiveTime" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "onset" ] ;
fhir:variable [ fhir:v "value" ] ;
fhir:transform [ fhir:v "create" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "Period" ]             ] )           ] ) ;
          ( fhir:dependent [
fhir:name [ fhir:v "IVLTSPeriod" ] ;
            ( fhir:variable [ fhir:v "effectiveTime" ] [ fhir:v "value" ] )           ] )         ] [
fhir:name [ fhir:v "note" ] ;
          ( fhir:source [
fhir:context [ fhir:v "obsentry" ] ;
fhir:element [ fhir:v "text" ] ;
fhir:variable [ fhir:v "text" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "note" ] ;
fhir:variable [ fhir:v "note" ]           ] ) ;
          ( fhir:rule [
fhir:name [ fhir:v "text" ] ;
            ( fhir:source [
fhir:context [ fhir:v "text" ] ;
fhir:element [ fhir:v "reference" ] ;
fhir:variable [ fhir:v "reference" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "note" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "text" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "reference.value" ]               ] )             ] )           ] )         ] [
fhir:name [ fhir:v "entryR" ] ;
          ( fhir:source [
fhir:context [ fhir:v "obsentry" ] ;
fhir:element [ fhir:v "entryRelationship" ] ;
fhir:variable [ fhir:v "entryR2" ]           ] ) ;
          ( fhir:rule [
fhir:name [ fhir:v "observation" ] ;
            ( fhir:source [
fhir:context [ fhir:v "entryR2" ] ;
fhir:element [ fhir:v "observation" ] ;
fhir:variable [ fhir:v "obsentry2" ]             ] ) ;
            ( fhir:rule [
fhir:name [ fhir:v "observation" ] ;
              ( fhir:source [
fhir:context [ fhir:v "obsentry2" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:condition [ fhir:v "code = '89261-2'" ]               ] ) ;
              ( fhir:rule [
fhir:name [ fhir:v "observation" ] ;
                ( fhir:source [
fhir:context [ fhir:v "obsentry2" ]                 ] ) ;
                ( fhir:target [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "evidence" ] ;
fhir:variable [ fhir:v "evidence" ]                 ] [
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 [ 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 [ fhir:v "POST" ]                   ] )                 ] [
fhir:context [ fhir:v "e1" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "resource" ] ;
fhir:variable [ fhir:v "obsy" ] ;
fhir:transform [ fhir:v "create" ] ;
                  ( fhir:parameter [
fhir:value [ fhir:v "Observation" ]                   ] )                 ] [
fhir:context [ fhir:v "obsy" ] ;
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 [ fhir:v "https://example/Observation/" ]                   ] [
fhir:value [ 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 [ fhir:v "Observation" ]                   ] )                 ] [
fhir:context [ fhir:v "evidence" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "detail" ] ;
fhir:variable [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "create" ] ;
                  ( fhir:parameter [
fhir:value [ 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 [ fhir:v "'https://example/Observation/' + %obsy.id" ]                   ] )                 ] ) ;
                ( fhir:dependent [
fhir:name [ fhir:v "Observation" ] ;
                  ( fhir:variable [ fhir:v "obsentry2" ] [ fhir:v "patient" ] [ fhir:v "encounter" ] [ fhir:v "obsy" ] [ fhir:v "bundle" ] )                 ] )               ] )             ] [
fhir:name [ fhir:v "clinicalStatus2" ] ;
              ( fhir:source [
fhir:context [ fhir:v "obsentry2" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:condition [ fhir:v "code = '33999-4'" ]               ] ) ;
              ( fhir:rule [
fhir:name [ fhir:v "clinicalstatus" ] ;
                ( fhir:source [
fhir:context [ fhir:v "obsentry2" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:variable [ fhir:v "value" ]                 ] ) ;
                ( fhir:target [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "clinicalStatus" ] ;
fhir:variable [ fhir:v "clinicalstatus" ]                 ] ) ;
                ( fhir:rule [
fhir:name [ fhir:v "coding" ] ;
                  ( fhir:source [
fhir:context [ fhir:v "value" ] ;
fhir:variable [ fhir:v "val" ]                   ] ) ;
                  ( fhir:target [
fhir:context [ fhir:v "clinicalstatus" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "coding" ] ;
fhir:variable [ fhir:v "coding" ] ;
fhir:transform [ fhir:v "create" ] ;
                    ( fhir:parameter [
fhir:value [ fhir:v "Coding" ]                     ] )                   ] ) ;
                  ( fhir:rule [
fhir:name [ fhir:v "code" ] ;
                    ( fhir:source [
fhir:context [ fhir:v "val" ] ;
fhir:condition [ fhir:v "(code = 'LA9041-0')" ]                     ] ) ;
                    ( 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 [ fhir:v "resolved" ]                       ] )                     ] )                   ] [
fhir:name [ fhir:v "code" ] ;
                    ( fhir:source [
fhir:context [ fhir:v "val" ] ;
fhir:condition [ fhir:v "(code = 'LA18632-2')" ]                     ] ) ;
                    ( 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 [ fhir:v "inactive" ]                       ] )                     ] )                   ] [
fhir:name [ fhir:v "code" ] ;
                    ( fhir:source [
fhir:context [ fhir:v "val" ] ;
fhir:condition [ fhir:v "(code = 'LA16666-2')" ]                     ] ) ;
                    ( 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 [ fhir:v "active" ]                       ] )                     ] )                   ] [
fhir:name [ fhir:v "system" ] ;
                    ( fhir:source [
fhir:context [ fhir:v "val" ]                     ] ) ;
                    ( 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 [ fhir:v "http://terminology.hl7.org/CodeSystem/condition-clinical" ]                       ] )                     ] )                   ] [
fhir:name [ fhir:v "display" ] ;
                    ( fhir:source [
fhir:context [ fhir:v "val" ] ;
fhir:element [ fhir:v "displayName" ] ;
fhir:variable [ fhir:v "display" ]                     ] ) ;
                    ( fhir:target [
fhir:context [ fhir:v "coding" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "display" ] ;
fhir:transform [ fhir:v "cast" ] ;
                      ( fhir:parameter [
fhir:value [ fhir:v "display" ]                       ] [
fhir:value [ fhir:v "string" ]                       ] )                     ] )                   ] )                 ] [
fhir:name [ fhir:v "text" ] ;
                  ( fhir:source [
fhir:context [ fhir:v "obsentry2" ] ;
fhir:element [ fhir:v "text" ] ;
fhir:variable [ fhir:v "text" ]                   ] ) ;
                  ( fhir:rule [
fhir:name [ fhir:v "text" ] ;
                    ( fhir:source [
fhir:context [ fhir:v "text" ] ;
fhir:element [ fhir:v "reference" ] ;
fhir:variable [ fhir:v "reference" ]                     ] ) ;
                    ( fhir:target [
fhir:context [ fhir:v "clinicalstatus" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "text" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
                      ( fhir:parameter [
fhir:value [ fhir:v "reference.value" ]                       ] )                     ] )                   ] )                 ] )               ] )             ] [
fhir:name [ fhir:v "severity" ] ;
              ( fhir:source [
fhir:context [ fhir:v "obsentry2" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:condition [ fhir:v "code = 'SEV'" ]               ] ) ;
              ( fhir:rule [
fhir:name [ fhir:v "value" ] ;
                ( fhir:source [
fhir:context [ fhir:v "obsentry2" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:variable [ fhir:v "vvv" ]                 ] ) ;
                ( fhir:target [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "severity" ] ;
fhir:variable [ fhir:v "vvv" ] ;
fhir:transform [ fhir:v "create" ]                 ] )               ] )             ] )           ] [
fhir:name [ fhir:v "act" ] ;
            ( fhir:source [
fhir:context [ fhir:v "entryR2" ] ;
fhir:element [ fhir:v "act" ] ;
fhir:variable [ fhir:v "act" ]             ] ) ;
            ( fhir:rule [
fhir:name [ fhir:v "note" ] ;
              ( fhir:source [
fhir:context [ fhir:v "act" ] ;
fhir:element [ fhir:v "text" ] ;
fhir:variable [ fhir:v "text" ]               ] ) ;
              ( fhir:target [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "note" ] ;
fhir:variable [ fhir:v "note" ]               ] ) ;
              ( fhir:rule [
fhir:name [ fhir:v "text" ] ;
                ( fhir:source [
fhir:context [ fhir:v "text" ] ;
fhir:element [ fhir:v "reference" ] ;
fhir:variable [ fhir:v "reference" ]                 ] ) ;
                ( fhir:target [
fhir:context [ fhir:v "note" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "text" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
                  ( fhir:parameter [
fhir:value [ fhir:v "reference.value" ]                   ] )                 ] )               ] )             ] )           ] )         ] )       ] )     ] )
  ] [
fhir:name [ fhir:v "FamilyMemberFunction" ] ;
fhir:typeMode [ fhir:v "none" ] ;
    ( fhir:input [
fhir:name [ fhir:v "src" ] ;
fhir:type [ fhir:v "organizer" ] ;
fhir:mode [ fhir:v "source" ]     ] [
fhir:name [ fhir:v "tgt" ] ;
fhir:type [ fhir:v "FamilyMemberHistory" ] ;
fhir:mode [ fhir:v "target" ]     ] [
fhir:name [ fhir:v "patient" ] ;
fhir:type [ fhir:v "patient" ] ;
fhir:mode [ fhir:v "target" ]     ] ) ;
    ( fhir:rule [
fhir:name [ fhir:v "patReference" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "patient" ] ;
fhir:variable [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "create" ] ;
        ( fhir:parameter [
fhir:value [ 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 [ fhir:v "'https://example/Patient/' + %patient.id" ]         ] )       ] )     ] [
fhir:name [ fhir:v "id" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "id" ] ;
fhir:variable [ fhir:v "vvv" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "identifier" ] ;
fhir:variable [ fhir:v "vvv" ] ;
fhir:transform [ fhir:v "create" ]       ] )     ] [
fhir:name [ fhir:v "statusCode" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "statusCode" ] ;
fhir:variable [ fhir:v "vvv" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "status" ] ;
fhir:variable [ fhir:v "vvv" ] ;
fhir:transform [ fhir:v "create" ]       ] )     ] [
fhir:name [ fhir:v "date" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "effectiveTime" ] ;
fhir:variable [ fhir:v "effectiveTime" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "date" ] ;
fhir:variable [ fhir:v "value" ] ;
fhir:transform [ fhir:v "create" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "date" ]         ] )       ] ) ;
      ( fhir:dependent [
fhir:name [ fhir:v "TSDate" ] ;
        ( fhir:variable [ fhir:v "effectiveTime" ] [ fhir:v "value" ] )       ] )     ] [
fhir:name [ fhir:v "relationship" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "subject" ] ;
fhir:variable [ fhir:v "subject" ]       ] ) ;
      ( fhir:rule [
fhir:name [ fhir:v "relatedSub" ] ;
        ( fhir:source [
fhir:context [ fhir:v "subject" ] ;
fhir:element [ fhir:v "relatedSubject" ] ;
fhir:variable [ fhir:v "relatedSubject" ]         ] ) ;
        ( fhir:rule [
fhir:name [ fhir:v "relationshipCode" ] ;
          ( fhir:source [
fhir:context [ fhir:v "relatedSubject" ] ;
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 "relationship" ] ;
fhir:variable [ fhir:v "vvv" ] ;
fhir:transform [ fhir:v "create" ]           ] )         ] [
fhir:name [ fhir:v "subject" ] ;
          ( fhir:source [
fhir:context [ fhir:v "relatedSubject" ] ;
fhir:element [ fhir:v "subject" ] ;
fhir:variable [ fhir:v "subject" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "sex" ] ;
fhir:variable [ fhir:v "sex" ]           ] ) ;
          ( fhir:rule [
fhir:name [ fhir:v "coding" ] ;
            ( fhir:source [
fhir:context [ fhir:v "subject" ] ;
fhir:element [ fhir:v "administrativeGenderCode" ] ;
fhir:variable [ fhir:v "administrativeGenderCode" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "sex" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "coding" ] ;
fhir:variable [ fhir:v "coding" ]             ] ) ;
            ( fhir:rule [
fhir:name [ fhir:v "gender" ] ;
              ( fhir:source [
fhir:context [ fhir:v "administrativeGenderCode" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "sexCode" ]               ] ) ;
              ( fhir:target [
fhir:context [ fhir:v "coding" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:transform [ fhir:v "translate" ] ;
                ( fhir:parameter [
fhir:value [ fhir:v "sexCode" ]                 ] [
fhir:value [ fhir:v "#cm-v3-administrative-gender" ]                 ] [
fhir:value [ fhir:v "code" ]                 ] )               ] )             ] [
fhir:name [ fhir:v "system" ] ;
              ( fhir:source [
fhir:context [ fhir:v "administrativeGenderCode" ]               ] ) ;
              ( 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 [ fhir:v "http://hl7.org/fhir/administrative-gender" ]                 ] )               ] )             ] [
fhir:name [ fhir:v "displayName" ] ;
              ( fhir:source [
fhir:context [ fhir:v "administrativeGenderCode" ] ;
fhir:element [ fhir:v "displayName" ] ;
fhir:variable [ fhir:v "dn" ]               ] ) ;
              ( fhir:target [
fhir:context [ fhir:v "coding" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "display" ] ;
fhir:transform [ fhir:v "copy" ] ;
                ( fhir:parameter [
fhir:value [ fhir:v "dn" ]                 ] )               ] )             ] )           ] )         ] )       ] )     ] [
fhir:name [ fhir:v "component" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "component" ] ;
fhir:variable [ fhir:v "component" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "condition" ] ;
fhir:variable [ fhir:v "condition" ]       ] ) ;
      ( fhir:rule [
fhir:name [ fhir:v "observation" ] ;
        ( fhir:source [
fhir:context [ fhir:v "component" ] ;
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 "condition" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "vvv" ] ;
fhir:transform [ fhir:v "create" ]           ] )         ] [
fhir:name [ fhir:v "reference" ] ;
          ( fhir:source [
fhir:context [ fhir:v "observation" ] ;
fhir:element [ fhir:v "text" ] ;
fhir:variable [ fhir:v "text" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "note" ] ;
fhir:variable [ fhir:v "note" ]           ] ) ;
          ( fhir:rule [
fhir:name [ fhir:v "value" ] ;
            ( fhir:source [
fhir:context [ fhir:v "text" ] ;
fhir:element [ fhir:v "reference" ] ;
fhir:variable [ fhir:v "reference" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "note" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "text" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "reference.value" ]               ] )             ] )           ] )         ] [
fhir:name [ fhir:v "statusCode" ] ;
          ( fhir:source [
fhir:context [ fhir:v "observation" ] ;
fhir:element [ fhir:v "statusCode" ] ;
fhir:variable [ fhir:v "vvv" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "status" ] ;
fhir:variable [ fhir:v "vvv" ] ;
fhir:transform [ fhir:v "create" ]           ] )         ] [
fhir:name [ fhir:v "codeable" ] ;
          ( fhir:source [
fhir:context [ fhir:v "observation" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:variable [ fhir:v "vvv" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "condition" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "outcome" ] ;
fhir:variable [ fhir:v "vvv" ] ;
fhir:transform [ fhir:v "create" ]           ] ) ;
fhir:documentation [ fhir:v "observation.effectiveTime as effectiveTime -> condition.onset = create('Period') as value then IVLTSPeriod(effectiveTime, value) \"valuePeriod\";" ]         ] [
fhir:name [ fhir:v "EntryRel" ] ;
          ( fhir:source [
fhir:context [ fhir:v "observation" ] ;
fhir:element [ fhir:v "entryRelationship" ] ;
fhir:variable [ fhir:v "entryR" ]           ] ) ;
          ( fhir:rule [
fhir:name [ fhir:v "obser" ] ;
            ( fhir:source [
fhir:context [ fhir:v "entryR" ] ;
fhir:element [ fhir:v "observation" ] ;
fhir:variable [ fhir:v "obs" ]             ] ) ;
            ( fhir:rule [
fhir:name [ fhir:v "insorgenza" ] ;
              ( fhir:source [
fhir:context [ fhir:v "obs" ] ;
fhir:condition [ fhir:v "(code.code = '35267-4')" ]               ] ) ;
              ( 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:target [
fhir:context [ fhir:v "condition" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "onset" ] ;
fhir:variable [ fhir:v "Age" ] ;
fhir:transform [ fhir:v "create" ] ;
                  ( fhir:parameter [
fhir:value [ fhir:v "Age" ]                   ] )                 ] ) ;
                ( fhir:rule [
fhir:name [ fhir:v "age" ] ;
                  ( fhir:source [
fhir:context [ fhir:v "value" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:variable [ fhir:v "valueAge" ]                   ] ) ;
                  ( fhir:target [
fhir:context [ fhir:v "Age" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:transform [ fhir:v "copy" ] ;
                    ( fhir:parameter [
fhir:value [ fhir:v "valueAge" ]                     ] )                   ] )                 ] [
fhir:name [ fhir:v "unit" ] ;
                  ( fhir:source [
fhir:context [ fhir:v "value" ] ;
fhir:element [ fhir:v "unit" ] ;
fhir:variable [ fhir:v "unit" ]                   ] ) ;
                  ( fhir:target [
fhir:context [ fhir:v "Age" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:transform [ fhir:v "copy" ] ;
                    ( fhir:parameter [
fhir:value [ fhir:v "unit" ]                     ] )                   ] )                 ] [
fhir:name [ fhir:v "unit" ] ;
                  ( fhir:source [
fhir:context [ fhir:v "value" ] ;
fhir:element [ fhir:v "unit" ] ;
fhir:variable [ fhir:v "unit" ]                   ] ) ;
                  ( fhir:target [
fhir:context [ fhir:v "Age" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "unit" ] ;
fhir:transform [ fhir:v "copy" ] ;
                    ( fhir:parameter [
fhir:value [ fhir:v "unit" ]                     ] )                   ] )                 ] [
fhir:name [ fhir:v "system" ] ;
                  ( fhir:source [
fhir:context [ fhir:v "value" ]                   ] ) ;
                  ( fhir:target [
fhir:context [ fhir:v "Age" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "system" ] ;
fhir:transform [ fhir:v "copy" ] ;
                    ( fhir:parameter [
fhir:value [ fhir:v "http://unitsofmeasure.org" ]                     ] )                   ] )                 ] )               ] )             ] [
fhir:name [ fhir:v "death" ] ;
              ( fhir:source [
fhir:context [ fhir:v "obs" ] ;
fhir:condition [ fhir:v "(code.code = '39016-1')" ]               ] ) ;
              ( 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:target [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "deceased" ] ;
fhir:variable [ fhir:v "Age" ] ;
fhir:transform [ fhir:v "create" ] ;
                  ( fhir:parameter [
fhir:value [ fhir:v "Age" ]                   ] )                 ] ) ;
                ( fhir:rule [
fhir:name [ fhir:v "age" ] ;
                  ( fhir:source [
fhir:context [ fhir:v "value" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:variable [ fhir:v "valueAge" ]                   ] ) ;
                  ( fhir:target [
fhir:context [ fhir:v "Age" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:transform [ fhir:v "copy" ] ;
                    ( fhir:parameter [
fhir:value [ fhir:v "valueAge" ]                     ] )                   ] )                 ] [
fhir:name [ fhir:v "unit" ] ;
                  ( fhir:source [
fhir:context [ fhir:v "value" ] ;
fhir:element [ fhir:v "unit" ] ;
fhir:variable [ fhir:v "unit" ]                   ] ) ;
                  ( fhir:target [
fhir:context [ fhir:v "Age" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:transform [ fhir:v "copy" ] ;
                    ( fhir:parameter [
fhir:value [ fhir:v "unit" ]                     ] )                   ] )                 ] [
fhir:name [ fhir:v "unit" ] ;
                  ( fhir:source [
fhir:context [ fhir:v "value" ] ;
fhir:element [ fhir:v "unit" ] ;
fhir:variable [ fhir:v "unit" ]                   ] ) ;
                  ( fhir:target [
fhir:context [ fhir:v "Age" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "unit" ] ;
fhir:transform [ fhir:v "copy" ] ;
                    ( fhir:parameter [
fhir:value [ fhir:v "unit" ]                     ] )                   ] )                 ] [
fhir:name [ fhir:v "system" ] ;
                  ( fhir:source [
fhir:context [ fhir:v "value" ]                   ] ) ;
                  ( fhir:target [
fhir:context [ fhir:v "Age" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "system" ] ;
fhir:transform [ fhir:v "copy" ] ;
                    ( fhir:parameter [
fhir:value [ fhir:v "http://unitsofmeasure.org" ]                     ] )                   ] )                 ] )               ] )             ] )           ] )         ] )       ] )     ] )
  ] [
fhir:name [ fhir:v "Practitioner" ] ;
fhir:typeMode [ fhir:v "none" ] ;
    ( fhir:input [
fhir:name [ fhir:v "src" ] ;
fhir:type [ fhir:v "performer" ] ;
fhir:mode [ fhir:v "source" ]     ] [
fhir:name [ fhir:v "tgt" ] ;
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:rule [
fhir:name [ fhir:v "resurceCreation" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "bundle" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "entry" ] ;
fhir:variable [ fhir:v "e22" ]       ] [
fhir:context [ fhir:v "e22" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "request" ] ;
fhir:variable [ fhir:v "request" ] ;
fhir:transform [ fhir:v "create" ] ;
        ( fhir:parameter [
fhir:value [ 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 [ fhir:v "PUT" ]         ] )       ] [
fhir:context [ fhir:v "e22" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "resource" ] ;
fhir:variable [ fhir:v "practitioner1" ] ;
fhir:transform [ fhir:v "create" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "Practitioner" ]         ] )       ] ) ;
      ( fhir:rule [
fhir:name [ fhir:v "participant" ] ;
        ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "assignedEntity" ] ;
fhir:variable [ fhir:v "assignedEntity" ]         ] ) ;
        ( fhir:target [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "participant" ] ;
fhir:variable [ fhir:v "participant" ]         ] ) ;
        ( fhir:rule [
fhir:name [ fhir:v "value1" ] ;
          ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "time" ] ;
fhir:variable [ fhir:v "time" ] ;
fhir:condition [ fhir:v "(value.exists())" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "participant" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "period" ] ;
fhir:variable [ fhir:v "value" ] ;
fhir:transform [ fhir:v "create" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "dateTime" ]             ] )           ] ) ;
          ( fhir:dependent [
fhir:name [ fhir:v "TSDateTime" ] ;
            ( fhir:variable [ fhir:v "time" ] [ fhir:v "value" ] )           ] )         ] [
fhir:name [ fhir:v "valuePeriod" ] ;
          ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "time" ] ;
fhir:variable [ fhir:v "time" ] ;
fhir:condition [ fhir:v "(low.exists())" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "participant" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "period" ] ;
fhir:variable [ fhir:v "value" ] ;
fhir:transform [ fhir:v "create" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "Period" ]             ] )           ] ) ;
          ( fhir:dependent [
fhir:name [ fhir:v "IVLTSPeriod" ] ;
            ( fhir:variable [ fhir:v "time" ] [ fhir:v "value" ] )           ] )         ] [
fhir:name [ fhir:v "identifier" ] ;
          ( fhir:source [
fhir:context [ fhir:v "assignedEntity" ] ;
fhir:element [ fhir:v "id" ] ;
fhir:variable [ fhir:v "id" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "practitioner1" ] ;
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 [ fhir:v "r" ]               ] [
fhir:value [ fhir:v "http://hl7.org/fhir/ConceptMap/special-oid2uri" ]               ] [
fhir:value [ 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 [ 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 [ 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 "id" ] ;
              ( fhir:source [
fhir:context [ fhir:v "id" ] ;
fhir:element [ fhir:v "extension" ] ;
fhir:variable [ fhir:v "ext" ]               ] ) ;
              ( fhir:target [
fhir:context [ fhir:v "practitioner1" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "id" ] ;
fhir:variable [ fhir:v "uuid22" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
                ( fhir:parameter [
fhir:value [ fhir:v "r + '-' + ext" ]                 ] )               ] [
fhir:context [ fhir:v "e22" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "fullUrl" ] ;
fhir:transform [ fhir:v "append" ] ;
                ( fhir:parameter [
fhir:value [ fhir:v "https://example/Practitioner/" ]                 ] [
fhir:value [ fhir:v "uuid22" ]                 ] )               ] [
fhir:context [ fhir:v "participant" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "individual" ] ;
fhir:variable [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "create" ] ;
                ( fhir:parameter [
fhir:value [ 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 [ fhir:v "'https://example/Practitioner/' + %practitioner1.id" ]                 ] )               ] )             ] )           ] ) ;
fhir:documentation [ fhir:v "src.time as time -> participant.period as period then{" ]         ] [
fhir:name [ fhir:v "2.16.840.1.113883.2.9.4.3.2" ] ;
          ( fhir:source [
fhir:context [ fhir:v "assignedEntity" ] ;
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')" ]           ] ) ;
          ( 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 "request" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "url" ] ;
fhir:transform [ fhir:v "append" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "Practitioner?identifier=" ]               ] [
fhir:value [ fhir:v "ext" ]               ] )             ] )           ] )         ] [
fhir:name [ fhir:v "diverso" ] ;
          ( fhir:source [
fhir:context [ fhir:v "assignedEntity" ] ;
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')" ]           ] ) ;
          ( 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 "request" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "url" ] ;
fhir:transform [ fhir:v "append" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "Practitioner?identifier=" ]               ] [
fhir:value [ fhir:v "ext" ]               ] )             ] )           ] )         ] [
fhir:name [ fhir:v "meta" ] ;
          ( fhir:source [
fhir:context [ fhir:v "assignedEntity" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "practitioner1" ] ;
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 "src" ]             ] ) ;
            ( 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 [ fhir:v "Coding" ]               ] )             ] ) ;
            ( fhir:rule [
fhir:name [ fhir:v "system" ] ;
              ( fhir:source [
fhir:context [ fhir:v "src" ]               ] ) ;
              ( 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 [ fhir:v "http://algoritmodiscoring" ]                 ] )               ] )             ] [
fhir:name [ fhir:v "code" ] ;
              ( fhir:source [
fhir:context [ fhir:v "src" ]               ] ) ;
              ( 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 [ fhir:v "ClinicalDocument/body/VisiteRicoveri/performer/" ]                 ] )               ] )             ] )           ] )         ] [
fhir:name [ fhir:v "addr" ] ;
          ( fhir:source [
fhir:context [ fhir:v "assignedEntity" ] ;
fhir:element [ fhir:v "addr" ] ;
fhir:variable [ fhir:v "vvv" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "practitioner1" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "address" ] ;
fhir:variable [ fhir:v "vvv" ] ;
fhir:transform [ fhir:v "create" ]           ] )         ] [
fhir:name [ fhir:v "telecom" ] ;
          ( fhir:source [
fhir:context [ fhir:v "assignedEntity" ] ;
fhir:element [ fhir:v "telecom" ] ;
fhir:variable [ fhir:v "vvv" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "practitioner1" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "telecom" ] ;
fhir:variable [ fhir:v "vvv" ] ;
fhir:transform [ fhir:v "create" ]           ] )         ] [
fhir:name [ fhir:v "partname" ] ;
          ( fhir:source [
fhir:context [ fhir:v "assignedEntity" ] ;
fhir:element [ fhir:v "assignedPerson" ] ;
fhir:variable [ fhir:v "person" ]           ] ) ;
          ( fhir:rule [
fhir:name [ fhir:v "name" ] ;
            ( fhir:source [
fhir:context [ fhir:v "person" ] ;
fhir:element [ fhir:v "name" ] ;
fhir:variable [ fhir:v "vvv" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "practitioner1" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "name" ] ;
fhir:variable [ fhir:v "vvv" ] ;
fhir:transform [ fhir:v "create" ]             ] )           ] [
fhir:name [ fhir:v "birthTime" ] ;
            ( fhir:source [
fhir:context [ fhir:v "person" ] ;
fhir:element [ fhir:v "birthTime" ] ;
fhir:variable [ fhir:v "vvv" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "practitioner1" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "birthDate" ] ;
fhir:variable [ fhir:v "vvv" ] ;
fhir:transform [ fhir:v "create" ]             ] )           ] )         ] )       ] )     ] )
  ] [
fhir:name [ fhir:v "CarePlanFunction" ] ;
fhir:typeMode [ fhir:v "none" ] ;
    ( fhir:input [
fhir:name [ fhir:v "src" ] ;
fhir:type [ fhir:v "entry" ] ;
fhir:mode [ fhir:v "source" ]     ] [
fhir:name [ fhir:v "tgt" ] ;
fhir:type [ fhir:v "CarePlan" ] ;
fhir:mode [ fhir:v "target" ]     ] [
fhir:name [ fhir:v "patient" ] ;
fhir:type [ fhir:v "Patient" ] ;
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:rule [
fhir:name [ fhir:v "reference" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "subject" ] ;
fhir:variable [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "create" ] ;
        ( fhir:parameter [
fhir:value [ 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 [ fhir:v "'https://example/Patient/' + %patient.id" ]         ] )       ] )     ] [
fhir:name [ fhir:v "status" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "status" ] ;
fhir:transform [ fhir:v "copy" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "unknown" ]         ] )       ] )     ] [
fhir:name [ fhir:v "intent" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "intent" ] ;
fhir:transform [ fhir:v "copy" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "plan" ]         ] )       ] )     ] [
fhir:name [ fhir:v "activityIni" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "activity" ] ;
fhir:variable [ fhir:v "activity" ]       ] ) ;
      ( fhir:rule [
fhir:name [ fhir:v "detail" ] ;
        ( fhir:source [
fhir:context [ fhir:v "src" ]         ] ) ;
        ( fhir:target [
fhir:context [ fhir:v "activity" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "detail" ] ;
fhir:variable [ fhir:v "detail" ]         ] ) ;
        ( fhir:rule [
fhir:name [ fhir:v "entryObs" ] ;
          ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "observation" ] ;
fhir:variable [ fhir:v "observation" ]           ] ) ;
          ( fhir:rule [
fhir:name [ fhir:v "activity" ] ;
            ( fhir:source [
fhir:context [ fhir:v "observation" ]             ] ) ;
            ( fhir:rule [
fhir:name [ fhir:v "status" ] ;
              ( fhir:source [
fhir:context [ fhir:v "observation" ]               ] ) ;
              ( fhir:target [
fhir:context [ fhir:v "detail" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "status" ] ;
fhir:transform [ fhir:v "copy" ] ;
                ( fhir:parameter [
fhir:value [ fhir:v "unknown" ]                 ] )               ] )             ] [
fhir:name [ fhir:v "obs1" ] ;
              ( fhir:source [
fhir:context [ fhir:v "observation" ]               ] ) ;
              ( 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 [ 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 [ fhir:v "POST" ]                 ] )               ] [
fhir:context [ fhir:v "e1" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "resource" ] ;
fhir:variable [ fhir:v "obs1" ] ;
fhir:transform [ fhir:v "create" ] ;
                ( fhir:parameter [
fhir:value [ fhir:v "Observation" ]                 ] )               ] [
fhir:context [ fhir:v "obs1" ] ;
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 [ fhir:v "https://example/Observation/" ]                 ] [
fhir:value [ 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 [ fhir:v "Observation" ]                 ] )               ] [
fhir:context [ fhir:v "detail" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "reasonReference" ] ;
fhir:variable [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "create" ] ;
                ( fhir:parameter [
fhir:value [ 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 [ fhir:v "'https://example/Observation/' + %obs1.id" ]                 ] )               ] ) ;
              ( fhir:dependent [
fhir:name [ fhir:v "Observation" ] ;
                ( fhir:variable [ fhir:v "observation" ] [ fhir:v "patient" ] [ fhir:v "encounter" ] [ fhir:v "obs1" ] [ fhir:v "bundle" ] )               ] )             ] )           ] )         ] [
fhir:name [ fhir:v "entrySub" ] ;
          ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "substanceAdministration" ] ;
fhir:variable [ fhir:v "substanceAdministration" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "activity" ] ;
fhir:variable [ fhir:v "activity" ]           ] ) ;
          ( fhir:rule [
fhir:name [ fhir:v "Terapie" ] ;
            ( fhir:source [
fhir:context [ fhir:v "substanceAdministration" ]             ] ) ;
            ( fhir:target [
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 "request" ] ;
fhir:transform [ fhir:v "create" ] ;
              ( fhir:parameter [
fhir:value [ 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 [ fhir:v "POST" ]               ] )             ] [
fhir:context [ fhir:v "e2" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "resource" ] ;
fhir:variable [ fhir:v "medre1" ] ;
fhir:transform [ fhir:v "create" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "MedicationRequest" ]               ] )             ] [
fhir:context [ fhir:v "medre1" ] ;
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 [ fhir:v "https://example/MedicationRequest/" ]               ] [
fhir:value [ fhir:v "uuid2" ]               ] )             ] [
fhir:context [ fhir:v "request" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "url" ] ;
fhir:transform [ fhir:v "copy" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "MedicationRequest" ]               ] )             ] [
fhir:context [ fhir:v "activity" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "reference" ] ;
fhir:variable [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "create" ] ;
              ( fhir:parameter [
fhir:value [ 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 [ fhir:v "'https://example/MedicationRequest/' + %medre1.id" ]               ] )             ] ) ;
            ( fhir:dependent [
fhir:name [ fhir:v "MedicationRequest" ] ;
              ( fhir:variable [ fhir:v "substanceAdministration" ] [ fhir:v "patient" ] [ fhir:v "encounter" ] [ fhir:v "medre1" ] [ fhir:v "bundle" ] )             ] )           ] )         ] [
fhir:name [ fhir:v "proc" ] ;
          ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "procedure" ] ;
fhir:variable [ fhir:v "procedureC" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "bundle" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "entry" ] ;
fhir:variable [ fhir:v "e8" ]           ] [
fhir:context [ fhir:v "e8" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "request" ] ;
fhir:variable [ fhir:v "request" ] ;
fhir:transform [ fhir:v "create" ] ;
            ( fhir:parameter [
fhir:value [ 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 [ fhir:v "POST" ]             ] )           ] [
fhir:context [ fhir:v "e8" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "resource" ] ;
fhir:variable [ fhir:v "procedure" ] ;
fhir:transform [ fhir:v "create" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "Procedure" ]             ] )           ] [
fhir:context [ fhir:v "procedure" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "id" ] ;
fhir:variable [ fhir:v "uuid8" ] ;
fhir:transform [ fhir:v "uuid" ]           ] [
fhir:context [ fhir:v "e8" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "fullUrl" ] ;
fhir:transform [ fhir:v "append" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "https://example/Procedure/" ]             ] [
fhir:value [ fhir:v "uuid8" ]             ] )           ] [
fhir:context [ fhir:v "request" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "url" ] ;
fhir:transform [ fhir:v "copy" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "Procedure" ]             ] )           ] [
fhir:context [ fhir:v "activity" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "outcomeReference" ] ;
fhir:variable [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "create" ] ;
            ( fhir:parameter [
fhir:value [ 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 [ fhir:v "'https://example/Procedure/' + %procedure.id" ]             ] )           ] ) ;
          ( fhir:dependent [
fhir:name [ fhir:v "Procedure" ] ;
            ( fhir:variable [ fhir:v "procedureC" ] [ fhir:v "patient" ] [ fhir:v "encounter" ] [ fhir:v "procedure" ] [ fhir:v "bundle" ] )           ] )         ] [
fhir:name [ fhir:v "viste" ] ;
          ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "encounter" ] ;
fhir:variable [ fhir:v "encounterCDA" ]           ] ) ;
          ( fhir:target [
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 [ 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 [ fhir:v "POST" ]             ] )           ] [
fhir:context [ fhir:v "e3" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "resource" ] ;
fhir:variable [ fhir:v "encounterFHIR" ] ;
fhir:transform [ fhir:v "create" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "Encounter" ]             ] )           ] [
fhir:context [ fhir:v "encounterFHIR" ] ;
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 [ fhir:v "https://example/Encounter/" ]             ] [
fhir:value [ 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 [ fhir:v "Encounter" ]             ] )           ] [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "encounter" ] ;
fhir:variable [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "create" ] ;
            ( fhir:parameter [
fhir:value [ 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 [ fhir:v "'https://example/Encounter/' + %encounterFHIR.id" ]             ] )           ] ) ;
          ( fhir:rule [
fhir:name [ fhir:v "refPatient" ] ;
            ( fhir:source [
fhir:context [ fhir:v "encounterCDA" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "encounterFHIR" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "subject" ] ;
fhir:variable [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "create" ] ;
              ( fhir:parameter [
fhir:value [ 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 [ fhir:v "'https://example/Patient/' + %patient.id" ]               ] )             ] ) ;
fhir:documentation [ fhir:v "encounterCDA -> encounterFHIR.partOf = create('Reference') as reference,  reference.reference = ('https://example/Encounter/' + %encounter.id) \"encounterHeader\";" ]           ] [
fhir:name [ fhir:v "id" ] ;
            ( fhir:source [
fhir:context [ fhir:v "encounterCDA" ] ;
fhir:element [ fhir:v "id" ] ;
fhir:variable [ fhir:v "vvv" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "encounterFHIR" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "identifier" ] ;
fhir:variable [ fhir:v "vvv" ] ;
fhir:transform [ fhir:v "create" ]             ] )           ] [
fhir:name [ fhir:v "statusCode" ] ;
            ( fhir:source [
fhir:context [ fhir:v "encounterCDA" ] ;
fhir:element [ fhir:v "statusCode" ] ;
fhir:variable [ fhir:v "vvv" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "encounterFHIR" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "status" ] ;
fhir:variable [ fhir:v "vvv" ] ;
fhir:transform [ fhir:v "create" ]             ] )           ] [
fhir:name [ fhir:v "status" ] ;
            ( fhir:source [
fhir:context [ fhir:v "encounterCDA" ] ;
fhir:condition [ fhir:v "statusCode.exists().not()" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "encounterFHIR" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "status" ] ;
fhir:transform [ fhir:v "copy" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "unknown" ]               ] )             ] )           ] [
fhir:name [ fhir:v "class" ] ;
            ( fhir:source [
fhir:context [ fhir:v "encounterCDA" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "code" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "encounterFHIR" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "class" ] ;
fhir:variable [ fhir:v "class" ]             ] ) ;
            ( fhir:rule [
fhir:name [ fhir:v "code" ] ;
              ( fhir:source [
fhir:context [ fhir:v "code" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "code" ]               ] ) ;
              ( fhir:target [
fhir:context [ fhir:v "class" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:transform [ fhir:v "cast" ] ;
                ( fhir:parameter [
fhir:value [ fhir:v "code" ]                 ] [
fhir:value [ fhir:v "string" ]                 ] )               ] )             ] [
fhir:name [ fhir:v "codeSystem" ] ;
              ( fhir:source [
fhir:context [ fhir:v "code" ] ;
fhir:element [ fhir:v "codeSystem" ] ;
fhir:variable [ fhir:v "system" ]               ] ) ;
              ( fhir:target [
fhir:context [ fhir:v "class" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "system" ] ;
fhir:transform [ fhir:v "translate" ] ;
                ( fhir:parameter [
fhir:value [ fhir:v "system" ]                 ] [
fhir:value [ fhir:v "http://hl7.org/fhir/ConceptMap/special-oid2uri" ]                 ] [
fhir:value [ fhir:v "uri" ]                 ] )               ] )             ] [
fhir:name [ fhir:v "displayName" ] ;
              ( fhir:source [
fhir:context [ fhir:v "code" ] ;
fhir:element [ fhir:v "displayName" ] ;
fhir:variable [ fhir:v "display" ]               ] ) ;
              ( fhir:target [
fhir:context [ fhir:v "class" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "display" ] ;
fhir:transform [ fhir:v "cast" ] ;
                ( fhir:parameter [
fhir:value [ fhir:v "display" ]                 ] [
fhir:value [ fhir:v "string" ]                 ] )               ] )             ] )           ] [
fhir:name [ fhir:v "text" ] ;
            ( fhir:source [
fhir:context [ fhir:v "encounterCDA" ] ;
fhir:element [ fhir:v "text" ] ;
fhir:variable [ fhir:v "text" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "encounterFHIR" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "type" ] ;
fhir:variable [ fhir:v "type" ]             ] ) ;
            ( fhir:rule [
fhir:name [ fhir:v "value" ] ;
              ( fhir:source [
fhir:context [ fhir:v "text" ] ;
fhir:element [ fhir:v "reference" ] ;
fhir:variable [ fhir:v "reference" ]               ] ) ;
              ( fhir:target [
fhir:context [ fhir:v "type" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "text" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
                ( fhir:parameter [
fhir:value [ fhir:v "reference.value" ]                 ] )               ] )             ] )           ] [
fhir:name [ fhir:v "efft" ] ;
            ( fhir:source [
fhir:context [ fhir:v "encounterCDA" ] ;
fhir:element [ fhir:v "effectiveTime" ] ;
fhir:variable [ fhir:v "effectiveTime" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "encounterFHIR" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "period" ] ;
fhir:variable [ fhir:v "period" ] ;
fhir:transform [ fhir:v "create" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "Period" ]               ] )             ] ) ;
            ( fhir:rule [
fhir:name [ fhir:v "val" ] ;
              ( fhir:source [
fhir:context [ fhir:v "effectiveTime" ]               ] ) ;
              ( fhir:target [
fhir:context [ fhir:v "period" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "start" ] ;
fhir:variable [ fhir:v "start" ] ;
fhir:transform [ fhir:v "create" ] ;
                ( fhir:parameter [
fhir:value [ fhir:v "dateTime" ]                 ] )               ] ) ;
              ( fhir:dependent [
fhir:name [ fhir:v "TSDateTime" ] ;
                ( fhir:variable [ fhir:v "effectiveTime" ] [ fhir:v "start" ] )               ] )             ] )           ] )         ] [
fhir:name [ fhir:v "act" ] ;
          ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "act" ] ;
fhir:variable [ fhir:v "act" ]           ] ) ;
          ( fhir:rule [
fhir:name [ fhir:v "id" ] ;
            ( fhir:source [
fhir:context [ fhir:v "act" ] ;
fhir:element [ fhir:v "id" ] ;
fhir:variable [ fhir:v "vvv" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "identifier" ] ;
fhir:variable [ fhir:v "vvv" ] ;
fhir:transform [ fhir:v "create" ]             ] )           ] [
fhir:name [ fhir:v "code" ] ;
            ( fhir:source [
fhir:context [ fhir:v "act" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "vvv" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "activity" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "outcomeCodeableConcept" ] ;
fhir:variable [ fhir:v "vvv" ] ;
fhir:transform [ fhir:v "create" ]             ] )           ] [
fhir:name [ fhir:v "text" ] ;
            ( fhir:source [
fhir:context [ fhir:v "act" ] ;
fhir:element [ fhir:v "text" ] ;
fhir:variable [ fhir:v "text" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "activity" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "progress" ] ;
fhir:variable [ fhir:v "progress" ] ;
fhir:transform [ fhir:v "create" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "Annotation" ]               ] )             ] ) ;
            ( fhir:rule [
fhir:name [ fhir:v "value" ] ;
              ( fhir:source [
fhir:context [ fhir:v "text" ] ;
fhir:element [ fhir:v "reference" ] ;
fhir:variable [ fhir:v "reference" ]               ] ) ;
              ( fhir:target [
fhir:context [ fhir:v "progress" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "text" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
                ( fhir:parameter [
fhir:value [ fhir:v "reference.value" ]                 ] )               ] )             ] )           ] [
fhir:name [ fhir:v "efft" ] ;
            ( fhir:source [
fhir:context [ fhir:v "act" ] ;
fhir:element [ fhir:v "effectiveTime" ] ;
fhir:variable [ fhir:v "effectiveTime" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "detail" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "scheduled" ] ;
fhir:variable [ fhir:v "period" ] ;
fhir:transform [ fhir:v "create" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "Period" ]               ] )             ] ) ;
            ( fhir:rule [
fhir:name [ fhir:v "val" ] ;
              ( fhir:source [
fhir:context [ fhir:v "effectiveTime" ]               ] ) ;
              ( fhir:target [
fhir:context [ fhir:v "period" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "start" ] ;
fhir:variable [ fhir:v "start" ] ;
fhir:transform [ fhir:v "create" ] ;
                ( fhir:parameter [
fhir:value [ fhir:v "dateTime" ]                 ] )               ] ) ;
              ( fhir:dependent [
fhir:name [ fhir:v "TSDateTime" ] ;
                ( fhir:variable [ fhir:v "effectiveTime" ] [ fhir:v "start" ] )               ] )             ] )           ] [
fhir:name [ fhir:v "status" ] ;
            ( fhir:source [
fhir:context [ fhir:v "act" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "detail" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "status" ] ;
fhir:transform [ fhir:v "copy" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "completed" ]               ] )             ] )           ] )         ] )       ] )     ] )
  ] [
fhir:name [ fhir:v "MedicationRequest" ] ;
fhir:typeMode [ fhir:v "none" ] ;
    ( fhir:input [
fhir:name [ fhir:v "src" ] ;
fhir:type [ fhir:v "substanceAdministration" ] ;
fhir:mode [ fhir:v "source" ]     ] [
fhir:name [ fhir:v "patient" ] ;
fhir:type [ fhir:v "Patient" ] ;
fhir:mode [ fhir:v "target" ]     ] [
fhir:name [ fhir:v "encounter" ] ;
fhir:type [ fhir:v "Encounter" ] ;
fhir:mode [ fhir:v "target" ]     ] [
fhir:name [ fhir:v "tgt" ] ;
fhir:type [ fhir:v "MedicationRequest" ] ;
fhir:mode [ fhir:v "target" ]     ] [
fhir:name [ fhir:v "bundle" ] ;
fhir:type [ fhir:v "Bundle" ] ;
fhir:mode [ fhir:v "target" ]     ] ) ;
    ( fhir:rule [
fhir:name [ fhir:v "reference" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "subject" ] ;
fhir:variable [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "create" ] ;
        ( fhir:parameter [
fhir:value [ 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 [ fhir:v "'https://example/Patient/' + %patient.id" ]         ] )       ] ) ;
fhir:documentation [ fhir:v "default  + mandatory" ]     ] [
fhir:name [ fhir:v "intent" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "intent" ] ;
fhir:transform [ fhir:v "copy" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "order" ]         ] )       ] ) ;
fhir:documentation [ fhir:v "src -> tgt.encounter = create('Reference') as reference,  reference.reference = ('https://example/Encounter/' + %encounter.id) \"reference\";" ]     ] [
fhir:name [ fhir:v "st" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:condition [ fhir:v "statusCode.exists().not()" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "status" ] ;
fhir:transform [ fhir:v "copy" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "unknown" ]         ] )       ] )     ] [
fhir:name [ fhir:v "status" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "statusCode" ] ;
fhir:variable [ fhir:v "sc" ]       ] ) ;
      ( fhir:rule [
fhir:name [ fhir:v "codeS" ] ;
        ( fhir:source [
fhir:context [ fhir:v "sc" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "cos" ]         ] ) ;
        ( fhir:target [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "status" ] ;
fhir:transform [ fhir:v "translate" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "cos" ]           ] [
fhir:value [ fhir:v "#MedicationStatusMap" ]           ] [
fhir:value [ fhir:v "code" ]           ] )         ] )       ] )     ] [
fhir:name [ fhir:v "id" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "id" ] ;
fhir:variable [ fhir:v "vvv" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "identifier" ] ;
fhir:variable [ fhir:v "vvv" ] ;
fhir:transform [ fhir:v "create" ]       ] )     ] [
fhir:name [ fhir:v "note" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "text" ] ;
fhir:variable [ fhir:v "txt" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "note" ] ;
fhir:variable [ fhir:v "note" ]       ] ) ;
      ( fhir:rule [
fhir:name [ fhir:v "text" ] ;
        ( fhir:source [
fhir:context [ fhir:v "txt" ] ;
fhir:element [ fhir:v "reference" ] ;
fhir:variable [ fhir:v "reference" ]         ] ) ;
        ( fhir:target [
fhir:context [ fhir:v "note" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "text" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "reference.value" ]           ] )         ] )       ] )     ] [
fhir:name [ fhir:v "period" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:type [ fhir:v "IVL_TS" ] ;
fhir:element [ fhir:v "effectiveTime" ] ;
fhir:variable [ fhir:v "eff" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "dosageInstruction" ] ;
fhir:variable [ fhir:v "dosage" ] ;
fhir:transform [ fhir:v "create" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "Dosage" ]         ] )       ] ) ;
      ( fhir:rule [
fhir:name [ fhir:v "timing" ] ;
        ( fhir:source [
fhir:context [ fhir:v "eff" ]         ] ) ;
        ( fhir:target [
fhir:context [ fhir:v "dosage" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "timing" ] ;
fhir:variable [ fhir:v "timing" ] ;
fhir:transform [ fhir:v "create" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "Timing" ]           ] )         ] ) ;
        ( fhir:rule [
fhir:name [ fhir:v "rep" ] ;
          ( fhir:source [
fhir:context [ fhir:v "eff" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "timing" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "repeat" ] ;
fhir:variable [ fhir:v "rep" ]           ] ) ;
          ( fhir:rule [
fhir:name [ fhir:v "valuePeriod" ] ;
            ( fhir:source [
fhir:context [ fhir:v "eff" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "rep" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "bounds" ] ;
fhir:variable [ fhir:v "value" ] ;
fhir:transform [ fhir:v "create" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "Period" ]               ] )             ] ) ;
            ( fhir:dependent [
fhir:name [ fhir:v "IVLTSPeriod" ] ;
              ( fhir:variable [ fhir:v "eff" ] [ fhir:v "value" ] )             ] )           ] )         ] )       ] )     ] [
fhir:name [ fhir:v "period" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:type [ fhir:v "EIVL_TS" ] ;
fhir:element [ fhir:v "effectiveTime" ] ;
fhir:variable [ fhir:v "effe" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "dosageInstruction" ] ;
fhir:variable [ fhir:v "dosage" ] ;
fhir:transform [ fhir:v "create" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "Dosage" ]         ] )       ] ) ;
      ( fhir:rule [
fhir:name [ fhir:v "timing" ] ;
        ( fhir:source [
fhir:context [ fhir:v "effe" ]         ] ) ;
        ( fhir:target [
fhir:context [ fhir:v "dosage" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "timing" ] ;
fhir:variable [ fhir:v "timing" ] ;
fhir:transform [ fhir:v "create" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "Timing" ]           ] )         ] ) ;
        ( fhir:rule [
fhir:name [ fhir:v "rep" ] ;
          ( fhir:source [
fhir:context [ fhir:v "effe" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "timing" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "repeat" ] ;
fhir:variable [ fhir:v "rep" ]           ] ) ;
          ( fhir:rule [
fhir:name [ fhir:v "eventCode" ] ;
            ( fhir:source [
fhir:context [ fhir:v "effe" ] ;
fhir:element [ fhir:v "eventCode" ] ;
fhir:variable [ fhir:v "ev" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "rep" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "when" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "ev.code" ]               ] )             ] )           ] )         ] )       ] )     ] [
fhir:name [ fhir:v "tim" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:type [ fhir:v "IVL_TS" ] ;
fhir:element [ fhir:v "effectiveTime" ] ;
fhir:variable [ fhir:v "eff" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "dosageInstruction" ] ;
fhir:variable [ fhir:v "dosage" ] ;
fhir:transform [ fhir:v "create" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "Dosage" ]         ] )       ] [
fhir:context [ fhir:v "dosage" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "timing" ] ;
fhir:variable [ fhir:v "timing" ] ;
fhir:transform [ fhir:v "create" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "Timing" ]         ] )       ] [
fhir:context [ fhir:v "timing" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "event" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "eff.value" ]         ] )       ] )     ] [
fhir:name [ fhir:v "eff" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:type [ fhir:v "PIVL_TS" ] ;
fhir:element [ fhir:v "effectiveTime" ] ;
fhir:variable [ fhir:v "eff" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "dosageInstruction" ] ;
fhir:variable [ fhir:v "dosage" ] ;
fhir:transform [ fhir:v "create" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "Dosage" ]         ] )       ] ) ;
      ( fhir:rule [
fhir:name [ fhir:v "cod" ] ;
        ( fhir:source [
fhir:context [ fhir:v "eff" ]         ] ) ;
        ( fhir:target [
fhir:context [ fhir:v "dosage" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "timing" ] ;
fhir:variable [ fhir:v "timing" ] ;
fhir:transform [ fhir:v "create" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "Timing" ]           ] )         ] ) ;
        ( fhir:dependent [
fhir:name [ fhir:v "periodTiming" ] ;
          ( fhir:variable [ fhir:v "eff" ] [ fhir:v "timing" ] )         ] )       ] )     ] [
fhir:name [ fhir:v "condition" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:condition [ fhir:v "(src.doseQuantity.exists() or src.rateQuantity.exists())" ]       ] ) ;
      ( fhir:rule [
fhir:name [ fhir:v "dosageIn" ] ;
        ( fhir:source [
fhir:context [ fhir:v "src" ]         ] ) ;
        ( fhir:target [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "dosageInstruction" ] ;
fhir:variable [ fhir:v "dosageInstruction" ] ;
fhir:transform [ fhir:v "create" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "Dosage" ]           ] )         ] ) ;
        ( fhir:rule [
fhir:name [ fhir:v "doseQuantity" ] ;
          ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "doseQuantity" ] ;
fhir:variable [ fhir:v "doseQuant" ]           ] ) ;
          ( fhir:rule [
fhir:name [ fhir:v "ot" ] ;
            ( fhir:source [
fhir:context [ fhir:v "doseQuant" ] ;
fhir:element [ fhir:v "originalText" ] ;
fhir:variable [ fhir:v "ot" ]             ] ) ;
            ( fhir:rule [
fhir:name [ fhir:v "reference" ] ;
              ( fhir:source [
fhir:context [ fhir:v "ot" ] ;
fhir:element [ fhir:v "reference" ] ;
fhir:variable [ fhir:v "vvv" ]               ] ) ;
              ( fhir:target [
fhir:context [ fhir:v "dosageInstruction" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "text" ] ;
fhir:variable [ fhir:v "vvv" ] ;
fhir:transform [ fhir:v "create" ]               ] )             ] )           ] [
fhir:name [ fhir:v "dosageRate" ] ;
            ( fhir:source [
fhir:context [ fhir:v "doseQuant" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "dosageInstruction" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "doseAndRate" ] ;
fhir:variable [ fhir:v "dosageRate" ]             ] ) ;
            ( fhir:rule [
fhir:name [ fhir:v "d" ] ;
              ( fhir:source [
fhir:context [ fhir:v "doseQuant" ]               ] ) ;
              ( fhir:target [
fhir:context [ fhir:v "dosageRate" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "dose" ] ;
fhir:variable [ fhir:v "d" ] ;
fhir:transform [ fhir:v "create" ] ;
                ( fhir:parameter [
fhir:value [ fhir:v "Range" ]                 ] )               ] ) ;
              ( fhir:rule [
fhir:name [ fhir:v "low" ] ;
                ( fhir:source [
fhir:context [ fhir:v "doseQuant" ]                 ] ) ;
                ( fhir:target [
fhir:context [ fhir:v "d" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "low" ] ;
fhir:variable [ fhir:v "l" ] ;
fhir:transform [ fhir:v "create" ] ;
                  ( fhir:parameter [
fhir:value [ fhir:v "SimpleQuantity" ]                   ] )                 ] ) ;
                ( fhir:rule [
fhir:name [ fhir:v "low" ] ;
                  ( fhir:source [
fhir:context [ fhir:v "doseQuant" ] ;
fhir:element [ fhir:v "low" ] ;
fhir:variable [ fhir:v "lo" ]                   ] ) ;
                  ( fhir:target [
fhir:context [ fhir:v "l" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
                    ( fhir:parameter [
fhir:value [ fhir:v "lo.value" ]                     ] )                   ] )                 ] [
fhir:name [ fhir:v "low" ] ;
                  ( fhir:source [
fhir:context [ fhir:v "doseQuant" ] ;
fhir:element [ fhir:v "low" ] ;
fhir:variable [ fhir:v "lo" ]                   ] ) ;
                  ( fhir:target [
fhir:context [ fhir:v "l" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "unit" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
                    ( fhir:parameter [
fhir:value [ fhir:v "lo.unit" ]                     ] )                   ] )                 ] )               ] [
fhir:name [ fhir:v "low" ] ;
                ( fhir:source [
fhir:context [ fhir:v "doseQuant" ]                 ] ) ;
                ( fhir:target [
fhir:context [ fhir:v "d" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "high" ] ;
fhir:variable [ fhir:v "h" ] ;
fhir:transform [ fhir:v "create" ] ;
                  ( fhir:parameter [
fhir:value [ fhir:v "SimpleQuantity" ]                   ] )                 ] ) ;
                ( fhir:rule [
fhir:name [ fhir:v "high" ] ;
                  ( fhir:source [
fhir:context [ fhir:v "doseQuant" ] ;
fhir:element [ fhir:v "high" ] ;
fhir:variable [ fhir:v "hi" ]                   ] ) ;
                  ( fhir:target [
fhir:context [ fhir:v "h" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
                    ( fhir:parameter [
fhir:value [ fhir:v "hi.value" ]                     ] )                   ] )                 ] [
fhir:name [ fhir:v "high" ] ;
                  ( fhir:source [
fhir:context [ fhir:v "doseQuant" ] ;
fhir:element [ fhir:v "high" ] ;
fhir:variable [ fhir:v "hi" ]                   ] ) ;
                  ( fhir:target [
fhir:context [ fhir:v "h" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "unit" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
                    ( fhir:parameter [
fhir:value [ fhir:v "hi.unit" ]                     ] )                   ] )                 ] )               ] )             ] )           ] )         ] [
fhir:name [ fhir:v "rate" ] ;
          ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "rateQuantity" ] ;
fhir:variable [ fhir:v "rateQuantity" ]           ] ) ;
          ( fhir:rule [
fhir:name [ fhir:v "ot" ] ;
            ( fhir:source [
fhir:context [ fhir:v "rateQuantity" ] ;
fhir:element [ fhir:v "originalText" ] ;
fhir:variable [ fhir:v "ot" ]             ] ) ;
            ( fhir:rule [
fhir:name [ fhir:v "reference" ] ;
              ( fhir:source [
fhir:context [ fhir:v "ot" ] ;
fhir:element [ fhir:v "reference" ] ;
fhir:variable [ fhir:v "vvv" ]               ] ) ;
              ( fhir:target [
fhir:context [ fhir:v "dosageInstruction" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "text" ] ;
fhir:variable [ fhir:v "vvv" ] ;
fhir:transform [ fhir:v "create" ]               ] )             ] )           ] [
fhir:name [ fhir:v "dosageRate" ] ;
            ( fhir:source [
fhir:context [ fhir:v "rateQuantity" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "dosageInstruction" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "doseAndRate" ] ;
fhir:variable [ fhir:v "dosageRate" ]             ] ) ;
            ( fhir:rule [
fhir:name [ fhir:v "r" ] ;
              ( fhir:source [
fhir:context [ fhir:v "rateQuantity" ]               ] ) ;
              ( fhir:target [
fhir:context [ fhir:v "dosageRate" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "rate" ] ;
fhir:variable [ fhir:v "d" ] ;
fhir:transform [ fhir:v "create" ] ;
                ( fhir:parameter [
fhir:value [ fhir:v "Range" ]                 ] )               ] ) ;
              ( fhir:rule [
fhir:name [ fhir:v "low" ] ;
                ( fhir:source [
fhir:context [ fhir:v "rateQuantity" ]                 ] ) ;
                ( fhir:target [
fhir:context [ fhir:v "d" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "low" ] ;
fhir:variable [ fhir:v "l" ] ;
fhir:transform [ fhir:v "create" ] ;
                  ( fhir:parameter [
fhir:value [ fhir:v "SimpleQuantity" ]                   ] )                 ] ) ;
                ( fhir:rule [
fhir:name [ fhir:v "low" ] ;
                  ( fhir:source [
fhir:context [ fhir:v "rateQuantity" ] ;
fhir:element [ fhir:v "low" ] ;
fhir:variable [ fhir:v "lo" ]                   ] ) ;
                  ( fhir:target [
fhir:context [ fhir:v "l" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
                    ( fhir:parameter [
fhir:value [ fhir:v "lo.value" ]                     ] )                   ] )                 ] [
fhir:name [ fhir:v "low" ] ;
                  ( fhir:source [
fhir:context [ fhir:v "rateQuantity" ] ;
fhir:element [ fhir:v "low" ] ;
fhir:variable [ fhir:v "lo" ]                   ] ) ;
                  ( fhir:target [
fhir:context [ fhir:v "l" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "unit" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
                    ( fhir:parameter [
fhir:value [ fhir:v "lo.unit" ]                     ] )                   ] )                 ] )               ] [
fhir:name [ fhir:v "high" ] ;
                ( fhir:source [
fhir:context [ fhir:v "rateQuantity" ]                 ] ) ;
                ( fhir:target [
fhir:context [ fhir:v "d" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "high" ] ;
fhir:variable [ fhir:v "h" ] ;
fhir:transform [ fhir:v "create" ] ;
                  ( fhir:parameter [
fhir:value [ fhir:v "SimpleQuantity" ]                   ] )                 ] ) ;
                ( fhir:rule [
fhir:name [ fhir:v "high" ] ;
                  ( fhir:source [
fhir:context [ fhir:v "rateQuantity" ] ;
fhir:element [ fhir:v "high" ] ;
fhir:variable [ fhir:v "hi" ]                   ] ) ;
                  ( fhir:target [
fhir:context [ fhir:v "h" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
                    ( fhir:parameter [
fhir:value [ fhir:v "hi.value" ]                     ] )                   ] )                 ] [
fhir:name [ fhir:v "high" ] ;
                  ( fhir:source [
fhir:context [ fhir:v "rateQuantity" ] ;
fhir:element [ fhir:v "high" ] ;
fhir:variable [ fhir:v "hi" ]                   ] ) ;
                  ( fhir:target [
fhir:context [ fhir:v "h" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "unit" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
                    ( fhir:parameter [
fhir:value [ fhir:v "hi.unit" ]                     ] )                   ] )                 ] )               ] )             ] )           ] )         ] [
fhir:name [ fhir:v "route" ] ;
          ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "routeCode" ] ;
fhir:variable [ fhir:v "vvv" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "dosageInstruction" ] ;
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 "src" ] ;
fhir:element [ fhir:v "approachSiteCode" ] ;
fhir:variable [ fhir:v "vvv" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "dosageInstruction" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "site" ] ;
fhir:variable [ fhir:v "vvv" ] ;
fhir:transform [ fhir:v "create" ]           ] )         ] [
fhir:name [ fhir:v "site" ] ;
          ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "targetSiteCode" ] ;
fhir:variable [ fhir:v "vvv" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "dosageInstruction" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "site" ] ;
fhir:variable [ fhir:v "vvv" ] ;
fhir:transform [ fhir:v "create" ]           ] )         ] )       ] )     ] [
fhir:name [ fhir:v "medication" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "consumable" ] ;
fhir:variable [ fhir:v "consumable" ]       ] ) ;
      ( 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 [ 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 [ fhir:v "POST" ]         ] )       ] [
fhir:context [ fhir:v "e1" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "resource" ] ;
fhir:variable [ fhir:v "medication" ] ;
fhir:transform [ fhir:v "create" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "Medication" ]         ] )       ] [
fhir:context [ fhir:v "medication" ] ;
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 [ fhir:v "https://example/Medication/" ]         ] [
fhir:value [ 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 [ fhir:v "Medication" ]         ] )       ] [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "medication" ] ;
fhir:variable [ fhir:v "medref" ] ;
fhir:transform [ fhir:v "create" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "Reference" ]         ] )       ] [
fhir:context [ fhir:v "medref" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "'https://example/Medication/' + %medication.id" ]         ] )       ] ) ;
      ( fhir:dependent [
fhir:name [ fhir:v "Medication" ] ;
        ( fhir:variable [ fhir:v "src" ] [ fhir:v "medication" ] [ fhir:v "patient" ] [ fhir:v "bundle" ] )       ] )     ] [
fhir:name [ fhir:v "entryR" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "entryRelationship" ] ;
fhir:variable [ fhir:v "entryRelationship" ]       ] ) ;
      ( fhir:rule [
fhir:name [ fhir:v "supply" ] ;
        ( fhir:source [
fhir:context [ fhir:v "entryRelationship" ] ;
fhir:element [ fhir:v "supply" ] ;
fhir:variable [ fhir:v "supply" ]         ] ) ;
        ( fhir:target [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "dispenseRequest" ] ;
fhir:variable [ fhir:v "dispenseRequest" ]         ] ) ;
        ( fhir:rule [
fhir:name [ fhir:v "quantity" ] ;
          ( fhir:source [
fhir:context [ fhir:v "supply" ] ;
fhir:element [ fhir:v "quantity" ] ;
fhir:variable [ fhir:v "quantityCDA" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "dispenseRequest" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "quantity" ] ;
fhir:variable [ fhir:v "quantityFHIR" ]           ] ) ;
          ( fhir:rule [
fhir:name [ fhir:v "value" ] ;
            ( fhir:source [
fhir:context [ fhir:v "quantityCDA" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "quantityFHIR" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "quantityCDA.value" ]               ] )             ] )           ] )         ] )       ] )     ] [
fhir:name [ fhir:v "Partecipant" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "participant" ] ;
fhir:variable [ fhir:v "participant" ]       ] ) ;
      ( fhir:rule [
fhir:name [ fhir:v "function" ] ;
        ( fhir:source [
fhir:context [ fhir:v "participant" ]         ] ) ;
        ( fhir:dependent [
fhir:name [ fhir:v "Practitioner" ] ;
          ( fhir:variable [ fhir:v "participant" ] [ fhir:v "tgt" ] [ fhir:v "bundle" ] )         ] )       ] [
fhir:name [ fhir:v "autor" ] ;
        ( fhir:source [
fhir:context [ fhir:v "participant" ] ;
fhir:element [ fhir:v "effectiveTime" ] ;
fhir:variable [ fhir:v "vvv" ]         ] ) ;
        ( fhir:target [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "authoredOn" ] ;
fhir:variable [ fhir:v "vvv" ] ;
fhir:transform [ fhir:v "create" ]         ] )       ] )     ] )
  ] [
fhir:name [ fhir:v "OrganizationAffiliation" ] ;
fhir:typeMode [ fhir:v "none" ] ;
    ( fhir:input [
fhir:name [ fhir:v "src" ] ;
fhir:type [ fhir:v "act" ] ;
fhir:mode [ fhir:v "source" ]     ] [
fhir:name [ fhir:v "patient" ] ;
fhir:type [ fhir:v "Patient" ] ;
fhir:mode [ fhir:v "target" ]     ] [
fhir:name [ fhir:v "enc" ] ;
fhir:type [ fhir:v "Encounter" ] ;
fhir:mode [ fhir:v "target" ]     ] [
fhir:name [ fhir:v "tgt" ] ;
fhir:type [ fhir:v "OrganizationAffiliation" ] ;
fhir:mode [ fhir:v "target" ]     ] [
fhir:name [ fhir:v "bundle" ] ;
fhir:type [ fhir:v "Bundle" ] ;
fhir:mode [ fhir:v "target" ]     ] ) ;
    ( fhir:rule [
fhir:name [ fhir:v "id" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "id" ] ;
fhir:variable [ fhir:v "vvv" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "identifier" ] ;
fhir:variable [ fhir:v "vvv" ] ;
fhir:transform [ fhir:v "create" ]       ] )     ] [
fhir:name [ fhir:v "statusCode" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "statusCode" ] ;
fhir:condition [ fhir:v "code = 'active'" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "active" ] ;
fhir:transform [ fhir:v "copy" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "true"^^xsd:boolean ]         ] )       ] ) ;
fhir:documentation [ fhir:v "src.code -> tgt.specialty as specialty then{" ]     ] [
fhir:name [ fhir:v "statusCode" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "statusCode" ] ;
fhir:condition [ fhir:v "(code = 'active').not()" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "active" ] ;
fhir:transform [ fhir:v "copy" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "false"^^xsd:boolean ]         ] )       ] )     ] [
fhir:name [ fhir:v "effectiveTime" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "effectiveTime" ] ;
fhir:variable [ fhir:v "eff" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "period" ]       ] )     ] [
fhir:name [ fhir:v "a" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "specialty" ] ;
fhir:variable [ fhir:v "spec" ] ;
fhir:transform [ fhir:v "create" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "CodeableConcept" ]         ] )       ] ) ;
      ( fhir:rule [
fhir:name [ fhir:v "spec" ] ;
        ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "code" ]         ] ) ;
        ( fhir:rule [
fhir:name [ fhir:v "cd" ] ;
          ( fhir:source [
fhir:context [ fhir:v "code" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "spec" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "coding" ] ;
fhir:variable [ fhir:v "cd" ] ;
fhir:transform [ fhir:v "create" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "Coding" ]             ] )           ] ) ;
          ( fhir:rule [
fhir:name [ fhir:v "code" ] ;
            ( fhir:source [
fhir:context [ fhir:v "code" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "cd" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "code.code" ]               ] )             ] )           ] [
fhir:name [ fhir:v "code" ] ;
            ( fhir:source [
fhir:context [ fhir:v "code" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "cd" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "display" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "code.displayName" ]               ] )             ] )           ] [
fhir:name [ fhir:v "root1" ] ;
            ( fhir:source [
fhir:context [ fhir:v "code" ] ;
fhir:element [ fhir:v "codeSystem" ] ;
fhir:variable [ fhir:v "r" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "cd" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "system" ] ;
fhir:transform [ fhir:v "translate" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "r" ]               ] [
fhir:value [ fhir:v "http://hl7.org/fhir/ConceptMap/special-oid2uri" ]               ] [
fhir:value [ fhir:v "uri" ]               ] )             ] )           ] )         ] )       ] [
fhir:name [ fhir:v "entry" ] ;
        ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "entryRelationship" ] ;
fhir:variable [ fhir:v "entry" ]         ] ) ;
        ( fhir:rule [
fhir:name [ fhir:v "act" ] ;
          ( fhir:source [
fhir:context [ fhir:v "entry" ] ;
fhir:element [ fhir:v "act" ] ;
fhir:variable [ fhir:v "a" ]           ] ) ;
          ( fhir:rule [
fhir:name [ fhir:v "ref" ] ;
            ( fhir:source [
fhir:context [ fhir:v "a" ] ;
fhir:element [ fhir:v "text" ] ;
fhir:variable [ fhir:v "tx" ]             ] ) ;
            ( fhir:rule [
fhir:name [ fhir:v "reference" ] ;
              ( fhir:source [
fhir:context [ fhir:v "tx" ] ;
fhir:element [ fhir:v "reference" ] ;
fhir:variable [ fhir:v "reff" ]               ] ) ;
              ( fhir:target [
fhir:context [ fhir:v "spec" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "text" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
                ( fhir:parameter [
fhir:value [ fhir:v "reff.value" ]                 ] )               ] )             ] )           ] )         ] )       ] ) ;
fhir:documentation [ fhir:v "src.code -> tgt.specialty;" ]     ] )
  ] [
fhir:name [ fhir:v "DiagnosticReportFunction" ] ;
fhir:typeMode [ fhir:v "none" ] ;
    ( fhir:input [
fhir:name [ fhir:v "src" ] ;
fhir:type [ fhir:v "organizer" ] ;
fhir:mode [ fhir:v "source" ]     ] [
fhir:name [ fhir:v "patient" ] ;
fhir:type [ fhir:v "Patient" ] ;
fhir:mode [ fhir:v "target" ]     ] [
fhir:name [ fhir:v "enc" ] ;
fhir:type [ fhir:v "Encounter" ] ;
fhir:mode [ fhir:v "target" ]     ] [
fhir:name [ fhir:v "tgt" ] ;
fhir:type [ fhir:v "DiagnosticReport" ] ;
fhir:mode [ fhir:v "target" ]     ] [
fhir:name [ fhir:v "bundle" ] ;
fhir:type [ fhir:v "Bundle" ] ;
fhir:mode [ fhir:v "target" ]     ] ) ;
    ( fhir:rule [
fhir:name [ fhir:v "reference" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "subject" ] ;
fhir:variable [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "create" ] ;
        ( fhir:parameter [
fhir:value [ 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 [ fhir:v "'https://example/Patient/' + %patient.id" ]         ] )       ] )     ] [
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:documentation [ fhir:v "src -> tgt.encounter=create('Reference') as reference,  reference.reference = ('https://example/Encounter/' + %enc.id) \"reference\";" ]     ] [
fhir:name [ fhir:v "statusCode" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "statusCode" ] ;
fhir:condition [ fhir:v "code = 'completed'" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "status" ] ;
fhir:transform [ fhir:v "copy" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "final" ]         ] )       ] )     ] [
fhir:name [ fhir:v "value1" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "effectiveTime" ] ;
fhir:variable [ fhir:v "eff" ] ;
fhir:condition [ fhir:v "(value.exists())" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "effective" ] ;
fhir:variable [ fhir:v "value" ] ;
fhir:transform [ fhir:v "create" ] ;
        ( fhir:parameter [
fhir:value [ 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 "src" ] ;
fhir:element [ fhir:v "effectiveTime" ] ;
fhir:variable [ fhir:v "eff" ] ;
fhir:condition [ fhir:v "(low.exists())" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "effective" ] ;
fhir:variable [ fhir:v "value" ] ;
fhir:transform [ fhir:v "create" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "Period" ]         ] )       ] ) ;
      ( fhir:dependent [
fhir:name [ fhir:v "IVLTSPeriod" ] ;
        ( fhir:variable [ fhir:v "effectiveTime" ] [ fhir:v "value" ] )       ] )     ] [
fhir:name [ fhir:v "component" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "component" ] ;
fhir:variable [ fhir:v "component" ]       ] ) ;
      ( fhir:rule [
fhir:name [ fhir:v "hasMember" ] ;
        ( fhir:source [
fhir:context [ fhir:v "component" ] ;
fhir:element [ fhir:v "observation" ] ;
fhir:variable [ fhir:v "observation" ]         ] ) ;
        ( fhir:target [
fhir:context [ fhir:v "bundle" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "entry" ] ;
fhir:variable [ fhir:v "ei" ]         ] [
fhir:context [ fhir:v "ei" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "request" ] ;
fhir:variable [ fhir:v "request" ] ;
fhir:transform [ fhir:v "create" ] ;
          ( fhir:parameter [
fhir:value [ 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 [ fhir:v "POST" ]           ] )         ] [
fhir:context [ fhir:v "ei" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "resource" ] ;
fhir:variable [ fhir:v "obsi" ] ;
fhir:transform [ fhir:v "create" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "Observation" ]           ] )         ] [
fhir:context [ fhir:v "obsi" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "id" ] ;
fhir:variable [ fhir:v "uuidi" ] ;
fhir:transform [ fhir:v "uuid" ]         ] [
fhir:context [ fhir:v "ei" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "fullUrl" ] ;
fhir:transform [ fhir:v "append" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "https://example/Observation/" ]           ] [
fhir:value [ fhir:v "uuidi" ]           ] )         ] [
fhir:context [ fhir:v "request" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "url" ] ;
fhir:transform [ fhir:v "copy" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "Observation" ]           ] )         ] [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "result" ] ;
fhir:variable [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "create" ] ;
          ( fhir:parameter [
fhir:value [ 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 [ fhir:v "'https://example/Observation/' + %obsi.id" ]           ] )         ] ) ;
        ( fhir:dependent [
fhir:name [ fhir:v "Observation" ] ;
          ( fhir:variable [ fhir:v "observation" ] [ fhir:v "patient" ] [ fhir:v "enc" ] [ fhir:v "obsi" ] [ fhir:v "bundle" ] )         ] )       ] )     ] )
  ] [
fhir:name [ fhir:v "EncounterFunction" ] ;
fhir:typeMode [ fhir:v "none" ] ;
    ( fhir:input [
fhir:name [ fhir:v "src" ] ;
fhir:type [ fhir:v "cdaElement" ] ;
fhir:mode [ fhir:v "source" ]     ] [
fhir:name [ fhir:v "patient" ] ;
fhir:type [ fhir:v "Patient" ] ;
fhir:mode [ fhir:v "target" ]     ] [
fhir:name [ fhir:v "encounter" ] ;
fhir:type [ fhir:v "Encounter" ] ;
fhir:mode [ fhir:v "target" ]     ] [
fhir:name [ fhir:v "tgt" ] ;
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:rule [
fhir:name [ fhir:v "id" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "id" ] ;
fhir:variable [ fhir:v "vvv" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "identifier" ] ;
fhir:variable [ fhir:v "vvv" ] ;
fhir:transform [ fhir:v "create" ]       ] )     ] [
fhir:name [ fhir:v "statusCode" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "statusCode" ] ;
fhir:variable [ fhir:v "vvv" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "status" ] ;
fhir:variable [ fhir:v "vvv" ] ;
fhir:transform [ fhir:v "create" ]       ] )     ] [
fhir:name [ fhir:v "status" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:condition [ fhir:v "statusCode.exists().not()" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "status" ] ;
fhir:transform [ fhir:v "copy" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "unknown" ]         ] )       ] )     ] [
fhir:name [ fhir:v "co" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "code" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "class" ] ;
fhir:variable [ fhir:v "class" ]       ] ) ;
      ( fhir:rule [
fhir:name [ fhir:v "code" ] ;
        ( fhir:source [
fhir:context [ fhir:v "code" ]         ] ) ;
        ( fhir:target [
fhir:context [ fhir:v "class" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "code.code" ]           ] )         ] )       ] [
fhir:name [ fhir:v "display" ] ;
        ( fhir:source [
fhir:context [ fhir:v "code" ]         ] ) ;
        ( fhir:target [
fhir:context [ fhir:v "class" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "display" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "code.displayName" ]           ] )         ] )       ] [
fhir:name [ fhir:v "root1" ] ;
        ( fhir:source [
fhir:context [ fhir:v "code" ] ;
fhir:element [ fhir:v "codeSystem" ] ;
fhir:variable [ fhir:v "r" ]         ] ) ;
        ( fhir:target [
fhir:context [ fhir:v "class" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "system" ] ;
fhir:transform [ fhir:v "translate" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "r" ]           ] [
fhir:value [ fhir:v "http://hl7.org/fhir/ConceptMap/special-oid2uri" ]           ] [
fhir:value [ fhir:v "uri" ]           ] )         ] )       ] )     ] [
fhir:name [ fhir:v "where" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:condition [ fhir:v "effectiveTime.low.exists() or effectiveTime.high.exists()" ]       ] ) ;
      ( fhir:rule [
fhir:name [ fhir:v "effectiveTime" ] ;
        ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "effectiveTime" ] ;
fhir:variable [ fhir:v "eff" ]         ] ) ;
        ( fhir:target [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "period" ] ;
fhir:variable [ fhir:v "period" ] ;
fhir:transform [ fhir:v "create" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "Period" ]           ] )         ] ) ;
        ( fhir:dependent [
fhir:name [ fhir:v "IVLTSPeriod" ] ;
          ( fhir:variable [ fhir:v "eff" ] [ fhir:v "period" ] )         ] )       ] ) ;
fhir:documentation [ fhir:v "src.effectiveTime as effective -> tgt.period as period then{" ]     ] [
fhir:name [ fhir:v "where" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:condition [ fhir:v "effectiveTime.low.exists().not() or effectiveTime.high.exists().not()" ]       ] ) ;
      ( fhir:rule [
fhir:name [ fhir:v "efft" ] ;
        ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "effectiveTime" ] ;
fhir:variable [ fhir:v "effectivetime1" ]         ] ) ;
        ( fhir:target [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "period" ] ;
fhir:variable [ fhir:v "period" ] ;
fhir:transform [ fhir:v "create" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "Period" ]           ] )         ] ) ;
        ( fhir:rule [
fhir:name [ fhir:v "val" ] ;
          ( fhir:source [
fhir:context [ fhir:v "effectivetime1" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "period" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "start" ] ;
fhir:variable [ fhir:v "start" ] ;
fhir:transform [ fhir:v "create" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "dateTime" ]             ] )           ] ) ;
          ( fhir:dependent [
fhir:name [ fhir:v "TSDateTime" ] ;
            ( fhir:variable [ fhir:v "effectivetime1" ] [ fhir:v "start" ] )           ] )         ] )       ] ) ;
fhir:documentation [ fhir:v "effectiveTime = time-stamp" ]     ] [
fhir:name [ fhir:v "text" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "text" ] ;
fhir:variable [ fhir:v "tx" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "type" ] ;
fhir:variable [ fhir:v "ty" ]       ] ) ;
      ( fhir:rule [
fhir:name [ fhir:v "textType" ] ;
        ( fhir:source [
fhir:context [ fhir:v "tx" ] ;
fhir:element [ fhir:v "reference" ] ;
fhir:variable [ fhir:v "reff" ]         ] ) ;
        ( fhir:target [
fhir:context [ fhir:v "ty" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "text" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "reff.value" ]           ] )         ] )       ] ) ;
fhir:documentation [ fhir:v "src.effectiveTime as eff where (value.exists()) -> tgt.period = create('dateTime') as value then TSDateTime(eff, value) \"value1\";" ]     ] [
fhir:name [ fhir:v "01" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "performer" ] ;
fhir:variable [ fhir:v "performer" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "participant" ] ;
fhir:variable [ fhir:v "part" ]       ] ) ;
      ( fhir:rule [
fhir:name [ fhir:v "period" ] ;
        ( fhir:source [
fhir:context [ fhir:v "performer" ]         ] ) ;
        ( fhir:target [
fhir:context [ fhir:v "part" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "period" ] ;
fhir:variable [ fhir:v "period" ]         ] ) ;
        ( fhir:rule [
fhir:name [ fhir:v "val" ] ;
          ( fhir:source [
fhir:context [ fhir:v "performer" ] ;
fhir:element [ fhir:v "time" ] ;
fhir:variable [ fhir:v "time" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "period" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "start" ] ;
fhir:variable [ fhir:v "start" ]           ] ) ;
          ( fhir:dependent [
fhir:name [ fhir:v "TSDateTime" ] ;
            ( fhir:variable [ fhir:v "time" ] [ fhir:v "start" ] )           ] )         ] )       ] [
fhir:name [ fhir:v "performer" ] ;
        ( fhir:source [
fhir:context [ fhir:v "performer" ] ;
fhir:element [ fhir:v "assignedEntity" ] ;
fhir:variable [ fhir:v "assentity" ]         ] ) ;
        ( 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 [ 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 [ fhir:v "POST" ]           ] )         ] [
fhir:context [ fhir:v "e1" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "resource" ] ;
fhir:variable [ fhir:v "practitionerRole" ] ;
fhir:transform [ fhir:v "create" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "PractitionerRole" ]           ] )         ] [
fhir:context [ fhir:v "practitionerRole" ] ;
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 [ fhir:v "https://example/PractitionerRole/" ]           ] [
fhir:value [ 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 [ fhir:v "PractitionerRole" ]           ] )         ] [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "participant" ] ;
fhir:variable [ fhir:v "participant1" ] ;
fhir:transform [ fhir:v "create" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "BackboneElement" ]           ] )         ] [
fhir:context [ fhir:v "participant1" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "individual" ] ;
fhir:variable [ fhir:v "referencepart" ] ;
fhir:transform [ fhir:v "create" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "Reference" ]           ] )         ] [
fhir:context [ fhir:v "referencepart" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "'https://example/PractitionerRole/' + %practitionerRole.id" ]           ] )         ] ) ;
        ( fhir:rule [
fhir:name [ fhir:v "code" ] ;
          ( fhir:source [
fhir:context [ fhir:v "assentity" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "vvv" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "practitionerRole" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "vvv" ] ;
fhir:transform [ fhir:v "create" ]           ] )         ] [
fhir:name [ fhir:v "assignedEntity" ] ;
          ( fhir:source [
fhir:context [ fhir:v "assentity" ]           ] ) ;
          ( fhir:target [
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 "request" ] ;
fhir:transform [ fhir:v "create" ] ;
            ( fhir:parameter [
fhir:value [ 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 [ fhir:v "PUT" ]             ] )           ] [
fhir:context [ fhir:v "e2" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "resource" ] ;
fhir:variable [ fhir:v "practitioner" ] ;
fhir:transform [ fhir:v "create" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "Practitioner" ]             ] )           ] ) ;
          ( fhir:rule [
fhir:name [ fhir:v "meta" ] ;
            ( fhir:source [
fhir:context [ fhir:v "assentity" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "practitioner" ] ;
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 "assentity" ]               ] ) ;
              ( 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 [ fhir:v "Coding" ]                 ] )               ] ) ;
              ( fhir:rule [
fhir:name [ fhir:v "system" ] ;
                ( fhir:source [
fhir:context [ fhir:v "assentity" ]                 ] ) ;
                ( 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 [ fhir:v "http://algoritmodiscoring" ]                   ] )                 ] )               ] [
fhir:name [ fhir:v "code" ] ;
                ( fhir:source [
fhir:context [ fhir:v "assentity" ]                 ] ) ;
                ( 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 [ fhir:v "ClinicalDocument/body/encounter/performer" ]                   ] )                 ] )               ] )             ] )           ] [
fhir:name [ fhir:v "identifier" ] ;
            ( fhir:source [
fhir:context [ fhir:v "assentity" ] ;
fhir:element [ fhir:v "id" ] ;
fhir:variable [ fhir:v "id" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "practitioner" ] ;
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 [ fhir:v "r" ]                 ] [
fhir:value [ fhir:v "http://hl7.org/fhir/ConceptMap/special-oid2uri" ]                 ] [
fhir:value [ 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 [ fhir:v "ext" ]                 ] )               ] ) ;
              ( fhir:rule [
fhir:name [ fhir:v "UUID" ] ;
                ( fhir:source [
fhir:context [ fhir:v "assentity" ]                 ] ) ;
                ( 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 [ fhir:v "Practitioner?identifier=" ]                   ] [
fhir:value [ 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 [ 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 "performer" ] ;
                ( fhir:source [
fhir:context [ fhir:v "id" ] ;
fhir:element [ fhir:v "extension" ] ;
fhir:variable [ fhir:v "ext" ]                 ] ) ;
                ( fhir:target [
fhir:context [ fhir:v "practitioner" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "id" ] ;
fhir:variable [ fhir:v "uuid2" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
                  ( fhir:parameter [
fhir:value [ fhir:v "r + '-' + ext" ]                   ] )                 ] [
fhir:context [ fhir:v "e2" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "fullUrl" ] ;
fhir:transform [ fhir:v "append" ] ;
                  ( fhir:parameter [
fhir:value [ fhir:v "https://example/Practitioner/" ]                   ] [
fhir:value [ fhir:v "uuid2" ]                   ] )                 ] [
fhir:context [ fhir:v "practitionerRole" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "practitioner" ] ;
fhir:variable [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "create" ] ;
                  ( fhir:parameter [
fhir:value [ 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 [ fhir:v "'https://example/Practitioner/' + %practitioner.id" ]                   ] )                 ] )               ] )             ] )           ] [
fhir:name [ fhir:v "2.16.840.1.113883.2.9.4.3.2" ] ;
            ( fhir:source [
fhir:context [ fhir:v "assentity" ] ;
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')" ]             ] ) ;
            ( 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 "request" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "url" ] ;
fhir:transform [ fhir:v "append" ] ;
                ( fhir:parameter [
fhir:value [ fhir:v "Practitioner?identifier=" ]                 ] [
fhir:value [ fhir:v "ext" ]                 ] )               ] )             ] )           ] [
fhir:name [ fhir:v "2.16.840.1.113883.2.9.4.3.2" ] ;
            ( fhir:source [
fhir:context [ fhir:v "assentity" ] ;
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')" ]             ] ) ;
            ( 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 "request" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "url" ] ;
fhir:transform [ fhir:v "append" ] ;
                ( fhir:parameter [
fhir:value [ fhir:v "Practitioner?identifier=" ]                 ] [
fhir:value [ fhir:v "ext" ]                 ] )               ] )             ] )           ] [
fhir:name [ fhir:v "addr" ] ;
            ( fhir:source [
fhir:context [ fhir:v "assentity" ] ;
fhir:element [ fhir:v "addr" ] ;
fhir:variable [ fhir:v "vvv" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "practitioner" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "address" ] ;
fhir:variable [ fhir:v "vvv" ] ;
fhir:transform [ fhir:v "create" ]             ] )           ] [
fhir:name [ fhir:v "telecom" ] ;
            ( fhir:source [
fhir:context [ fhir:v "assentity" ] ;
fhir:element [ fhir:v "telecom" ] ;
fhir:variable [ fhir:v "vvv" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "practitioner" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "telecom" ] ;
fhir:variable [ fhir:v "vvv" ] ;
fhir:transform [ fhir:v "create" ]             ] )           ] [
fhir:name [ fhir:v "name" ] ;
            ( fhir:source [
fhir:context [ fhir:v "assentity" ] ;
fhir:element [ fhir:v "assignedPerson" ] ;
fhir:variable [ fhir:v "person" ]             ] ) ;
            ( fhir:rule [
fhir:name [ fhir:v "name" ] ;
              ( fhir:source [
fhir:context [ fhir:v "person" ] ;
fhir:element [ fhir:v "name" ] ;
fhir:variable [ fhir:v "vvv" ]               ] ) ;
              ( fhir:target [
fhir:context [ fhir:v "practitioner" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "name" ] ;
fhir:variable [ fhir:v "vvv" ] ;
fhir:transform [ fhir:v "create" ]               ] )             ] [
fhir:name [ fhir:v "birth" ] ;
              ( fhir:source [
fhir:context [ fhir:v "person" ] ;
fhir:element [ fhir:v "birthTime" ] ;
fhir:variable [ fhir:v "birthTime" ]               ] ) ;
              ( fhir:rule [
fhir:name [ fhir:v "value" ] ;
                ( fhir:source [
fhir:context [ fhir:v "birthTime" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:variable [ fhir:v "date" ]                 ] ) ;
                ( fhir:target [
fhir:context [ fhir:v "practitioner" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "birthDate" ] ;
fhir:transform [ fhir:v "truncate" ] ;
                  ( fhir:parameter [
fhir:value [ fhir:v "date" ]                   ] [
fhir:value [ fhir:v "10"^^xsd:integer ]                   ] )                 ] )               ] )             ] )           ] )         ] )       ] )     ] )
  ] ) . #