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 - RAD - 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 "cda2fhirRadReport"] ; # 
  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/cda2fhirRadReport&quot; = &quot;cda2fhirRadReport&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; bundle.id = uuid() &quot;id&quot;;\n  cda.id -&gt; bundle.identifier &quot;identifier&quot;;\n  cda -&gt; bundle.type = 'transaction' &quot;type&quot;;\n  cda -&gt; bundle.timestamp = (timestamp.now()) &quot;date&quot;;\n  cda then ClinicalDocumentComposition(cda, composition, patient, encounter, bundle, DocumentReference) &quot;composition&quot;;\n  cda -&gt;  bundle.entry as e,  e.request = create('BackboneElement') as request,  request.method = 'POST',  e.resource = create('DiagnosticReport') as diagnosticReport,  diagnosticReport.id = uuid() as uuid1,  e.fullUrl = append('https://example/DiagnosticReport/', uuid1),  request.url = 'DiagnosticReport' then {\n    cda.code -&gt; diagnosticReport.code &quot;diagnosticCode&quot;;\n    cda -&gt; diagnosticReport.status = 'registered' &quot;stats&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, diagnosticReport);\n          };\n        };\n      } &quot;body&quot;;\n    };\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 dReport : DiagnosticReport) {\n  src.title as t -&gt; tgt.title = (t.dataString);\n  src.code -&gt; tgt.code;\n  src -&gt;  tgt.entry = create('Reference') as reference,  reference.reference = ('https://example/DiagnosticReport/' + %dReport.id) &quot;reference&quot;;\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    entry then DiagnosticReportFunction(src, entry, dReport, bundle, enc, patient) &quot;dreport&quot;;\n  };\n  src where src.entry.exists().not() then DiagnosticReportFunction(src, cda, dReport, bundle, enc, patient) &quot;narrative&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 DiagnosticReportFunction(source section : section, source src : entry, target dReport : DiagnosticReport, target bundle : Bundle, target encounter : Encounter, target patient : Patient) {\n  src.act as act1 then {\n    section where (code.code = '121181') -&gt;  bundle.entry as e1,  e1.request = create('BackboneElement') as request,  request.method = 'POST',  e1.resource = create('ImagingStudy') as imageS,  imageS.id = uuid() as uuid1,  e1.fullUrl = append('https://example/ImagingStudy/', uuid1),  request.url = 'ImagingStudy',  dReport.imagingStudy = create('Reference') as reference,  reference.reference = ('https://example/ImagingStudy/' + %imageS.id) then ImagingStudy(act1, section, imageS, patient, encounter) &quot;imagingStudy&quot;;\n    section where (code.code = '48765-2') -&gt;  bundle.entry as e2,  e2.request = create('BackboneElement') as request,  request.method = 'POST',  e2.resource = create('Observation') as obs1,  obs1.id = uuid() as uuid2,  e2.fullUrl = append('https://example/Observation/', uuid2),  request.url = 'Observation',  dReport.result = create('Reference') as reference,  reference.reference = ('https://example/Observation/' + %obs1.id) then {\n      section -&gt;  obs1.subject = create('Reference') as reference,  reference.reference = ('https://example/Patient/' + %patient.id) &quot;reference&quot;;\n      section -&gt;  obs1.encounter = create('Reference') as reference,  reference.reference = ('https://example/Encounter/' + %encounter.id) &quot;reference&quot;;\n      section -&gt; obs1.status = 'final' &quot;STatusobse&quot;;\n      section.code -&gt; obs1.code;\n      act1.statusCode as s then {\n        s.code as cos -&gt; obs1.status = translate(cos, '#OBSstatus', 'code') &quot;codeS&quot;;\n      } &quot;status&quot;;\n      section -&gt;  bundle.entry as e4,  e4.request = create('BackboneElement') as request,  request.method = 'POST',  e4.resource = create('List') as list1,  list1.id = uuid() as uuid4,  e4.fullUrl = append('https://example/List/', uuid4),  request.url = 'List',  obs1.focus = create('Reference') as reference,  reference.reference = ('https://example/List/' + %list1.id) then {\n        section -&gt;  list1.subject = create('Reference') as reference,  reference.reference = ('https://example/Patient/' + %patient.id) &quot;reference&quot;;\n        section -&gt; list1.status = 'current' &quot;listatus&quot;;\n        section -&gt; list1.mode = 'working' &quot;lstmod&quot;;\n        section -&gt;  list1.encounter = create('Reference') as reference,  reference.reference = ('https://example/Encounter/' + %encounter.id) &quot;reference&quot;;\n        src -&gt; list1.entry as entryList1 then {\n          act1 -&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',  entryList1.item = create('Reference') as reference,  reference.reference = ('https://example/AllergyIntolerance/' + %allergy.id) then allergyFunction(act1, allergy, patient, encounter) &quot;allergy&quot;;\n        } &quot;item&quot;;\n      } &quot;list&quot;;\n    } &quot;allergyAct&quot;;\n    section where (code.code = '55111-9') -&gt;  bundle.entry as e3,  e3.request = create('BackboneElement') as request,  request.method = 'POST',  e3.resource = create('Observation') as obs2,  obs2.id = uuid() as uuid3,  e3.fullUrl = append('https://example/Observation/', uuid3),  request.url = 'Observation',  dReport.result = create('Reference') as reference,  reference.reference = ('https://example/Observation/' + %obs2.id) then Observation(act1, patient, encounter, obs2, bundle) &quot;observation&quot;;\n  };\n  src.observation as entryobs then {\n    section where (code.code = '11329-0') -&gt;  bundle.entry as e6,  e6.request = create('BackboneElement') as request,  request.method = 'POST',  e6.resource = create('Observation') as obs6,  obs6.id = uuid() as uuid6,  e6.fullUrl = append('https://example/Observation/', uuid6),  request.url = 'Observation',  dReport.result = create('Reference') as reference,  reference.reference = ('https://example/Observation/' + %obs6.id) then {\n      section -&gt;  obs6.subject = create('Reference') as reference,  reference.reference = ('https://example/Patient/' + %patient.id) &quot;reference&quot;;\n      section -&gt;  obs6.encounter = create('Reference') as reference,  reference.reference = ('https://example/Encounter/' + %encounter.id) &quot;reference&quot;;\n      section -&gt; obs6.status = 'final' &quot;tatusobse&quot;;\n      section.code -&gt; obs6.code;\n      entryobs -&gt;  bundle.entry as e7,  e7.request = create('BackboneElement') as request,  request.method = 'POST',  e7.resource = create('Condition') as condition1,  condition1.id = uuid() as uuid7,  e7.fullUrl = append('https://example/Condition/', uuid7),  request.url = 'Condition',  obs6.focus = create('Reference') as reference,  reference.reference = ('https://example/Condition/' + %condition1.id) then ConditionFunction(entryobs, condition1, patient, encounter, bundle) &quot;condition&quot;;\n    } &quot;observationstclinica&quot;;\n    section where (code.code = '55114-3') -&gt;  bundle.entry as e9,  e9.request = create('BackboneElement') as request,  request.method = 'POST',  e9.resource = create('Observation') as obs9,  obs9.id = uuid() as uuid9,  e9.fullUrl = append('https://example/Observation/', uuid9),  request.url = 'Observation',  dReport.result = create('Reference') as reference,  reference.reference = ('https://example/Observation/' + %obs9.id) then Observation(entryobs, patient, encounter, obs9, bundle) &quot;precedentiEsami&quot;;\n    section where (code.code = '55109-3') -&gt;  bundle.entry as e8,  e8.request = create('BackboneElement') as request,  request.method = 'POST',  e8.resource = create('Observation') as obs8,  obs8.id = uuid() as uuid8,  e8.fullUrl = append('https://example/Observation/', uuid8),  request.url = 'Observation',  dReport.result = create('Reference') as reference,  reference.reference = ('https://example/Observation/' + %obs8.id) then Observation(entryobs, patient, encounter, obs8, bundle) &quot;complicanze&quot;;\n    section where (code.code = '18785-6') -&gt;  bundle.entry as e14,  e14.request = create('BackboneElement') as request,  request.method = 'POST',  e14.resource = create('Observation') as obs14,  obs14.id = uuid() as uuid14,  e14.fullUrl = append('https://example/Observation/', uuid14),  request.url = 'Observation',  dReport.result = create('Reference') as reference,  reference.reference = ('https://example/Observation/' + %obs14.id) then Observation(entryobs, patient, encounter, obs14, bundle) &quot;quesitoDiagnostico&quot;;\n  } &quot;entryObs&quot;;\n  src.organizer as organizer then {\n    src -&gt;  bundle.entry as e10,  e10.request = create('BackboneElement') as request,  request.method = 'POST',  e10.resource = create('Observation') as obs10,  obs10.id = uuid() as uuid10,  e10.fullUrl = append('https://example/Observation/', uuid10),  request.url = 'Observation',  dReport.result = create('Reference') as reference,  reference.reference = ('https://example/Observation/' + %obs10.id) then {\n      section -&gt;  obs10.subject = create('Reference') as reference,  reference.reference = ('https://example/Patient/' + %patient.id) &quot;reference&quot;;\n      section -&gt;  obs10.encounter = create('Reference') as reference,  reference.reference = ('https://example/Encounter/' + %encounter.id) &quot;reference&quot;;\n      section -&gt; obs10.status = 'final' &quot;tatusobse&quot;;\n      section.code -&gt; obs10.code &quot;codeObs&quot;;\n      section -&gt;  bundle.entry as e11,  e11.request = create('BackboneElement') as request,  request.method = 'POST',  e11.resource = create('List') as list11,  list11.id = uuid() as uuid11,  e11.fullUrl = append('https://example/List/', uuid11),  request.url = 'List',  obs10.focus = create('Reference') as reference,  reference.reference = ('https://example/List/' + %list11.id) then {\n        section -&gt;  list11.subject = create('Reference') as reference,  reference.reference = ('https://example/Patient/' + %patient.id) &quot;reference&quot;;\n        section -&gt; list11.status = 'current' &quot;liststat&quot;;\n        section -&gt; list11.mode = 'working' &quot;listmd&quot;;\n        section -&gt;  list11.encounter = create('Reference') as reference,  reference.reference = ('https://example/Encounter/' + %encounter.id) &quot;reference&quot;;\n        organizer -&gt; list11.entry as entryList2 then {\n          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',  entryList2.item = create('Reference') as reference,  reference.reference = ('https://example/FamilyMemberHistory/' + %familyMember.id) then FamilyMemberFunction(organizer, familyMember, patient) &quot;family&quot;;\n        } &quot;org&quot;;\n      } &quot;List&quot;;\n    } &quot;entryOrganizer&quot;;\n  };\n  section where section.entry.exists().not() then {\n    section where (code.code = '48765-2') -&gt;  bundle.entry as e2,  e2.request = create('BackboneElement') as request,  request.method = 'POST',  e2.resource = create('Observation') as obs1,  obs1.id = uuid() as uuid2,  e2.fullUrl = append('https://example/Observation/', uuid2),  request.url = 'Observation',  dReport.result = create('Reference') as reference,  reference.reference = ('https://example/Observation/' + %obs1.id) then {\n      section -&gt;  obs1.subject = create('Reference') as reference,  reference.reference = ('https://example/Patient/' + %patient.id) &quot;reference&quot;;\n      section -&gt;  obs1.encounter = create('Reference') as reference,  reference.reference = ('https://example/Encounter/' + %encounter.id) &quot;reference&quot;;\n      section -&gt; obs1.status = 'final' &quot;STatusobse&quot;;\n      section.code -&gt; obs1.code;\n      section.statusCode as s then {\n        s.code as cos -&gt; obs1.status = translate(cos, '#OBSstatus', 'code') &quot;codeS&quot;;\n      } &quot;status&quot;;\n      section.text as text -&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',  obs1.focus = create('Reference') as reference,  reference.reference = ('https://example/AllergyIntolerance/' + %allergy.id) then {\n        section -&gt;  allergy.patient = create('Reference') as reference,  reference.reference = ('https://example/Patient/' + %patient.id) &quot;reference&quot;;\n        section -&gt;  allergy.encounter = create('Reference') as reference,  reference.reference = ('https://example/Encounter/' + %encounter.id) &quot;reference&quot;;\n        section -&gt; allergy.clinicalStatus as clinicalStatus then {\n          section -&gt; clinicalStatus.coding = create('Coding') as coding then {\n            section -&gt; coding.code = 'active' &quot;code&quot;;\n            section -&gt; coding.system = 'http://terminology.hl7.org/CodeSystem/allergyintolerance-clinical' &quot;system&quot;;\n          } &quot;coding&quot;;\n        } &quot;status&quot;;\n        text -&gt; allergy.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;allergytext&quot;;\n    } &quot;allergyAct&quot;;\n    section where (code.code = '55110-1').not() or (code.code = '11329-0').not() then {\n      section.text as text -&gt;  bundle.entry as e13,  e13.request = create('BackboneElement') as request,  request.method = 'POST',  e13.resource = create('Observation') as obs13,  obs13.id = uuid() as uuid13,  e13.fullUrl = append('https://example/Observation/', uuid13),  request.url = 'Observation',  dReport.result = create('Reference') as reference,  reference.reference = ('https://example/Observation/' + %obs13.id) then {\n        section -&gt;  obs13.subject = create('Reference') as reference,  reference.reference = ('https://example/Patient/' + %patient.id) &quot;reference&quot;;\n        section -&gt;  obs13.encounter = create('Reference') as reference,  reference.reference = ('https://example/Encounter/' + %encounter.id) &quot;reference&quot;;\n        section -&gt; obs13.status = 'preliminary' &quot;obsst&quot;;\n        section.code -&gt; obs13.code &quot;obscde&quot;;\n        section -&gt; obs13.status = 'final' &quot;statusS&quot;;\n        text -&gt; obs13.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;NonConclusion&quot;;\n    section where (code.code = '55110-1') then {\n      section.text as t -&gt; dReport.conclusion = create('string') as textConclusion then EDstring(t, textConclusion) &quot;conc&quot;;\n    } &quot;conclusion&quot;;\n  } &quot;whereCond&quot;;\n}\n\ngroup Observation(source cda : observation, 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.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);\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 -&gt; ob.effective = create('dateTime') as value then TSDateTime(effectiveTime, value) &quot;value1&quot;;\n  cda.effectiveTime as effectiveTime where effectiveTime.low.exists() or effectiveTime.high.exists() then {\n    cda.effectiveTime as eff -&gt; ob.effective = create('Period') as period then IVLTSPeriod(effectiveTime, period) &quot;value3&quot;;\n  } &quot;where&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}\n\ngroup ImagingStudy(source src : act, source section : section, target tgt : ImagingStudy, target patient : Patient, target encounter : Encounter) {\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 -&gt; tgt.status = 'available' &quot;status&quot;;\n  src.entryRelationship as entryRelationship then {\n    entryRelationship.act as act -&gt; tgt.series as series then {\n      act.id as id -&gt; series.uid = (id.root);\n      section.code as code -&gt; series.modality = create('Coding') as coding then {\n        code.code as code1 -&gt; coding.code = cast(code1, 'string');\n        code.codeSystem as system -&gt; coding.system = translate(system, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri');\n        code.displayName as display -&gt; coding.display = cast(display, 'string');\n      } &quot;modality&quot;;\n      act.entryRelationship as entryRelationship2 then {\n        entryRelationship2.observation as obs -&gt; series.instance as instance then {\n          obs.id as id -&gt; instance.uid = (id.root) &quot;root&quot;;\n          obs.code as code1 -&gt; instance.sopClass = create('Coding') as coding then {\n            code1.code as code -&gt; coding.code = cast(code, 'string');\n            code1.codeSystem as system -&gt; coding.system = translate(system, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri');\n            code1.displayName as display -&gt; coding.display = cast(display, 'string');\n          } &quot;sopClass&quot;;\n        } &quot;idRoot&quot;;\n      } &quot;instance&quot;;\n    } &quot;series&quot;;\n  };\n}\n\ngroup ConditionFunction(source src : cdaElement, target tgt : Condition, target patient : Patient, target encounter : Encounter, target bundle : Bundle) {\n  src.code -&gt; tgt.category;\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 effectiveTime.low.exists() or effectiveTime.high.exists() then {\n    src.effectiveTime as effectiveTime -&gt; tgt.onset = create('Period') as period then IVLTSPeriod(effectiveTime, period) &quot;valuePeriod&quot;;\n  } &quot;where&quot;;\n  src.effectiveTime as effectiveTime -&gt; tgt.onset = create('dateTime') as dateTime then TSDateTime(effectiveTime, dateTime) &quot;value2&quot;;\n  src.value -&gt; tgt.code;\n  src.entryRelationship as entryRelationship then {\n    entryRelationship.observation as obsentry then {\n      obsentry.code where code = '89261-2' then {\n        obsentry -&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(obsentry, patient, encounter, obsy, bundle) &quot;observation&quot;;\n      } &quot;observation&quot;;\n      obsentry.code where code = '33999-4' then {\n        obsentry.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          obsentry.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    } &quot;EntryRelObsevation&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.entryRelationship as entryRelationship1 then {\n    entryRelationship1.observation as observation1 then {\n      observation1 where effectiveTime.low.exists() or effectiveTime.high.exists() then {\n        observation1.effectiveTime as effectiveTime -&gt; tgt.onset = create('Period') as period then IVLTSPeriod(effectiveTime, period) &quot;valuePeriod&quot;;\n      } &quot;where&quot;;\n      observation1.effectiveTime as effectiveTime -&gt; tgt.onset = create('dateTime') as dateTime then TSDateTime(effectiveTime, dateTime) &quot;value2&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      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.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        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.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          // criticality\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.value -&gt; tgt.clinicalStatus;\n          observation4.value as value -&gt; tgt.clinicalStatus as clinicalStatus 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          } &quot;clinicalStatus&quot;;\n        } &quot;observ4&quot;;\n      } &quot;entryR4&quot;;\n    };\n  } &quot;entryrelationship&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.statusCode -&gt; tgt.status;\n  src.effectiveTime as effectiveTime -&gt; tgt.date = create('dateTime') as value then TSDateTime(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.system -&gt; coding.system = 'http://hl7.org/fhir/administrative-gender';\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 where observation.effectiveTime.exists() then {\n        observation.effectiveTime as effectiveTime -&gt; tgt.condition = create('BackboneElement') as condition then {\n          observation.code -&gt; condition.code;\n          observation.value -&gt; condition.outcome &quot;codeable&quot;;\n          effectiveTime -&gt; condition.onset = 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;effttemp&quot;;\n      } &quot;cont&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\n</pre>\n      </div>"
  ] ; # 
  fhir:url [ fhir:v "http://hl7.it/fhir/cda2fhir/StructureMap/cda2fhirRadReport"^^xsd:anyURI] ; # 
  fhir:version [ fhir:v "0.1.0"] ; # 
  fhir:name [ fhir:v "cda2fhirRadReport"] ; # 
  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 "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: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: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 "diagnosticReport" ] ;
fhir:transform [ fhir:v "create" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "DiagnosticReport" ]         ] )       ] [
fhir:context [ fhir:v "diagnosticReport" ] ;
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/DiagnosticReport/" ]         ] [
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 "DiagnosticReport" ]         ] )       ] ) ;
      ( fhir:rule [
fhir:name [ fhir:v "diagnosticCode" ] ;
        ( fhir:source [
fhir:context [ fhir:v "cda" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "vvv" ]         ] ) ;
        ( fhir:target [
fhir:context [ fhir:v "diagnosticReport" ] ;
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 "diagnosticReport" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "status" ] ;
fhir:transform [ fhir:v "copy" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "registered" ]           ] )         ] )       ] [
fhir:name [ fhir:v "component" ] ;
        ( fhir:source [
fhir:context [ fhir:v "cda" ] ;
fhir:element [ fhir:v "component" ] ;
fhir:variable [ fhir:v "component" ]         ] ) ;
        ( fhir:rule [
fhir:name [ fhir:v "body" ] ;
          ( fhir:source [
fhir:context [ fhir:v "component" ] ;
fhir:element [ fhir:v "structuredBody" ] ;
fhir:variable [ fhir:v "body" ]           ] ) ;
          ( fhir:rule [
fhir:name [ fhir:v "component" ] ;
            ( fhir:source [
fhir:context [ fhir:v "body" ] ;
fhir:element [ fhir:v "component" ] ;
fhir:variable [ fhir:v "component" ]             ] ) ;
            ( fhir:rule [
fhir:name [ fhir:v "section" ] ;
              ( fhir:source [
fhir:context [ fhir:v "component" ] ;
fhir:element [ fhir:v "section" ] ;
fhir:variable [ fhir:v "srcSection" ]               ] ) ;
              ( fhir:rule [
fhir:name [ fhir:v "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 "diagnosticReport" ] )                 ] )               ] )             ] )           ] )         ] )       ] )     ] )
  ] [
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 "dReport" ] ;
fhir:type [ fhir:v "DiagnosticReport" ] ;
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 "reference" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ]       ] ) ;
      ( fhir:target [
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/' + %dReport.id" ]         ] )       ] )     ] [
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 "dreport" ] ;
        ( fhir:source [
fhir:context [ fhir:v "entry" ]         ] ) ;
        ( fhir:dependent [
fhir:name [ fhir:v "DiagnosticReportFunction" ] ;
          ( fhir:variable [ fhir:v "src" ] [ fhir:v "entry" ] [ fhir:v "dReport" ] [ fhir:v "bundle" ] [ fhir:v "enc" ] [ fhir:v "patient" ] )         ] )       ] )     ] [
fhir:name [ fhir:v "narrative" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:condition [ fhir:v "src.entry.exists().not()" ]       ] ) ;
      ( fhir:dependent [
fhir:name [ fhir:v "DiagnosticReportFunction" ] ;
        ( fhir:variable [ fhir:v "src" ] [ fhir:v "cda" ] [ fhir:v "dReport" ] [ fhir:v "bundle" ] [ fhir:v "enc" ] [ fhir:v "patient" ] )       ] )     ] [
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 "DiagnosticReportFunction" ] ;
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 "src" ] ;
fhir:type [ fhir:v "entry" ] ;
fhir:mode [ fhir:v "source" ]     ] [
fhir:name [ fhir:v "dReport" ] ;
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:name [ fhir:v "encounter" ] ;
fhir:type [ fhir:v "Encounter" ] ;
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 "act" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "act" ] ;
fhir:variable [ fhir:v "act1" ]       ] ) ;
      ( fhir:rule [
fhir:name [ fhir:v "imagingStudy" ] ;
        ( fhir:source [
fhir:context [ fhir:v "section" ] ;
fhir:condition [ fhir:v "(code.code = '121181')" ]         ] ) ;
        ( 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 "imageS" ] ;
fhir:transform [ fhir:v "create" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "ImagingStudy" ]           ] )         ] [
fhir:context [ fhir:v "imageS" ] ;
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/ImagingStudy/" ]           ] [
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 "ImagingStudy" ]           ] )         ] [
fhir:context [ fhir:v "dReport" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "imagingStudy" ] ;
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/ImagingStudy/' + %imageS.id" ]           ] )         ] ) ;
        ( fhir:dependent [
fhir:name [ fhir:v "ImagingStudy" ] ;
          ( fhir:variable [ fhir:v "act1" ] [ fhir:v "section" ] [ fhir:v "imageS" ] [ fhir:v "patient" ] [ fhir:v "encounter" ] )         ] )       ] [
fhir:name [ fhir:v "allergyAct" ] ;
        ( fhir:source [
fhir:context [ fhir:v "section" ] ;
fhir:condition [ fhir:v "(code.code = '48765-2')" ]         ] ) ;
        ( 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 "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 "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 "dReport" ] ;
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/' + %obs1.id" ]           ] )         ] ) ;
        ( fhir:rule [
fhir:name [ fhir:v "reference" ] ;
          ( fhir:source [
fhir:context [ fhir:v "section" ]           ] ) ;
          ( 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 "reference" ] ;
          ( fhir:source [
fhir:context [ fhir:v "section" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "obs1" ] ;
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/' + %encounter.id" ]             ] )           ] )         ] [
fhir:name [ fhir:v "STatusobse" ] ;
          ( fhir:source [
fhir:context [ fhir:v "section" ]           ] ) ;
          ( 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 "code" ] ;
          ( fhir:source [
fhir:context [ fhir:v "section" ] ;
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 "status" ] ;
          ( fhir:source [
fhir:context [ fhir:v "act1" ] ;
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 "obs1" ] ;
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 "list" ] ;
          ( fhir:source [
fhir:context [ fhir:v "section" ]           ] ) ;
          ( fhir:target [
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 "list1" ] ;
fhir:transform [ fhir:v "create" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "List" ]             ] )           ] [
fhir:context [ fhir:v "list1" ] ;
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/List/" ]             ] [
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 "List" ]             ] )           ] [
fhir:context [ fhir:v "obs1" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "focus" ] ;
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/List/' + %list1.id" ]             ] )           ] ) ;
          ( fhir:rule [
fhir:name [ fhir:v "reference" ] ;
            ( fhir:source [
fhir:context [ fhir:v "section" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "list1" ] ;
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 "listatus" ] ;
            ( fhir:source [
fhir:context [ fhir:v "section" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "list1" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "status" ] ;
fhir:transform [ fhir:v "copy" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "current" ]               ] )             ] )           ] [
fhir:name [ fhir:v "lstmod" ] ;
            ( fhir:source [
fhir:context [ fhir:v "section" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "list1" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "mode" ] ;
fhir:transform [ fhir:v "copy" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "working" ]               ] )             ] )           ] [
fhir:name [ fhir:v "reference" ] ;
            ( fhir:source [
fhir:context [ fhir:v "section" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "list1" ] ;
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/' + %encounter.id" ]               ] )             ] )           ] [
fhir:name [ fhir:v "item" ] ;
            ( fhir:source [
fhir:context [ fhir:v "src" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "list1" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "entry" ] ;
fhir:variable [ fhir:v "entryList1" ]             ] ) ;
            ( fhir:rule [
fhir:name [ fhir:v "allergy" ] ;
              ( fhir:source [
fhir:context [ fhir:v "act1" ]               ] ) ;
              ( 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 "entryList1" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "item" ] ;
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 "act1" ] [ fhir:v "allergy" ] [ fhir:v "patient" ] [ fhir:v "encounter" ] )               ] )             ] )           ] )         ] )       ] [
fhir:name [ fhir:v "observation" ] ;
        ( fhir:source [
fhir:context [ fhir:v "section" ] ;
fhir:condition [ fhir:v "(code.code = '55111-9')" ]         ] ) ;
        ( 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 "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 "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 "dReport" ] ;
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/' + %obs2.id" ]           ] )         ] ) ;
        ( fhir:dependent [
fhir:name [ fhir:v "Observation" ] ;
          ( fhir:variable [ fhir:v "act1" ] [ fhir:v "patient" ] [ fhir:v "encounter" ] [ fhir:v "obs2" ] [ fhir:v "bundle" ] )         ] )       ] )     ] [
fhir:name [ fhir:v "entryObs" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "observation" ] ;
fhir:variable [ fhir:v "entryobs" ]       ] ) ;
      ( fhir:rule [
fhir:name [ fhir:v "observationstclinica" ] ;
        ( fhir:source [
fhir:context [ fhir:v "section" ] ;
fhir:condition [ fhir:v "(code.code = '11329-0')" ]         ] ) ;
        ( 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 "obs6" ] ;
fhir:transform [ fhir:v "create" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "Observation" ]           ] )         ] [
fhir:context [ fhir:v "obs6" ] ;
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/Observation/" ]           ] [
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 "Observation" ]           ] )         ] [
fhir:context [ fhir:v "dReport" ] ;
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/' + %obs6.id" ]           ] )         ] ) ;
        ( fhir:rule [
fhir:name [ fhir:v "reference" ] ;
          ( fhir:source [
fhir:context [ fhir:v "section" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "obs6" ] ;
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 "reference" ] ;
          ( fhir:source [
fhir:context [ fhir:v "section" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "obs6" ] ;
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/' + %encounter.id" ]             ] )           ] )         ] [
fhir:name [ fhir:v "tatusobse" ] ;
          ( fhir:source [
fhir:context [ fhir:v "section" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "obs6" ] ;
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 "code" ] ;
          ( fhir:source [
fhir:context [ fhir:v "section" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "vvv" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "obs6" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "vvv" ] ;
fhir:transform [ fhir:v "create" ]           ] )         ] [
fhir:name [ fhir:v "condition" ] ;
          ( fhir:source [
fhir:context [ fhir:v "entryobs" ]           ] ) ;
          ( 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 "condition1" ] ;
fhir:transform [ fhir:v "create" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "Condition" ]             ] )           ] [
fhir:context [ fhir:v "condition1" ] ;
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/Condition/" ]             ] [
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 "Condition" ]             ] )           ] [
fhir:context [ fhir:v "obs6" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "focus" ] ;
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/' + %condition1.id" ]             ] )           ] ) ;
          ( fhir:dependent [
fhir:name [ fhir:v "ConditionFunction" ] ;
            ( fhir:variable [ fhir:v "entryobs" ] [ fhir:v "condition1" ] [ fhir:v "patient" ] [ fhir:v "encounter" ] [ fhir:v "bundle" ] )           ] )         ] )       ] [
fhir:name [ fhir:v "precedentiEsami" ] ;
        ( fhir:source [
fhir:context [ fhir:v "section" ] ;
fhir:condition [ fhir:v "(code.code = '55114-3')" ]         ] ) ;
        ( 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 "obs9" ] ;
fhir:transform [ fhir:v "create" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "Observation" ]           ] )         ] [
fhir:context [ fhir:v "obs9" ] ;
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/Observation/" ]           ] [
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 "Observation" ]           ] )         ] [
fhir:context [ fhir:v "dReport" ] ;
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/' + %obs9.id" ]           ] )         ] ) ;
        ( fhir:dependent [
fhir:name [ fhir:v "Observation" ] ;
          ( fhir:variable [ fhir:v "entryobs" ] [ fhir:v "patient" ] [ fhir:v "encounter" ] [ fhir:v "obs9" ] [ fhir:v "bundle" ] )         ] )       ] [
fhir:name [ fhir:v "complicanze" ] ;
        ( fhir:source [
fhir:context [ fhir:v "section" ] ;
fhir:condition [ fhir:v "(code.code = '55109-3')" ]         ] ) ;
        ( 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 "obs8" ] ;
fhir:transform [ fhir:v "create" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "Observation" ]           ] )         ] [
fhir:context [ fhir:v "obs8" ] ;
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/Observation/" ]           ] [
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 "Observation" ]           ] )         ] [
fhir:context [ fhir:v "dReport" ] ;
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/' + %obs8.id" ]           ] )         ] ) ;
        ( fhir:dependent [
fhir:name [ fhir:v "Observation" ] ;
          ( fhir:variable [ fhir:v "entryobs" ] [ fhir:v "patient" ] [ fhir:v "encounter" ] [ fhir:v "obs8" ] [ fhir:v "bundle" ] )         ] )       ] [
fhir:name [ fhir:v "quesitoDiagnostico" ] ;
        ( fhir:source [
fhir:context [ fhir:v "section" ] ;
fhir:condition [ fhir:v "(code.code = '18785-6')" ]         ] ) ;
        ( 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 "obs14" ] ;
fhir:transform [ fhir:v "create" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "Observation" ]           ] )         ] [
fhir:context [ fhir:v "obs14" ] ;
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/Observation/" ]           ] [
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 "Observation" ]           ] )         ] [
fhir:context [ fhir:v "dReport" ] ;
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/' + %obs14.id" ]           ] )         ] ) ;
        ( fhir:dependent [
fhir:name [ fhir:v "Observation" ] ;
          ( fhir:variable [ fhir:v "entryobs" ] [ fhir:v "patient" ] [ fhir:v "encounter" ] [ fhir:v "obs14" ] [ fhir:v "bundle" ] )         ] )       ] )     ] [
fhir:name [ fhir:v "organizer" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "organizer" ] ;
fhir:variable [ fhir:v "organizer" ]       ] ) ;
      ( fhir:rule [
fhir:name [ fhir:v "entryOrganizer" ] ;
        ( 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 "e10" ]         ] [
fhir:context [ fhir:v "e10" ] ;
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 "e10" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "resource" ] ;
fhir:variable [ fhir:v "obs10" ] ;
fhir:transform [ fhir:v "create" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "Observation" ]           ] )         ] [
fhir:context [ fhir:v "obs10" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "id" ] ;
fhir:variable [ fhir:v "uuid10" ] ;
fhir:transform [ fhir:v "uuid" ]         ] [
fhir:context [ fhir:v "e10" ] ;
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 "uuid10" ]           ] )         ] [
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 "dReport" ] ;
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/' + %obs10.id" ]           ] )         ] ) ;
        ( fhir:rule [
fhir:name [ fhir:v "reference" ] ;
          ( fhir:source [
fhir:context [ fhir:v "section" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "obs10" ] ;
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 "reference" ] ;
          ( fhir:source [
fhir:context [ fhir:v "section" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "obs10" ] ;
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/' + %encounter.id" ]             ] )           ] )         ] [
fhir:name [ fhir:v "tatusobse" ] ;
          ( fhir:source [
fhir:context [ fhir:v "section" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "obs10" ] ;
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 "codeObs" ] ;
          ( fhir:source [
fhir:context [ fhir:v "section" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "vvv" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "obs10" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "vvv" ] ;
fhir:transform [ fhir:v "create" ]           ] )         ] [
fhir:name [ fhir:v "List" ] ;
          ( fhir:source [
fhir:context [ fhir:v "section" ]           ] ) ;
          ( 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 "list11" ] ;
fhir:transform [ fhir:v "create" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "List" ]             ] )           ] [
fhir:context [ fhir:v "list11" ] ;
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/List/" ]             ] [
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 "List" ]             ] )           ] [
fhir:context [ fhir:v "obs10" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "focus" ] ;
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/List/' + %list11.id" ]             ] )           ] ) ;
          ( fhir:rule [
fhir:name [ fhir:v "reference" ] ;
            ( fhir:source [
fhir:context [ fhir:v "section" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "list11" ] ;
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 "liststat" ] ;
            ( fhir:source [
fhir:context [ fhir:v "section" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "list11" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "status" ] ;
fhir:transform [ fhir:v "copy" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "current" ]               ] )             ] )           ] [
fhir:name [ fhir:v "listmd" ] ;
            ( fhir:source [
fhir:context [ fhir:v "section" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "list11" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "mode" ] ;
fhir:transform [ fhir:v "copy" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "working" ]               ] )             ] )           ] [
fhir:name [ fhir:v "reference" ] ;
            ( fhir:source [
fhir:context [ fhir:v "section" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "list11" ] ;
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/' + %encounter.id" ]               ] )             ] )           ] [
fhir:name [ fhir:v "org" ] ;
            ( fhir:source [
fhir:context [ fhir:v "organizer" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "list11" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "entry" ] ;
fhir:variable [ fhir:v "entryList2" ]             ] ) ;
            ( fhir:rule [
fhir:name [ fhir:v "family" ] ;
              ( fhir:source [
fhir:context [ 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 "entryList2" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "item" ] ;
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 "whereCond" ] ;
      ( fhir:source [
fhir:context [ fhir:v "section" ] ;
fhir:condition [ fhir:v "section.entry.exists().not()" ]       ] ) ;
      ( fhir:rule [
fhir:name [ fhir:v "allergyAct" ] ;
        ( fhir:source [
fhir:context [ fhir:v "section" ] ;
fhir:condition [ fhir:v "(code.code = '48765-2')" ]         ] ) ;
        ( 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 "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 "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 "dReport" ] ;
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/' + %obs1.id" ]           ] )         ] ) ;
        ( fhir:rule [
fhir:name [ fhir:v "reference" ] ;
          ( fhir:source [
fhir:context [ fhir:v "section" ]           ] ) ;
          ( 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 "reference" ] ;
          ( fhir:source [
fhir:context [ fhir:v "section" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "obs1" ] ;
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/' + %encounter.id" ]             ] )           ] )         ] [
fhir:name [ fhir:v "STatusobse" ] ;
          ( fhir:source [
fhir:context [ fhir:v "section" ]           ] ) ;
          ( 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 "code" ] ;
          ( fhir:source [
fhir:context [ fhir:v "section" ] ;
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 "status" ] ;
          ( fhir:source [
fhir:context [ fhir:v "section" ] ;
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 "obs1" ] ;
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 "allergytext" ] ;
          ( fhir:source [
fhir:context [ fhir:v "section" ] ;
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 "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 "obs1" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "focus" ] ;
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:rule [
fhir:name [ fhir:v "reference" ] ;
            ( fhir:source [
fhir:context [ fhir:v "section" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "allergy" ] ;
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 "reference" ] ;
            ( fhir:source [
fhir:context [ fhir:v "section" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "allergy" ] ;
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/' + %encounter.id" ]               ] )             ] )           ] [
fhir:name [ fhir:v "status" ] ;
            ( fhir:source [
fhir:context [ fhir:v "section" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "allergy" ] ;
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 "section" ]               ] ) ;
              ( 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 "section" ]                 ] ) ;
                ( 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 "section" ]                 ] ) ;
                ( 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 "narrative" ] ;
            ( fhir:source [
fhir:context [ fhir:v "text" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "allergy" ] ;
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:name [ fhir:v "NonConclusion" ] ;
        ( fhir:source [
fhir:context [ fhir:v "section" ] ;
fhir:condition [ fhir:v "(code.code = '55110-1').not() or (code.code = '11329-0').not()" ]         ] ) ;
        ( fhir:rule [
fhir:name [ fhir:v "txtsec" ] ;
          ( fhir:source [
fhir:context [ fhir:v "section" ] ;
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 "obs13" ] ;
fhir:transform [ fhir:v "create" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "Observation" ]             ] )           ] [
fhir:context [ fhir:v "obs13" ] ;
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 "dReport" ] ;
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/' + %obs13.id" ]             ] )           ] ) ;
          ( fhir:rule [
fhir:name [ fhir:v "reference" ] ;
            ( fhir:source [
fhir:context [ fhir:v "section" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "obs13" ] ;
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 "reference" ] ;
            ( fhir:source [
fhir:context [ fhir:v "section" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "obs13" ] ;
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/' + %encounter.id" ]               ] )             ] )           ] [
fhir:name [ fhir:v "obsst" ] ;
            ( fhir:source [
fhir:context [ fhir:v "section" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "obs13" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "status" ] ;
fhir:transform [ fhir:v "copy" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "preliminary" ]               ] )             ] )           ] [
fhir:name [ fhir:v "obscde" ] ;
            ( fhir:source [
fhir:context [ fhir:v "section" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "vvv" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "obs13" ] ;
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 "section" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "obs13" ] ;
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 "obs13" ] ;
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:name [ fhir:v "conclusion" ] ;
        ( fhir:source [
fhir:context [ fhir:v "section" ] ;
fhir:condition [ fhir:v "(code.code = '55110-1')" ]         ] ) ;
        ( fhir:rule [
fhir:name [ fhir:v "conc" ] ;
          ( fhir:source [
fhir:context [ fhir:v "section" ] ;
fhir:element [ fhir:v "text" ] ;
fhir:variable [ fhir:v "t" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "dReport" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "conclusion" ] ;
fhir:variable [ fhir:v "textConclusion" ] ;
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 "textConclusion" ] )           ] )         ] )       ] )     ] )
  ] [
fhir:name [ fhir:v "Observation" ] ;
fhir:typeMode [ fhir:v "none" ] ;
    ( fhir:input [
fhir:name [ fhir:v "cda" ] ;
fhir:type [ fhir:v "observation" ] ;
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 "reference" ] ;
      ( fhir:source [
fhir:context [ fhir:v "cda" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "ob" ] ;
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/' + %encounter.id" ]         ] )       ] )     ] [
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 "value" ] ;
      ( 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: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 "where" ] ;
      ( fhir:source [
fhir:context [ fhir:v "cda" ] ;
fhir:element [ fhir:v "effectiveTime" ] ;
fhir:variable [ fhir:v "effectiveTime" ] ;
fhir:condition [ fhir:v "effectiveTime.low.exists() or effectiveTime.high.exists()" ]       ] ) ;
      ( fhir:rule [
fhir:name [ fhir:v "value3" ] ;
        ( fhir:source [
fhir:context [ fhir:v "cda" ] ;
fhir:element [ fhir:v "effectiveTime" ] ;
fhir:variable [ fhir:v "eff" ]         ] ) ;
        ( fhir:target [
fhir:context [ fhir:v "ob" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "effective" ] ;
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 "effectiveTime" ] [ fhir:v "period" ] )         ] )       ] )     ] [
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 "ImagingStudy" ] ;
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 "section" ] ;
fhir:type [ fhir:v "section" ] ;
fhir:mode [ fhir:v "source" ]     ] [
fhir:name [ fhir:v "tgt" ] ;
fhir:type [ fhir:v "ImagingStudy" ] ;
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 "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 "reference" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ]       ] ) ;
      ( fhir:target [
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/' + %encounter.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 "available" ]         ] )       ] )     ] [
fhir:name [ fhir:v "entryRelationship" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "entryRelationship" ] ;
fhir:variable [ fhir:v "entryRelationship" ]       ] ) ;
      ( fhir:rule [
fhir:name [ fhir:v "series" ] ;
        ( fhir:source [
fhir:context [ fhir:v "entryRelationship" ] ;
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 "series" ] ;
fhir:variable [ fhir:v "series" ]         ] ) ;
        ( fhir:rule [
fhir:name [ fhir:v "id" ] ;
          ( fhir:source [
fhir:context [ fhir:v "act" ] ;
fhir:element [ fhir:v "id" ] ;
fhir:variable [ fhir:v "id" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "series" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "uid" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "id.root" ]             ] )           ] )         ] [
fhir:name [ fhir:v "modality" ] ;
          ( fhir:source [
fhir:context [ fhir:v "section" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "code" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "series" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "modality" ] ;
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 "code" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "code1" ]             ] ) ;
            ( 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 "code1" ]               ] [
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 "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 "code" ] ;
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 "instance" ] ;
          ( fhir:source [
fhir:context [ fhir:v "act" ] ;
fhir:element [ fhir:v "entryRelationship" ] ;
fhir:variable [ fhir:v "entryRelationship2" ]           ] ) ;
          ( fhir:rule [
fhir:name [ fhir:v "idRoot" ] ;
            ( fhir:source [
fhir:context [ fhir:v "entryRelationship2" ] ;
fhir:element [ fhir:v "observation" ] ;
fhir:variable [ fhir:v "obs" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "series" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "instance" ] ;
fhir:variable [ fhir:v "instance" ]             ] ) ;
            ( fhir:rule [
fhir:name [ fhir:v "root" ] ;
              ( fhir:source [
fhir:context [ fhir:v "obs" ] ;
fhir:element [ fhir:v "id" ] ;
fhir:variable [ fhir:v "id" ]               ] ) ;
              ( fhir:target [
fhir:context [ fhir:v "instance" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "uid" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
                ( fhir:parameter [
fhir:value [ fhir:v "id.root" ]                 ] )               ] )             ] [
fhir:name [ fhir:v "sopClass" ] ;
              ( fhir:source [
fhir:context [ fhir:v "obs" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "code1" ]               ] ) ;
              ( fhir:target [
fhir:context [ fhir:v "instance" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "sopClass" ] ;
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 "code1" ] ;
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 "code1" ] ;
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 "code1" ] ;
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 "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 "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 "category" ] ;
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 "reference" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ]       ] ) ;
      ( fhir:target [
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/' + %encounter.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: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 "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 "period" ] ;
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 "period" ] )         ] )       ] )     ] [
fhir:name [ fhir:v "value2" ] ;
      ( 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 "dateTime" ] ;
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 "dateTime" ] )       ] )     ] [
fhir:name [ fhir:v "value" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ] ;
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: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 "observation" ] ;
          ( fhir:source [
fhir:context [ fhir:v "obsentry" ] ;
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 "obsentry" ]             ] ) ;
            ( 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 "obsentry" ] [ fhir:v "patient" ] [ fhir:v "encounter" ] [ fhir:v "obsy" ] [ fhir:v "bundle" ] )             ] )           ] )         ] [
fhir:name [ fhir:v "clinicalStatus2" ] ;
          ( fhir:source [
fhir:context [ fhir:v "obsentry" ] ;
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 "obsentry" ] ;
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 "obsentry" ] ;
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 "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 "reference" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ]       ] ) ;
      ( fhir:target [
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/' + %encounter.id" ]         ] )       ] )     ] [
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 "where" ] ;
          ( fhir:source [
fhir:context [ fhir:v "observation1" ] ;
fhir:condition [ fhir:v "effectiveTime.low.exists() or effectiveTime.high.exists()" ]           ] ) ;
          ( fhir:rule [
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 "period" ] ;
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 "period" ] )             ] )           ] )         ] [
fhir:name [ fhir:v "value2" ] ;
          ( 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 "dateTime" ] ;
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 "dateTime" ] )           ] )         ] [
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 "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 "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 "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 "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:documentation [ fhir:v "criticality" ]             ] )           ] [
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: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 "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:documentation [ fhir:v "observation4.value -> tgt.clinicalStatus;" ]             ] )           ] )         ] )       ] )     ] )
  ] [
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 "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 "dateTime" ]         ] )       ] ) ;
      ( fhir:dependent [
fhir:name [ fhir:v "TSDateTime" ] ;
        ( 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:element [ fhir:v "system" ]               ] ) ;
              ( 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 "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 "cont" ] ;
          ( fhir:source [
fhir:context [ fhir:v "observation" ] ;
fhir:condition [ fhir:v "observation.effectiveTime.exists()" ]           ] ) ;
          ( fhir:rule [
fhir:name [ fhir:v "effttemp" ] ;
            ( fhir:source [
fhir:context [ fhir:v "observation" ] ;
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 "condition" ] ;
fhir:variable [ fhir:v "condition" ] ;
fhir:transform [ fhir:v "create" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "BackboneElement" ]               ] )             ] ) ;
            ( 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 "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:name [ fhir:v "efft" ] ;
              ( fhir:source [
fhir:context [ fhir:v "effectiveTime" ]               ] ) ;
              ( fhir:target [
fhir:context [ fhir:v "condition" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "onset" ] ;
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 "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: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" ]                     ] )                   ] )                 ] )               ] )             ] )           ] )         ] )       ] )     ] )
  ] ) . #