CDA to FHIR Maps
0.1.0 - ci-build

CDA to FHIR Maps, published by HL7 Italy. This guide is not an authorized publication; it is the continuous build for version 0.1.0 built by the FHIR (HL7® FHIR® Standard) CI Build. This version is based on the current content of https://github.com/hl7-it/cda2fhir/ and changes regularly. See the Directory of published versions

## : CDA to FHIR - RAD - JSON Representation

Draft as of 2025-10-01

Raw json | Download

    {
      "resourceType" : "StructureMap",
      "id" : "cda2fhirRadReport",
      "text" : {
        "status" : "generated",
        "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>"
      },
      "url" : "http://hl7.it/fhir/cda2fhir/StructureMap/cda2fhirRadReport",
      "version" : "0.1.0",
      "name" : "cda2fhirRadReport",
      "status" : "draft",
      "date" : "2025-10-01T07:14:02+00:00",
      "publisher" : "HL7 Italy",
      "contact" : [
        {
          "name" : "HL7 Italy",
          "telecom" : [
            {
              "system" : "url",
              "value" : "http://hl7.it"
            }
          ]
        }
      ],
      "jurisdiction" : [
        {
          "coding" : [
            {
              "system" : "urn:iso:std:iso:3166",
              "code" : "IT",
              "display" : "Italy"
            }
          ]
        }
      ],
      "structure" : [
        {
          "url" : "http://hl7.org/fhir/cda/StructureDefinition/ClinicalDocument",
          "mode" : "source",
          "alias" : "ClinicalDocument"
        },
        {
          "url" : "http://hl7.org/fhir/cda/StructureDefinition/AssignedAuthor",
          "mode" : "queried",
          "alias" : "AssignedAuthor"
        },
        {
          "url" : "http://hl7.org/fhir/cda/StructureDefinition/AssignedEntity",
          "mode" : "queried",
          "alias" : "AssignedEntity"
        },
        {
          "url" : "http://hl7.org/fhir/cda/StructureDefinition/AssociatedEntity",
          "mode" : "queried",
          "alias" : "AssociatedEntity"
        },
        {
          "url" : "http://hl7.org/fhir/cda/StructureDefinition/CustodianOrganization",
          "mode" : "queried",
          "alias" : "CustodianOrganization"
        },
        {
          "url" : "http://hl7.org/fhir/cda/StructureDefinition/OrganizationPartOf",
          "mode" : "queried",
          "alias" : "OrganizationPartOf"
        },
        {
          "url" : "http://hl7.org/fhir/cda/StructureDefinition/Organization",
          "mode" : "queried",
          "alias" : "rapresentedOrganization"
        },
        {
          "url" : "http://hl7.org/fhir/cda/StructureDefinition/Section",
          "mode" : "queried",
          "alias" : "Section"
        },
        {
          "url" : "http://hl7.org/fhir/cda/StructureDefinition/PatientRole",
          "mode" : "queried",
          "alias" : "PatientRole"
        },
        {
          "url" : "http://hl7.org/fhir/cda/StructureDefinition/AD",
          "mode" : "source",
          "alias" : "AD"
        },
        {
          "url" : "http://hl7.org/fhir/StructureDefinition/Bundle",
          "mode" : "target",
          "alias" : "Bundle"
        },
        {
          "url" : "http://hl7.org/fhir/StructureDefinition/Composition",
          "mode" : "produced",
          "alias" : "Composition"
        },
        {
          "url" : "http://hl7.org/fhir/StructureDefinition/Patient",
          "mode" : "produced",
          "alias" : "Patient"
        },
        {
          "url" : "http://hl7.org/fhir/StructureDefinition/Encounter",
          "mode" : "produced",
          "alias" : "Encounter"
        },
        {
          "url" : "http://hl7.org/fhir/StructureDefinition/Person",
          "mode" : "produced",
          "alias" : "Patient"
        },
        {
          "url" : "http://hl7.org/fhir/StructureDefinition/List",
          "mode" : "produced",
          "alias" : "List"
        },
        {
          "url" : "http://hl7.org/fhir/StructureDefinition/Practitioner",
          "mode" : "produced",
          "alias" : "Practitioner"
        },
        {
          "url" : "http://hl7.org/fhir/StructureDefinition/Organization",
          "mode" : "produced",
          "alias" : "Organization"
        },
        {
          "url" : "http://hl7.org/fhir/cda/StructureDefinition/Act",
          "mode" : "produced",
          "alias" : "Act"
        },
        {
          "url" : "http://hl7.org/fhir/cda/StructureDefinition/IVL-PQ",
          "mode" : "source",
          "alias" : "IVL_PQ"
        },
        {
          "url" : "http://hl7.org/fhir/cda/StructureDefinition/PQ",
          "mode" : "source",
          "alias" : "PQ"
        },
        {
          "url" : "http://hl7.org/fhir/StructureDefinition/SimpleQuantity",
          "mode" : "target",
          "alias" : "SimpleQuantity"
        }
      ],
      "import" : [
        🔗 "http://hl7.it/fhir/cda2fhir/StructureMap/cda2fhirDataTypes"🔗 ,
        "http://hl7.it/fhir/cda2fhir/StructureMap/cda2fhirHeader"
      ],
      "group" : [
        {
          "name" : "CdaToBundle",
          "typeMode" : "none",
          "input" : [
            {
              "name" : "cda",
              "type" : "ClinicalDocument",
              "mode" : "source"
            },
            {
              "name" : "bundle",
              "type" : "Bundle",
              "mode" : "target"
            }
          ],
          "rule" : [
            {
              "name" : "ClinicalDocumentToBody",
              "source" : [
                {
                  "context" : "cda"
                }
              ],
              "target" : [
                {
                  "context" : "bundle",
                  "contextType" : "variable",
                  "element" : "entry",
                  "variable" : "e"
                },
                {
                  "context" : "e",
                  "contextType" : "variable",
                  "element" : "request",
                  "variable" : "request",
                  "transform" : "create",
                  "parameter" : [
                    {
                      "valueString" : "BackboneElement"
                    }
                  ]
                },
                {
                  "context" : "request",
                  "contextType" : "variable",
                  "element" : "method",
                  "transform" : "copy",
                  "parameter" : [
                    {
                      "valueString" : "POST"
                    }
                  ]
                },
                {
                  "context" : "e",
                  "contextType" : "variable",
                  "element" : "resource",
                  "variable" : "composition",
                  "transform" : "create",
                  "parameter" : [
                    {
                      "valueString" : "Composition"
                    }
                  ]
                },
                {
                  "context" : "composition",
                  "contextType" : "variable",
                  "element" : "id",
                  "variable" : "uuid1",
                  "transform" : "uuid"
                },
                {
                  "context" : "e",
                  "contextType" : "variable",
                  "element" : "fullUrl",
                  "transform" : "append",
                  "parameter" : [
                    {
                      "valueString" : "https://example/Composition/"
                    },
                    {
                      "valueId" : "uuid1"
                    }
                  ]
                },
                {
                  "context" : "request",
                  "contextType" : "variable",
                  "element" : "url",
                  "transform" : "copy",
                  "parameter" : [
                    {
                      "valueString" : "Composition"
                    }
                  ]
                },
                {
                  "context" : "bundle",
                  "contextType" : "variable",
                  "element" : "entry",
                  "variable" : "e2"
                },
                {
                  "context" : "e2",
                  "contextType" : "variable",
                  "element" : "request",
                  "variable" : "requestPAT",
                  "transform" : "create",
                  "parameter" : [
                    {
                      "valueString" : "BackboneElement"
                    }
                  ]
                },
                {
                  "context" : "requestPAT",
                  "contextType" : "variable",
                  "element" : "method",
                  "transform" : "copy",
                  "parameter" : [
                    {
                      "valueString" : "PUT"
                    }
                  ]
                },
                {
                  "context" : "e2",
                  "contextType" : "variable",
                  "element" : "resource",
                  "variable" : "patient",
                  "transform" : "create",
                  "parameter" : [
                    {
                      "valueString" : "Patient"
                    }
                  ]
                },
                {
                  "context" : "patient",
                  "contextType" : "variable",
                  "element" : "id",
                  "variable" : "uuid2",
                  "transform" : "uuid"
                },
                {
                  "context" : "e2",
                  "contextType" : "variable",
                  "element" : "fullUrl",
                  "transform" : "append",
                  "parameter" : [
                    {
                      "valueString" : "https://example/Patient/"
                    },
                    {
                      "valueId" : "uuid2"
                    }
                  ]
                },
                {
                  "context" : "bundle",
                  "contextType" : "variable",
                  "element" : "entry",
                  "variable" : "e3"
                },
                {
                  "context" : "e3",
                  "contextType" : "variable",
                  "element" : "request",
                  "variable" : "request",
                  "transform" : "create",
                  "parameter" : [
                    {
                      "valueString" : "BackboneElement"
                    }
                  ]
                },
                {
                  "context" : "request",
                  "contextType" : "variable",
                  "element" : "method",
                  "transform" : "copy",
                  "parameter" : [
                    {
                      "valueString" : "POST"
                    }
                  ]
                },
                {
                  "context" : "e3",
                  "contextType" : "variable",
                  "element" : "resource",
                  "variable" : "encounter",
                  "transform" : "create",
                  "parameter" : [
                    {
                      "valueString" : "Encounter"
                    }
                  ]
                },
                {
                  "context" : "encounter",
                  "contextType" : "variable",
                  "element" : "id",
                  "variable" : "uuid3",
                  "transform" : "uuid"
                },
                {
                  "context" : "e3",
                  "contextType" : "variable",
                  "element" : "fullUrl",
                  "transform" : "append",
                  "parameter" : [
                    {
                      "valueString" : "https://example/Encounter/"
                    },
                    {
                      "valueId" : "uuid3"
                    }
                  ]
                },
                {
                  "context" : "request",
                  "contextType" : "variable",
                  "element" : "url",
                  "transform" : "copy",
                  "parameter" : [
                    {
                      "valueString" : "Encounter"
                    }
                  ]
                },
                {
                  "context" : "bundle",
                  "contextType" : "variable",
                  "element" : "entry",
                  "variable" : "e4"
                },
                {
                  "context" : "e4",
                  "contextType" : "variable",
                  "element" : "request",
                  "variable" : "request",
                  "transform" : "create",
                  "parameter" : [
                    {
                      "valueString" : "BackboneElement"
                    }
                  ]
                },
                {
                  "context" : "request",
                  "contextType" : "variable",
                  "element" : "method",
                  "transform" : "copy",
                  "parameter" : [
                    {
                      "valueString" : "POST"
                    }
                  ]
                },
                {
                  "context" : "e4",
                  "contextType" : "variable",
                  "element" : "resource",
                  "variable" : "DocumentReference",
                  "transform" : "create",
                  "parameter" : [
                    {
                      "valueString" : "DocumentReference"
                    }
                  ]
                },
                {
                  "context" : "DocumentReference",
                  "contextType" : "variable",
                  "element" : "id",
                  "variable" : "uuid4",
                  "transform" : "uuid"
                },
                {
                  "context" : "e4",
                  "contextType" : "variable",
                  "element" : "fullUrl",
                  "transform" : "append",
                  "parameter" : [
                    {
                      "valueString" : "https://example/DocumentReference/"
                    },
                    {
                      "valueId" : "uuid4"
                    }
                  ]
                },
                {
                  "context" : "request",
                  "contextType" : "variable",
                  "element" : "url",
                  "transform" : "copy",
                  "parameter" : [
                    {
                      "valueString" : "DocumentReference"
                    }
                  ]
                }
              ],
              "rule" : [
                {
                  "name" : "cdatobundle",
                  "source" : [
                    {
                      "context" : "cda"
                    }
                  ],
                  "dependent" : [
                    {
                      "name" : "ClinicalDocumentToBundle",
                      "variable" : [
                        "cda",
                        "patient",
                        "composition",
                        "encounter",
                        "bundle",
                        "DocumentReference"
                      ]
                    }
                  ]
                },
                {
                  "name" : "patient",
                  "source" : [
                    {
                      "context" : "cda",
                      "element" : "recordTarget",
                      "variable" : "recordTarget"
                    }
                  ],
                  "rule" : [
                    {
                      "name" : "recPat",
                      "source" : [
                        {
                          "context" : "recordTarget",
                          "element" : "patientRole",
                          "variable" : "patient"
                        }
                      ],
                      "rule" : [
                        {
                          "name" : "idfr",
                          "source" : [
                            {
                              "context" : "patient",
                              "element" : "id",
                              "variable" : "id"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "patient",
                              "contextType" : "variable",
                              "element" : "identifier",
                              "variable" : "identifier"
                            }
                          ],
                          "rule" : [
                            {
                              "name" : "root1",
                              "source" : [
                                {
                                  "context" : "id",
                                  "element" : "root",
                                  "variable" : "r"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "identifier",
                                  "contextType" : "variable",
                                  "element" : "system",
                                  "transform" : "translate",
                                  "parameter" : [
                                    {
                                      "valueId" : "r"
                                    },
                                    {
                                      "valueString" : "http://hl7.org/fhir/ConceptMap/special-oid2uri"
                                    },
                                    {
                                      "valueString" : "uri"
                                    }
                                  ]
                                }
                              ]
                            },
                            {
                              "name" : "value",
                              "source" : [
                                {
                                  "context" : "id",
                                  "element" : "extension",
                                  "variable" : "ext1"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "identifier",
                                  "contextType" : "variable",
                                  "element" : "value",
                                  "transform" : "copy",
                                  "parameter" : [
                                    {
                                      "valueId" : "ext1"
                                    }
                                  ]
                                }
                              ]
                            },
                            {
                              "name" : "assigningAuthorityName",
                              "source" : [
                                {
                                  "context" : "id",
                                  "element" : "assigningAuthorityName",
                                  "variable" : "s"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "identifier",
                                  "contextType" : "variable",
                                  "element" : "assigner",
                                  "variable" : "a"
                                },
                                {
                                  "context" : "a",
                                  "contextType" : "variable",
                                  "element" : "display",
                                  "transform" : "copy",
                                  "parameter" : [
                                    {
                                      "valueId" : "s"
                                    }
                                  ]
                                }
                              ]
                            }
                          ]
                        },
                        {
                          "name" : "ext",
                          "source" : [
                            {
                              "context" : "patient",
                              "element" : "id",
                              "variable" : "id",
                              "condition" : "(root = '2.16.840.1.113883.2.9.4.3.2') or (root = '2.16.840.1.113883.2.9.4.3.7') or (root = '2.16.840.1.113883.2.9.4.3.3') or (root = '2.16.840.1.113883.2.9.4.3.17') or (root = '2.16.840.1.113883.2.9.4.3.18') or (root = '2.16.840.1.113883.2.9.2.10.4.1.1') or (root = '2.16.840.1.113883.2.9.2.20.4.1.1') or (root = '2.16.840.1.113883.2.9.2.30.4.1.1') or (root = '2.16.840.1.113883.2.9.2.41.4.1.1') or (root = '2.16.840.1.113883.2.9.2.42.4.1.1') or (root = '2.16.840.1.113883.2.9.2.50.4.1.1') or (root = '2.16.840.1.113883.2.9.2.60.4.1.1') or (root = '2.16.840.1.113883.2.9.2.70.4.1.1') or (root = '2.16.840.1.113883.2.9.2.80.4.1.1') or (root = '2.16.840.1.113883.2.9.2.90.4.1.1') or (root = '2.16.840.1.113883.2.9.2.100.4.1.1') or (root = '2.16.840.1.113883.2.9.2.110.4.1.1') or (root = '2.16.840.1.113883.2.9.2.120.4.1.1') or (root = '2.16.840.1.113883.2.9.2.130.4.1.1') or (root = '2.16.840.1.113883.2.9.2.140.4.1.1') or (root = '2.16.840.1.113883.2.9.2.150.4.1.1') or (root = '2.16.840.1.113883.2.9.2.160.4.1.1') or (root = '2.16.840.1.113883.2.9.2.170.4.1.1') or (root = '2.16.840.1.113883.2.9.2.180.4.1.1') or (root = '2.16.840.1.113883.2.9.2.190.4.1.1') or (root = '2.16.840.1.113883.2.9.2.200.4.1.1') or (root = '2.16.840.1.113883.2.9.2.10.4.1') or (root = '2.16.840.1.113883.2.9.2.20.4.1') or (root = '2.16.840.1.113883.2.9.2.30.4.1') or (root = '2.16.840.1.113883.2.9.2.41.4.1') or (root = '2.16.840.1.113883.2.9.2.42.4.1') or (root = '2.16.840.1.113883.2.9.2.50.4.1') or (root = '2.16.840.1.113883.2.9.2.60.4.1') or (root = '2.16.840.1.113883.2.9.2.70.4.1') or (root = '2.16.840.1.113883.2.9.2.80.4.1') or (root = '2.16.840.1.113883.2.9.2.90.4.1') or (root = '2.16.840.1.113883.2.9.2.100.4.1') or (root = '2.16.840.1.113883.2.9.2.110.4.1') or (root = '2.16.840.1.113883.2.9.2.120.4.1') or (root = '2.16.840.1.113883.2.9.2.130.4.1') or (root = '2.16.840.1.113883.2.9.2.140.4.1') or (root = '2.16.840.1.113883.2.9.2.150.4.1') or (root = '2.16.840.1.113883.2.9.2.160.4.1') or (root = '2.16.840.1.113883.2.9.2.170.4.1') or (root = '2.16.840.1.113883.2.9.2.180.4.1') or (root = '2.16.840.1.113883.2.9.2.190.4.1') or (root = '2.16.840.1.113883.2.9.2.200.4.1') or (root = '2.16.840.1.113883.2.9.4.3.15')"
                            }
                          ],
                          "rule" : [
                            {
                              "name" : "UUID",
                              "source" : [
                                {
                                  "context" : "id",
                                  "element" : "extension",
                                  "variable" : "ext"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "requestPAT",
                                  "contextType" : "variable",
                                  "element" : "url",
                                  "transform" : "append",
                                  "parameter" : [
                                    {
                                      "valueString" : "Patient?identifier="
                                    },
                                    {
                                      "valueId" : "ext"
                                    }
                                  ]
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ]
        },
        {
          "name" : "ClinicalDocumentToBundle",
          "typeMode" : "none",
          "input" : [
            {
              "name" : "cda",
              "type" : "ClinicalDocument",
              "mode" : "source"
            },
            {
              "name" : "patient",
              "type" : "Patient",
              "mode" : "target"
            },
            {
              "name" : "composition",
              "type" : "Composition",
              "mode" : "target"
            },
            {
              "name" : "encounter",
              "type" : "Encounter",
              "mode" : "target"
            },
            {
              "name" : "bundle",
              "type" : "Bundle",
              "mode" : "target"
            },
            {
              "name" : "DocumentReference",
              "type" : "DocumentReference",
              "mode" : "target"
            }
          ],
          "rule" : [
            {
              "name" : "id",
              "source" : [
                {
                  "context" : "cda"
                }
              ],
              "target" : [
                {
                  "context" : "bundle",
                  "contextType" : "variable",
                  "element" : "id",
                  "transform" : "uuid"
                }
              ]
            },
            {
              "name" : "identifier",
              "source" : [
                {
                  "context" : "cda",
                  "element" : "id",
                  "variable" : "vvv"
                }
              ],
              "target" : [
                {
                  "context" : "bundle",
                  "contextType" : "variable",
                  "element" : "identifier",
                  "variable" : "vvv",
                  "transform" : "create"
                }
              ]
            },
            {
              "name" : "type",
              "source" : [
                {
                  "context" : "cda"
                }
              ],
              "target" : [
                {
                  "context" : "bundle",
                  "contextType" : "variable",
                  "element" : "type",
                  "transform" : "copy",
                  "parameter" : [
                    {
                      "valueString" : "transaction"
                    }
                  ]
                }
              ]
            },
            {
              "name" : "date",
              "source" : [
                {
                  "context" : "cda"
                }
              ],
              "target" : [
                {
                  "context" : "bundle",
                  "contextType" : "variable",
                  "element" : "timestamp",
                  "transform" : "evaluate",
                  "parameter" : [
                    {
                      "valueString" : "timestamp.now()"
                    }
                  ]
                }
              ]
            },
            {
              "name" : "composition",
              "source" : [
                {
                  "context" : "cda"
                }
              ],
              "dependent" : [
                {
                  "name" : "ClinicalDocumentComposition",
                  "variable" : [
                    "cda",
                    "composition",
                    "patient",
                    "encounter",
                    "bundle",
                    "DocumentReference"
                  ]
                }
              ]
            },
            {
              "name" : "diagnostic",
              "source" : [
                {
                  "context" : "cda"
                }
              ],
              "target" : [
                {
                  "context" : "bundle",
                  "contextType" : "variable",
                  "element" : "entry",
                  "variable" : "e"
                },
                {
                  "context" : "e",
                  "contextType" : "variable",
                  "element" : "request",
                  "variable" : "request",
                  "transform" : "create",
                  "parameter" : [
                    {
                      "valueString" : "BackboneElement"
                    }
                  ]
                },
                {
                  "context" : "request",
                  "contextType" : "variable",
                  "element" : "method",
                  "transform" : "copy",
                  "parameter" : [
                    {
                      "valueString" : "POST"
                    }
                  ]
                },
                {
                  "context" : "e",
                  "contextType" : "variable",
                  "element" : "resource",
                  "variable" : "diagnosticReport",
                  "transform" : "create",
                  "parameter" : [
                    {
                      "valueString" : "DiagnosticReport"
                    }
                  ]
                },
                {
                  "context" : "diagnosticReport",
                  "contextType" : "variable",
                  "element" : "id",
                  "variable" : "uuid1",
                  "transform" : "uuid"
                },
                {
                  "context" : "e",
                  "contextType" : "variable",
                  "element" : "fullUrl",
                  "transform" : "append",
                  "parameter" : [
                    {
                      "valueString" : "https://example/DiagnosticReport/"
                    },
                    {
                      "valueId" : "uuid1"
                    }
                  ]
                },
                {
                  "context" : "request",
                  "contextType" : "variable",
                  "element" : "url",
                  "transform" : "copy",
                  "parameter" : [
                    {
                      "valueString" : "DiagnosticReport"
                    }
                  ]
                }
              ],
              "rule" : [
                {
                  "name" : "diagnosticCode",
                  "source" : [
                    {
                      "context" : "cda",
                      "element" : "code",
                      "variable" : "vvv"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "diagnosticReport",
                      "contextType" : "variable",
                      "element" : "code",
                      "variable" : "vvv",
                      "transform" : "create"
                    }
                  ]
                },
                {
                  "name" : "stats",
                  "source" : [
                    {
                      "context" : "cda"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "diagnosticReport",
                      "contextType" : "variable",
                      "element" : "status",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "registered"
                        }
                      ]
                    }
                  ]
                },
                {
                  "name" : "component",
                  "source" : [
                    {
                      "context" : "cda",
                      "element" : "component",
                      "variable" : "component"
                    }
                  ],
                  "rule" : [
                    {
                      "name" : "body",
                      "source" : [
                        {
                          "context" : "component",
                          "element" : "structuredBody",
                          "variable" : "body"
                        }
                      ],
                      "rule" : [
                        {
                          "name" : "component",
                          "source" : [
                            {
                              "context" : "body",
                              "element" : "component",
                              "variable" : "component"
                            }
                          ],
                          "rule" : [
                            {
                              "name" : "section",
                              "source" : [
                                {
                                  "context" : "component",
                                  "element" : "section",
                                  "variable" : "srcSection"
                                }
                              ],
                              "rule" : [
                                {
                                  "name" : "code",
                                  "source" : [
                                    {
                                      "context" : "srcSection",
                                      "element" : "code"
                                    }
                                  ],
                                  "target" : [
                                    {
                                      "context" : "composition",
                                      "contextType" : "variable",
                                      "element" : "section",
                                      "variable" : "tgtSection"
                                    }
                                  ],
                                  "dependent" : [
                                    {
                                      "name" : "ClinicalDocumentSection",
                                      "variable" : [
                                        "cda",
                                        "srcSection",
                                        "patient",
                                        "tgtSection",
                                        "bundle",
                                        "encounter",
                                        "diagnosticReport"
                                      ]
                                    }
                                  ]
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ]
        },
        {
          "name" : "ClinicalDocumentSection",
          "typeMode" : "none",
          "input" : [
            {
              "name" : "cda",
              "type" : "ClinicalDocument",
              "mode" : "source"
            },
            {
              "name" : "src",
              "type" : "Section",
              "mode" : "source"
            },
            {
              "name" : "patient",
              "type" : "Patient",
              "mode" : "target"
            },
            {
              "name" : "tgt",
              "mode" : "target"
            },
            {
              "name" : "bundle",
              "type" : "Bundle",
              "mode" : "target"
            },
            {
              "name" : "enc",
              "type" : "Encounter",
              "mode" : "target"
            },
            {
              "name" : "dReport",
              "type" : "DiagnosticReport",
              "mode" : "target"
            }
          ],
          "rule" : [
            {
              "name" : "title",
              "source" : [
                {
                  "context" : "src",
                  "element" : "title",
                  "variable" : "t"
                }
              ],
              "target" : [
                {
                  "context" : "tgt",
                  "contextType" : "variable",
                  "element" : "title",
                  "transform" : "evaluate",
                  "parameter" : [
                    {
                      "valueString" : "t.dataString"
                    }
                  ]
                }
              ]
            },
            {
              "name" : "code",
              "source" : [
                {
                  "context" : "src",
                  "element" : "code",
                  "variable" : "vvv"
                }
              ],
              "target" : [
                {
                  "context" : "tgt",
                  "contextType" : "variable",
                  "element" : "code",
                  "variable" : "vvv",
                  "transform" : "create"
                }
              ]
            },
            {
              "name" : "reference",
              "source" : [
                {
                  "context" : "src"
                }
              ],
              "target" : [
                {
                  "context" : "tgt",
                  "contextType" : "variable",
                  "element" : "entry",
                  "variable" : "reference",
                  "transform" : "create",
                  "parameter" : [
                    {
                      "valueString" : "Reference"
                    }
                  ]
                },
                {
                  "context" : "reference",
                  "contextType" : "variable",
                  "element" : "reference",
                  "transform" : "evaluate",
                  "parameter" : [
                    {
                      "valueString" : "'https://example/DiagnosticReport/' + %dReport.id"
                    }
                  ]
                }
              ]
            },
            {
              "name" : "entry",
              "source" : [
                {
                  "context" : "src",
                  "element" : "entry",
                  "variable" : "entry"
                }
              ],
              "rule" : [
                {
                  "name" : "cdaText",
                  "source" : [
                    {
                      "context" : "src",
                      "element" : "text",
                      "variable" : "cdaText"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "tgt",
                      "contextType" : "variable",
                      "element" : "text",
                      "variable" : "fhirText"
                    }
                  ],
                  "rule" : [
                    {
                      "name" : "narrativeStatus",
                      "source" : [
                        {
                          "context" : "cdaText"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "fhirText",
                          "contextType" : "variable",
                          "element" : "status",
                          "transform" : "copy",
                          "parameter" : [
                            {
                              "valueString" : "generated"
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "name" : "narrativeText",
                      "source" : [
                        {
                          "context" : "cdaText",
                          "variable" : "t"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "fhirText",
                          "contextType" : "variable",
                          "element" : "div",
                          "transform" : "copy",
                          "parameter" : [
                            {
                              "valueId" : "t"
                            }
                          ]
                        }
                      ]
                    }
                  ]
                },
                {
                  "name" : "dreport",
                  "source" : [
                    {
                      "context" : "entry"
                    }
                  ],
                  "dependent" : [
                    {
                      "name" : "DiagnosticReportFunction",
                      "variable" : [
                        "src",
                        "entry",
                        "dReport",
                        "bundle",
                        "enc",
                        "patient"
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "name" : "narrative",
              "source" : [
                {
                  "context" : "src",
                  "condition" : "src.entry.exists().not()"
                }
              ],
              "dependent" : [
                {
                  "name" : "DiagnosticReportFunction",
                  "variable" : [
                    "src",
                    "cda",
                    "dReport",
                    "bundle",
                    "enc",
                    "patient"
                  ]
                }
              ]
            },
            {
              "name" : "component",
              "source" : [
                {
                  "context" : "src",
                  "element" : "component",
                  "variable" : "component"
                }
              ],
              "rule" : [
                {
                  "name" : "section",
                  "source" : [
                    {
                      "context" : "component",
                      "element" : "section",
                      "variable" : "sec"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "tgt",
                      "contextType" : "variable",
                      "element" : "section",
                      "variable" : "tgtSection"
                    }
                  ],
                  "dependent" : [
                    {
                      "name" : "ClinicalDocumentSection",
                      "variable" : [
                        "cda",
                        "sec",
                        "patient",
                        "tgtSection",
                        "bundle",
                        "enc",
                        "dReport"
                      ]
                    }
                  ]
                }
              ]
            }
          ]
        },
        {
          "name" : "DiagnosticReportFunction",
          "typeMode" : "none",
          "input" : [
            {
              "name" : "section",
              "type" : "section",
              "mode" : "source"
            },
            {
              "name" : "src",
              "type" : "entry",
              "mode" : "source"
            },
            {
              "name" : "dReport",
              "type" : "DiagnosticReport",
              "mode" : "target"
            },
            {
              "name" : "bundle",
              "type" : "Bundle",
              "mode" : "target"
            },
            {
              "name" : "encounter",
              "type" : "Encounter",
              "mode" : "target"
            },
            {
              "name" : "patient",
              "type" : "Patient",
              "mode" : "target"
            }
          ],
          "rule" : [
            {
              "name" : "act",
              "source" : [
                {
                  "context" : "src",
                  "element" : "act",
                  "variable" : "act1"
                }
              ],
              "rule" : [
                {
                  "name" : "imagingStudy",
                  "source" : [
                    {
                      "context" : "section",
                      "condition" : "(code.code = '121181')"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "bundle",
                      "contextType" : "variable",
                      "element" : "entry",
                      "variable" : "e1"
                    },
                    {
                      "context" : "e1",
                      "contextType" : "variable",
                      "element" : "request",
                      "variable" : "request",
                      "transform" : "create",
                      "parameter" : [
                        {
                          "valueString" : "BackboneElement"
                        }
                      ]
                    },
                    {
                      "context" : "request",
                      "contextType" : "variable",
                      "element" : "method",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "POST"
                        }
                      ]
                    },
                    {
                      "context" : "e1",
                      "contextType" : "variable",
                      "element" : "resource",
                      "variable" : "imageS",
                      "transform" : "create",
                      "parameter" : [
                        {
                          "valueString" : "ImagingStudy"
                        }
                      ]
                    },
                    {
                      "context" : "imageS",
                      "contextType" : "variable",
                      "element" : "id",
                      "variable" : "uuid1",
                      "transform" : "uuid"
                    },
                    {
                      "context" : "e1",
                      "contextType" : "variable",
                      "element" : "fullUrl",
                      "transform" : "append",
                      "parameter" : [
                        {
                          "valueString" : "https://example/ImagingStudy/"
                        },
                        {
                          "valueId" : "uuid1"
                        }
                      ]
                    },
                    {
                      "context" : "request",
                      "contextType" : "variable",
                      "element" : "url",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "ImagingStudy"
                        }
                      ]
                    },
                    {
                      "context" : "dReport",
                      "contextType" : "variable",
                      "element" : "imagingStudy",
                      "variable" : "reference",
                      "transform" : "create",
                      "parameter" : [
                        {
                          "valueString" : "Reference"
                        }
                      ]
                    },
                    {
                      "context" : "reference",
                      "contextType" : "variable",
                      "element" : "reference",
                      "transform" : "evaluate",
                      "parameter" : [
                        {
                          "valueString" : "'https://example/ImagingStudy/' + %imageS.id"
                        }
                      ]
                    }
                  ],
                  "dependent" : [
                    {
                      "name" : "ImagingStudy",
                      "variable" : [
                        "act1",
                        "section",
                        "imageS",
                        "patient",
                        "encounter"
                      ]
                    }
                  ]
                },
                {
                  "name" : "allergyAct",
                  "source" : [
                    {
                      "context" : "section",
                      "condition" : "(code.code = '48765-2')"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "bundle",
                      "contextType" : "variable",
                      "element" : "entry",
                      "variable" : "e2"
                    },
                    {
                      "context" : "e2",
                      "contextType" : "variable",
                      "element" : "request",
                      "variable" : "request",
                      "transform" : "create",
                      "parameter" : [
                        {
                          "valueString" : "BackboneElement"
                        }
                      ]
                    },
                    {
                      "context" : "request",
                      "contextType" : "variable",
                      "element" : "method",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "POST"
                        }
                      ]
                    },
                    {
                      "context" : "e2",
                      "contextType" : "variable",
                      "element" : "resource",
                      "variable" : "obs1",
                      "transform" : "create",
                      "parameter" : [
                        {
                          "valueString" : "Observation"
                        }
                      ]
                    },
                    {
                      "context" : "obs1",
                      "contextType" : "variable",
                      "element" : "id",
                      "variable" : "uuid2",
                      "transform" : "uuid"
                    },
                    {
                      "context" : "e2",
                      "contextType" : "variable",
                      "element" : "fullUrl",
                      "transform" : "append",
                      "parameter" : [
                        {
                          "valueString" : "https://example/Observation/"
                        },
                        {
                          "valueId" : "uuid2"
                        }
                      ]
                    },
                    {
                      "context" : "request",
                      "contextType" : "variable",
                      "element" : "url",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "Observation"
                        }
                      ]
                    },
                    {
                      "context" : "dReport",
                      "contextType" : "variable",
                      "element" : "result",
                      "variable" : "reference",
                      "transform" : "create",
                      "parameter" : [
                        {
                          "valueString" : "Reference"
                        }
                      ]
                    },
                    {
                      "context" : "reference",
                      "contextType" : "variable",
                      "element" : "reference",
                      "transform" : "evaluate",
                      "parameter" : [
                        {
                          "valueString" : "'https://example/Observation/' + %obs1.id"
                        }
                      ]
                    }
                  ],
                  "rule" : [
                    {
                      "name" : "reference",
                      "source" : [
                        {
                          "context" : "section"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "obs1",
                          "contextType" : "variable",
                          "element" : "subject",
                          "variable" : "reference",
                          "transform" : "create",
                          "parameter" : [
                            {
                              "valueString" : "Reference"
                            }
                          ]
                        },
                        {
                          "context" : "reference",
                          "contextType" : "variable",
                          "element" : "reference",
                          "transform" : "evaluate",
                          "parameter" : [
                            {
                              "valueString" : "'https://example/Patient/' + %patient.id"
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "name" : "reference",
                      "source" : [
                        {
                          "context" : "section"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "obs1",
                          "contextType" : "variable",
                          "element" : "encounter",
                          "variable" : "reference",
                          "transform" : "create",
                          "parameter" : [
                            {
                              "valueString" : "Reference"
                            }
                          ]
                        },
                        {
                          "context" : "reference",
                          "contextType" : "variable",
                          "element" : "reference",
                          "transform" : "evaluate",
                          "parameter" : [
                            {
                              "valueString" : "'https://example/Encounter/' + %encounter.id"
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "name" : "STatusobse",
                      "source" : [
                        {
                          "context" : "section"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "obs1",
                          "contextType" : "variable",
                          "element" : "status",
                          "transform" : "copy",
                          "parameter" : [
                            {
                              "valueString" : "final"
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "name" : "code",
                      "source" : [
                        {
                          "context" : "section",
                          "element" : "code",
                          "variable" : "vvv"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "obs1",
                          "contextType" : "variable",
                          "element" : "code",
                          "variable" : "vvv",
                          "transform" : "create"
                        }
                      ]
                    },
                    {
                      "name" : "status",
                      "source" : [
                        {
                          "context" : "act1",
                          "element" : "statusCode",
                          "variable" : "s"
                        }
                      ],
                      "rule" : [
                        {
                          "name" : "codeS",
                          "source" : [
                            {
                              "context" : "s",
                              "element" : "code",
                              "variable" : "cos"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "obs1",
                              "contextType" : "variable",
                              "element" : "status",
                              "transform" : "translate",
                              "parameter" : [
                                {
                                  "valueId" : "cos"
                                },
                                {
                                  "valueString" : "#OBSstatus"
                                },
                                {
                                  "valueString" : "code"
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "name" : "list",
                      "source" : [
                        {
                          "context" : "section"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "bundle",
                          "contextType" : "variable",
                          "element" : "entry",
                          "variable" : "e4"
                        },
                        {
                          "context" : "e4",
                          "contextType" : "variable",
                          "element" : "request",
                          "variable" : "request",
                          "transform" : "create",
                          "parameter" : [
                            {
                              "valueString" : "BackboneElement"
                            }
                          ]
                        },
                        {
                          "context" : "request",
                          "contextType" : "variable",
                          "element" : "method",
                          "transform" : "copy",
                          "parameter" : [
                            {
                              "valueString" : "POST"
                            }
                          ]
                        },
                        {
                          "context" : "e4",
                          "contextType" : "variable",
                          "element" : "resource",
                          "variable" : "list1",
                          "transform" : "create",
                          "parameter" : [
                            {
                              "valueString" : "List"
                            }
                          ]
                        },
                        {
                          "context" : "list1",
                          "contextType" : "variable",
                          "element" : "id",
                          "variable" : "uuid4",
                          "transform" : "uuid"
                        },
                        {
                          "context" : "e4",
                          "contextType" : "variable",
                          "element" : "fullUrl",
                          "transform" : "append",
                          "parameter" : [
                            {
                              "valueString" : "https://example/List/"
                            },
                            {
                              "valueId" : "uuid4"
                            }
                          ]
                        },
                        {
                          "context" : "request",
                          "contextType" : "variable",
                          "element" : "url",
                          "transform" : "copy",
                          "parameter" : [
                            {
                              "valueString" : "List"
                            }
                          ]
                        },
                        {
                          "context" : "obs1",
                          "contextType" : "variable",
                          "element" : "focus",
                          "variable" : "reference",
                          "transform" : "create",
                          "parameter" : [
                            {
                              "valueString" : "Reference"
                            }
                          ]
                        },
                        {
                          "context" : "reference",
                          "contextType" : "variable",
                          "element" : "reference",
                          "transform" : "evaluate",
                          "parameter" : [
                            {
                              "valueString" : "'https://example/List/' + %list1.id"
                            }
                          ]
                        }
                      ],
                      "rule" : [
                        {
                          "name" : "reference",
                          "source" : [
                            {
                              "context" : "section"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "list1",
                              "contextType" : "variable",
                              "element" : "subject",
                              "variable" : "reference",
                              "transform" : "create",
                              "parameter" : [
                                {
                                  "valueString" : "Reference"
                                }
                              ]
                            },
                            {
                              "context" : "reference",
                              "contextType" : "variable",
                              "element" : "reference",
                              "transform" : "evaluate",
                              "parameter" : [
                                {
                                  "valueString" : "'https://example/Patient/' + %patient.id"
                                }
                              ]
                            }
                          ]
                        },
                        {
                          "name" : "listatus",
                          "source" : [
                            {
                              "context" : "section"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "list1",
                              "contextType" : "variable",
                              "element" : "status",
                              "transform" : "copy",
                              "parameter" : [
                                {
                                  "valueString" : "current"
                                }
                              ]
                            }
                          ]
                        },
                        {
                          "name" : "lstmod",
                          "source" : [
                            {
                              "context" : "section"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "list1",
                              "contextType" : "variable",
                              "element" : "mode",
                              "transform" : "copy",
                              "parameter" : [
                                {
                                  "valueString" : "working"
                                }
                              ]
                            }
                          ]
                        },
                        {
                          "name" : "reference",
                          "source" : [
                            {
                              "context" : "section"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "list1",
                              "contextType" : "variable",
                              "element" : "encounter",
                              "variable" : "reference",
                              "transform" : "create",
                              "parameter" : [
                                {
                                  "valueString" : "Reference"
                                }
                              ]
                            },
                            {
                              "context" : "reference",
                              "contextType" : "variable",
                              "element" : "reference",
                              "transform" : "evaluate",
                              "parameter" : [
                                {
                                  "valueString" : "'https://example/Encounter/' + %encounter.id"
                                }
                              ]
                            }
                          ]
                        },
                        {
                          "name" : "item",
                          "source" : [
                            {
                              "context" : "src"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "list1",
                              "contextType" : "variable",
                              "element" : "entry",
                              "variable" : "entryList1"
                            }
                          ],
                          "rule" : [
                            {
                              "name" : "allergy",
                              "source" : [
                                {
                                  "context" : "act1"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "bundle",
                                  "contextType" : "variable",
                                  "element" : "entry",
                                  "variable" : "e5"
                                },
                                {
                                  "context" : "e5",
                                  "contextType" : "variable",
                                  "element" : "request",
                                  "variable" : "request",
                                  "transform" : "create",
                                  "parameter" : [
                                    {
                                      "valueString" : "BackboneElement"
                                    }
                                  ]
                                },
                                {
                                  "context" : "request",
                                  "contextType" : "variable",
                                  "element" : "method",
                                  "transform" : "copy",
                                  "parameter" : [
                                    {
                                      "valueString" : "POST"
                                    }
                                  ]
                                },
                                {
                                  "context" : "e5",
                                  "contextType" : "variable",
                                  "element" : "resource",
                                  "variable" : "allergy",
                                  "transform" : "create",
                                  "parameter" : [
                                    {
                                      "valueString" : "AllergyIntolerance"
                                    }
                                  ]
                                },
                                {
                                  "context" : "allergy",
                                  "contextType" : "variable",
                                  "element" : "id",
                                  "variable" : "uuid5",
                                  "transform" : "uuid"
                                },
                                {
                                  "context" : "e5",
                                  "contextType" : "variable",
                                  "element" : "fullUrl",
                                  "transform" : "append",
                                  "parameter" : [
                                    {
                                      "valueString" : "https://example/AllergyIntolerance/"
                                    },
                                    {
                                      "valueId" : "uuid5"
                                    }
                                  ]
                                },
                                {
                                  "context" : "request",
                                  "contextType" : "variable",
                                  "element" : "url",
                                  "transform" : "copy",
                                  "parameter" : [
                                    {
                                      "valueString" : "AllergyIntolerance"
                                    }
                                  ]
                                },
                                {
                                  "context" : "entryList1",
                                  "contextType" : "variable",
                                  "element" : "item",
                                  "variable" : "reference",
                                  "transform" : "create",
                                  "parameter" : [
                                    {
                                      "valueString" : "Reference"
                                    }
                                  ]
                                },
                                {
                                  "context" : "reference",
                                  "contextType" : "variable",
                                  "element" : "reference",
                                  "transform" : "evaluate",
                                  "parameter" : [
                                    {
                                      "valueString" : "'https://example/AllergyIntolerance/' + %allergy.id"
                                    }
                                  ]
                                }
                              ],
                              "dependent" : [
                                {
                                  "name" : "allergyFunction",
                                  "variable" : [
                                    "act1",
                                    "allergy",
                                    "patient",
                                    "encounter"
                                  ]
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  ]
                },
                {
                  "name" : "observation",
                  "source" : [
                    {
                      "context" : "section",
                      "condition" : "(code.code = '55111-9')"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "bundle",
                      "contextType" : "variable",
                      "element" : "entry",
                      "variable" : "e3"
                    },
                    {
                      "context" : "e3",
                      "contextType" : "variable",
                      "element" : "request",
                      "variable" : "request",
                      "transform" : "create",
                      "parameter" : [
                        {
                          "valueString" : "BackboneElement"
                        }
                      ]
                    },
                    {
                      "context" : "request",
                      "contextType" : "variable",
                      "element" : "method",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "POST"
                        }
                      ]
                    },
                    {
                      "context" : "e3",
                      "contextType" : "variable",
                      "element" : "resource",
                      "variable" : "obs2",
                      "transform" : "create",
                      "parameter" : [
                        {
                          "valueString" : "Observation"
                        }
                      ]
                    },
                    {
                      "context" : "obs2",
                      "contextType" : "variable",
                      "element" : "id",
                      "variable" : "uuid3",
                      "transform" : "uuid"
                    },
                    {
                      "context" : "e3",
                      "contextType" : "variable",
                      "element" : "fullUrl",
                      "transform" : "append",
                      "parameter" : [
                        {
                          "valueString" : "https://example/Observation/"
                        },
                        {
                          "valueId" : "uuid3"
                        }
                      ]
                    },
                    {
                      "context" : "request",
                      "contextType" : "variable",
                      "element" : "url",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "Observation"
                        }
                      ]
                    },
                    {
                      "context" : "dReport",
                      "contextType" : "variable",
                      "element" : "result",
                      "variable" : "reference",
                      "transform" : "create",
                      "parameter" : [
                        {
                          "valueString" : "Reference"
                        }
                      ]
                    },
                    {
                      "context" : "reference",
                      "contextType" : "variable",
                      "element" : "reference",
                      "transform" : "evaluate",
                      "parameter" : [
                        {
                          "valueString" : "'https://example/Observation/' + %obs2.id"
                        }
                      ]
                    }
                  ],
                  "dependent" : [
                    {
                      "name" : "Observation",
                      "variable" : [
                        "act1",
                        "patient",
                        "encounter",
                        "obs2",
                        "bundle"
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "name" : "entryObs",
              "source" : [
                {
                  "context" : "src",
                  "element" : "observation",
                  "variable" : "entryobs"
                }
              ],
              "rule" : [
                {
                  "name" : "observationstclinica",
                  "source" : [
                    {
                      "context" : "section",
                      "condition" : "(code.code = '11329-0')"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "bundle",
                      "contextType" : "variable",
                      "element" : "entry",
                      "variable" : "e6"
                    },
                    {
                      "context" : "e6",
                      "contextType" : "variable",
                      "element" : "request",
                      "variable" : "request",
                      "transform" : "create",
                      "parameter" : [
                        {
                          "valueString" : "BackboneElement"
                        }
                      ]
                    },
                    {
                      "context" : "request",
                      "contextType" : "variable",
                      "element" : "method",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "POST"
                        }
                      ]
                    },
                    {
                      "context" : "e6",
                      "contextType" : "variable",
                      "element" : "resource",
                      "variable" : "obs6",
                      "transform" : "create",
                      "parameter" : [
                        {
                          "valueString" : "Observation"
                        }
                      ]
                    },
                    {
                      "context" : "obs6",
                      "contextType" : "variable",
                      "element" : "id",
                      "variable" : "uuid6",
                      "transform" : "uuid"
                    },
                    {
                      "context" : "e6",
                      "contextType" : "variable",
                      "element" : "fullUrl",
                      "transform" : "append",
                      "parameter" : [
                        {
                          "valueString" : "https://example/Observation/"
                        },
                        {
                          "valueId" : "uuid6"
                        }
                      ]
                    },
                    {
                      "context" : "request",
                      "contextType" : "variable",
                      "element" : "url",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "Observation"
                        }
                      ]
                    },
                    {
                      "context" : "dReport",
                      "contextType" : "variable",
                      "element" : "result",
                      "variable" : "reference",
                      "transform" : "create",
                      "parameter" : [
                        {
                          "valueString" : "Reference"
                        }
                      ]
                    },
                    {
                      "context" : "reference",
                      "contextType" : "variable",
                      "element" : "reference",
                      "transform" : "evaluate",
                      "parameter" : [
                        {
                          "valueString" : "'https://example/Observation/' + %obs6.id"
                        }
                      ]
                    }
                  ],
                  "rule" : [
                    {
                      "name" : "reference",
                      "source" : [
                        {
                          "context" : "section"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "obs6",
                          "contextType" : "variable",
                          "element" : "subject",
                          "variable" : "reference",
                          "transform" : "create",
                          "parameter" : [
                            {
                              "valueString" : "Reference"
                            }
                          ]
                        },
                        {
                          "context" : "reference",
                          "contextType" : "variable",
                          "element" : "reference",
                          "transform" : "evaluate",
                          "parameter" : [
                            {
                              "valueString" : "'https://example/Patient/' + %patient.id"
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "name" : "reference",
                      "source" : [
                        {
                          "context" : "section"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "obs6",
                          "contextType" : "variable",
                          "element" : "encounter",
                          "variable" : "reference",
                          "transform" : "create",
                          "parameter" : [
                            {
                              "valueString" : "Reference"
                            }
                          ]
                        },
                        {
                          "context" : "reference",
                          "contextType" : "variable",
                          "element" : "reference",
                          "transform" : "evaluate",
                          "parameter" : [
                            {
                              "valueString" : "'https://example/Encounter/' + %encounter.id"
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "name" : "tatusobse",
                      "source" : [
                        {
                          "context" : "section"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "obs6",
                          "contextType" : "variable",
                          "element" : "status",
                          "transform" : "copy",
                          "parameter" : [
                            {
                              "valueString" : "final"
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "name" : "code",
                      "source" : [
                        {
                          "context" : "section",
                          "element" : "code",
                          "variable" : "vvv"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "obs6",
                          "contextType" : "variable",
                          "element" : "code",
                          "variable" : "vvv",
                          "transform" : "create"
                        }
                      ]
                    },
                    {
                      "name" : "condition",
                      "source" : [
                        {
                          "context" : "entryobs"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "bundle",
                          "contextType" : "variable",
                          "element" : "entry",
                          "variable" : "e7"
                        },
                        {
                          "context" : "e7",
                          "contextType" : "variable",
                          "element" : "request",
                          "variable" : "request",
                          "transform" : "create",
                          "parameter" : [
                            {
                              "valueString" : "BackboneElement"
                            }
                          ]
                        },
                        {
                          "context" : "request",
                          "contextType" : "variable",
                          "element" : "method",
                          "transform" : "copy",
                          "parameter" : [
                            {
                              "valueString" : "POST"
                            }
                          ]
                        },
                        {
                          "context" : "e7",
                          "contextType" : "variable",
                          "element" : "resource",
                          "variable" : "condition1",
                          "transform" : "create",
                          "parameter" : [
                            {
                              "valueString" : "Condition"
                            }
                          ]
                        },
                        {
                          "context" : "condition1",
                          "contextType" : "variable",
                          "element" : "id",
                          "variable" : "uuid7",
                          "transform" : "uuid"
                        },
                        {
                          "context" : "e7",
                          "contextType" : "variable",
                          "element" : "fullUrl",
                          "transform" : "append",
                          "parameter" : [
                            {
                              "valueString" : "https://example/Condition/"
                            },
                            {
                              "valueId" : "uuid7"
                            }
                          ]
                        },
                        {
                          "context" : "request",
                          "contextType" : "variable",
                          "element" : "url",
                          "transform" : "copy",
                          "parameter" : [
                            {
                              "valueString" : "Condition"
                            }
                          ]
                        },
                        {
                          "context" : "obs6",
                          "contextType" : "variable",
                          "element" : "focus",
                          "variable" : "reference",
                          "transform" : "create",
                          "parameter" : [
                            {
                              "valueString" : "Reference"
                            }
                          ]
                        },
                        {
                          "context" : "reference",
                          "contextType" : "variable",
                          "element" : "reference",
                          "transform" : "evaluate",
                          "parameter" : [
                            {
                              "valueString" : "'https://example/Condition/' + %condition1.id"
                            }
                          ]
                        }
                      ],
                      "dependent" : [
                        {
                          "name" : "ConditionFunction",
                          "variable" : [
                            "entryobs",
                            "condition1",
                            "patient",
                            "encounter",
                            "bundle"
                          ]
                        }
                      ]
                    }
                  ]
                },
                {
                  "name" : "precedentiEsami",
                  "source" : [
                    {
                      "context" : "section",
                      "condition" : "(code.code = '55114-3')"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "bundle",
                      "contextType" : "variable",
                      "element" : "entry",
                      "variable" : "e9"
                    },
                    {
                      "context" : "e9",
                      "contextType" : "variable",
                      "element" : "request",
                      "variable" : "request",
                      "transform" : "create",
                      "parameter" : [
                        {
                          "valueString" : "BackboneElement"
                        }
                      ]
                    },
                    {
                      "context" : "request",
                      "contextType" : "variable",
                      "element" : "method",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "POST"
                        }
                      ]
                    },
                    {
                      "context" : "e9",
                      "contextType" : "variable",
                      "element" : "resource",
                      "variable" : "obs9",
                      "transform" : "create",
                      "parameter" : [
                        {
                          "valueString" : "Observation"
                        }
                      ]
                    },
                    {
                      "context" : "obs9",
                      "contextType" : "variable",
                      "element" : "id",
                      "variable" : "uuid9",
                      "transform" : "uuid"
                    },
                    {
                      "context" : "e9",
                      "contextType" : "variable",
                      "element" : "fullUrl",
                      "transform" : "append",
                      "parameter" : [
                        {
                          "valueString" : "https://example/Observation/"
                        },
                        {
                          "valueId" : "uuid9"
                        }
                      ]
                    },
                    {
                      "context" : "request",
                      "contextType" : "variable",
                      "element" : "url",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "Observation"
                        }
                      ]
                    },
                    {
                      "context" : "dReport",
                      "contextType" : "variable",
                      "element" : "result",
                      "variable" : "reference",
                      "transform" : "create",
                      "parameter" : [
                        {
                          "valueString" : "Reference"
                        }
                      ]
                    },
                    {
                      "context" : "reference",
                      "contextType" : "variable",
                      "element" : "reference",
                      "transform" : "evaluate",
                      "parameter" : [
                        {
                          "valueString" : "'https://example/Observation/' + %obs9.id"
                        }
                      ]
                    }
                  ],
                  "dependent" : [
                    {
                      "name" : "Observation",
                      "variable" : [
                        "entryobs",
                        "patient",
                        "encounter",
                        "obs9",
                        "bundle"
                      ]
                    }
                  ]
                },
                {
                  "name" : "complicanze",
                  "source" : [
                    {
                      "context" : "section",
                      "condition" : "(code.code = '55109-3')"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "bundle",
                      "contextType" : "variable",
                      "element" : "entry",
                      "variable" : "e8"
                    },
                    {
                      "context" : "e8",
                      "contextType" : "variable",
                      "element" : "request",
                      "variable" : "request",
                      "transform" : "create",
                      "parameter" : [
                        {
                          "valueString" : "BackboneElement"
                        }
                      ]
                    },
                    {
                      "context" : "request",
                      "contextType" : "variable",
                      "element" : "method",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "POST"
                        }
                      ]
                    },
                    {
                      "context" : "e8",
                      "contextType" : "variable",
                      "element" : "resource",
                      "variable" : "obs8",
                      "transform" : "create",
                      "parameter" : [
                        {
                          "valueString" : "Observation"
                        }
                      ]
                    },
                    {
                      "context" : "obs8",
                      "contextType" : "variable",
                      "element" : "id",
                      "variable" : "uuid8",
                      "transform" : "uuid"
                    },
                    {
                      "context" : "e8",
                      "contextType" : "variable",
                      "element" : "fullUrl",
                      "transform" : "append",
                      "parameter" : [
                        {
                          "valueString" : "https://example/Observation/"
                        },
                        {
                          "valueId" : "uuid8"
                        }
                      ]
                    },
                    {
                      "context" : "request",
                      "contextType" : "variable",
                      "element" : "url",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "Observation"
                        }
                      ]
                    },
                    {
                      "context" : "dReport",
                      "contextType" : "variable",
                      "element" : "result",
                      "variable" : "reference",
                      "transform" : "create",
                      "parameter" : [
                        {
                          "valueString" : "Reference"
                        }
                      ]
                    },
                    {
                      "context" : "reference",
                      "contextType" : "variable",
                      "element" : "reference",
                      "transform" : "evaluate",
                      "parameter" : [
                        {
                          "valueString" : "'https://example/Observation/' + %obs8.id"
                        }
                      ]
                    }
                  ],
                  "dependent" : [
                    {
                      "name" : "Observation",
                      "variable" : [
                        "entryobs",
                        "patient",
                        "encounter",
                        "obs8",
                        "bundle"
                      ]
                    }
                  ]
                },
                {
                  "name" : "quesitoDiagnostico",
                  "source" : [
                    {
                      "context" : "section",
                      "condition" : "(code.code = '18785-6')"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "bundle",
                      "contextType" : "variable",
                      "element" : "entry",
                      "variable" : "e14"
                    },
                    {
                      "context" : "e14",
                      "contextType" : "variable",
                      "element" : "request",
                      "variable" : "request",
                      "transform" : "create",
                      "parameter" : [
                        {
                          "valueString" : "BackboneElement"
                        }
                      ]
                    },
                    {
                      "context" : "request",
                      "contextType" : "variable",
                      "element" : "method",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "POST"
                        }
                      ]
                    },
                    {
                      "context" : "e14",
                      "contextType" : "variable",
                      "element" : "resource",
                      "variable" : "obs14",
                      "transform" : "create",
                      "parameter" : [
                        {
                          "valueString" : "Observation"
                        }
                      ]
                    },
                    {
                      "context" : "obs14",
                      "contextType" : "variable",
                      "element" : "id",
                      "variable" : "uuid14",
                      "transform" : "uuid"
                    },
                    {
                      "context" : "e14",
                      "contextType" : "variable",
                      "element" : "fullUrl",
                      "transform" : "append",
                      "parameter" : [
                        {
                          "valueString" : "https://example/Observation/"
                        },
                        {
                          "valueId" : "uuid14"
                        }
                      ]
                    },
                    {
                      "context" : "request",
                      "contextType" : "variable",
                      "element" : "url",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "Observation"
                        }
                      ]
                    },
                    {
                      "context" : "dReport",
                      "contextType" : "variable",
                      "element" : "result",
                      "variable" : "reference",
                      "transform" : "create",
                      "parameter" : [
                        {
                          "valueString" : "Reference"
                        }
                      ]
                    },
                    {
                      "context" : "reference",
                      "contextType" : "variable",
                      "element" : "reference",
                      "transform" : "evaluate",
                      "parameter" : [
                        {
                          "valueString" : "'https://example/Observation/' + %obs14.id"
                        }
                      ]
                    }
                  ],
                  "dependent" : [
                    {
                      "name" : "Observation",
                      "variable" : [
                        "entryobs",
                        "patient",
                        "encounter",
                        "obs14",
                        "bundle"
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "name" : "organizer",
              "source" : [
                {
                  "context" : "src",
                  "element" : "organizer",
                  "variable" : "organizer"
                }
              ],
              "rule" : [
                {
                  "name" : "entryOrganizer",
                  "source" : [
                    {
                      "context" : "src"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "bundle",
                      "contextType" : "variable",
                      "element" : "entry",
                      "variable" : "e10"
                    },
                    {
                      "context" : "e10",
                      "contextType" : "variable",
                      "element" : "request",
                      "variable" : "request",
                      "transform" : "create",
                      "parameter" : [
                        {
                          "valueString" : "BackboneElement"
                        }
                      ]
                    },
                    {
                      "context" : "request",
                      "contextType" : "variable",
                      "element" : "method",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "POST"
                        }
                      ]
                    },
                    {
                      "context" : "e10",
                      "contextType" : "variable",
                      "element" : "resource",
                      "variable" : "obs10",
                      "transform" : "create",
                      "parameter" : [
                        {
                          "valueString" : "Observation"
                        }
                      ]
                    },
                    {
                      "context" : "obs10",
                      "contextType" : "variable",
                      "element" : "id",
                      "variable" : "uuid10",
                      "transform" : "uuid"
                    },
                    {
                      "context" : "e10",
                      "contextType" : "variable",
                      "element" : "fullUrl",
                      "transform" : "append",
                      "parameter" : [
                        {
                          "valueString" : "https://example/Observation/"
                        },
                        {
                          "valueId" : "uuid10"
                        }
                      ]
                    },
                    {
                      "context" : "request",
                      "contextType" : "variable",
                      "element" : "url",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "Observation"
                        }
                      ]
                    },
                    {
                      "context" : "dReport",
                      "contextType" : "variable",
                      "element" : "result",
                      "variable" : "reference",
                      "transform" : "create",
                      "parameter" : [
                        {
                          "valueString" : "Reference"
                        }
                      ]
                    },
                    {
                      "context" : "reference",
                      "contextType" : "variable",
                      "element" : "reference",
                      "transform" : "evaluate",
                      "parameter" : [
                        {
                          "valueString" : "'https://example/Observation/' + %obs10.id"
                        }
                      ]
                    }
                  ],
                  "rule" : [
                    {
                      "name" : "reference",
                      "source" : [
                        {
                          "context" : "section"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "obs10",
                          "contextType" : "variable",
                          "element" : "subject",
                          "variable" : "reference",
                          "transform" : "create",
                          "parameter" : [
                            {
                              "valueString" : "Reference"
                            }
                          ]
                        },
                        {
                          "context" : "reference",
                          "contextType" : "variable",
                          "element" : "reference",
                          "transform" : "evaluate",
                          "parameter" : [
                            {
                              "valueString" : "'https://example/Patient/' + %patient.id"
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "name" : "reference",
                      "source" : [
                        {
                          "context" : "section"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "obs10",
                          "contextType" : "variable",
                          "element" : "encounter",
                          "variable" : "reference",
                          "transform" : "create",
                          "parameter" : [
                            {
                              "valueString" : "Reference"
                            }
                          ]
                        },
                        {
                          "context" : "reference",
                          "contextType" : "variable",
                          "element" : "reference",
                          "transform" : "evaluate",
                          "parameter" : [
                            {
                              "valueString" : "'https://example/Encounter/' + %encounter.id"
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "name" : "tatusobse",
                      "source" : [
                        {
                          "context" : "section"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "obs10",
                          "contextType" : "variable",
                          "element" : "status",
                          "transform" : "copy",
                          "parameter" : [
                            {
                              "valueString" : "final"
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "name" : "codeObs",
                      "source" : [
                        {
                          "context" : "section",
                          "element" : "code",
                          "variable" : "vvv"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "obs10",
                          "contextType" : "variable",
                          "element" : "code",
                          "variable" : "vvv",
                          "transform" : "create"
                        }
                      ]
                    },
                    {
                      "name" : "List",
                      "source" : [
                        {
                          "context" : "section"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "bundle",
                          "contextType" : "variable",
                          "element" : "entry",
                          "variable" : "e11"
                        },
                        {
                          "context" : "e11",
                          "contextType" : "variable",
                          "element" : "request",
                          "variable" : "request",
                          "transform" : "create",
                          "parameter" : [
                            {
                              "valueString" : "BackboneElement"
                            }
                          ]
                        },
                        {
                          "context" : "request",
                          "contextType" : "variable",
                          "element" : "method",
                          "transform" : "copy",
                          "parameter" : [
                            {
                              "valueString" : "POST"
                            }
                          ]
                        },
                        {
                          "context" : "e11",
                          "contextType" : "variable",
                          "element" : "resource",
                          "variable" : "list11",
                          "transform" : "create",
                          "parameter" : [
                            {
                              "valueString" : "List"
                            }
                          ]
                        },
                        {
                          "context" : "list11",
                          "contextType" : "variable",
                          "element" : "id",
                          "variable" : "uuid11",
                          "transform" : "uuid"
                        },
                        {
                          "context" : "e11",
                          "contextType" : "variable",
                          "element" : "fullUrl",
                          "transform" : "append",
                          "parameter" : [
                            {
                              "valueString" : "https://example/List/"
                            },
                            {
                              "valueId" : "uuid11"
                            }
                          ]
                        },
                        {
                          "context" : "request",
                          "contextType" : "variable",
                          "element" : "url",
                          "transform" : "copy",
                          "parameter" : [
                            {
                              "valueString" : "List"
                            }
                          ]
                        },
                        {
                          "context" : "obs10",
                          "contextType" : "variable",
                          "element" : "focus",
                          "variable" : "reference",
                          "transform" : "create",
                          "parameter" : [
                            {
                              "valueString" : "Reference"
                            }
                          ]
                        },
                        {
                          "context" : "reference",
                          "contextType" : "variable",
                          "element" : "reference",
                          "transform" : "evaluate",
                          "parameter" : [
                            {
                              "valueString" : "'https://example/List/' + %list11.id"
                            }
                          ]
                        }
                      ],
                      "rule" : [
                        {
                          "name" : "reference",
                          "source" : [
                            {
                              "context" : "section"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "list11",
                              "contextType" : "variable",
                              "element" : "subject",
                              "variable" : "reference",
                              "transform" : "create",
                              "parameter" : [
                                {
                                  "valueString" : "Reference"
                                }
                              ]
                            },
                            {
                              "context" : "reference",
                              "contextType" : "variable",
                              "element" : "reference",
                              "transform" : "evaluate",
                              "parameter" : [
                                {
                                  "valueString" : "'https://example/Patient/' + %patient.id"
                                }
                              ]
                            }
                          ]
                        },
                        {
                          "name" : "liststat",
                          "source" : [
                            {
                              "context" : "section"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "list11",
                              "contextType" : "variable",
                              "element" : "status",
                              "transform" : "copy",
                              "parameter" : [
                                {
                                  "valueString" : "current"
                                }
                              ]
                            }
                          ]
                        },
                        {
                          "name" : "listmd",
                          "source" : [
                            {
                              "context" : "section"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "list11",
                              "contextType" : "variable",
                              "element" : "mode",
                              "transform" : "copy",
                              "parameter" : [
                                {
                                  "valueString" : "working"
                                }
                              ]
                            }
                          ]
                        },
                        {
                          "name" : "reference",
                          "source" : [
                            {
                              "context" : "section"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "list11",
                              "contextType" : "variable",
                              "element" : "encounter",
                              "variable" : "reference",
                              "transform" : "create",
                              "parameter" : [
                                {
                                  "valueString" : "Reference"
                                }
                              ]
                            },
                            {
                              "context" : "reference",
                              "contextType" : "variable",
                              "element" : "reference",
                              "transform" : "evaluate",
                              "parameter" : [
                                {
                                  "valueString" : "'https://example/Encounter/' + %encounter.id"
                                }
                              ]
                            }
                          ]
                        },
                        {
                          "name" : "org",
                          "source" : [
                            {
                              "context" : "organizer"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "list11",
                              "contextType" : "variable",
                              "element" : "entry",
                              "variable" : "entryList2"
                            }
                          ],
                          "rule" : [
                            {
                              "name" : "family",
                              "source" : [
                                {
                                  "context" : "organizer"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "bundle",
                                  "contextType" : "variable",
                                  "element" : "entry",
                                  "variable" : "e12"
                                },
                                {
                                  "context" : "e12",
                                  "contextType" : "variable",
                                  "element" : "request",
                                  "variable" : "request",
                                  "transform" : "create",
                                  "parameter" : [
                                    {
                                      "valueString" : "BackboneElement"
                                    }
                                  ]
                                },
                                {
                                  "context" : "request",
                                  "contextType" : "variable",
                                  "element" : "method",
                                  "transform" : "copy",
                                  "parameter" : [
                                    {
                                      "valueString" : "POST"
                                    }
                                  ]
                                },
                                {
                                  "context" : "e12",
                                  "contextType" : "variable",
                                  "element" : "resource",
                                  "variable" : "familyMember",
                                  "transform" : "create",
                                  "parameter" : [
                                    {
                                      "valueString" : "FamilyMemberHistory"
                                    }
                                  ]
                                },
                                {
                                  "context" : "familyMember",
                                  "contextType" : "variable",
                                  "element" : "id",
                                  "variable" : "uuid12",
                                  "transform" : "uuid"
                                },
                                {
                                  "context" : "e12",
                                  "contextType" : "variable",
                                  "element" : "fullUrl",
                                  "transform" : "append",
                                  "parameter" : [
                                    {
                                      "valueString" : "https://example/FamilyMemberHistory/"
                                    },
                                    {
                                      "valueId" : "uuid12"
                                    }
                                  ]
                                },
                                {
                                  "context" : "request",
                                  "contextType" : "variable",
                                  "element" : "url",
                                  "transform" : "copy",
                                  "parameter" : [
                                    {
                                      "valueString" : "FamilyMemberHistory"
                                    }
                                  ]
                                },
                                {
                                  "context" : "entryList2",
                                  "contextType" : "variable",
                                  "element" : "item",
                                  "variable" : "reference",
                                  "transform" : "create",
                                  "parameter" : [
                                    {
                                      "valueString" : "Reference"
                                    }
                                  ]
                                },
                                {
                                  "context" : "reference",
                                  "contextType" : "variable",
                                  "element" : "reference",
                                  "transform" : "evaluate",
                                  "parameter" : [
                                    {
                                      "valueString" : "'https://example/FamilyMemberHistory/' + %familyMember.id"
                                    }
                                  ]
                                }
                              ],
                              "dependent" : [
                                {
                                  "name" : "FamilyMemberFunction",
                                  "variable" : [
                                    "organizer",
                                    "familyMember",
                                    "patient"
                                  ]
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "name" : "whereCond",
              "source" : [
                {
                  "context" : "section",
                  "condition" : "section.entry.exists().not()"
                }
              ],
              "rule" : [
                {
                  "name" : "allergyAct",
                  "source" : [
                    {
                      "context" : "section",
                      "condition" : "(code.code = '48765-2')"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "bundle",
                      "contextType" : "variable",
                      "element" : "entry",
                      "variable" : "e2"
                    },
                    {
                      "context" : "e2",
                      "contextType" : "variable",
                      "element" : "request",
                      "variable" : "request",
                      "transform" : "create",
                      "parameter" : [
                        {
                          "valueString" : "BackboneElement"
                        }
                      ]
                    },
                    {
                      "context" : "request",
                      "contextType" : "variable",
                      "element" : "method",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "POST"
                        }
                      ]
                    },
                    {
                      "context" : "e2",
                      "contextType" : "variable",
                      "element" : "resource",
                      "variable" : "obs1",
                      "transform" : "create",
                      "parameter" : [
                        {
                          "valueString" : "Observation"
                        }
                      ]
                    },
                    {
                      "context" : "obs1",
                      "contextType" : "variable",
                      "element" : "id",
                      "variable" : "uuid2",
                      "transform" : "uuid"
                    },
                    {
                      "context" : "e2",
                      "contextType" : "variable",
                      "element" : "fullUrl",
                      "transform" : "append",
                      "parameter" : [
                        {
                          "valueString" : "https://example/Observation/"
                        },
                        {
                          "valueId" : "uuid2"
                        }
                      ]
                    },
                    {
                      "context" : "request",
                      "contextType" : "variable",
                      "element" : "url",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "Observation"
                        }
                      ]
                    },
                    {
                      "context" : "dReport",
                      "contextType" : "variable",
                      "element" : "result",
                      "variable" : "reference",
                      "transform" : "create",
                      "parameter" : [
                        {
                          "valueString" : "Reference"
                        }
                      ]
                    },
                    {
                      "context" : "reference",
                      "contextType" : "variable",
                      "element" : "reference",
                      "transform" : "evaluate",
                      "parameter" : [
                        {
                          "valueString" : "'https://example/Observation/' + %obs1.id"
                        }
                      ]
                    }
                  ],
                  "rule" : [
                    {
                      "name" : "reference",
                      "source" : [
                        {
                          "context" : "section"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "obs1",
                          "contextType" : "variable",
                          "element" : "subject",
                          "variable" : "reference",
                          "transform" : "create",
                          "parameter" : [
                            {
                              "valueString" : "Reference"
                            }
                          ]
                        },
                        {
                          "context" : "reference",
                          "contextType" : "variable",
                          "element" : "reference",
                          "transform" : "evaluate",
                          "parameter" : [
                            {
                              "valueString" : "'https://example/Patient/' + %patient.id"
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "name" : "reference",
                      "source" : [
                        {
                          "context" : "section"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "obs1",
                          "contextType" : "variable",
                          "element" : "encounter",
                          "variable" : "reference",
                          "transform" : "create",
                          "parameter" : [
                            {
                              "valueString" : "Reference"
                            }
                          ]
                        },
                        {
                          "context" : "reference",
                          "contextType" : "variable",
                          "element" : "reference",
                          "transform" : "evaluate",
                          "parameter" : [
                            {
                              "valueString" : "'https://example/Encounter/' + %encounter.id"
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "name" : "STatusobse",
                      "source" : [
                        {
                          "context" : "section"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "obs1",
                          "contextType" : "variable",
                          "element" : "status",
                          "transform" : "copy",
                          "parameter" : [
                            {
                              "valueString" : "final"
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "name" : "code",
                      "source" : [
                        {
                          "context" : "section",
                          "element" : "code",
                          "variable" : "vvv"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "obs1",
                          "contextType" : "variable",
                          "element" : "code",
                          "variable" : "vvv",
                          "transform" : "create"
                        }
                      ]
                    },
                    {
                      "name" : "status",
                      "source" : [
                        {
                          "context" : "section",
                          "element" : "statusCode",
                          "variable" : "s"
                        }
                      ],
                      "rule" : [
                        {
                          "name" : "codeS",
                          "source" : [
                            {
                              "context" : "s",
                              "element" : "code",
                              "variable" : "cos"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "obs1",
                              "contextType" : "variable",
                              "element" : "status",
                              "transform" : "translate",
                              "parameter" : [
                                {
                                  "valueId" : "cos"
                                },
                                {
                                  "valueString" : "#OBSstatus"
                                },
                                {
                                  "valueString" : "code"
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "name" : "allergytext",
                      "source" : [
                        {
                          "context" : "section",
                          "element" : "text",
                          "variable" : "text"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "bundle",
                          "contextType" : "variable",
                          "element" : "entry",
                          "variable" : "e5"
                        },
                        {
                          "context" : "e5",
                          "contextType" : "variable",
                          "element" : "request",
                          "variable" : "request",
                          "transform" : "create",
                          "parameter" : [
                            {
                              "valueString" : "BackboneElement"
                            }
                          ]
                        },
                        {
                          "context" : "request",
                          "contextType" : "variable",
                          "element" : "method",
                          "transform" : "copy",
                          "parameter" : [
                            {
                              "valueString" : "POST"
                            }
                          ]
                        },
                        {
                          "context" : "e5",
                          "contextType" : "variable",
                          "element" : "resource",
                          "variable" : "allergy",
                          "transform" : "create",
                          "parameter" : [
                            {
                              "valueString" : "AllergyIntolerance"
                            }
                          ]
                        },
                        {
                          "context" : "allergy",
                          "contextType" : "variable",
                          "element" : "id",
                          "variable" : "uuid5",
                          "transform" : "uuid"
                        },
                        {
                          "context" : "e5",
                          "contextType" : "variable",
                          "element" : "fullUrl",
                          "transform" : "append",
                          "parameter" : [
                            {
                              "valueString" : "https://example/AllergyIntolerance/"
                            },
                            {
                              "valueId" : "uuid5"
                            }
                          ]
                        },
                        {
                          "context" : "request",
                          "contextType" : "variable",
                          "element" : "url",
                          "transform" : "copy",
                          "parameter" : [
                            {
                              "valueString" : "AllergyIntolerance"
                            }
                          ]
                        },
                        {
                          "context" : "obs1",
                          "contextType" : "variable",
                          "element" : "focus",
                          "variable" : "reference",
                          "transform" : "create",
                          "parameter" : [
                            {
                              "valueString" : "Reference"
                            }
                          ]
                        },
                        {
                          "context" : "reference",
                          "contextType" : "variable",
                          "element" : "reference",
                          "transform" : "evaluate",
                          "parameter" : [
                            {
                              "valueString" : "'https://example/AllergyIntolerance/' + %allergy.id"
                            }
                          ]
                        }
                      ],
                      "rule" : [
                        {
                          "name" : "reference",
                          "source" : [
                            {
                              "context" : "section"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "allergy",
                              "contextType" : "variable",
                              "element" : "patient",
                              "variable" : "reference",
                              "transform" : "create",
                              "parameter" : [
                                {
                                  "valueString" : "Reference"
                                }
                              ]
                            },
                            {
                              "context" : "reference",
                              "contextType" : "variable",
                              "element" : "reference",
                              "transform" : "evaluate",
                              "parameter" : [
                                {
                                  "valueString" : "'https://example/Patient/' + %patient.id"
                                }
                              ]
                            }
                          ]
                        },
                        {
                          "name" : "reference",
                          "source" : [
                            {
                              "context" : "section"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "allergy",
                              "contextType" : "variable",
                              "element" : "encounter",
                              "variable" : "reference",
                              "transform" : "create",
                              "parameter" : [
                                {
                                  "valueString" : "Reference"
                                }
                              ]
                            },
                            {
                              "context" : "reference",
                              "contextType" : "variable",
                              "element" : "reference",
                              "transform" : "evaluate",
                              "parameter" : [
                                {
                                  "valueString" : "'https://example/Encounter/' + %encounter.id"
                                }
                              ]
                            }
                          ]
                        },
                        {
                          "name" : "status",
                          "source" : [
                            {
                              "context" : "section"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "allergy",
                              "contextType" : "variable",
                              "element" : "clinicalStatus",
                              "variable" : "clinicalStatus"
                            }
                          ],
                          "rule" : [
                            {
                              "name" : "coding",
                              "source" : [
                                {
                                  "context" : "section"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "clinicalStatus",
                                  "contextType" : "variable",
                                  "element" : "coding",
                                  "variable" : "coding",
                                  "transform" : "create",
                                  "parameter" : [
                                    {
                                      "valueString" : "Coding"
                                    }
                                  ]
                                }
                              ],
                              "rule" : [
                                {
                                  "name" : "code",
                                  "source" : [
                                    {
                                      "context" : "section"
                                    }
                                  ],
                                  "target" : [
                                    {
                                      "context" : "coding",
                                      "contextType" : "variable",
                                      "element" : "code",
                                      "transform" : "copy",
                                      "parameter" : [
                                        {
                                          "valueString" : "active"
                                        }
                                      ]
                                    }
                                  ]
                                },
                                {
                                  "name" : "system",
                                  "source" : [
                                    {
                                      "context" : "section"
                                    }
                                  ],
                                  "target" : [
                                    {
                                      "context" : "coding",
                                      "contextType" : "variable",
                                      "element" : "system",
                                      "transform" : "copy",
                                      "parameter" : [
                                        {
                                          "valueString" : "http://terminology.hl7.org/CodeSystem/allergyintolerance-clinical"
                                        }
                                      ]
                                    }
                                  ]
                                }
                              ]
                            }
                          ]
                        },
                        {
                          "name" : "narrative",
                          "source" : [
                            {
                              "context" : "text"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "allergy",
                              "contextType" : "variable",
                              "element" : "note",
                              "variable" : "note"
                            }
                          ],
                          "rule" : [
                            {
                              "name" : "note",
                              "source" : [
                                {
                                  "context" : "text",
                                  "variable" : "t"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "note",
                                  "contextType" : "variable",
                                  "element" : "text",
                                  "variable" : "textNote",
                                  "transform" : "create",
                                  "parameter" : [
                                    {
                                      "valueString" : "string"
                                    }
                                  ]
                                }
                              ],
                              "dependent" : [
                                {
                                  "name" : "EDstring",
                                  "variable" : [
                                    "t",
                                    "textNote"
                                  ]
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  ]
                },
                {
                  "name" : "NonConclusion",
                  "source" : [
                    {
                      "context" : "section",
                      "condition" : "(code.code = '55110-1').not() or (code.code = '11329-0').not()"
                    }
                  ],
                  "rule" : [
                    {
                      "name" : "txtsec",
                      "source" : [
                        {
                          "context" : "section",
                          "element" : "text",
                          "variable" : "text"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "bundle",
                          "contextType" : "variable",
                          "element" : "entry",
                          "variable" : "e13"
                        },
                        {
                          "context" : "e13",
                          "contextType" : "variable",
                          "element" : "request",
                          "variable" : "request",
                          "transform" : "create",
                          "parameter" : [
                            {
                              "valueString" : "BackboneElement"
                            }
                          ]
                        },
                        {
                          "context" : "request",
                          "contextType" : "variable",
                          "element" : "method",
                          "transform" : "copy",
                          "parameter" : [
                            {
                              "valueString" : "POST"
                            }
                          ]
                        },
                        {
                          "context" : "e13",
                          "contextType" : "variable",
                          "element" : "resource",
                          "variable" : "obs13",
                          "transform" : "create",
                          "parameter" : [
                            {
                              "valueString" : "Observation"
                            }
                          ]
                        },
                        {
                          "context" : "obs13",
                          "contextType" : "variable",
                          "element" : "id",
                          "variable" : "uuid13",
                          "transform" : "uuid"
                        },
                        {
                          "context" : "e13",
                          "contextType" : "variable",
                          "element" : "fullUrl",
                          "transform" : "append",
                          "parameter" : [
                            {
                              "valueString" : "https://example/Observation/"
                            },
                            {
                              "valueId" : "uuid13"
                            }
                          ]
                        },
                        {
                          "context" : "request",
                          "contextType" : "variable",
                          "element" : "url",
                          "transform" : "copy",
                          "parameter" : [
                            {
                              "valueString" : "Observation"
                            }
                          ]
                        },
                        {
                          "context" : "dReport",
                          "contextType" : "variable",
                          "element" : "result",
                          "variable" : "reference",
                          "transform" : "create",
                          "parameter" : [
                            {
                              "valueString" : "Reference"
                            }
                          ]
                        },
                        {
                          "context" : "reference",
                          "contextType" : "variable",
                          "element" : "reference",
                          "transform" : "evaluate",
                          "parameter" : [
                            {
                              "valueString" : "'https://example/Observation/' + %obs13.id"
                            }
                          ]
                        }
                      ],
                      "rule" : [
                        {
                          "name" : "reference",
                          "source" : [
                            {
                              "context" : "section"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "obs13",
                              "contextType" : "variable",
                              "element" : "subject",
                              "variable" : "reference",
                              "transform" : "create",
                              "parameter" : [
                                {
                                  "valueString" : "Reference"
                                }
                              ]
                            },
                            {
                              "context" : "reference",
                              "contextType" : "variable",
                              "element" : "reference",
                              "transform" : "evaluate",
                              "parameter" : [
                                {
                                  "valueString" : "'https://example/Patient/' + %patient.id"
                                }
                              ]
                            }
                          ]
                        },
                        {
                          "name" : "reference",
                          "source" : [
                            {
                              "context" : "section"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "obs13",
                              "contextType" : "variable",
                              "element" : "encounter",
                              "variable" : "reference",
                              "transform" : "create",
                              "parameter" : [
                                {
                                  "valueString" : "Reference"
                                }
                              ]
                            },
                            {
                              "context" : "reference",
                              "contextType" : "variable",
                              "element" : "reference",
                              "transform" : "evaluate",
                              "parameter" : [
                                {
                                  "valueString" : "'https://example/Encounter/' + %encounter.id"
                                }
                              ]
                            }
                          ]
                        },
                        {
                          "name" : "obsst",
                          "source" : [
                            {
                              "context" : "section"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "obs13",
                              "contextType" : "variable",
                              "element" : "status",
                              "transform" : "copy",
                              "parameter" : [
                                {
                                  "valueString" : "preliminary"
                                }
                              ]
                            }
                          ]
                        },
                        {
                          "name" : "obscde",
                          "source" : [
                            {
                              "context" : "section",
                              "element" : "code",
                              "variable" : "vvv"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "obs13",
                              "contextType" : "variable",
                              "element" : "code",
                              "variable" : "vvv",
                              "transform" : "create"
                            }
                          ]
                        },
                        {
                          "name" : "statusS",
                          "source" : [
                            {
                              "context" : "section"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "obs13",
                              "contextType" : "variable",
                              "element" : "status",
                              "transform" : "copy",
                              "parameter" : [
                                {
                                  "valueString" : "final"
                                }
                              ]
                            }
                          ]
                        },
                        {
                          "name" : "narrative",
                          "source" : [
                            {
                              "context" : "text"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "obs13",
                              "contextType" : "variable",
                              "element" : "note",
                              "variable" : "note"
                            }
                          ],
                          "rule" : [
                            {
                              "name" : "note",
                              "source" : [
                                {
                                  "context" : "text",
                                  "variable" : "t"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "note",
                                  "contextType" : "variable",
                                  "element" : "text",
                                  "variable" : "textNote",
                                  "transform" : "create",
                                  "parameter" : [
                                    {
                                      "valueString" : "string"
                                    }
                                  ]
                                }
                              ],
                              "dependent" : [
                                {
                                  "name" : "EDstring",
                                  "variable" : [
                                    "t",
                                    "textNote"
                                  ]
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  ]
                },
                {
                  "name" : "conclusion",
                  "source" : [
                    {
                      "context" : "section",
                      "condition" : "(code.code = '55110-1')"
                    }
                  ],
                  "rule" : [
                    {
                      "name" : "conc",
                      "source" : [
                        {
                          "context" : "section",
                          "element" : "text",
                          "variable" : "t"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "dReport",
                          "contextType" : "variable",
                          "element" : "conclusion",
                          "variable" : "textConclusion",
                          "transform" : "create",
                          "parameter" : [
                            {
                              "valueString" : "string"
                            }
                          ]
                        }
                      ],
                      "dependent" : [
                        {
                          "name" : "EDstring",
                          "variable" : [
                            "t",
                            "textConclusion"
                          ]
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ]
        },
        {
          "name" : "Observation",
          "typeMode" : "none",
          "input" : [
            {
              "name" : "cda",
              "type" : "observation",
              "mode" : "source"
            },
            {
              "name" : "patient",
              "type" : "Patient",
              "mode" : "target"
            },
            {
              "name" : "encounter",
              "type" : "Encounter",
              "mode" : "target"
            },
            {
              "name" : "ob",
              "type" : "Observation",
              "mode" : "target"
            },
            {
              "name" : "bundle",
              "type" : "Bundle",
              "mode" : "target"
            }
          ],
          "rule" : [
            {
              "name" : "reference",
              "source" : [
                {
                  "context" : "cda"
                }
              ],
              "target" : [
                {
                  "context" : "ob",
                  "contextType" : "variable",
                  "element" : "subject",
                  "variable" : "reference",
                  "transform" : "create",
                  "parameter" : [
                    {
                      "valueString" : "Reference"
                    }
                  ]
                },
                {
                  "context" : "reference",
                  "contextType" : "variable",
                  "element" : "reference",
                  "transform" : "evaluate",
                  "parameter" : [
                    {
                      "valueString" : "'https://example/Patient/' + %patient.id"
                    }
                  ]
                }
              ]
            },
            {
              "name" : "reference",
              "source" : [
                {
                  "context" : "cda"
                }
              ],
              "target" : [
                {
                  "context" : "ob",
                  "contextType" : "variable",
                  "element" : "encounter",
                  "variable" : "reference",
                  "transform" : "create",
                  "parameter" : [
                    {
                      "valueString" : "Reference"
                    }
                  ]
                },
                {
                  "context" : "reference",
                  "contextType" : "variable",
                  "element" : "reference",
                  "transform" : "evaluate",
                  "parameter" : [
                    {
                      "valueString" : "'https://example/Encounter/' + %encounter.id"
                    }
                  ]
                }
              ]
            },
            {
              "name" : "code",
              "source" : [
                {
                  "context" : "cda",
                  "element" : "code",
                  "variable" : "vvv"
                }
              ],
              "target" : [
                {
                  "context" : "ob",
                  "contextType" : "variable",
                  "element" : "code",
                  "variable" : "vvv",
                  "transform" : "create"
                }
              ]
            },
            {
              "name" : "Stats",
              "source" : [
                {
                  "context" : "cda"
                }
              ],
              "target" : [
                {
                  "context" : "ob",
                  "contextType" : "variable",
                  "element" : "status",
                  "transform" : "copy",
                  "parameter" : [
                    {
                      "valueString" : "final"
                    }
                  ]
                }
              ]
            },
            {
              "name" : "value",
              "source" : [
                {
                  "context" : "cda",
                  "type" : "ST",
                  "element" : "value",
                  "variable" : "st"
                }
              ],
              "target" : [
                {
                  "context" : "ob",
                  "contextType" : "variable",
                  "element" : "value",
                  "transform" : "create",
                  "parameter" : [
                    {
                      "valueString" : "string"
                    }
                  ]
                },
                {
                  "context" : "ob",
                  "contextType" : "variable",
                  "element" : "value",
                  "transform" : "evaluate",
                  "parameter" : [
                    {
                      "valueString" : "st.dataString"
                    }
                  ]
                }
              ],
              "documentation" : "value datatype"
            },
            {
              "name" : "boolean",
              "source" : [
                {
                  "context" : "cda",
                  "type" : "BL",
                  "element" : "value",
                  "variable" : "boolean"
                }
              ],
              "target" : [
                {
                  "context" : "ob",
                  "contextType" : "variable",
                  "element" : "value",
                  "transform" : "evaluate",
                  "parameter" : [
                    {
                      "valueString" : "boolean.value"
                    }
                  ]
                }
              ]
            },
            {
              "name" : "value",
              "source" : [
                {
                  "context" : "cda",
                  "type" : "INT",
                  "element" : "value",
                  "variable" : "int"
                }
              ],
              "target" : [
                {
                  "context" : "ob",
                  "contextType" : "variable",
                  "element" : "value",
                  "transform" : "evaluate",
                  "parameter" : [
                    {
                      "valueString" : "int.value"
                    }
                  ]
                }
              ]
            },
            {
              "name" : "val",
              "source" : [
                {
                  "context" : "cda",
                  "type" : "CE",
                  "element" : "value",
                  "variable" : "val"
                }
              ],
              "rule" : [
                {
                  "name" : "coding",
                  "source" : [
                    {
                      "context" : "val"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "ob",
                      "contextType" : "variable",
                      "element" : "value",
                      "variable" : "ce",
                      "transform" : "create",
                      "parameter" : [
                        {
                          "valueString" : "CodeableConcept"
                        }
                      ]
                    }
                  ],
                  "rule" : [
                    {
                      "name" : "originalText",
                      "source" : [
                        {
                          "context" : "val",
                          "element" : "originalText",
                          "variable" : "originalText"
                        }
                      ],
                      "rule" : [
                        {
                          "name" : "reference",
                          "source" : [
                            {
                              "context" : "originalText",
                              "element" : "reference",
                              "variable" : "reference"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "ce",
                              "contextType" : "variable",
                              "element" : "text",
                              "transform" : "evaluate",
                              "parameter" : [
                                {
                                  "valueString" : "reference.value"
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "name" : "code",
                      "source" : [
                        {
                          "context" : "val"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "ce",
                          "contextType" : "variable",
                          "element" : "coding",
                          "variable" : "coding"
                        }
                      ],
                      "rule" : [
                        {
                          "name" : "code",
                          "source" : [
                            {
                              "context" : "val",
                              "element" : "code",
                              "variable" : "code"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "coding",
                              "contextType" : "variable",
                              "element" : "code",
                              "transform" : "cast",
                              "parameter" : [
                                {
                                  "valueId" : "code"
                                },
                                {
                                  "valueString" : "string"
                                }
                              ]
                            }
                          ]
                        },
                        {
                          "name" : "codeSystem",
                          "source" : [
                            {
                              "context" : "val",
                              "element" : "codeSystem",
                              "variable" : "system"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "coding",
                              "contextType" : "variable",
                              "element" : "system",
                              "transform" : "translate",
                              "parameter" : [
                                {
                                  "valueId" : "system"
                                },
                                {
                                  "valueString" : "http://hl7.org/fhir/ConceptMap/special-oid2uri"
                                },
                                {
                                  "valueString" : "uri"
                                }
                              ]
                            }
                          ]
                        },
                        {
                          "name" : "displayName",
                          "source" : [
                            {
                              "context" : "val",
                              "element" : "displayName",
                              "variable" : "display"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "coding",
                              "contextType" : "variable",
                              "element" : "display",
                              "transform" : "cast",
                              "parameter" : [
                                {
                                  "valueId" : "display"
                                },
                                {
                                  "valueString" : "string"
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "name" : "translation",
                      "source" : [
                        {
                          "context" : "val",
                          "element" : "translation",
                          "variable" : "translation"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "ce",
                          "contextType" : "variable",
                          "element" : "coding",
                          "variable" : "coding"
                        }
                      ],
                      "rule" : [
                        {
                          "name" : "code",
                          "source" : [
                            {
                              "context" : "translation",
                              "element" : "code",
                              "variable" : "code"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "coding",
                              "contextType" : "variable",
                              "element" : "code",
                              "transform" : "cast",
                              "parameter" : [
                                {
                                  "valueId" : "code"
                                },
                                {
                                  "valueString" : "string"
                                }
                              ]
                            }
                          ]
                        },
                        {
                          "name" : "codeSystem",
                          "source" : [
                            {
                              "context" : "translation",
                              "element" : "codeSystem",
                              "variable" : "system"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "coding",
                              "contextType" : "variable",
                              "element" : "system",
                              "transform" : "translate",
                              "parameter" : [
                                {
                                  "valueId" : "system"
                                },
                                {
                                  "valueString" : "http://hl7.org/fhir/ConceptMap/special-oid2uri"
                                },
                                {
                                  "valueString" : "uri"
                                }
                              ]
                            }
                          ]
                        },
                        {
                          "name" : "displayName",
                          "source" : [
                            {
                              "context" : "translation",
                              "element" : "displayName",
                              "variable" : "display"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "coding",
                              "contextType" : "variable",
                              "element" : "display",
                              "transform" : "cast",
                              "parameter" : [
                                {
                                  "valueId" : "display"
                                },
                                {
                                  "valueString" : "string"
                                }
                              ]
                            }
                          ]
                        },
                        {
                          "name" : "qualifier",
                          "source" : [
                            {
                              "context" : "translation",
                              "element" : "qualifier",
                              "variable" : "qualifier"
                            }
                          ],
                          "rule" : [
                            {
                              "name" : "value",
                              "source" : [
                                {
                                  "context" : "qualifier",
                                  "element" : "value",
                                  "variable" : "value"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "ce",
                                  "contextType" : "variable",
                                  "element" : "coding",
                                  "variable" : "coding"
                                }
                              ],
                              "rule" : [
                                {
                                  "name" : "code",
                                  "source" : [
                                    {
                                      "context" : "value",
                                      "element" : "code",
                                      "variable" : "code"
                                    }
                                  ],
                                  "target" : [
                                    {
                                      "context" : "coding",
                                      "contextType" : "variable",
                                      "element" : "code",
                                      "transform" : "cast",
                                      "parameter" : [
                                        {
                                          "valueId" : "code"
                                        },
                                        {
                                          "valueString" : "string"
                                        }
                                      ]
                                    }
                                  ]
                                },
                                {
                                  "name" : "codeSystem",
                                  "source" : [
                                    {
                                      "context" : "value",
                                      "element" : "codeSystem",
                                      "variable" : "system"
                                    }
                                  ],
                                  "target" : [
                                    {
                                      "context" : "coding",
                                      "contextType" : "variable",
                                      "element" : "system",
                                      "transform" : "translate",
                                      "parameter" : [
                                        {
                                          "valueId" : "system"
                                        },
                                        {
                                          "valueString" : "http://hl7.org/fhir/ConceptMap/special-oid2uri"
                                        },
                                        {
                                          "valueString" : "uri"
                                        }
                                      ]
                                    }
                                  ]
                                },
                                {
                                  "name" : "displayName",
                                  "source" : [
                                    {
                                      "context" : "value",
                                      "element" : "displayName",
                                      "variable" : "display"
                                    }
                                  ],
                                  "target" : [
                                    {
                                      "context" : "coding",
                                      "contextType" : "variable",
                                      "element" : "display",
                                      "transform" : "cast",
                                      "parameter" : [
                                        {
                                          "valueId" : "display"
                                        },
                                        {
                                          "valueString" : "string"
                                        }
                                      ]
                                    }
                                  ]
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "name" : "val",
              "source" : [
                {
                  "context" : "cda",
                  "type" : "CD",
                  "element" : "value",
                  "variable" : "val"
                }
              ],
              "rule" : [
                {
                  "name" : "coding",
                  "source" : [
                    {
                      "context" : "val"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "ob",
                      "contextType" : "variable",
                      "element" : "value",
                      "variable" : "ce",
                      "transform" : "create",
                      "parameter" : [
                        {
                          "valueString" : "CodeableConcept"
                        }
                      ]
                    }
                  ],
                  "rule" : [
                    {
                      "name" : "originalText",
                      "source" : [
                        {
                          "context" : "val",
                          "element" : "originalText",
                          "variable" : "originalText"
                        }
                      ],
                      "rule" : [
                        {
                          "name" : "reference",
                          "source" : [
                            {
                              "context" : "originalText",
                              "element" : "reference",
                              "variable" : "reference"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "ce",
                              "contextType" : "variable",
                              "element" : "text",
                              "transform" : "evaluate",
                              "parameter" : [
                                {
                                  "valueString" : "reference.value"
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "name" : "code",
                      "source" : [
                        {
                          "context" : "val"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "ce",
                          "contextType" : "variable",
                          "element" : "coding",
                          "variable" : "coding"
                        }
                      ],
                      "rule" : [
                        {
                          "name" : "code",
                          "source" : [
                            {
                              "context" : "val",
                              "element" : "code",
                              "variable" : "code"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "coding",
                              "contextType" : "variable",
                              "element" : "code",
                              "transform" : "cast",
                              "parameter" : [
                                {
                                  "valueId" : "code"
                                },
                                {
                                  "valueString" : "string"
                                }
                              ]
                            }
                          ]
                        },
                        {
                          "name" : "codeSystem",
                          "source" : [
                            {
                              "context" : "val",
                              "element" : "codeSystem",
                              "variable" : "system"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "coding",
                              "contextType" : "variable",
                              "element" : "system",
                              "transform" : "translate",
                              "parameter" : [
                                {
                                  "valueId" : "system"
                                },
                                {
                                  "valueString" : "http://hl7.org/fhir/ConceptMap/special-oid2uri"
                                },
                                {
                                  "valueString" : "uri"
                                }
                              ]
                            }
                          ]
                        },
                        {
                          "name" : "displayName",
                          "source" : [
                            {
                              "context" : "val",
                              "element" : "displayName",
                              "variable" : "display"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "coding",
                              "contextType" : "variable",
                              "element" : "display",
                              "transform" : "cast",
                              "parameter" : [
                                {
                                  "valueId" : "display"
                                },
                                {
                                  "valueString" : "string"
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "name" : "translation",
                      "source" : [
                        {
                          "context" : "val",
                          "element" : "translation",
                          "variable" : "translation"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "ce",
                          "contextType" : "variable",
                          "element" : "coding",
                          "variable" : "coding"
                        }
                      ],
                      "rule" : [
                        {
                          "name" : "code",
                          "source" : [
                            {
                              "context" : "translation",
                              "element" : "code",
                              "variable" : "code"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "coding",
                              "contextType" : "variable",
                              "element" : "code",
                              "transform" : "cast",
                              "parameter" : [
                                {
                                  "valueId" : "code"
                                },
                                {
                                  "valueString" : "string"
                                }
                              ]
                            }
                          ]
                        },
                        {
                          "name" : "codeSystem",
                          "source" : [
                            {
                              "context" : "translation",
                              "element" : "codeSystem",
                              "variable" : "system"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "coding",
                              "contextType" : "variable",
                              "element" : "system",
                              "transform" : "translate",
                              "parameter" : [
                                {
                                  "valueId" : "system"
                                },
                                {
                                  "valueString" : "http://hl7.org/fhir/ConceptMap/special-oid2uri"
                                },
                                {
                                  "valueString" : "uri"
                                }
                              ]
                            }
                          ]
                        },
                        {
                          "name" : "displayName",
                          "source" : [
                            {
                              "context" : "translation",
                              "element" : "displayName",
                              "variable" : "display"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "coding",
                              "contextType" : "variable",
                              "element" : "display",
                              "transform" : "cast",
                              "parameter" : [
                                {
                                  "valueId" : "display"
                                },
                                {
                                  "valueString" : "string"
                                }
                              ]
                            }
                          ]
                        },
                        {
                          "name" : "qualifier",
                          "source" : [
                            {
                              "context" : "translation",
                              "element" : "qualifier",
                              "variable" : "qualifier"
                            }
                          ],
                          "rule" : [
                            {
                              "name" : "value",
                              "source" : [
                                {
                                  "context" : "qualifier",
                                  "element" : "value",
                                  "variable" : "value"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "ce",
                                  "contextType" : "variable",
                                  "element" : "coding",
                                  "variable" : "coding"
                                }
                              ],
                              "rule" : [
                                {
                                  "name" : "code",
                                  "source" : [
                                    {
                                      "context" : "value",
                                      "element" : "code",
                                      "variable" : "code"
                                    }
                                  ],
                                  "target" : [
                                    {
                                      "context" : "coding",
                                      "contextType" : "variable",
                                      "element" : "code",
                                      "transform" : "cast",
                                      "parameter" : [
                                        {
                                          "valueId" : "code"
                                        },
                                        {
                                          "valueString" : "string"
                                        }
                                      ]
                                    }
                                  ]
                                },
                                {
                                  "name" : "codeSystem",
                                  "source" : [
                                    {
                                      "context" : "value",
                                      "element" : "codeSystem",
                                      "variable" : "system"
                                    }
                                  ],
                                  "target" : [
                                    {
                                      "context" : "coding",
                                      "contextType" : "variable",
                                      "element" : "system",
                                      "transform" : "translate",
                                      "parameter" : [
                                        {
                                          "valueId" : "system"
                                        },
                                        {
                                          "valueString" : "http://hl7.org/fhir/ConceptMap/special-oid2uri"
                                        },
                                        {
                                          "valueString" : "uri"
                                        }
                                      ]
                                    }
                                  ]
                                },
                                {
                                  "name" : "displayName",
                                  "source" : [
                                    {
                                      "context" : "value",
                                      "element" : "displayName",
                                      "variable" : "display"
                                    }
                                  ],
                                  "target" : [
                                    {
                                      "context" : "coding",
                                      "contextType" : "variable",
                                      "element" : "display",
                                      "transform" : "cast",
                                      "parameter" : [
                                        {
                                          "valueId" : "display"
                                        },
                                        {
                                          "valueString" : "string"
                                        }
                                      ]
                                    }
                                  ]
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "name" : "valueQuantity",
              "source" : [
                {
                  "context" : "cda",
                  "type" : "PQ",
                  "element" : "value",
                  "variable" : "val"
                }
              ],
              "rule" : [
                {
                  "name" : "quantity",
                  "source" : [
                    {
                      "context" : "val"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "ob",
                      "contextType" : "variable",
                      "element" : "value",
                      "variable" : "quantity",
                      "transform" : "create",
                      "parameter" : [
                        {
                          "valueString" : "Quantity"
                        }
                      ]
                    }
                  ],
                  "rule" : [
                    {
                      "name" : "value",
                      "source" : [
                        {
                          "context" : "val",
                          "element" : "value",
                          "variable" : "value"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "quantity",
                          "contextType" : "variable",
                          "element" : "value",
                          "transform" : "copy",
                          "parameter" : [
                            {
                              "valueId" : "value"
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "name" : "unit",
                      "source" : [
                        {
                          "context" : "val",
                          "element" : "unit",
                          "variable" : "unit"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "quantity",
                          "contextType" : "variable",
                          "element" : "unit",
                          "transform" : "copy",
                          "parameter" : [
                            {
                              "valueId" : "unit"
                            }
                          ]
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "name" : "value1",
              "source" : [
                {
                  "context" : "cda",
                  "element" : "effectiveTime",
                  "variable" : "effectiveTime"
                }
              ],
              "target" : [
                {
                  "context" : "ob",
                  "contextType" : "variable",
                  "element" : "effective",
                  "variable" : "value",
                  "transform" : "create",
                  "parameter" : [
                    {
                      "valueString" : "dateTime"
                    }
                  ]
                }
              ],
              "dependent" : [
                {
                  "name" : "TSDateTime",
                  "variable" : [
                    "effectiveTime",
                    "value"
                  ]
                }
              ]
            },
            {
              "name" : "where",
              "source" : [
                {
                  "context" : "cda",
                  "element" : "effectiveTime",
                  "variable" : "effectiveTime",
                  "condition" : "effectiveTime.low.exists() or effectiveTime.high.exists()"
                }
              ],
              "rule" : [
                {
                  "name" : "value3",
                  "source" : [
                    {
                      "context" : "cda",
                      "element" : "effectiveTime",
                      "variable" : "eff"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "ob",
                      "contextType" : "variable",
                      "element" : "effective",
                      "variable" : "period",
                      "transform" : "create",
                      "parameter" : [
                        {
                          "valueString" : "Period"
                        }
                      ]
                    }
                  ],
                  "dependent" : [
                    {
                      "name" : "IVLTSPeriod",
                      "variable" : [
                        "effectiveTime",
                        "period"
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "name" : "note",
              "source" : [
                {
                  "context" : "cda",
                  "element" : "text",
                  "variable" : "text"
                }
              ],
              "target" : [
                {
                  "context" : "ob",
                  "contextType" : "variable",
                  "element" : "note",
                  "variable" : "note"
                }
              ],
              "rule" : [
                {
                  "name" : "text",
                  "source" : [
                    {
                      "context" : "text",
                      "element" : "reference",
                      "variable" : "reference"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "note",
                      "contextType" : "variable",
                      "element" : "text",
                      "transform" : "evaluate",
                      "parameter" : [
                        {
                          "valueString" : "reference.value"
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "name" : "status",
              "source" : [
                {
                  "context" : "cda",
                  "element" : "statusCode",
                  "variable" : "s"
                }
              ],
              "rule" : [
                {
                  "name" : "codeS",
                  "source" : [
                    {
                      "context" : "s",
                      "element" : "code",
                      "variable" : "cos"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "ob",
                      "contextType" : "variable",
                      "element" : "status",
                      "transform" : "translate",
                      "parameter" : [
                        {
                          "valueId" : "cos"
                        },
                        {
                          "valueString" : "#OBSstatus"
                        },
                        {
                          "valueString" : "code"
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ]
        },
        {
          "name" : "ImagingStudy",
          "typeMode" : "none",
          "input" : [
            {
              "name" : "src",
              "type" : "act",
              "mode" : "source"
            },
            {
              "name" : "section",
              "type" : "section",
              "mode" : "source"
            },
            {
              "name" : "tgt",
              "type" : "ImagingStudy",
              "mode" : "target"
            },
            {
              "name" : "patient",
              "type" : "Patient",
              "mode" : "target"
            },
            {
              "name" : "encounter",
              "type" : "Encounter",
              "mode" : "target"
            }
          ],
          "rule" : [
            {
              "name" : "id",
              "source" : [
                {
                  "context" : "src",
                  "element" : "id",
                  "variable" : "vvv"
                }
              ],
              "target" : [
                {
                  "context" : "tgt",
                  "contextType" : "variable",
                  "element" : "identifier",
                  "variable" : "vvv",
                  "transform" : "create"
                }
              ]
            },
            {
              "name" : "reference",
              "source" : [
                {
                  "context" : "src"
                }
              ],
              "target" : [
                {
                  "context" : "tgt",
                  "contextType" : "variable",
                  "element" : "subject",
                  "variable" : "reference",
                  "transform" : "create",
                  "parameter" : [
                    {
                      "valueString" : "Reference"
                    }
                  ]
                },
                {
                  "context" : "reference",
                  "contextType" : "variable",
                  "element" : "reference",
                  "transform" : "evaluate",
                  "parameter" : [
                    {
                      "valueString" : "'https://example/Patient/' + %patient.id"
                    }
                  ]
                }
              ]
            },
            {
              "name" : "reference",
              "source" : [
                {
                  "context" : "src"
                }
              ],
              "target" : [
                {
                  "context" : "tgt",
                  "contextType" : "variable",
                  "element" : "encounter",
                  "variable" : "reference",
                  "transform" : "create",
                  "parameter" : [
                    {
                      "valueString" : "Reference"
                    }
                  ]
                },
                {
                  "context" : "reference",
                  "contextType" : "variable",
                  "element" : "reference",
                  "transform" : "evaluate",
                  "parameter" : [
                    {
                      "valueString" : "'https://example/Encounter/' + %encounter.id"
                    }
                  ]
                }
              ]
            },
            {
              "name" : "status",
              "source" : [
                {
                  "context" : "src"
                }
              ],
              "target" : [
                {
                  "context" : "tgt",
                  "contextType" : "variable",
                  "element" : "status",
                  "transform" : "copy",
                  "parameter" : [
                    {
                      "valueString" : "available"
                    }
                  ]
                }
              ]
            },
            {
              "name" : "entryRelationship",
              "source" : [
                {
                  "context" : "src",
                  "element" : "entryRelationship",
                  "variable" : "entryRelationship"
                }
              ],
              "rule" : [
                {
                  "name" : "series",
                  "source" : [
                    {
                      "context" : "entryRelationship",
                      "element" : "act",
                      "variable" : "act"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "tgt",
                      "contextType" : "variable",
                      "element" : "series",
                      "variable" : "series"
                    }
                  ],
                  "rule" : [
                    {
                      "name" : "id",
                      "source" : [
                        {
                          "context" : "act",
                          "element" : "id",
                          "variable" : "id"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "series",
                          "contextType" : "variable",
                          "element" : "uid",
                          "transform" : "evaluate",
                          "parameter" : [
                            {
                              "valueString" : "id.root"
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "name" : "modality",
                      "source" : [
                        {
                          "context" : "section",
                          "element" : "code",
                          "variable" : "code"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "series",
                          "contextType" : "variable",
                          "element" : "modality",
                          "variable" : "coding",
                          "transform" : "create",
                          "parameter" : [
                            {
                              "valueString" : "Coding"
                            }
                          ]
                        }
                      ],
                      "rule" : [
                        {
                          "name" : "code",
                          "source" : [
                            {
                              "context" : "code",
                              "element" : "code",
                              "variable" : "code1"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "coding",
                              "contextType" : "variable",
                              "element" : "code",
                              "transform" : "cast",
                              "parameter" : [
                                {
                                  "valueId" : "code1"
                                },
                                {
                                  "valueString" : "string"
                                }
                              ]
                            }
                          ]
                        },
                        {
                          "name" : "codeSystem",
                          "source" : [
                            {
                              "context" : "code",
                              "element" : "codeSystem",
                              "variable" : "system"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "coding",
                              "contextType" : "variable",
                              "element" : "system",
                              "transform" : "translate",
                              "parameter" : [
                                {
                                  "valueId" : "system"
                                },
                                {
                                  "valueString" : "http://hl7.org/fhir/ConceptMap/special-oid2uri"
                                },
                                {
                                  "valueString" : "uri"
                                }
                              ]
                            }
                          ]
                        },
                        {
                          "name" : "displayName",
                          "source" : [
                            {
                              "context" : "code",
                              "element" : "displayName",
                              "variable" : "display"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "coding",
                              "contextType" : "variable",
                              "element" : "display",
                              "transform" : "cast",
                              "parameter" : [
                                {
                                  "valueId" : "display"
                                },
                                {
                                  "valueString" : "string"
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "name" : "instance",
                      "source" : [
                        {
                          "context" : "act",
                          "element" : "entryRelationship",
                          "variable" : "entryRelationship2"
                        }
                      ],
                      "rule" : [
                        {
                          "name" : "idRoot",
                          "source" : [
                            {
                              "context" : "entryRelationship2",
                              "element" : "observation",
                              "variable" : "obs"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "series",
                              "contextType" : "variable",
                              "element" : "instance",
                              "variable" : "instance"
                            }
                          ],
                          "rule" : [
                            {
                              "name" : "root",
                              "source" : [
                                {
                                  "context" : "obs",
                                  "element" : "id",
                                  "variable" : "id"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "instance",
                                  "contextType" : "variable",
                                  "element" : "uid",
                                  "transform" : "evaluate",
                                  "parameter" : [
                                    {
                                      "valueString" : "id.root"
                                    }
                                  ]
                                }
                              ]
                            },
                            {
                              "name" : "sopClass",
                              "source" : [
                                {
                                  "context" : "obs",
                                  "element" : "code",
                                  "variable" : "code1"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "instance",
                                  "contextType" : "variable",
                                  "element" : "sopClass",
                                  "variable" : "coding",
                                  "transform" : "create",
                                  "parameter" : [
                                    {
                                      "valueString" : "Coding"
                                    }
                                  ]
                                }
                              ],
                              "rule" : [
                                {
                                  "name" : "code",
                                  "source" : [
                                    {
                                      "context" : "code1",
                                      "element" : "code",
                                      "variable" : "code"
                                    }
                                  ],
                                  "target" : [
                                    {
                                      "context" : "coding",
                                      "contextType" : "variable",
                                      "element" : "code",
                                      "transform" : "cast",
                                      "parameter" : [
                                        {
                                          "valueId" : "code"
                                        },
                                        {
                                          "valueString" : "string"
                                        }
                                      ]
                                    }
                                  ]
                                },
                                {
                                  "name" : "codeSystem",
                                  "source" : [
                                    {
                                      "context" : "code1",
                                      "element" : "codeSystem",
                                      "variable" : "system"
                                    }
                                  ],
                                  "target" : [
                                    {
                                      "context" : "coding",
                                      "contextType" : "variable",
                                      "element" : "system",
                                      "transform" : "translate",
                                      "parameter" : [
                                        {
                                          "valueId" : "system"
                                        },
                                        {
                                          "valueString" : "http://hl7.org/fhir/ConceptMap/special-oid2uri"
                                        },
                                        {
                                          "valueString" : "uri"
                                        }
                                      ]
                                    }
                                  ]
                                },
                                {
                                  "name" : "displayName",
                                  "source" : [
                                    {
                                      "context" : "code1",
                                      "element" : "displayName",
                                      "variable" : "display"
                                    }
                                  ],
                                  "target" : [
                                    {
                                      "context" : "coding",
                                      "contextType" : "variable",
                                      "element" : "display",
                                      "transform" : "cast",
                                      "parameter" : [
                                        {
                                          "valueId" : "display"
                                        },
                                        {
                                          "valueString" : "string"
                                        }
                                      ]
                                    }
                                  ]
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ]
        },
        {
          "name" : "ConditionFunction",
          "typeMode" : "none",
          "input" : [
            {
              "name" : "src",
              "type" : "cdaElement",
              "mode" : "source"
            },
            {
              "name" : "tgt",
              "type" : "Condition",
              "mode" : "target"
            },
            {
              "name" : "patient",
              "type" : "Patient",
              "mode" : "target"
            },
            {
              "name" : "encounter",
              "type" : "Encounter",
              "mode" : "target"
            },
            {
              "name" : "bundle",
              "type" : "Bundle",
              "mode" : "target"
            }
          ],
          "rule" : [
            {
              "name" : "code",
              "source" : [
                {
                  "context" : "src",
                  "element" : "code",
                  "variable" : "vvv"
                }
              ],
              "target" : [
                {
                  "context" : "tgt",
                  "contextType" : "variable",
                  "element" : "category",
                  "variable" : "vvv",
                  "transform" : "create"
                }
              ]
            },
            {
              "name" : "reference",
              "source" : [
                {
                  "context" : "src"
                }
              ],
              "target" : [
                {
                  "context" : "tgt",
                  "contextType" : "variable",
                  "element" : "subject",
                  "variable" : "reference",
                  "transform" : "create",
                  "parameter" : [
                    {
                      "valueString" : "Reference"
                    }
                  ]
                },
                {
                  "context" : "reference",
                  "contextType" : "variable",
                  "element" : "reference",
                  "transform" : "evaluate",
                  "parameter" : [
                    {
                      "valueString" : "'https://example/Patient/' + %patient.id"
                    }
                  ]
                }
              ]
            },
            {
              "name" : "reference",
              "source" : [
                {
                  "context" : "src"
                }
              ],
              "target" : [
                {
                  "context" : "tgt",
                  "contextType" : "variable",
                  "element" : "encounter",
                  "variable" : "reference",
                  "transform" : "create",
                  "parameter" : [
                    {
                      "valueString" : "Reference"
                    }
                  ]
                },
                {
                  "context" : "reference",
                  "contextType" : "variable",
                  "element" : "reference",
                  "transform" : "evaluate",
                  "parameter" : [
                    {
                      "valueString" : "'https://example/Encounter/' + %encounter.id"
                    }
                  ]
                }
              ]
            },
            {
              "name" : "verifstatus",
              "source" : [
                {
                  "context" : "src",
                  "element" : "statusCode",
                  "variable" : "stscode"
                }
              ],
              "target" : [
                {
                  "context" : "tgt",
                  "contextType" : "variable",
                  "element" : "verificationStatus",
                  "variable" : "verifstatus"
                }
              ],
              "rule" : [
                {
                  "name" : "coding",
                  "source" : [
                    {
                      "context" : "stscode",
                      "variable" : "codeS"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "verifstatus",
                      "contextType" : "variable",
                      "element" : "coding",
                      "variable" : "coding",
                      "transform" : "create",
                      "parameter" : [
                        {
                          "valueString" : "Coding"
                        }
                      ]
                    }
                  ],
                  "rule" : [
                    {
                      "name" : "code",
                      "source" : [
                        {
                          "context" : "codeS",
                          "element" : "code"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "coding",
                          "contextType" : "variable",
                          "element" : "code",
                          "transform" : "copy",
                          "parameter" : [
                            {
                              "valueString" : "confirmed"
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "name" : "system",
                      "source" : [
                        {
                          "context" : "codeS"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "coding",
                          "contextType" : "variable",
                          "element" : "system",
                          "transform" : "copy",
                          "parameter" : [
                            {
                              "valueString" : "http://terminology.hl7.org/CodeSystem/condition-ver-status"
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "name" : "display",
                      "source" : [
                        {
                          "context" : "codeS"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "coding",
                          "contextType" : "variable",
                          "element" : "display",
                          "transform" : "cast",
                          "parameter" : [
                            {
                              "valueString" : "Confirmed"
                            },
                            {
                              "valueString" : "string"
                            }
                          ]
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "name" : "where",
              "source" : [
                {
                  "context" : "src",
                  "condition" : "effectiveTime.low.exists() or effectiveTime.high.exists()"
                }
              ],
              "rule" : [
                {
                  "name" : "valuePeriod",
                  "source" : [
                    {
                      "context" : "src",
                      "element" : "effectiveTime",
                      "variable" : "effectiveTime"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "tgt",
                      "contextType" : "variable",
                      "element" : "onset",
                      "variable" : "period",
                      "transform" : "create",
                      "parameter" : [
                        {
                          "valueString" : "Period"
                        }
                      ]
                    }
                  ],
                  "dependent" : [
                    {
                      "name" : "IVLTSPeriod",
                      "variable" : [
                        "effectiveTime",
                        "period"
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "name" : "value2",
              "source" : [
                {
                  "context" : "src",
                  "element" : "effectiveTime",
                  "variable" : "effectiveTime"
                }
              ],
              "target" : [
                {
                  "context" : "tgt",
                  "contextType" : "variable",
                  "element" : "onset",
                  "variable" : "dateTime",
                  "transform" : "create",
                  "parameter" : [
                    {
                      "valueString" : "dateTime"
                    }
                  ]
                }
              ],
              "dependent" : [
                {
                  "name" : "TSDateTime",
                  "variable" : [
                    "effectiveTime",
                    "dateTime"
                  ]
                }
              ]
            },
            {
              "name" : "value",
              "source" : [
                {
                  "context" : "src",
                  "element" : "value",
                  "variable" : "vvv"
                }
              ],
              "target" : [
                {
                  "context" : "tgt",
                  "contextType" : "variable",
                  "element" : "code",
                  "variable" : "vvv",
                  "transform" : "create"
                }
              ]
            },
            {
              "name" : "entryR",
              "source" : [
                {
                  "context" : "src",
                  "element" : "entryRelationship",
                  "variable" : "entryRelationship"
                }
              ],
              "rule" : [
                {
                  "name" : "EntryRelObsevation",
                  "source" : [
                    {
                      "context" : "entryRelationship",
                      "element" : "observation",
                      "variable" : "obsentry"
                    }
                  ],
                  "rule" : [
                    {
                      "name" : "observation",
                      "source" : [
                        {
                          "context" : "obsentry",
                          "element" : "code",
                          "condition" : "code = '89261-2'"
                        }
                      ],
                      "rule" : [
                        {
                          "name" : "observation",
                          "source" : [
                            {
                              "context" : "obsentry"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "tgt",
                              "contextType" : "variable",
                              "element" : "evidence",
                              "variable" : "evidence"
                            },
                            {
                              "context" : "bundle",
                              "contextType" : "variable",
                              "element" : "entry",
                              "variable" : "e1"
                            },
                            {
                              "context" : "e1",
                              "contextType" : "variable",
                              "element" : "request",
                              "variable" : "request",
                              "transform" : "create",
                              "parameter" : [
                                {
                                  "valueString" : "BackboneElement"
                                }
                              ]
                            },
                            {
                              "context" : "request",
                              "contextType" : "variable",
                              "element" : "method",
                              "transform" : "copy",
                              "parameter" : [
                                {
                                  "valueString" : "POST"
                                }
                              ]
                            },
                            {
                              "context" : "e1",
                              "contextType" : "variable",
                              "element" : "resource",
                              "variable" : "obsy",
                              "transform" : "create",
                              "parameter" : [
                                {
                                  "valueString" : "Observation"
                                }
                              ]
                            },
                            {
                              "context" : "obsy",
                              "contextType" : "variable",
                              "element" : "id",
                              "variable" : "uuid1",
                              "transform" : "uuid"
                            },
                            {
                              "context" : "e1",
                              "contextType" : "variable",
                              "element" : "fullUrl",
                              "transform" : "append",
                              "parameter" : [
                                {
                                  "valueString" : "https://example/Observation/"
                                },
                                {
                                  "valueId" : "uuid1"
                                }
                              ]
                            },
                            {
                              "context" : "request",
                              "contextType" : "variable",
                              "element" : "url",
                              "transform" : "copy",
                              "parameter" : [
                                {
                                  "valueString" : "Observation"
                                }
                              ]
                            },
                            {
                              "context" : "evidence",
                              "contextType" : "variable",
                              "element" : "detail",
                              "variable" : "reference",
                              "transform" : "create",
                              "parameter" : [
                                {
                                  "valueString" : "Reference"
                                }
                              ]
                            },
                            {
                              "context" : "reference",
                              "contextType" : "variable",
                              "element" : "reference",
                              "transform" : "evaluate",
                              "parameter" : [
                                {
                                  "valueString" : "'https://example/Observation/' + %obsy.id"
                                }
                              ]
                            }
                          ],
                          "dependent" : [
                            {
                              "name" : "Observation",
                              "variable" : [
                                "obsentry",
                                "patient",
                                "encounter",
                                "obsy",
                                "bundle"
                              ]
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "name" : "clinicalStatus2",
                      "source" : [
                        {
                          "context" : "obsentry",
                          "element" : "code",
                          "condition" : "code = '33999-4'"
                        }
                      ],
                      "rule" : [
                        {
                          "name" : "clinicalstatus",
                          "source" : [
                            {
                              "context" : "obsentry",
                              "element" : "value",
                              "variable" : "value"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "tgt",
                              "contextType" : "variable",
                              "element" : "clinicalStatus",
                              "variable" : "clinicalstatus"
                            }
                          ],
                          "rule" : [
                            {
                              "name" : "coding",
                              "source" : [
                                {
                                  "context" : "value",
                                  "variable" : "val"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "clinicalstatus",
                                  "contextType" : "variable",
                                  "element" : "coding",
                                  "variable" : "coding",
                                  "transform" : "create",
                                  "parameter" : [
                                    {
                                      "valueString" : "Coding"
                                    }
                                  ]
                                }
                              ],
                              "rule" : [
                                {
                                  "name" : "code",
                                  "source" : [
                                    {
                                      "context" : "val",
                                      "condition" : "(code = 'LA9041-0')"
                                    }
                                  ],
                                  "target" : [
                                    {
                                      "context" : "coding",
                                      "contextType" : "variable",
                                      "element" : "code",
                                      "transform" : "copy",
                                      "parameter" : [
                                        {
                                          "valueString" : "resolved"
                                        }
                                      ]
                                    }
                                  ]
                                },
                                {
                                  "name" : "code",
                                  "source" : [
                                    {
                                      "context" : "val",
                                      "condition" : "(code = 'LA18632-2')"
                                    }
                                  ],
                                  "target" : [
                                    {
                                      "context" : "coding",
                                      "contextType" : "variable",
                                      "element" : "code",
                                      "transform" : "copy",
                                      "parameter" : [
                                        {
                                          "valueString" : "inactive"
                                        }
                                      ]
                                    }
                                  ]
                                },
                                {
                                  "name" : "code",
                                  "source" : [
                                    {
                                      "context" : "val",
                                      "condition" : "(code = 'LA16666-2')"
                                    }
                                  ],
                                  "target" : [
                                    {
                                      "context" : "coding",
                                      "contextType" : "variable",
                                      "element" : "code",
                                      "transform" : "copy",
                                      "parameter" : [
                                        {
                                          "valueString" : "active"
                                        }
                                      ]
                                    }
                                  ]
                                },
                                {
                                  "name" : "system",
                                  "source" : [
                                    {
                                      "context" : "val"
                                    }
                                  ],
                                  "target" : [
                                    {
                                      "context" : "coding",
                                      "contextType" : "variable",
                                      "element" : "system",
                                      "transform" : "copy",
                                      "parameter" : [
                                        {
                                          "valueString" : "http://terminology.hl7.org/CodeSystem/condition-clinical"
                                        }
                                      ]
                                    }
                                  ]
                                },
                                {
                                  "name" : "display",
                                  "source" : [
                                    {
                                      "context" : "val",
                                      "element" : "displayName",
                                      "variable" : "display"
                                    }
                                  ],
                                  "target" : [
                                    {
                                      "context" : "coding",
                                      "contextType" : "variable",
                                      "element" : "display",
                                      "transform" : "cast",
                                      "parameter" : [
                                        {
                                          "valueId" : "display"
                                        },
                                        {
                                          "valueString" : "string"
                                        }
                                      ]
                                    }
                                  ]
                                }
                              ]
                            },
                            {
                              "name" : "text",
                              "source" : [
                                {
                                  "context" : "obsentry",
                                  "element" : "text",
                                  "variable" : "text"
                                }
                              ],
                              "rule" : [
                                {
                                  "name" : "text",
                                  "source" : [
                                    {
                                      "context" : "text",
                                      "element" : "reference",
                                      "variable" : "reference"
                                    }
                                  ],
                                  "target" : [
                                    {
                                      "context" : "clinicalstatus",
                                      "contextType" : "variable",
                                      "element" : "text",
                                      "transform" : "evaluate",
                                      "parameter" : [
                                        {
                                          "valueString" : "reference.value"
                                        }
                                      ]
                                    }
                                  ]
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ]
        },
        {
          "name" : "allergyFunction",
          "typeMode" : "none",
          "input" : [
            {
              "name" : "src",
              "type" : "cdaElement",
              "mode" : "source"
            },
            {
              "name" : "tgt",
              "type" : "AllergyIntolerance",
              "mode" : "target"
            },
            {
              "name" : "patient",
              "type" : "Patient",
              "mode" : "target"
            },
            {
              "name" : "encounter",
              "type" : "Encounter",
              "mode" : "target"
            }
          ],
          "rule" : [
            {
              "name" : "reference",
              "source" : [
                {
                  "context" : "src"
                }
              ],
              "target" : [
                {
                  "context" : "tgt",
                  "contextType" : "variable",
                  "element" : "patient",
                  "variable" : "reference",
                  "transform" : "create",
                  "parameter" : [
                    {
                      "valueString" : "Reference"
                    }
                  ]
                },
                {
                  "context" : "reference",
                  "contextType" : "variable",
                  "element" : "reference",
                  "transform" : "evaluate",
                  "parameter" : [
                    {
                      "valueString" : "'https://example/Patient/' + %patient.id"
                    }
                  ]
                }
              ]
            },
            {
              "name" : "reference",
              "source" : [
                {
                  "context" : "src"
                }
              ],
              "target" : [
                {
                  "context" : "tgt",
                  "contextType" : "variable",
                  "element" : "encounter",
                  "variable" : "reference",
                  "transform" : "create",
                  "parameter" : [
                    {
                      "valueString" : "Reference"
                    }
                  ]
                },
                {
                  "context" : "reference",
                  "contextType" : "variable",
                  "element" : "reference",
                  "transform" : "evaluate",
                  "parameter" : [
                    {
                      "valueString" : "'https://example/Encounter/' + %encounter.id"
                    }
                  ]
                }
              ]
            },
            {
              "name" : "entryrelationship",
              "source" : [
                {
                  "context" : "src",
                  "element" : "entryRelationship",
                  "variable" : "entryRelationship1"
                }
              ],
              "rule" : [
                {
                  "name" : "observation",
                  "source" : [
                    {
                      "context" : "entryRelationship1",
                      "element" : "observation",
                      "variable" : "observation1"
                    }
                  ],
                  "rule" : [
                    {
                      "name" : "where",
                      "source" : [
                        {
                          "context" : "observation1",
                          "condition" : "effectiveTime.low.exists() or effectiveTime.high.exists()"
                        }
                      ],
                      "rule" : [
                        {
                          "name" : "valuePeriod",
                          "source" : [
                            {
                              "context" : "observation1",
                              "element" : "effectiveTime",
                              "variable" : "effectiveTime"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "tgt",
                              "contextType" : "variable",
                              "element" : "onset",
                              "variable" : "period",
                              "transform" : "create",
                              "parameter" : [
                                {
                                  "valueString" : "Period"
                                }
                              ]
                            }
                          ],
                          "dependent" : [
                            {
                              "name" : "IVLTSPeriod",
                              "variable" : [
                                "effectiveTime",
                                "period"
                              ]
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "name" : "value2",
                      "source" : [
                        {
                          "context" : "observation1",
                          "element" : "effectiveTime",
                          "variable" : "effectiveTime"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "tgt",
                          "contextType" : "variable",
                          "element" : "onset",
                          "variable" : "dateTime",
                          "transform" : "create",
                          "parameter" : [
                            {
                              "valueString" : "dateTime"
                            }
                          ]
                        }
                      ],
                      "dependent" : [
                        {
                          "name" : "TSDateTime",
                          "variable" : [
                            "effectiveTime",
                            "dateTime"
                          ]
                        }
                      ]
                    },
                    {
                      "name" : "code",
                      "source" : [
                        {
                          "context" : "observation1",
                          "element" : "value",
                          "variable" : "code"
                        }
                      ],
                      "rule" : [
                        {
                          "name" : "type",
                          "source" : [
                            {
                              "context" : "code",
                              "element" : "code",
                              "variable" : "code1"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "tgt",
                              "contextType" : "variable",
                              "element" : "type",
                              "transform" : "translate",
                              "parameter" : [
                                {
                                  "valueId" : "code1"
                                },
                                {
                                  "valueString" : "#AllergyTypeMap"
                                },
                                {
                                  "valueString" : "code"
                                }
                              ]
                            }
                          ]
                        },
                        {
                          "name" : "category",
                          "source" : [
                            {
                              "context" : "code",
                              "element" : "code",
                              "variable" : "code1"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "tgt",
                              "contextType" : "variable",
                              "element" : "category",
                              "transform" : "translate",
                              "parameter" : [
                                {
                                  "valueId" : "code1"
                                },
                                {
                                  "valueString" : "#AllergyCategoryMap"
                                },
                                {
                                  "valueString" : "code"
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "name" : "participant",
                      "source" : [
                        {
                          "context" : "observation1",
                          "element" : "participant",
                          "variable" : "participant"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "tgt",
                          "contextType" : "variable",
                          "element" : "reaction",
                          "variable" : "reaction"
                        }
                      ],
                      "rule" : [
                        {
                          "name" : "entryR2",
                          "source" : [
                            {
                              "context" : "observation1",
                              "element" : "entryRelationship",
                              "variable" : "entryRelationship2",
                              "condition" : "(typeCode = 'MFST')"
                            }
                          ],
                          "rule" : [
                            {
                              "name" : "observ2",
                              "source" : [
                                {
                                  "context" : "entryRelationship2",
                                  "element" : "observation",
                                  "variable" : "observation2"
                                }
                              ],
                              "rule" : [
                                {
                                  "name" : "manifestation",
                                  "source" : [
                                    {
                                      "context" : "observation2",
                                      "element" : "value",
                                      "variable" : "vvv"
                                    }
                                  ],
                                  "target" : [
                                    {
                                      "context" : "reaction",
                                      "contextType" : "variable",
                                      "element" : "manifestation",
                                      "variable" : "vvv",
                                      "transform" : "create"
                                    }
                                  ]
                                },
                                {
                                  "name" : "low",
                                  "source" : [
                                    {
                                      "context" : "observation2",
                                      "element" : "effectiveTime",
                                      "variable" : "effectiveTime"
                                    }
                                  ],
                                  "rule" : [
                                    {
                                      "name" : "valuePeriodLow",
                                      "source" : [
                                        {
                                          "context" : "effectiveTime",
                                          "element" : "low",
                                          "variable" : "low"
                                        }
                                      ],
                                      "target" : [
                                        {
                                          "context" : "reaction",
                                          "contextType" : "variable",
                                          "element" : "onset",
                                          "variable" : "value",
                                          "transform" : "create",
                                          "parameter" : [
                                            {
                                              "valueString" : "dateTime"
                                            }
                                          ]
                                        }
                                      ],
                                      "dependent" : [
                                        {
                                          "name" : "TSDateTime",
                                          "variable" : [
                                            "low",
                                            "value"
                                          ]
                                        }
                                      ]
                                    }
                                  ]
                                }
                              ]
                            }
                          ]
                        },
                        {
                          "name" : "participantRole",
                          "source" : [
                            {
                              "context" : "participant",
                              "element" : "participantRole",
                              "variable" : "participantRole"
                            }
                          ],
                          "rule" : [
                            {
                              "name" : "playingEntity",
                              "source" : [
                                {
                                  "context" : "participantRole",
                                  "element" : "playingEntity",
                                  "variable" : "playingEntity"
                                }
                              ],
                              "rule" : [
                                {
                                  "name" : "reaction",
                                  "source" : [
                                    {
                                      "context" : "playingEntity",
                                      "element" : "code",
                                      "variable" : "vvv"
                                    }
                                  ],
                                  "target" : [
                                    {
                                      "context" : "reaction",
                                      "contextType" : "variable",
                                      "element" : "substance",
                                      "variable" : "vvv",
                                      "transform" : "create"
                                    }
                                  ]
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "name" : "entryR2",
                      "source" : [
                        {
                          "context" : "observation1",
                          "element" : "entryRelationship",
                          "variable" : "entryRelationship2",
                          "condition" : "(typeCode = 'MFST')"
                        }
                      ],
                      "rule" : [
                        {
                          "name" : "observ2",
                          "source" : [
                            {
                              "context" : "entryRelationship2",
                              "element" : "observation",
                              "variable" : "observation2",
                              "condition" : "observation1.participant.exists().not()"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "tgt",
                              "contextType" : "variable",
                              "element" : "reaction",
                              "variable" : "reaction"
                            }
                          ],
                          "rule" : [
                            {
                              "name" : "manifestation",
                              "source" : [
                                {
                                  "context" : "observation2",
                                  "element" : "value",
                                  "variable" : "vvv"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "reaction",
                                  "contextType" : "variable",
                                  "element" : "manifestation",
                                  "variable" : "vvv",
                                  "transform" : "create"
                                }
                              ]
                            },
                            {
                              "name" : "low",
                              "source" : [
                                {
                                  "context" : "observation2",
                                  "element" : "effectiveTime",
                                  "variable" : "effectiveTime"
                                }
                              ],
                              "rule" : [
                                {
                                  "name" : "valuePeriodLow",
                                  "source" : [
                                    {
                                      "context" : "effectiveTime",
                                      "element" : "low",
                                      "variable" : "low"
                                    }
                                  ],
                                  "target" : [
                                    {
                                      "context" : "reaction",
                                      "contextType" : "variable",
                                      "element" : "onset",
                                      "variable" : "value",
                                      "transform" : "create",
                                      "parameter" : [
                                        {
                                          "valueString" : "dateTime"
                                        }
                                      ]
                                    }
                                  ],
                                  "dependent" : [
                                    {
                                      "name" : "TSDateTime",
                                      "variable" : [
                                        "low",
                                        "value"
                                      ]
                                    }
                                  ]
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "name" : "entryR3",
                      "source" : [
                        {
                          "context" : "observation1",
                          "element" : "entryRelationship",
                          "variable" : "entryRelationship3",
                          "condition" : "(typeCode = 'SUBJ')"
                        }
                      ],
                      "rule" : [
                        {
                          "name" : "observ3",
                          "source" : [
                            {
                              "context" : "entryRelationship3",
                              "element" : "observation",
                              "variable" : "observation3"
                            }
                          ],
                          "rule" : [
                            {
                              "name" : "criticality",
                              "source" : [
                                {
                                  "context" : "observation3",
                                  "element" : "value",
                                  "variable" : "value"
                                }
                              ],
                              "rule" : [
                                {
                                  "name" : "value",
                                  "source" : [
                                    {
                                      "context" : "value",
                                      "element" : "code",
                                      "variable" : "c"
                                    }
                                  ],
                                  "target" : [
                                    {
                                      "context" : "tgt",
                                      "contextType" : "variable",
                                      "element" : "criticality",
                                      "transform" : "translate",
                                      "parameter" : [
                                        {
                                          "valueId" : "c"
                                        },
                                        {
                                          "valueString" : "#CricalityMap"
                                        },
                                        {
                                          "valueString" : "code"
                                        }
                                      ]
                                    }
                                  ]
                                }
                              ],
                              "documentation" : "criticality"
                            }
                          ]
                        },
                        {
                          "name" : "act",
                          "source" : [
                            {
                              "context" : "entryRelationship3",
                              "element" : "act",
                              "variable" : "act"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "tgt",
                              "contextType" : "variable",
                              "element" : "note",
                              "variable" : "note"
                            }
                          ],
                          "rule" : [
                            {
                              "name" : "note",
                              "source" : [
                                {
                                  "context" : "act",
                                  "element" : "text",
                                  "variable" : "text"
                                }
                              ],
                              "rule" : [
                                {
                                  "name" : "reference",
                                  "source" : [
                                    {
                                      "context" : "text",
                                      "element" : "reference",
                                      "variable" : "reference"
                                    }
                                  ],
                                  "target" : [
                                    {
                                      "context" : "note",
                                      "contextType" : "variable",
                                      "element" : "text",
                                      "transform" : "evaluate",
                                      "parameter" : [
                                        {
                                          "valueString" : "reference.value"
                                        }
                                      ]
                                    }
                                  ]
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "name" : "entryR4",
                      "source" : [
                        {
                          "context" : "observation1",
                          "element" : "entryRelationship",
                          "variable" : "entryRelationship4",
                          "condition" : "(typeCode = 'REFR')"
                        }
                      ],
                      "rule" : [
                        {
                          "name" : "observ4",
                          "source" : [
                            {
                              "context" : "entryRelationship4",
                              "element" : "observation",
                              "variable" : "observation4"
                            }
                          ],
                          "rule" : [
                            {
                              "name" : "clinicalStatus",
                              "source" : [
                                {
                                  "context" : "observation4",
                                  "element" : "value",
                                  "variable" : "value"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "tgt",
                                  "contextType" : "variable",
                                  "element" : "clinicalStatus",
                                  "variable" : "clinicalStatus"
                                }
                              ],
                              "rule" : [
                                {
                                  "name" : "coding",
                                  "source" : [
                                    {
                                      "context" : "value",
                                      "variable" : "valu"
                                    }
                                  ],
                                  "target" : [
                                    {
                                      "context" : "clinicalStatus",
                                      "contextType" : "variable",
                                      "element" : "coding",
                                      "variable" : "coding",
                                      "transform" : "create",
                                      "parameter" : [
                                        {
                                          "valueString" : "Coding"
                                        }
                                      ]
                                    }
                                  ],
                                  "rule" : [
                                    {
                                      "name" : "code",
                                      "source" : [
                                        {
                                          "context" : "valu",
                                          "condition" : "(code = 'LA9041-0')"
                                        }
                                      ],
                                      "target" : [
                                        {
                                          "context" : "coding",
                                          "contextType" : "variable",
                                          "element" : "code",
                                          "transform" : "copy",
                                          "parameter" : [
                                            {
                                              "valueString" : "resolved"
                                            }
                                          ]
                                        }
                                      ]
                                    },
                                    {
                                      "name" : "code",
                                      "source" : [
                                        {
                                          "context" : "valu",
                                          "condition" : "(code = 'LA18632-2')"
                                        }
                                      ],
                                      "target" : [
                                        {
                                          "context" : "coding",
                                          "contextType" : "variable",
                                          "element" : "code",
                                          "transform" : "copy",
                                          "parameter" : [
                                            {
                                              "valueString" : "inactive"
                                            }
                                          ]
                                        }
                                      ]
                                    },
                                    {
                                      "name" : "code",
                                      "source" : [
                                        {
                                          "context" : "valu",
                                          "condition" : "(code = 'LA16666-2')"
                                        }
                                      ],
                                      "target" : [
                                        {
                                          "context" : "coding",
                                          "contextType" : "variable",
                                          "element" : "code",
                                          "transform" : "copy",
                                          "parameter" : [
                                            {
                                              "valueString" : "active"
                                            }
                                          ]
                                        }
                                      ]
                                    },
                                    {
                                      "name" : "system",
                                      "source" : [
                                        {
                                          "context" : "valu"
                                        }
                                      ],
                                      "target" : [
                                        {
                                          "context" : "coding",
                                          "contextType" : "variable",
                                          "element" : "system",
                                          "transform" : "copy",
                                          "parameter" : [
                                            {
                                              "valueString" : "http://terminology.hl7.org/CodeSystem/allergyintolerance-clinical"
                                            }
                                          ]
                                        }
                                      ]
                                    },
                                    {
                                      "name" : "display",
                                      "source" : [
                                        {
                                          "context" : "valu",
                                          "element" : "displayName",
                                          "variable" : "display"
                                        }
                                      ],
                                      "target" : [
                                        {
                                          "context" : "coding",
                                          "contextType" : "variable",
                                          "element" : "display",
                                          "transform" : "cast",
                                          "parameter" : [
                                            {
                                              "valueId" : "display"
                                            },
                                            {
                                              "valueString" : "string"
                                            }
                                          ]
                                        }
                                      ]
                                    }
                                  ]
                                }
                              ],
                              "documentation" : "observation4.value -> tgt.clinicalStatus;"
                            }
                          ]
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ]
        },
        {
          "name" : "FamilyMemberFunction",
          "typeMode" : "none",
          "input" : [
            {
              "name" : "src",
              "type" : "organizer",
              "mode" : "source"
            },
            {
              "name" : "tgt",
              "type" : "FamilyMemberHistory",
              "mode" : "target"
            },
            {
              "name" : "patient",
              "type" : "Patient",
              "mode" : "target"
            }
          ],
          "rule" : [
            {
              "name" : "patReference",
              "source" : [
                {
                  "context" : "src"
                }
              ],
              "target" : [
                {
                  "context" : "tgt",
                  "contextType" : "variable",
                  "element" : "patient",
                  "variable" : "reference",
                  "transform" : "create",
                  "parameter" : [
                    {
                      "valueString" : "Reference"
                    }
                  ]
                },
                {
                  "context" : "reference",
                  "contextType" : "variable",
                  "element" : "reference",
                  "transform" : "evaluate",
                  "parameter" : [
                    {
                      "valueString" : "'https://example/Patient/' + %patient.id"
                    }
                  ]
                }
              ]
            },
            {
              "name" : "statusCode",
              "source" : [
                {
                  "context" : "src",
                  "element" : "statusCode",
                  "variable" : "vvv"
                }
              ],
              "target" : [
                {
                  "context" : "tgt",
                  "contextType" : "variable",
                  "element" : "status",
                  "variable" : "vvv",
                  "transform" : "create"
                }
              ]
            },
            {
              "name" : "date",
              "source" : [
                {
                  "context" : "src",
                  "element" : "effectiveTime",
                  "variable" : "effectiveTime"
                }
              ],
              "target" : [
                {
                  "context" : "tgt",
                  "contextType" : "variable",
                  "element" : "date",
                  "variable" : "value",
                  "transform" : "create",
                  "parameter" : [
                    {
                      "valueString" : "dateTime"
                    }
                  ]
                }
              ],
              "dependent" : [
                {
                  "name" : "TSDateTime",
                  "variable" : [
                    "effectiveTime",
                    "value"
                  ]
                }
              ]
            },
            {
              "name" : "relationship",
              "source" : [
                {
                  "context" : "src",
                  "element" : "subject",
                  "variable" : "subject"
                }
              ],
              "rule" : [
                {
                  "name" : "relatedSub",
                  "source" : [
                    {
                      "context" : "subject",
                      "element" : "relatedSubject",
                      "variable" : "relatedSubject"
                    }
                  ],
                  "rule" : [
                    {
                      "name" : "relationshipCode",
                      "source" : [
                        {
                          "context" : "relatedSubject",
                          "element" : "code",
                          "variable" : "vvv"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "tgt",
                          "contextType" : "variable",
                          "element" : "relationship",
                          "variable" : "vvv",
                          "transform" : "create"
                        }
                      ]
                    },
                    {
                      "name" : "subject",
                      "source" : [
                        {
                          "context" : "relatedSubject",
                          "element" : "subject",
                          "variable" : "subject"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "tgt",
                          "contextType" : "variable",
                          "element" : "sex",
                          "variable" : "sex"
                        }
                      ],
                      "rule" : [
                        {
                          "name" : "coding",
                          "source" : [
                            {
                              "context" : "subject",
                              "element" : "administrativeGenderCode",
                              "variable" : "administrativeGenderCode"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "sex",
                              "contextType" : "variable",
                              "element" : "coding",
                              "variable" : "coding"
                            }
                          ],
                          "rule" : [
                            {
                              "name" : "gender",
                              "source" : [
                                {
                                  "context" : "administrativeGenderCode",
                                  "element" : "code",
                                  "variable" : "sexCode"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "coding",
                                  "contextType" : "variable",
                                  "element" : "code",
                                  "transform" : "translate",
                                  "parameter" : [
                                    {
                                      "valueId" : "sexCode"
                                    },
                                    {
                                      "valueString" : "#cm-v3-administrative-gender"
                                    },
                                    {
                                      "valueString" : "code"
                                    }
                                  ]
                                }
                              ]
                            },
                            {
                              "name" : "system",
                              "source" : [
                                {
                                  "context" : "administrativeGenderCode",
                                  "element" : "system"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "coding",
                                  "contextType" : "variable",
                                  "element" : "system",
                                  "transform" : "copy",
                                  "parameter" : [
                                    {
                                      "valueString" : "http://hl7.org/fhir/administrative-gender"
                                    }
                                  ]
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "name" : "component",
              "source" : [
                {
                  "context" : "src",
                  "element" : "component",
                  "variable" : "component"
                }
              ],
              "target" : [
                {
                  "context" : "tgt",
                  "contextType" : "variable",
                  "element" : "condition",
                  "variable" : "condition"
                }
              ],
              "rule" : [
                {
                  "name" : "observation",
                  "source" : [
                    {
                      "context" : "component",
                      "element" : "observation",
                      "variable" : "observation"
                    }
                  ],
                  "rule" : [
                    {
                      "name" : "code",
                      "source" : [
                        {
                          "context" : "observation",
                          "element" : "code",
                          "variable" : "vvv"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "condition",
                          "contextType" : "variable",
                          "element" : "code",
                          "variable" : "vvv",
                          "transform" : "create"
                        }
                      ]
                    },
                    {
                      "name" : "reference",
                      "source" : [
                        {
                          "context" : "observation",
                          "element" : "text",
                          "variable" : "text"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "tgt",
                          "contextType" : "variable",
                          "element" : "note",
                          "variable" : "note"
                        }
                      ],
                      "rule" : [
                        {
                          "name" : "value",
                          "source" : [
                            {
                              "context" : "text",
                              "element" : "reference",
                              "variable" : "reference"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "note",
                              "contextType" : "variable",
                              "element" : "text",
                              "transform" : "evaluate",
                              "parameter" : [
                                {
                                  "valueString" : "reference.value"
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "name" : "statusCode",
                      "source" : [
                        {
                          "context" : "observation",
                          "element" : "statusCode",
                          "variable" : "vvv"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "tgt",
                          "contextType" : "variable",
                          "element" : "status",
                          "variable" : "vvv",
                          "transform" : "create"
                        }
                      ]
                    },
                    {
                      "name" : "cont",
                      "source" : [
                        {
                          "context" : "observation",
                          "condition" : "observation.effectiveTime.exists()"
                        }
                      ],
                      "rule" : [
                        {
                          "name" : "effttemp",
                          "source" : [
                            {
                              "context" : "observation",
                              "element" : "effectiveTime",
                              "variable" : "effectiveTime"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "tgt",
                              "contextType" : "variable",
                              "element" : "condition",
                              "variable" : "condition",
                              "transform" : "create",
                              "parameter" : [
                                {
                                  "valueString" : "BackboneElement"
                                }
                              ]
                            }
                          ],
                          "rule" : [
                            {
                              "name" : "code",
                              "source" : [
                                {
                                  "context" : "observation",
                                  "element" : "code",
                                  "variable" : "vvv"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "condition",
                                  "contextType" : "variable",
                                  "element" : "code",
                                  "variable" : "vvv",
                                  "transform" : "create"
                                }
                              ]
                            },
                            {
                              "name" : "codeable",
                              "source" : [
                                {
                                  "context" : "observation",
                                  "element" : "value",
                                  "variable" : "vvv"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "condition",
                                  "contextType" : "variable",
                                  "element" : "outcome",
                                  "variable" : "vvv",
                                  "transform" : "create"
                                }
                              ]
                            },
                            {
                              "name" : "efft",
                              "source" : [
                                {
                                  "context" : "effectiveTime"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "condition",
                                  "contextType" : "variable",
                                  "element" : "onset",
                                  "variable" : "period",
                                  "transform" : "create",
                                  "parameter" : [
                                    {
                                      "valueString" : "Period"
                                    }
                                  ]
                                }
                              ],
                              "rule" : [
                                {
                                  "name" : "val",
                                  "source" : [
                                    {
                                      "context" : "effectiveTime"
                                    }
                                  ],
                                  "target" : [
                                    {
                                      "context" : "period",
                                      "contextType" : "variable",
                                      "element" : "start",
                                      "variable" : "start",
                                      "transform" : "create",
                                      "parameter" : [
                                        {
                                          "valueString" : "dateTime"
                                        }
                                      ]
                                    }
                                  ],
                                  "dependent" : [
                                    {
                                      "name" : "TSDateTime",
                                      "variable" : [
                                        "effectiveTime",
                                        "start"
                                      ]
                                    }
                                  ]
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "name" : "codeable",
                      "source" : [
                        {
                          "context" : "observation",
                          "element" : "value",
                          "variable" : "vvv"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "condition",
                          "contextType" : "variable",
                          "element" : "outcome",
                          "variable" : "vvv",
                          "transform" : "create"
                        }
                      ]
                    },
                    {
                      "name" : "EntryRel",
                      "source" : [
                        {
                          "context" : "observation",
                          "element" : "entryRelationship",
                          "variable" : "entryR"
                        }
                      ],
                      "rule" : [
                        {
                          "name" : "obser",
                          "source" : [
                            {
                              "context" : "entryR",
                              "element" : "observation",
                              "variable" : "obs"
                            }
                          ],
                          "rule" : [
                            {
                              "name" : "insorgenza",
                              "source" : [
                                {
                                  "context" : "obs",
                                  "condition" : "(code.code = '35267-4')"
                                }
                              ],
                              "rule" : [
                                {
                                  "name" : "value",
                                  "source" : [
                                    {
                                      "context" : "obs",
                                      "element" : "value",
                                      "variable" : "value"
                                    }
                                  ],
                                  "target" : [
                                    {
                                      "context" : "condition",
                                      "contextType" : "variable",
                                      "element" : "onset",
                                      "variable" : "Age",
                                      "transform" : "create",
                                      "parameter" : [
                                        {
                                          "valueString" : "Age"
                                        }
                                      ]
                                    }
                                  ],
                                  "rule" : [
                                    {
                                      "name" : "age",
                                      "source" : [
                                        {
                                          "context" : "value",
                                          "element" : "value",
                                          "variable" : "valueAge"
                                        }
                                      ],
                                      "target" : [
                                        {
                                          "context" : "Age",
                                          "contextType" : "variable",
                                          "element" : "value",
                                          "transform" : "copy",
                                          "parameter" : [
                                            {
                                              "valueId" : "valueAge"
                                            }
                                          ]
                                        }
                                      ]
                                    },
                                    {
                                      "name" : "unit",
                                      "source" : [
                                        {
                                          "context" : "value",
                                          "element" : "unit",
                                          "variable" : "unit"
                                        }
                                      ],
                                      "target" : [
                                        {
                                          "context" : "Age",
                                          "contextType" : "variable",
                                          "element" : "code",
                                          "transform" : "copy",
                                          "parameter" : [
                                            {
                                              "valueId" : "unit"
                                            }
                                          ]
                                        }
                                      ]
                                    },
                                    {
                                      "name" : "unit",
                                      "source" : [
                                        {
                                          "context" : "value",
                                          "element" : "unit",
                                          "variable" : "unit"
                                        }
                                      ],
                                      "target" : [
                                        {
                                          "context" : "Age",
                                          "contextType" : "variable",
                                          "element" : "unit",
                                          "transform" : "copy",
                                          "parameter" : [
                                            {
                                              "valueId" : "unit"
                                            }
                                          ]
                                        }
                                      ]
                                    },
                                    {
                                      "name" : "system",
                                      "source" : [
                                        {
                                          "context" : "value"
                                        }
                                      ],
                                      "target" : [
                                        {
                                          "context" : "Age",
                                          "contextType" : "variable",
                                          "element" : "system",
                                          "transform" : "copy",
                                          "parameter" : [
                                            {
                                              "valueString" : "http://unitsofmeasure.org"
                                            }
                                          ]
                                        }
                                      ]
                                    }
                                  ]
                                }
                              ]
                            },
                            {
                              "name" : "death",
                              "source" : [
                                {
                                  "context" : "obs",
                                  "condition" : "(code.code = '39016-1')"
                                }
                              ],
                              "rule" : [
                                {
                                  "name" : "value",
                                  "source" : [
                                    {
                                      "context" : "obs",
                                      "element" : "value",
                                      "variable" : "value"
                                    }
                                  ],
                                  "target" : [
                                    {
                                      "context" : "tgt",
                                      "contextType" : "variable",
                                      "element" : "deceased",
                                      "variable" : "Age",
                                      "transform" : "create",
                                      "parameter" : [
                                        {
                                          "valueString" : "Age"
                                        }
                                      ]
                                    }
                                  ],
                                  "rule" : [
                                    {
                                      "name" : "age",
                                      "source" : [
                                        {
                                          "context" : "value",
                                          "element" : "value",
                                          "variable" : "valueAge"
                                        }
                                      ],
                                      "target" : [
                                        {
                                          "context" : "Age",
                                          "contextType" : "variable",
                                          "element" : "value",
                                          "transform" : "copy",
                                          "parameter" : [
                                            {
                                              "valueId" : "valueAge"
                                            }
                                          ]
                                        }
                                      ]
                                    },
                                    {
                                      "name" : "unit",
                                      "source" : [
                                        {
                                          "context" : "value",
                                          "element" : "unit",
                                          "variable" : "unit"
                                        }
                                      ],
                                      "target" : [
                                        {
                                          "context" : "Age",
                                          "contextType" : "variable",
                                          "element" : "code",
                                          "transform" : "copy",
                                          "parameter" : [
                                            {
                                              "valueId" : "unit"
                                            }
                                          ]
                                        }
                                      ]
                                    },
                                    {
                                      "name" : "unit",
                                      "source" : [
                                        {
                                          "context" : "value",
                                          "element" : "unit",
                                          "variable" : "unit"
                                        }
                                      ],
                                      "target" : [
                                        {
                                          "context" : "Age",
                                          "contextType" : "variable",
                                          "element" : "unit",
                                          "transform" : "copy",
                                          "parameter" : [
                                            {
                                              "valueId" : "unit"
                                            }
                                          ]
                                        }
                                      ]
                                    },
                                    {
                                      "name" : "system",
                                      "source" : [
                                        {
                                          "context" : "value"
                                        }
                                      ],
                                      "target" : [
                                        {
                                          "context" : "Age",
                                          "contextType" : "variable",
                                          "element" : "system",
                                          "transform" : "copy",
                                          "parameter" : [
                                            {
                                              "valueString" : "http://unitsofmeasure.org"
                                            }
                                          ]
                                        }
                                      ]
                                    }
                                  ]
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ]
        }
      ]
    }