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

Draft as of 2025-10-01

Raw xml | Download

    <StructureMap xmlns="http://hl7.org/fhir">
      <id value="cda2fhirRadReport"/>
      <text>
        <status value="generated"/>
        <div xmlns="http://www.w3.org/1999/xhtml">
             <pre>map &quot;http://hl7.it/fhir/cda2fhir/StructureMap/cda2fhirRadReport&quot; = &quot;cda2fhirRadReport&quot;

    uses &quot;http://hl7.org/fhir/cda/StructureDefinition/ClinicalDocument&quot; alias ClinicalDocument as source
    uses &quot;http://hl7.org/fhir/cda/StructureDefinition/AssignedAuthor&quot; alias AssignedAuthor as queried
    uses &quot;http://hl7.org/fhir/cda/StructureDefinition/AssignedEntity&quot; alias AssignedEntity as queried
    uses &quot;http://hl7.org/fhir/cda/StructureDefinition/AssociatedEntity&quot; alias AssociatedEntity as queried
    uses &quot;http://hl7.org/fhir/cda/StructureDefinition/CustodianOrganization&quot; alias CustodianOrganization as queried
    uses &quot;http://hl7.org/fhir/cda/StructureDefinition/OrganizationPartOf&quot; alias OrganizationPartOf as queried
    uses &quot;http://hl7.org/fhir/cda/StructureDefinition/Organization&quot; alias rapresentedOrganization as queried
    uses &quot;http://hl7.org/fhir/cda/StructureDefinition/Section&quot; alias Section as queried
    uses &quot;http://hl7.org/fhir/cda/StructureDefinition/PatientRole&quot; alias PatientRole as queried
    uses &quot;http://hl7.org/fhir/cda/StructureDefinition/AD&quot; alias AD as source
    uses &quot;http://hl7.org/fhir/StructureDefinition/Bundle&quot; alias Bundle as target
    uses &quot;http://hl7.org/fhir/StructureDefinition/Composition&quot; alias Composition as produced
    uses &quot;http://hl7.org/fhir/StructureDefinition/Patient&quot; alias Patient as produced
    uses &quot;http://hl7.org/fhir/StructureDefinition/Encounter&quot; alias Encounter as produced
    uses &quot;http://hl7.org/fhir/StructureDefinition/Person&quot; alias Patient as produced
    uses &quot;http://hl7.org/fhir/StructureDefinition/List&quot; alias List as produced
    uses &quot;http://hl7.org/fhir/StructureDefinition/Practitioner&quot; alias Practitioner as produced
    uses &quot;http://hl7.org/fhir/StructureDefinition/Organization&quot; alias Organization as produced
    uses &quot;http://hl7.org/fhir/cda/StructureDefinition/Act&quot; alias Act as produced
    uses &quot;http://hl7.org/fhir/cda/StructureDefinition/IVL-PQ&quot; alias IVL_PQ as source
    uses &quot;http://hl7.org/fhir/cda/StructureDefinition/PQ&quot; alias PQ as source
    uses &quot;http://hl7.org/fhir/StructureDefinition/SimpleQuantity&quot; alias SimpleQuantity as target

    imports &quot;http://hl7.it/fhir/cda2fhir/StructureMap/cda2fhirDataTypes&quot;
    imports &quot;http://hl7.it/fhir/cda2fhir/StructureMap/cda2fhirHeader&quot;

    group CdaToBundle(source cda : ClinicalDocument, target bundle : Bundle) {
      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 {
        cda then ClinicalDocumentToBundle(cda, patient, composition, encounter, bundle, DocumentReference) &quot;cdatobundle&quot;;
        cda.recordTarget as recordTarget then {
          recordTarget.patientRole as patient then {
            patient.id as id -&gt; patient.identifier as identifier then {
              id.root as r -&gt; identifier.system = translate(r, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri') &quot;root1&quot;;
              id.extension as ext1 -&gt; identifier.value = ext1 &quot;value&quot;;
              id.assigningAuthorityName as s -&gt;  identifier.assigner as a,  a.display = s;
            } &quot;idfr&quot;;
            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 {
              id.extension as ext -&gt; requestPAT.url = append('Patient?identifier=', ext) &quot;UUID&quot;;
            } &quot;ext&quot;;
          } &quot;recPat&quot;;
        } &quot;patient&quot;;
      } &quot;ClinicalDocumentToBody&quot;;
    }

    group ClinicalDocumentToBundle(source cda : ClinicalDocument, target patient : Patient, target composition : Composition, target encounter : Encounter, target bundle : Bundle, target DocumentReference : DocumentReference) {
      cda -&gt; bundle.id = uuid() &quot;id&quot;;
      cda.id -&gt; bundle.identifier &quot;identifier&quot;;
      cda -&gt; bundle.type = 'transaction' &quot;type&quot;;
      cda -&gt; bundle.timestamp = (timestamp.now()) &quot;date&quot;;
      cda then ClinicalDocumentComposition(cda, composition, patient, encounter, bundle, DocumentReference) &quot;composition&quot;;
      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 {
        cda.code -&gt; diagnosticReport.code &quot;diagnosticCode&quot;;
        cda -&gt; diagnosticReport.status = 'registered' &quot;stats&quot;;
        cda.component as component then {
          component.structuredBody as body then {
            body.component as component then {
              component.section as srcSection then {
                srcSection.code -&gt; composition.section as tgtSection then ClinicalDocumentSection(cda, srcSection, patient, tgtSection, bundle, encounter, diagnosticReport);
              };
            };
          } &quot;body&quot;;
        };
      } &quot;diagnostic&quot;;
    }

    group ClinicalDocumentSection(source cda : ClinicalDocument, source src : Section, target patient : Patient, target tgt, target bundle : Bundle, target enc : Encounter, target dReport : DiagnosticReport) {
      src.title as t -&gt; tgt.title = (t.dataString);
      src.code -&gt; tgt.code;
      src -&gt;  tgt.entry = create('Reference') as reference,  reference.reference = ('https://example/DiagnosticReport/' + %dReport.id) &quot;reference&quot;;
      src.entry as entry then {
        src.text as cdaText -&gt; tgt.text as fhirText then {
          cdaText -&gt; fhirText.status = 'generated' &quot;narrativeStatus&quot;;
          cdaText as t -&gt; fhirText.div = t &quot;narrativeText&quot;;
        } &quot;cdaText&quot;;
        entry then DiagnosticReportFunction(src, entry, dReport, bundle, enc, patient) &quot;dreport&quot;;
      };
      src where src.entry.exists().not() then DiagnosticReportFunction(src, cda, dReport, bundle, enc, patient) &quot;narrative&quot;;
      src.component as component then {
        component.section as sec -&gt; tgt.section as tgtSection then ClinicalDocumentSection(cda, sec, patient, tgtSection, bundle, enc, dReport);
      };
    }

    group DiagnosticReportFunction(source section : section, source src : entry, target dReport : DiagnosticReport, target bundle : Bundle, target encounter : Encounter, target patient : Patient) {
      src.act as act1 then {
        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;;
        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 {
          section -&gt;  obs1.subject = create('Reference') as reference,  reference.reference = ('https://example/Patient/' + %patient.id) &quot;reference&quot;;
          section -&gt;  obs1.encounter = create('Reference') as reference,  reference.reference = ('https://example/Encounter/' + %encounter.id) &quot;reference&quot;;
          section -&gt; obs1.status = 'final' &quot;STatusobse&quot;;
          section.code -&gt; obs1.code;
          act1.statusCode as s then {
            s.code as cos -&gt; obs1.status = translate(cos, '#OBSstatus', 'code') &quot;codeS&quot;;
          } &quot;status&quot;;
          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 {
            section -&gt;  list1.subject = create('Reference') as reference,  reference.reference = ('https://example/Patient/' + %patient.id) &quot;reference&quot;;
            section -&gt; list1.status = 'current' &quot;listatus&quot;;
            section -&gt; list1.mode = 'working' &quot;lstmod&quot;;
            section -&gt;  list1.encounter = create('Reference') as reference,  reference.reference = ('https://example/Encounter/' + %encounter.id) &quot;reference&quot;;
            src -&gt; list1.entry as entryList1 then {
              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;;
            } &quot;item&quot;;
          } &quot;list&quot;;
        } &quot;allergyAct&quot;;
        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;;
      };
      src.observation as entryobs then {
        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 {
          section -&gt;  obs6.subject = create('Reference') as reference,  reference.reference = ('https://example/Patient/' + %patient.id) &quot;reference&quot;;
          section -&gt;  obs6.encounter = create('Reference') as reference,  reference.reference = ('https://example/Encounter/' + %encounter.id) &quot;reference&quot;;
          section -&gt; obs6.status = 'final' &quot;tatusobse&quot;;
          section.code -&gt; obs6.code;
          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;;
        } &quot;observationstclinica&quot;;
        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;;
        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;;
        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;;
      } &quot;entryObs&quot;;
      src.organizer as organizer then {
        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 {
          section -&gt;  obs10.subject = create('Reference') as reference,  reference.reference = ('https://example/Patient/' + %patient.id) &quot;reference&quot;;
          section -&gt;  obs10.encounter = create('Reference') as reference,  reference.reference = ('https://example/Encounter/' + %encounter.id) &quot;reference&quot;;
          section -&gt; obs10.status = 'final' &quot;tatusobse&quot;;
          section.code -&gt; obs10.code &quot;codeObs&quot;;
          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 {
            section -&gt;  list11.subject = create('Reference') as reference,  reference.reference = ('https://example/Patient/' + %patient.id) &quot;reference&quot;;
            section -&gt; list11.status = 'current' &quot;liststat&quot;;
            section -&gt; list11.mode = 'working' &quot;listmd&quot;;
            section -&gt;  list11.encounter = create('Reference') as reference,  reference.reference = ('https://example/Encounter/' + %encounter.id) &quot;reference&quot;;
            organizer -&gt; list11.entry as entryList2 then {
              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;;
            } &quot;org&quot;;
          } &quot;List&quot;;
        } &quot;entryOrganizer&quot;;
      };
      section where section.entry.exists().not() then {
        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 {
          section -&gt;  obs1.subject = create('Reference') as reference,  reference.reference = ('https://example/Patient/' + %patient.id) &quot;reference&quot;;
          section -&gt;  obs1.encounter = create('Reference') as reference,  reference.reference = ('https://example/Encounter/' + %encounter.id) &quot;reference&quot;;
          section -&gt; obs1.status = 'final' &quot;STatusobse&quot;;
          section.code -&gt; obs1.code;
          section.statusCode as s then {
            s.code as cos -&gt; obs1.status = translate(cos, '#OBSstatus', 'code') &quot;codeS&quot;;
          } &quot;status&quot;;
          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 {
            section -&gt;  allergy.patient = create('Reference') as reference,  reference.reference = ('https://example/Patient/' + %patient.id) &quot;reference&quot;;
            section -&gt;  allergy.encounter = create('Reference') as reference,  reference.reference = ('https://example/Encounter/' + %encounter.id) &quot;reference&quot;;
            section -&gt; allergy.clinicalStatus as clinicalStatus then {
              section -&gt; clinicalStatus.coding = create('Coding') as coding then {
                section -&gt; coding.code = 'active' &quot;code&quot;;
                section -&gt; coding.system = 'http://terminology.hl7.org/CodeSystem/allergyintolerance-clinical' &quot;system&quot;;
              } &quot;coding&quot;;
            } &quot;status&quot;;
            text -&gt; allergy.note as note then {
              text as t -&gt; note.text = create('string') as textNote then EDstring(t, textNote) &quot;note&quot;;
            } &quot;narrative&quot;;
          } &quot;allergytext&quot;;
        } &quot;allergyAct&quot;;
        section where (code.code = '55110-1').not() or (code.code = '11329-0').not() then {
          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 {
            section -&gt;  obs13.subject = create('Reference') as reference,  reference.reference = ('https://example/Patient/' + %patient.id) &quot;reference&quot;;
            section -&gt;  obs13.encounter = create('Reference') as reference,  reference.reference = ('https://example/Encounter/' + %encounter.id) &quot;reference&quot;;
            section -&gt; obs13.status = 'preliminary' &quot;obsst&quot;;
            section.code -&gt; obs13.code &quot;obscde&quot;;
            section -&gt; obs13.status = 'final' &quot;statusS&quot;;
            text -&gt; obs13.note as note then {
              text as t -&gt; note.text = create('string') as textNote then EDstring(t, textNote) &quot;note&quot;;
            } &quot;narrative&quot;;
          } &quot;txtsec&quot;;
        } &quot;NonConclusion&quot;;
        section where (code.code = '55110-1') then {
          section.text as t -&gt; dReport.conclusion = create('string') as textConclusion then EDstring(t, textConclusion) &quot;conc&quot;;
        } &quot;conclusion&quot;;
      } &quot;whereCond&quot;;
    }

    group Observation(source cda : observation, target patient : Patient, target encounter : Encounter, target ob : Observation, target bundle : Bundle) {
      cda -&gt;  ob.subject = create('Reference') as reference,  reference.reference = ('https://example/Patient/' + %patient.id) &quot;reference&quot;;
      cda -&gt;  ob.encounter = create('Reference') as reference,  reference.reference = ('https://example/Encounter/' + %encounter.id) &quot;reference&quot;;
      cda.code -&gt; ob.code;
      cda -&gt; ob.status = 'final' &quot;Stats&quot;;
      // value datatype
      cda.value : ST as st -&gt;  ob.value = create('string'),  ob.value = (st.dataString);
      cda.value : BL as boolean -&gt; ob.value = (boolean.value) &quot;boolean&quot;;
      cda.value : INT as int -&gt; ob.value = (int.value);
      cda.value : CE as val then {
        val -&gt; ob.value = create('CodeableConcept') as ce then {
          val.originalText as originalText then {
            originalText.reference as reference -&gt; ce.text = (reference.value);
          };
          val -&gt; ce.coding as coding then {
            val.code as code -&gt; coding.code = cast(code, 'string');
            val.codeSystem as system -&gt; coding.system = translate(system, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri');
            val.displayName as display -&gt; coding.display = cast(display, 'string');
          } &quot;code&quot;;
          val.translation as translation -&gt; ce.coding as coding then {
            translation.code as code -&gt; coding.code = cast(code, 'string');
            translation.codeSystem as system -&gt; coding.system = translate(system, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri');
            translation.displayName as display -&gt; coding.display = cast(display, 'string');
            translation.qualifier as qualifier then {
              qualifier.value as value -&gt; ce.coding as coding then {
                value.code as code -&gt; coding.code = cast(code, 'string');
                value.codeSystem as system -&gt; coding.system = translate(system, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri');
                value.displayName as display -&gt; coding.display = cast(display, 'string');
              };
            };
          };
        } &quot;coding&quot;;
      } &quot;val&quot;;
      cda.value : CD as val then {
        val -&gt; ob.value = create('CodeableConcept') as ce then {
          val.originalText as originalText then {
            originalText.reference as reference -&gt; ce.text = (reference.value);
          };
          val -&gt; ce.coding as coding then {
            val.code as code -&gt; coding.code = cast(code, 'string');
            val.codeSystem as system -&gt; coding.system = translate(system, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri');
            val.displayName as display -&gt; coding.display = cast(display, 'string');
          } &quot;code&quot;;
          val.translation as translation -&gt; ce.coding as coding then {
            translation.code as code -&gt; coding.code = cast(code, 'string');
            translation.codeSystem as system -&gt; coding.system = translate(system, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri');
            translation.displayName as display -&gt; coding.display = cast(display, 'string');
            translation.qualifier as qualifier then {
              qualifier.value as value -&gt; ce.coding as coding then {
                value.code as code -&gt; coding.code = cast(code, 'string');
                value.codeSystem as system -&gt; coding.system = translate(system, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri');
                value.displayName as display -&gt; coding.display = cast(display, 'string');
              };
            };
          };
        } &quot;coding&quot;;
      } &quot;val&quot;;
      cda.value : PQ as val then {
        val -&gt; ob.value = create('Quantity') as quantity then {
          val.value as value -&gt; quantity.value = value;
          val.unit as unit -&gt; quantity.unit = unit;
        } &quot;quantity&quot;;
      } &quot;valueQuantity&quot;;
      cda.effectiveTime as effectiveTime -&gt; ob.effective = create('dateTime') as value then TSDateTime(effectiveTime, value) &quot;value1&quot;;
      cda.effectiveTime as effectiveTime where effectiveTime.low.exists() or effectiveTime.high.exists() then {
        cda.effectiveTime as eff -&gt; ob.effective = create('Period') as period then IVLTSPeriod(effectiveTime, period) &quot;value3&quot;;
      } &quot;where&quot;;
      cda.text as text -&gt; ob.note as note then {
        text.reference as reference -&gt; note.text = (reference.value) &quot;text&quot;;
      } &quot;note&quot;;
      cda.statusCode as s then {
        s.code as cos -&gt; ob.status = translate(cos, '#OBSstatus', 'code') &quot;codeS&quot;;
      } &quot;status&quot;;
    }

    group ImagingStudy(source src : act, source section : section, target tgt : ImagingStudy, target patient : Patient, target encounter : Encounter) {
      src.id -&gt; tgt.identifier;
      src -&gt;  tgt.subject = create('Reference') as reference,  reference.reference = ('https://example/Patient/' + %patient.id) &quot;reference&quot;;
      src -&gt;  tgt.encounter = create('Reference') as reference,  reference.reference = ('https://example/Encounter/' + %encounter.id) &quot;reference&quot;;
      src -&gt; tgt.status = 'available' &quot;status&quot;;
      src.entryRelationship as entryRelationship then {
        entryRelationship.act as act -&gt; tgt.series as series then {
          act.id as id -&gt; series.uid = (id.root);
          section.code as code -&gt; series.modality = create('Coding') as coding then {
            code.code as code1 -&gt; coding.code = cast(code1, 'string');
            code.codeSystem as system -&gt; coding.system = translate(system, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri');
            code.displayName as display -&gt; coding.display = cast(display, 'string');
          } &quot;modality&quot;;
          act.entryRelationship as entryRelationship2 then {
            entryRelationship2.observation as obs -&gt; series.instance as instance then {
              obs.id as id -&gt; instance.uid = (id.root) &quot;root&quot;;
              obs.code as code1 -&gt; instance.sopClass = create('Coding') as coding then {
                code1.code as code -&gt; coding.code = cast(code, 'string');
                code1.codeSystem as system -&gt; coding.system = translate(system, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri');
                code1.displayName as display -&gt; coding.display = cast(display, 'string');
              } &quot;sopClass&quot;;
            } &quot;idRoot&quot;;
          } &quot;instance&quot;;
        } &quot;series&quot;;
      };
    }

    group ConditionFunction(source src : cdaElement, target tgt : Condition, target patient : Patient, target encounter : Encounter, target bundle : Bundle) {
      src.code -&gt; tgt.category;
      src -&gt;  tgt.subject = create('Reference') as reference,  reference.reference = ('https://example/Patient/' + %patient.id) &quot;reference&quot;;
      src -&gt;  tgt.encounter = create('Reference') as reference,  reference.reference = ('https://example/Encounter/' + %encounter.id) &quot;reference&quot;;
      src.statusCode as stscode -&gt; tgt.verificationStatus as verifstatus then {
        stscode as codeS -&gt; verifstatus.coding = create('Coding') as coding then {
          codeS.code -&gt; coding.code = 'confirmed';
          codeS -&gt; coding.system = 'http://terminology.hl7.org/CodeSystem/condition-ver-status' &quot;system&quot;;
          codeS -&gt; coding.display = cast('Confirmed', 'string') &quot;display&quot;;
        } &quot;coding&quot;;
      } &quot;verifstatus&quot;;
      src where effectiveTime.low.exists() or effectiveTime.high.exists() then {
        src.effectiveTime as effectiveTime -&gt; tgt.onset = create('Period') as period then IVLTSPeriod(effectiveTime, period) &quot;valuePeriod&quot;;
      } &quot;where&quot;;
      src.effectiveTime as effectiveTime -&gt; tgt.onset = create('dateTime') as dateTime then TSDateTime(effectiveTime, dateTime) &quot;value2&quot;;
      src.value -&gt; tgt.code;
      src.entryRelationship as entryRelationship then {
        entryRelationship.observation as obsentry then {
          obsentry.code where code = '89261-2' then {
            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;;
          } &quot;observation&quot;;
          obsentry.code where code = '33999-4' then {
            obsentry.value as value -&gt; tgt.clinicalStatus as clinicalstatus then {
              value as val -&gt; clinicalstatus.coding = create('Coding') as coding then {
                val where (code = 'LA9041-0') -&gt; coding.code = 'resolved' &quot;code&quot;;
                val where (code = 'LA18632-2') -&gt; coding.code = 'inactive' &quot;code&quot;;
                val where (code = 'LA16666-2') -&gt; coding.code = 'active' &quot;code&quot;;
                val -&gt; coding.system = 'http://terminology.hl7.org/CodeSystem/condition-clinical' &quot;system&quot;;
                val.displayName as display -&gt; coding.display = cast(display, 'string') &quot;display&quot;;
              } &quot;coding&quot;;
              obsentry.text as text then {
                text.reference as reference -&gt; clinicalstatus.text = (reference.value) &quot;text&quot;;
              };
            } &quot;clinicalstatus&quot;;
          } &quot;clinicalStatus2&quot;;
        } &quot;EntryRelObsevation&quot;;
      } &quot;entryR&quot;;
    }

    group allergyFunction(source src : cdaElement, target tgt : AllergyIntolerance, target patient : Patient, target encounter : Encounter) {
      src -&gt;  tgt.patient = create('Reference') as reference,  reference.reference = ('https://example/Patient/' + %patient.id) &quot;reference&quot;;
      src -&gt;  tgt.encounter = create('Reference') as reference,  reference.reference = ('https://example/Encounter/' + %encounter.id) &quot;reference&quot;;
      src.entryRelationship as entryRelationship1 then {
        entryRelationship1.observation as observation1 then {
          observation1 where effectiveTime.low.exists() or effectiveTime.high.exists() then {
            observation1.effectiveTime as effectiveTime -&gt; tgt.onset = create('Period') as period then IVLTSPeriod(effectiveTime, period) &quot;valuePeriod&quot;;
          } &quot;where&quot;;
          observation1.effectiveTime as effectiveTime -&gt; tgt.onset = create('dateTime') as dateTime then TSDateTime(effectiveTime, dateTime) &quot;value2&quot;;
          observation1.value as code then {
            code.code as code1 -&gt; tgt.type = translate(code1, '#AllergyTypeMap', 'code') &quot;type&quot;;
            code.code as code1 -&gt; tgt.category = translate(code1, '#AllergyCategoryMap', 'code') &quot;category&quot;;
          } &quot;code&quot;;
          observation1.participant as participant -&gt; tgt.reaction as reaction then {
            observation1.entryRelationship as entryRelationship2 where (typeCode = 'MFST') then {
              entryRelationship2.observation as observation2 then {
                observation2.value -&gt; reaction.manifestation &quot;manifestation&quot;;
                observation2.effectiveTime as effectiveTime then {
                  effectiveTime.low as low -&gt; reaction.onset = create('dateTime') as value then TSDateTime(low, value) &quot;valuePeriodLow&quot;;
                } &quot;low&quot;;
              } &quot;observ2&quot;;
            } &quot;entryR2&quot;;
            participant.participantRole as participantRole then {
              participantRole.playingEntity as playingEntity then {
                playingEntity.code -&gt; reaction.substance &quot;reaction&quot;;
              };
            };
          };
          observation1.entryRelationship as entryRelationship2 where (typeCode = 'MFST') then {
            entryRelationship2.observation as observation2 where observation1.participant.exists().not() -&gt; tgt.reaction as reaction then {
              observation2.value -&gt; reaction.manifestation &quot;manifestation&quot;;
              observation2.effectiveTime as effectiveTime then {
                effectiveTime.low as low -&gt; reaction.onset = create('dateTime') as value then TSDateTime(low, value) &quot;valuePeriodLow&quot;;
              } &quot;low&quot;;
            } &quot;observ2&quot;;
          } &quot;entryR2&quot;;
          observation1.entryRelationship as entryRelationship3 where (typeCode = 'SUBJ') then {
            entryRelationship3.observation as observation3 then {
              // criticality
              observation3.value as value then {
                value.code as c -&gt; tgt.criticality = translate(c, '#CricalityMap', 'code') &quot;value&quot;;
              } &quot;criticality&quot;;
            } &quot;observ3&quot;;
            entryRelationship3.act as act -&gt; tgt.note as note then {
              act.text as text then {
                text.reference as reference -&gt; note.text = (reference.value);
              } &quot;note&quot;;
            };
          } &quot;entryR3&quot;;
          observation1.entryRelationship as entryRelationship4 where (typeCode = 'REFR') then {
            entryRelationship4.observation as observation4 then {
              // observation4.value -&gt; tgt.clinicalStatus;
              observation4.value as value -&gt; tgt.clinicalStatus as clinicalStatus then {
                value as valu -&gt; clinicalStatus.coding = create('Coding') as coding then {
                  valu where (code = 'LA9041-0') -&gt; coding.code = 'resolved' &quot;code&quot;;
                  valu where (code = 'LA18632-2') -&gt; coding.code = 'inactive' &quot;code&quot;;
                  valu where (code = 'LA16666-2') -&gt; coding.code = 'active' &quot;code&quot;;
                  valu -&gt; coding.system = 'http://terminology.hl7.org/CodeSystem/allergyintolerance-clinical' &quot;system&quot;;
                  valu.displayName as display -&gt; coding.display = cast(display, 'string') &quot;display&quot;;
                } &quot;coding&quot;;
              } &quot;clinicalStatus&quot;;
            } &quot;observ4&quot;;
          } &quot;entryR4&quot;;
        };
      } &quot;entryrelationship&quot;;
    }

    group FamilyMemberFunction(source src : organizer, target tgt : FamilyMemberHistory, target patient : Patient) {
      src -&gt;  tgt.patient = create('Reference') as reference,  reference.reference = ('https://example/Patient/' + %patient.id) &quot;patReference&quot;;
      src.statusCode -&gt; tgt.status;
      src.effectiveTime as effectiveTime -&gt; tgt.date = create('dateTime') as value then TSDateTime(effectiveTime, value) &quot;date&quot;;
      src.subject as subject then {
        subject.relatedSubject as relatedSubject then {
          relatedSubject.code -&gt; tgt.relationship &quot;relationshipCode&quot;;
          relatedSubject.subject as subject -&gt; tgt.sex as sex then {
            subject.administrativeGenderCode as administrativeGenderCode -&gt; sex.coding as coding then {
              administrativeGenderCode.code as sexCode -&gt; coding.code = translate(sexCode, '#cm-v3-administrative-gender', 'code') &quot;gender&quot;;
              administrativeGenderCode.system -&gt; coding.system = 'http://hl7.org/fhir/administrative-gender';
            } &quot;coding&quot;;
          };
        } &quot;relatedSub&quot;;
      } &quot;relationship&quot;;
      src.component as component -&gt; tgt.condition as condition then {
        component.observation as observation then {
          observation.code -&gt; condition.code;
          observation.text as text -&gt; tgt.note as note then {
            text.reference as reference -&gt; note.text = (reference.value) &quot;value&quot;;
          } &quot;reference&quot;;
          observation.statusCode -&gt; tgt.status;
          observation where observation.effectiveTime.exists() then {
            observation.effectiveTime as effectiveTime -&gt; tgt.condition = create('BackboneElement') as condition then {
              observation.code -&gt; condition.code;
              observation.value -&gt; condition.outcome &quot;codeable&quot;;
              effectiveTime -&gt; condition.onset = create('Period') as period then {
                effectiveTime -&gt; period.start = create('dateTime') as start then TSDateTime(effectiveTime, start) &quot;val&quot;;
              } &quot;efft&quot;;
            } &quot;effttemp&quot;;
          } &quot;cont&quot;;
          observation.value -&gt; condition.outcome &quot;codeable&quot;;
          observation.entryRelationship as entryR then {
            entryR.observation as obs then {
              obs where (code.code = '35267-4') then {
                obs.value as value -&gt; condition.onset = create('Age') as Age then {
                  value.value as valueAge -&gt; Age.value = valueAge &quot;age&quot;;
                  value.unit as unit -&gt; Age.code = unit;
                  value.unit as unit -&gt; Age.unit = unit;
                  value -&gt; Age.system = 'http://unitsofmeasure.org' &quot;system&quot;;
                };
              } &quot;insorgenza&quot;;
              obs where (code.code = '39016-1') then {
                obs.value as value -&gt; tgt.deceased = create('Age') as Age then {
                  value.value as valueAge -&gt; Age.value = valueAge &quot;age&quot;;
                  value.unit as unit -&gt; Age.code = unit;
                  value.unit as unit -&gt; Age.unit = unit;
                  value -&gt; Age.system = 'http://unitsofmeasure.org' &quot;system&quot;;
                };
              } &quot;death&quot;;
            } &quot;obser&quot;;
          } &quot;EntryRel&quot;;
        };
      };
    }

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