CDA to FHIR Maps
0.1.0 - ci-build IT

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

: CDA to FHIR - LAB - XML Representation

Draft as of 2024-04-11

Raw xml | Download



<StructureMap xmlns="http://hl7.org/fhir">
  <id value="cda2fhirLabReport"/>
  <text>
    <status value="generated"/>
    <div xmlns="http://www.w3.org/1999/xhtml">
         <pre>map &quot;http://hl7.it/fhir/cda2fhir/StructureMap/cda2fhirLabReport&quot; = &quot;cda2fhirLabReport&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/Practitioner&quot; alias Practitioner as produced
uses &quot;http://hl7.org/fhir/StructureDefinition/Specimen&quot; alias Specimen as produced
uses &quot;http://hl7.org/fhir/StructureDefinition/Procedure&quot; alias Procedure 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
uses &quot;http://hl7.org/fhir/cda/StructureDefinition/Organizer&quot; alias Organizer as source

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 e6,  e6.request = create('BackboneElement') as request,  request.method = 'POST',  e6.resource = create('DocumentReference') as DocumentReference,  DocumentReference.id = uuid() as uuid6,  e6.fullUrl = append('https://example/DocumentReference/', uuid6),  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;record&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.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, documentreference);
        };
      };
    } &quot;body&quot;;
  };
}

group ClinicalDocumentSection(source cda : ClinicalDocument, source src : Section, target patient : Patient, target tgt, target bundle : Bundle, target enc : Encounter, target documentreference : DocumentReference) {
  src.title as t -&gt; tgt.title = (t.dataString);
  src.code -&gt; tgt.code;
  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;;
  src.entry as entry1 -&gt;  bundle.entry as e1,  e1.request = create('BackboneElement') as request,  request.method = 'POST',  e1.resource = create('DiagnosticReport') as DiagnosticReport,  DiagnosticReport.id = uuid() as uuid1,  e1.fullUrl = append('https://example/DiagnosticReport/', uuid1),  request.url = 'DiagnosticReport',  tgt.entry = create('Reference') as reference,  reference.reference = ('https://example/DiagnosticReport/' + %DiagnosticReport.id) then {
    entry1.act as act1 then Act(act1, patient, DiagnosticReport, enc, bundle);
  };
  src.component as component then {
    component.section as sec -&gt; tgt.section as tgtSection then ClinicalDocumentSection(cda, sec, patient, tgtSection, bundle, enc, documentreference);
  };
}

group Observation(source obs : Observation, target patient : Patient, target encounter : Encounter, target ob : Observation, target bundle : Bundle) {
  obs -&gt;  ob.subject = create('Reference') as reference,  reference.reference = ('https://example/Patient/' + %patient.id) &quot;reference&quot;;
  obs -&gt;  ob.encounter = create('Reference') as reference,  reference.reference = ('https://example/Encounter/' + %encounter.id) &quot;reference&quot;;
  obs.code -&gt; ob.code;
  obs.statusCode as statusc where (code = 'completed') -&gt; ob.status = 'final';
  obs.statusCode as statusc where (code = 'active') -&gt; ob.status = 'registered';
  obs.statusCode as statusc where (code = 'aborted') -&gt; ob.status = 'cancelled';
  obs.statusCode as statusc where (code = 'suspended') -&gt; ob.status = 'partial';
  obs.effectiveTime as effectiveTime -&gt; ob.effective = create('dateTime') as value then TSDateTime(effectiveTime, value) &quot;value2&quot;;
  obs where effectiveTime.low.exists() or effectiveTime.high.exists() then {
    obs.effectiveTime as eff -&gt; ob.effective = create('Period') as period then IVLTSPeriod(eff, period);
  } &quot;where&quot;;
  obs.interpretationCode -&gt; ob.interpretation;
  obs.methodCode -&gt; ob.method;
  obs.value : INT as int -&gt; ob.value = (int.value);
  obs.value : BL as boolean -&gt; ob.value = (boolean.value) &quot;boolean&quot;;
  obs.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;
      } &quot;originltext&quot;;
      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');
        val.codeSystemVersion as version -&gt; coding.version = cast(version, '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.codeSystemVersion as version -&gt; coding.version = cast(version, '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');
            value.codeSystemVersion as version -&gt; coding.version = cast(version, 'string');
          };
        };
      };
    } &quot;coding&quot;;
  } &quot;val&quot;;
  obs.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;
      } &quot;originltext&quot;;
      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');
        val.codeSystemVersion as version -&gt; coding.version = cast(version, '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.codeSystemVersion as version -&gt; coding.version = cast(version, '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');
            value.codeSystemVersion as version -&gt; coding.version = cast(version, 'string');
          };
        };
      };
    } &quot;coding&quot;;
  } &quot;val&quot;;
  obs.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;;
  obs.value : ST as value -&gt;  ob.value = create('string'),  ob.value = (value.dataString);
  // Note e commenti
  obs.entryRelationship as entryRelationship then {
    entryRelationship.act as act then {
      act.text as text then {
        text.reference as reference -&gt; ob.note as note then {
          reference -&gt; note.text = (reference.value) &quot;reference&quot;;
        };
      };
    } &quot;Act&quot;;
  };
  // subject
  obs.subject as sbj then {
    sbj.relatedSubject as relatedSubj -&gt; patient.extension as extension2 then ExtSubjectAnimal(relatedSubj, extension2);
  };
  // performer
  obs.performer as performer -&gt;  bundle.entry as e1,  e1.request = create('BackboneElement') as request,  request.method = 'POST',  e1.resource = create('PractitionerRole') as practitionerRole,  practitionerRole.id = uuid() as uuid1,  e1.fullUrl = append('https://example/PractitionerRole/', uuid1),  request.url = 'PractitionerRole' then {
    performer -&gt;  ob.performer = create('Reference') as reference,  reference.reference = ('https://example/PractitionerRole/' + %practitionerRole.id) then {
      performer.assignedEntity as entity then {
        entity.code -&gt; practitionerRole.code;
        entity -&gt;  bundle.entry as e2,  e2.request = create('BackboneElement') as request,  request.method = 'PUT',  e2.resource = create('Practitioner') as practitioner then {
          entity -&gt; practitioner.meta as meta then {
            entity -&gt; meta.tag = create('Coding') as coding then {
              entity -&gt; coding.system = 'http://algoritmodiscoring' &quot;system&quot;;
              entity -&gt; coding.code = 'ClinicalDocument/body/observation/performer' &quot;code&quot;;
            } &quot;coding&quot;;
          } &quot;meta&quot;;
          entity.id as id -&gt; practitioner.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 ext -&gt; identifier.value = ext then {
              entity -&gt; request.url = append('Practitioner?identifier=', ext) &quot;UUID&quot;;
            } &quot;ext&quot;;
            id.assigningAuthorityName as s -&gt;  identifier.assigner as a,  a.display = s;
            id.root as r then {
              id.extension as ext -&gt;  practitioner.id = (r + '-' + ext) as uuid2,  e2.fullUrl = append('https://example/Practitioner/', uuid2),  practitionerRole.practitioner = create('Reference') as reference,  reference.reference = ('https://example/Practitioner/' + %practitioner.id) &quot;performer&quot;;
            } &quot;r&quot;;
          } &quot;identifier&quot;;
          entity.id as id where (root = '2.16.840.1.113883.2.9.4.3.2') then {
            id.extension as ext -&gt; request.url = append('Practitioner?identifier=', ext) &quot;UUID&quot;;
          } &quot;2&quot;;
          entity.id as id where (root != '2.16.840.1.113883.2.9.4.3.2') then {
            id.extension as ext -&gt; request.url = append('Practitioner?identifier=', ext) &quot;UUID&quot;;
          } &quot;diverso&quot;;
          entity.addr -&gt; practitioner.address;
          entity.telecom -&gt; practitioner.telecom;
          entity.assignedPerson as person then {
            person.name -&gt; practitioner.name;
            person.birthTime as birthTime then {
              birthTime.value as date -&gt; practitioner.birthDate = truncate(date, 10);
            } &quot;birth&quot;;
          } &quot;name&quot;;
          // organization
          entity.representedOrganization as representedOrganization -&gt;  bundle.entry as e3,  e3.request = create('BackboneElement') as request,  request.method = 'PUT',  e3.resource = create('Organization') as organization then {
            representedOrganization -&gt; organization.meta as meta then {
              representedOrganization -&gt; meta.tag = create('Coding') as coding then {
                representedOrganization -&gt; coding.system = 'http://algoritmodiscoring' &quot;system&quot;;
                representedOrganization -&gt; coding.code = 'ClinicalDocument/body/observation/performer/representedOrganization' &quot;code&quot;;
              } &quot;coding&quot;;
            } &quot;meta&quot;;
            representedOrganization.id as id -&gt; organization.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 ext -&gt; identifier.value = ext then {
                representedOrganization -&gt; request.url = append('Organization?identifier=', ext) &quot;UUID&quot;;
              } &quot;ext&quot;;
              id.assigningAuthorityName as s -&gt;  identifier.assigner as a,  a.display = s;
              id.root as r then {
                id.extension as ext -&gt;  organization.id = (r + '-' + ext) as uuid3,  e3.fullUrl = append('https://example/Organization/', uuid3),  practitionerRole.organization = create('Reference') as referenceOrg,  referenceOrg.reference = append('https://example/Organization/', uuid3) &quot;aut&quot;;
              } &quot;r&quot;;
            } &quot;identifier&quot;;
            representedOrganization.name as v -&gt; organization.name = (v.other);
            representedOrganization.telecom -&gt; organization.telecom;
            representedOrganization.addr -&gt; organization.address;
            representedOrganization.asOrganizationPartOf as OrgPartOf -&gt;  bundle.entry as e4,  e4.request = create('BackboneElement') as request,  e4.resource = create('Organization') as organization1,  request.method = 'PUT' then {
              OrgPartOf -&gt; organization1.meta as meta then {
                OrgPartOf -&gt; meta.tag = create('Coding') as coding then {
                  OrgPartOf -&gt; coding.system = 'http://algoritmodiscoring' &quot;system&quot;;
                  OrgPartOf -&gt; coding.code = 'ClinicalDocument/body/observation/performer/representedOrganization/asOrganizationPartOf' &quot;code&quot;;
                } &quot;coding&quot;;
              } &quot;meta&quot;;
              OrgPartOf.id as id -&gt; organization1.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 ext -&gt; identifier.value = ext then {
                  OrgPartOf -&gt; request.url = append('Organization?identifier=', ext) &quot;UUID&quot;;
                } &quot;ext&quot;;
                id.assigningAuthorityName as s -&gt;  identifier.assigner as a,  a.display = s;
                id.root as r then {
                  id.extension as ext -&gt;  organization1.id = (r + '-' + ext) as uuid4,  e4.fullUrl = append('https://example/Organization/', uuid4),  organization.partOf = create('Reference') as reference,  reference.reference = ('https://example/Organization/' + %organization1.id) &quot;org&quot;;
                } &quot;r&quot;;
              } &quot;identifier&quot;;
              OrgPartOf.code -&gt; organization1.type;
              OrgPartOf.statusCode as status where (value = 'active') -&gt;  organization1.active = create('boolean'),  organization1.active = 'true';
              OrgPartOf.wholeOrganization as wholeOrgan -&gt;  bundle.entry as e5,  e5.request = create('BackboneElement') as request,  request.method = 'PUT',  e5.resource = create('Organization') as organization2 then {
                wholeOrgan -&gt; organization2.meta as meta then {
                  wholeOrgan -&gt; meta.tag = create('Coding') as coding then {
                    wholeOrgan -&gt; coding.system = 'http://algoritmodiscoring' &quot;system&quot;;
                    wholeOrgan -&gt; coding.code = 'ClinicalDocument/body/observation/performer/representedOrganization/wholeOrganization' &quot;code&quot;;
                  } &quot;coding&quot;;
                } &quot;meta&quot;;
                wholeOrgan.id as id -&gt; organization2.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 ext -&gt; identifier.value = ext then {
                    wholeOrgan -&gt; request.url = append('Organization?identifier=', ext) &quot;UUID&quot;;
                  } &quot;ext&quot;;
                  id.assigningAuthorityName as s -&gt;  identifier.assigner as a,  a.display = s;
                  id.root as r then {
                    id.extension as ext -&gt;  organization2.id = (r + '-' + ext) as uuid5,  e5.fullUrl = append('https://example/Organization/', uuid5),  organization1.partOf = create('Reference') as reference,  reference.reference = ('https://example/Organization/' + %organization2.id) &quot;org&quot;;
                  } &quot;r&quot;;
                } &quot;identifier&quot;;
                wholeOrgan.name as v -&gt; organization2.name = (v.other);
                wholeOrgan.telecom -&gt; organization2.telecom;
                wholeOrgan.addr -&gt; organization2.address;
              };
            } &quot;OrgPartOf&quot;;
          };
        } &quot;practitioner&quot;;
      } &quot;entity&quot;;
    } &quot;practitionerRole&quot;;
  };
  // author
  obs.author as srcAuthor -&gt;  bundle.entry as e6,  e6.request = create('BackboneElement') as request,  request.method = 'POST',  e6.resource = create('PractitionerRole') as practitionerRole,  practitionerRole.id = uuid() as uuid6,  e6.fullUrl = append('https://example/PractitionerRole/', uuid6),  request.url = 'PractitionerRole',  ob.performer = create('Reference') as referenceaut,  referenceaut.reference = ('https://example/PractitionerRole/' + %practitionerRole.id) then {
    srcAuthor.assignedAuthor as assignedAuthor then {
      assignedAuthor.code as codice -&gt; practitionerRole.code as code2 then CECodeableConcept(codice, code2);
      assignedAuthor -&gt;  bundle.entry as e7,  e7.request = create('BackboneElement') as request,  request.method = 'PUT',  e7.resource = create('Practitioner') as practitioner,  practitioner.id = uuid() as uuid7 then {
        srcAuthor.functionCode -&gt; practitionerRole.code;
        assignedAuthor -&gt; practitioner.meta as meta then {
          assignedAuthor -&gt; meta.tag = create('Coding') as coding then {
            assignedAuthor -&gt; coding.system = 'http://algoritmodiscoring' &quot;system&quot;;
            assignedAuthor -&gt; coding.code = 'ClinicalDocument/body/observation/author' &quot;code&quot;;
          } &quot;coding&quot;;
        } &quot;meta&quot;;
        assignedAuthor.id as id -&gt; practitioner.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 ext -&gt; identifier.value = ext then {
            assignedAuthor -&gt; request.url = append('Practitioner?identifier=', ext) &quot;UUID&quot;;
          } &quot;ext&quot;;
          id.assigningAuthorityName as s -&gt;  identifier.assigner as a,  a.display = s;
          id.root as r then {
            id.extension as ext -&gt;  practitioner.id = (r + '-' + ext) as uuid2,  e7.fullUrl = append('https://example/Practitioner/', uuid2),  practitionerRole.practitioner = create('Reference') as reference,  reference.reference = ('https://example/Practitioner/' + %practitioner.id) &quot;aut&quot;;
          } &quot;r&quot;;
          assignedAuthor.id as id where (root = '2.16.840.1.113883.2.9.4.3.2') then {
            id.extension as ext -&gt; request.url = append('Practitioner?identifier=', ext) &quot;UUID&quot;;
          } &quot;2&quot;;
          assignedAuthor.id as id where (root != '2.16.840.1.113883.2.9.4.3.2') then {
            id.extension as ext -&gt; request.url = append('Practitioner?identifier=', ext) &quot;UUID&quot;;
          } &quot;diverso&quot;;
        } &quot;identifier&quot;;
        assignedAuthor.addr -&gt; practitioner.address;
        assignedAuthor.telecom -&gt; practitioner.telecom;
        // person
        assignedAuthor.assignedPerson as person then {
          person.name -&gt; practitioner.name;
          person.birthTime as birthTime then {
            birthTime.value as date -&gt; practitioner.birthDate = truncate(date, 10);
          } &quot;birth&quot;;
        } &quot;name&quot;;
      } &quot;ASSAUth&quot;;
      // organization
      assignedAuthor.representedOrganization as representedOrganization -&gt;  bundle.entry as e8,  e8.request = create('BackboneElement') as request,  request.method = 'PUT',  e8.resource = create('Organization') as organization then {
        representedOrganization -&gt; organization.meta as meta then {
          representedOrganization -&gt; meta.tag = create('Coding') as coding then {
            representedOrganization -&gt; coding.system = 'http://algoritmodiscoring' &quot;system&quot;;
            representedOrganization -&gt; coding.code = 'ClinicalDocument/body/observation/author/representedOrganization' &quot;code&quot;;
          } &quot;coding&quot;;
        } &quot;meta&quot;;
        representedOrganization.id as id -&gt; organization.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 ext -&gt; identifier.value = ext then {
            representedOrganization -&gt; request.url = append('Organization?identifier=', ext) &quot;UUID&quot;;
          } &quot;ext&quot;;
          id.assigningAuthorityName as s -&gt;  identifier.assigner as a,  a.display = s;
          id.root as r then {
            id.extension as ext -&gt;  organization.id = (r + '-' + ext) as uuid3,  e8.fullUrl = append('https://example/Organization/', uuid3),  practitionerRole.organization = create('Reference') as referenceOrg,  referenceOrg.reference = append('https://example/Organization/', uuid3) &quot;org&quot;;
          } &quot;r&quot;;
        } &quot;identifier&quot;;
        representedOrganization.name as v -&gt; organization.name = (v.other);
        representedOrganization.telecom -&gt; organization.telecom;
        representedOrganization.addr -&gt; organization.address;
        representedOrganization.asOrganizationPartOf as OrgPartOf -&gt;  bundle.entry as e9,  e9.request = create('BackboneElement') as request,  request.method = 'PUT',  e9.resource = create('Organization') as organization1 then {
          OrgPartOf -&gt; organization1.meta as meta then {
            OrgPartOf -&gt; meta.tag = create('Coding') as coding then {
              OrgPartOf -&gt; coding.system = 'http://algoritmodiscoring' &quot;system&quot;;
              OrgPartOf -&gt; coding.code = 'ClinicalDocument/body/observation/author/representedOrganization/asOrganizationPartOf' &quot;code&quot;;
            } &quot;coding&quot;;
          } &quot;meta&quot;;
          OrgPartOf.id as id -&gt; organization1.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 ext -&gt; identifier.value = ext then {
              OrgPartOf -&gt; request.url = append('Organization?identifier=', ext) &quot;UUID&quot;;
            } &quot;ext&quot;;
            id.assigningAuthorityName as s -&gt;  identifier.assigner as a,  a.display = s;
            id.root as r then {
              id.extension as ext -&gt;  organization1.id = (r + '-' + ext) as uuid4,  e9.fullUrl = append('https://example/Organization/', uuid4),  organization.partOf = create('Reference') as reference,  reference.reference = ('https://example/Organization/' + %organization1.id) &quot;org&quot;;
            } &quot;r&quot;;
          } &quot;identifier&quot;;
          OrgPartOf.code -&gt; organization1.type;
          OrgPartOf.statusCode as status where (value = 'active') -&gt;  organization1.active = create('boolean'),  organization1.active = 'true';
          OrgPartOf.wholeOrganization as wholeOrgan -&gt;  bundle.entry as e10,  e10.request = create('BackboneElement') as request,  request.method = 'PUT',  e10.resource = create('Organization') as organization2 then {
            wholeOrgan -&gt; organization2.meta as meta then {
              wholeOrgan -&gt; meta.tag = create('Coding') as coding then {
                wholeOrgan -&gt; coding.system = 'http://algoritmodiscoring' &quot;system&quot;;
                wholeOrgan -&gt; coding.code = 'ClinicalDocument/body/observation/author/representedOrganization/asOrganizationPartOf/wholeOrganization' &quot;code&quot;;
              } &quot;coding&quot;;
            } &quot;meta&quot;;
            wholeOrgan.id as id -&gt; organization2.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 ext -&gt; identifier.value = ext then {
                wholeOrgan -&gt; request.url = append('Organization?identifier=', ext) &quot;UUID&quot;;
              } &quot;ext&quot;;
              id.assigningAuthorityName as s -&gt;  identifier.assigner as a,  a.display = s;
              id.root as r then {
                id.extension as ext -&gt;  organization2.id = (r + '-' + ext) as uuid4,  e10.fullUrl = append('https://example/Organization/', uuid4),  organization1.partOf = create('Reference') as reference,  reference.reference = ('https://example/Organization/' + %organization2.id) &quot;org&quot;;
              } &quot;r&quot;;
            } &quot;identifier&quot;;
            wholeOrgan.name as v -&gt; organization2.name = (v.other);
            wholeOrgan.telecom -&gt; organization2.telecom;
            wholeOrgan.addr -&gt; organization2.address;
          };
        } &quot;OrgPartOf&quot;;
      };
      // device
      assignedAuthor.assignedAuthoringDevice as assignedAuthoringDevice -&gt;  bundle.entry as e11,  e11.request = create('BackboneElement') as request,  request.method = 'POST',  e11.resource = create('Device') as device,  device.id = uuid() as uuid11,  e11.fullUrl = append('https://example/Device/', uuid11),  request.url = 'Device',  tgt.author = create('Reference') as reference,  reference.reference = ('https://example/Device/' + %device.id) then {
        assignedAuthoringDevice.templateId -&gt; device.identifier;
        assignedAuthoringDevice.code -&gt; device.type;
        assignedAuthoringDevice.manufacturerModelName as manufacturerModelName then {
          manufacturerModelName as m -&gt; device.manufacturer = (m.displayName) &quot;displayRule&quot;;
        } &quot;manufacturer&quot;;
        assignedAuthoringDevice.softwareName as softwareName -&gt; device.deviceName as deviceName then {
          softwareName -&gt; deviceName.type = 'other' &quot;typeName&quot;;
          softwareName as s -&gt; deviceName.name = (s.displayName) &quot;name&quot;;
        } &quot;deviceName&quot;;
      } &quot;Device&quot;;
    };
  };
  // participant person
  obs.participant as participant where (typeCode != 'DEV') -&gt;  ob.encounter = create('Reference') as reference,  reference.reference = ('https://example/Encounter/' + %encounter.id) then {
    participant -&gt; encounter.participant as FhirParticipant then {
      participant as p -&gt; FhirParticipant.type as type then {
        p -&gt; type.coding as coding then {
          p -&gt; coding.code = (p.typeCode) &quot;codice&quot;;
          p -&gt; coding.system = 'http://terminology.hl7.org/CodeSystem/v3-ParticipationType' &quot;system&quot;;
        } &quot;codeType&quot;;
      } &quot;type&quot;;
    } &quot;fhirParticipant&quot;;
    participant.participantRole as participantRole -&gt;  bundle.entry as e12,  e12.request = create('BackboneElement') as request,  request.method = 'POST',  e12.resource = create('PractitionerRole') as practitionerRole,  practitionerRole.id = uuid() as uuid12,  e12.fullUrl = append('https://example/PractitionerRole/', uuid12),  request.url = 'PractitionerRole',  encounter.participant = create('BackboneElement') as participant1,  participant1.individual = create('Reference') as referencepart,  referencepart.reference = ('https://example/Practitioner/' + %practitionerRole.id) then {
      // participant.time -&gt; participant1.period;
      participant.time as time1 -&gt; participant1.period = create('Period') as period then {
        time1 -&gt; period.start = create('dateTime') as start then TSDateTime(time1, start) &quot;val&quot;;
      };
      participant.time as time1 -&gt; participant1.period = create('Period') as period then IVLTSPeriod(time1, period);
      participant.functionCode -&gt; practitionerRole.code;
      // non mappa i 2 precedenti
      participantRole -&gt;  bundle.entry as e13,  e13.request = create('BackboneElement') as request,  request.method = 'PUT',  e13.resource = create('Practitioner') as practitioner then {
        participantRole -&gt; practitioner.meta as meta then {
          participantRole -&gt; meta.tag = create('Coding') as coding then {
            participantRole -&gt; coding.system = 'http://algoritmodiscoring' &quot;system&quot;;
            participantRole -&gt; coding.code = 'ClinicalDocument/body/observation/participant' &quot;code&quot;;
          } &quot;coding&quot;;
        } &quot;meta&quot;;
        participantRole.id as id -&gt; practitioner.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 ext -&gt; identifier.value = ext then {
            participantRole -&gt; request.url = append('Practitioner?identifier=', ext) &quot;UUID&quot;;
          } &quot;ext&quot;;
          id.assigningAuthorityName as s -&gt;  identifier.assigner as a,  a.display = s;
          id.root as r then {
            id.extension as ext -&gt;  practitioner.id = (r + '-' + ext) as uuid4,  e13.fullUrl = append('https://example/Practitioner/', uuid4),  practitionerRole.practitioner = create('Reference') as reference,  reference.reference = ('https://example/Practitioner/' + %practitioner.id) &quot;org&quot;;
          } &quot;r&quot;;
        } &quot;identifier&quot;;
        participantRole.code -&gt; practitionerRole.code;
        participantRole.addr -&gt; practitioner.address;
        participantRole.telecom -&gt; practitioner.telecom;
        participantRole.playingEntity as playingEntity then {
          playingEntity.name -&gt; practitioner.name;
          playingEntity.birthTime as birthTime then {
            birthTime.value as date -&gt; practitioner.birthDate = truncate(date, 10);
          } &quot;birth&quot;;
        } &quot;name&quot;;
      } &quot;practitioner&quot;;
    } &quot;partRole&quot;;
  } &quot;participantEncounter&quot;;
  // participant device
  obs.participant as devParticipant where (typeCode = 'DEV') -&gt;  bundle.entry as e14,  e14.request = create('BackboneElement') as request,  request.method = 'POST',  e14.resource = create('Device') as device,  device.id = uuid() as uuid14,  e14.fullUrl = append('https://example/Device/', uuid14),  request.url = 'Device',  ob.device = create('Reference') as reference,  reference.reference = ('https://example/Device/' + %device.id) then {
    devParticipant.participantRole as participantRoleDev then {
      participantRoleDev.playingDevice as playingDevice then {
        playingDevice.code -&gt; device.type;
        playingDevice.manufacturerModelName as manufacturerModelName then {
          manufacturerModelName as m -&gt; device.manufacturer = (m.displayName) &quot;displayRule&quot;;
        } &quot;manufacturer&quot;;
        playingDevice.softwareName as softwareName -&gt; device.deviceName as deviceName then {
          softwareName -&gt; deviceName.type = 'other' &quot;typeName&quot;;
          softwareName as s -&gt; deviceName.name = (s.displayName) &quot;name&quot;;
        } &quot;deviceName&quot;;
      };
    } &quot;participantRoleDev&quot;;
  } &quot;devParticipant&quot;;
  // observationMedia
  obs.entryRelationship as er then {
    er.observationMedia as obsMedia -&gt;  bundle.entry as e15,  e15.request = create('BackboneElement') as request,  request.method = 'POST',  e15.resource = create('Media') as media1,  media1.id = uuid() as uuid15,  e15.fullUrl = append('https://example/Media/', uuid15),  request.url = 'Media',  ob.derivedFrom = create('Reference') as reference,  reference.reference = ('https://example/Media/' + %media1.id) then {
      obsMedia -&gt; media1.content = create('Attachment') as Attachment then {
        obsMedia -&gt; media1.status = 'unknown' &quot;status&quot;;
        obsMedia.value as valueMedia then {
          valueMedia.mediaType as type -&gt; Attachment.contentType = type &quot;type&quot;;
          valueMedia -&gt; Attachment.data = (valueMedia.dataBase64Binary) &quot;data&quot;;
        } &quot;valuemedia&quot;;
      } &quot;Attachment&quot;;
    } &quot;media&quot;;
  } &quot;observationMedia&quot;;
  // referenceRange
  obs.referenceRange as refRange -&gt; ob.referenceRange = create('BackboneElement') as ref then {
    refRange.observationRange as obsRange then {
      obsRange.value : ST as value -&gt;  ref.text = create('string'),  ref.text = (value.dataString);
      obsRange -&gt; ref.low = create('Quantity') as Low then {
        obsRange.value : IVL_PQ as v then {
          v.low as l1 then {
            l1.value as decValue -&gt; Low.value = decValue;
            l1.unit as Unit -&gt; Low.unit = Unit;
          } &quot;decValue&quot;;
          v -&gt; ref.high = create('Quantity') as high then {
            v.high as h1 then {
              h1.value as decValue1 -&gt; high.value = decValue1;
              h1.unit as Unit1 -&gt; high.unit = Unit1;
            } &quot;decValue&quot;;
          } &quot;high&quot;;
        } &quot;IVL-PQ&quot;;
        obsRange.interpretationCode -&gt; ref.type;
        obsRange.precondition as precondition then {
          precondition.criterion as criterion then {
            criterion.code -&gt; ref.appliesTo &quot;appliesTo&quot;;
            criterion.value : IVL_PQ as v then {
              v.high as l1 then {
                l1 -&gt; ref.age = create('Quantity') as age then {
                  l1 -&gt; age.high as high then {
                    l1.value as decValue -&gt; high.value = decValue;
                    l1.unit as Unit1 -&gt; high.unit = Unit1;
                  } &quot;high&quot;;
                } &quot;age&quot;;
              } &quot;low&quot;;
            } &quot;v&quot;;
          };
        };
      } &quot;obsRange&quot;;
    } &quot;refRange&quot;;
  } &quot;ref&quot;;
}

group Observation2(source obs : Observation, target patient : Patient, target encounter : Encounter, target ob : Observation, target bundle : Bundle, source cda : Act, target specimenp : Specimen) {
  obs -&gt;  ob.subject = create('Reference') as reference,  reference.reference = ('https://example/Patient/' + %patient.id) &quot;reference&quot;;
  obs -&gt;  ob.encounter = create('Reference') as reference,  reference.reference = ('https://example/Encounter/' + %encounter.id) &quot;reference&quot;;
  obs.code -&gt; ob.code;
  obs.statusCode as statusc where (code = 'completed') -&gt; ob.status = 'final';
  obs.statusCode as statusc where (code = 'active') -&gt; ob.status = 'registered';
  obs.statusCode as statusc where (code = 'aborted') -&gt; ob.status = 'cancelled';
  obs.statusCode as statusc where (code = 'suspended') -&gt; ob.status = 'partial';
  obs.effectiveTime as effectiveTime -&gt; ob.effective = create('dateTime') as value then TSDateTime(effectiveTime, value) &quot;value2&quot;;
  obs where effectiveTime.low.exists() or effectiveTime.high.exists() then {
    obs.effectiveTime as eff -&gt; ob.effective = create('Period') as period then IVLTSPeriod(eff, period);
  } &quot;where&quot;;
  obs.interpretationCode -&gt; ob.interpretation;
  obs.methodCode -&gt; ob.method;
  obs.value : INT as int -&gt; ob.value = (int.value);
  obs.value : BL as boolean -&gt; ob.value = (boolean.value) &quot;boolean&quot;;
  obs.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;
      } &quot;originltext&quot;;
      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');
        val.codeSystemVersion as version -&gt; coding.version = cast(version, '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.codeSystemVersion as version -&gt; coding.version = cast(version, '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');
            value.codeSystemVersion as version -&gt; coding.version = cast(version, 'string');
          };
        };
      };
    } &quot;coding&quot;;
  } &quot;val&quot;;
  obs.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;;
  obs.value : ST as value -&gt;  ob.value = create('string'),  ob.value = (value.dataString);
  // Note e commenti
  obs.entryRelationship as entryRelationship then {
    entryRelationship.act as act then {
      act.text as text then {
        text.reference as reference -&gt; ob.note as note then {
          reference -&gt; note.text = (reference.value) &quot;reference&quot;;
        };
      };
    } &quot;Act&quot;;
  };
  // subject
  obs.subject as sbj then {
    sbj.relatedSubject as relatedSubj -&gt; patient.extension as extension2 then ExtSubjectAnimal(relatedSubj, extension2);
  };
  cda where cda.entryRelationship.act.exists() then {
    // specimen
    obs.specimen as spmn then {
      spmn.specimenRole as specimenRole then {
        specimenRole.id as id then {
          id.extension as extobs then {
            cda.entryRelationship as entryRelationship then {
              entryRelationship.act as a then {
                a.specimen as sp then {
                  sp.specimenRole as spr then {
                    spr.id where (extension = extobs) -&gt;  bundle.entry as e4o,  e4o.request = create('BackboneElement') as request,  request.method = 'POST',  e4o.resource = create('Specimen') as specimen,  specimen.id = uuid() as uuid4o,  e4o.fullUrl = append('https://example/Specimen/', uuid4o),  request.url = 'Specimen',  ob.specimen = create('Reference') as reference,  reference.reference = ('https://example/Specimen/' + %specimen.id) then {
                      spr -&gt;  specimen.parent = create('Reference') as reference,  reference.reference = ('https://example/Specimen/' + %specimenp.id) &quot;reference&quot;;
                      spr.id -&gt; specimen.identifier;
                      specimenRole.specimenPlayingEntity as spent then {
                        spent.code -&gt; specimen.type;
                      } &quot;ent&quot;;
                      spr.specimenPlayingEntity as specimenPlayingEntity then {
                        specimenPlayingEntity.code -&gt; specimen.type;
                      };
                      a -&gt; specimen.collection = create('BackboneElement') as collection then {
                        a.effectiveTime as effectivetime -&gt; collection.collected = create('dateTime') as value then TSDateTime(effectivetime, value) &quot;value&quot;;
                        a where effectiveTime.low.exists() or effectiveTime.high.exists() then {
                          a.effectiveTime as eff -&gt; collection.collected = create('Period') as period then IVLTSPeriod(eff, period);
                        } &quot;where&quot;;
                        a.participant as participant -&gt;  bundle.entry as e10,  e10.request = create('BackboneElement') as request,  request.method = 'PUT',  e10.resource = create('Practitioner') as practitioner,  practitioner.id = uuid() as uuid11,  e10.fullUrl = append('https://example/Practitioner/', uuid11),  collection.collector = create('Reference') as reference,  reference.reference = ('https://example/Practitioner/' + %practitioner.id) then {
                          participant.participantRole as participantRole then {
                            participantRole -&gt; practitioner.meta as meta then {
                              participantRole -&gt; meta.tag = create('Coding') as coding then {
                                participantRole -&gt; coding.system = 'http://algoritmodiscoring' &quot;system&quot;;
                                participantRole -&gt; coding.code = 'ClinicalDocument/body/act/participant' &quot;code&quot;;
                              } &quot;coding&quot;;
                            } &quot;meta&quot;;
                            participantRole.id as id -&gt; practitioner.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 ext -&gt; identifier.value = ext then {
                                participantRole -&gt; request.url = append('Practitioner?identifier=', ext) &quot;UUID&quot;;
                              } &quot;ext&quot;;
                              id.assigningAuthorityName as s -&gt;  identifier.assigner as a,  a.display = s;
                            } &quot;identifier&quot;;
                            participantRole.addr -&gt; practitioner.address;
                            participantRole.playingEntity as playingEntity then {
                              playingEntity.name -&gt; practitioner.name;
                            };
                          };
                        };
                      } &quot;collection&quot;;
                    } &quot;cont&quot;;
                  } &quot;spr&quot;;
                } &quot;sp&quot;;
              } &quot;a&quot;;
            } &quot;en&quot;;
          } &quot;extobs&quot;;
        };
      };
    };
  } &quot;conditionactexists&quot;;
  cda where cda.entryRelationship.act.exists().not() and (obs.specimen.specimenRole.specimenPlayingEntity.code.code != specimenp.type.coding.code) then {
    obs.specimen as spmn -&gt;  bundle.entry as e4o,  e4o.request = create('BackboneElement') as request,  request.method = 'POST',  e4o.resource = create('Specimen') as specimen,  specimen.id = uuid() as uuid4o,  e4o.fullUrl = append('https://example/Specimen/', uuid4o),  request.url = 'Specimen',  ob.specimen = create('Reference') as reference,  reference.reference = ('https://example/Specimen/' + %specimen.id) then {
      spmn.specimenRole as specimenRole then {
        specimenRole.id -&gt; specimen.identifier;
        specimenRole.specimenPlayingEntity as specimenPlayingEntity then {
          specimenPlayingEntity.code -&gt; specimen.type;
        };
      };
    };
  } &quot;wherenotexists&quot;;
  // performer
  obs.performer as performer -&gt;  bundle.entry as e1,  e1.request = create('BackboneElement') as request,  request.method = 'POST',  e1.resource = create('PractitionerRole') as practitionerRole,  practitionerRole.id = uuid() as uuid1,  e1.fullUrl = append('https://example/PractitionerRole/', uuid1),  request.url = 'PractitionerRole' then {
    performer -&gt;  ob.performer = create('Reference') as reference,  reference.reference = ('https://example/PractitionerRole/' + %practitionerRole.id) then {
      performer.assignedEntity as entity then {
        entity.code -&gt; practitionerRole.code;
        entity -&gt;  bundle.entry as e2,  e2.request = create('BackboneElement') as request,  request.method = 'PUT',  e2.resource = create('Practitioner') as practitioner then {
          entity -&gt; practitioner.meta as meta then {
            entity -&gt; meta.tag = create('Coding') as coding then {
              entity -&gt; coding.system = 'http://algoritmodiscoring' &quot;system&quot;;
              entity -&gt; coding.code = 'ClinicalDocument/body/observation/performer' &quot;code&quot;;
            } &quot;coding&quot;;
          } &quot;meta&quot;;
          entity.id as id -&gt; practitioner.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 ext -&gt; identifier.value = ext then {
              entity -&gt; request.url = append('Practitioner?identifier=', ext) &quot;UUID&quot;;
            } &quot;ext&quot;;
            id.assigningAuthorityName as s -&gt;  identifier.assigner as a,  a.display = s;
            id.root as r then {
              id.extension as ext -&gt;  practitioner.id = (r + '-' + ext) as uuid2,  e2.fullUrl = append('https://example/Practitioner/', uuid2),  practitionerRole.practitioner = create('Reference') as reference,  reference.reference = ('https://example/Practitioner/' + %practitioner.id) &quot;performer&quot;;
            } &quot;r&quot;;
          } &quot;identifier&quot;;
          entity.id as id where (root = '2.16.840.1.113883.2.9.4.3.2') then {
            id.extension as ext -&gt; request.url = append('Practitioner?identifier=', ext) &quot;UUID&quot;;
          } &quot;2&quot;;
          entity.id as id where (root != '2.16.840.1.113883.2.9.4.3.2') then {
            id.extension as ext -&gt; request.url = append('Practitioner?identifier=', ext) &quot;UUID&quot;;
          } &quot;diverso&quot;;
          entity.addr -&gt; practitioner.address;
          entity.telecom -&gt; practitioner.telecom;
          entity.assignedPerson as person then {
            person.name -&gt; practitioner.name;
            person.birthTime as birthTime then {
              birthTime.value as date -&gt; practitioner.birthDate = truncate(date, 10);
            } &quot;birth&quot;;
          } &quot;name&quot;;
          // organization
          entity.representedOrganization as representedOrganization -&gt;  bundle.entry as e3,  e3.request = create('BackboneElement') as request,  request.method = 'PUT',  e3.resource = create('Organization') as organization then {
            representedOrganization -&gt; organization.meta as meta then {
              representedOrganization -&gt; meta.tag = create('Coding') as coding then {
                representedOrganization -&gt; coding.system = 'http://algoritmodiscoring' &quot;system&quot;;
                representedOrganization -&gt; coding.code = 'ClinicalDocument/body/observation/performer/representedOrganization' &quot;code&quot;;
              } &quot;coding&quot;;
            } &quot;meta&quot;;
            representedOrganization.id as id -&gt; organization.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 ext -&gt; identifier.value = ext then {
                representedOrganization -&gt; request.url = append('Organization?identifier=', ext) &quot;UUID&quot;;
              } &quot;ext&quot;;
              id.assigningAuthorityName as s -&gt;  identifier.assigner as a,  a.display = s;
              id.root as r then {
                id.extension as ext -&gt;  organization.id = (r + '-' + ext) as uuid3,  e3.fullUrl = append('https://example/Organization/', uuid3),  practitionerRole.organization = create('Reference') as referenceOrg,  referenceOrg.reference = append('https://example/Organization/', uuid3) &quot;aut&quot;;
              } &quot;r&quot;;
            } &quot;identifier&quot;;
            representedOrganization.name as v -&gt; organization.name = (v.other);
            representedOrganization.telecom -&gt; organization.telecom;
            representedOrganization.addr -&gt; organization.address;
            representedOrganization.asOrganizationPartOf as OrgPartOf -&gt;  bundle.entry as e4,  e4.request = create('BackboneElement') as request,  e4.resource = create('Organization') as organization1,  request.method = 'PUT' then {
              OrgPartOf -&gt; organization1.meta as meta then {
                OrgPartOf -&gt; meta.tag = create('Coding') as coding then {
                  OrgPartOf -&gt; coding.system = 'http://algoritmodiscoring' &quot;system&quot;;
                  OrgPartOf -&gt; coding.code = 'ClinicalDocument/body/observation/performer/representedOrganization/asOrganizationPartOf' &quot;code&quot;;
                } &quot;coding&quot;;
              } &quot;meta&quot;;
              OrgPartOf.id as id -&gt; organization1.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 ext -&gt; identifier.value = ext then {
                  OrgPartOf -&gt; request.url = append('Organization?identifier=', ext) &quot;UUID&quot;;
                } &quot;ext&quot;;
                id.assigningAuthorityName as s -&gt;  identifier.assigner as a,  a.display = s;
                id.root as r then {
                  id.extension as ext -&gt;  organization1.id = (r + '-' + ext) as uuid4,  e4.fullUrl = append('https://example/Organization/', uuid4),  organization.partOf = create('Reference') as reference,  reference.reference = ('https://example/Organization/' + %organization1.id) &quot;org&quot;;
                } &quot;r&quot;;
              } &quot;identifier&quot;;
              OrgPartOf.code -&gt; organization1.type;
              OrgPartOf.statusCode as status where (value = 'active') -&gt;  organization1.active = create('boolean'),  organization1.active = 'true';
              OrgPartOf.wholeOrganization as wholeOrgan -&gt;  bundle.entry as e5,  e5.request = create('BackboneElement') as request,  request.method = 'PUT',  e5.resource = create('Organization') as organization2 then {
                wholeOrgan -&gt; organization2.meta as meta then {
                  wholeOrgan -&gt; meta.tag = create('Coding') as coding then {
                    wholeOrgan -&gt; coding.system = 'http://algoritmodiscoring' &quot;system&quot;;
                    wholeOrgan -&gt; coding.code = 'ClinicalDocument/body/observation/performer/representedOrganization/wholeOrganization' &quot;code&quot;;
                  } &quot;coding&quot;;
                } &quot;meta&quot;;
                wholeOrgan.id as id -&gt; organization2.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 ext -&gt; identifier.value = ext then {
                    wholeOrgan -&gt; request.url = append('Organization?identifier=', ext) &quot;UUID&quot;;
                  } &quot;ext&quot;;
                  id.assigningAuthorityName as s -&gt;  identifier.assigner as a,  a.display = s;
                  id.root as r then {
                    id.extension as ext -&gt;  organization2.id = (r + '-' + ext) as uuid5,  e5.fullUrl = append('https://example/Organization/', uuid5),  organization1.partOf = create('Reference') as reference,  reference.reference = ('https://example/Organization/' + %organization2.id) &quot;org&quot;;
                  } &quot;r&quot;;
                } &quot;identifier&quot;;
                wholeOrgan.name as v -&gt; organization2.name = (v.other);
                wholeOrgan.telecom -&gt; organization2.telecom;
                wholeOrgan.addr -&gt; organization2.address;
              };
            } &quot;OrgPartOf&quot;;
          };
        } &quot;practitioner&quot;;
      } &quot;entity&quot;;
    } &quot;practitionerRole&quot;;
  };
  // author
  obs.author as srcAuthor -&gt;  bundle.entry as e6,  e6.request = create('BackboneElement') as request,  request.method = 'POST',  e6.resource = create('PractitionerRole') as practitionerRole,  practitionerRole.id = uuid() as uuid6,  e6.fullUrl = append('https://example/PractitionerRole/', uuid6),  request.url = 'PractitionerRole',  ob.performer = create('Reference') as referenceaut,  referenceaut.reference = ('https://example/PractitionerRole/' + %practitionerRole.id) then {
    srcAuthor.assignedAuthor as assignedAuthor then {
      assignedAuthor.code as codice -&gt; practitionerRole.code as code2 then CECodeableConcept(codice, code2);
      assignedAuthor -&gt;  bundle.entry as e7,  e7.request = create('BackboneElement') as request,  request.method = 'PUT',  e7.resource = create('Practitioner') as practitioner,  practitioner.id = uuid() as uuid7 then {
        srcAuthor.functionCode -&gt; practitionerRole.code;
        assignedAuthor -&gt; practitioner.meta as meta then {
          assignedAuthor -&gt; meta.tag = create('Coding') as coding then {
            assignedAuthor -&gt; coding.system = 'http://algoritmodiscoring' &quot;system&quot;;
            assignedAuthor -&gt; coding.code = 'ClinicalDocument/body/observation/author' &quot;code&quot;;
          } &quot;coding&quot;;
        } &quot;meta&quot;;
        assignedAuthor.id as id -&gt; practitioner.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 ext -&gt; identifier.value = ext then {
            assignedAuthor -&gt; request.url = append('Practitioner?identifier=', ext) &quot;UUID&quot;;
          } &quot;ext&quot;;
          id.assigningAuthorityName as s -&gt;  identifier.assigner as a,  a.display = s;
          id.root as r then {
            id.extension as ext -&gt;  practitioner.id = (r + '-' + ext) as uuid2,  e7.fullUrl = append('https://example/Practitioner/', uuid2),  practitionerRole.practitioner = create('Reference') as reference,  reference.reference = ('https://example/Practitioner/' + %practitioner.id) &quot;aut&quot;;
          } &quot;r&quot;;
          assignedAuthor.id as id where (root = '2.16.840.1.113883.2.9.4.3.2') then {
            id.extension as ext -&gt; request.url = append('Practitioner?identifier=', ext) &quot;UUID&quot;;
          } &quot;2&quot;;
          assignedAuthor.id as id where (root != '2.16.840.1.113883.2.9.4.3.2') then {
            id.extension as ext -&gt; request.url = append('Practitioner?identifier=', ext) &quot;UUID&quot;;
          } &quot;diverso&quot;;
        } &quot;identifier&quot;;
        assignedAuthor.addr -&gt; practitioner.address;
        assignedAuthor.telecom -&gt; practitioner.telecom;
        // person
        assignedAuthor.assignedPerson as person then {
          person.name -&gt; practitioner.name;
          person.birthTime as birthTime then {
            birthTime.value as date -&gt; practitioner.birthDate = truncate(date, 10);
          } &quot;birth&quot;;
        } &quot;name&quot;;
      } &quot;ASSAUth&quot;;
      // organization
      assignedAuthor.representedOrganization as representedOrganization -&gt;  bundle.entry as e8,  e8.request = create('BackboneElement') as request,  request.method = 'PUT',  e8.resource = create('Organization') as organization then {
        representedOrganization -&gt; organization.meta as meta then {
          representedOrganization -&gt; meta.tag = create('Coding') as coding then {
            representedOrganization -&gt; coding.system = 'http://algoritmodiscoring' &quot;system&quot;;
            representedOrganization -&gt; coding.code = 'ClinicalDocument/body/observation/author/representedOrganization' &quot;code&quot;;
          } &quot;coding&quot;;
        } &quot;meta&quot;;
        representedOrganization.id as id -&gt; organization.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 ext -&gt; identifier.value = ext then {
            representedOrganization -&gt; request.url = append('Organization?identifier=', ext) &quot;UUID&quot;;
          } &quot;ext&quot;;
          id.assigningAuthorityName as s -&gt;  identifier.assigner as a,  a.display = s;
          id.root as r then {
            id.extension as ext -&gt;  organization.id = (r + '-' + ext) as uuid3,  e8.fullUrl = append('https://example/Organization/', uuid3),  practitionerRole.organization = create('Reference') as referenceOrg,  referenceOrg.reference = append('https://example/Organization/', uuid3) &quot;org&quot;;
          } &quot;r&quot;;
        } &quot;identifier&quot;;
        representedOrganization.name as v -&gt; organization.name = (v.other);
        representedOrganization.telecom -&gt; organization.telecom;
        representedOrganization.addr -&gt; organization.address;
        representedOrganization.asOrganizationPartOf as OrgPartOf -&gt;  bundle.entry as e9,  e9.request = create('BackboneElement') as request,  request.method = 'PUT',  e9.resource = create('Organization') as organization1 then {
          OrgPartOf -&gt; organization1.meta as meta then {
            OrgPartOf -&gt; meta.tag = create('Coding') as coding then {
              OrgPartOf -&gt; coding.system = 'http://algoritmodiscoring' &quot;system&quot;;
              OrgPartOf -&gt; coding.code = 'ClinicalDocument/body/observation/author/representedOrganization/asOrganizationPartOf' &quot;code&quot;;
            } &quot;coding&quot;;
          } &quot;meta&quot;;
          OrgPartOf.id as id -&gt; organization1.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 ext -&gt; identifier.value = ext then {
              OrgPartOf -&gt; request.url = append('Organization?identifier=', ext) &quot;UUID&quot;;
            } &quot;ext&quot;;
            id.assigningAuthorityName as s -&gt;  identifier.assigner as a,  a.display = s;
            id.root as r then {
              id.extension as ext -&gt;  organization1.id = (r + '-' + ext) as uuid4,  e9.fullUrl = append('https://example/Organization/', uuid4),  organization.partOf = create('Reference') as reference,  reference.reference = ('https://example/Organization/' + %organization1.id) &quot;org&quot;;
            } &quot;r&quot;;
          } &quot;identifier&quot;;
          OrgPartOf.code -&gt; organization1.type;
          OrgPartOf.statusCode as status where (value = 'active') -&gt;  organization1.active = create('boolean'),  organization1.active = 'true';
          OrgPartOf.wholeOrganization as wholeOrgan -&gt;  bundle.entry as e10,  e10.request = create('BackboneElement') as request,  request.method = 'PUT',  e10.resource = create('Organization') as organization2 then {
            wholeOrgan -&gt; organization2.meta as meta then {
              wholeOrgan -&gt; meta.tag = create('Coding') as coding then {
                wholeOrgan -&gt; coding.system = 'http://algoritmodiscoring' &quot;system&quot;;
                wholeOrgan -&gt; coding.code = 'ClinicalDocument/body/observation/author/representedOrganization/asOrganizationPartOf/wholeOrganization' &quot;code&quot;;
              } &quot;coding&quot;;
            } &quot;meta&quot;;
            wholeOrgan.id as id -&gt; organization2.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 ext -&gt; identifier.value = ext then {
                wholeOrgan -&gt; request.url = append('Organization?identifier=', ext) &quot;UUID&quot;;
              } &quot;ext&quot;;
              id.assigningAuthorityName as s -&gt;  identifier.assigner as a,  a.display = s;
              id.root as r then {
                id.extension as ext -&gt;  organization2.id = (r + '-' + ext) as uuid4,  e10.fullUrl = append('https://example/Organization/', uuid4),  organization1.partOf = create('Reference') as reference,  reference.reference = ('https://example/Organization/' + %organization2.id) &quot;org&quot;;
              } &quot;r&quot;;
            } &quot;identifier&quot;;
            wholeOrgan.name as v -&gt; organization2.name = (v.other);
            wholeOrgan.telecom -&gt; organization2.telecom;
            wholeOrgan.addr -&gt; organization2.address;
          };
        } &quot;OrgPartOf&quot;;
      };
      // device
      assignedAuthor.assignedAuthoringDevice as assignedAuthoringDevice -&gt;  bundle.entry as e11,  e11.request = create('BackboneElement') as request,  request.method = 'POST',  e11.resource = create('Device') as device,  device.id = uuid() as uuid11,  e11.fullUrl = append('https://example/Device/', uuid11),  request.url = 'Device',  tgt.author = create('Reference') as reference,  reference.reference = ('https://example/Device/' + %device.id) then {
        assignedAuthoringDevice.templateId -&gt; device.identifier;
        assignedAuthoringDevice.code -&gt; device.type;
        assignedAuthoringDevice.manufacturerModelName as manufacturerModelName then {
          manufacturerModelName as m -&gt; device.manufacturer = (m.displayName) &quot;displayRule&quot;;
        } &quot;manufacturer&quot;;
        assignedAuthoringDevice.softwareName as softwareName -&gt; device.deviceName as deviceName then {
          softwareName -&gt; deviceName.type = 'other' &quot;typeName&quot;;
          softwareName as s -&gt; deviceName.name = (s.displayName) &quot;name&quot;;
        } &quot;deviceName&quot;;
      } &quot;Device&quot;;
    };
  };
  // participant person
  obs.participant as participant where (typeCode != 'DEV') -&gt;  ob.encounter = create('Reference') as reference,  reference.reference = ('https://example/Encounter/' + %encounter.id) then {
    participant -&gt; encounter.participant as FhirParticipant then {
      participant as p -&gt; FhirParticipant.type as type then {
        p -&gt; type.coding as coding then {
          p -&gt; coding.code = (p.typeCode) &quot;codice&quot;;
          p -&gt; coding.system = 'http://terminology.hl7.org/CodeSystem/v3-ParticipationType' &quot;system&quot;;
        } &quot;codeType&quot;;
      } &quot;type&quot;;
    } &quot;fhirParticipant&quot;;
    participant.participantRole as participantRole -&gt;  bundle.entry as e12,  e12.request = create('BackboneElement') as request,  request.method = 'POST',  e12.resource = create('PractitionerRole') as practitionerRole,  practitionerRole.id = uuid() as uuid12,  e12.fullUrl = append('https://example/PractitionerRole/', uuid12),  request.url = 'PractitionerRole',  encounter.participant = create('BackboneElement') as participant1,  participant1.individual = create('Reference') as referencepart,  referencepart.reference = ('https://example/Practitioner/' + %practitionerRole.id) then {
      // participant.time -&gt; participant1.period;
      participant.time as time1 -&gt; participant1.period = create('Period') as period then {
        time1 -&gt; period.start = create('dateTime') as start then TSDateTime(time1, start) &quot;val&quot;;
      };
      participant.time as time1 -&gt; participant1.period = create('Period') as period then IVLTSPeriod(time1, period);
      participant.functionCode -&gt; practitionerRole.code;
      // non mappa i 2 precedenti
      participantRole -&gt;  bundle.entry as e13,  e13.request = create('BackboneElement') as request,  request.method = 'PUT',  e13.resource = create('Practitioner') as practitioner then {
        participantRole -&gt; practitioner.meta as meta then {
          participantRole -&gt; meta.tag = create('Coding') as coding then {
            participantRole -&gt; coding.system = 'http://algoritmodiscoring' &quot;system&quot;;
            participantRole -&gt; coding.code = 'ClinicalDocument/body/observation/participant' &quot;code&quot;;
          } &quot;coding&quot;;
        } &quot;meta&quot;;
        participantRole.id as id -&gt; practitioner.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 ext -&gt; identifier.value = ext then {
            participantRole -&gt; request.url = append('Practitioner?identifier=', ext) &quot;UUID&quot;;
          } &quot;ext&quot;;
          id.assigningAuthorityName as s -&gt;  identifier.assigner as a,  a.display = s;
          id.root as r then {
            id.extension as ext -&gt;  practitioner.id = (r + '-' + ext) as uuid4,  e13.fullUrl = append('https://example/Practitioner/', uuid4),  practitionerRole.practitioner = create('Reference') as reference,  reference.reference = ('https://example/Practitioner/' + %practitioner.id) &quot;org&quot;;
          } &quot;r&quot;;
        } &quot;identifier&quot;;
        participantRole.code -&gt; practitionerRole.code;
        participantRole.addr -&gt; practitioner.address;
        participantRole.telecom -&gt; practitioner.telecom;
        participantRole.playingEntity as playingEntity then {
          playingEntity.name -&gt; practitioner.name;
          playingEntity.birthTime as birthTime then {
            birthTime.value as date -&gt; practitioner.birthDate = truncate(date, 10);
          } &quot;birth&quot;;
        } &quot;name&quot;;
      } &quot;practitioner&quot;;
    } &quot;partRole&quot;;
  } &quot;participantEncounter&quot;;
  // participant device
  obs.participant as devParticipant where (typeCode = 'DEV') -&gt;  bundle.entry as e14,  e14.request = create('BackboneElement') as request,  request.method = 'POST',  e14.resource = create('Device') as device,  device.id = uuid() as uuid14,  e14.fullUrl = append('https://example/Device/', uuid14),  request.url = 'Device',  ob.device = create('Reference') as reference,  reference.reference = ('https://example/Device/' + %device.id) then {
    devParticipant.participantRole as participantRoleDev then {
      participantRoleDev.playingDevice as playingDevice then {
        playingDevice.code -&gt; device.type;
        playingDevice.manufacturerModelName as manufacturerModelName then {
          manufacturerModelName as m -&gt; device.manufacturer = (m.displayName) &quot;displayRule&quot;;
        } &quot;manufacturer&quot;;
        playingDevice.softwareName as softwareName -&gt; device.deviceName as deviceName then {
          softwareName -&gt; deviceName.type = 'other' &quot;typeName&quot;;
          softwareName as s -&gt; deviceName.name = (s.displayName) &quot;name&quot;;
        } &quot;deviceName&quot;;
      };
    } &quot;participantRoleDev&quot;;
  } &quot;devParticipant&quot;;
  // observationMedia
  obs.entryRelationship as er then {
    er.observationMedia as obsMedia -&gt;  bundle.entry as e15,  e15.request = create('BackboneElement') as request,  request.method = 'POST',  e15.resource = create('Media') as media1,  media1.id = uuid() as uuid15,  e15.fullUrl = append('https://example/Media/', uuid15),  request.url = 'Media',  ob.derivedFrom = create('Reference') as reference,  reference.reference = ('https://example/Media/' + %media1.id) then {
      obsMedia -&gt; media1.content = create('Attachment') as Attachment then {
        obsMedia -&gt; media1.status = 'unknown' &quot;status&quot;;
        obsMedia.value as valueMedia then {
          valueMedia.mediaType as type -&gt; Attachment.contentType = type &quot;type&quot;;
          valueMedia -&gt; Attachment.data = (valueMedia.dataBase64Binary) &quot;data&quot;;
        } &quot;valuemedia&quot;;
      } &quot;Attachment&quot;;
    } &quot;media&quot;;
  } &quot;observationMedia&quot;;
  // referenceRange
  obs.referenceRange as refRange -&gt; ob.referenceRange = create('BackboneElement') as ref then {
    refRange.observationRange as obsRange then {
      obsRange.value : ST as value -&gt;  ref.text = create('string'),  ref.text = (value.dataString);
      obsRange -&gt; ref.low = create('Quantity') as Low then {
        obsRange.value : IVL_PQ as v then {
          v.low as l1 then {
            l1.value as decValue -&gt; Low.value = decValue;
            l1.unit as Unit -&gt; Low.unit = Unit;
          } &quot;decValue&quot;;
          v -&gt; ref.high = create('Quantity') as high then {
            v.high as h1 then {
              h1.value as decValue1 -&gt; high.value = decValue1;
              h1.unit as Unit1 -&gt; high.unit = Unit1;
            } &quot;decValue&quot;;
          } &quot;high&quot;;
        } &quot;IVL-PQ&quot;;
        obsRange.interpretationCode -&gt; ref.type;
        obsRange.precondition as precondition then {
          precondition.criterion as criterion then {
            criterion.code -&gt; ref.appliesTo &quot;appliesTo&quot;;
            criterion.value : IVL_PQ as v then {
              v.high as l1 then {
                l1 -&gt; ref.age = create('Quantity') as age then {
                  l1 -&gt; age.high as high then {
                    l1.value as decValue -&gt; high.value = decValue;
                    l1.unit as Unit1 -&gt; high.unit = Unit1;
                  } &quot;high&quot;;
                } &quot;age&quot;;
              } &quot;low&quot;;
            } &quot;v&quot;;
          };
        };
      } &quot;obsRange&quot;;
    } &quot;refRange&quot;;
  } &quot;ref&quot;;
}

group Observation3(source obs : Observation, target patient : Patient, target encounter : Encounter, target ob : Observation, target bundle : Bundle, source cda : Act) {
  obs -&gt;  ob.subject = create('Reference') as reference,  reference.reference = ('https://example/Patient/' + %patient.id) &quot;reference&quot;;
  obs -&gt;  ob.encounter = create('Reference') as reference,  reference.reference = ('https://example/Encounter/' + %encounter.id) &quot;reference&quot;;
  obs.code -&gt; ob.code;
  obs.statusCode as statusc where (code = 'completed') -&gt; ob.status = 'final';
  obs.statusCode as statusc where (code = 'active') -&gt; ob.status = 'registered';
  obs.statusCode as statusc where (code = 'aborted') -&gt; ob.status = 'cancelled';
  obs.statusCode as statusc where (code = 'suspended') -&gt; ob.status = 'partial';
  obs.effectiveTime as effectiveTime -&gt; ob.effective = create('dateTime') as value then TSDateTime(effectiveTime, value) &quot;value2&quot;;
  obs where effectiveTime.low.exists() or effectiveTime.high.exists() then {
    obs.effectiveTime as eff -&gt; ob.effective = create('Period') as period then IVLTSPeriod(eff, period);
  } &quot;where&quot;;
  obs.interpretationCode -&gt; ob.interpretation;
  obs.methodCode -&gt; ob.method;
  obs.value : INT as int -&gt; ob.value = (int.value);
  obs.value : BL as boolean -&gt; ob.value = (boolean.value) &quot;boolean&quot;;
  obs.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;
      } &quot;originltext&quot;;
      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');
        val.codeSystemVersion as version -&gt; coding.version = cast(version, '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.codeSystemVersion as version -&gt; coding.version = cast(version, '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');
            value.codeSystemVersion as version -&gt; coding.version = cast(version, 'string');
          };
        };
      };
    } &quot;coding&quot;;
  } &quot;val&quot;;
  obs.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;;
  obs.value : ST as value -&gt;  ob.value = create('string'),  ob.value = (value.dataString);
  // Note e commenti
  obs.entryRelationship as entryRelationship then {
    entryRelationship.act as act then {
      act.text as text then {
        text.reference as reference -&gt; ob.note as note then {
          reference -&gt; note.text = (reference.value) &quot;reference&quot;;
        };
      };
    } &quot;Act&quot;;
  };
  // subject
  obs.subject as sbj then {
    sbj.relatedSubject as relatedSubj -&gt; patient.extension as extension2 then ExtSubjectAnimal(relatedSubj, extension2);
  };
  // specimen
  obs.specimen as spmn -&gt;  bundle.entry as e4o,  e4o.request = create('BackboneElement') as request,  request.method = 'POST',  e4o.resource = create('Specimen') as specimen,  specimen.id = uuid() as uuid4o,  e4o.fullUrl = append('https://example/Specimen/', uuid4o),  request.url = 'Specimen',  ob.specimen = create('Reference') as reference,  reference.reference = ('https://example/Specimen/' + %specimen.id) then {
    spmn.specimenRole as specimenRole then {
      specimenRole.id as id -&gt; specimen.identifier;
      specimenRole.specimenPlayingEntity as specimenPlayingEntity then {
        specimenPlayingEntity.code -&gt; specimen.type;
      };
    };
  };
  // performer
  obs.performer as performer -&gt;  bundle.entry as e1,  e1.request = create('BackboneElement') as request,  request.method = 'POST',  e1.resource = create('PractitionerRole') as practitionerRole,  practitionerRole.id = uuid() as uuid1,  e1.fullUrl = append('https://example/PractitionerRole/', uuid1),  request.url = 'PractitionerRole' then {
    performer -&gt;  ob.performer = create('Reference') as reference,  reference.reference = ('https://example/PractitionerRole/' + %practitionerRole.id) then {
      performer.assignedEntity as entity then {
        entity.code -&gt; practitionerRole.code;
        entity -&gt;  bundle.entry as e2,  e2.request = create('BackboneElement') as request,  request.method = 'PUT',  e2.resource = create('Practitioner') as practitioner then {
          entity -&gt; practitioner.meta as meta then {
            entity -&gt; meta.tag = create('Coding') as coding then {
              entity -&gt; coding.system = 'http://algoritmodiscoring' &quot;system&quot;;
              entity -&gt; coding.code = 'ClinicalDocument/body/observation/performer' &quot;code&quot;;
            } &quot;coding&quot;;
          } &quot;meta&quot;;
          entity.id as id -&gt; practitioner.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 ext -&gt; identifier.value = ext then {
              entity -&gt; request.url = append('Practitioner?identifier=', ext) &quot;UUID&quot;;
            } &quot;ext&quot;;
            id.assigningAuthorityName as s -&gt;  identifier.assigner as a,  a.display = s;
            id.root as r then {
              id.extension as ext -&gt;  practitioner.id = (r + '-' + ext) as uuid2,  e2.fullUrl = append('https://example/Practitioner/', uuid2),  practitionerRole.practitioner = create('Reference') as reference,  reference.reference = ('https://example/Practitioner/' + %practitioner.id) &quot;performer&quot;;
            } &quot;r&quot;;
          } &quot;identifier&quot;;
          entity.id as id where (root = '2.16.840.1.113883.2.9.4.3.2') then {
            id.extension as ext -&gt; request.url = append('Practitioner?identifier=', ext) &quot;UUID&quot;;
          } &quot;2&quot;;
          entity.id as id where (root != '2.16.840.1.113883.2.9.4.3.2') then {
            id.extension as ext -&gt; request.url = append('Practitioner?identifier=', ext) &quot;UUID&quot;;
          } &quot;diverso&quot;;
          entity.addr -&gt; practitioner.address;
          entity.telecom -&gt; practitioner.telecom;
          entity.assignedPerson as person then {
            person.name -&gt; practitioner.name;
            person.birthTime as birthTime then {
              birthTime.value as date -&gt; practitioner.birthDate = truncate(date, 10);
            } &quot;birth&quot;;
          } &quot;name&quot;;
          // organization
          entity.representedOrganization as representedOrganization -&gt;  bundle.entry as e3,  e3.request = create('BackboneElement') as request,  request.method = 'PUT',  e3.resource = create('Organization') as organization then {
            representedOrganization -&gt; organization.meta as meta then {
              representedOrganization -&gt; meta.tag = create('Coding') as coding then {
                representedOrganization -&gt; coding.system = 'http://algoritmodiscoring' &quot;system&quot;;
                representedOrganization -&gt; coding.code = 'ClinicalDocument/body/observation/performer/representedOrganization' &quot;code&quot;;
              } &quot;coding&quot;;
            } &quot;meta&quot;;
            representedOrganization.id as id -&gt; organization.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 ext -&gt; identifier.value = ext then {
                representedOrganization -&gt; request.url = append('Organization?identifier=', ext) &quot;UUID&quot;;
              } &quot;ext&quot;;
              id.assigningAuthorityName as s -&gt;  identifier.assigner as a,  a.display = s;
              id.root as r then {
                id.extension as ext -&gt;  organization.id = (r + '-' + ext) as uuid3,  e3.fullUrl = append('https://example/Organization/', uuid3),  practitionerRole.organization = create('Reference') as referenceOrg,  referenceOrg.reference = append('https://example/Organization/', uuid3) &quot;aut&quot;;
              } &quot;r&quot;;
            } &quot;identifier&quot;;
            representedOrganization.name as v -&gt; organization.name = (v.other);
            representedOrganization.telecom -&gt; organization.telecom;
            representedOrganization.addr -&gt; organization.address;
            representedOrganization.asOrganizationPartOf as OrgPartOf -&gt;  bundle.entry as e4,  e4.request = create('BackboneElement') as request,  e4.resource = create('Organization') as organization1,  request.method = 'PUT' then {
              OrgPartOf -&gt; organization1.meta as meta then {
                OrgPartOf -&gt; meta.tag = create('Coding') as coding then {
                  OrgPartOf -&gt; coding.system = 'http://algoritmodiscoring' &quot;system&quot;;
                  OrgPartOf -&gt; coding.code = 'ClinicalDocument/body/observation/performer/representedOrganization/asOrganizationPartOf' &quot;code&quot;;
                } &quot;coding&quot;;
              } &quot;meta&quot;;
              OrgPartOf.id as id -&gt; organization1.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 ext -&gt; identifier.value = ext then {
                  OrgPartOf -&gt; request.url = append('Organization?identifier=', ext) &quot;UUID&quot;;
                } &quot;ext&quot;;
                id.assigningAuthorityName as s -&gt;  identifier.assigner as a,  a.display = s;
                id.root as r then {
                  id.extension as ext -&gt;  organization1.id = (r + '-' + ext) as uuid4,  e4.fullUrl = append('https://example/Organization/', uuid4),  organization.partOf = create('Reference') as reference,  reference.reference = ('https://example/Organization/' + %organization1.id) &quot;org&quot;;
                } &quot;r&quot;;
              } &quot;identifier&quot;;
              OrgPartOf.code -&gt; organization1.type;
              OrgPartOf.statusCode as status where (value = 'active') -&gt;  organization1.active = create('boolean'),  organization1.active = 'true';
              OrgPartOf.wholeOrganization as wholeOrgan -&gt;  bundle.entry as e5,  e5.request = create('BackboneElement') as request,  request.method = 'PUT',  e5.resource = create('Organization') as organization2 then {
                wholeOrgan -&gt; organization2.meta as meta then {
                  wholeOrgan -&gt; meta.tag = create('Coding') as coding then {
                    wholeOrgan -&gt; coding.system = 'http://algoritmodiscoring' &quot;system&quot;;
                    wholeOrgan -&gt; coding.code = 'ClinicalDocument/body/observation/performer/representedOrganization/wholeOrganization' &quot;code&quot;;
                  } &quot;coding&quot;;
                } &quot;meta&quot;;
                wholeOrgan.id as id -&gt; organization2.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 ext -&gt; identifier.value = ext then {
                    wholeOrgan -&gt; request.url = append('Organization?identifier=', ext) &quot;UUID&quot;;
                  } &quot;ext&quot;;
                  id.assigningAuthorityName as s -&gt;  identifier.assigner as a,  a.display = s;
                  id.root as r then {
                    id.extension as ext -&gt;  organization2.id = (r + '-' + ext) as uuid5,  e5.fullUrl = append('https://example/Organization/', uuid5),  organization1.partOf = create('Reference') as reference,  reference.reference = ('https://example/Organization/' + %organization2.id) &quot;org&quot;;
                  } &quot;r&quot;;
                } &quot;identifier&quot;;
                wholeOrgan.name as v -&gt; organization2.name = (v.other);
                wholeOrgan.telecom -&gt; organization2.telecom;
                wholeOrgan.addr -&gt; organization2.address;
              };
            } &quot;OrgPartOf&quot;;
          };
        } &quot;practitioner&quot;;
      } &quot;entity&quot;;
    } &quot;practitionerRole&quot;;
  };
  // author
  obs.author as srcAuthor -&gt;  bundle.entry as e6,  e6.request = create('BackboneElement') as request,  request.method = 'POST',  e6.resource = create('PractitionerRole') as practitionerRole,  practitionerRole.id = uuid() as uuid6,  e6.fullUrl = append('https://example/PractitionerRole/', uuid6),  request.url = 'PractitionerRole',  ob.performer = create('Reference') as referenceaut,  referenceaut.reference = ('https://example/PractitionerRole/' + %practitionerRole.id) then {
    srcAuthor.assignedAuthor as assignedAuthor then {
      assignedAuthor.code as codice -&gt; practitionerRole.code as code2 then CECodeableConcept(codice, code2);
      assignedAuthor -&gt;  bundle.entry as e7,  e7.request = create('BackboneElement') as request,  request.method = 'PUT',  e7.resource = create('Practitioner') as practitioner,  practitioner.id = uuid() as uuid7 then {
        srcAuthor.functionCode -&gt; practitionerRole.code;
        assignedAuthor -&gt; practitioner.meta as meta then {
          assignedAuthor -&gt; meta.tag = create('Coding') as coding then {
            assignedAuthor -&gt; coding.system = 'http://algoritmodiscoring' &quot;system&quot;;
            assignedAuthor -&gt; coding.code = 'ClinicalDocument/body/observation/author' &quot;code&quot;;
          } &quot;coding&quot;;
        } &quot;meta&quot;;
        assignedAuthor.id as id -&gt; practitioner.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 ext -&gt; identifier.value = ext then {
            assignedAuthor -&gt; request.url = append('Practitioner?identifier=', ext) &quot;UUID&quot;;
          } &quot;ext&quot;;
          id.assigningAuthorityName as s -&gt;  identifier.assigner as a,  a.display = s;
          id.root as r then {
            id.extension as ext -&gt;  practitioner.id = (r + '-' + ext) as uuid2,  e7.fullUrl = append('https://example/Practitioner/', uuid2),  practitionerRole.practitioner = create('Reference') as reference,  reference.reference = ('https://example/Practitioner/' + %practitioner.id) &quot;aut&quot;;
          } &quot;r&quot;;
          assignedAuthor.id as id where (root = '2.16.840.1.113883.2.9.4.3.2') then {
            id.extension as ext -&gt; request.url = append('Practitioner?identifier=', ext) &quot;UUID&quot;;
          } &quot;2&quot;;
          assignedAuthor.id as id where (root != '2.16.840.1.113883.2.9.4.3.2') then {
            id.extension as ext -&gt; request.url = append('Practitioner?identifier=', ext) &quot;UUID&quot;;
          } &quot;diverso&quot;;
        } &quot;identifier&quot;;
        assignedAuthor.addr -&gt; practitioner.address;
        assignedAuthor.telecom -&gt; practitioner.telecom;
        // person
        assignedAuthor.assignedPerson as person then {
          person.name -&gt; practitioner.name;
          person.birthTime as birthTime then {
            birthTime.value as date -&gt; practitioner.birthDate = truncate(date, 10);
          } &quot;birth&quot;;
        } &quot;name&quot;;
      } &quot;ASSAUth&quot;;
      // organization
      assignedAuthor.representedOrganization as representedOrganization -&gt;  bundle.entry as e8,  e8.request = create('BackboneElement') as request,  request.method = 'PUT',  e8.resource = create('Organization') as organization then {
        representedOrganization -&gt; organization.meta as meta then {
          representedOrganization -&gt; meta.tag = create('Coding') as coding then {
            representedOrganization -&gt; coding.system = 'http://algoritmodiscoring' &quot;system&quot;;
            representedOrganization -&gt; coding.code = 'ClinicalDocument/body/observation/author/representedOrganization' &quot;code&quot;;
          } &quot;coding&quot;;
        } &quot;meta&quot;;
        representedOrganization.id as id -&gt; organization.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 ext -&gt; identifier.value = ext then {
            representedOrganization -&gt; request.url = append('Organization?identifier=', ext) &quot;UUID&quot;;
          } &quot;ext&quot;;
          id.assigningAuthorityName as s -&gt;  identifier.assigner as a,  a.display = s;
          id.root as r then {
            id.extension as ext -&gt;  organization.id = (r + '-' + ext) as uuid3,  e8.fullUrl = append('https://example/Organization/', uuid3),  practitionerRole.organization = create('Reference') as referenceOrg,  referenceOrg.reference = append('https://example/Organization/', uuid3) &quot;org&quot;;
          } &quot;r&quot;;
        } &quot;identifier&quot;;
        representedOrganization.name as v -&gt; organization.name = (v.other);
        representedOrganization.telecom -&gt; organization.telecom;
        representedOrganization.addr -&gt; organization.address;
        representedOrganization.asOrganizationPartOf as OrgPartOf -&gt;  bundle.entry as e9,  e9.request = create('BackboneElement') as request,  request.method = 'PUT',  e9.resource = create('Organization') as organization1 then {
          OrgPartOf -&gt; organization1.meta as meta then {
            OrgPartOf -&gt; meta.tag = create('Coding') as coding then {
              OrgPartOf -&gt; coding.system = 'http://algoritmodiscoring' &quot;system&quot;;
              OrgPartOf -&gt; coding.code = 'ClinicalDocument/body/observation/author/representedOrganization/asOrganizationPartOf' &quot;code&quot;;
            } &quot;coding&quot;;
          } &quot;meta&quot;;
          OrgPartOf.id as id -&gt; organization1.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 ext -&gt; identifier.value = ext then {
              OrgPartOf -&gt; request.url = append('Organization?identifier=', ext) &quot;UUID&quot;;
            } &quot;ext&quot;;
            id.assigningAuthorityName as s -&gt;  identifier.assigner as a,  a.display = s;
            id.root as r then {
              id.extension as ext -&gt;  organization1.id = (r + '-' + ext) as uuid4,  e9.fullUrl = append('https://example/Organization/', uuid4),  organization.partOf = create('Reference') as reference,  reference.reference = ('https://example/Organization/' + %organization1.id) &quot;org&quot;;
            } &quot;r&quot;;
          } &quot;identifier&quot;;
          OrgPartOf.code -&gt; organization1.type;
          OrgPartOf.statusCode as status where (value = 'active') -&gt;  organization1.active = create('boolean'),  organization1.active = 'true';
          OrgPartOf.wholeOrganization as wholeOrgan -&gt;  bundle.entry as e10,  e10.request = create('BackboneElement') as request,  request.method = 'PUT',  e10.resource = create('Organization') as organization2 then {
            wholeOrgan -&gt; organization2.meta as meta then {
              wholeOrgan -&gt; meta.tag = create('Coding') as coding then {
                wholeOrgan -&gt; coding.system = 'http://algoritmodiscoring' &quot;system&quot;;
                wholeOrgan -&gt; coding.code = 'ClinicalDocument/body/observation/author/representedOrganization/asOrganizationPartOf/wholeOrganization' &quot;code&quot;;
              } &quot;coding&quot;;
            } &quot;meta&quot;;
            wholeOrgan.id as id -&gt; organization2.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 ext -&gt; identifier.value = ext then {
                wholeOrgan -&gt; request.url = append('Organization?identifier=', ext) &quot;UUID&quot;;
              } &quot;ext&quot;;
              id.assigningAuthorityName as s -&gt;  identifier.assigner as a,  a.display = s;
              id.root as r then {
                id.extension as ext -&gt;  organization2.id = (r + '-' + ext) as uuid4,  e10.fullUrl = append('https://example/Organization/', uuid4),  organization1.partOf = create('Reference') as reference,  reference.reference = ('https://example/Organization/' + %organization2.id) &quot;org&quot;;
              } &quot;r&quot;;
            } &quot;identifier&quot;;
            wholeOrgan.name as v -&gt; organization2.name = (v.other);
            wholeOrgan.telecom -&gt; organization2.telecom;
            wholeOrgan.addr -&gt; organization2.address;
          };
        } &quot;OrgPartOf&quot;;
      };
      // device
      assignedAuthor.assignedAuthoringDevice as assignedAuthoringDevice -&gt;  bundle.entry as e11,  e11.request = create('BackboneElement') as request,  request.method = 'POST',  e11.resource = create('Device') as device,  device.id = uuid() as uuid11,  e11.fullUrl = append('https://example/Device/', uuid11),  request.url = 'Device',  tgt.author = create('Reference') as reference,  reference.reference = ('https://example/Device/' + %device.id) then {
        assignedAuthoringDevice.templateId -&gt; device.identifier;
        assignedAuthoringDevice.code -&gt; device.type;
        assignedAuthoringDevice.manufacturerModelName as manufacturerModelName then {
          manufacturerModelName as m -&gt; device.manufacturer = (m.displayName) &quot;displayRule&quot;;
        } &quot;manufacturer&quot;;
        assignedAuthoringDevice.softwareName as softwareName -&gt; device.deviceName as deviceName then {
          softwareName -&gt; deviceName.type = 'other' &quot;typeName&quot;;
          softwareName as s -&gt; deviceName.name = (s.displayName) &quot;name&quot;;
        } &quot;deviceName&quot;;
      } &quot;Device&quot;;
    };
  };
  // participant person
  obs.participant as participant where (typeCode != 'DEV') -&gt;  ob.encounter = create('Reference') as reference,  reference.reference = ('https://example/Encounter/' + %encounter.id) then {
    participant -&gt; encounter.participant as FhirParticipant then {
      participant as p -&gt; FhirParticipant.type as type then {
        p -&gt; type.coding as coding then {
          p -&gt; coding.code = (p.typeCode) &quot;codice&quot;;
          p -&gt; coding.system = 'http://terminology.hl7.org/CodeSystem/v3-ParticipationType' &quot;system&quot;;
        } &quot;codeType&quot;;
      } &quot;type&quot;;
    } &quot;fhirParticipant&quot;;
    participant.participantRole as participantRole -&gt;  bundle.entry as e12,  e12.request = create('BackboneElement') as request,  request.method = 'POST',  e12.resource = create('PractitionerRole') as practitionerRole,  practitionerRole.id = uuid() as uuid12,  e12.fullUrl = append('https://example/PractitionerRole/', uuid12),  request.url = 'PractitionerRole',  encounter.participant = create('BackboneElement') as participant1,  participant1.individual = create('Reference') as referencepart,  referencepart.reference = ('https://example/Practitioner/' + %practitionerRole.id) then {
      // participant.time -&gt; participant1.period;
      participant.time as time1 -&gt; participant1.period = create('Period') as period then {
        time1 -&gt; period.start = create('dateTime') as start then TSDateTime(time1, start) &quot;val&quot;;
      };
      participant.time as time1 -&gt; participant1.period = create('Period') as period then IVLTSPeriod(time1, period);
      participant.functionCode -&gt; practitionerRole.code;
      // non mappa i 2 precedenti
      participantRole -&gt;  bundle.entry as e13,  e13.request = create('BackboneElement') as request,  request.method = 'PUT',  e13.resource = create('Practitioner') as practitioner then {
        participantRole -&gt; practitioner.meta as meta then {
          participantRole -&gt; meta.tag = create('Coding') as coding then {
            participantRole -&gt; coding.system = 'http://algoritmodiscoring' &quot;system&quot;;
            participantRole -&gt; coding.code = 'ClinicalDocument/body/observation/participant' &quot;code&quot;;
          } &quot;coding&quot;;
        } &quot;meta&quot;;
        participantRole.id as id -&gt; practitioner.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 ext -&gt; identifier.value = ext then {
            participantRole -&gt; request.url = append('Practitioner?identifier=', ext) &quot;UUID&quot;;
          } &quot;ext&quot;;
          id.assigningAuthorityName as s -&gt;  identifier.assigner as a,  a.display = s;
          id.root as r then {
            id.extension as ext -&gt;  practitioner.id = (r + '-' + ext) as uuid4,  e13.fullUrl = append('https://example/Practitioner/', uuid4),  practitionerRole.practitioner = create('Reference') as reference,  reference.reference = ('https://example/Practitioner/' + %practitioner.id) &quot;org&quot;;
          } &quot;r&quot;;
        } &quot;identifier&quot;;
        participantRole.code -&gt; practitionerRole.code;
        participantRole.addr -&gt; practitioner.address;
        participantRole.telecom -&gt; practitioner.telecom;
        participantRole.playingEntity as playingEntity then {
          playingEntity.name -&gt; practitioner.name;
          playingEntity.birthTime as birthTime then {
            birthTime.value as date -&gt; practitioner.birthDate = truncate(date, 10);
          } &quot;birth&quot;;
        } &quot;name&quot;;
      } &quot;practitioner&quot;;
    } &quot;partRole&quot;;
  } &quot;participantEncounter&quot;;
  // participant device
  obs.participant as devParticipant where (typeCode = 'DEV') -&gt;  bundle.entry as e14,  e14.request = create('BackboneElement') as request,  request.method = 'POST',  e14.resource = create('Device') as device,  device.id = uuid() as uuid14,  e14.fullUrl = append('https://example/Device/', uuid14),  request.url = 'Device',  ob.device = create('Reference') as reference,  reference.reference = ('https://example/Device/' + %device.id) then {
    devParticipant.participantRole as participantRoleDev then {
      participantRoleDev.playingDevice as playingDevice then {
        playingDevice.code -&gt; device.type;
        playingDevice.manufacturerModelName as manufacturerModelName then {
          manufacturerModelName as m -&gt; device.manufacturer = (m.displayName) &quot;displayRule&quot;;
        } &quot;manufacturer&quot;;
        playingDevice.softwareName as softwareName -&gt; device.deviceName as deviceName then {
          softwareName -&gt; deviceName.type = 'other' &quot;typeName&quot;;
          softwareName as s -&gt; deviceName.name = (s.displayName) &quot;name&quot;;
        } &quot;deviceName&quot;;
      };
    } &quot;participantRoleDev&quot;;
  } &quot;devParticipant&quot;;
  // observationMedia
  obs.entryRelationship as er then {
    er.observationMedia as obsMedia -&gt;  bundle.entry as e15,  e15.request = create('BackboneElement') as request,  request.method = 'POST',  e15.resource = create('Media') as media1,  media1.id = uuid() as uuid15,  e15.fullUrl = append('https://example/Media/', uuid15),  request.url = 'Media',  ob.derivedFrom = create('Reference') as reference,  reference.reference = ('https://example/Media/' + %media1.id) then {
      obsMedia -&gt; media1.content = create('Attachment') as Attachment then {
        obsMedia -&gt; media1.status = 'unknown' &quot;status&quot;;
        obsMedia.value as valueMedia then {
          valueMedia.mediaType as type -&gt; Attachment.contentType = type &quot;type&quot;;
          valueMedia -&gt; Attachment.data = (valueMedia.dataBase64Binary) &quot;data&quot;;
        } &quot;valuemedia&quot;;
      } &quot;Attachment&quot;;
    } &quot;media&quot;;
  } &quot;observationMedia&quot;;
  // referenceRange
  obs.referenceRange as refRange -&gt; ob.referenceRange = create('BackboneElement') as ref then {
    refRange.observationRange as obsRange then {
      obsRange.value : ST as value -&gt;  ref.text = create('string'),  ref.text = (value.dataString);
      obsRange -&gt; ref.low = create('Quantity') as Low then {
        obsRange.value : IVL_PQ as v then {
          v.low as l1 then {
            l1.value as decValue -&gt; Low.value = decValue;
            l1.unit as Unit -&gt; Low.unit = Unit;
          } &quot;decValue&quot;;
          v -&gt; ref.high = create('Quantity') as high then {
            v.high as h1 then {
              h1.value as decValue1 -&gt; high.value = decValue1;
              h1.unit as Unit1 -&gt; high.unit = Unit1;
            } &quot;decValue&quot;;
          } &quot;high&quot;;
        } &quot;IVLPQ&quot;;
        obsRange.interpretationCode -&gt; ref.type;
        obsRange.precondition as precondition then {
          precondition.criterion as criterion then {
            criterion.code -&gt; ref.appliesTo &quot;appliesTo&quot;;
            criterion.value : IVL_PQ as v then {
              v.high as l1 then {
                l1 -&gt; ref.age = create('Quantity') as age then {
                  l1 -&gt; age.high as high then {
                    l1.value as decValue -&gt; high.value = decValue;
                    l1.unit as Unit1 -&gt; high.unit = Unit1;
                  } &quot;high&quot;;
                } &quot;age&quot;;
              } &quot;low&quot;;
            } &quot;v&quot;;
          };
        };
      } &quot;obsRange&quot;;
    } &quot;refRange&quot;;
  } &quot;ref&quot;;
}

group Act(source cda : Act, target pat : Patient, target ac : DiagnosticReport, target enc : Encounter, target bundle : Bundle) {
  cda.code -&gt; ac.code;
  cda where cda.statusCode.exists().not() then {
    cda -&gt; ac.status = 'final' &quot;statuscode&quot;;
  } &quot;status&quot;;
  cda.statusCode as statusc where (code = 'completed') -&gt; ac.status = 'final';
  cda.statusCode as statusc where (code = 'active') -&gt; ac.status = 'registered';
  cda.statusCode as statusc where (code = 'aborted') -&gt; ac.status = 'cancelled';
  cda.statusCode as statusc where (code = 'suspended') -&gt; ac.status = 'partial';
  cda.effectiveTime as effectiveTime -&gt; ac.effective = create('dateTime') as value then TSDateTime(effectiveTime, value) &quot;value3&quot;;
  cda where effectiveTime.low.exists() or effectiveTime.high.exists() then {
    cda.effectiveTime as eff -&gt; ac.effective = create('Period') as period then IVLTSPeriod(eff, period);
  } &quot;where&quot;;
  cda -&gt;  ac.subject = create('Reference') as reference,  reference.reference = ('https://example/Patient/' + %pat.id) &quot;reference&quot;;
  cda -&gt;  ac.encounter = create('Reference') as reference,  reference.reference = ('https://example/Encounter/' + %enc.id) &quot;reference&quot;;
  // specimen
  cda where cda.specimen.exists() then {
    cda.specimen as src -&gt;  bundle.entry as e4,  e4.request = create('BackboneElement') as request,  request.method = 'POST',  e4.resource = create('Specimen') as specimen,  specimen.id = uuid() as uuid4,  e4.fullUrl = append('https://example/Specimen/', uuid4),  request.url = 'Specimen',  ac.specimen = create('Reference') as reference,  reference.reference = ('https://example/Specimen/' + %specimen.id) then {
      src.specimenRole as specimenRole then {
        specimenRole.id -&gt; specimen.identifier;
        specimenRole.specimenPlayingEntity as specimenPlayingEntity then {
          specimenPlayingEntity.code -&gt; specimen.type;
        };
      } &quot;SpecimenRole&quot;;
      src -&gt;  specimen.subject = create('Reference') as reference,  reference.reference = ('https://example/Patient/' + %patient.id) &quot;reference&quot;;
      cda.entryRelationship as entryRelationship then {
        entryRelationship.observation as observation then {
          observation -&gt;  bundle.entry as e12,  e12.request = create('BackboneElement') as request,  request.method = 'POST',  e12.resource = create('Observation') as obs,  obs.id = uuid() as uuid13,  e12.fullUrl = append('https://example/Observation/', uuid13),  request.url = 'Observation',  ac.result = create('Reference') as reference,  reference.reference = ('https://example/Observation/' + %obs.id) then {
            observation then Observation2(observation, pat, enc, obs, bundle, cda, specimen) &quot;ORG&quot;;
            // procedure
            cda.entryRelationship as entryRelationship1 then {
              entryRelationship1.procedure as proc -&gt;  bundle.entry as e5,  e5.request = create('BackboneElement') as request,  request.method = 'POST',  e5.resource = create('Procedure') as procedure,  procedure.id = uuid() as uuid5,  e5.fullUrl = append('https://example/Procedure/', uuid5),  request.url = 'Procedure',  obs.partOf = create('Reference') as reference,  reference.reference = ('https://example/Procedure/' + %procedure.id) then {
                proc -&gt;  procedure.subject = create('Reference') as reference,  reference.reference = ('https://example/Patient/' + %patient.id) &quot;reference&quot;;
                proc -&gt;  procedure.encounter = create('Reference') as reference,  reference.reference = ('https://example/Encounter/' + %encounter.id) &quot;reference&quot;;
                proc where proc.statusCode.exists().not() then {
                  proc -&gt; procedure.status = 'unknown' &quot;statuscode&quot;;
                } &quot;status&quot;;
                proc.statusCode as statusc where (code = 'completed') -&gt; procedure.status = 'completed';
                proc.statusCode as statusc where (code = 'active') -&gt; procedure.status = 'in-progress';
                proc.statusCode as statusc where (code = 'aborted') -&gt; procedure.status = 'stopped';
                proc.statusCode as statusc where (code = 'suspended') -&gt; procedure.status = 'on-hold';
                proc.statusCode as statusc where (code = 'cancelled') -&gt; procedure.status = 'not-done';
                proc.statusCode as statusc where (code = 'held') -&gt; procedure.status = 'on-hold';
                proc.statusCode as statusc where (code = 'new') -&gt; procedure.status = 'preparation';
                proc.statusCode as statusc where (code = 'obsolete') -&gt; procedure.status = 'entered-in-error';
                proc.statusCode as statusc where (code = 'nullified') -&gt; procedure.status = 'unknown';
                proc.effectiveTime as effectiveTime -&gt; procedure.performed = create('dateTime') as value then TSDateTime(effectiveTime, value) &quot;datetime&quot;;
                proc where effectiveTime.low.exists() or effectiveTime.high.exists() then {
                  proc.effectiveTime as eff -&gt; procedure.performed = create('Period') as period then IVLTSPeriod(eff, period);
                } &quot;where&quot;;
                proc.targetSiteCode -&gt; procedure.bodySite;
              };
            } &quot;entryRelationshipprocedure&quot;;
          } &quot;obs&quot;;
        };
        entryRelationship.organizer as organizer then {
          organizer -&gt;  bundle.entry as e12,  e12.request = create('BackboneElement') as request,  request.method = 'POST',  e12.resource = create('Observation') as obs,  obs.id = uuid() as uuid13,  e12.fullUrl = append('https://example/Observation/', uuid13),  request.url = 'Observation',  ac.result = create('Reference') as reference,  reference.reference = ('https://example/Observation/' + %obs.id) then {
            organizer then Organizer(cda, organizer, pat, enc, obs, bundle) &quot;ORG&quot;;
            // procedure
            cda.entryRelationship as entryRelationship1 then {
              entryRelationship1.procedure as proc -&gt;  bundle.entry as e5,  e5.request = create('BackboneElement') as request,  request.method = 'POST',  e5.resource = create('Procedure') as procedure,  procedure.id = uuid() as uuid5,  e5.fullUrl = append('https://example/Procedure/', uuid5),  request.url = 'Procedure',  obs.partOf = create('Reference') as reference,  reference.reference = ('https://example/Procedure/' + %procedure.id) then {
                proc -&gt;  procedure.subject = create('Reference') as reference,  reference.reference = ('https://example/Patient/' + %patient.id) &quot;reference&quot;;
                proc -&gt;  procedure.encounter = create('Reference') as reference,  reference.reference = ('https://example/Encounter/' + %encounter.id) &quot;reference&quot;;
                proc where proc.statusCode.exists().not() then {
                  proc -&gt; procedure.status = 'unknown' &quot;statuscode&quot;;
                } &quot;status&quot;;
                proc.statusCode as statusc where (code = 'completed') -&gt; procedure.status = 'completed';
                proc.statusCode as statusc where (code = 'active') -&gt; procedure.status = 'in-progress';
                proc.statusCode as statusc where (code = 'aborted') -&gt; procedure.status = 'stopped';
                proc.statusCode as statusc where (code = 'suspended') -&gt; procedure.status = 'on-hold';
                proc.statusCode as statusc where (code = 'cancelled') -&gt; procedure.status = 'not-done';
                proc.statusCode as statusc where (code = 'held') -&gt; procedure.status = 'on-hold';
                proc.statusCode as statusc where (code = 'new') -&gt; procedure.status = 'preparation';
                proc.statusCode as statusc where (code = 'obsolete') -&gt; procedure.status = 'entered-in-error';
                proc.statusCode as statusc where (code = 'nullified') -&gt; procedure.status = 'unknown';
                proc.effectiveTime as effectiveTime -&gt; procedure.performed = create('dateTime') as value then TSDateTime(effectiveTime, value) &quot;datetime&quot;;
                proc where effectiveTime.low.exists() or effectiveTime.high.exists() then {
                  proc.effectiveTime as eff -&gt; procedure.performed = create('Period') as period then IVLTSPeriod(eff, period);
                } &quot;where&quot;;
                proc.targetSiteCode -&gt; procedure.bodySite;
              } &quot;pbservation&quot;;
            } &quot;entryRelationshiprocedure&quot;;
          } &quot;Organizer&quot;;
        };
      } &quot;entryRelationshipobservation&quot;;
    };
  } &quot;exist&quot;;
  cda where cda.specimen.exists().not() then {
    // cda -&gt; bundle.entry as e4, e4.request = create('BackboneElement') as request, request.method = 'POST', e4.resource = create('Specimen') as specimen,  specimen.id = uuid() as uuid4,  e4.fullUrl = append('https://example/Specimen/', uuid4), request.url = 'Specimen' then {
    cda.entryRelationship as entryRelationship then {
      entryRelationship.observation as observation then {
        observation -&gt;  bundle.entry as e12,  e12.request = create('BackboneElement') as request,  request.method = 'POST',  e12.resource = create('Observation') as obs,  obs.id = uuid() as uuid13,  e12.fullUrl = append('https://example/Observation/', uuid13),  request.url = 'Observation',  ac.result = create('Reference') as reference,  reference.reference = ('https://example/Observation/' + %obs.id) then {
          observation then Observation3(observation, pat, enc, obs, bundle, cda) &quot;ORG&quot;;
          // procedure
          cda.entryRelationship as entryRelationship1 then {
            entryRelationship1.procedure as proc -&gt;  bundle.entry as e5,  e5.request = create('BackboneElement') as request,  request.method = 'POST',  e5.resource = create('Procedure') as procedure,  procedure.id = uuid() as uuid5,  e5.fullUrl = append('https://example/Procedure/', uuid5),  request.url = 'Procedure',  obs.partOf = create('Reference') as reference,  reference.reference = ('https://example/Procedure/' + %procedure.id) then {
              proc -&gt;  procedure.subject = create('Reference') as reference,  reference.reference = ('https://example/Patient/' + %patient.id) &quot;reference&quot;;
              proc -&gt;  procedure.encounter = create('Reference') as reference,  reference.reference = ('https://example/Encounter/' + %encounter.id) &quot;reference&quot;;
              proc where proc.statusCode.exists().not() then {
                proc -&gt; procedure.status = 'unknown' &quot;statuscode&quot;;
              } &quot;status&quot;;
              proc.statusCode as statusc where (code = 'completed') -&gt; procedure.status = 'completed';
              proc.statusCode as statusc where (code = 'active') -&gt; procedure.status = 'in-progress';
              proc.statusCode as statusc where (code = 'aborted') -&gt; procedure.status = 'stopped';
              proc.statusCode as statusc where (code = 'suspended') -&gt; procedure.status = 'on-hold';
              proc.statusCode as statusc where (code = 'cancelled') -&gt; procedure.status = 'not-done';
              proc.statusCode as statusc where (code = 'held') -&gt; procedure.status = 'on-hold';
              proc.statusCode as statusc where (code = 'new') -&gt; procedure.status = 'preparation';
              proc.statusCode as statusc where (code = 'obsolete') -&gt; procedure.status = 'entered-in-error';
              proc.statusCode as statusc where (code = 'nullified') -&gt; procedure.status = 'unknown';
              proc.effectiveTime as effectiveTime -&gt; procedure.performed = create('dateTime') as value then TSDateTime(effectiveTime, value) &quot;datetime&quot;;
              proc where effectiveTime.low.exists() or effectiveTime.high.exists() then {
                proc.effectiveTime as eff -&gt; procedure.performed = create('Period') as period then IVLTSPeriod(eff, period);
              } &quot;where&quot;;
              proc.targetSiteCode -&gt; procedure.bodySite;
            };
          } &quot;entryRelationshipprocedure&quot;;
        } &quot;obs&quot;;
      };
      entryRelationship.organizer as organizer then {
        organizer -&gt;  bundle.entry as e12,  e12.request = create('BackboneElement') as request,  request.method = 'POST',  e12.resource = create('Observation') as obs,  obs.id = uuid() as uuid13,  e12.fullUrl = append('https://example/Observation/', uuid13),  request.url = 'Observation',  ac.result = create('Reference') as reference,  reference.reference = ('https://example/Observation/' + %obs.id) then {
          organizer then Organizer(cda, organizer, pat, enc, obs, bundle) &quot;ORG&quot;;
          // procedure
          cda.entryRelationship as entryRelationship1 then {
            entryRelationship1.procedure as proc -&gt;  bundle.entry as e5,  e5.request = create('BackboneElement') as request,  request.method = 'POST',  e5.resource = create('Procedure') as procedure,  procedure.id = uuid() as uuid5,  e5.fullUrl = append('https://example/Procedure/', uuid5),  request.url = 'Procedure',  obs.partOf = create('Reference') as reference,  reference.reference = ('https://example/Procedure/' + %procedure.id) then {
              proc -&gt;  procedure.subject = create('Reference') as reference,  reference.reference = ('https://example/Patient/' + %patient.id) &quot;reference&quot;;
              proc -&gt;  procedure.encounter = create('Reference') as reference,  reference.reference = ('https://example/Encounter/' + %encounter.id) &quot;reference&quot;;
              proc where proc.statusCode.exists().not() then {
                proc -&gt; procedure.status = 'unknown' &quot;statuscode&quot;;
              } &quot;status&quot;;
              proc.statusCode as statusc where (code = 'completed') -&gt; procedure.status = 'completed';
              proc.statusCode as statusc where (code = 'active') -&gt; procedure.status = 'in-progress';
              proc.statusCode as statusc where (code = 'aborted') -&gt; procedure.status = 'stopped';
              proc.statusCode as statusc where (code = 'suspended') -&gt; procedure.status = 'on-hold';
              proc.statusCode as statusc where (code = 'cancelled') -&gt; procedure.status = 'not-done';
              proc.statusCode as statusc where (code = 'held') -&gt; procedure.status = 'on-hold';
              proc.statusCode as statusc where (code = 'new') -&gt; procedure.status = 'preparation';
              proc.statusCode as statusc where (code = 'obsolete') -&gt; procedure.status = 'entered-in-error';
              proc.statusCode as statusc where (code = 'nullified') -&gt; procedure.status = 'unknown';
              proc.effectiveTime as effectiveTime -&gt; procedure.performed = create('dateTime') as value then TSDateTime(effectiveTime, value) &quot;datetime&quot;;
              proc where effectiveTime.low.exists() or effectiveTime.high.exists() then {
                proc.effectiveTime as eff -&gt; procedure.performed = create('Period') as period then IVLTSPeriod(eff, period);
              } &quot;where&quot;;
              proc.targetSiteCode -&gt; procedure.bodySite;
            } &quot;pbservation&quot;;
          } &quot;entryRelationshiprocedure&quot;;
        } &quot;Organizer&quot;;
      };
    } &quot;entryRelationshipobservation&quot;;
  } &quot;existnot&quot;;
  // PARTICIPANT
  cda.participant as part where (typeCode != 'DEV') -&gt; enc.participant as participant then {
    part -&gt; participant.type as type then {
      part -&gt; type.coding as coding then {
        part -&gt; coding.code = (part.typeCode) &quot;codice&quot;;
        part -&gt; coding.system = 'http://terminology.hl7.org/CodeSystem/v3-ParticipationType' &quot;system&quot;;
      } &quot;codeType&quot;;
    } &quot;type&quot;;
    part.participantRole as participantRole -&gt; participant.individual = create('Reference') as reference then {
      participantRole -&gt;  bundle.entry as e,  e.request = create('BackboneElement') as request,  request.method = 'PUT',  e.resource = create('Practitioner') as practitioner then {
        part.time as time1 -&gt; participant.period = create('Period') as period then {
          time1 -&gt; period.start = create('dateTime') as start then TSDateTime(time1, start) &quot;val&quot;;
        };
        part.time as time1 -&gt; participant.period = create('Period') as period then IVLTSPeriod(time1, period);
        participantRole -&gt; practitioner.meta as meta then {
          participantRole -&gt; meta.tag = create('Coding') as coding then {
            participantRole -&gt; coding.system = 'http://algoritmodiscoring' &quot;system&quot;;
            participantRole -&gt; coding.code = 'ClinicalDocument/body/act/participant' &quot;code&quot;;
          } &quot;coding&quot;;
        } &quot;meta&quot;;
        participantRole.id as id -&gt; practitioner.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 ext -&gt; identifier.value = ext then {
            participantRole -&gt; request.url = append('Practitioner?identifier=', ext) &quot;UUID&quot;;
          } &quot;ext&quot;;
          id.assigningAuthorityName as s -&gt;  identifier.assigner as a,  a.display = s;
          id.root as r then {
            id.extension as ext -&gt;  practitioner.id = (r + '-' + ext) as uuid4,  e.fullUrl = append('https://example/Practitioner/', uuid4),  reference.reference = ('https://example/Practitioner/' + %practitioner.id) &quot;org&quot;;
          } &quot;r&quot;;
        } &quot;identifier&quot;;
        participantRole.addr -&gt; practitioner.address;
        participantRole.playingEntity as playingEntity then {
          playingEntity.name -&gt; practitioner.name;
        };
      } &quot;participanRoleBund&quot;;
    };
  };
  // PERFORMER
  cda.performer as performer -&gt;  bundle.entry as e1,  e1.request = create('BackboneElement') as request,  request.method = 'POST',  e1.resource = create('PractitionerRole') as practitionerRole,  practitionerRole.id = uuid() as uuid1,  e1.fullUrl = append('https://example/PractitionerRole/', uuid1),  request.url = 'PractitionerRole',  ac.performer = create('Reference') as reference,  reference.reference = ('https://example/PractitionerRole/' + %practitionerRole.id) then {
    performer.assignedEntity as assignedEntity then {
      assignedEntity.code as codice -&gt; practitionerRole.code;
      assignedEntity -&gt;  bundle.entry as e2,  e2.request = create('BackboneElement') as request,  request.method = 'PUT',  e2.resource = create('Practitioner') as practitioner then {
        assignedEntity.code -&gt; practitionerRole.code;
        assignedEntity -&gt; practitioner.meta as meta then {
          assignedEntity -&gt; meta.tag = create('Coding') as coding then {
            assignedEntity -&gt; coding.system = 'http://algoritmodiscoring' &quot;system&quot;;
            assignedEntity -&gt; coding.code = 'ClinicalDocument/body/act/performer' &quot;code&quot;;
          } &quot;coding&quot;;
        } &quot;meta&quot;;
        assignedEntity.id as id -&gt; practitioner.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 ext -&gt; identifier.value = ext then {
            assignedEntity -&gt; request.url = append('Practitioner?identifier=', ext) &quot;UUID&quot;;
          } &quot;ext&quot;;
          id.assigningAuthorityName as s -&gt;  identifier.assigner as a,  a.display = s;
          id.root as r then {
            id.extension as ext -&gt;  practitioner.id = (r + '-' + ext) as uuid4,  e2.fullUrl = append('https://example/Practitioner/', uuid4),  practitionerRole.practitioner = create('Reference') as reference,  reference.reference = ('https://example/Practitioner/' + %practitioner.id) &quot;pra&quot;;
          } &quot;r&quot;;
        } &quot;identifier&quot;;
        assignedEntity.addr -&gt; practitioner.address;
        assignedEntity.telecom -&gt; practitioner.telecom;
        assignedEntity.assignedPerson as person then {
          person.name -&gt; practitioner.name;
          person.birthTime as birthTime then {
            birthTime.value as date -&gt; practitioner.birthDate = truncate(date, 10);
          } &quot;birth&quot;;
        } &quot;name&quot;;
      } &quot;ASSAUth&quot;;
      assignedEntity.representedOrganization as representedOrganization -&gt;  bundle.entry as e3,  e3.request = create('BackboneElement') as request,  request.method = 'PUT',  e3.resource = create('Organization') as organization then {
        representedOrganization -&gt; organization.meta as meta then {
          representedOrganization -&gt; meta.tag = create('Coding') as coding then {
            representedOrganization -&gt; coding.system = 'http://algoritmodiscoring' &quot;system&quot;;
            representedOrganization -&gt; coding.code = 'ClinicalDocument/body/act/representedOrganization' &quot;code&quot;;
          } &quot;coding&quot;;
        } &quot;meta&quot;;
        representedOrganization.id as id -&gt; organization.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 ext -&gt; identifier.value = ext then {
            representedOrganization -&gt; request.url = append('Organization?identifier=', ext) &quot;UUID&quot;;
          } &quot;ext&quot;;
          id.assigningAuthorityName as s -&gt;  identifier.assigner as a,  a.display = s;
          id.root as r then {
            id.extension as ext -&gt;  organization.id = (r + '-' + ext) as uuid2,  e3.fullUrl = append('https://example/Organization/', uuid2),  practitionerRole.organization = create('Reference') as referenceOrg,  referenceOrg.reference = append('https://example/Organization/', uuid2) &quot;org&quot;;
          } &quot;r&quot;;
        } &quot;identifier&quot;;
        representedOrganization.name as v -&gt; organization.name = (v.other);
        representedOrganization.telecom -&gt; organization.telecom;
        representedOrganization.addr -&gt; organization.address;
        representedOrganization.asOrganizationPartOf as OrgPartOf -&gt;  bundle.entry as e4,  e4.request = create('BackboneElement') as request,  request.method = 'PUT',  e4.resource = create('Organization') as organization1 then {
          OrgPartOf -&gt; organization1.meta as meta then {
            OrgPartOf -&gt; meta.tag = create('Coding') as coding then {
              OrgPartOf -&gt; coding.system = 'http://algoritmodiscoring' &quot;system&quot;;
              OrgPartOf -&gt; coding.code = 'ClinicalDocument/body/act/representedOrganization/asOrganizationPartOf' &quot;code&quot;;
            } &quot;coding&quot;;
          } &quot;meta&quot;;
          OrgPartOf.id as id -&gt; organization1.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 ext -&gt; identifier.value = ext then {
              OrgPartOf -&gt; request.url = append('Organization?identifier=', ext) &quot;UUID&quot;;
            } &quot;ext&quot;;
            id.assigningAuthorityName as s -&gt;  identifier.assigner as a,  a.display = s;
            id.root as r then {
              id.extension as ext -&gt;  organization1.id = (r + '-' + ext) as uuid3,  organization1.id = uuid() as uuid3,  e4.fullUrl = append('https://example/Organization/', uuid3),  organization.partOf = create('Reference') as reference,  reference.reference = ('https://example/Organization/' + %organization1.id) &quot;org&quot;;
            } &quot;r&quot;;
          } &quot;identifier&quot;;
          OrgPartOf.code -&gt; organization1.type;
          OrgPartOf.statusCode as status where (value = 'active') -&gt;  organization1.active = create('boolean'),  organization1.active = 'true';
          OrgPartOf.wholeOrganization as wholeOrgan -&gt;  bundle.entry as e10bis,  e10bis.request = create('BackboneElement') as request,  request.method = 'PUT',  e10bis.resource = create('Organization') as organization2 then {
            OrgPartOf -&gt; organization2.meta as meta then {
              OrgPartOf -&gt; meta.tag = create('Coding') as coding then {
                OrgPartOf -&gt; coding.system = 'http://algoritmodiscoring' &quot;system&quot;;
                OrgPartOf -&gt; coding.code = 'ClinicalDocument/body/act/representedOrganization/asOrganizationPartOf/wholeOrganization' &quot;code&quot;;
              } &quot;coding&quot;;
            } &quot;meta&quot;;
            wholeOrgan.id as id -&gt; organization2.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 ext -&gt; identifier.value = ext then {
                wholeOrgan -&gt; request.url = append('Organization?identifier=', ext) &quot;UUID&quot;;
              } &quot;ext&quot;;
              id.assigningAuthorityName as s -&gt;  identifier.assigner as a,  a.display = s;
              id.root as r then {
                id.extension as ext -&gt;  organization2.id = (r + '-' + ext) as uuid5,  e10bis.fullUrl = append('https://example/Organization/', uuid5),  organization1.partOf = create('Reference') as reference,  reference.reference = ('https://example/Organization/' + %organization2.id) &quot;org&quot;;
              } &quot;r&quot;;
            } &quot;identifier&quot;;
            wholeOrgan.name as v -&gt; organization2.name = (v.other);
            wholeOrgan.telecom -&gt; organization2.telecom;
            wholeOrgan.addr -&gt; organization2.address;
          };
        } &quot;OrgPartOf&quot;;
      };
    } &quot;performer&quot;;
  };
  // AUTHOR
  cda.author as srcAuthor -&gt;  bundle.entry as e5,  e5.request = create('BackboneElement') as request,  request.method = 'POST',  e5.resource = create('PractitionerRole') as practitionerRole,  practitionerRole.id = uuid() as uuid6,  e5.fullUrl = append('https://example/PractitionerRole/', uuid6),  request.url = 'PractitionerRole',  ac.performer = create('Reference') as reference,  reference.reference = ('https://example/PractitionerRole/' + %practitionerRole.id) then {
    srcAuthor.assignedAuthor as assignedAuthor then {
      assignedAuthor.code as codice -&gt; practitionerRole.code;
      assignedAuthor -&gt;  bundle.entry as e7,  e7.request = create('BackboneElement') as request,  request.method = 'PUT',  e7.resource = create('Practitioner') as practitioner then {
        srcAuthor.functionCode -&gt; practitionerRole.code;
        assignedAuthor.code -&gt; practitionerRole.code;
        assignedAuthor -&gt; practitioner.meta as meta then {
          assignedAuthor -&gt; meta.tag = create('Coding') as coding then {
            assignedAuthor -&gt; coding.system = 'http://algoritmodiscoring' &quot;system&quot;;
            assignedAuthor -&gt; coding.code = 'ClinicalDocument/body/act/author' &quot;code&quot;;
          } &quot;coding&quot;;
        } &quot;meta&quot;;
        assignedAuthor.id as id -&gt; practitioner.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 ext -&gt; identifier.value = ext then {
            assignedAuthor -&gt; request.url = append('Practitioner?identifier=', ext) &quot;UUID&quot;;
          } &quot;ext&quot;;
          id.assigningAuthorityName as s -&gt;  identifier.assigner as a,  a.display = s;
          id.root as r then {
            id.extension as ext -&gt;  practitioner.id = (r + '-' + ext) as uuid2,  e7.fullUrl = append('https://example/Practitioner/', uuid2),  practitionerRole.practitioner = create('Reference') as reference,  reference.reference = ('https://example/Practitioner/' + %practitioner.id) &quot;aut&quot;;
          } &quot;r&quot;;
        } &quot;identifier&quot;;
        assignedAuthor.id as id where (root = '2.16.840.1.113883.2.9.4.3.2') then {
          id.extension as ext -&gt; request.url = append('Practitioner?identifier=', ext) &quot;UUID&quot;;
        } &quot;2&quot;;
        assignedAuthor.id as id where (root != '2.16.840.1.113883.2.9.4.3.2') then {
          id.extension as ext -&gt; request.url = append('Practitioner?identifier=', ext) &quot;UUID&quot;;
        } &quot;diverso&quot;;
        assignedAuthor.addr -&gt; practitioner.address;
        assignedAuthor.telecom -&gt; practitioner.telecom;
        // person
        assignedAuthor.assignedPerson as person then {
          person.name -&gt; practitioner.name;
          person.birthTime as birthTime then {
            birthTime.value as date -&gt; practitioner.birthDate = truncate(date, 10);
          } &quot;birth&quot;;
        } &quot;name&quot;;
      } &quot;ASSAUth&quot;;
      // organization
      assignedAuthor.representedOrganization as representedOrganization -&gt;  bundle.entry as e8,  e8.request = create('BackboneElement') as request,  request.method = 'PUT',  e8.resource = create('Organization') as organization then {
        representedOrganization -&gt; organization.meta as meta then {
          representedOrganization -&gt; meta.tag = create('Coding') as coding then {
            representedOrganization -&gt; coding.system = 'http://algoritmodiscoring' &quot;system&quot;;
            representedOrganization -&gt; coding.code = 'ClinicalDocument/body/act/author/representedOrganization' &quot;code&quot;;
          } &quot;coding&quot;;
        } &quot;meta&quot;;
        representedOrganization.id as id -&gt; organization.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 ext -&gt; identifier.value = ext then {
            representedOrganization -&gt; request.url = append('Organization?identifier=', ext) &quot;UUID&quot;;
          } &quot;ext&quot;;
          id.assigningAuthorityName as s -&gt;  identifier.assigner as a,  a.display = s;
          id.root as r then {
            id.extension as ext -&gt;  organization.id = (r + '-' + ext) as uuid8,  e8.fullUrl = append('https://example/Organization/', uuid8),  practitionerRole.organization = create('Reference') as referenceOrg,  referenceOrg.reference = append('https://example/Organization/', uuid8) &quot;org&quot;;
          } &quot;r&quot;;
        } &quot;identifier&quot;;
        representedOrganization.name as v -&gt; organization.name = (v.other);
        representedOrganization.telecom -&gt; organization.telecom;
        representedOrganization.addr -&gt; organization.address;
        representedOrganization.asOrganizationPartOf as OrgPartOf -&gt;  bundle.entry as e9,  e9.request = create('BackboneElement') as request,  request.method = 'PUT',  e9.resource = create('Organization') as organization1 then {
          OrgPartOf -&gt; organization1.meta as meta then {
            OrgPartOf -&gt; meta.tag = create('Coding') as coding then {
              OrgPartOf -&gt; coding.system = 'http://algoritmodiscoring' &quot;system&quot;;
              OrgPartOf -&gt; coding.code = 'ClinicalDocument/body/act/author/representedOrganization/asOrganizationPartOf' &quot;code&quot;;
            } &quot;coding&quot;;
          } &quot;meta&quot;;
          OrgPartOf.id as id -&gt; organization1.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 ext -&gt; identifier.value = ext then {
              OrgPartOf -&gt; request.url = append('Organization?identifier=', ext) &quot;UUID&quot;;
            } &quot;ext&quot;;
            id.assigningAuthorityName as s -&gt;  identifier.assigner as a,  a.display = s;
            id.root as r then {
              id.extension as ext -&gt;  organization1.id = (r + '-' + ext) as uuid9,  e9.fullUrl = append('https://example/Organization/', uuid9),  organization.partOf = create('Reference') as reference,  reference.reference = ('https://example/Organization/' + %organization1.id) &quot;org&quot;;
            } &quot;r&quot;;
          } &quot;identifier&quot;;
          OrgPartOf.code -&gt; organization1.type;
          OrgPartOf.statusCode as status where (value = 'active') -&gt;  organization1.active = create('boolean'),  organization1.active = 'true';
          OrgPartOf.wholeOrganization as wholeOrgan -&gt;  bundle.entry as e10,  e10.request = create('BackboneElement') as request,  request.method = 'PUT',  e10.resource = create('Organization') as organization2 then {
            wholeOrgan -&gt; organization2.meta as meta then {
              wholeOrgan -&gt; meta.tag = create('Coding') as coding then {
                wholeOrgan -&gt; coding.system = 'http://algoritmodiscoring' &quot;system&quot;;
                wholeOrgan -&gt; coding.code = 'ClinicalDocument/body/act/author/representedOrganization/asOrganizationPartOf/wholeOrganization' &quot;code&quot;;
              } &quot;coding&quot;;
            } &quot;meta&quot;;
            wholeOrgan.id as id -&gt; organization2.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 ext -&gt; identifier.value = ext then {
                wholeOrgan -&gt; request.url = append('Organization?identifier=', ext) &quot;UUID&quot;;
              } &quot;ext&quot;;
              id.assigningAuthorityName as s -&gt;  identifier.assigner as a,  a.display = s;
              id.root as r then {
                id.extension as ext -&gt;  organization2.id = (r + '-' + ext) as uuid10,  e10.fullUrl = append('https://example/Organization/', uuid10),  organization1.partOf = create('Reference') as reference,  reference.reference = ('https://example/Organization/' + %organization2.id) &quot;org&quot;;
              } &quot;r&quot;;
            } &quot;identifier&quot;;
            wholeOrgan.name as v -&gt; organization2.name = (v.other);
            wholeOrgan.telecom -&gt; organization2.telecom;
            wholeOrgan.addr -&gt; organization2.address;
          };
        } &quot;OrgPartOf&quot;;
      };
    } &quot;author&quot;;
  };
  // &lt;!--entryRelationship per la gestione delle note e commenti--&gt;
  cda.entryRelationship as entryRelationship then {
    entryRelationship.act as act then {
      act.text as text then {
        text.reference as reference -&gt; ac.conclusion = (reference.value);
      };
    } &quot;Act&quot;;
  };
}

group Organizer(source cda : Act, source org : Organizer, target patient : Patient, target encounter : Encounter, target observation : Observation, target bundle : Bundle) {
  org -&gt;  observation.subject = create('Reference') as reference,  reference.reference = ('https://example/Patient/' + %patient.id) &quot;reference&quot;;
  org -&gt;  observation.encounter = create('Reference') as reference,  reference.reference = ('https://example/Encounter/' + %encounter.id) &quot;reference&quot;;
  org.code -&gt; observation.code;
  org where org.code.exists().not() then {
    cda.code -&gt; observation.code;
  } &quot;act&quot;;
  org.statusCode as statusc where (code = 'completed') -&gt; observation.status = 'final';
  org.statusCode as statusc where (code = 'active') -&gt; observation.status = 'registered';
  org.statusCode as statusc where (code = 'aborted') -&gt; observation.status = 'cancelled';
  org.statusCode as statusc where (code = 'suspended') -&gt; observation.status = 'partial';
  org.effectiveTime as effectiveTime -&gt; observation.effective = create('dateTime') as value then TSDateTime(effectiveTime, value) &quot;value2&quot;;
  org where effectiveTime.low.exists() or effectiveTime.high.exists() then {
    org.effectiveTime as eff -&gt; observation.effective = create('Period') as period then IVLTSPeriod(eff, period);
  } &quot;where&quot;;
  // specimen
  org.specimen as spmn -&gt;  bundle.entry as e4o,  e4o.request = create('BackboneElement') as request,  request.method = 'POST',  e4o.resource = create('Specimen') as specimen,  specimen.id = uuid() as uuid4o,  e4o.fullUrl = append('https://example/Specimen/', uuid4o),  request.url = 'Specimen',  observation.specimen = create('Reference') as reference,  reference.reference = ('https://example/Specimen/' + %specimen.id) then {
    spmn.specimenRole as specimenRole then {
      specimenRole.id as id -&gt; specimen.identifier;
      specimenRole.specimenPlayingEntity as specimenPlayingEntity then {
        specimenPlayingEntity.code -&gt; specimen.type;
      };
    };
  };
  // subject
  org.subject as sbj then {
    sbj.relatedSubject as relatedSubj -&gt; patient.extension as extension2 then ExtSubjectAnimal(relatedSubj, extension2);
  };
  // performer
  org.performer as performer -&gt;  bundle.entry as e1,  e1.request = create('BackboneElement') as request,  request.method = 'POST',  e1.resource = create('PractitionerRole') as practitionerRole,  practitionerRole.id = uuid() as uuid1,  e1.fullUrl = append('https://example/PractitionerRole/', uuid1),  request.url = 'PractitionerRole' then {
    performer -&gt;  observation.performer = create('Reference') as reference,  reference.reference = ('https://example/PractitionerRole/' + %practitionerRole.id) then {
      performer.assignedEntity as entity then {
        entity.code -&gt; practitionerRole.code;
        entity -&gt;  bundle.entry as e2,  e2.request = create('BackboneElement') as request,  request.method = 'PUT',  e2.resource = create('Practitioner') as practitioner then {
          entity -&gt; practitioner.meta as meta then {
            entity -&gt; meta.tag = create('Coding') as coding then {
              entity -&gt; coding.system = 'http://algoritmodiscoring' &quot;system&quot;;
              entity -&gt; coding.code = 'ClinicalDocument/body/organizer/performer' &quot;code&quot;;
            } &quot;coding&quot;;
          } &quot;meta&quot;;
          entity.id as id -&gt; practitioner.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 ext -&gt; identifier.value = ext then {
              entity -&gt; request.url = append('Practitioner?identifier=', ext) &quot;UUID&quot;;
            } &quot;ext&quot;;
            id.assigningAuthorityName as s -&gt;  identifier.assigner as a,  a.display = s;
            id.root as r then {
              id.extension as ext -&gt;  practitioner.id = (r + '-' + ext) as uuid2,  e2.fullUrl = append('https://example/Practitioner/', uuid2),  practitionerRole.practitioner = create('Reference') as reference,  reference.reference = ('https://example/Practitioner/' + %practitioner.id) &quot;aut&quot;;
            } &quot;r&quot;;
          } &quot;identifier&quot;;
          entity.id as id where (root = '2.16.840.1.113883.2.9.4.3.2') then {
            id.extension as ext -&gt; request.url = append('Practitioner?identifier=', ext) &quot;UUID&quot;;
          } &quot;2&quot;;
          entity.id as id where (root != '2.16.840.1.113883.2.9.4.3.2') then {
            id.extension as ext -&gt; request.url = append('Practitioner?identifier=', ext) &quot;UUID&quot;;
          } &quot;diverso&quot;;
          entity.addr -&gt; practitioner.address;
          entity.telecom -&gt; practitioner.telecom;
          entity.assignedPerson as person then {
            person.name -&gt; practitioner.name;
            person.birthTime as birthTime then {
              birthTime.value as date -&gt; practitioner.birthDate = truncate(date, 10);
            } &quot;birth&quot;;
          } &quot;name&quot;;
          entity.representedOrganization as representedOrganization -&gt;  bundle.entry as e3,  e3.request = create('BackboneElement') as request,  request.method = 'PUT',  e3.resource = create('Organization') as organization then {
            representedOrganization -&gt; organization.meta as meta then {
              representedOrganization -&gt; meta.tag = create('Coding') as coding then {
                representedOrganization -&gt; coding.system = 'http://algoritmodiscoring' &quot;system&quot;;
                representedOrganization -&gt; coding.code = 'ClinicalDocument/body/organizer/performer/representedOrganization' &quot;code&quot;;
              } &quot;coding&quot;;
            } &quot;meta&quot;;
            representedOrganization.id as id -&gt; organization.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 ext -&gt; identifier.value = ext then {
                representedOrganization -&gt; request.url = append('Organization?identifier=', ext) &quot;UUID&quot;;
              } &quot;ext&quot;;
              id.assigningAuthorityName as s -&gt;  identifier.assigner as a,  a.display = s;
              id.root as r then {
                id.extension as ext -&gt;  organization.id = (r + '-' + ext) as uuid3,  e3.fullUrl = append('https://example/Organization/', uuid3),  practitionerRole.organization = create('Reference') as referenceOrg,  referenceOrg.reference = append('https://example/Organization/', uuid3) &quot;aut&quot;;
              } &quot;r&quot;;
            } &quot;identifier&quot;;
            representedOrganization.name as v -&gt; organization.name = (v.other);
            representedOrganization.telecom -&gt; organization.telecom;
            representedOrganization.addr -&gt; organization.address;
            representedOrganization.asOrganizationPartOf as OrgPartOf -&gt;  bundle.entry as e4,  e4.request = create('BackboneElement') as request,  request.method = 'PUT',  e4.resource = create('Organization') as organization1 then {
              OrgPartOf -&gt; organization1.meta as meta then {
                OrgPartOf -&gt; meta.tag = create('Coding') as coding then {
                  OrgPartOf -&gt; coding.system = 'http://algoritmodiscoring' &quot;system&quot;;
                  OrgPartOf -&gt; coding.code = 'ClinicalDocument/body/organizer/performer/representedOrganization/asOrganizationPartOf' &quot;code&quot;;
                } &quot;coding&quot;;
              } &quot;meta&quot;;
              OrgPartOf.id as id -&gt; organization1.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 ext -&gt; identifier.value = ext then {
                  OrgPartOf -&gt; request.url = append('Organization?identifier=', ext) &quot;UUID&quot;;
                } &quot;ext&quot;;
                id.assigningAuthorityName as s -&gt;  identifier.assigner as a,  a.display = s;
                id.root as r then {
                  id.extension as ext -&gt;  organization1.id = (r + '-' + ext) as uuid4,  e4.fullUrl = append('https://example/Organization/', uuid4),  organization.partOf = create('Reference') as reference,  reference.reference = ('https://example/Organization/' + %organization1.id) &quot;org&quot;;
                } &quot;r&quot;;
              } &quot;identifier&quot;;
              OrgPartOf.code -&gt; organization1.type;
              OrgPartOf.statusCode as status where (value = 'active') -&gt;  organization1.active = create('boolean'),  organization1.active = 'true';
              OrgPartOf.wholeOrganization as wholeOrgan -&gt;  bundle.entry as e5,  e5.request = create('BackboneElement') as request,  request.method = 'PUT',  e5.resource = create('Organization') as organization2 then {
                wholeOrgan -&gt; organization2.meta as meta then {
                  wholeOrgan -&gt; meta.tag = create('Coding') as coding then {
                    wholeOrgan -&gt; coding.system = 'http://algoritmodiscoring' &quot;system&quot;;
                    wholeOrgan -&gt; coding.code = 'ClinicalDocument/body/organizer/performer/representedOrganization/asOrganizationPartOf/wholeOrganization' &quot;code&quot;;
                  } &quot;coding&quot;;
                } &quot;meta&quot;;
                wholeOrgan.id as id -&gt; organization2.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 ext -&gt; identifier.value = ext then {
                    wholeOrgan -&gt; request.url = append('Organization?identifier=', ext) &quot;UUID&quot;;
                  } &quot;ext&quot;;
                  id.assigningAuthorityName as s -&gt;  identifier.assigner as a,  a.display = s;
                  id.root as r then {
                    id.extension as ext -&gt;  organization2.id = (r + '-' + ext) as uuid4,  e5.fullUrl = append('https://example/Organization/', uuid4),  organization1.partOf = create('Reference') as reference,  reference.reference = ('https://example/Organization/' + %organization2.id) &quot;org&quot;;
                  } &quot;r&quot;;
                } &quot;identifier&quot;;
                wholeOrgan.name as v -&gt; organization2.name = (v.other);
                wholeOrgan.telecom -&gt; organization2.telecom;
                wholeOrgan.addr -&gt; organization2.address;
              };
            } &quot;OrgPartOf&quot;;
          };
        } &quot;practitioner&quot;;
      } &quot;entity&quot;;
    } &quot;practitionerRole&quot;;
  };
  // author
  org.author as srcAuthor -&gt;  bundle.entry as e6,  e6.request = create('BackboneElement') as request,  request.method = 'POST',  e6.resource = create('PractitionerRole') as practitionerRole,  practitionerRole.id = uuid() as uuid6,  e6.fullUrl = append('https://example/PractitionerRole/', uuid6),  request.url = 'PractitionerRole',  observation.performer = create('Reference') as referenceaut,  referenceaut.reference = ('https://example/PractitionerRole/' + %practitionerRole.id) then {
    // srcAuthor.time as time -&gt; tgt.date;
    srcAuthor.assignedAuthor as assignedAuthor then {
      assignedAuthor.code as codice -&gt; practitionerRole.code as code2 then CECodeableConcept(codice, code2);
      assignedAuthor -&gt;  bundle.entry as e7,  e7.request = create('BackboneElement') as request,  request.method = 'PUT',  e7.resource = create('Practitioner') as practitioner then {
        srcAuthor.functionCode -&gt; practitionerRole.code;
        // assignedAuthor.code -&gt; practitionerRole.code;
        assignedAuthor -&gt; practitioner.meta as meta then {
          assignedAuthor -&gt; meta.tag = create('Coding') as coding then {
            assignedAuthor -&gt; coding.system = 'http://algoritmodiscoring' &quot;system&quot;;
            assignedAuthor -&gt; coding.code = 'ClinicalDocument/body/organizer/author' &quot;code&quot;;
          } &quot;coding&quot;;
        } &quot;meta&quot;;
        assignedAuthor.id as id -&gt; practitioner.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 ext -&gt; identifier.value = ext then {
            assignedAuthor -&gt; request.url = append('Practitioner?identifier=', ext) &quot;UUID&quot;;
          } &quot;ext&quot;;
          id.assigningAuthorityName as s -&gt;  identifier.assigner as a,  a.display = s;
          id.root as r then {
            id.extension as ext -&gt;  practitioner.id = (r + '-' + ext) as uuid7,  e7.fullUrl = append('https://example/Practitioner/', uuid7),  practitionerRole.practitioner = create('Reference') as reference,  reference.reference = ('https://example/Practitioner/' + %practitioner.id) &quot;aut&quot;;
          } &quot;r&quot;;
        } &quot;identifier&quot;;
        assignedAuthor.id as id where (root = '2.16.840.1.113883.2.9.4.3.2') then {
          id.extension as ext -&gt; request.url = append('Practitioner?identifier=', ext) &quot;UUID&quot;;
        } &quot;2&quot;;
        assignedAuthor.id as id where (root != '2.16.840.1.113883.2.9.4.3.2') then {
          id.extension as ext -&gt; request.url = append('Practitioner?identifier=', ext) &quot;UUID&quot;;
        } &quot;diverso&quot;;
        assignedAuthor.addr -&gt; practitioner.address;
        assignedAuthor.telecom -&gt; practitioner.telecom;
        // person
        assignedAuthor.assignedPerson as person then {
          person.name -&gt; practitioner.name;
          person.birthTime as birthTime then {
            birthTime.value as date -&gt; practitioner.birthDate = truncate(date, 10);
          } &quot;birth&quot;;
        } &quot;name&quot;;
      } &quot;ASSAUth&quot;;
      // organization
      assignedAuthor.representedOrganization as representedOrganization -&gt;  bundle.entry as e8,  e8.request = create('BackboneElement') as request,  request.method = 'PUT',  e8.resource = create('Organization') as organization then {
        representedOrganization -&gt; organization.meta as meta then {
          representedOrganization -&gt; meta.tag = create('Coding') as coding then {
            representedOrganization -&gt; coding.system = 'http://algoritmodiscoring' &quot;system&quot;;
            representedOrganization -&gt; coding.code = 'ClinicalDocument/body/organizer/author/representedOrganization' &quot;code&quot;;
          } &quot;coding&quot;;
        } &quot;meta&quot;;
        representedOrganization.id as id -&gt; organization.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 ext -&gt; identifier.value = ext then {
            representedOrganization -&gt; request.url = append('Organization?identifier=', ext) &quot;UUID&quot;;
          } &quot;ext&quot;;
          id.assigningAuthorityName as s -&gt;  identifier.assigner as a,  a.display = s;
          id.root as r then {
            id.extension as ext -&gt;  organization.id = (r + '-' + ext) as uuid8,  e8.fullUrl = append('https://example/Organization/', uuid8),  practitionerRole.organization = create('Reference') as referenceOrg,  referenceOrg.reference = append('https://example/Organization/', uuid8) &quot;aut&quot;;
          } &quot;r&quot;;
        } &quot;identifier&quot;;
        representedOrganization.name as v -&gt; organization.name = (v.other);
        representedOrganization.telecom -&gt; organization.telecom;
        representedOrganization.addr -&gt; organization.address;
        representedOrganization.asOrganizationPartOf as OrgPartOf -&gt;  bundle.entry as e9,  e9.request = create('BackboneElement') as request,  request.method = 'PUT',  e9.resource = create('Organization') as organization1 then {
          OrgPartOf -&gt; organization1.meta as meta then {
            OrgPartOf -&gt; meta.tag = create('Coding') as coding then {
              OrgPartOf -&gt; coding.system = 'http://algoritmodiscoring' &quot;system&quot;;
              OrgPartOf -&gt; coding.code = 'ClinicalDocument/body/organizer/author/representedOrganization/asOrganizationPartOf' &quot;code&quot;;
            } &quot;coding&quot;;
          } &quot;meta&quot;;
          OrgPartOf.id as id -&gt; organization1.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 ext -&gt; identifier.value = ext then {
              OrgPartOf -&gt; request.url = append('Organization?identifier=', ext) &quot;UUID&quot;;
            } &quot;ext&quot;;
            id.assigningAuthorityName as s -&gt;  identifier.assigner as a,  a.display = s;
            id.root as r then {
              id.extension as ext -&gt;  organization1.id = (r + '-' + ext) as uuid9,  e9.fullUrl = append('https://example/Organization/', uuid9),  organization.partOf = create('Reference') as reference,  reference.reference = ('https://example/Organization/' + %organization1.id) &quot;aut&quot;;
            } &quot;r&quot;;
          } &quot;identifier&quot;;
          OrgPartOf.code -&gt; organization1.type;
          OrgPartOf.statusCode as status where (value = 'active') -&gt;  organization1.active = create('boolean'),  organization1.active = 'true';
          OrgPartOf.wholeOrganization as wholeOrgan -&gt;  bundle.entry as e10,  e10.request = create('BackboneElement') as request,  request.method = 'PUT',  e10.resource = create('Organization') as organization2 then {
            OrgPartOf -&gt; organization2.meta as meta then {
              OrgPartOf -&gt; meta.tag = create('Coding') as coding then {
                OrgPartOf -&gt; coding.system = 'http://algoritmodiscoring' &quot;system&quot;;
                OrgPartOf -&gt; coding.code = 'ClinicalDocument/body/organizer/author/representedOrganization/asOrganizationPartOf/wholeOrganization' &quot;code&quot;;
              } &quot;coding&quot;;
            } &quot;meta&quot;;
            wholeOrgan.id as id -&gt; organization2.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 ext -&gt; identifier.value = ext then {
                wholeOrgan -&gt; request.url = append('Organization?identifier=', ext) &quot;UUID&quot;;
              } &quot;ext&quot;;
              id.assigningAuthorityName as s -&gt;  identifier.assigner as a,  a.display = s;
              id.root as r then {
                id.extension as ext -&gt;  organization2.id = (r + '-' + ext) as uuid10,  e10.fullUrl = append('https://example/Organization/', uuid10),  organization1.partOf = create('Reference') as reference,  reference.reference = ('https://example/Organization/' + %organization2.id) &quot;aut&quot;;
              } &quot;r&quot;;
            } &quot;identifier&quot;;
            wholeOrgan.name as v -&gt; organization2.name = (v.other);
            wholeOrgan.telecom -&gt; organization2.telecom;
            wholeOrgan.addr -&gt; organization2.address;
          };
        } &quot;OrgPartOf&quot;;
      };
      // device
      assignedAuthor.assignedAuthoringDevice as assignedAuthoringDevice -&gt;  bundle.entry as e11,  e11.request = create('BackboneElement') as request,  request.method = 'POST',  e11.resource = create('Device') as device,  device.id = uuid() as uuid11,  e11.fullUrl = append('https://example/Device/', uuid11),  request.url = 'Device',  tgt.author = create('Reference') as reference,  reference.reference = ('https://example/Device/' + %device.id) then {
        assignedAuthoringDevice.templateId -&gt; device.identifier;
        assignedAuthoringDevice.code -&gt; device.type;
        assignedAuthoringDevice.manufacturerModelName as manufacturerModelName then {
          manufacturerModelName as m -&gt; device.manufacturer = (m.displayName) &quot;displayRule&quot;;
        } &quot;manufacturer&quot;;
        assignedAuthoringDevice.softwareName as softwareName -&gt; device.deviceName as deviceName then {
          softwareName -&gt; deviceName.type = 'other' &quot;typeName&quot;;
          softwareName as s -&gt; deviceName.name = (s.displayName) &quot;name&quot;;
        } &quot;deviceName&quot;;
      } &quot;Device&quot;;
    };
  };
  // participant person
  org.participant as participant where (typeCode != 'DEV') -&gt;  observation.encounter = create('Reference') as reference,  reference.reference = ('https://example/Encounter/' + %encounter.id) then {
    participant -&gt; encounter.participant as FhirParticipant then {
      participant as p -&gt; FhirParticipant.type as type then {
        p -&gt; type.coding as coding then {
          p -&gt; coding.code = (p.typeCode) &quot;codice&quot;;
          p -&gt; coding.system = 'http://terminology.hl7.org/CodeSystem/v3-ParticipationType' &quot;system&quot;;
        } &quot;codeType&quot;;
      } &quot;type&quot;;
    } &quot;fhirParticipant&quot;;
    participant.participantRole as participantRole -&gt;  bundle.entry as e12,  e12.request = create('BackboneElement') as request,  request.method = 'POST',  e12.resource = create('PractitionerRole') as practitionerRole,  practitionerRole.id = uuid() as uuid12,  e12.fullUrl = append('https://example/PractitionerRole/', uuid12),  request.url = 'PractitionerRole',  encounter.participant = create('BackboneElement') as participant1 then {
      // participant.time -&gt; participant1.period;
      participant.time as time1 -&gt; participant1.period = create('Period') as period then {
        time1 -&gt; period.start = create('dateTime') as start then TSDateTime(time1, start) &quot;val&quot;;
      };
      participant.time as time1 -&gt; participant1.period = create('Period') as period then IVLTSPeriod(time1, period);
      participant.functionCode -&gt; practitionerRole.code;
      // non mappa i 2 precedenti
      participantRole -&gt;  bundle.entry as e13,  e13.request = create('BackboneElement') as request,  request.method = 'PUT',  e13.resource = create('Practitioner') as practitioner then {
        participantRole -&gt;  participant1.individual = create('Reference') as referencepart,  referencepart.reference = ('https://example/PractitionerRole/' + %practitionerRole.id) &quot;par&quot;;
        participantRole -&gt; practitioner.meta as meta then {
          participantRole -&gt; meta.tag = create('Coding') as coding then {
            participantRole -&gt; coding.system = 'http://algoritmodiscoring' &quot;system&quot;;
            participantRole -&gt; coding.code = 'ClinicalDocument/body/organizer/participant' &quot;code&quot;;
          } &quot;coding&quot;;
        } &quot;meta&quot;;
        participantRole.id as id -&gt; practitioner.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 ext -&gt; identifier.value = ext then {
            participantRole -&gt; request.url = append('Practitioner?identifier=', ext) &quot;UUID&quot;;
          } &quot;ext&quot;;
          id.assigningAuthorityName as s -&gt;  identifier.assigner as a,  a.display = s;
          id.root as r then {
            id.extension as ext -&gt;  practitioner.id = (r + '-' + ext) as uuid2,  e13.fullUrl = append('https://example/Practitioner/', uuid2),  practitionerRole.practitioner = create('Reference') as reference,  reference.reference = ('https://example/Practitioner/' + %practitioner.id) &quot;part&quot;;
          } &quot;r&quot;;
        } &quot;identifier&quot;;
        participantRole.id as id where (root = '2.16.840.1.113883.2.9.4.3.2') then {
          id.extension as ext -&gt; request.url = append('Practitioner?identifier=', ext) &quot;UUID&quot;;
        } &quot;2&quot;;
        participantRole.id as id where (root != '2.16.840.1.113883.2.9.4.3.2') then {
          id.extension as ext -&gt; request.url = append('Practitioner?identifier=', ext) &quot;UUID&quot;;
        } &quot;diverso&quot;;
        participantRole.code -&gt; practitionerRole.code;
        participantRole.addr -&gt; practitioner.address;
        participantRole.telecom -&gt; practitioner.telecom;
        participantRole.playingEntity as playingEntity then {
          playingEntity.name -&gt; practitioner.name;
          playingEntity.birthTime as birthTime then {
            birthTime.value as date -&gt; practitioner.birthDate = truncate(date, 10);
          } &quot;birth&quot;;
        } &quot;name&quot;;
      } &quot;practitioner&quot;;
    } &quot;partRole&quot;;
  } &quot;participantEncounter&quot;;
  // participant device
  org.participant as devParticipant where (typeCode = 'DEV') -&gt;  bundle.entry as e14,  e14.request = create('BackboneElement') as request,  request.method = 'POST',  e14.resource = create('Device') as device,  device.id = uuid() as uuid14,  e14.fullUrl = append('https://example/Device/', uuid14),  request.url = 'Device',  observation.device = create('Reference') as reference,  reference.reference = ('https://example/Device/' + %device.id) then {
    devParticipant.participantRole as participantRoleDev then {
      participantRoleDev.playingDevice as playingDevice then {
        playingDevice.code -&gt; device.type;
        playingDevice.manufacturerModelName as manufacturerModelName then {
          manufacturerModelName as m -&gt; device.manufacturer = (m.displayName) &quot;displayRule&quot;;
        } &quot;manufacturer&quot;;
        playingDevice.softwareName as softwareName -&gt; device.deviceName as deviceName then {
          softwareName -&gt; deviceName.type = 'other' &quot;typeName&quot;;
          softwareName as s -&gt; deviceName.name = (s.displayName) &quot;name&quot;;
        } &quot;deviceName&quot;;
      };
    } &quot;participantRoleDev&quot;;
  } &quot;devParticipant&quot;;
  org.component as component then {
    component.observation as observation -&gt;  bundle.entry as e,  e.request = create('BackboneElement') as request,  request.method = 'POST',  e.resource = create('Observation') as observationhasmember,  observationhasmember.id = uuid() as uuid2,  e.fullUrl = append('https://example/Observation/', uuid2),  request.url = 'Observation',  observation.hasMember = create('Reference') as reference,  reference.reference = ('https://example/Observation/' + %observationhasmember.id) then Observation(observation, patient, encounter, observationhasmember, bundle) &quot;OBS&quot;;
  } &quot;componentobservation&quot;;
  org.component as component then {
    component.organizer as organizer -&gt;  bundle.entry as e1,  e1.request = create('BackboneElement') as request,  request.method = 'POST',  e1.resource = create('Observation') as observationorganizer,  observationorganizer.id = uuid() as uuid3,  e1.fullUrl = append('https://example/Observation/', uuid3),  request.url = 'Observation',  observation.hasMember = create('Reference') as reference,  reference.reference = ('https://example/Observation/' + %observationorganizer.id) then {
      organizer then Organizer(cda, organizer, patient, encounter, observationorganizer, bundle) &quot;ORG&quot;;
    };
  } &quot;componentorganizer&quot;;
  // observationMedia
  org.component as component then {
    component.observationMedia as obsMedia -&gt;  bundle.entry as e15,  e15.request = create('BackboneElement') as request,  request.method = 'POST',  e15.resource = create('Media') as media1,  media1.id = uuid() as uuid15,  e15.fullUrl = append('https://example/Media/', uuid15),  request.url = 'Media',  observation.derivedFrom = create('Reference') as reference,  reference.reference = ('https://example/Media/' + %media1.id) then {
      obsMedia -&gt; media1.content = create('Attachment') as Attachment then {
        obsMedia -&gt; media1.status = 'unknown' &quot;status&quot;;
        obsMedia.value as valueMedia then {
          valueMedia.mediaType as type -&gt; Attachment.contentType = type &quot;type&quot;;
          valueMedia -&gt; Attachment.data = (valueMedia.dataBase64Binary) &quot;data&quot;;
        } &quot;valuemedia&quot;;
      } &quot;Attachment&quot;;
    } &quot;obsmedia&quot;;
  };
  // note
  org.component as component then {
    component.act as act then {
      act.text as text then {
        text.reference as reference -&gt; observation.note as note then {
          reference -&gt; note.text = (reference.value) &quot;reference&quot;;
        } &quot;note&quot;;
      };
    } &quot;componentact&quot;;
  };
}

group ExtSubjectAnimal(source src : relatedSubject, target ext : Extension) {
  src -&gt; ext.url = 'http://hl7.org/fhir/StructureDefinition/patient-animal' &quot;url&quot;;
  src.code as code -&gt;  ext.extension as ext,  ext.url = 'species',  ext.value = create('CodeableConcept') as code1 then CECodeableConcept(code, code1);
}

</pre>
      </div>
  </text>
  <url value="http://hl7.it/fhir/cda2fhir/StructureMap/cda2fhirLabReport"/>
  <version value="0.1.0"/>
  <name value="cda2fhirLabReport"/>
  <status value="draft"/>
  <date value="2024-04-11T15:38:19+02: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/Practitioner"/>
    <mode value="produced"/>
    <alias value="Practitioner"/>
  </structure>
  <structure>
    <url value="http://hl7.org/fhir/StructureDefinition/Specimen"/>
    <mode value="produced"/>
    <alias value="Specimen"/>
  </structure>
  <structure>
    <url value="http://hl7.org/fhir/StructureDefinition/Procedure"/>
    <mode value="produced"/>
    <alias value="Procedure"/>
  </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>
  <structure>
    <url value="http://hl7.org/fhir/cda/StructureDefinition/Organizer"/>
    <mode value="source"/>
    <alias value="Organizer"/>
  </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="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="DocumentReference"/>
        <transform value="create"/>
        <parameter>
          <valueString value="DocumentReference"/>
        </parameter>
      </target>
      <target>
        <context value="DocumentReference"/>
        <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/DocumentReference/"/>
        </parameter>
        <parameter>
          <valueId value="uuid6"/>
        </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="record"/>
          <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="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="documentreference"/>
              </dependent>
            </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="documentreference"/>
      <type value="DocumentReference"/>
      <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="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="entry"/>
      <source>
        <context value="src"/>
        <element value="entry"/>
        <variable value="entry1"/>
      </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="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="e1"/>
        <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>
      <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/' + %DiagnosticReport.id"/>
        </parameter>
      </target>
      <rule>
        <name value="act"/>
        <source>
          <context value="entry1"/>
          <element value="act"/>
          <variable value="act1"/>
        </source>
        <dependent>
          <name value="Act"/>
          <variable value="act1"/>
          <variable value="patient"/>
          <variable value="DiagnosticReport"/>
          <variable value="enc"/>
          <variable value="bundle"/>
        </dependent>
      </rule>
    </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="documentreference"/>
        </dependent>
      </rule>
    </rule>
  </group>
  <group>
    <name value="Observation"/>
    <typeMode value="none"/>
    <input>
      <name value="obs"/>
      <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="obs"/>
      </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="obs"/>
      </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="obs"/>
        <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="statusCode"/>
      <source>
        <context value="obs"/>
        <element value="statusCode"/>
        <variable value="statusc"/>
        <condition value="(code = 'completed')"/>
      </source>
      <target>
        <context value="ob"/>
        <contextType value="variable"/>
        <element value="status"/>
        <transform value="copy"/>
        <parameter>
          <valueString value="final"/>
        </parameter>
      </target>
    </rule>
    <rule>
      <name value="statusCode"/>
      <source>
        <context value="obs"/>
        <element value="statusCode"/>
        <variable value="statusc"/>
        <condition value="(code = 'active')"/>
      </source>
      <target>
        <context value="ob"/>
        <contextType value="variable"/>
        <element value="status"/>
        <transform value="copy"/>
        <parameter>
          <valueString value="registered"/>
        </parameter>
      </target>
    </rule>
    <rule>
      <name value="statusCode"/>
      <source>
        <context value="obs"/>
        <element value="statusCode"/>
        <variable value="statusc"/>
        <condition value="(code = 'aborted')"/>
      </source>
      <target>
        <context value="ob"/>
        <contextType value="variable"/>
        <element value="status"/>
        <transform value="copy"/>
        <parameter>
          <valueString value="cancelled"/>
        </parameter>
      </target>
    </rule>
    <rule>
      <name value="statusCode"/>
      <source>
        <context value="obs"/>
        <element value="statusCode"/>
        <variable value="statusc"/>
        <condition value="(code = 'suspended')"/>
      </source>
      <target>
        <context value="ob"/>
        <contextType value="variable"/>
        <element value="status"/>
        <transform value="copy"/>
        <parameter>
          <valueString value="partial"/>
        </parameter>
      </target>
    </rule>
    <rule>
      <name value="value2"/>
      <source>
        <context value="obs"/>
        <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="obs"/>
        <condition
                   value="effectiveTime.low.exists() or effectiveTime.high.exists()"/>
      </source>
      <rule>
        <name value="effectiveTime"/>
        <source>
          <context value="obs"/>
          <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="eff"/>
          <variable value="period"/>
        </dependent>
      </rule>
    </rule>
    <rule>
      <name value="interpretationCode"/>
      <source>
        <context value="obs"/>
        <element value="interpretationCode"/>
        <variable value="vvv"/>
      </source>
      <target>
        <context value="ob"/>
        <contextType value="variable"/>
        <element value="interpretation"/>
        <variable value="vvv"/>
        <transform value="create"/>
      </target>
    </rule>
    <rule>
      <name value="methodCode"/>
      <source>
        <context value="obs"/>
        <element value="methodCode"/>
        <variable value="vvv"/>
      </source>
      <target>
        <context value="ob"/>
        <contextType value="variable"/>
        <element value="method"/>
        <variable value="vvv"/>
        <transform value="create"/>
      </target>
    </rule>
    <rule>
      <name value="value"/>
      <source>
        <context value="obs"/>
        <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="boolean"/>
      <source>
        <context value="obs"/>
        <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="val"/>
      <source>
        <context value="obs"/>
        <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="originltext"/>
          <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="copy"/>
              <parameter>
                <valueId value="reference"/>
              </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>
            <name value="codeSystemVersion"/>
            <source>
              <context value="val"/>
              <element value="codeSystemVersion"/>
              <variable value="version"/>
            </source>
            <target>
              <context value="coding"/>
              <contextType value="variable"/>
              <element value="version"/>
              <transform value="cast"/>
              <parameter>
                <valueId value="version"/>
              </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="codeSystemVersion"/>
            <source>
              <context value="translation"/>
              <element value="codeSystemVersion"/>
              <variable value="version"/>
            </source>
            <target>
              <context value="coding"/>
              <contextType value="variable"/>
              <element value="version"/>
              <transform value="cast"/>
              <parameter>
                <valueId value="version"/>
              </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>
                <name value="codeSystemVersion"/>
                <source>
                  <context value="value"/>
                  <element value="codeSystemVersion"/>
                  <variable value="version"/>
                </source>
                <target>
                  <context value="coding"/>
                  <contextType value="variable"/>
                  <element value="version"/>
                  <transform value="cast"/>
                  <parameter>
                    <valueId value="version"/>
                  </parameter>
                  <parameter>
                    <valueString value="string"/>
                  </parameter>
                </target>
              </rule>
            </rule>
          </rule>
        </rule>
      </rule>
    </rule>
    <rule>
      <name value="val"/>
      <source>
        <context value="obs"/>
        <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="originltext"/>
          <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="copy"/>
              <parameter>
                <valueId value="reference"/>
              </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>
            <name value="codeSystemVersion"/>
            <source>
              <context value="val"/>
              <element value="codeSystemVersion"/>
              <variable value="version"/>
            </source>
            <target>
              <context value="coding"/>
              <contextType value="variable"/>
              <element value="version"/>
              <transform value="cast"/>
              <parameter>
                <valueId value="version"/>
              </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="codeSystemVersion"/>
            <source>
              <context value="translation"/>
              <element value="codeSystemVersion"/>
              <variable value="version"/>
            </source>
            <target>
              <context value="coding"/>
              <contextType value="variable"/>
              <element value="version"/>
              <transform value="cast"/>
              <parameter>
                <valueId value="version"/>
              </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>
                <name value="codeSystemVersion"/>
                <source>
                  <context value="value"/>
                  <element value="codeSystemVersion"/>
                  <variable value="version"/>
                </source>
                <target>
                  <context value="coding"/>
                  <contextType value="variable"/>
                  <element value="version"/>
                  <transform value="cast"/>
                  <parameter>
                    <valueId value="version"/>
                  </parameter>
                  <parameter>
                    <valueString value="string"/>
                  </parameter>
                </target>
              </rule>
            </rule>
          </rule>
        </rule>
      </rule>
    </rule>
    <rule>
      <name value="valueQuantity"/>
      <source>
        <context value="obs"/>
        <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="value"/>
      <source>
        <context value="obs"/>
        <type value="ST"/>
        <element value="value"/>
        <variable value="value"/>
      </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="value.dataString"/>
        </parameter>
      </target>
    </rule>
    <rule>
      <name value="entryRelationship"/>
      <source>
        <context value="obs"/>
        <element value="entryRelationship"/>
        <variable value="entryRelationship"/>
      </source>
      <rule>
        <name value="Act"/>
        <source>
          <context value="entryRelationship"/>
          <element value="act"/>
          <variable value="act"/>
        </source>
        <rule>
          <name value="text"/>
          <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="ob"/>
              <contextType value="variable"/>
              <element value="note"/>
              <variable value="note"/>
            </target>
            <rule>
              <name value="reference"/>
              <source>
                <context 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>
      <documentation value="Note e commenti"/>
    </rule>
    <rule>
      <name value="subject"/>
      <source>
        <context value="obs"/>
        <element value="subject"/>
        <variable value="sbj"/>
      </source>
      <rule>
        <name value="relatedSubject"/>
        <source>
          <context value="sbj"/>
          <element value="relatedSubject"/>
          <variable value="relatedSubj"/>
        </source>
        <target>
          <context value="patient"/>
          <contextType value="variable"/>
          <element value="extension"/>
          <variable value="extension2"/>
        </target>
        <dependent>
          <name value="ExtSubjectAnimal"/>
          <variable value="relatedSubj"/>
          <variable value="extension2"/>
        </dependent>
      </rule>
      <documentation value="subject"/>
    </rule>
    <rule>
      <name value="performer"/>
      <source>
        <context value="obs"/>
        <element value="performer"/>
        <variable value="performer"/>
      </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="practitionerRole"/>
        <transform value="create"/>
        <parameter>
          <valueString value="PractitionerRole"/>
        </parameter>
      </target>
      <target>
        <context value="practitionerRole"/>
        <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/PractitionerRole/"/>
        </parameter>
        <parameter>
          <valueId value="uuid1"/>
        </parameter>
      </target>
      <target>
        <context value="request"/>
        <contextType value="variable"/>
        <element value="url"/>
        <transform value="copy"/>
        <parameter>
          <valueString value="PractitionerRole"/>
        </parameter>
      </target>
      <rule>
        <name value="practitionerRole"/>
        <source>
          <context value="performer"/>
        </source>
        <target>
          <context value="ob"/>
          <contextType value="variable"/>
          <element value="performer"/>
          <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/PractitionerRole/' + %practitionerRole.id"/>
          </parameter>
        </target>
        <rule>
          <name value="entity"/>
          <source>
            <context value="performer"/>
            <element value="assignedEntity"/>
            <variable value="entity"/>
          </source>
          <rule>
            <name value="code"/>
            <source>
              <context value="entity"/>
              <element value="code"/>
              <variable value="vvv"/>
            </source>
            <target>
              <context value="practitionerRole"/>
              <contextType value="variable"/>
              <element value="code"/>
              <variable value="vvv"/>
              <transform value="create"/>
            </target>
          </rule>
          <rule>
            <name value="practitioner"/>
            <source>
              <context value="entity"/>
            </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="PUT"/>
              </parameter>
            </target>
            <target>
              <context value="e2"/>
              <contextType value="variable"/>
              <element value="resource"/>
              <variable value="practitioner"/>
              <transform value="create"/>
              <parameter>
                <valueString value="Practitioner"/>
              </parameter>
            </target>
            <rule>
              <name value="meta"/>
              <source>
                <context value="entity"/>
              </source>
              <target>
                <context value="practitioner"/>
                <contextType value="variable"/>
                <element value="meta"/>
                <variable value="meta"/>
              </target>
              <rule>
                <name value="coding"/>
                <source>
                  <context value="entity"/>
                </source>
                <target>
                  <context value="meta"/>
                  <contextType value="variable"/>
                  <element value="tag"/>
                  <variable value="coding"/>
                  <transform value="create"/>
                  <parameter>
                    <valueString value="Coding"/>
                  </parameter>
                </target>
                <rule>
                  <name value="system"/>
                  <source>
                    <context value="entity"/>
                  </source>
                  <target>
                    <context value="coding"/>
                    <contextType value="variable"/>
                    <element value="system"/>
                    <transform value="copy"/>
                    <parameter>
                      <valueString value="http://algoritmodiscoring"/>
                    </parameter>
                  </target>
                </rule>
                <rule>
                  <name value="code"/>
                  <source>
                    <context value="entity"/>
                  </source>
                  <target>
                    <context value="coding"/>
                    <contextType value="variable"/>
                    <element value="code"/>
                    <transform value="copy"/>
                    <parameter>
                      <valueString
                                   value="ClinicalDocument/body/observation/performer"/>
                    </parameter>
                  </target>
                </rule>
              </rule>
            </rule>
            <rule>
              <name value="identifier"/>
              <source>
                <context value="entity"/>
                <element value="id"/>
                <variable value="id"/>
              </source>
              <target>
                <context value="practitioner"/>
                <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="ext"/>
                <source>
                  <context value="id"/>
                  <element value="extension"/>
                  <variable value="ext"/>
                </source>
                <target>
                  <context value="identifier"/>
                  <contextType value="variable"/>
                  <element value="value"/>
                  <transform value="copy"/>
                  <parameter>
                    <valueId value="ext"/>
                  </parameter>
                </target>
                <rule>
                  <name value="UUID"/>
                  <source>
                    <context value="entity"/>
                  </source>
                  <target>
                    <context value="request"/>
                    <contextType value="variable"/>
                    <element value="url"/>
                    <transform value="append"/>
                    <parameter>
                      <valueString value="Practitioner?identifier="/>
                    </parameter>
                    <parameter>
                      <valueId value="ext"/>
                    </parameter>
                  </target>
                </rule>
              </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>
                <name value="r"/>
                <source>
                  <context value="id"/>
                  <element value="root"/>
                  <variable value="r"/>
                </source>
                <rule>
                  <name value="performer"/>
                  <source>
                    <context value="id"/>
                    <element value="extension"/>
                    <variable value="ext"/>
                  </source>
                  <target>
                    <context value="practitioner"/>
                    <contextType value="variable"/>
                    <element value="id"/>
                    <variable value="uuid2"/>
                    <transform value="evaluate"/>
                    <parameter>
                      <valueString value="r + '-' + ext"/>
                    </parameter>
                  </target>
                  <target>
                    <context value="e2"/>
                    <contextType value="variable"/>
                    <element value="fullUrl"/>
                    <transform value="append"/>
                    <parameter>
                      <valueString value="https://example/Practitioner/"/>
                    </parameter>
                    <parameter>
                      <valueId value="uuid2"/>
                    </parameter>
                  </target>
                  <target>
                    <context value="practitionerRole"/>
                    <contextType value="variable"/>
                    <element value="practitioner"/>
                    <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/Practitioner/' + %practitioner.id"/>
                    </parameter>
                  </target>
                </rule>
              </rule>
            </rule>
            <rule>
              <name value="2.16.840.1.113883.2.9.4.3.2"/>
              <source>
                <context value="entity"/>
                <element value="id"/>
                <variable value="id"/>
                <condition value="(root = '2.16.840.1.113883.2.9.4.3.2')"/>
              </source>
              <rule>
                <name value="UUID"/>
                <source>
                  <context value="id"/>
                  <element value="extension"/>
                  <variable value="ext"/>
                </source>
                <target>
                  <context value="request"/>
                  <contextType value="variable"/>
                  <element value="url"/>
                  <transform value="append"/>
                  <parameter>
                    <valueString value="Practitioner?identifier="/>
                  </parameter>
                  <parameter>
                    <valueId value="ext"/>
                  </parameter>
                </target>
              </rule>
            </rule>
            <rule>
              <name value="diverso"/>
              <source>
                <context value="entity"/>
                <element value="id"/>
                <variable value="id"/>
                <condition value="(root != '2.16.840.1.113883.2.9.4.3.2')"/>
              </source>
              <rule>
                <name value="UUID"/>
                <source>
                  <context value="id"/>
                  <element value="extension"/>
                  <variable value="ext"/>
                </source>
                <target>
                  <context value="request"/>
                  <contextType value="variable"/>
                  <element value="url"/>
                  <transform value="append"/>
                  <parameter>
                    <valueString value="Practitioner?identifier="/>
                  </parameter>
                  <parameter>
                    <valueId value="ext"/>
                  </parameter>
                </target>
              </rule>
            </rule>
            <rule>
              <name value="addr"/>
              <source>
                <context value="entity"/>
                <element value="addr"/>
                <variable value="vvv"/>
              </source>
              <target>
                <context value="practitioner"/>
                <contextType value="variable"/>
                <element value="address"/>
                <variable value="vvv"/>
                <transform value="create"/>
              </target>
            </rule>
            <rule>
              <name value="telecom"/>
              <source>
                <context value="entity"/>
                <element value="telecom"/>
                <variable value="vvv"/>
              </source>
              <target>
                <context value="practitioner"/>
                <contextType value="variable"/>
                <element value="telecom"/>
                <variable value="vvv"/>
                <transform value="create"/>
              </target>
            </rule>
            <rule>
              <name value="name"/>
              <source>
                <context value="entity"/>
                <element value="assignedPerson"/>
                <variable value="person"/>
              </source>
              <rule>
                <name value="name"/>
                <source>
                  <context value="person"/>
                  <element value="name"/>
                  <variable value="vvv"/>
                </source>
                <target>
                  <context value="practitioner"/>
                  <contextType value="variable"/>
                  <element value="name"/>
                  <variable value="vvv"/>
                  <transform value="create"/>
                </target>
              </rule>
              <rule>
                <name value="birth"/>
                <source>
                  <context value="person"/>
                  <element value="birthTime"/>
                  <variable value="birthTime"/>
                </source>
                <rule>
                  <name value="value"/>
                  <source>
                    <context value="birthTime"/>
                    <element value="value"/>
                    <variable value="date"/>
                  </source>
                  <target>
                    <context value="practitioner"/>
                    <contextType value="variable"/>
                    <element value="birthDate"/>
                    <transform value="truncate"/>
                    <parameter>
                      <valueId value="date"/>
                    </parameter>
                    <parameter>
                      <valueInteger value="10"/>
                    </parameter>
                  </target>
                </rule>
              </rule>
            </rule>
            <rule>
              <name value="representedOrganization"/>
              <source>
                <context value="entity"/>
                <element value="representedOrganization"/>
                <variable value="representedOrganization"/>
              </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="PUT"/>
                </parameter>
              </target>
              <target>
                <context value="e3"/>
                <contextType value="variable"/>
                <element value="resource"/>
                <variable value="organization"/>
                <transform value="create"/>
                <parameter>
                  <valueString value="Organization"/>
                </parameter>
              </target>
              <rule>
                <name value="meta"/>
                <source>
                  <context value="representedOrganization"/>
                </source>
                <target>
                  <context value="organization"/>
                  <contextType value="variable"/>
                  <element value="meta"/>
                  <variable value="meta"/>
                </target>
                <rule>
                  <name value="coding"/>
                  <source>
                    <context value="representedOrganization"/>
                  </source>
                  <target>
                    <context value="meta"/>
                    <contextType value="variable"/>
                    <element value="tag"/>
                    <variable value="coding"/>
                    <transform value="create"/>
                    <parameter>
                      <valueString value="Coding"/>
                    </parameter>
                  </target>
                  <rule>
                    <name value="system"/>
                    <source>
                      <context value="representedOrganization"/>
                    </source>
                    <target>
                      <context value="coding"/>
                      <contextType value="variable"/>
                      <element value="system"/>
                      <transform value="copy"/>
                      <parameter>
                        <valueString value="http://algoritmodiscoring"/>
                      </parameter>
                    </target>
                  </rule>
                  <rule>
                    <name value="code"/>
                    <source>
                      <context value="representedOrganization"/>
                    </source>
                    <target>
                      <context value="coding"/>
                      <contextType value="variable"/>
                      <element value="code"/>
                      <transform value="copy"/>
                      <parameter>
                        <valueString
                                     value="ClinicalDocument/body/observation/performer/representedOrganization"/>
                      </parameter>
                    </target>
                  </rule>
                </rule>
              </rule>
              <rule>
                <name value="identifier"/>
                <source>
                  <context value="representedOrganization"/>
                  <element value="id"/>
                  <variable value="id"/>
                </source>
                <target>
                  <context value="organization"/>
                  <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="ext"/>
                  <source>
                    <context value="id"/>
                    <element value="extension"/>
                    <variable value="ext"/>
                  </source>
                  <target>
                    <context value="identifier"/>
                    <contextType value="variable"/>
                    <element value="value"/>
                    <transform value="copy"/>
                    <parameter>
                      <valueId value="ext"/>
                    </parameter>
                  </target>
                  <rule>
                    <name value="UUID"/>
                    <source>
                      <context value="representedOrganization"/>
                    </source>
                    <target>
                      <context value="request"/>
                      <contextType value="variable"/>
                      <element value="url"/>
                      <transform value="append"/>
                      <parameter>
                        <valueString value="Organization?identifier="/>
                      </parameter>
                      <parameter>
                        <valueId value="ext"/>
                      </parameter>
                    </target>
                  </rule>
                </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>
                  <name value="r"/>
                  <source>
                    <context value="id"/>
                    <element value="root"/>
                    <variable value="r"/>
                  </source>
                  <rule>
                    <name value="aut"/>
                    <source>
                      <context value="id"/>
                      <element value="extension"/>
                      <variable value="ext"/>
                    </source>
                    <target>
                      <context value="organization"/>
                      <contextType value="variable"/>
                      <element value="id"/>
                      <variable value="uuid3"/>
                      <transform value="evaluate"/>
                      <parameter>
                        <valueString value="r + '-' + ext"/>
                      </parameter>
                    </target>
                    <target>
                      <context value="e3"/>
                      <contextType value="variable"/>
                      <element value="fullUrl"/>
                      <transform value="append"/>
                      <parameter>
                        <valueString value="https://example/Organization/"/>
                      </parameter>
                      <parameter>
                        <valueId value="uuid3"/>
                      </parameter>
                    </target>
                    <target>
                      <context value="practitionerRole"/>
                      <contextType value="variable"/>
                      <element value="organization"/>
                      <variable value="referenceOrg"/>
                      <transform value="create"/>
                      <parameter>
                        <valueString value="Reference"/>
                      </parameter>
                    </target>
                    <target>
                      <context value="referenceOrg"/>
                      <contextType value="variable"/>
                      <element value="reference"/>
                      <transform value="append"/>
                      <parameter>
                        <valueString value="https://example/Organization/"/>
                      </parameter>
                      <parameter>
                        <valueId value="uuid3"/>
                      </parameter>
                    </target>
                  </rule>
                </rule>
              </rule>
              <rule>
                <name value="name"/>
                <source>
                  <context value="representedOrganization"/>
                  <element value="name"/>
                  <variable value="v"/>
                </source>
                <target>
                  <context value="organization"/>
                  <contextType value="variable"/>
                  <element value="name"/>
                  <transform value="evaluate"/>
                  <parameter>
                    <valueString value="v.other"/>
                  </parameter>
                </target>
              </rule>
              <rule>
                <name value="telecom"/>
                <source>
                  <context value="representedOrganization"/>
                  <element value="telecom"/>
                  <variable value="vvv"/>
                </source>
                <target>
                  <context value="organization"/>
                  <contextType value="variable"/>
                  <element value="telecom"/>
                  <variable value="vvv"/>
                  <transform value="create"/>
                </target>
              </rule>
              <rule>
                <name value="addr"/>
                <source>
                  <context value="representedOrganization"/>
                  <element value="addr"/>
                  <variable value="vvv"/>
                </source>
                <target>
                  <context value="organization"/>
                  <contextType value="variable"/>
                  <element value="address"/>
                  <variable value="vvv"/>
                  <transform value="create"/>
                </target>
              </rule>
              <rule>
                <name value="OrgPartOf"/>
                <source>
                  <context value="representedOrganization"/>
                  <element value="asOrganizationPartOf"/>
                  <variable value="OrgPartOf"/>
                </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="e4"/>
                  <contextType value="variable"/>
                  <element value="resource"/>
                  <variable value="organization1"/>
                  <transform value="create"/>
                  <parameter>
                    <valueString value="Organization"/>
                  </parameter>
                </target>
                <target>
                  <context value="request"/>
                  <contextType value="variable"/>
                  <element value="method"/>
                  <transform value="copy"/>
                  <parameter>
                    <valueString value="PUT"/>
                  </parameter>
                </target>
                <rule>
                  <name value="meta"/>
                  <source>
                    <context value="OrgPartOf"/>
                  </source>
                  <target>
                    <context value="organization1"/>
                    <contextType value="variable"/>
                    <element value="meta"/>
                    <variable value="meta"/>
                  </target>
                  <rule>
                    <name value="coding"/>
                    <source>
                      <context value="OrgPartOf"/>
                    </source>
                    <target>
                      <context value="meta"/>
                      <contextType value="variable"/>
                      <element value="tag"/>
                      <variable value="coding"/>
                      <transform value="create"/>
                      <parameter>
                        <valueString value="Coding"/>
                      </parameter>
                    </target>
                    <rule>
                      <name value="system"/>
                      <source>
                        <context value="OrgPartOf"/>
                      </source>
                      <target>
                        <context value="coding"/>
                        <contextType value="variable"/>
                        <element value="system"/>
                        <transform value="copy"/>
                        <parameter>
                          <valueString value="http://algoritmodiscoring"/>
                        </parameter>
                      </target>
                    </rule>
                    <rule>
                      <name value="code"/>
                      <source>
                        <context value="OrgPartOf"/>
                      </source>
                      <target>
                        <context value="coding"/>
                        <contextType value="variable"/>
                        <element value="code"/>
                        <transform value="copy"/>
                        <parameter>
                          <valueString
                                       value="ClinicalDocument/body/observation/performer/representedOrganization/asOrganizationPartOf"/>
                        </parameter>
                      </target>
                    </rule>
                  </rule>
                </rule>
                <rule>
                  <name value="identifier"/>
                  <source>
                    <context value="OrgPartOf"/>
                    <element value="id"/>
                    <variable value="id"/>
                  </source>
                  <target>
                    <context value="organization1"/>
                    <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="ext"/>
                    <source>
                      <context value="id"/>
                      <element value="extension"/>
                      <variable value="ext"/>
                    </source>
                    <target>
                      <context value="identifier"/>
                      <contextType value="variable"/>
                      <element value="value"/>
                      <transform value="copy"/>
                      <parameter>
                        <valueId value="ext"/>
                      </parameter>
                    </target>
                    <rule>
                      <name value="UUID"/>
                      <source>
                        <context value="OrgPartOf"/>
                      </source>
                      <target>
                        <context value="request"/>
                        <contextType value="variable"/>
                        <element value="url"/>
                        <transform value="append"/>
                        <parameter>
                          <valueString value="Organization?identifier="/>
                        </parameter>
                        <parameter>
                          <valueId value="ext"/>
                        </parameter>
                      </target>
                    </rule>
                  </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>
                    <name value="r"/>
                    <source>
                      <context value="id"/>
                      <element value="root"/>
                      <variable value="r"/>
                    </source>
                    <rule>
                      <name value="org"/>
                      <source>
                        <context value="id"/>
                        <element value="extension"/>
                        <variable value="ext"/>
                      </source>
                      <target>
                        <context value="organization1"/>
                        <contextType value="variable"/>
                        <element value="id"/>
                        <variable value="uuid4"/>
                        <transform value="evaluate"/>
                        <parameter>
                          <valueString value="r + '-' + ext"/>
                        </parameter>
                      </target>
                      <target>
                        <context value="e4"/>
                        <contextType value="variable"/>
                        <element value="fullUrl"/>
                        <transform value="append"/>
                        <parameter>
                          <valueString value="https://example/Organization/"/>
                        </parameter>
                        <parameter>
                          <valueId value="uuid4"/>
                        </parameter>
                      </target>
                      <target>
                        <context value="organization"/>
                        <contextType value="variable"/>
                        <element value="partOf"/>
                        <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/Organization/' + %organization1.id"/>
                        </parameter>
                      </target>
                    </rule>
                  </rule>
                </rule>
                <rule>
                  <name value="code"/>
                  <source>
                    <context value="OrgPartOf"/>
                    <element value="code"/>
                    <variable value="vvv"/>
                  </source>
                  <target>
                    <context value="organization1"/>
                    <contextType value="variable"/>
                    <element value="type"/>
                    <variable value="vvv"/>
                    <transform value="create"/>
                  </target>
                </rule>
                <rule>
                  <name value="statusCode"/>
                  <source>
                    <context value="OrgPartOf"/>
                    <element value="statusCode"/>
                    <variable value="status"/>
                    <condition value="(value = 'active')"/>
                  </source>
                  <target>
                    <context value="organization1"/>
                    <contextType value="variable"/>
                    <element value="active"/>
                    <transform value="create"/>
                    <parameter>
                      <valueString value="boolean"/>
                    </parameter>
                  </target>
                  <target>
                    <context value="organization1"/>
                    <contextType value="variable"/>
                    <element value="active"/>
                    <transform value="copy"/>
                    <parameter>
                      <valueString value="true"/>
                    </parameter>
                  </target>
                </rule>
                <rule>
                  <name value="wholeOrganization"/>
                  <source>
                    <context value="OrgPartOf"/>
                    <element value="wholeOrganization"/>
                    <variable value="wholeOrgan"/>
                  </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="PUT"/>
                    </parameter>
                  </target>
                  <target>
                    <context value="e5"/>
                    <contextType value="variable"/>
                    <element value="resource"/>
                    <variable value="organization2"/>
                    <transform value="create"/>
                    <parameter>
                      <valueString value="Organization"/>
                    </parameter>
                  </target>
                  <rule>
                    <name value="meta"/>
                    <source>
                      <context value="wholeOrgan"/>
                    </source>
                    <target>
                      <context value="organization2"/>
                      <contextType value="variable"/>
                      <element value="meta"/>
                      <variable value="meta"/>
                    </target>
                    <rule>
                      <name value="coding"/>
                      <source>
                        <context value="wholeOrgan"/>
                      </source>
                      <target>
                        <context value="meta"/>
                        <contextType value="variable"/>
                        <element value="tag"/>
                        <variable value="coding"/>
                        <transform value="create"/>
                        <parameter>
                          <valueString value="Coding"/>
                        </parameter>
                      </target>
                      <rule>
                        <name value="system"/>
                        <source>
                          <context value="wholeOrgan"/>
                        </source>
                        <target>
                          <context value="coding"/>
                          <contextType value="variable"/>
                          <element value="system"/>
                          <transform value="copy"/>
                          <parameter>
                            <valueString value="http://algoritmodiscoring"/>
                          </parameter>
                        </target>
                      </rule>
                      <rule>
                        <name value="code"/>
                        <source>
                          <context value="wholeOrgan"/>
                        </source>
                        <target>
                          <context value="coding"/>
                          <contextType value="variable"/>
                          <element value="code"/>
                          <transform value="copy"/>
                          <parameter>
                            <valueString
                                         value="ClinicalDocument/body/observation/performer/representedOrganization/wholeOrganization"/>
                          </parameter>
                        </target>
                      </rule>
                    </rule>
                  </rule>
                  <rule>
                    <name value="identifier"/>
                    <source>
                      <context value="wholeOrgan"/>
                      <element value="id"/>
                      <variable value="id"/>
                    </source>
                    <target>
                      <context value="organization2"/>
                      <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="ext"/>
                      <source>
                        <context value="id"/>
                        <element value="extension"/>
                        <variable value="ext"/>
                      </source>
                      <target>
                        <context value="identifier"/>
                        <contextType value="variable"/>
                        <element value="value"/>
                        <transform value="copy"/>
                        <parameter>
                          <valueId value="ext"/>
                        </parameter>
                      </target>
                      <rule>
                        <name value="UUID"/>
                        <source>
                          <context value="wholeOrgan"/>
                        </source>
                        <target>
                          <context value="request"/>
                          <contextType value="variable"/>
                          <element value="url"/>
                          <transform value="append"/>
                          <parameter>
                            <valueString value="Organization?identifier="/>
                          </parameter>
                          <parameter>
                            <valueId value="ext"/>
                          </parameter>
                        </target>
                      </rule>
                    </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>
                      <name value="r"/>
                      <source>
                        <context value="id"/>
                        <element value="root"/>
                        <variable value="r"/>
                      </source>
                      <rule>
                        <name value="org"/>
                        <source>
                          <context value="id"/>
                          <element value="extension"/>
                          <variable value="ext"/>
                        </source>
                        <target>
                          <context value="organization2"/>
                          <contextType value="variable"/>
                          <element value="id"/>
                          <variable value="uuid5"/>
                          <transform value="evaluate"/>
                          <parameter>
                            <valueString value="r + '-' + ext"/>
                          </parameter>
                        </target>
                        <target>
                          <context value="e5"/>
                          <contextType value="variable"/>
                          <element value="fullUrl"/>
                          <transform value="append"/>
                          <parameter>
                            <valueString
                                         value="https://example/Organization/"/>
                          </parameter>
                          <parameter>
                            <valueId value="uuid5"/>
                          </parameter>
                        </target>
                        <target>
                          <context value="organization1"/>
                          <contextType value="variable"/>
                          <element value="partOf"/>
                          <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/Organization/' + %organization2.id"/>
                          </parameter>
                        </target>
                      </rule>
                    </rule>
                  </rule>
                  <rule>
                    <name value="name"/>
                    <source>
                      <context value="wholeOrgan"/>
                      <element value="name"/>
                      <variable value="v"/>
                    </source>
                    <target>
                      <context value="organization2"/>
                      <contextType value="variable"/>
                      <element value="name"/>
                      <transform value="evaluate"/>
                      <parameter>
                        <valueString value="v.other"/>
                      </parameter>
                    </target>
                  </rule>
                  <rule>
                    <name value="telecom"/>
                    <source>
                      <context value="wholeOrgan"/>
                      <element value="telecom"/>
                      <variable value="vvv"/>
                    </source>
                    <target>
                      <context value="organization2"/>
                      <contextType value="variable"/>
                      <element value="telecom"/>
                      <variable value="vvv"/>
                      <transform value="create"/>
                    </target>
                  </rule>
                  <rule>
                    <name value="addr"/>
                    <source>
                      <context value="wholeOrgan"/>
                      <element value="addr"/>
                      <variable value="vvv"/>
                    </source>
                    <target>
                      <context value="organization2"/>
                      <contextType value="variable"/>
                      <element value="address"/>
                      <variable value="vvv"/>
                      <transform value="create"/>
                    </target>
                  </rule>
                </rule>
              </rule>
              <documentation value="organization"/>
            </rule>
          </rule>
        </rule>
      </rule>
      <documentation value="performer"/>
    </rule>
    <rule>
      <name value="author"/>
      <source>
        <context value="obs"/>
        <element value="author"/>
        <variable value="srcAuthor"/>
      </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="practitionerRole"/>
        <transform value="create"/>
        <parameter>
          <valueString value="PractitionerRole"/>
        </parameter>
      </target>
      <target>
        <context value="practitionerRole"/>
        <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/PractitionerRole/"/>
        </parameter>
        <parameter>
          <valueId value="uuid6"/>
        </parameter>
      </target>
      <target>
        <context value="request"/>
        <contextType value="variable"/>
        <element value="url"/>
        <transform value="copy"/>
        <parameter>
          <valueString value="PractitionerRole"/>
        </parameter>
      </target>
      <target>
        <context value="ob"/>
        <contextType value="variable"/>
        <element value="performer"/>
        <variable value="referenceaut"/>
        <transform value="create"/>
        <parameter>
          <valueString value="Reference"/>
        </parameter>
      </target>
      <target>
        <context value="referenceaut"/>
        <contextType value="variable"/>
        <element value="reference"/>
        <transform value="evaluate"/>
        <parameter>
          <valueString
                       value="'https://example/PractitionerRole/' + %practitionerRole.id"/>
        </parameter>
      </target>
      <rule>
        <name value="assignedAuthor"/>
        <source>
          <context value="srcAuthor"/>
          <element value="assignedAuthor"/>
          <variable value="assignedAuthor"/>
        </source>
        <rule>
          <name value="code"/>
          <source>
            <context value="assignedAuthor"/>
            <element value="code"/>
            <variable value="codice"/>
          </source>
          <target>
            <context value="practitionerRole"/>
            <contextType value="variable"/>
            <element value="code"/>
            <variable value="code2"/>
          </target>
          <dependent>
            <name value="CECodeableConcept"/>
            <variable value="codice"/>
            <variable value="code2"/>
          </dependent>
        </rule>
        <rule>
          <name value="ASSAUth"/>
          <source>
            <context value="assignedAuthor"/>
          </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="PUT"/>
            </parameter>
          </target>
          <target>
            <context value="e7"/>
            <contextType value="variable"/>
            <element value="resource"/>
            <variable value="practitioner"/>
            <transform value="create"/>
            <parameter>
              <valueString value="Practitioner"/>
            </parameter>
          </target>
          <target>
            <context value="practitioner"/>
            <contextType value="variable"/>
            <element value="id"/>
            <variable value="uuid7"/>
            <transform value="uuid"/>
          </target>
          <rule>
            <name value="functionCode"/>
            <source>
              <context value="srcAuthor"/>
              <element value="functionCode"/>
              <variable value="vvv"/>
            </source>
            <target>
              <context value="practitionerRole"/>
              <contextType value="variable"/>
              <element value="code"/>
              <variable value="vvv"/>
              <transform value="create"/>
            </target>
          </rule>
          <rule>
            <name value="meta"/>
            <source>
              <context value="assignedAuthor"/>
            </source>
            <target>
              <context value="practitioner"/>
              <contextType value="variable"/>
              <element value="meta"/>
              <variable value="meta"/>
            </target>
            <rule>
              <name value="coding"/>
              <source>
                <context value="assignedAuthor"/>
              </source>
              <target>
                <context value="meta"/>
                <contextType value="variable"/>
                <element value="tag"/>
                <variable value="coding"/>
                <transform value="create"/>
                <parameter>
                  <valueString value="Coding"/>
                </parameter>
              </target>
              <rule>
                <name value="system"/>
                <source>
                  <context value="assignedAuthor"/>
                </source>
                <target>
                  <context value="coding"/>
                  <contextType value="variable"/>
                  <element value="system"/>
                  <transform value="copy"/>
                  <parameter>
                    <valueString value="http://algoritmodiscoring"/>
                  </parameter>
                </target>
              </rule>
              <rule>
                <name value="code"/>
                <source>
                  <context value="assignedAuthor"/>
                </source>
                <target>
                  <context value="coding"/>
                  <contextType value="variable"/>
                  <element value="code"/>
                  <transform value="copy"/>
                  <parameter>
                    <valueString
                                 value="ClinicalDocument/body/observation/author"/>
                  </parameter>
                </target>
              </rule>
            </rule>
          </rule>
          <rule>
            <name value="identifier"/>
            <source>
              <context value="assignedAuthor"/>
              <element value="id"/>
              <variable value="id"/>
            </source>
            <target>
              <context value="practitioner"/>
              <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="ext"/>
              <source>
                <context value="id"/>
                <element value="extension"/>
                <variable value="ext"/>
              </source>
              <target>
                <context value="identifier"/>
                <contextType value="variable"/>
                <element value="value"/>
                <transform value="copy"/>
                <parameter>
                  <valueId value="ext"/>
                </parameter>
              </target>
              <rule>
                <name value="UUID"/>
                <source>
                  <context value="assignedAuthor"/>
                </source>
                <target>
                  <context value="request"/>
                  <contextType value="variable"/>
                  <element value="url"/>
                  <transform value="append"/>
                  <parameter>
                    <valueString value="Practitioner?identifier="/>
                  </parameter>
                  <parameter>
                    <valueId value="ext"/>
                  </parameter>
                </target>
              </rule>
            </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>
              <name value="r"/>
              <source>
                <context value="id"/>
                <element value="root"/>
                <variable value="r"/>
              </source>
              <rule>
                <name value="aut"/>
                <source>
                  <context value="id"/>
                  <element value="extension"/>
                  <variable value="ext"/>
                </source>
                <target>
                  <context value="practitioner"/>
                  <contextType value="variable"/>
                  <element value="id"/>
                  <variable value="uuid2"/>
                  <transform value="evaluate"/>
                  <parameter>
                    <valueString value="r + '-' + ext"/>
                  </parameter>
                </target>
                <target>
                  <context value="e7"/>
                  <contextType value="variable"/>
                  <element value="fullUrl"/>
                  <transform value="append"/>
                  <parameter>
                    <valueString value="https://example/Practitioner/"/>
                  </parameter>
                  <parameter>
                    <valueId value="uuid2"/>
                  </parameter>
                </target>
                <target>
                  <context value="practitionerRole"/>
                  <contextType value="variable"/>
                  <element value="practitioner"/>
                  <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/Practitioner/' + %practitioner.id"/>
                  </parameter>
                </target>
              </rule>
            </rule>
            <rule>
              <name value="2.16.840.1.113883.2.9.4.3.2"/>
              <source>
                <context value="assignedAuthor"/>
                <element value="id"/>
                <variable value="id"/>
                <condition value="(root = '2.16.840.1.113883.2.9.4.3.2')"/>
              </source>
              <rule>
                <name value="UUID"/>
                <source>
                  <context value="id"/>
                  <element value="extension"/>
                  <variable value="ext"/>
                </source>
                <target>
                  <context value="request"/>
                  <contextType value="variable"/>
                  <element value="url"/>
                  <transform value="append"/>
                  <parameter>
                    <valueString value="Practitioner?identifier="/>
                  </parameter>
                  <parameter>
                    <valueId value="ext"/>
                  </parameter>
                </target>
              </rule>
            </rule>
            <rule>
              <name value="diverso"/>
              <source>
                <context value="assignedAuthor"/>
                <element value="id"/>
                <variable value="id"/>
                <condition value="(root != '2.16.840.1.113883.2.9.4.3.2')"/>
              </source>
              <rule>
                <name value="UUID"/>
                <source>
                  <context value="id"/>
                  <element value="extension"/>
                  <variable value="ext"/>
                </source>
                <target>
                  <context value="request"/>
                  <contextType value="variable"/>
                  <element value="url"/>
                  <transform value="append"/>
                  <parameter>
                    <valueString value="Practitioner?identifier="/>
                  </parameter>
                  <parameter>
                    <valueId value="ext"/>
                  </parameter>
                </target>
              </rule>
            </rule>
          </rule>
          <rule>
            <name value="addr"/>
            <source>
              <context value="assignedAuthor"/>
              <element value="addr"/>
              <variable value="vvv"/>
            </source>
            <target>
              <context value="practitioner"/>
              <contextType value="variable"/>
              <element value="address"/>
              <variable value="vvv"/>
              <transform value="create"/>
            </target>
          </rule>
          <rule>
            <name value="telecom"/>
            <source>
              <context value="assignedAuthor"/>
              <element value="telecom"/>
              <variable value="vvv"/>
            </source>
            <target>
              <context value="practitioner"/>
              <contextType value="variable"/>
              <element value="telecom"/>
              <variable value="vvv"/>
              <transform value="create"/>
            </target>
          </rule>
          <rule>
            <name value="name"/>
            <source>
              <context value="assignedAuthor"/>
              <element value="assignedPerson"/>
              <variable value="person"/>
            </source>
            <rule>
              <name value="name"/>
              <source>
                <context value="person"/>
                <element value="name"/>
                <variable value="vvv"/>
              </source>
              <target>
                <context value="practitioner"/>
                <contextType value="variable"/>
                <element value="name"/>
                <variable value="vvv"/>
                <transform value="create"/>
              </target>
            </rule>
            <rule>
              <name value="birth"/>
              <source>
                <context value="person"/>
                <element value="birthTime"/>
                <variable value="birthTime"/>
              </source>
              <rule>
                <name value="value"/>
                <source>
                  <context value="birthTime"/>
                  <element value="value"/>
                  <variable value="date"/>
                </source>
                <target>
                  <context value="practitioner"/>
                  <contextType value="variable"/>
                  <element value="birthDate"/>
                  <transform value="truncate"/>
                  <parameter>
                    <valueId value="date"/>
                  </parameter>
                  <parameter>
                    <valueInteger value="10"/>
                  </parameter>
                </target>
              </rule>
            </rule>
            <documentation value="person"/>
          </rule>
        </rule>
        <rule>
          <name value="representedOrganization"/>
          <source>
            <context value="assignedAuthor"/>
            <element value="representedOrganization"/>
            <variable value="representedOrganization"/>
          </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="PUT"/>
            </parameter>
          </target>
          <target>
            <context value="e8"/>
            <contextType value="variable"/>
            <element value="resource"/>
            <variable value="organization"/>
            <transform value="create"/>
            <parameter>
              <valueString value="Organization"/>
            </parameter>
          </target>
          <rule>
            <name value="meta"/>
            <source>
              <context value="representedOrganization"/>
            </source>
            <target>
              <context value="organization"/>
              <contextType value="variable"/>
              <element value="meta"/>
              <variable value="meta"/>
            </target>
            <rule>
              <name value="coding"/>
              <source>
                <context value="representedOrganization"/>
              </source>
              <target>
                <context value="meta"/>
                <contextType value="variable"/>
                <element value="tag"/>
                <variable value="coding"/>
                <transform value="create"/>
                <parameter>
                  <valueString value="Coding"/>
                </parameter>
              </target>
              <rule>
                <name value="system"/>
                <source>
                  <context value="representedOrganization"/>
                </source>
                <target>
                  <context value="coding"/>
                  <contextType value="variable"/>
                  <element value="system"/>
                  <transform value="copy"/>
                  <parameter>
                    <valueString value="http://algoritmodiscoring"/>
                  </parameter>
                </target>
              </rule>
              <rule>
                <name value="code"/>
                <source>
                  <context value="representedOrganization"/>
                </source>
                <target>
                  <context value="coding"/>
                  <contextType value="variable"/>
                  <element value="code"/>
                  <transform value="copy"/>
                  <parameter>
                    <valueString
                                 value="ClinicalDocument/body/observation/author/representedOrganization"/>
                  </parameter>
                </target>
              </rule>
            </rule>
          </rule>
          <rule>
            <name value="identifier"/>
            <source>
              <context value="representedOrganization"/>
              <element value="id"/>
              <variable value="id"/>
            </source>
            <target>
              <context value="organization"/>
              <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="ext"/>
              <source>
                <context value="id"/>
                <element value="extension"/>
                <variable value="ext"/>
              </source>
              <target>
                <context value="identifier"/>
                <contextType value="variable"/>
                <element value="value"/>
                <transform value="copy"/>
                <parameter>
                  <valueId value="ext"/>
                </parameter>
              </target>
              <rule>
                <name value="UUID"/>
                <source>
                  <context value="representedOrganization"/>
                </source>
                <target>
                  <context value="request"/>
                  <contextType value="variable"/>
                  <element value="url"/>
                  <transform value="append"/>
                  <parameter>
                    <valueString value="Organization?identifier="/>
                  </parameter>
                  <parameter>
                    <valueId value="ext"/>
                  </parameter>
                </target>
              </rule>
            </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>
              <name value="r"/>
              <source>
                <context value="id"/>
                <element value="root"/>
                <variable value="r"/>
              </source>
              <rule>
                <name value="org"/>
                <source>
                  <context value="id"/>
                  <element value="extension"/>
                  <variable value="ext"/>
                </source>
                <target>
                  <context value="organization"/>
                  <contextType value="variable"/>
                  <element value="id"/>
                  <variable value="uuid3"/>
                  <transform value="evaluate"/>
                  <parameter>
                    <valueString value="r + '-' + ext"/>
                  </parameter>
                </target>
                <target>
                  <context value="e8"/>
                  <contextType value="variable"/>
                  <element value="fullUrl"/>
                  <transform value="append"/>
                  <parameter>
                    <valueString value="https://example/Organization/"/>
                  </parameter>
                  <parameter>
                    <valueId value="uuid3"/>
                  </parameter>
                </target>
                <target>
                  <context value="practitionerRole"/>
                  <contextType value="variable"/>
                  <element value="organization"/>
                  <variable value="referenceOrg"/>
                  <transform value="create"/>
                  <parameter>
                    <valueString value="Reference"/>
                  </parameter>
                </target>
                <target>
                  <context value="referenceOrg"/>
                  <contextType value="variable"/>
                  <element value="reference"/>
                  <transform value="append"/>
                  <parameter>
                    <valueString value="https://example/Organization/"/>
                  </parameter>
                  <parameter>
                    <valueId value="uuid3"/>
                  </parameter>
                </target>
              </rule>
            </rule>
          </rule>
          <rule>
            <name value="name"/>
            <source>
              <context value="representedOrganization"/>
              <element value="name"/>
              <variable value="v"/>
            </source>
            <target>
              <context value="organization"/>
              <contextType value="variable"/>
              <element value="name"/>
              <transform value="evaluate"/>
              <parameter>
                <valueString value="v.other"/>
              </parameter>
            </target>
          </rule>
          <rule>
            <name value="telecom"/>
            <source>
              <context value="representedOrganization"/>
              <element value="telecom"/>
              <variable value="vvv"/>
            </source>
            <target>
              <context value="organization"/>
              <contextType value="variable"/>
              <element value="telecom"/>
              <variable value="vvv"/>
              <transform value="create"/>
            </target>
          </rule>
          <rule>
            <name value="addr"/>
            <source>
              <context value="representedOrganization"/>
              <element value="addr"/>
              <variable value="vvv"/>
            </source>
            <target>
              <context value="organization"/>
              <contextType value="variable"/>
              <element value="address"/>
              <variable value="vvv"/>
              <transform value="create"/>
            </target>
          </rule>
          <rule>
            <name value="OrgPartOf"/>
            <source>
              <context value="representedOrganization"/>
              <element value="asOrganizationPartOf"/>
              <variable value="OrgPartOf"/>
            </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="PUT"/>
              </parameter>
            </target>
            <target>
              <context value="e9"/>
              <contextType value="variable"/>
              <element value="resource"/>
              <variable value="organization1"/>
              <transform value="create"/>
              <parameter>
                <valueString value="Organization"/>
              </parameter>
            </target>
            <rule>
              <name value="meta"/>
              <source>
                <context value="OrgPartOf"/>
              </source>
              <target>
                <context value="organization1"/>
                <contextType value="variable"/>
                <element value="meta"/>
                <variable value="meta"/>
              </target>
              <rule>
                <name value="coding"/>
                <source>
                  <context value="OrgPartOf"/>
                </source>
                <target>
                  <context value="meta"/>
                  <contextType value="variable"/>
                  <element value="tag"/>
                  <variable value="coding"/>
                  <transform value="create"/>
                  <parameter>
                    <valueString value="Coding"/>
                  </parameter>
                </target>
                <rule>
                  <name value="system"/>
                  <source>
                    <context value="OrgPartOf"/>
                  </source>
                  <target>
                    <context value="coding"/>
                    <contextType value="variable"/>
                    <element value="system"/>
                    <transform value="copy"/>
                    <parameter>
                      <valueString value="http://algoritmodiscoring"/>
                    </parameter>
                  </target>
                </rule>
                <rule>
                  <name value="code"/>
                  <source>
                    <context value="OrgPartOf"/>
                  </source>
                  <target>
                    <context value="coding"/>
                    <contextType value="variable"/>
                    <element value="code"/>
                    <transform value="copy"/>
                    <parameter>
                      <valueString
                                   value="ClinicalDocument/body/observation/author/representedOrganization/asOrganizationPartOf"/>
                    </parameter>
                  </target>
                </rule>
              </rule>
            </rule>
            <rule>
              <name value="identifier"/>
              <source>
                <context value="OrgPartOf"/>
                <element value="id"/>
                <variable value="id"/>
              </source>
              <target>
                <context value="organization1"/>
                <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="ext"/>
                <source>
                  <context value="id"/>
                  <element value="extension"/>
                  <variable value="ext"/>
                </source>
                <target>
                  <context value="identifier"/>
                  <contextType value="variable"/>
                  <element value="value"/>
                  <transform value="copy"/>
                  <parameter>
                    <valueId value="ext"/>
                  </parameter>
                </target>
                <rule>
                  <name value="UUID"/>
                  <source>
                    <context value="OrgPartOf"/>
                  </source>
                  <target>
                    <context value="request"/>
                    <contextType value="variable"/>
                    <element value="url"/>
                    <transform value="append"/>
                    <parameter>
                      <valueString value="Organization?identifier="/>
                    </parameter>
                    <parameter>
                      <valueId value="ext"/>
                    </parameter>
                  </target>
                </rule>
              </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>
                <name value="r"/>
                <source>
                  <context value="id"/>
                  <element value="root"/>
                  <variable value="r"/>
                </source>
                <rule>
                  <name value="org"/>
                  <source>
                    <context value="id"/>
                    <element value="extension"/>
                    <variable value="ext"/>
                  </source>
                  <target>
                    <context value="organization1"/>
                    <contextType value="variable"/>
                    <element value="id"/>
                    <variable value="uuid4"/>
                    <transform value="evaluate"/>
                    <parameter>
                      <valueString value="r + '-' + ext"/>
                    </parameter>
                  </target>
                  <target>
                    <context value="e9"/>
                    <contextType value="variable"/>
                    <element value="fullUrl"/>
                    <transform value="append"/>
                    <parameter>
                      <valueString value="https://example/Organization/"/>
                    </parameter>
                    <parameter>
                      <valueId value="uuid4"/>
                    </parameter>
                  </target>
                  <target>
                    <context value="organization"/>
                    <contextType value="variable"/>
                    <element value="partOf"/>
                    <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/Organization/' + %organization1.id"/>
                    </parameter>
                  </target>
                </rule>
              </rule>
            </rule>
            <rule>
              <name value="code"/>
              <source>
                <context value="OrgPartOf"/>
                <element value="code"/>
                <variable value="vvv"/>
              </source>
              <target>
                <context value="organization1"/>
                <contextType value="variable"/>
                <element value="type"/>
                <variable value="vvv"/>
                <transform value="create"/>
              </target>
            </rule>
            <rule>
              <name value="statusCode"/>
              <source>
                <context value="OrgPartOf"/>
                <element value="statusCode"/>
                <variable value="status"/>
                <condition value="(value = 'active')"/>
              </source>
              <target>
                <context value="organization1"/>
                <contextType value="variable"/>
                <element value="active"/>
                <transform value="create"/>
                <parameter>
                  <valueString value="boolean"/>
                </parameter>
              </target>
              <target>
                <context value="organization1"/>
                <contextType value="variable"/>
                <element value="active"/>
                <transform value="copy"/>
                <parameter>
                  <valueString value="true"/>
                </parameter>
              </target>
            </rule>
            <rule>
              <name value="wholeOrganization"/>
              <source>
                <context value="OrgPartOf"/>
                <element value="wholeOrganization"/>
                <variable value="wholeOrgan"/>
              </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="PUT"/>
                </parameter>
              </target>
              <target>
                <context value="e10"/>
                <contextType value="variable"/>
                <element value="resource"/>
                <variable value="organization2"/>
                <transform value="create"/>
                <parameter>
                  <valueString value="Organization"/>
                </parameter>
              </target>
              <rule>
                <name value="meta"/>
                <source>
                  <context value="wholeOrgan"/>
                </source>
                <target>
                  <context value="organization2"/>
                  <contextType value="variable"/>
                  <element value="meta"/>
                  <variable value="meta"/>
                </target>
                <rule>
                  <name value="coding"/>
                  <source>
                    <context value="wholeOrgan"/>
                  </source>
                  <target>
                    <context value="meta"/>
                    <contextType value="variable"/>
                    <element value="tag"/>
                    <variable value="coding"/>
                    <transform value="create"/>
                    <parameter>
                      <valueString value="Coding"/>
                    </parameter>
                  </target>
                  <rule>
                    <name value="system"/>
                    <source>
                      <context value="wholeOrgan"/>
                    </source>
                    <target>
                      <context value="coding"/>
                      <contextType value="variable"/>
                      <element value="system"/>
                      <transform value="copy"/>
                      <parameter>
                        <valueString value="http://algoritmodiscoring"/>
                      </parameter>
                    </target>
                  </rule>
                  <rule>
                    <name value="code"/>
                    <source>
                      <context value="wholeOrgan"/>
                    </source>
                    <target>
                      <context value="coding"/>
                      <contextType value="variable"/>
                      <element value="code"/>
                      <transform value="copy"/>
                      <parameter>
                        <valueString
                                     value="ClinicalDocument/body/observation/author/representedOrganization/asOrganizationPartOf/wholeOrganization"/>
                      </parameter>
                    </target>
                  </rule>
                </rule>
              </rule>
              <rule>
                <name value="identifier"/>
                <source>
                  <context value="wholeOrgan"/>
                  <element value="id"/>
                  <variable value="id"/>
                </source>
                <target>
                  <context value="organization2"/>
                  <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="ext"/>
                  <source>
                    <context value="id"/>
                    <element value="extension"/>
                    <variable value="ext"/>
                  </source>
                  <target>
                    <context value="identifier"/>
                    <contextType value="variable"/>
                    <element value="value"/>
                    <transform value="copy"/>
                    <parameter>
                      <valueId value="ext"/>
                    </parameter>
                  </target>
                  <rule>
                    <name value="UUID"/>
                    <source>
                      <context value="wholeOrgan"/>
                    </source>
                    <target>
                      <context value="request"/>
                      <contextType value="variable"/>
                      <element value="url"/>
                      <transform value="append"/>
                      <parameter>
                        <valueString value="Organization?identifier="/>
                      </parameter>
                      <parameter>
                        <valueId value="ext"/>
                      </parameter>
                    </target>
                  </rule>
                </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>
                  <name value="r"/>
                  <source>
                    <context value="id"/>
                    <element value="root"/>
                    <variable value="r"/>
                  </source>
                  <rule>
                    <name value="org"/>
                    <source>
                      <context value="id"/>
                      <element value="extension"/>
                      <variable value="ext"/>
                    </source>
                    <target>
                      <context value="organization2"/>
                      <contextType value="variable"/>
                      <element value="id"/>
                      <variable value="uuid4"/>
                      <transform value="evaluate"/>
                      <parameter>
                        <valueString value="r + '-' + ext"/>
                      </parameter>
                    </target>
                    <target>
                      <context value="e10"/>
                      <contextType value="variable"/>
                      <element value="fullUrl"/>
                      <transform value="append"/>
                      <parameter>
                        <valueString value="https://example/Organization/"/>
                      </parameter>
                      <parameter>
                        <valueId value="uuid4"/>
                      </parameter>
                    </target>
                    <target>
                      <context value="organization1"/>
                      <contextType value="variable"/>
                      <element value="partOf"/>
                      <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/Organization/' + %organization2.id"/>
                      </parameter>
                    </target>
                  </rule>
                </rule>
              </rule>
              <rule>
                <name value="name"/>
                <source>
                  <context value="wholeOrgan"/>
                  <element value="name"/>
                  <variable value="v"/>
                </source>
                <target>
                  <context value="organization2"/>
                  <contextType value="variable"/>
                  <element value="name"/>
                  <transform value="evaluate"/>
                  <parameter>
                    <valueString value="v.other"/>
                  </parameter>
                </target>
              </rule>
              <rule>
                <name value="telecom"/>
                <source>
                  <context value="wholeOrgan"/>
                  <element value="telecom"/>
                  <variable value="vvv"/>
                </source>
                <target>
                  <context value="organization2"/>
                  <contextType value="variable"/>
                  <element value="telecom"/>
                  <variable value="vvv"/>
                  <transform value="create"/>
                </target>
              </rule>
              <rule>
                <name value="addr"/>
                <source>
                  <context value="wholeOrgan"/>
                  <element value="addr"/>
                  <variable value="vvv"/>
                </source>
                <target>
                  <context value="organization2"/>
                  <contextType value="variable"/>
                  <element value="address"/>
                  <variable value="vvv"/>
                  <transform value="create"/>
                </target>
              </rule>
            </rule>
          </rule>
          <documentation value="organization"/>
        </rule>
        <rule>
          <name value="Device"/>
          <source>
            <context value="assignedAuthor"/>
            <element value="assignedAuthoringDevice"/>
            <variable value="assignedAuthoringDevice"/>
          </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="device"/>
            <transform value="create"/>
            <parameter>
              <valueString value="Device"/>
            </parameter>
          </target>
          <target>
            <context value="device"/>
            <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/Device/"/>
            </parameter>
            <parameter>
              <valueId value="uuid11"/>
            </parameter>
          </target>
          <target>
            <context value="request"/>
            <contextType value="variable"/>
            <element value="url"/>
            <transform value="copy"/>
            <parameter>
              <valueString value="Device"/>
            </parameter>
          </target>
          <target>
            <context value="tgt"/>
            <contextType value="variable"/>
            <element value="author"/>
            <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/Device/' + %device.id"/>
            </parameter>
          </target>
          <rule>
            <name value="templateId"/>
            <source>
              <context value="assignedAuthoringDevice"/>
              <element value="templateId"/>
              <variable value="vvv"/>
            </source>
            <target>
              <context value="device"/>
              <contextType value="variable"/>
              <element value="identifier"/>
              <variable value="vvv"/>
              <transform value="create"/>
            </target>
          </rule>
          <rule>
            <name value="code"/>
            <source>
              <context value="assignedAuthoringDevice"/>
              <element value="code"/>
              <variable value="vvv"/>
            </source>
            <target>
              <context value="device"/>
              <contextType value="variable"/>
              <element value="type"/>
              <variable value="vvv"/>
              <transform value="create"/>
            </target>
          </rule>
          <rule>
            <name value="manufacturer"/>
            <source>
              <context value="assignedAuthoringDevice"/>
              <element value="manufacturerModelName"/>
              <variable value="manufacturerModelName"/>
            </source>
            <rule>
              <name value="displayRule"/>
              <source>
                <context value="manufacturerModelName"/>
                <variable value="m"/>
              </source>
              <target>
                <context value="device"/>
                <contextType value="variable"/>
                <element value="manufacturer"/>
                <transform value="evaluate"/>
                <parameter>
                  <valueString value="m.displayName"/>
                </parameter>
              </target>
            </rule>
          </rule>
          <rule>
            <name value="deviceName"/>
            <source>
              <context value="assignedAuthoringDevice"/>
              <element value="softwareName"/>
              <variable value="softwareName"/>
            </source>
            <target>
              <context value="device"/>
              <contextType value="variable"/>
              <element value="deviceName"/>
              <variable value="deviceName"/>
            </target>
            <rule>
              <name value="typeName"/>
              <source>
                <context value="softwareName"/>
              </source>
              <target>
                <context value="deviceName"/>
                <contextType value="variable"/>
                <element value="type"/>
                <transform value="copy"/>
                <parameter>
                  <valueString value="other"/>
                </parameter>
              </target>
            </rule>
            <rule>
              <name value="name"/>
              <source>
                <context value="softwareName"/>
                <variable value="s"/>
              </source>
              <target>
                <context value="deviceName"/>
                <contextType value="variable"/>
                <element value="name"/>
                <transform value="evaluate"/>
                <parameter>
                  <valueString value="s.displayName"/>
                </parameter>
              </target>
            </rule>
          </rule>
          <documentation value="device"/>
        </rule>
      </rule>
      <documentation value="author"/>
    </rule>
    <rule>
      <name value="participantEncounter"/>
      <source>
        <context value="obs"/>
        <element value="participant"/>
        <variable value="participant"/>
        <condition value="(typeCode != 'DEV')"/>
      </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>
        <name value="fhirParticipant"/>
        <source>
          <context value="participant"/>
        </source>
        <target>
          <context value="encounter"/>
          <contextType value="variable"/>
          <element value="participant"/>
          <variable value="FhirParticipant"/>
        </target>
        <rule>
          <name value="type"/>
          <source>
            <context value="participant"/>
            <variable value="p"/>
          </source>
          <target>
            <context value="FhirParticipant"/>
            <contextType value="variable"/>
            <element value="type"/>
            <variable value="type"/>
          </target>
          <rule>
            <name value="codeType"/>
            <source>
              <context value="p"/>
            </source>
            <target>
              <context value="type"/>
              <contextType value="variable"/>
              <element value="coding"/>
              <variable value="coding"/>
            </target>
            <rule>
              <name value="codice"/>
              <source>
                <context value="p"/>
              </source>
              <target>
                <context value="coding"/>
                <contextType value="variable"/>
                <element value="code"/>
                <transform value="evaluate"/>
                <parameter>
                  <valueString value="p.typeCode"/>
                </parameter>
              </target>
            </rule>
            <rule>
              <name value="system"/>
              <source>
                <context value="p"/>
              </source>
              <target>
                <context value="coding"/>
                <contextType value="variable"/>
                <element value="system"/>
                <transform value="copy"/>
                <parameter>
                  <valueString
                               value="http://terminology.hl7.org/CodeSystem/v3-ParticipationType"/>
                </parameter>
              </target>
            </rule>
          </rule>
        </rule>
      </rule>
      <rule>
        <name value="partRole"/>
        <source>
          <context value="participant"/>
          <element value="participantRole"/>
          <variable value="participantRole"/>
        </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="practitionerRole"/>
          <transform value="create"/>
          <parameter>
            <valueString value="PractitionerRole"/>
          </parameter>
        </target>
        <target>
          <context value="practitionerRole"/>
          <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/PractitionerRole/"/>
          </parameter>
          <parameter>
            <valueId value="uuid12"/>
          </parameter>
        </target>
        <target>
          <context value="request"/>
          <contextType value="variable"/>
          <element value="url"/>
          <transform value="copy"/>
          <parameter>
            <valueString value="PractitionerRole"/>
          </parameter>
        </target>
        <target>
          <context value="encounter"/>
          <contextType value="variable"/>
          <element value="participant"/>
          <variable value="participant1"/>
          <transform value="create"/>
          <parameter>
            <valueString value="BackboneElement"/>
          </parameter>
        </target>
        <target>
          <context value="participant1"/>
          <contextType value="variable"/>
          <element value="individual"/>
          <variable value="referencepart"/>
          <transform value="create"/>
          <parameter>
            <valueString value="Reference"/>
          </parameter>
        </target>
        <target>
          <context value="referencepart"/>
          <contextType value="variable"/>
          <element value="reference"/>
          <transform value="evaluate"/>
          <parameter>
            <valueString
                         value="'https://example/Practitioner/' + %practitionerRole.id"/>
          </parameter>
        </target>
        <rule>
          <name value="time"/>
          <source>
            <context value="participant"/>
            <element value="time"/>
            <variable value="time1"/>
          </source>
          <target>
            <context value="participant1"/>
            <contextType value="variable"/>
            <element value="period"/>
            <variable value="period"/>
            <transform value="create"/>
            <parameter>
              <valueString value="Period"/>
            </parameter>
          </target>
          <rule>
            <name value="val"/>
            <source>
              <context value="time1"/>
            </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="time1"/>
              <variable value="start"/>
            </dependent>
          </rule>
          <documentation value="participant.time -&gt; participant1.period;"/>
        </rule>
        <rule>
          <name value="time"/>
          <source>
            <context value="participant"/>
            <element value="time"/>
            <variable value="time1"/>
          </source>
          <target>
            <context value="participant1"/>
            <contextType value="variable"/>
            <element value="period"/>
            <variable value="period"/>
            <transform value="create"/>
            <parameter>
              <valueString value="Period"/>
            </parameter>
          </target>
          <dependent>
            <name value="IVLTSPeriod"/>
            <variable value="time1"/>
            <variable value="period"/>
          </dependent>
        </rule>
        <rule>
          <name value="functionCode"/>
          <source>
            <context value="participant"/>
            <element value="functionCode"/>
            <variable value="vvv"/>
          </source>
          <target>
            <context value="practitionerRole"/>
            <contextType value="variable"/>
            <element value="code"/>
            <variable value="vvv"/>
            <transform value="create"/>
          </target>
        </rule>
        <rule>
          <name value="practitioner"/>
          <source>
            <context value="participantRole"/>
          </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="PUT"/>
            </parameter>
          </target>
          <target>
            <context value="e13"/>
            <contextType value="variable"/>
            <element value="resource"/>
            <variable value="practitioner"/>
            <transform value="create"/>
            <parameter>
              <valueString value="Practitioner"/>
            </parameter>
          </target>
          <rule>
            <name value="meta"/>
            <source>
              <context value="participantRole"/>
            </source>
            <target>
              <context value="practitioner"/>
              <contextType value="variable"/>
              <element value="meta"/>
              <variable value="meta"/>
            </target>
            <rule>
              <name value="coding"/>
              <source>
                <context value="participantRole"/>
              </source>
              <target>
                <context value="meta"/>
                <contextType value="variable"/>
                <element value="tag"/>
                <variable value="coding"/>
                <transform value="create"/>
                <parameter>
                  <valueString value="Coding"/>
                </parameter>
              </target>
              <rule>
                <name value="system"/>
                <source>
                  <context value="participantRole"/>
                </source>
                <target>
                  <context value="coding"/>
                  <contextType value="variable"/>
                  <element value="system"/>
                  <transform value="copy"/>
                  <parameter>
                    <valueString value="http://algoritmodiscoring"/>
                  </parameter>
                </target>
              </rule>
              <rule>
                <name value="code"/>
                <source>
                  <context value="participantRole"/>
                </source>
                <target>
                  <context value="coding"/>
                  <contextType value="variable"/>
                  <element value="code"/>
                  <transform value="copy"/>
                  <parameter>
                    <valueString
                                 value="ClinicalDocument/body/observation/participant"/>
                  </parameter>
                </target>
              </rule>
            </rule>
          </rule>
          <rule>
            <name value="identifier"/>
            <source>
              <context value="participantRole"/>
              <element value="id"/>
              <variable value="id"/>
            </source>
            <target>
              <context value="practitioner"/>
              <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="ext"/>
              <source>
                <context value="id"/>
                <element value="extension"/>
                <variable value="ext"/>
              </source>
              <target>
                <context value="identifier"/>
                <contextType value="variable"/>
                <element value="value"/>
                <transform value="copy"/>
                <parameter>
                  <valueId value="ext"/>
                </parameter>
              </target>
              <rule>
                <name value="UUID"/>
                <source>
                  <context value="participantRole"/>
                </source>
                <target>
                  <context value="request"/>
                  <contextType value="variable"/>
                  <element value="url"/>
                  <transform value="append"/>
                  <parameter>
                    <valueString value="Practitioner?identifier="/>
                  </parameter>
                  <parameter>
                    <valueId value="ext"/>
                  </parameter>
                </target>
              </rule>
            </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>
              <name value="r"/>
              <source>
                <context value="id"/>
                <element value="root"/>
                <variable value="r"/>
              </source>
              <rule>
                <name value="org"/>
                <source>
                  <context value="id"/>
                  <element value="extension"/>
                  <variable value="ext"/>
                </source>
                <target>
                  <context value="practitioner"/>
                  <contextType value="variable"/>
                  <element value="id"/>
                  <variable value="uuid4"/>
                  <transform value="evaluate"/>
                  <parameter>
                    <valueString value="r + '-' + ext"/>
                  </parameter>
                </target>
                <target>
                  <context value="e13"/>
                  <contextType value="variable"/>
                  <element value="fullUrl"/>
                  <transform value="append"/>
                  <parameter>
                    <valueString value="https://example/Practitioner/"/>
                  </parameter>
                  <parameter>
                    <valueId value="uuid4"/>
                  </parameter>
                </target>
                <target>
                  <context value="practitionerRole"/>
                  <contextType value="variable"/>
                  <element value="practitioner"/>
                  <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/Practitioner/' + %practitioner.id"/>
                  </parameter>
                </target>
              </rule>
            </rule>
          </rule>
          <rule>
            <name value="code"/>
            <source>
              <context value="participantRole"/>
              <element value="code"/>
              <variable value="vvv"/>
            </source>
            <target>
              <context value="practitionerRole"/>
              <contextType value="variable"/>
              <element value="code"/>
              <variable value="vvv"/>
              <transform value="create"/>
            </target>
          </rule>
          <rule>
            <name value="addr"/>
            <source>
              <context value="participantRole"/>
              <element value="addr"/>
              <variable value="vvv"/>
            </source>
            <target>
              <context value="practitioner"/>
              <contextType value="variable"/>
              <element value="address"/>
              <variable value="vvv"/>
              <transform value="create"/>
            </target>
          </rule>
          <rule>
            <name value="telecom"/>
            <source>
              <context value="participantRole"/>
              <element value="telecom"/>
              <variable value="vvv"/>
            </source>
            <target>
              <context value="practitioner"/>
              <contextType value="variable"/>
              <element value="telecom"/>
              <variable value="vvv"/>
              <transform value="create"/>
            </target>
          </rule>
          <rule>
            <name value="name"/>
            <source>
              <context value="participantRole"/>
              <element value="playingEntity"/>
              <variable value="playingEntity"/>
            </source>
            <rule>
              <name value="name"/>
              <source>
                <context value="playingEntity"/>
                <element value="name"/>
                <variable value="vvv"/>
              </source>
              <target>
                <context value="practitioner"/>
                <contextType value="variable"/>
                <element value="name"/>
                <variable value="vvv"/>
                <transform value="create"/>
              </target>
            </rule>
            <rule>
              <name value="birth"/>
              <source>
                <context value="playingEntity"/>
                <element value="birthTime"/>
                <variable value="birthTime"/>
              </source>
              <rule>
                <name value="value"/>
                <source>
                  <context value="birthTime"/>
                  <element value="value"/>
                  <variable value="date"/>
                </source>
                <target>
                  <context value="practitioner"/>
                  <contextType value="variable"/>
                  <element value="birthDate"/>
                  <transform value="truncate"/>
                  <parameter>
                    <valueId value="date"/>
                  </parameter>
                  <parameter>
                    <valueInteger value="10"/>
                  </parameter>
                </target>
              </rule>
            </rule>
          </rule>
          <documentation value="non mappa i 2 precedenti"/>
        </rule>
      </rule>
      <documentation value="participant person"/>
    </rule>
    <rule>
      <name value="devParticipant"/>
      <source>
        <context value="obs"/>
        <element value="participant"/>
        <variable value="devParticipant"/>
        <condition value="(typeCode = 'DEV')"/>
      </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="device"/>
        <transform value="create"/>
        <parameter>
          <valueString value="Device"/>
        </parameter>
      </target>
      <target>
        <context value="device"/>
        <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/Device/"/>
        </parameter>
        <parameter>
          <valueId value="uuid14"/>
        </parameter>
      </target>
      <target>
        <context value="request"/>
        <contextType value="variable"/>
        <element value="url"/>
        <transform value="copy"/>
        <parameter>
          <valueString value="Device"/>
        </parameter>
      </target>
      <target>
        <context value="ob"/>
        <contextType value="variable"/>
        <element value="device"/>
        <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/Device/' + %device.id"/>
        </parameter>
      </target>
      <rule>
        <name value="participantRoleDev"/>
        <source>
          <context value="devParticipant"/>
          <element value="participantRole"/>
          <variable value="participantRoleDev"/>
        </source>
        <rule>
          <name value="playingDevice"/>
          <source>
            <context value="participantRoleDev"/>
            <element value="playingDevice"/>
            <variable value="playingDevice"/>
          </source>
          <rule>
            <name value="code"/>
            <source>
              <context value="playingDevice"/>
              <element value="code"/>
              <variable value="vvv"/>
            </source>
            <target>
              <context value="device"/>
              <contextType value="variable"/>
              <element value="type"/>
              <variable value="vvv"/>
              <transform value="create"/>
            </target>
          </rule>
          <rule>
            <name value="manufacturer"/>
            <source>
              <context value="playingDevice"/>
              <element value="manufacturerModelName"/>
              <variable value="manufacturerModelName"/>
            </source>
            <rule>
              <name value="displayRule"/>
              <source>
                <context value="manufacturerModelName"/>
                <variable value="m"/>
              </source>
              <target>
                <context value="device"/>
                <contextType value="variable"/>
                <element value="manufacturer"/>
                <transform value="evaluate"/>
                <parameter>
                  <valueString value="m.displayName"/>
                </parameter>
              </target>
            </rule>
          </rule>
          <rule>
            <name value="deviceName"/>
            <source>
              <context value="playingDevice"/>
              <element value="softwareName"/>
              <variable value="softwareName"/>
            </source>
            <target>
              <context value="device"/>
              <contextType value="variable"/>
              <element value="deviceName"/>
              <variable value="deviceName"/>
            </target>
            <rule>
              <name value="typeName"/>
              <source>
                <context value="softwareName"/>
              </source>
              <target>
                <context value="deviceName"/>
                <contextType value="variable"/>
                <element value="type"/>
                <transform value="copy"/>
                <parameter>
                  <valueString value="other"/>
                </parameter>
              </target>
            </rule>
            <rule>
              <name value="name"/>
              <source>
                <context value="softwareName"/>
                <variable value="s"/>
              </source>
              <target>
                <context value="deviceName"/>
                <contextType value="variable"/>
                <element value="name"/>
                <transform value="evaluate"/>
                <parameter>
                  <valueString value="s.displayName"/>
                </parameter>
              </target>
            </rule>
          </rule>
        </rule>
      </rule>
      <documentation value="participant device"/>
    </rule>
    <rule>
      <name value="observationMedia"/>
      <source>
        <context value="obs"/>
        <element value="entryRelationship"/>
        <variable value="er"/>
      </source>
      <rule>
        <name value="media"/>
        <source>
          <context value="er"/>
          <element value="observationMedia"/>
          <variable value="obsMedia"/>
        </source>
        <target>
          <context value="bundle"/>
          <contextType value="variable"/>
          <element value="entry"/>
          <variable value="e15"/>
        </target>
        <target>
          <context value="e15"/>
          <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="e15"/>
          <contextType value="variable"/>
          <element value="resource"/>
          <variable value="media1"/>
          <transform value="create"/>
          <parameter>
            <valueString value="Media"/>
          </parameter>
        </target>
        <target>
          <context value="media1"/>
          <contextType value="variable"/>
          <element value="id"/>
          <variable value="uuid15"/>
          <transform value="uuid"/>
        </target>
        <target>
          <context value="e15"/>
          <contextType value="variable"/>
          <element value="fullUrl"/>
          <transform value="append"/>
          <parameter>
            <valueString value="https://example/Media/"/>
          </parameter>
          <parameter>
            <valueId value="uuid15"/>
          </parameter>
        </target>
        <target>
          <context value="request"/>
          <contextType value="variable"/>
          <element value="url"/>
          <transform value="copy"/>
          <parameter>
            <valueString value="Media"/>
          </parameter>
        </target>
        <target>
          <context value="ob"/>
          <contextType value="variable"/>
          <element value="derivedFrom"/>
          <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/Media/' + %media1.id"/>
          </parameter>
        </target>
        <rule>
          <name value="Attachment"/>
          <source>
            <context value="obsMedia"/>
          </source>
          <target>
            <context value="media1"/>
            <contextType value="variable"/>
            <element value="content"/>
            <variable value="Attachment"/>
            <transform value="create"/>
            <parameter>
              <valueString value="Attachment"/>
            </parameter>
          </target>
          <rule>
            <name value="status"/>
            <source>
              <context value="obsMedia"/>
            </source>
            <target>
              <context value="media1"/>
              <contextType value="variable"/>
              <element value="status"/>
              <transform value="copy"/>
              <parameter>
                <valueString value="unknown"/>
              </parameter>
            </target>
          </rule>
          <rule>
            <name value="valuemedia"/>
            <source>
              <context value="obsMedia"/>
              <element value="value"/>
              <variable value="valueMedia"/>
            </source>
            <rule>
              <name value="type"/>
              <source>
                <context value="valueMedia"/>
                <element value="mediaType"/>
                <variable value="type"/>
              </source>
              <target>
                <context value="Attachment"/>
                <contextType value="variable"/>
                <element value="contentType"/>
                <transform value="copy"/>
                <parameter>
                  <valueId value="type"/>
                </parameter>
              </target>
            </rule>
            <rule>
              <name value="data"/>
              <source>
                <context value="valueMedia"/>
              </source>
              <target>
                <context value="Attachment"/>
                <contextType value="variable"/>
                <element value="data"/>
                <transform value="evaluate"/>
                <parameter>
                  <valueString value="valueMedia.dataBase64Binary"/>
                </parameter>
              </target>
            </rule>
          </rule>
        </rule>
      </rule>
      <documentation value="observationMedia"/>
    </rule>
    <rule>
      <name value="ref"/>
      <source>
        <context value="obs"/>
        <element value="referenceRange"/>
        <variable value="refRange"/>
      </source>
      <target>
        <context value="ob"/>
        <contextType value="variable"/>
        <element value="referenceRange"/>
        <variable value="ref"/>
        <transform value="create"/>
        <parameter>
          <valueString value="BackboneElement"/>
        </parameter>
      </target>
      <rule>
        <name value="refRange"/>
        <source>
          <context value="refRange"/>
          <element value="observationRange"/>
          <variable value="obsRange"/>
        </source>
        <rule>
          <name value="value"/>
          <source>
            <context value="obsRange"/>
            <type value="ST"/>
            <element value="value"/>
            <variable value="value"/>
          </source>
          <target>
            <context value="ref"/>
            <contextType value="variable"/>
            <element value="text"/>
            <transform value="create"/>
            <parameter>
              <valueString value="string"/>
            </parameter>
          </target>
          <target>
            <context value="ref"/>
            <contextType value="variable"/>
            <element value="text"/>
            <transform value="evaluate"/>
            <parameter>
              <valueString value="value.dataString"/>
            </parameter>
          </target>
        </rule>
        <rule>
          <name value="obsRange"/>
          <source>
            <context value="obsRange"/>
          </source>
          <target>
            <context value="ref"/>
            <contextType value="variable"/>
            <element value="low"/>
            <variable value="Low"/>
            <transform value="create"/>
            <parameter>
              <valueString value="Quantity"/>
            </parameter>
          </target>
          <rule>
            <name value="IVL-PQ"/>
            <source>
              <context value="obsRange"/>
              <type value="IVL_PQ"/>
              <element value="value"/>
              <variable value="v"/>
            </source>
            <rule>
              <name value="decValue"/>
              <source>
                <context value="v"/>
                <element value="low"/>
                <variable value="l1"/>
              </source>
              <rule>
                <name value="value"/>
                <source>
                  <context value="l1"/>
                  <element value="value"/>
                  <variable value="decValue"/>
                </source>
                <target>
                  <context value="Low"/>
                  <contextType value="variable"/>
                  <element value="value"/>
                  <transform value="copy"/>
                  <parameter>
                    <valueId value="decValue"/>
                  </parameter>
                </target>
              </rule>
              <rule>
                <name value="unit"/>
                <source>
                  <context value="l1"/>
                  <element value="unit"/>
                  <variable value="Unit"/>
                </source>
                <target>
                  <context value="Low"/>
                  <contextType value="variable"/>
                  <element value="unit"/>
                  <transform value="copy"/>
                  <parameter>
                    <valueId value="Unit"/>
                  </parameter>
                </target>
              </rule>
            </rule>
            <rule>
              <name value="high"/>
              <source>
                <context value="v"/>
              </source>
              <target>
                <context value="ref"/>
                <contextType value="variable"/>
                <element value="high"/>
                <variable value="high"/>
                <transform value="create"/>
                <parameter>
                  <valueString value="Quantity"/>
                </parameter>
              </target>
              <rule>
                <name value="decValue"/>
                <source>
                  <context value="v"/>
                  <element value="high"/>
                  <variable value="h1"/>
                </source>
                <rule>
                  <name value="value"/>
                  <source>
                    <context value="h1"/>
                    <element value="value"/>
                    <variable value="decValue1"/>
                  </source>
                  <target>
                    <context value="high"/>
                    <contextType value="variable"/>
                    <element value="value"/>
                    <transform value="copy"/>
                    <parameter>
                      <valueId value="decValue1"/>
                    </parameter>
                  </target>
                </rule>
                <rule>
                  <name value="unit"/>
                  <source>
                    <context value="h1"/>
                    <element value="unit"/>
                    <variable value="Unit1"/>
                  </source>
                  <target>
                    <context value="high"/>
                    <contextType value="variable"/>
                    <element value="unit"/>
                    <transform value="copy"/>
                    <parameter>
                      <valueId value="Unit1"/>
                    </parameter>
                  </target>
                </rule>
              </rule>
            </rule>
          </rule>
          <rule>
            <name value="interpretationCode"/>
            <source>
              <context value="obsRange"/>
              <element value="interpretationCode"/>
              <variable value="vvv"/>
            </source>
            <target>
              <context value="ref"/>
              <contextType value="variable"/>
              <element value="type"/>
              <variable value="vvv"/>
              <transform value="create"/>
            </target>
          </rule>
          <rule>
            <name value="precondition"/>
            <source>
              <context value="obsRange"/>
              <element value="precondition"/>
              <variable value="precondition"/>
            </source>
            <rule>
              <name value="criterion"/>
              <source>
                <context value="precondition"/>
                <element value="criterion"/>
                <variable value="criterion"/>
              </source>
              <rule>
                <name value="appliesTo"/>
                <source>
                  <context value="criterion"/>
                  <element value="code"/>
                  <variable value="vvv"/>
                </source>
                <target>
                  <context value="ref"/>
                  <contextType value="variable"/>
                  <element value="appliesTo"/>
                  <variable value="vvv"/>
                  <transform value="create"/>
                </target>
              </rule>
              <rule>
                <name value="v"/>
                <source>
                  <context value="criterion"/>
                  <type value="IVL_PQ"/>
                  <element value="value"/>
                  <variable value="v"/>
                </source>
                <rule>
                  <name value="low"/>
                  <source>
                    <context value="v"/>
                    <element value="high"/>
                    <variable value="l1"/>
                  </source>
                  <rule>
                    <name value="age"/>
                    <source>
                      <context value="l1"/>
                    </source>
                    <target>
                      <context value="ref"/>
                      <contextType value="variable"/>
                      <element value="age"/>
                      <variable value="age"/>
                      <transform value="create"/>
                      <parameter>
                        <valueString value="Quantity"/>
                      </parameter>
                    </target>
                    <rule>
                      <name value="high"/>
                      <source>
                        <context value="l1"/>
                      </source>
                      <target>
                        <context value="age"/>
                        <contextType value="variable"/>
                        <element value="high"/>
                        <variable value="high"/>
                      </target>
                      <rule>
                        <name value="value"/>
                        <source>
                          <context value="l1"/>
                          <element value="value"/>
                          <variable value="decValue"/>
                        </source>
                        <target>
                          <context value="high"/>
                          <contextType value="variable"/>
                          <element value="value"/>
                          <transform value="copy"/>
                          <parameter>
                            <valueId value="decValue"/>
                          </parameter>
                        </target>
                      </rule>
                      <rule>
                        <name value="unit"/>
                        <source>
                          <context value="l1"/>
                          <element value="unit"/>
                          <variable value="Unit1"/>
                        </source>
                        <target>
                          <context value="high"/>
                          <contextType value="variable"/>
                          <element value="unit"/>
                          <transform value="copy"/>
                          <parameter>
                            <valueId value="Unit1"/>
                          </parameter>
                        </target>
                      </rule>
                    </rule>
                  </rule>
                </rule>
              </rule>
            </rule>
          </rule>
        </rule>
      </rule>
      <documentation value="referenceRange"/>
    </rule>
  </group>
  <group>
    <name value="Observation2"/>
    <typeMode value="none"/>
    <input>
      <name value="obs"/>
      <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>
    <input>
      <name value="cda"/>
      <type value="Act"/>
      <mode value="source"/>
    </input>
    <input>
      <name value="specimenp"/>
      <type value="Specimen"/>
      <mode value="target"/>
    </input>
    <rule>
      <name value="reference"/>
      <source>
        <context value="obs"/>
      </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="obs"/>
      </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="obs"/>
        <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="statusCode"/>
      <source>
        <context value="obs"/>
        <element value="statusCode"/>
        <variable value="statusc"/>
        <condition value="(code = 'completed')"/>
      </source>
      <target>
        <context value="ob"/>
        <contextType value="variable"/>
        <element value="status"/>
        <transform value="copy"/>
        <parameter>
          <valueString value="final"/>
        </parameter>
      </target>
    </rule>
    <rule>
      <name value="statusCode"/>
      <source>
        <context value="obs"/>
        <element value="statusCode"/>
        <variable value="statusc"/>
        <condition value="(code = 'active')"/>
      </source>
      <target>
        <context value="ob"/>
        <contextType value="variable"/>
        <element value="status"/>
        <transform value="copy"/>
        <parameter>
          <valueString value="registered"/>
        </parameter>
      </target>
    </rule>
    <rule>
      <name value="statusCode"/>
      <source>
        <context value="obs"/>
        <element value="statusCode"/>
        <variable value="statusc"/>
        <condition value="(code = 'aborted')"/>
      </source>
      <target>
        <context value="ob"/>
        <contextType value="variable"/>
        <element value="status"/>
        <transform value="copy"/>
        <parameter>
          <valueString value="cancelled"/>
        </parameter>
      </target>
    </rule>
    <rule>
      <name value="statusCode"/>
      <source>
        <context value="obs"/>
        <element value="statusCode"/>
        <variable value="statusc"/>
        <condition value="(code = 'suspended')"/>
      </source>
      <target>
        <context value="ob"/>
        <contextType value="variable"/>
        <element value="status"/>
        <transform value="copy"/>
        <parameter>
          <valueString value="partial"/>
        </parameter>
      </target>
    </rule>
    <rule>
      <name value="value2"/>
      <source>
        <context value="obs"/>
        <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="obs"/>
        <condition
                   value="effectiveTime.low.exists() or effectiveTime.high.exists()"/>
      </source>
      <rule>
        <name value="effectiveTime"/>
        <source>
          <context value="obs"/>
          <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="eff"/>
          <variable value="period"/>
        </dependent>
      </rule>
    </rule>
    <rule>
      <name value="interpretationCode"/>
      <source>
        <context value="obs"/>
        <element value="interpretationCode"/>
        <variable value="vvv"/>
      </source>
      <target>
        <context value="ob"/>
        <contextType value="variable"/>
        <element value="interpretation"/>
        <variable value="vvv"/>
        <transform value="create"/>
      </target>
    </rule>
    <rule>
      <name value="methodCode"/>
      <source>
        <context value="obs"/>
        <element value="methodCode"/>
        <variable value="vvv"/>
      </source>
      <target>
        <context value="ob"/>
        <contextType value="variable"/>
        <element value="method"/>
        <variable value="vvv"/>
        <transform value="create"/>
      </target>
    </rule>
    <rule>
      <name value="value"/>
      <source>
        <context value="obs"/>
        <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="boolean"/>
      <source>
        <context value="obs"/>
        <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="val"/>
      <source>
        <context value="obs"/>
        <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="originltext"/>
          <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="copy"/>
              <parameter>
                <valueId value="reference"/>
              </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>
            <name value="codeSystemVersion"/>
            <source>
              <context value="val"/>
              <element value="codeSystemVersion"/>
              <variable value="version"/>
            </source>
            <target>
              <context value="coding"/>
              <contextType value="variable"/>
              <element value="version"/>
              <transform value="cast"/>
              <parameter>
                <valueId value="version"/>
              </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="codeSystemVersion"/>
            <source>
              <context value="translation"/>
              <element value="codeSystemVersion"/>
              <variable value="version"/>
            </source>
            <target>
              <context value="coding"/>
              <contextType value="variable"/>
              <element value="version"/>
              <transform value="cast"/>
              <parameter>
                <valueId value="version"/>
              </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>
                <name value="codeSystemVersion"/>
                <source>
                  <context value="value"/>
                  <element value="codeSystemVersion"/>
                  <variable value="version"/>
                </source>
                <target>
                  <context value="coding"/>
                  <contextType value="variable"/>
                  <element value="version"/>
                  <transform value="cast"/>
                  <parameter>
                    <valueId value="version"/>
                  </parameter>
                  <parameter>
                    <valueString value="string"/>
                  </parameter>
                </target>
              </rule>
            </rule>
          </rule>
        </rule>
      </rule>
    </rule>
    <rule>
      <name value="valueQuantity"/>
      <source>
        <context value="obs"/>
        <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="value"/>
      <source>
        <context value="obs"/>
        <type value="ST"/>
        <element value="value"/>
        <variable value="value"/>
      </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="value.dataString"/>
        </parameter>
      </target>
    </rule>
    <rule>
      <name value="entryRelationship"/>
      <source>
        <context value="obs"/>
        <element value="entryRelationship"/>
        <variable value="entryRelationship"/>
      </source>
      <rule>
        <name value="Act"/>
        <source>
          <context value="entryRelationship"/>
          <element value="act"/>
          <variable value="act"/>
        </source>
        <rule>
          <name value="text"/>
          <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="ob"/>
              <contextType value="variable"/>
              <element value="note"/>
              <variable value="note"/>
            </target>
            <rule>
              <name value="reference"/>
              <source>
                <context 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>
      <documentation value="Note e commenti"/>
    </rule>
    <rule>
      <name value="subject"/>
      <source>
        <context value="obs"/>
        <element value="subject"/>
        <variable value="sbj"/>
      </source>
      <rule>
        <name value="relatedSubject"/>
        <source>
          <context value="sbj"/>
          <element value="relatedSubject"/>
          <variable value="relatedSubj"/>
        </source>
        <target>
          <context value="patient"/>
          <contextType value="variable"/>
          <element value="extension"/>
          <variable value="extension2"/>
        </target>
        <dependent>
          <name value="ExtSubjectAnimal"/>
          <variable value="relatedSubj"/>
          <variable value="extension2"/>
        </dependent>
      </rule>
      <documentation value="subject"/>
    </rule>
    <rule>
      <name value="conditionactexists"/>
      <source>
        <context value="cda"/>
        <condition value="cda.entryRelationship.act.exists()"/>
      </source>
      <rule>
        <name value="specimen"/>
        <source>
          <context value="obs"/>
          <element value="specimen"/>
          <variable value="spmn"/>
        </source>
        <rule>
          <name value="specimenRole"/>
          <source>
            <context value="spmn"/>
            <element value="specimenRole"/>
            <variable value="specimenRole"/>
          </source>
          <rule>
            <name value="id"/>
            <source>
              <context value="specimenRole"/>
              <element value="id"/>
              <variable value="id"/>
            </source>
            <rule>
              <name value="extobs"/>
              <source>
                <context value="id"/>
                <element value="extension"/>
                <variable value="extobs"/>
              </source>
              <rule>
                <name value="en"/>
                <source>
                  <context value="cda"/>
                  <element value="entryRelationship"/>
                  <variable value="entryRelationship"/>
                </source>
                <rule>
                  <name value="a"/>
                  <source>
                    <context value="entryRelationship"/>
                    <element value="act"/>
                    <variable value="a"/>
                  </source>
                  <rule>
                    <name value="sp"/>
                    <source>
                      <context value="a"/>
                      <element value="specimen"/>
                      <variable value="sp"/>
                    </source>
                    <rule>
                      <name value="spr"/>
                      <source>
                        <context value="sp"/>
                        <element value="specimenRole"/>
                        <variable value="spr"/>
                      </source>
                      <rule>
                        <name value="cont"/>
                        <source>
                          <context value="spr"/>
                          <element value="id"/>
                          <condition value="(extension = extobs)"/>
                        </source>
                        <target>
                          <context value="bundle"/>
                          <contextType value="variable"/>
                          <element value="entry"/>
                          <variable value="e4o"/>
                        </target>
                        <target>
                          <context value="e4o"/>
                          <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="e4o"/>
                          <contextType value="variable"/>
                          <element value="resource"/>
                          <variable value="specimen"/>
                          <transform value="create"/>
                          <parameter>
                            <valueString value="Specimen"/>
                          </parameter>
                        </target>
                        <target>
                          <context value="specimen"/>
                          <contextType value="variable"/>
                          <element value="id"/>
                          <variable value="uuid4o"/>
                          <transform value="uuid"/>
                        </target>
                        <target>
                          <context value="e4o"/>
                          <contextType value="variable"/>
                          <element value="fullUrl"/>
                          <transform value="append"/>
                          <parameter>
                            <valueString value="https://example/Specimen/"/>
                          </parameter>
                          <parameter>
                            <valueId value="uuid4o"/>
                          </parameter>
                        </target>
                        <target>
                          <context value="request"/>
                          <contextType value="variable"/>
                          <element value="url"/>
                          <transform value="copy"/>
                          <parameter>
                            <valueString value="Specimen"/>
                          </parameter>
                        </target>
                        <target>
                          <context value="ob"/>
                          <contextType value="variable"/>
                          <element value="specimen"/>
                          <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/Specimen/' + %specimen.id"/>
                          </parameter>
                        </target>
                        <rule>
                          <name value="reference"/>
                          <source>
                            <context value="spr"/>
                          </source>
                          <target>
                            <context value="specimen"/>
                            <contextType value="variable"/>
                            <element value="parent"/>
                            <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/Specimen/' + %specimenp.id"/>
                            </parameter>
                          </target>
                        </rule>
                        <rule>
                          <name value="id"/>
                          <source>
                            <context value="spr"/>
                            <element value="id"/>
                            <variable value="vvv"/>
                          </source>
                          <target>
                            <context value="specimen"/>
                            <contextType value="variable"/>
                            <element value="identifier"/>
                            <variable value="vvv"/>
                            <transform value="create"/>
                          </target>
                        </rule>
                        <rule>
                          <name value="ent"/>
                          <source>
                            <context value="specimenRole"/>
                            <element value="specimenPlayingEntity"/>
                            <variable value="spent"/>
                          </source>
                          <rule>
                            <name value="code"/>
                            <source>
                              <context value="spent"/>
                              <element value="code"/>
                              <variable value="vvv"/>
                            </source>
                            <target>
                              <context value="specimen"/>
                              <contextType value="variable"/>
                              <element value="type"/>
                              <variable value="vvv"/>
                              <transform value="create"/>
                            </target>
                          </rule>
                        </rule>
                        <rule>
                          <name value="specimenPlayingEntity"/>
                          <source>
                            <context value="spr"/>
                            <element value="specimenPlayingEntity"/>
                            <variable value="specimenPlayingEntity"/>
                          </source>
                          <rule>
                            <name value="code"/>
                            <source>
                              <context value="specimenPlayingEntity"/>
                              <element value="code"/>
                              <variable value="vvv"/>
                            </source>
                            <target>
                              <context value="specimen"/>
                              <contextType value="variable"/>
                              <element value="type"/>
                              <variable value="vvv"/>
                              <transform value="create"/>
                            </target>
                          </rule>
                        </rule>
                        <rule>
                          <name value="collection"/>
                          <source>
                            <context value="a"/>
                          </source>
                          <target>
                            <context value="specimen"/>
                            <contextType value="variable"/>
                            <element value="collection"/>
                            <variable value="collection"/>
                            <transform value="create"/>
                            <parameter>
                              <valueString value="BackboneElement"/>
                            </parameter>
                          </target>
                          <rule>
                            <name value="value"/>
                            <source>
                              <context value="a"/>
                              <element value="effectiveTime"/>
                              <variable value="effectivetime"/>
                            </source>
                            <target>
                              <context value="collection"/>
                              <contextType value="variable"/>
                              <element value="collected"/>
                              <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="a"/>
                              <condition
                                         value="effectiveTime.low.exists() or effectiveTime.high.exists()"/>
                            </source>
                            <rule>
                              <name value="effectiveTime"/>
                              <source>
                                <context value="a"/>
                                <element value="effectiveTime"/>
                                <variable value="eff"/>
                              </source>
                              <target>
                                <context value="collection"/>
                                <contextType value="variable"/>
                                <element value="collected"/>
                                <variable value="period"/>
                                <transform value="create"/>
                                <parameter>
                                  <valueString value="Period"/>
                                </parameter>
                              </target>
                              <dependent>
                                <name value="IVLTSPeriod"/>
                                <variable value="eff"/>
                                <variable value="period"/>
                              </dependent>
                            </rule>
                          </rule>
                          <rule>
                            <name value="participant"/>
                            <source>
                              <context value="a"/>
                              <element value="participant"/>
                              <variable value="participant"/>
                            </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="PUT"/>
                              </parameter>
                            </target>
                            <target>
                              <context value="e10"/>
                              <contextType value="variable"/>
                              <element value="resource"/>
                              <variable value="practitioner"/>
                              <transform value="create"/>
                              <parameter>
                                <valueString value="Practitioner"/>
                              </parameter>
                            </target>
                            <target>
                              <context value="practitioner"/>
                              <contextType value="variable"/>
                              <element value="id"/>
                              <variable value="uuid11"/>
                              <transform value="uuid"/>
                            </target>
                            <target>
                              <context value="e10"/>
                              <contextType value="variable"/>
                              <element value="fullUrl"/>
                              <transform value="append"/>
                              <parameter>
                                <valueString
                                             value="https://example/Practitioner/"/>
                              </parameter>
                              <parameter>
                                <valueId value="uuid11"/>
                              </parameter>
                            </target>
                            <target>
                              <context value="collection"/>
                              <contextType value="variable"/>
                              <element value="collector"/>
                              <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/Practitioner/' + %practitioner.id"/>
                              </parameter>
                            </target>
                            <rule>
                              <name value="participantRole"/>
                              <source>
                                <context value="participant"/>
                                <element value="participantRole"/>
                                <variable value="participantRole"/>
                              </source>
                              <rule>
                                <name value="meta"/>
                                <source>
                                  <context value="participantRole"/>
                                </source>
                                <target>
                                  <context value="practitioner"/>
                                  <contextType value="variable"/>
                                  <element value="meta"/>
                                  <variable value="meta"/>
                                </target>
                                <rule>
                                  <name value="coding"/>
                                  <source>
                                    <context value="participantRole"/>
                                  </source>
                                  <target>
                                    <context value="meta"/>
                                    <contextType value="variable"/>
                                    <element value="tag"/>
                                    <variable value="coding"/>
                                    <transform value="create"/>
                                    <parameter>
                                      <valueString value="Coding"/>
                                    </parameter>
                                  </target>
                                  <rule>
                                    <name value="system"/>
                                    <source>
                                      <context value="participantRole"/>
                                    </source>
                                    <target>
                                      <context value="coding"/>
                                      <contextType value="variable"/>
                                      <element value="system"/>
                                      <transform value="copy"/>
                                      <parameter>
                                        <valueString
                                                     value="http://algoritmodiscoring"/>
                                      </parameter>
                                    </target>
                                  </rule>
                                  <rule>
                                    <name value="code"/>
                                    <source>
                                      <context value="participantRole"/>
                                    </source>
                                    <target>
                                      <context value="coding"/>
                                      <contextType value="variable"/>
                                      <element value="code"/>
                                      <transform value="copy"/>
                                      <parameter>
                                        <valueString
                                                     value="ClinicalDocument/body/act/participant"/>
                                      </parameter>
                                    </target>
                                  </rule>
                                </rule>
                              </rule>
                              <rule>
                                <name value="identifier"/>
                                <source>
                                  <context value="participantRole"/>
                                  <element value="id"/>
                                  <variable value="id"/>
                                </source>
                                <target>
                                  <context value="practitioner"/>
                                  <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="ext"/>
                                  <source>
                                    <context value="id"/>
                                    <element value="extension"/>
                                    <variable value="ext"/>
                                  </source>
                                  <target>
                                    <context value="identifier"/>
                                    <contextType value="variable"/>
                                    <element value="value"/>
                                    <transform value="copy"/>
                                    <parameter>
                                      <valueId value="ext"/>
                                    </parameter>
                                  </target>
                                  <rule>
                                    <name value="UUID"/>
                                    <source>
                                      <context value="participantRole"/>
                                    </source>
                                    <target>
                                      <context value="request"/>
                                      <contextType value="variable"/>
                                      <element value="url"/>
                                      <transform value="append"/>
                                      <parameter>
                                        <valueString
                                                     value="Practitioner?identifier="/>
                                      </parameter>
                                      <parameter>
                                        <valueId value="ext"/>
                                      </parameter>
                                    </target>
                                  </rule>
                                </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="addr"/>
                                <source>
                                  <context value="participantRole"/>
                                  <element value="addr"/>
                                  <variable value="vvv"/>
                                </source>
                                <target>
                                  <context value="practitioner"/>
                                  <contextType value="variable"/>
                                  <element value="address"/>
                                  <variable value="vvv"/>
                                  <transform value="create"/>
                                </target>
                              </rule>
                              <rule>
                                <name value="playingEntity"/>
                                <source>
                                  <context value="participantRole"/>
                                  <element value="playingEntity"/>
                                  <variable value="playingEntity"/>
                                </source>
                                <rule>
                                  <name value="name"/>
                                  <source>
                                    <context value="playingEntity"/>
                                    <element value="name"/>
                                    <variable value="vvv"/>
                                  </source>
                                  <target>
                                    <context value="practitioner"/>
                                    <contextType value="variable"/>
                                    <element value="name"/>
                                    <variable value="vvv"/>
                                    <transform value="create"/>
                                  </target>
                                </rule>
                              </rule>
                            </rule>
                          </rule>
                        </rule>
                      </rule>
                    </rule>
                  </rule>
                </rule>
              </rule>
            </rule>
          </rule>
        </rule>
        <documentation value="specimen"/>
      </rule>
    </rule>
    <rule>
      <name value="wherenotexists"/>
      <source>
        <context value="cda"/>
        <condition
                   value="cda.entryRelationship.act.exists().not() and (obs.specimen.specimenRole.specimenPlayingEntity.code.code != specimenp.type.coding.code)"/>
      </source>
      <rule>
        <name value="specimen"/>
        <source>
          <context value="obs"/>
          <element value="specimen"/>
          <variable value="spmn"/>
        </source>
        <target>
          <context value="bundle"/>
          <contextType value="variable"/>
          <element value="entry"/>
          <variable value="e4o"/>
        </target>
        <target>
          <context value="e4o"/>
          <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="e4o"/>
          <contextType value="variable"/>
          <element value="resource"/>
          <variable value="specimen"/>
          <transform value="create"/>
          <parameter>
            <valueString value="Specimen"/>
          </parameter>
        </target>
        <target>
          <context value="specimen"/>
          <contextType value="variable"/>
          <element value="id"/>
          <variable value="uuid4o"/>
          <transform value="uuid"/>
        </target>
        <target>
          <context value="e4o"/>
          <contextType value="variable"/>
          <element value="fullUrl"/>
          <transform value="append"/>
          <parameter>
            <valueString value="https://example/Specimen/"/>
          </parameter>
          <parameter>
            <valueId value="uuid4o"/>
          </parameter>
        </target>
        <target>
          <context value="request"/>
          <contextType value="variable"/>
          <element value="url"/>
          <transform value="copy"/>
          <parameter>
            <valueString value="Specimen"/>
          </parameter>
        </target>
        <target>
          <context value="ob"/>
          <contextType value="variable"/>
          <element value="specimen"/>
          <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/Specimen/' + %specimen.id"/>
          </parameter>
        </target>
        <rule>
          <name value="specimenRole"/>
          <source>
            <context value="spmn"/>
            <element value="specimenRole"/>
            <variable value="specimenRole"/>
          </source>
          <rule>
            <name value="id"/>
            <source>
              <context value="specimenRole"/>
              <element value="id"/>
              <variable value="vvv"/>
            </source>
            <target>
              <context value="specimen"/>
              <contextType value="variable"/>
              <element value="identifier"/>
              <variable value="vvv"/>
              <transform value="create"/>
            </target>
          </rule>
          <rule>
            <name value="specimenPlayingEntity"/>
            <source>
              <context value="specimenRole"/>
              <element value="specimenPlayingEntity"/>
              <variable value="specimenPlayingEntity"/>
            </source>
            <rule>
              <name value="code"/>
              <source>
                <context value="specimenPlayingEntity"/>
                <element value="code"/>
                <variable value="vvv"/>
              </source>
              <target>
                <context value="specimen"/>
                <contextType value="variable"/>
                <element value="type"/>
                <variable value="vvv"/>
                <transform value="create"/>
              </target>
            </rule>
          </rule>
        </rule>
      </rule>
    </rule>
    <rule>
      <name value="performer"/>
      <source>
        <context value="obs"/>
        <element value="performer"/>
        <variable value="performer"/>
      </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="practitionerRole"/>
        <transform value="create"/>
        <parameter>
          <valueString value="PractitionerRole"/>
        </parameter>
      </target>
      <target>
        <context value="practitionerRole"/>
        <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/PractitionerRole/"/>
        </parameter>
        <parameter>
          <valueId value="uuid1"/>
        </parameter>
      </target>
      <target>
        <context value="request"/>
        <contextType value="variable"/>
        <element value="url"/>
        <transform value="copy"/>
        <parameter>
          <valueString value="PractitionerRole"/>
        </parameter>
      </target>
      <rule>
        <name value="practitionerRole"/>
        <source>
          <context value="performer"/>
        </source>
        <target>
          <context value="ob"/>
          <contextType value="variable"/>
          <element value="performer"/>
          <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/PractitionerRole/' + %practitionerRole.id"/>
          </parameter>
        </target>
        <rule>
          <name value="entity"/>
          <source>
            <context value="performer"/>
            <element value="assignedEntity"/>
            <variable value="entity"/>
          </source>
          <rule>
            <name value="code"/>
            <source>
              <context value="entity"/>
              <element value="code"/>
              <variable value="vvv"/>
            </source>
            <target>
              <context value="practitionerRole"/>
              <contextType value="variable"/>
              <element value="code"/>
              <variable value="vvv"/>
              <transform value="create"/>
            </target>
          </rule>
          <rule>
            <name value="practitioner"/>
            <source>
              <context value="entity"/>
            </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="PUT"/>
              </parameter>
            </target>
            <target>
              <context value="e2"/>
              <contextType value="variable"/>
              <element value="resource"/>
              <variable value="practitioner"/>
              <transform value="create"/>
              <parameter>
                <valueString value="Practitioner"/>
              </parameter>
            </target>
            <rule>
              <name value="meta"/>
              <source>
                <context value="entity"/>
              </source>
              <target>
                <context value="practitioner"/>
                <contextType value="variable"/>
                <element value="meta"/>
                <variable value="meta"/>
              </target>
              <rule>
                <name value="coding"/>
                <source>
                  <context value="entity"/>
                </source>
                <target>
                  <context value="meta"/>
                  <contextType value="variable"/>
                  <element value="tag"/>
                  <variable value="coding"/>
                  <transform value="create"/>
                  <parameter>
                    <valueString value="Coding"/>
                  </parameter>
                </target>
                <rule>
                  <name value="system"/>
                  <source>
                    <context value="entity"/>
                  </source>
                  <target>
                    <context value="coding"/>
                    <contextType value="variable"/>
                    <element value="system"/>
                    <transform value="copy"/>
                    <parameter>
                      <valueString value="http://algoritmodiscoring"/>
                    </parameter>
                  </target>
                </rule>
                <rule>
                  <name value="code"/>
                  <source>
                    <context value="entity"/>
                  </source>
                  <target>
                    <context value="coding"/>
                    <contextType value="variable"/>
                    <element value="code"/>
                    <transform value="copy"/>
                    <parameter>
                      <valueString
                                   value="ClinicalDocument/body/observation/performer"/>
                    </parameter>
                  </target>
                </rule>
              </rule>
            </rule>
            <rule>
              <name value="identifier"/>
              <source>
                <context value="entity"/>
                <element value="id"/>
                <variable value="id"/>
              </source>
              <target>
                <context value="practitioner"/>
                <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="ext"/>
                <source>
                  <context value="id"/>
                  <element value="extension"/>
                  <variable value="ext"/>
                </source>
                <target>
                  <context value="identifier"/>
                  <contextType value="variable"/>
                  <element value="value"/>
                  <transform value="copy"/>
                  <parameter>
                    <valueId value="ext"/>
                  </parameter>
                </target>
                <rule>
                  <name value="UUID"/>
                  <source>
                    <context value="entity"/>
                  </source>
                  <target>
                    <context value="request"/>
                    <contextType value="variable"/>
                    <element value="url"/>
                    <transform value="append"/>
                    <parameter>
                      <valueString value="Practitioner?identifier="/>
                    </parameter>
                    <parameter>
                      <valueId value="ext"/>
                    </parameter>
                  </target>
                </rule>
              </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>
                <name value="r"/>
                <source>
                  <context value="id"/>
                  <element value="root"/>
                  <variable value="r"/>
                </source>
                <rule>
                  <name value="performer"/>
                  <source>
                    <context value="id"/>
                    <element value="extension"/>
                    <variable value="ext"/>
                  </source>
                  <target>
                    <context value="practitioner"/>
                    <contextType value="variable"/>
                    <element value="id"/>
                    <variable value="uuid2"/>
                    <transform value="evaluate"/>
                    <parameter>
                      <valueString value="r + '-' + ext"/>
                    </parameter>
                  </target>
                  <target>
                    <context value="e2"/>
                    <contextType value="variable"/>
                    <element value="fullUrl"/>
                    <transform value="append"/>
                    <parameter>
                      <valueString value="https://example/Practitioner/"/>
                    </parameter>
                    <parameter>
                      <valueId value="uuid2"/>
                    </parameter>
                  </target>
                  <target>
                    <context value="practitionerRole"/>
                    <contextType value="variable"/>
                    <element value="practitioner"/>
                    <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/Practitioner/' + %practitioner.id"/>
                    </parameter>
                  </target>
                </rule>
              </rule>
            </rule>
            <rule>
              <name value="2.16.840.1.113883.2.9.4.3.2"/>
              <source>
                <context value="entity"/>
                <element value="id"/>
                <variable value="id"/>
                <condition value="(root = '2.16.840.1.113883.2.9.4.3.2')"/>
              </source>
              <rule>
                <name value="UUID"/>
                <source>
                  <context value="id"/>
                  <element value="extension"/>
                  <variable value="ext"/>
                </source>
                <target>
                  <context value="request"/>
                  <contextType value="variable"/>
                  <element value="url"/>
                  <transform value="append"/>
                  <parameter>
                    <valueString value="Practitioner?identifier="/>
                  </parameter>
                  <parameter>
                    <valueId value="ext"/>
                  </parameter>
                </target>
              </rule>
            </rule>
            <rule>
              <name value="diverso"/>
              <source>
                <context value="entity"/>
                <element value="id"/>
                <variable value="id"/>
                <condition value="(root != '2.16.840.1.113883.2.9.4.3.2')"/>
              </source>
              <rule>
                <name value="UUID"/>
                <source>
                  <context value="id"/>
                  <element value="extension"/>
                  <variable value="ext"/>
                </source>
                <target>
                  <context value="request"/>
                  <contextType value="variable"/>
                  <element value="url"/>
                  <transform value="append"/>
                  <parameter>
                    <valueString value="Practitioner?identifier="/>
                  </parameter>
                  <parameter>
                    <valueId value="ext"/>
                  </parameter>
                </target>
              </rule>
            </rule>
            <rule>
              <name value="addr"/>
              <source>
                <context value="entity"/>
                <element value="addr"/>
                <variable value="vvv"/>
              </source>
              <target>
                <context value="practitioner"/>
                <contextType value="variable"/>
                <element value="address"/>
                <variable value="vvv"/>
                <transform value="create"/>
              </target>
            </rule>
            <rule>
              <name value="telecom"/>
              <source>
                <context value="entity"/>
                <element value="telecom"/>
                <variable value="vvv"/>
              </source>
              <target>
                <context value="practitioner"/>
                <contextType value="variable"/>
                <element value="telecom"/>
                <variable value="vvv"/>
                <transform value="create"/>
              </target>
            </rule>
            <rule>
              <name value="name"/>
              <source>
                <context value="entity"/>
                <element value="assignedPerson"/>
                <variable value="person"/>
              </source>
              <rule>
                <name value="name"/>
                <source>
                  <context value="person"/>
                  <element value="name"/>
                  <variable value="vvv"/>
                </source>
                <target>
                  <context value="practitioner"/>
                  <contextType value="variable"/>
                  <element value="name"/>
                  <variable value="vvv"/>
                  <transform value="create"/>
                </target>
              </rule>
              <rule>
                <name value="birth"/>
                <source>
                  <context value="person"/>
                  <element value="birthTime"/>
                  <variable value="birthTime"/>
                </source>
                <rule>
                  <name value="value"/>
                  <source>
                    <context value="birthTime"/>
                    <element value="value"/>
                    <variable value="date"/>
                  </source>
                  <target>
                    <context value="practitioner"/>
                    <contextType value="variable"/>
                    <element value="birthDate"/>
                    <transform value="truncate"/>
                    <parameter>
                      <valueId value="date"/>
                    </parameter>
                    <parameter>
                      <valueInteger value="10"/>
                    </parameter>
                  </target>
                </rule>
              </rule>
            </rule>
            <rule>
              <name value="representedOrganization"/>
              <source>
                <context value="entity"/>
                <element value="representedOrganization"/>
                <variable value="representedOrganization"/>
              </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="PUT"/>
                </parameter>
              </target>
              <target>
                <context value="e3"/>
                <contextType value="variable"/>
                <element value="resource"/>
                <variable value="organization"/>
                <transform value="create"/>
                <parameter>
                  <valueString value="Organization"/>
                </parameter>
              </target>
              <rule>
                <name value="meta"/>
                <source>
                  <context value="representedOrganization"/>
                </source>
                <target>
                  <context value="organization"/>
                  <contextType value="variable"/>
                  <element value="meta"/>
                  <variable value="meta"/>
                </target>
                <rule>
                  <name value="coding"/>
                  <source>
                    <context value="representedOrganization"/>
                  </source>
                  <target>
                    <context value="meta"/>
                    <contextType value="variable"/>
                    <element value="tag"/>
                    <variable value="coding"/>
                    <transform value="create"/>
                    <parameter>
                      <valueString value="Coding"/>
                    </parameter>
                  </target>
                  <rule>
                    <name value="system"/>
                    <source>
                      <context value="representedOrganization"/>
                    </source>
                    <target>
                      <context value="coding"/>
                      <contextType value="variable"/>
                      <element value="system"/>
                      <transform value="copy"/>
                      <parameter>
                        <valueString value="http://algoritmodiscoring"/>
                      </parameter>
                    </target>
                  </rule>
                  <rule>
                    <name value="code"/>
                    <source>
                      <context value="representedOrganization"/>
                    </source>
                    <target>
                      <context value="coding"/>
                      <contextType value="variable"/>
                      <element value="code"/>
                      <transform value="copy"/>
                      <parameter>
                        <valueString
                                     value="ClinicalDocument/body/observation/performer/representedOrganization"/>
                      </parameter>
                    </target>
                  </rule>
                </rule>
              </rule>
              <rule>
                <name value="identifier"/>
                <source>
                  <context value="representedOrganization"/>
                  <element value="id"/>
                  <variable value="id"/>
                </source>
                <target>
                  <context value="organization"/>
                  <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="ext"/>
                  <source>
                    <context value="id"/>
                    <element value="extension"/>
                    <variable value="ext"/>
                  </source>
                  <target>
                    <context value="identifier"/>
                    <contextType value="variable"/>
                    <element value="value"/>
                    <transform value="copy"/>
                    <parameter>
                      <valueId value="ext"/>
                    </parameter>
                  </target>
                  <rule>
                    <name value="UUID"/>
                    <source>
                      <context value="representedOrganization"/>
                    </source>
                    <target>
                      <context value="request"/>
                      <contextType value="variable"/>
                      <element value="url"/>
                      <transform value="append"/>
                      <parameter>
                        <valueString value="Organization?identifier="/>
                      </parameter>
                      <parameter>
                        <valueId value="ext"/>
                      </parameter>
                    </target>
                  </rule>
                </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>
                  <name value="r"/>
                  <source>
                    <context value="id"/>
                    <element value="root"/>
                    <variable value="r"/>
                  </source>
                  <rule>
                    <name value="aut"/>
                    <source>
                      <context value="id"/>
                      <element value="extension"/>
                      <variable value="ext"/>
                    </source>
                    <target>
                      <context value="organization"/>
                      <contextType value="variable"/>
                      <element value="id"/>
                      <variable value="uuid3"/>
                      <transform value="evaluate"/>
                      <parameter>
                        <valueString value="r + '-' + ext"/>
                      </parameter>
                    </target>
                    <target>
                      <context value="e3"/>
                      <contextType value="variable"/>
                      <element value="fullUrl"/>
                      <transform value="append"/>
                      <parameter>
                        <valueString value="https://example/Organization/"/>
                      </parameter>
                      <parameter>
                        <valueId value="uuid3"/>
                      </parameter>
                    </target>
                    <target>
                      <context value="practitionerRole"/>
                      <contextType value="variable"/>
                      <element value="organization"/>
                      <variable value="referenceOrg"/>
                      <transform value="create"/>
                      <parameter>
                        <valueString value="Reference"/>
                      </parameter>
                    </target>
                    <target>
                      <context value="referenceOrg"/>
                      <contextType value="variable"/>
                      <element value="reference"/>
                      <transform value="append"/>
                      <parameter>
                        <valueString value="https://example/Organization/"/>
                      </parameter>
                      <parameter>
                        <valueId value="uuid3"/>
                      </parameter>
                    </target>
                  </rule>
                </rule>
              </rule>
              <rule>
                <name value="name"/>
                <source>
                  <context value="representedOrganization"/>
                  <element value="name"/>
                  <variable value="v"/>
                </source>
                <target>
                  <context value="organization"/>
                  <contextType value="variable"/>
                  <element value="name"/>
                  <transform value="evaluate"/>
                  <parameter>
                    <valueString value="v.other"/>
                  </parameter>
                </target>
              </rule>
              <rule>
                <name value="telecom"/>
                <source>
                  <context value="representedOrganization"/>
                  <element value="telecom"/>
                  <variable value="vvv"/>
                </source>
                <target>
                  <context value="organization"/>
                  <contextType value="variable"/>
                  <element value="telecom"/>
                  <variable value="vvv"/>
                  <transform value="create"/>
                </target>
              </rule>
              <rule>
                <name value="addr"/>
                <source>
                  <context value="representedOrganization"/>
                  <element value="addr"/>
                  <variable value="vvv"/>
                </source>
                <target>
                  <context value="organization"/>
                  <contextType value="variable"/>
                  <element value="address"/>
                  <variable value="vvv"/>
                  <transform value="create"/>
                </target>
              </rule>
              <rule>
                <name value="OrgPartOf"/>
                <source>
                  <context value="representedOrganization"/>
                  <element value="asOrganizationPartOf"/>
                  <variable value="OrgPartOf"/>
                </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="e4"/>
                  <contextType value="variable"/>
                  <element value="resource"/>
                  <variable value="organization1"/>
                  <transform value="create"/>
                  <parameter>
                    <valueString value="Organization"/>
                  </parameter>
                </target>
                <target>
                  <context value="request"/>
                  <contextType value="variable"/>
                  <element value="method"/>
                  <transform value="copy"/>
                  <parameter>
                    <valueString value="PUT"/>
                  </parameter>
                </target>
                <rule>
                  <name value="meta"/>
                  <source>
                    <context value="OrgPartOf"/>
                  </source>
                  <target>
                    <context value="organization1"/>
                    <contextType value="variable"/>
                    <element value="meta"/>
                    <variable value="meta"/>
                  </target>
                  <rule>
                    <name value="coding"/>
                    <source>
                      <context value="OrgPartOf"/>
                    </source>
                    <target>
                      <context value="meta"/>
                      <contextType value="variable"/>
                      <element value="tag"/>
                      <variable value="coding"/>
                      <transform value="create"/>
                      <parameter>
                        <valueString value="Coding"/>
                      </parameter>
                    </target>
                    <rule>
                      <name value="system"/>
                      <source>
                        <context value="OrgPartOf"/>
                      </source>
                      <target>
                        <context value="coding"/>
                        <contextType value="variable"/>
                        <element value="system"/>
                        <transform value="copy"/>
                        <parameter>
                          <valueString value="http://algoritmodiscoring"/>
                        </parameter>
                      </target>
                    </rule>
                    <rule>
                      <name value="code"/>
                      <source>
                        <context value="OrgPartOf"/>
                      </source>
                      <target>
                        <context value="coding"/>
                        <contextType value="variable"/>
                        <element value="code"/>
                        <transform value="copy"/>
                        <parameter>
                          <valueString
                                       value="ClinicalDocument/body/observation/performer/representedOrganization/asOrganizationPartOf"/>
                        </parameter>
                      </target>
                    </rule>
                  </rule>
                </rule>
                <rule>
                  <name value="identifier"/>
                  <source>
                    <context value="OrgPartOf"/>
                    <element value="id"/>
                    <variable value="id"/>
                  </source>
                  <target>
                    <context value="organization1"/>
                    <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="ext"/>
                    <source>
                      <context value="id"/>
                      <element value="extension"/>
                      <variable value="ext"/>
                    </source>
                    <target>
                      <context value="identifier"/>
                      <contextType value="variable"/>
                      <element value="value"/>
                      <transform value="copy"/>
                      <parameter>
                        <valueId value="ext"/>
                      </parameter>
                    </target>
                    <rule>
                      <name value="UUID"/>
                      <source>
                        <context value="OrgPartOf"/>
                      </source>
                      <target>
                        <context value="request"/>
                        <contextType value="variable"/>
                        <element value="url"/>
                        <transform value="append"/>
                        <parameter>
                          <valueString value="Organization?identifier="/>
                        </parameter>
                        <parameter>
                          <valueId value="ext"/>
                        </parameter>
                      </target>
                    </rule>
                  </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>
                    <name value="r"/>
                    <source>
                      <context value="id"/>
                      <element value="root"/>
                      <variable value="r"/>
                    </source>
                    <rule>
                      <name value="org"/>
                      <source>
                        <context value="id"/>
                        <element value="extension"/>
                        <variable value="ext"/>
                      </source>
                      <target>
                        <context value="organization1"/>
                        <contextType value="variable"/>
                        <element value="id"/>
                        <variable value="uuid4"/>
                        <transform value="evaluate"/>
                        <parameter>
                          <valueString value="r + '-' + ext"/>
                        </parameter>
                      </target>
                      <target>
                        <context value="e4"/>
                        <contextType value="variable"/>
                        <element value="fullUrl"/>
                        <transform value="append"/>
                        <parameter>
                          <valueString value="https://example/Organization/"/>
                        </parameter>
                        <parameter>
                          <valueId value="uuid4"/>
                        </parameter>
                      </target>
                      <target>
                        <context value="organization"/>
                        <contextType value="variable"/>
                        <element value="partOf"/>
                        <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/Organization/' + %organization1.id"/>
                        </parameter>
                      </target>
                    </rule>
                  </rule>
                </rule>
                <rule>
                  <name value="code"/>
                  <source>
                    <context value="OrgPartOf"/>
                    <element value="code"/>
                    <variable value="vvv"/>
                  </source>
                  <target>
                    <context value="organization1"/>
                    <contextType value="variable"/>
                    <element value="type"/>
                    <variable value="vvv"/>
                    <transform value="create"/>
                  </target>
                </rule>
                <rule>
                  <name value="statusCode"/>
                  <source>
                    <context value="OrgPartOf"/>
                    <element value="statusCode"/>
                    <variable value="status"/>
                    <condition value="(value = 'active')"/>
                  </source>
                  <target>
                    <context value="organization1"/>
                    <contextType value="variable"/>
                    <element value="active"/>
                    <transform value="create"/>
                    <parameter>
                      <valueString value="boolean"/>
                    </parameter>
                  </target>
                  <target>
                    <context value="organization1"/>
                    <contextType value="variable"/>
                    <element value="active"/>
                    <transform value="copy"/>
                    <parameter>
                      <valueString value="true"/>
                    </parameter>
                  </target>
                </rule>
                <rule>
                  <name value="wholeOrganization"/>
                  <source>
                    <context value="OrgPartOf"/>
                    <element value="wholeOrganization"/>
                    <variable value="wholeOrgan"/>
                  </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="PUT"/>
                    </parameter>
                  </target>
                  <target>
                    <context value="e5"/>
                    <contextType value="variable"/>
                    <element value="resource"/>
                    <variable value="organization2"/>
                    <transform value="create"/>
                    <parameter>
                      <valueString value="Organization"/>
                    </parameter>
                  </target>
                  <rule>
                    <name value="meta"/>
                    <source>
                      <context value="wholeOrgan"/>
                    </source>
                    <target>
                      <context value="organization2"/>
                      <contextType value="variable"/>
                      <element value="meta"/>
                      <variable value="meta"/>
                    </target>
                    <rule>
                      <name value="coding"/>
                      <source>
                        <context value="wholeOrgan"/>
                      </source>
                      <target>
                        <context value="meta"/>
                        <contextType value="variable"/>
                        <element value="tag"/>
                        <variable value="coding"/>
                        <transform value="create"/>
                        <parameter>
                          <valueString value="Coding"/>
                        </parameter>
                      </target>
                      <rule>
                        <name value="system"/>
                        <source>
                          <context value="wholeOrgan"/>
                        </source>
                        <target>
                          <context value="coding"/>
                          <contextType value="variable"/>
                          <element value="system"/>
                          <transform value="copy"/>
                          <parameter>
                            <valueString value="http://algoritmodiscoring"/>
                          </parameter>
                        </target>
                      </rule>
                      <rule>
                        <name value="code"/>
                        <source>
                          <context value="wholeOrgan"/>
                        </source>
                        <target>
                          <context value="coding"/>
                          <contextType value="variable"/>
                          <element value="code"/>
                          <transform value="copy"/>
                          <parameter>
                            <valueString
                                         value="ClinicalDocument/body/observation/performer/representedOrganization/wholeOrganization"/>
                          </parameter>
                        </target>
                      </rule>
                    </rule>
                  </rule>
                  <rule>
                    <name value="identifier"/>
                    <source>
                      <context value="wholeOrgan"/>
                      <element value="id"/>
                      <variable value="id"/>
                    </source>
                    <target>
                      <context value="organization2"/>
                      <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="ext"/>
                      <source>
                        <context value="id"/>
                        <element value="extension"/>
                        <variable value="ext"/>
                      </source>
                      <target>
                        <context value="identifier"/>
                        <contextType value="variable"/>
                        <element value="value"/>
                        <transform value="copy"/>
                        <parameter>
                          <valueId value="ext"/>
                        </parameter>
                      </target>
                      <rule>
                        <name value="UUID"/>
                        <source>
                          <context value="wholeOrgan"/>
                        </source>
                        <target>
                          <context value="request"/>
                          <contextType value="variable"/>
                          <element value="url"/>
                          <transform value="append"/>
                          <parameter>
                            <valueString value="Organization?identifier="/>
                          </parameter>
                          <parameter>
                            <valueId value="ext"/>
                          </parameter>
                        </target>
                      </rule>
                    </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>
                      <name value="r"/>
                      <source>
                        <context value="id"/>
                        <element value="root"/>
                        <variable value="r"/>
                      </source>
                      <rule>
                        <name value="org"/>
                        <source>
                          <context value="id"/>
                          <element value="extension"/>
                          <variable value="ext"/>
                        </source>
                        <target>
                          <context value="organization2"/>
                          <contextType value="variable"/>
                          <element value="id"/>
                          <variable value="uuid5"/>
                          <transform value="evaluate"/>
                          <parameter>
                            <valueString value="r + '-' + ext"/>
                          </parameter>
                        </target>
                        <target>
                          <context value="e5"/>
                          <contextType value="variable"/>
                          <element value="fullUrl"/>
                          <transform value="append"/>
                          <parameter>
                            <valueString
                                         value="https://example/Organization/"/>
                          </parameter>
                          <parameter>
                            <valueId value="uuid5"/>
                          </parameter>
                        </target>
                        <target>
                          <context value="organization1"/>
                          <contextType value="variable"/>
                          <element value="partOf"/>
                          <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/Organization/' + %organization2.id"/>
                          </parameter>
                        </target>
                      </rule>
                    </rule>
                  </rule>
                  <rule>
                    <name value="name"/>
                    <source>
                      <context value="wholeOrgan"/>
                      <element value="name"/>
                      <variable value="v"/>
                    </source>
                    <target>
                      <context value="organization2"/>
                      <contextType value="variable"/>
                      <element value="name"/>
                      <transform value="evaluate"/>
                      <parameter>
                        <valueString value="v.other"/>
                      </parameter>
                    </target>
                  </rule>
                  <rule>
                    <name value="telecom"/>
                    <source>
                      <context value="wholeOrgan"/>
                      <element value="telecom"/>
                      <variable value="vvv"/>
                    </source>
                    <target>
                      <context value="organization2"/>
                      <contextType value="variable"/>
                      <element value="telecom"/>
                      <variable value="vvv"/>
                      <transform value="create"/>
                    </target>
                  </rule>
                  <rule>
                    <name value="addr"/>
                    <source>
                      <context value="wholeOrgan"/>
                      <element value="addr"/>
                      <variable value="vvv"/>
                    </source>
                    <target>
                      <context value="organization2"/>
                      <contextType value="variable"/>
                      <element value="address"/>
                      <variable value="vvv"/>
                      <transform value="create"/>
                    </target>
                  </rule>
                </rule>
              </rule>
              <documentation value="organization"/>
            </rule>
          </rule>
        </rule>
      </rule>
      <documentation value="performer"/>
    </rule>
    <rule>
      <name value="author"/>
      <source>
        <context value="obs"/>
        <element value="author"/>
        <variable value="srcAuthor"/>
      </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="practitionerRole"/>
        <transform value="create"/>
        <parameter>
          <valueString value="PractitionerRole"/>
        </parameter>
      </target>
      <target>
        <context value="practitionerRole"/>
        <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/PractitionerRole/"/>
        </parameter>
        <parameter>
          <valueId value="uuid6"/>
        </parameter>
      </target>
      <target>
        <context value="request"/>
        <contextType value="variable"/>
        <element value="url"/>
        <transform value="copy"/>
        <parameter>
          <valueString value="PractitionerRole"/>
        </parameter>
      </target>
      <target>
        <context value="ob"/>
        <contextType value="variable"/>
        <element value="performer"/>
        <variable value="referenceaut"/>
        <transform value="create"/>
        <parameter>
          <valueString value="Reference"/>
        </parameter>
      </target>
      <target>
        <context value="referenceaut"/>
        <contextType value="variable"/>
        <element value="reference"/>
        <transform value="evaluate"/>
        <parameter>
          <valueString
                       value="'https://example/PractitionerRole/' + %practitionerRole.id"/>
        </parameter>
      </target>
      <rule>
        <name value="assignedAuthor"/>
        <source>
          <context value="srcAuthor"/>
          <element value="assignedAuthor"/>
          <variable value="assignedAuthor"/>
        </source>
        <rule>
          <name value="code"/>
          <source>
            <context value="assignedAuthor"/>
            <element value="code"/>
            <variable value="codice"/>
          </source>
          <target>
            <context value="practitionerRole"/>
            <contextType value="variable"/>
            <element value="code"/>
            <variable value="code2"/>
          </target>
          <dependent>
            <name value="CECodeableConcept"/>
            <variable value="codice"/>
            <variable value="code2"/>
          </dependent>
        </rule>
        <rule>
          <name value="ASSAUth"/>
          <source>
            <context value="assignedAuthor"/>
          </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="PUT"/>
            </parameter>
          </target>
          <target>
            <context value="e7"/>
            <contextType value="variable"/>
            <element value="resource"/>
            <variable value="practitioner"/>
            <transform value="create"/>
            <parameter>
              <valueString value="Practitioner"/>
            </parameter>
          </target>
          <target>
            <context value="practitioner"/>
            <contextType value="variable"/>
            <element value="id"/>
            <variable value="uuid7"/>
            <transform value="uuid"/>
          </target>
          <rule>
            <name value="functionCode"/>
            <source>
              <context value="srcAuthor"/>
              <element value="functionCode"/>
              <variable value="vvv"/>
            </source>
            <target>
              <context value="practitionerRole"/>
              <contextType value="variable"/>
              <element value="code"/>
              <variable value="vvv"/>
              <transform value="create"/>
            </target>
          </rule>
          <rule>
            <name value="meta"/>
            <source>
              <context value="assignedAuthor"/>
            </source>
            <target>
              <context value="practitioner"/>
              <contextType value="variable"/>
              <element value="meta"/>
              <variable value="meta"/>
            </target>
            <rule>
              <name value="coding"/>
              <source>
                <context value="assignedAuthor"/>
              </source>
              <target>
                <context value="meta"/>
                <contextType value="variable"/>
                <element value="tag"/>
                <variable value="coding"/>
                <transform value="create"/>
                <parameter>
                  <valueString value="Coding"/>
                </parameter>
              </target>
              <rule>
                <name value="system"/>
                <source>
                  <context value="assignedAuthor"/>
                </source>
                <target>
                  <context value="coding"/>
                  <contextType value="variable"/>
                  <element value="system"/>
                  <transform value="copy"/>
                  <parameter>
                    <valueString value="http://algoritmodiscoring"/>
                  </parameter>
                </target>
              </rule>
              <rule>
                <name value="code"/>
                <source>
                  <context value="assignedAuthor"/>
                </source>
                <target>
                  <context value="coding"/>
                  <contextType value="variable"/>
                  <element value="code"/>
                  <transform value="copy"/>
                  <parameter>
                    <valueString
                                 value="ClinicalDocument/body/observation/author"/>
                  </parameter>
                </target>
              </rule>
            </rule>
          </rule>
          <rule>
            <name value="identifier"/>
            <source>
              <context value="assignedAuthor"/>
              <element value="id"/>
              <variable value="id"/>
            </source>
            <target>
              <context value="practitioner"/>
              <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="ext"/>
              <source>
                <context value="id"/>
                <element value="extension"/>
                <variable value="ext"/>
              </source>
              <target>
                <context value="identifier"/>
                <contextType value="variable"/>
                <element value="value"/>
                <transform value="copy"/>
                <parameter>
                  <valueId value="ext"/>
                </parameter>
              </target>
              <rule>
                <name value="UUID"/>
                <source>
                  <context value="assignedAuthor"/>
                </source>
                <target>
                  <context value="request"/>
                  <contextType value="variable"/>
                  <element value="url"/>
                  <transform value="append"/>
                  <parameter>
                    <valueString value="Practitioner?identifier="/>
                  </parameter>
                  <parameter>
                    <valueId value="ext"/>
                  </parameter>
                </target>
              </rule>
            </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>
              <name value="r"/>
              <source>
                <context value="id"/>
                <element value="root"/>
                <variable value="r"/>
              </source>
              <rule>
                <name value="aut"/>
                <source>
                  <context value="id"/>
                  <element value="extension"/>
                  <variable value="ext"/>
                </source>
                <target>
                  <context value="practitioner"/>
                  <contextType value="variable"/>
                  <element value="id"/>
                  <variable value="uuid2"/>
                  <transform value="evaluate"/>
                  <parameter>
                    <valueString value="r + '-' + ext"/>
                  </parameter>
                </target>
                <target>
                  <context value="e7"/>
                  <contextType value="variable"/>
                  <element value="fullUrl"/>
                  <transform value="append"/>
                  <parameter>
                    <valueString value="https://example/Practitioner/"/>
                  </parameter>
                  <parameter>
                    <valueId value="uuid2"/>
                  </parameter>
                </target>
                <target>
                  <context value="practitionerRole"/>
                  <contextType value="variable"/>
                  <element value="practitioner"/>
                  <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/Practitioner/' + %practitioner.id"/>
                  </parameter>
                </target>
              </rule>
            </rule>
            <rule>
              <name value="2.16.840.1.113883.2.9.4.3.2"/>
              <source>
                <context value="assignedAuthor"/>
                <element value="id"/>
                <variable value="id"/>
                <condition value="(root = '2.16.840.1.113883.2.9.4.3.2')"/>
              </source>
              <rule>
                <name value="UUID"/>
                <source>
                  <context value="id"/>
                  <element value="extension"/>
                  <variable value="ext"/>
                </source>
                <target>
                  <context value="request"/>
                  <contextType value="variable"/>
                  <element value="url"/>
                  <transform value="append"/>
                  <parameter>
                    <valueString value="Practitioner?identifier="/>
                  </parameter>
                  <parameter>
                    <valueId value="ext"/>
                  </parameter>
                </target>
              </rule>
            </rule>
            <rule>
              <name value="diverso"/>
              <source>
                <context value="assignedAuthor"/>
                <element value="id"/>
                <variable value="id"/>
                <condition value="(root != '2.16.840.1.113883.2.9.4.3.2')"/>
              </source>
              <rule>
                <name value="UUID"/>
                <source>
                  <context value="id"/>
                  <element value="extension"/>
                  <variable value="ext"/>
                </source>
                <target>
                  <context value="request"/>
                  <contextType value="variable"/>
                  <element value="url"/>
                  <transform value="append"/>
                  <parameter>
                    <valueString value="Practitioner?identifier="/>
                  </parameter>
                  <parameter>
                    <valueId value="ext"/>
                  </parameter>
                </target>
              </rule>
            </rule>
          </rule>
          <rule>
            <name value="addr"/>
            <source>
              <context value="assignedAuthor"/>
              <element value="addr"/>
              <variable value="vvv"/>
            </source>
            <target>
              <context value="practitioner"/>
              <contextType value="variable"/>
              <element value="address"/>
              <variable value="vvv"/>
              <transform value="create"/>
            </target>
          </rule>
          <rule>
            <name value="telecom"/>
            <source>
              <context value="assignedAuthor"/>
              <element value="telecom"/>
              <variable value="vvv"/>
            </source>
            <target>
              <context value="practitioner"/>
              <contextType value="variable"/>
              <element value="telecom"/>
              <variable value="vvv"/>
              <transform value="create"/>
            </target>
          </rule>
          <rule>
            <name value="name"/>
            <source>
              <context value="assignedAuthor"/>
              <element value="assignedPerson"/>
              <variable value="person"/>
            </source>
            <rule>
              <name value="name"/>
              <source>
                <context value="person"/>
                <element value="name"/>
                <variable value="vvv"/>
              </source>
              <target>
                <context value="practitioner"/>
                <contextType value="variable"/>
                <element value="name"/>
                <variable value="vvv"/>
                <transform value="create"/>
              </target>
            </rule>
            <rule>
              <name value="birth"/>
              <source>
                <context value="person"/>
                <element value="birthTime"/>
                <variable value="birthTime"/>
              </source>
              <rule>
                <name value="value"/>
                <source>
                  <context value="birthTime"/>
                  <element value="value"/>
                  <variable value="date"/>
                </source>
                <target>
                  <context value="practitioner"/>
                  <contextType value="variable"/>
                  <element value="birthDate"/>
                  <transform value="truncate"/>
                  <parameter>
                    <valueId value="date"/>
                  </parameter>
                  <parameter>
                    <valueInteger value="10"/>
                  </parameter>
                </target>
              </rule>
            </rule>
            <documentation value="person"/>
          </rule>
        </rule>
        <rule>
          <name value="representedOrganization"/>
          <source>
            <context value="assignedAuthor"/>
            <element value="representedOrganization"/>
            <variable value="representedOrganization"/>
          </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="PUT"/>
            </parameter>
          </target>
          <target>
            <context value="e8"/>
            <contextType value="variable"/>
            <element value="resource"/>
            <variable value="organization"/>
            <transform value="create"/>
            <parameter>
              <valueString value="Organization"/>
            </parameter>
          </target>
          <rule>
            <name value="meta"/>
            <source>
              <context value="representedOrganization"/>
            </source>
            <target>
              <context value="organization"/>
              <contextType value="variable"/>
              <element value="meta"/>
              <variable value="meta"/>
            </target>
            <rule>
              <name value="coding"/>
              <source>
                <context value="representedOrganization"/>
              </source>
              <target>
                <context value="meta"/>
                <contextType value="variable"/>
                <element value="tag"/>
                <variable value="coding"/>
                <transform value="create"/>
                <parameter>
                  <valueString value="Coding"/>
                </parameter>
              </target>
              <rule>
                <name value="system"/>
                <source>
                  <context value="representedOrganization"/>
                </source>
                <target>
                  <context value="coding"/>
                  <contextType value="variable"/>
                  <element value="system"/>
                  <transform value="copy"/>
                  <parameter>
                    <valueString value="http://algoritmodiscoring"/>
                  </parameter>
                </target>
              </rule>
              <rule>
                <name value="code"/>
                <source>
                  <context value="representedOrganization"/>
                </source>
                <target>
                  <context value="coding"/>
                  <contextType value="variable"/>
                  <element value="code"/>
                  <transform value="copy"/>
                  <parameter>
                    <valueString
                                 value="ClinicalDocument/body/observation/author/representedOrganization"/>
                  </parameter>
                </target>
              </rule>
            </rule>
          </rule>
          <rule>
            <name value="identifier"/>
            <source>
              <context value="representedOrganization"/>
              <element value="id"/>
              <variable value="id"/>
            </source>
            <target>
              <context value="organization"/>
              <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="ext"/>
              <source>
                <context value="id"/>
                <element value="extension"/>
                <variable value="ext"/>
              </source>
              <target>
                <context value="identifier"/>
                <contextType value="variable"/>
                <element value="value"/>
                <transform value="copy"/>
                <parameter>
                  <valueId value="ext"/>
                </parameter>
              </target>
              <rule>
                <name value="UUID"/>
                <source>
                  <context value="representedOrganization"/>
                </source>
                <target>
                  <context value="request"/>
                  <contextType value="variable"/>
                  <element value="url"/>
                  <transform value="append"/>
                  <parameter>
                    <valueString value="Organization?identifier="/>
                  </parameter>
                  <parameter>
                    <valueId value="ext"/>
                  </parameter>
                </target>
              </rule>
            </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>
              <name value="r"/>
              <source>
                <context value="id"/>
                <element value="root"/>
                <variable value="r"/>
              </source>
              <rule>
                <name value="org"/>
                <source>
                  <context value="id"/>
                  <element value="extension"/>
                  <variable value="ext"/>
                </source>
                <target>
                  <context value="organization"/>
                  <contextType value="variable"/>
                  <element value="id"/>
                  <variable value="uuid3"/>
                  <transform value="evaluate"/>
                  <parameter>
                    <valueString value="r + '-' + ext"/>
                  </parameter>
                </target>
                <target>
                  <context value="e8"/>
                  <contextType value="variable"/>
                  <element value="fullUrl"/>
                  <transform value="append"/>
                  <parameter>
                    <valueString value="https://example/Organization/"/>
                  </parameter>
                  <parameter>
                    <valueId value="uuid3"/>
                  </parameter>
                </target>
                <target>
                  <context value="practitionerRole"/>
                  <contextType value="variable"/>
                  <element value="organization"/>
                  <variable value="referenceOrg"/>
                  <transform value="create"/>
                  <parameter>
                    <valueString value="Reference"/>
                  </parameter>
                </target>
                <target>
                  <context value="referenceOrg"/>
                  <contextType value="variable"/>
                  <element value="reference"/>
                  <transform value="append"/>
                  <parameter>
                    <valueString value="https://example/Organization/"/>
                  </parameter>
                  <parameter>
                    <valueId value="uuid3"/>
                  </parameter>
                </target>
              </rule>
            </rule>
          </rule>
          <rule>
            <name value="name"/>
            <source>
              <context value="representedOrganization"/>
              <element value="name"/>
              <variable value="v"/>
            </source>
            <target>
              <context value="organization"/>
              <contextType value="variable"/>
              <element value="name"/>
              <transform value="evaluate"/>
              <parameter>
                <valueString value="v.other"/>
              </parameter>
            </target>
          </rule>
          <rule>
            <name value="telecom"/>
            <source>
              <context value="representedOrganization"/>
              <element value="telecom"/>
              <variable value="vvv"/>
            </source>
            <target>
              <context value="organization"/>
              <contextType value="variable"/>
              <element value="telecom"/>
              <variable value="vvv"/>
              <transform value="create"/>
            </target>
          </rule>
          <rule>
            <name value="addr"/>
            <source>
              <context value="representedOrganization"/>
              <element value="addr"/>
              <variable value="vvv"/>
            </source>
            <target>
              <context value="organization"/>
              <contextType value="variable"/>
              <element value="address"/>
              <variable value="vvv"/>
              <transform value="create"/>
            </target>
          </rule>
          <rule>
            <name value="OrgPartOf"/>
            <source>
              <context value="representedOrganization"/>
              <element value="asOrganizationPartOf"/>
              <variable value="OrgPartOf"/>
            </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="PUT"/>
              </parameter>
            </target>
            <target>
              <context value="e9"/>
              <contextType value="variable"/>
              <element value="resource"/>
              <variable value="organization1"/>
              <transform value="create"/>
              <parameter>
                <valueString value="Organization"/>
              </parameter>
            </target>
            <rule>
              <name value="meta"/>
              <source>
                <context value="OrgPartOf"/>
              </source>
              <target>
                <context value="organization1"/>
                <contextType value="variable"/>
                <element value="meta"/>
                <variable value="meta"/>
              </target>
              <rule>
                <name value="coding"/>
                <source>
                  <context value="OrgPartOf"/>
                </source>
                <target>
                  <context value="meta"/>
                  <contextType value="variable"/>
                  <element value="tag"/>
                  <variable value="coding"/>
                  <transform value="create"/>
                  <parameter>
                    <valueString value="Coding"/>
                  </parameter>
                </target>
                <rule>
                  <name value="system"/>
                  <source>
                    <context value="OrgPartOf"/>
                  </source>
                  <target>
                    <context value="coding"/>
                    <contextType value="variable"/>
                    <element value="system"/>
                    <transform value="copy"/>
                    <parameter>
                      <valueString value="http://algoritmodiscoring"/>
                    </parameter>
                  </target>
                </rule>
                <rule>
                  <name value="code"/>
                  <source>
                    <context value="OrgPartOf"/>
                  </source>
                  <target>
                    <context value="coding"/>
                    <contextType value="variable"/>
                    <element value="code"/>
                    <transform value="copy"/>
                    <parameter>
                      <valueString
                                   value="ClinicalDocument/body/observation/author/representedOrganization/asOrganizationPartOf"/>
                    </parameter>
                  </target>
                </rule>
              </rule>
            </rule>
            <rule>
              <name value="identifier"/>
              <source>
                <context value="OrgPartOf"/>
                <element value="id"/>
                <variable value="id"/>
              </source>
              <target>
                <context value="organization1"/>
                <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="ext"/>
                <source>
                  <context value="id"/>
                  <element value="extension"/>
                  <variable value="ext"/>
                </source>
                <target>
                  <context value="identifier"/>
                  <contextType value="variable"/>
                  <element value="value"/>
                  <transform value="copy"/>
                  <parameter>
                    <valueId value="ext"/>
                  </parameter>
                </target>
                <rule>
                  <name value="UUID"/>
                  <source>
                    <context value="OrgPartOf"/>
                  </source>
                  <target>
                    <context value="request"/>
                    <contextType value="variable"/>
                    <element value="url"/>
                    <transform value="append"/>
                    <parameter>
                      <valueString value="Organization?identifier="/>
                    </parameter>
                    <parameter>
                      <valueId value="ext"/>
                    </parameter>
                  </target>
                </rule>
              </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>
                <name value="r"/>
                <source>
                  <context value="id"/>
                  <element value="root"/>
                  <variable value="r"/>
                </source>
                <rule>
                  <name value="org"/>
                  <source>
                    <context value="id"/>
                    <element value="extension"/>
                    <variable value="ext"/>
                  </source>
                  <target>
                    <context value="organization1"/>
                    <contextType value="variable"/>
                    <element value="id"/>
                    <variable value="uuid4"/>
                    <transform value="evaluate"/>
                    <parameter>
                      <valueString value="r + '-' + ext"/>
                    </parameter>
                  </target>
                  <target>
                    <context value="e9"/>
                    <contextType value="variable"/>
                    <element value="fullUrl"/>
                    <transform value="append"/>
                    <parameter>
                      <valueString value="https://example/Organization/"/>
                    </parameter>
                    <parameter>
                      <valueId value="uuid4"/>
                    </parameter>
                  </target>
                  <target>
                    <context value="organization"/>
                    <contextType value="variable"/>
                    <element value="partOf"/>
                    <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/Organization/' + %organization1.id"/>
                    </parameter>
                  </target>
                </rule>
              </rule>
            </rule>
            <rule>
              <name value="code"/>
              <source>
                <context value="OrgPartOf"/>
                <element value="code"/>
                <variable value="vvv"/>
              </source>
              <target>
                <context value="organization1"/>
                <contextType value="variable"/>
                <element value="type"/>
                <variable value="vvv"/>
                <transform value="create"/>
              </target>
            </rule>
            <rule>
              <name value="statusCode"/>
              <source>
                <context value="OrgPartOf"/>
                <element value="statusCode"/>
                <variable value="status"/>
                <condition value="(value = 'active')"/>
              </source>
              <target>
                <context value="organization1"/>
                <contextType value="variable"/>
                <element value="active"/>
                <transform value="create"/>
                <parameter>
                  <valueString value="boolean"/>
                </parameter>
              </target>
              <target>
                <context value="organization1"/>
                <contextType value="variable"/>
                <element value="active"/>
                <transform value="copy"/>
                <parameter>
                  <valueString value="true"/>
                </parameter>
              </target>
            </rule>
            <rule>
              <name value="wholeOrganization"/>
              <source>
                <context value="OrgPartOf"/>
                <element value="wholeOrganization"/>
                <variable value="wholeOrgan"/>
              </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="PUT"/>
                </parameter>
              </target>
              <target>
                <context value="e10"/>
                <contextType value="variable"/>
                <element value="resource"/>
                <variable value="organization2"/>
                <transform value="create"/>
                <parameter>
                  <valueString value="Organization"/>
                </parameter>
              </target>
              <rule>
                <name value="meta"/>
                <source>
                  <context value="wholeOrgan"/>
                </source>
                <target>
                  <context value="organization2"/>
                  <contextType value="variable"/>
                  <element value="meta"/>
                  <variable value="meta"/>
                </target>
                <rule>
                  <name value="coding"/>
                  <source>
                    <context value="wholeOrgan"/>
                  </source>
                  <target>
                    <context value="meta"/>
                    <contextType value="variable"/>
                    <element value="tag"/>
                    <variable value="coding"/>
                    <transform value="create"/>
                    <parameter>
                      <valueString value="Coding"/>
                    </parameter>
                  </target>
                  <rule>
                    <name value="system"/>
                    <source>
                      <context value="wholeOrgan"/>
                    </source>
                    <target>
                      <context value="coding"/>
                      <contextType value="variable"/>
                      <element value="system"/>
                      <transform value="copy"/>
                      <parameter>
                        <valueString value="http://algoritmodiscoring"/>
                      </parameter>
                    </target>
                  </rule>
                  <rule>
                    <name value="code"/>
                    <source>
                      <context value="wholeOrgan"/>
                    </source>
                    <target>
                      <context value="coding"/>
                      <contextType value="variable"/>
                      <element value="code"/>
                      <transform value="copy"/>
                      <parameter>
                        <valueString
                                     value="ClinicalDocument/body/observation/author/representedOrganization/asOrganizationPartOf/wholeOrganization"/>
                      </parameter>
                    </target>
                  </rule>
                </rule>
              </rule>
              <rule>
                <name value="identifier"/>
                <source>
                  <context value="wholeOrgan"/>
                  <element value="id"/>
                  <variable value="id"/>
                </source>
                <target>
                  <context value="organization2"/>
                  <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="ext"/>
                  <source>
                    <context value="id"/>
                    <element value="extension"/>
                    <variable value="ext"/>
                  </source>
                  <target>
                    <context value="identifier"/>
                    <contextType value="variable"/>
                    <element value="value"/>
                    <transform value="copy"/>
                    <parameter>
                      <valueId value="ext"/>
                    </parameter>
                  </target>
                  <rule>
                    <name value="UUID"/>
                    <source>
                      <context value="wholeOrgan"/>
                    </source>
                    <target>
                      <context value="request"/>
                      <contextType value="variable"/>
                      <element value="url"/>
                      <transform value="append"/>
                      <parameter>
                        <valueString value="Organization?identifier="/>
                      </parameter>
                      <parameter>
                        <valueId value="ext"/>
                      </parameter>
                    </target>
                  </rule>
                </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>
                  <name value="r"/>
                  <source>
                    <context value="id"/>
                    <element value="root"/>
                    <variable value="r"/>
                  </source>
                  <rule>
                    <name value="org"/>
                    <source>
                      <context value="id"/>
                      <element value="extension"/>
                      <variable value="ext"/>
                    </source>
                    <target>
                      <context value="organization2"/>
                      <contextType value="variable"/>
                      <element value="id"/>
                      <variable value="uuid4"/>
                      <transform value="evaluate"/>
                      <parameter>
                        <valueString value="r + '-' + ext"/>
                      </parameter>
                    </target>
                    <target>
                      <context value="e10"/>
                      <contextType value="variable"/>
                      <element value="fullUrl"/>
                      <transform value="append"/>
                      <parameter>
                        <valueString value="https://example/Organization/"/>
                      </parameter>
                      <parameter>
                        <valueId value="uuid4"/>
                      </parameter>
                    </target>
                    <target>
                      <context value="organization1"/>
                      <contextType value="variable"/>
                      <element value="partOf"/>
                      <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/Organization/' + %organization2.id"/>
                      </parameter>
                    </target>
                  </rule>
                </rule>
              </rule>
              <rule>
                <name value="name"/>
                <source>
                  <context value="wholeOrgan"/>
                  <element value="name"/>
                  <variable value="v"/>
                </source>
                <target>
                  <context value="organization2"/>
                  <contextType value="variable"/>
                  <element value="name"/>
                  <transform value="evaluate"/>
                  <parameter>
                    <valueString value="v.other"/>
                  </parameter>
                </target>
              </rule>
              <rule>
                <name value="telecom"/>
                <source>
                  <context value="wholeOrgan"/>
                  <element value="telecom"/>
                  <variable value="vvv"/>
                </source>
                <target>
                  <context value="organization2"/>
                  <contextType value="variable"/>
                  <element value="telecom"/>
                  <variable value="vvv"/>
                  <transform value="create"/>
                </target>
              </rule>
              <rule>
                <name value="addr"/>
                <source>
                  <context value="wholeOrgan"/>
                  <element value="addr"/>
                  <variable value="vvv"/>
                </source>
                <target>
                  <context value="organization2"/>
                  <contextType value="variable"/>
                  <element value="address"/>
                  <variable value="vvv"/>
                  <transform value="create"/>
                </target>
              </rule>
            </rule>
          </rule>
          <documentation value="organization"/>
        </rule>
        <rule>
          <name value="Device"/>
          <source>
            <context value="assignedAuthor"/>
            <element value="assignedAuthoringDevice"/>
            <variable value="assignedAuthoringDevice"/>
          </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="device"/>
            <transform value="create"/>
            <parameter>
              <valueString value="Device"/>
            </parameter>
          </target>
          <target>
            <context value="device"/>
            <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/Device/"/>
            </parameter>
            <parameter>
              <valueId value="uuid11"/>
            </parameter>
          </target>
          <target>
            <context value="request"/>
            <contextType value="variable"/>
            <element value="url"/>
            <transform value="copy"/>
            <parameter>
              <valueString value="Device"/>
            </parameter>
          </target>
          <target>
            <context value="tgt"/>
            <contextType value="variable"/>
            <element value="author"/>
            <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/Device/' + %device.id"/>
            </parameter>
          </target>
          <rule>
            <name value="templateId"/>
            <source>
              <context value="assignedAuthoringDevice"/>
              <element value="templateId"/>
              <variable value="vvv"/>
            </source>
            <target>
              <context value="device"/>
              <contextType value="variable"/>
              <element value="identifier"/>
              <variable value="vvv"/>
              <transform value="create"/>
            </target>
          </rule>
          <rule>
            <name value="code"/>
            <source>
              <context value="assignedAuthoringDevice"/>
              <element value="code"/>
              <variable value="vvv"/>
            </source>
            <target>
              <context value="device"/>
              <contextType value="variable"/>
              <element value="type"/>
              <variable value="vvv"/>
              <transform value="create"/>
            </target>
          </rule>
          <rule>
            <name value="manufacturer"/>
            <source>
              <context value="assignedAuthoringDevice"/>
              <element value="manufacturerModelName"/>
              <variable value="manufacturerModelName"/>
            </source>
            <rule>
              <name value="displayRule"/>
              <source>
                <context value="manufacturerModelName"/>
                <variable value="m"/>
              </source>
              <target>
                <context value="device"/>
                <contextType value="variable"/>
                <element value="manufacturer"/>
                <transform value="evaluate"/>
                <parameter>
                  <valueString value="m.displayName"/>
                </parameter>
              </target>
            </rule>
          </rule>
          <rule>
            <name value="deviceName"/>
            <source>
              <context value="assignedAuthoringDevice"/>
              <element value="softwareName"/>
              <variable value="softwareName"/>
            </source>
            <target>
              <context value="device"/>
              <contextType value="variable"/>
              <element value="deviceName"/>
              <variable value="deviceName"/>
            </target>
            <rule>
              <name value="typeName"/>
              <source>
                <context value="softwareName"/>
              </source>
              <target>
                <context value="deviceName"/>
                <contextType value="variable"/>
                <element value="type"/>
                <transform value="copy"/>
                <parameter>
                  <valueString value="other"/>
                </parameter>
              </target>
            </rule>
            <rule>
              <name value="name"/>
              <source>
                <context value="softwareName"/>
                <variable value="s"/>
              </source>
              <target>
                <context value="deviceName"/>
                <contextType value="variable"/>
                <element value="name"/>
                <transform value="evaluate"/>
                <parameter>
                  <valueString value="s.displayName"/>
                </parameter>
              </target>
            </rule>
          </rule>
          <documentation value="device"/>
        </rule>
      </rule>
      <documentation value="author"/>
    </rule>
    <rule>
      <name value="participantEncounter"/>
      <source>
        <context value="obs"/>
        <element value="participant"/>
        <variable value="participant"/>
        <condition value="(typeCode != 'DEV')"/>
      </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>
        <name value="fhirParticipant"/>
        <source>
          <context value="participant"/>
        </source>
        <target>
          <context value="encounter"/>
          <contextType value="variable"/>
          <element value="participant"/>
          <variable value="FhirParticipant"/>
        </target>
        <rule>
          <name value="type"/>
          <source>
            <context value="participant"/>
            <variable value="p"/>
          </source>
          <target>
            <context value="FhirParticipant"/>
            <contextType value="variable"/>
            <element value="type"/>
            <variable value="type"/>
          </target>
          <rule>
            <name value="codeType"/>
            <source>
              <context value="p"/>
            </source>
            <target>
              <context value="type"/>
              <contextType value="variable"/>
              <element value="coding"/>
              <variable value="coding"/>
            </target>
            <rule>
              <name value="codice"/>
              <source>
                <context value="p"/>
              </source>
              <target>
                <context value="coding"/>
                <contextType value="variable"/>
                <element value="code"/>
                <transform value="evaluate"/>
                <parameter>
                  <valueString value="p.typeCode"/>
                </parameter>
              </target>
            </rule>
            <rule>
              <name value="system"/>
              <source>
                <context value="p"/>
              </source>
              <target>
                <context value="coding"/>
                <contextType value="variable"/>
                <element value="system"/>
                <transform value="copy"/>
                <parameter>
                  <valueString
                               value="http://terminology.hl7.org/CodeSystem/v3-ParticipationType"/>
                </parameter>
              </target>
            </rule>
          </rule>
        </rule>
      </rule>
      <rule>
        <name value="partRole"/>
        <source>
          <context value="participant"/>
          <element value="participantRole"/>
          <variable value="participantRole"/>
        </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="practitionerRole"/>
          <transform value="create"/>
          <parameter>
            <valueString value="PractitionerRole"/>
          </parameter>
        </target>
        <target>
          <context value="practitionerRole"/>
          <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/PractitionerRole/"/>
          </parameter>
          <parameter>
            <valueId value="uuid12"/>
          </parameter>
        </target>
        <target>
          <context value="request"/>
          <contextType value="variable"/>
          <element value="url"/>
          <transform value="copy"/>
          <parameter>
            <valueString value="PractitionerRole"/>
          </parameter>
        </target>
        <target>
          <context value="encounter"/>
          <contextType value="variable"/>
          <element value="participant"/>
          <variable value="participant1"/>
          <transform value="create"/>
          <parameter>
            <valueString value="BackboneElement"/>
          </parameter>
        </target>
        <target>
          <context value="participant1"/>
          <contextType value="variable"/>
          <element value="individual"/>
          <variable value="referencepart"/>
          <transform value="create"/>
          <parameter>
            <valueString value="Reference"/>
          </parameter>
        </target>
        <target>
          <context value="referencepart"/>
          <contextType value="variable"/>
          <element value="reference"/>
          <transform value="evaluate"/>
          <parameter>
            <valueString
                         value="'https://example/Practitioner/' + %practitionerRole.id"/>
          </parameter>
        </target>
        <rule>
          <name value="time"/>
          <source>
            <context value="participant"/>
            <element value="time"/>
            <variable value="time1"/>
          </source>
          <target>
            <context value="participant1"/>
            <contextType value="variable"/>
            <element value="period"/>
            <variable value="period"/>
            <transform value="create"/>
            <parameter>
              <valueString value="Period"/>
            </parameter>
          </target>
          <rule>
            <name value="val"/>
            <source>
              <context value="time1"/>
            </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="time1"/>
              <variable value="start"/>
            </dependent>
          </rule>
          <documentation value="participant.time -&gt; participant1.period;"/>
        </rule>
        <rule>
          <name value="time"/>
          <source>
            <context value="participant"/>
            <element value="time"/>
            <variable value="time1"/>
          </source>
          <target>
            <context value="participant1"/>
            <contextType value="variable"/>
            <element value="period"/>
            <variable value="period"/>
            <transform value="create"/>
            <parameter>
              <valueString value="Period"/>
            </parameter>
          </target>
          <dependent>
            <name value="IVLTSPeriod"/>
            <variable value="time1"/>
            <variable value="period"/>
          </dependent>
        </rule>
        <rule>
          <name value="functionCode"/>
          <source>
            <context value="participant"/>
            <element value="functionCode"/>
            <variable value="vvv"/>
          </source>
          <target>
            <context value="practitionerRole"/>
            <contextType value="variable"/>
            <element value="code"/>
            <variable value="vvv"/>
            <transform value="create"/>
          </target>
        </rule>
        <rule>
          <name value="practitioner"/>
          <source>
            <context value="participantRole"/>
          </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="PUT"/>
            </parameter>
          </target>
          <target>
            <context value="e13"/>
            <contextType value="variable"/>
            <element value="resource"/>
            <variable value="practitioner"/>
            <transform value="create"/>
            <parameter>
              <valueString value="Practitioner"/>
            </parameter>
          </target>
          <rule>
            <name value="meta"/>
            <source>
              <context value="participantRole"/>
            </source>
            <target>
              <context value="practitioner"/>
              <contextType value="variable"/>
              <element value="meta"/>
              <variable value="meta"/>
            </target>
            <rule>
              <name value="coding"/>
              <source>
                <context value="participantRole"/>
              </source>
              <target>
                <context value="meta"/>
                <contextType value="variable"/>
                <element value="tag"/>
                <variable value="coding"/>
                <transform value="create"/>
                <parameter>
                  <valueString value="Coding"/>
                </parameter>
              </target>
              <rule>
                <name value="system"/>
                <source>
                  <context value="participantRole"/>
                </source>
                <target>
                  <context value="coding"/>
                  <contextType value="variable"/>
                  <element value="system"/>
                  <transform value="copy"/>
                  <parameter>
                    <valueString value="http://algoritmodiscoring"/>
                  </parameter>
                </target>
              </rule>
              <rule>
                <name value="code"/>
                <source>
                  <context value="participantRole"/>
                </source>
                <target>
                  <context value="coding"/>
                  <contextType value="variable"/>
                  <element value="code"/>
                  <transform value="copy"/>
                  <parameter>
                    <valueString
                                 value="ClinicalDocument/body/observation/participant"/>
                  </parameter>
                </target>
              </rule>
            </rule>
          </rule>
          <rule>
            <name value="identifier"/>
            <source>
              <context value="participantRole"/>
              <element value="id"/>
              <variable value="id"/>
            </source>
            <target>
              <context value="practitioner"/>
              <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="ext"/>
              <source>
                <context value="id"/>
                <element value="extension"/>
                <variable value="ext"/>
              </source>
              <target>
                <context value="identifier"/>
                <contextType value="variable"/>
                <element value="value"/>
                <transform value="copy"/>
                <parameter>
                  <valueId value="ext"/>
                </parameter>
              </target>
              <rule>
                <name value="UUID"/>
                <source>
                  <context value="participantRole"/>
                </source>
                <target>
                  <context value="request"/>
                  <contextType value="variable"/>
                  <element value="url"/>
                  <transform value="append"/>
                  <parameter>
                    <valueString value="Practitioner?identifier="/>
                  </parameter>
                  <parameter>
                    <valueId value="ext"/>
                  </parameter>
                </target>
              </rule>
            </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>
              <name value="r"/>
              <source>
                <context value="id"/>
                <element value="root"/>
                <variable value="r"/>
              </source>
              <rule>
                <name value="org"/>
                <source>
                  <context value="id"/>
                  <element value="extension"/>
                  <variable value="ext"/>
                </source>
                <target>
                  <context value="practitioner"/>
                  <contextType value="variable"/>
                  <element value="id"/>
                  <variable value="uuid4"/>
                  <transform value="evaluate"/>
                  <parameter>
                    <valueString value="r + '-' + ext"/>
                  </parameter>
                </target>
                <target>
                  <context value="e13"/>
                  <contextType value="variable"/>
                  <element value="fullUrl"/>
                  <transform value="append"/>
                  <parameter>
                    <valueString value="https://example/Practitioner/"/>
                  </parameter>
                  <parameter>
                    <valueId value="uuid4"/>
                  </parameter>
                </target>
                <target>
                  <context value="practitionerRole"/>
                  <contextType value="variable"/>
                  <element value="practitioner"/>
                  <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/Practitioner/' + %practitioner.id"/>
                  </parameter>
                </target>
              </rule>
            </rule>
          </rule>
          <rule>
            <name value="code"/>
            <source>
              <context value="participantRole"/>
              <element value="code"/>
              <variable value="vvv"/>
            </source>
            <target>
              <context value="practitionerRole"/>
              <contextType value="variable"/>
              <element value="code"/>
              <variable value="vvv"/>
              <transform value="create"/>
            </target>
          </rule>
          <rule>
            <name value="addr"/>
            <source>
              <context value="participantRole"/>
              <element value="addr"/>
              <variable value="vvv"/>
            </source>
            <target>
              <context value="practitioner"/>
              <contextType value="variable"/>
              <element value="address"/>
              <variable value="vvv"/>
              <transform value="create"/>
            </target>
          </rule>
          <rule>
            <name value="telecom"/>
            <source>
              <context value="participantRole"/>
              <element value="telecom"/>
              <variable value="vvv"/>
            </source>
            <target>
              <context value="practitioner"/>
              <contextType value="variable"/>
              <element value="telecom"/>
              <variable value="vvv"/>
              <transform value="create"/>
            </target>
          </rule>
          <rule>
            <name value="name"/>
            <source>
              <context value="participantRole"/>
              <element value="playingEntity"/>
              <variable value="playingEntity"/>
            </source>
            <rule>
              <name value="name"/>
              <source>
                <context value="playingEntity"/>
                <element value="name"/>
                <variable value="vvv"/>
              </source>
              <target>
                <context value="practitioner"/>
                <contextType value="variable"/>
                <element value="name"/>
                <variable value="vvv"/>
                <transform value="create"/>
              </target>
            </rule>
            <rule>
              <name value="birth"/>
              <source>
                <context value="playingEntity"/>
                <element value="birthTime"/>
                <variable value="birthTime"/>
              </source>
              <rule>
                <name value="value"/>
                <source>
                  <context value="birthTime"/>
                  <element value="value"/>
                  <variable value="date"/>
                </source>
                <target>
                  <context value="practitioner"/>
                  <contextType value="variable"/>
                  <element value="birthDate"/>
                  <transform value="truncate"/>
                  <parameter>
                    <valueId value="date"/>
                  </parameter>
                  <parameter>
                    <valueInteger value="10"/>
                  </parameter>
                </target>
              </rule>
            </rule>
          </rule>
          <documentation value="non mappa i 2 precedenti"/>
        </rule>
      </rule>
      <documentation value="participant person"/>
    </rule>
    <rule>
      <name value="devParticipant"/>
      <source>
        <context value="obs"/>
        <element value="participant"/>
        <variable value="devParticipant"/>
        <condition value="(typeCode = 'DEV')"/>
      </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="device"/>
        <transform value="create"/>
        <parameter>
          <valueString value="Device"/>
        </parameter>
      </target>
      <target>
        <context value="device"/>
        <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/Device/"/>
        </parameter>
        <parameter>
          <valueId value="uuid14"/>
        </parameter>
      </target>
      <target>
        <context value="request"/>
        <contextType value="variable"/>
        <element value="url"/>
        <transform value="copy"/>
        <parameter>
          <valueString value="Device"/>
        </parameter>
      </target>
      <target>
        <context value="ob"/>
        <contextType value="variable"/>
        <element value="device"/>
        <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/Device/' + %device.id"/>
        </parameter>
      </target>
      <rule>
        <name value="participantRoleDev"/>
        <source>
          <context value="devParticipant"/>
          <element value="participantRole"/>
          <variable value="participantRoleDev"/>
        </source>
        <rule>
          <name value="playingDevice"/>
          <source>
            <context value="participantRoleDev"/>
            <element value="playingDevice"/>
            <variable value="playingDevice"/>
          </source>
          <rule>
            <name value="code"/>
            <source>
              <context value="playingDevice"/>
              <element value="code"/>
              <variable value="vvv"/>
            </source>
            <target>
              <context value="device"/>
              <contextType value="variable"/>
              <element value="type"/>
              <variable value="vvv"/>
              <transform value="create"/>
            </target>
          </rule>
          <rule>
            <name value="manufacturer"/>
            <source>
              <context value="playingDevice"/>
              <element value="manufacturerModelName"/>
              <variable value="manufacturerModelName"/>
            </source>
            <rule>
              <name value="displayRule"/>
              <source>
                <context value="manufacturerModelName"/>
                <variable value="m"/>
              </source>
              <target>
                <context value="device"/>
                <contextType value="variable"/>
                <element value="manufacturer"/>
                <transform value="evaluate"/>
                <parameter>
                  <valueString value="m.displayName"/>
                </parameter>
              </target>
            </rule>
          </rule>
          <rule>
            <name value="deviceName"/>
            <source>
              <context value="playingDevice"/>
              <element value="softwareName"/>
              <variable value="softwareName"/>
            </source>
            <target>
              <context value="device"/>
              <contextType value="variable"/>
              <element value="deviceName"/>
              <variable value="deviceName"/>
            </target>
            <rule>
              <name value="typeName"/>
              <source>
                <context value="softwareName"/>
              </source>
              <target>
                <context value="deviceName"/>
                <contextType value="variable"/>
                <element value="type"/>
                <transform value="copy"/>
                <parameter>
                  <valueString value="other"/>
                </parameter>
              </target>
            </rule>
            <rule>
              <name value="name"/>
              <source>
                <context value="softwareName"/>
                <variable value="s"/>
              </source>
              <target>
                <context value="deviceName"/>
                <contextType value="variable"/>
                <element value="name"/>
                <transform value="evaluate"/>
                <parameter>
                  <valueString value="s.displayName"/>
                </parameter>
              </target>
            </rule>
          </rule>
        </rule>
      </rule>
      <documentation value="participant device"/>
    </rule>
    <rule>
      <name value="observationMedia"/>
      <source>
        <context value="obs"/>
        <element value="entryRelationship"/>
        <variable value="er"/>
      </source>
      <rule>
        <name value="media"/>
        <source>
          <context value="er"/>
          <element value="observationMedia"/>
          <variable value="obsMedia"/>
        </source>
        <target>
          <context value="bundle"/>
          <contextType value="variable"/>
          <element value="entry"/>
          <variable value="e15"/>
        </target>
        <target>
          <context value="e15"/>
          <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="e15"/>
          <contextType value="variable"/>
          <element value="resource"/>
          <variable value="media1"/>
          <transform value="create"/>
          <parameter>
            <valueString value="Media"/>
          </parameter>
        </target>
        <target>
          <context value="media1"/>
          <contextType value="variable"/>
          <element value="id"/>
          <variable value="uuid15"/>
          <transform value="uuid"/>
        </target>
        <target>
          <context value="e15"/>
          <contextType value="variable"/>
          <element value="fullUrl"/>
          <transform value="append"/>
          <parameter>
            <valueString value="https://example/Media/"/>
          </parameter>
          <parameter>
            <valueId value="uuid15"/>
          </parameter>
        </target>
        <target>
          <context value="request"/>
          <contextType value="variable"/>
          <element value="url"/>
          <transform value="copy"/>
          <parameter>
            <valueString value="Media"/>
          </parameter>
        </target>
        <target>
          <context value="ob"/>
          <contextType value="variable"/>
          <element value="derivedFrom"/>
          <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/Media/' + %media1.id"/>
          </parameter>
        </target>
        <rule>
          <name value="Attachment"/>
          <source>
            <context value="obsMedia"/>
          </source>
          <target>
            <context value="media1"/>
            <contextType value="variable"/>
            <element value="content"/>
            <variable value="Attachment"/>
            <transform value="create"/>
            <parameter>
              <valueString value="Attachment"/>
            </parameter>
          </target>
          <rule>
            <name value="status"/>
            <source>
              <context value="obsMedia"/>
            </source>
            <target>
              <context value="media1"/>
              <contextType value="variable"/>
              <element value="status"/>
              <transform value="copy"/>
              <parameter>
                <valueString value="unknown"/>
              </parameter>
            </target>
          </rule>
          <rule>
            <name value="valuemedia"/>
            <source>
              <context value="obsMedia"/>
              <element value="value"/>
              <variable value="valueMedia"/>
            </source>
            <rule>
              <name value="type"/>
              <source>
                <context value="valueMedia"/>
                <element value="mediaType"/>
                <variable value="type"/>
              </source>
              <target>
                <context value="Attachment"/>
                <contextType value="variable"/>
                <element value="contentType"/>
                <transform value="copy"/>
                <parameter>
                  <valueId value="type"/>
                </parameter>
              </target>
            </rule>
            <rule>
              <name value="data"/>
              <source>
                <context value="valueMedia"/>
              </source>
              <target>
                <context value="Attachment"/>
                <contextType value="variable"/>
                <element value="data"/>
                <transform value="evaluate"/>
                <parameter>
                  <valueString value="valueMedia.dataBase64Binary"/>
                </parameter>
              </target>
            </rule>
          </rule>
        </rule>
      </rule>
      <documentation value="observationMedia"/>
    </rule>
    <rule>
      <name value="ref"/>
      <source>
        <context value="obs"/>
        <element value="referenceRange"/>
        <variable value="refRange"/>
      </source>
      <target>
        <context value="ob"/>
        <contextType value="variable"/>
        <element value="referenceRange"/>
        <variable value="ref"/>
        <transform value="create"/>
        <parameter>
          <valueString value="BackboneElement"/>
        </parameter>
      </target>
      <rule>
        <name value="refRange"/>
        <source>
          <context value="refRange"/>
          <element value="observationRange"/>
          <variable value="obsRange"/>
        </source>
        <rule>
          <name value="value"/>
          <source>
            <context value="obsRange"/>
            <type value="ST"/>
            <element value="value"/>
            <variable value="value"/>
          </source>
          <target>
            <context value="ref"/>
            <contextType value="variable"/>
            <element value="text"/>
            <transform value="create"/>
            <parameter>
              <valueString value="string"/>
            </parameter>
          </target>
          <target>
            <context value="ref"/>
            <contextType value="variable"/>
            <element value="text"/>
            <transform value="evaluate"/>
            <parameter>
              <valueString value="value.dataString"/>
            </parameter>
          </target>
        </rule>
        <rule>
          <name value="obsRange"/>
          <source>
            <context value="obsRange"/>
          </source>
          <target>
            <context value="ref"/>
            <contextType value="variable"/>
            <element value="low"/>
            <variable value="Low"/>
            <transform value="create"/>
            <parameter>
              <valueString value="Quantity"/>
            </parameter>
          </target>
          <rule>
            <name value="IVL-PQ"/>
            <source>
              <context value="obsRange"/>
              <type value="IVL_PQ"/>
              <element value="value"/>
              <variable value="v"/>
            </source>
            <rule>
              <name value="decValue"/>
              <source>
                <context value="v"/>
                <element value="low"/>
                <variable value="l1"/>
              </source>
              <rule>
                <name value="value"/>
                <source>
                  <context value="l1"/>
                  <element value="value"/>
                  <variable value="decValue"/>
                </source>
                <target>
                  <context value="Low"/>
                  <contextType value="variable"/>
                  <element value="value"/>
                  <transform value="copy"/>
                  <parameter>
                    <valueId value="decValue"/>
                  </parameter>
                </target>
              </rule>
              <rule>
                <name value="unit"/>
                <source>
                  <context value="l1"/>
                  <element value="unit"/>
                  <variable value="Unit"/>
                </source>
                <target>
                  <context value="Low"/>
                  <contextType value="variable"/>
                  <element value="unit"/>
                  <transform value="copy"/>
                  <parameter>
                    <valueId value="Unit"/>
                  </parameter>
                </target>
              </rule>
            </rule>
            <rule>
              <name value="high"/>
              <source>
                <context value="v"/>
              </source>
              <target>
                <context value="ref"/>
                <contextType value="variable"/>
                <element value="high"/>
                <variable value="high"/>
                <transform value="create"/>
                <parameter>
                  <valueString value="Quantity"/>
                </parameter>
              </target>
              <rule>
                <name value="decValue"/>
                <source>
                  <context value="v"/>
                  <element value="high"/>
                  <variable value="h1"/>
                </source>
                <rule>
                  <name value="value"/>
                  <source>
                    <context value="h1"/>
                    <element value="value"/>
                    <variable value="decValue1"/>
                  </source>
                  <target>
                    <context value="high"/>
                    <contextType value="variable"/>
                    <element value="value"/>
                    <transform value="copy"/>
                    <parameter>
                      <valueId value="decValue1"/>
                    </parameter>
                  </target>
                </rule>
                <rule>
                  <name value="unit"/>
                  <source>
                    <context value="h1"/>
                    <element value="unit"/>
                    <variable value="Unit1"/>
                  </source>
                  <target>
                    <context value="high"/>
                    <contextType value="variable"/>
                    <element value="unit"/>
                    <transform value="copy"/>
                    <parameter>
                      <valueId value="Unit1"/>
                    </parameter>
                  </target>
                </rule>
              </rule>
            </rule>
          </rule>
          <rule>
            <name value="interpretationCode"/>
            <source>
              <context value="obsRange"/>
              <element value="interpretationCode"/>
              <variable value="vvv"/>
            </source>
            <target>
              <context value="ref"/>
              <contextType value="variable"/>
              <element value="type"/>
              <variable value="vvv"/>
              <transform value="create"/>
            </target>
          </rule>
          <rule>
            <name value="precondition"/>
            <source>
              <context value="obsRange"/>
              <element value="precondition"/>
              <variable value="precondition"/>
            </source>
            <rule>
              <name value="criterion"/>
              <source>
                <context value="precondition"/>
                <element value="criterion"/>
                <variable value="criterion"/>
              </source>
              <rule>
                <name value="appliesTo"/>
                <source>
                  <context value="criterion"/>
                  <element value="code"/>
                  <variable value="vvv"/>
                </source>
                <target>
                  <context value="ref"/>
                  <contextType value="variable"/>
                  <element value="appliesTo"/>
                  <variable value="vvv"/>
                  <transform value="create"/>
                </target>
              </rule>
              <rule>
                <name value="v"/>
                <source>
                  <context value="criterion"/>
                  <type value="IVL_PQ"/>
                  <element value="value"/>
                  <variable value="v"/>
                </source>
                <rule>
                  <name value="low"/>
                  <source>
                    <context value="v"/>
                    <element value="high"/>
                    <variable value="l1"/>
                  </source>
                  <rule>
                    <name value="age"/>
                    <source>
                      <context value="l1"/>
                    </source>
                    <target>
                      <context value="ref"/>
                      <contextType value="variable"/>
                      <element value="age"/>
                      <variable value="age"/>
                      <transform value="create"/>
                      <parameter>
                        <valueString value="Quantity"/>
                      </parameter>
                    </target>
                    <rule>
                      <name value="high"/>
                      <source>
                        <context value="l1"/>
                      </source>
                      <target>
                        <context value="age"/>
                        <contextType value="variable"/>
                        <element value="high"/>
                        <variable value="high"/>
                      </target>
                      <rule>
                        <name value="value"/>
                        <source>
                          <context value="l1"/>
                          <element value="value"/>
                          <variable value="decValue"/>
                        </source>
                        <target>
                          <context value="high"/>
                          <contextType value="variable"/>
                          <element value="value"/>
                          <transform value="copy"/>
                          <parameter>
                            <valueId value="decValue"/>
                          </parameter>
                        </target>
                      </rule>
                      <rule>
                        <name value="unit"/>
                        <source>
                          <context value="l1"/>
                          <element value="unit"/>
                          <variable value="Unit1"/>
                        </source>
                        <target>
                          <context value="high"/>
                          <contextType value="variable"/>
                          <element value="unit"/>
                          <transform value="copy"/>
                          <parameter>
                            <valueId value="Unit1"/>
                          </parameter>
                        </target>
                      </rule>
                    </rule>
                  </rule>
                </rule>
              </rule>
            </rule>
          </rule>
        </rule>
      </rule>
      <documentation value="referenceRange"/>
    </rule>
  </group>
  <group>
    <name value="Observation3"/>
    <typeMode value="none"/>
    <input>
      <name value="obs"/>
      <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>
    <input>
      <name value="cda"/>
      <type value="Act"/>
      <mode value="source"/>
    </input>
    <rule>
      <name value="reference"/>
      <source>
        <context value="obs"/>
      </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="obs"/>
      </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="obs"/>
        <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="statusCode"/>
      <source>
        <context value="obs"/>
        <element value="statusCode"/>
        <variable value="statusc"/>
        <condition value="(code = 'completed')"/>
      </source>
      <target>
        <context value="ob"/>
        <contextType value="variable"/>
        <element value="status"/>
        <transform value="copy"/>
        <parameter>
          <valueString value="final"/>
        </parameter>
      </target>
    </rule>
    <rule>
      <name value="statusCode"/>
      <source>
        <context value="obs"/>
        <element value="statusCode"/>
        <variable value="statusc"/>
        <condition value="(code = 'active')"/>
      </source>
      <target>
        <context value="ob"/>
        <contextType value="variable"/>
        <element value="status"/>
        <transform value="copy"/>
        <parameter>
          <valueString value="registered"/>
        </parameter>
      </target>
    </rule>
    <rule>
      <name value="statusCode"/>
      <source>
        <context value="obs"/>
        <element value="statusCode"/>
        <variable value="statusc"/>
        <condition value="(code = 'aborted')"/>
      </source>
      <target>
        <context value="ob"/>
        <contextType value="variable"/>
        <element value="status"/>
        <transform value="copy"/>
        <parameter>
          <valueString value="cancelled"/>
        </parameter>
      </target>
    </rule>
    <rule>
      <name value="statusCode"/>
      <source>
        <context value="obs"/>
        <element value="statusCode"/>
        <variable value="statusc"/>
        <condition value="(code = 'suspended')"/>
      </source>
      <target>
        <context value="ob"/>
        <contextType value="variable"/>
        <element value="status"/>
        <transform value="copy"/>
        <parameter>
          <valueString value="partial"/>
        </parameter>
      </target>
    </rule>
    <rule>
      <name value="value2"/>
      <source>
        <context value="obs"/>
        <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="obs"/>
        <condition
                   value="effectiveTime.low.exists() or effectiveTime.high.exists()"/>
      </source>
      <rule>
        <name value="effectiveTime"/>
        <source>
          <context value="obs"/>
          <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="eff"/>
          <variable value="period"/>
        </dependent>
      </rule>
    </rule>
    <rule>
      <name value="interpretationCode"/>
      <source>
        <context value="obs"/>
        <element value="interpretationCode"/>
        <variable value="vvv"/>
      </source>
      <target>
        <context value="ob"/>
        <contextType value="variable"/>
        <element value="interpretation"/>
        <variable value="vvv"/>
        <transform value="create"/>
      </target>
    </rule>
    <rule>
      <name value="methodCode"/>
      <source>
        <context value="obs"/>
        <element value="methodCode"/>
        <variable value="vvv"/>
      </source>
      <target>
        <context value="ob"/>
        <contextType value="variable"/>
        <element value="method"/>
        <variable value="vvv"/>
        <transform value="create"/>
      </target>
    </rule>
    <rule>
      <name value="value"/>
      <source>
        <context value="obs"/>
        <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="boolean"/>
      <source>
        <context value="obs"/>
        <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="val"/>
      <source>
        <context value="obs"/>
        <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="originltext"/>
          <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="copy"/>
              <parameter>
                <valueId value="reference"/>
              </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>
            <name value="codeSystemVersion"/>
            <source>
              <context value="val"/>
              <element value="codeSystemVersion"/>
              <variable value="version"/>
            </source>
            <target>
              <context value="coding"/>
              <contextType value="variable"/>
              <element value="version"/>
              <transform value="cast"/>
              <parameter>
                <valueId value="version"/>
              </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="codeSystemVersion"/>
            <source>
              <context value="translation"/>
              <element value="codeSystemVersion"/>
              <variable value="version"/>
            </source>
            <target>
              <context value="coding"/>
              <contextType value="variable"/>
              <element value="version"/>
              <transform value="cast"/>
              <parameter>
                <valueId value="version"/>
              </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>
                <name value="codeSystemVersion"/>
                <source>
                  <context value="value"/>
                  <element value="codeSystemVersion"/>
                  <variable value="version"/>
                </source>
                <target>
                  <context value="coding"/>
                  <contextType value="variable"/>
                  <element value="version"/>
                  <transform value="cast"/>
                  <parameter>
                    <valueId value="version"/>
                  </parameter>
                  <parameter>
                    <valueString value="string"/>
                  </parameter>
                </target>
              </rule>
            </rule>
          </rule>
        </rule>
      </rule>
    </rule>
    <rule>
      <name value="valueQuantity"/>
      <source>
        <context value="obs"/>
        <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="value"/>
      <source>
        <context value="obs"/>
        <type value="ST"/>
        <element value="value"/>
        <variable value="value"/>
      </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="value.dataString"/>
        </parameter>
      </target>
    </rule>
    <rule>
      <name value="entryRelationship"/>
      <source>
        <context value="obs"/>
        <element value="entryRelationship"/>
        <variable value="entryRelationship"/>
      </source>
      <rule>
        <name value="Act"/>
        <source>
          <context value="entryRelationship"/>
          <element value="act"/>
          <variable value="act"/>
        </source>
        <rule>
          <name value="text"/>
          <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="ob"/>
              <contextType value="variable"/>
              <element value="note"/>
              <variable value="note"/>
            </target>
            <rule>
              <name value="reference"/>
              <source>
                <context 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>
      <documentation value="Note e commenti"/>
    </rule>
    <rule>
      <name value="subject"/>
      <source>
        <context value="obs"/>
        <element value="subject"/>
        <variable value="sbj"/>
      </source>
      <rule>
        <name value="relatedSubject"/>
        <source>
          <context value="sbj"/>
          <element value="relatedSubject"/>
          <variable value="relatedSubj"/>
        </source>
        <target>
          <context value="patient"/>
          <contextType value="variable"/>
          <element value="extension"/>
          <variable value="extension2"/>
        </target>
        <dependent>
          <name value="ExtSubjectAnimal"/>
          <variable value="relatedSubj"/>
          <variable value="extension2"/>
        </dependent>
      </rule>
      <documentation value="subject"/>
    </rule>
    <rule>
      <name value="specimen"/>
      <source>
        <context value="obs"/>
        <element value="specimen"/>
        <variable value="spmn"/>
      </source>
      <target>
        <context value="bundle"/>
        <contextType value="variable"/>
        <element value="entry"/>
        <variable value="e4o"/>
      </target>
      <target>
        <context value="e4o"/>
        <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="e4o"/>
        <contextType value="variable"/>
        <element value="resource"/>
        <variable value="specimen"/>
        <transform value="create"/>
        <parameter>
          <valueString value="Specimen"/>
        </parameter>
      </target>
      <target>
        <context value="specimen"/>
        <contextType value="variable"/>
        <element value="id"/>
        <variable value="uuid4o"/>
        <transform value="uuid"/>
      </target>
      <target>
        <context value="e4o"/>
        <contextType value="variable"/>
        <element value="fullUrl"/>
        <transform value="append"/>
        <parameter>
          <valueString value="https://example/Specimen/"/>
        </parameter>
        <parameter>
          <valueId value="uuid4o"/>
        </parameter>
      </target>
      <target>
        <context value="request"/>
        <contextType value="variable"/>
        <element value="url"/>
        <transform value="copy"/>
        <parameter>
          <valueString value="Specimen"/>
        </parameter>
      </target>
      <target>
        <context value="ob"/>
        <contextType value="variable"/>
        <element value="specimen"/>
        <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/Specimen/' + %specimen.id"/>
        </parameter>
      </target>
      <rule>
        <name value="specimenRole"/>
        <source>
          <context value="spmn"/>
          <element value="specimenRole"/>
          <variable value="specimenRole"/>
        </source>
        <rule>
          <name value="id"/>
          <source>
            <context value="specimenRole"/>
            <element value="id"/>
            <variable value="id"/>
          </source>
          <target>
            <context value="specimen"/>
            <contextType value="variable"/>
            <element value="identifier"/>
          </target>
        </rule>
        <rule>
          <name value="specimenPlayingEntity"/>
          <source>
            <context value="specimenRole"/>
            <element value="specimenPlayingEntity"/>
            <variable value="specimenPlayingEntity"/>
          </source>
          <rule>
            <name value="code"/>
            <source>
              <context value="specimenPlayingEntity"/>
              <element value="code"/>
              <variable value="vvv"/>
            </source>
            <target>
              <context value="specimen"/>
              <contextType value="variable"/>
              <element value="type"/>
              <variable value="vvv"/>
              <transform value="create"/>
            </target>
          </rule>
        </rule>
      </rule>
      <documentation value="specimen"/>
    </rule>
    <rule>
      <name value="performer"/>
      <source>
        <context value="obs"/>
        <element value="performer"/>
        <variable value="performer"/>
      </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="practitionerRole"/>
        <transform value="create"/>
        <parameter>
          <valueString value="PractitionerRole"/>
        </parameter>
      </target>
      <target>
        <context value="practitionerRole"/>
        <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/PractitionerRole/"/>
        </parameter>
        <parameter>
          <valueId value="uuid1"/>
        </parameter>
      </target>
      <target>
        <context value="request"/>
        <contextType value="variable"/>
        <element value="url"/>
        <transform value="copy"/>
        <parameter>
          <valueString value="PractitionerRole"/>
        </parameter>
      </target>
      <rule>
        <name value="practitionerRole"/>
        <source>
          <context value="performer"/>
        </source>
        <target>
          <context value="ob"/>
          <contextType value="variable"/>
          <element value="performer"/>
          <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/PractitionerRole/' + %practitionerRole.id"/>
          </parameter>
        </target>
        <rule>
          <name value="entity"/>
          <source>
            <context value="performer"/>
            <element value="assignedEntity"/>
            <variable value="entity"/>
          </source>
          <rule>
            <name value="code"/>
            <source>
              <context value="entity"/>
              <element value="code"/>
              <variable value="vvv"/>
            </source>
            <target>
              <context value="practitionerRole"/>
              <contextType value="variable"/>
              <element value="code"/>
              <variable value="vvv"/>
              <transform value="create"/>
            </target>
          </rule>
          <rule>
            <name value="practitioner"/>
            <source>
              <context value="entity"/>
            </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="PUT"/>
              </parameter>
            </target>
            <target>
              <context value="e2"/>
              <contextType value="variable"/>
              <element value="resource"/>
              <variable value="practitioner"/>
              <transform value="create"/>
              <parameter>
                <valueString value="Practitioner"/>
              </parameter>
            </target>
            <rule>
              <name value="meta"/>
              <source>
                <context value="entity"/>
              </source>
              <target>
                <context value="practitioner"/>
                <contextType value="variable"/>
                <element value="meta"/>
                <variable value="meta"/>
              </target>
              <rule>
                <name value="coding"/>
                <source>
                  <context value="entity"/>
                </source>
                <target>
                  <context value="meta"/>
                  <contextType value="variable"/>
                  <element value="tag"/>
                  <variable value="coding"/>
                  <transform value="create"/>
                  <parameter>
                    <valueString value="Coding"/>
                  </parameter>
                </target>
                <rule>
                  <name value="system"/>
                  <source>
                    <context value="entity"/>
                  </source>
                  <target>
                    <context value="coding"/>
                    <contextType value="variable"/>
                    <element value="system"/>
                    <transform value="copy"/>
                    <parameter>
                      <valueString value="http://algoritmodiscoring"/>
                    </parameter>
                  </target>
                </rule>
                <rule>
                  <name value="code"/>
                  <source>
                    <context value="entity"/>
                  </source>
                  <target>
                    <context value="coding"/>
                    <contextType value="variable"/>
                    <element value="code"/>
                    <transform value="copy"/>
                    <parameter>
                      <valueString
                                   value="ClinicalDocument/body/observation/performer"/>
                    </parameter>
                  </target>
                </rule>
              </rule>
            </rule>
            <rule>
              <name value="identifier"/>
              <source>
                <context value="entity"/>
                <element value="id"/>
                <variable value="id"/>
              </source>
              <target>
                <context value="practitioner"/>
                <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="ext"/>
                <source>
                  <context value="id"/>
                  <element value="extension"/>
                  <variable value="ext"/>
                </source>
                <target>
                  <context value="identifier"/>
                  <contextType value="variable"/>
                  <element value="value"/>
                  <transform value="copy"/>
                  <parameter>
                    <valueId value="ext"/>
                  </parameter>
                </target>
                <rule>
                  <name value="UUID"/>
                  <source>
                    <context value="entity"/>
                  </source>
                  <target>
                    <context value="request"/>
                    <contextType value="variable"/>
                    <element value="url"/>
                    <transform value="append"/>
                    <parameter>
                      <valueString value="Practitioner?identifier="/>
                    </parameter>
                    <parameter>
                      <valueId value="ext"/>
                    </parameter>
                  </target>
                </rule>
              </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>
                <name value="r"/>
                <source>
                  <context value="id"/>
                  <element value="root"/>
                  <variable value="r"/>
                </source>
                <rule>
                  <name value="performer"/>
                  <source>
                    <context value="id"/>
                    <element value="extension"/>
                    <variable value="ext"/>
                  </source>
                  <target>
                    <context value="practitioner"/>
                    <contextType value="variable"/>
                    <element value="id"/>
                    <variable value="uuid2"/>
                    <transform value="evaluate"/>
                    <parameter>
                      <valueString value="r + '-' + ext"/>
                    </parameter>
                  </target>
                  <target>
                    <context value="e2"/>
                    <contextType value="variable"/>
                    <element value="fullUrl"/>
                    <transform value="append"/>
                    <parameter>
                      <valueString value="https://example/Practitioner/"/>
                    </parameter>
                    <parameter>
                      <valueId value="uuid2"/>
                    </parameter>
                  </target>
                  <target>
                    <context value="practitionerRole"/>
                    <contextType value="variable"/>
                    <element value="practitioner"/>
                    <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/Practitioner/' + %practitioner.id"/>
                    </parameter>
                  </target>
                </rule>
              </rule>
            </rule>
            <rule>
              <name value="2.16.840.1.113883.2.9.4.3.2"/>
              <source>
                <context value="entity"/>
                <element value="id"/>
                <variable value="id"/>
                <condition value="(root = '2.16.840.1.113883.2.9.4.3.2')"/>
              </source>
              <rule>
                <name value="UUID"/>
                <source>
                  <context value="id"/>
                  <element value="extension"/>
                  <variable value="ext"/>
                </source>
                <target>
                  <context value="request"/>
                  <contextType value="variable"/>
                  <element value="url"/>
                  <transform value="append"/>
                  <parameter>
                    <valueString value="Practitioner?identifier="/>
                  </parameter>
                  <parameter>
                    <valueId value="ext"/>
                  </parameter>
                </target>
              </rule>
            </rule>
            <rule>
              <name value="diverso"/>
              <source>
                <context value="entity"/>
                <element value="id"/>
                <variable value="id"/>
                <condition value="(root != '2.16.840.1.113883.2.9.4.3.2')"/>
              </source>
              <rule>
                <name value="UUID"/>
                <source>
                  <context value="id"/>
                  <element value="extension"/>
                  <variable value="ext"/>
                </source>
                <target>
                  <context value="request"/>
                  <contextType value="variable"/>
                  <element value="url"/>
                  <transform value="append"/>
                  <parameter>
                    <valueString value="Practitioner?identifier="/>
                  </parameter>
                  <parameter>
                    <valueId value="ext"/>
                  </parameter>
                </target>
              </rule>
            </rule>
            <rule>
              <name value="addr"/>
              <source>
                <context value="entity"/>
                <element value="addr"/>
                <variable value="vvv"/>
              </source>
              <target>
                <context value="practitioner"/>
                <contextType value="variable"/>
                <element value="address"/>
                <variable value="vvv"/>
                <transform value="create"/>
              </target>
            </rule>
            <rule>
              <name value="telecom"/>
              <source>
                <context value="entity"/>
                <element value="telecom"/>
                <variable value="vvv"/>
              </source>
              <target>
                <context value="practitioner"/>
                <contextType value="variable"/>
                <element value="telecom"/>
                <variable value="vvv"/>
                <transform value="create"/>
              </target>
            </rule>
            <rule>
              <name value="name"/>
              <source>
                <context value="entity"/>
                <element value="assignedPerson"/>
                <variable value="person"/>
              </source>
              <rule>
                <name value="name"/>
                <source>
                  <context value="person"/>
                  <element value="name"/>
                  <variable value="vvv"/>
                </source>
                <target>
                  <context value="practitioner"/>
                  <contextType value="variable"/>
                  <element value="name"/>
                  <variable value="vvv"/>
                  <transform value="create"/>
                </target>
              </rule>
              <rule>
                <name value="birth"/>
                <source>
                  <context value="person"/>
                  <element value="birthTime"/>
                  <variable value="birthTime"/>
                </source>
                <rule>
                  <name value="value"/>
                  <source>
                    <context value="birthTime"/>
                    <element value="value"/>
                    <variable value="date"/>
                  </source>
                  <target>
                    <context value="practitioner"/>
                    <contextType value="variable"/>
                    <element value="birthDate"/>
                    <transform value="truncate"/>
                    <parameter>
                      <valueId value="date"/>
                    </parameter>
                    <parameter>
                      <valueInteger value="10"/>
                    </parameter>
                  </target>
                </rule>
              </rule>
            </rule>
            <rule>
              <name value="representedOrganization"/>
              <source>
                <context value="entity"/>
                <element value="representedOrganization"/>
                <variable value="representedOrganization"/>
              </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="PUT"/>
                </parameter>
              </target>
              <target>
                <context value="e3"/>
                <contextType value="variable"/>
                <element value="resource"/>
                <variable value="organization"/>
                <transform value="create"/>
                <parameter>
                  <valueString value="Organization"/>
                </parameter>
              </target>
              <rule>
                <name value="meta"/>
                <source>
                  <context value="representedOrganization"/>
                </source>
                <target>
                  <context value="organization"/>
                  <contextType value="variable"/>
                  <element value="meta"/>
                  <variable value="meta"/>
                </target>
                <rule>
                  <name value="coding"/>
                  <source>
                    <context value="representedOrganization"/>
                  </source>
                  <target>
                    <context value="meta"/>
                    <contextType value="variable"/>
                    <element value="tag"/>
                    <variable value="coding"/>
                    <transform value="create"/>
                    <parameter>
                      <valueString value="Coding"/>
                    </parameter>
                  </target>
                  <rule>
                    <name value="system"/>
                    <source>
                      <context value="representedOrganization"/>
                    </source>
                    <target>
                      <context value="coding"/>
                      <contextType value="variable"/>
                      <element value="system"/>
                      <transform value="copy"/>
                      <parameter>
                        <valueString value="http://algoritmodiscoring"/>
                      </parameter>
                    </target>
                  </rule>
                  <rule>
                    <name value="code"/>
                    <source>
                      <context value="representedOrganization"/>
                    </source>
                    <target>
                      <context value="coding"/>
                      <contextType value="variable"/>
                      <element value="code"/>
                      <transform value="copy"/>
                      <parameter>
                        <valueString
                                     value="ClinicalDocument/body/observation/performer/representedOrganization"/>
                      </parameter>
                    </target>
                  </rule>
                </rule>
              </rule>
              <rule>
                <name value="identifier"/>
                <source>
                  <context value="representedOrganization"/>
                  <element value="id"/>
                  <variable value="id"/>
                </source>
                <target>
                  <context value="organization"/>
                  <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="ext"/>
                  <source>
                    <context value="id"/>
                    <element value="extension"/>
                    <variable value="ext"/>
                  </source>
                  <target>
                    <context value="identifier"/>
                    <contextType value="variable"/>
                    <element value="value"/>
                    <transform value="copy"/>
                    <parameter>
                      <valueId value="ext"/>
                    </parameter>
                  </target>
                  <rule>
                    <name value="UUID"/>
                    <source>
                      <context value="representedOrganization"/>
                    </source>
                    <target>
                      <context value="request"/>
                      <contextType value="variable"/>
                      <element value="url"/>
                      <transform value="append"/>
                      <parameter>
                        <valueString value="Organization?identifier="/>
                      </parameter>
                      <parameter>
                        <valueId value="ext"/>
                      </parameter>
                    </target>
                  </rule>
                </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>
                  <name value="r"/>
                  <source>
                    <context value="id"/>
                    <element value="root"/>
                    <variable value="r"/>
                  </source>
                  <rule>
                    <name value="aut"/>
                    <source>
                      <context value="id"/>
                      <element value="extension"/>
                      <variable value="ext"/>
                    </source>
                    <target>
                      <context value="organization"/>
                      <contextType value="variable"/>
                      <element value="id"/>
                      <variable value="uuid3"/>
                      <transform value="evaluate"/>
                      <parameter>
                        <valueString value="r + '-' + ext"/>
                      </parameter>
                    </target>
                    <target>
                      <context value="e3"/>
                      <contextType value="variable"/>
                      <element value="fullUrl"/>
                      <transform value="append"/>
                      <parameter>
                        <valueString value="https://example/Organization/"/>
                      </parameter>
                      <parameter>
                        <valueId value="uuid3"/>
                      </parameter>
                    </target>
                    <target>
                      <context value="practitionerRole"/>
                      <contextType value="variable"/>
                      <element value="organization"/>
                      <variable value="referenceOrg"/>
                      <transform value="create"/>
                      <parameter>
                        <valueString value="Reference"/>
                      </parameter>
                    </target>
                    <target>
                      <context value="referenceOrg"/>
                      <contextType value="variable"/>
                      <element value="reference"/>
                      <transform value="append"/>
                      <parameter>
                        <valueString value="https://example/Organization/"/>
                      </parameter>
                      <parameter>
                        <valueId value="uuid3"/>
                      </parameter>
                    </target>
                  </rule>
                </rule>
              </rule>
              <rule>
                <name value="name"/>
                <source>
                  <context value="representedOrganization"/>
                  <element value="name"/>
                  <variable value="v"/>
                </source>
                <target>
                  <context value="organization"/>
                  <contextType value="variable"/>
                  <element value="name"/>
                  <transform value="evaluate"/>
                  <parameter>
                    <valueString value="v.other"/>
                  </parameter>
                </target>
              </rule>
              <rule>
                <name value="telecom"/>
                <source>
                  <context value="representedOrganization"/>
                  <element value="telecom"/>
                  <variable value="vvv"/>
                </source>
                <target>
                  <context value="organization"/>
                  <contextType value="variable"/>
                  <element value="telecom"/>
                  <variable value="vvv"/>
                  <transform value="create"/>
                </target>
              </rule>
              <rule>
                <name value="addr"/>
                <source>
                  <context value="representedOrganization"/>
                  <element value="addr"/>
                  <variable value="vvv"/>
                </source>
                <target>
                  <context value="organization"/>
                  <contextType value="variable"/>
                  <element value="address"/>
                  <variable value="vvv"/>
                  <transform value="create"/>
                </target>
              </rule>
              <rule>
                <name value="OrgPartOf"/>
                <source>
                  <context value="representedOrganization"/>
                  <element value="asOrganizationPartOf"/>
                  <variable value="OrgPartOf"/>
                </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="e4"/>
                  <contextType value="variable"/>
                  <element value="resource"/>
                  <variable value="organization1"/>
                  <transform value="create"/>
                  <parameter>
                    <valueString value="Organization"/>
                  </parameter>
                </target>
                <target>
                  <context value="request"/>
                  <contextType value="variable"/>
                  <element value="method"/>
                  <transform value="copy"/>
                  <parameter>
                    <valueString value="PUT"/>
                  </parameter>
                </target>
                <rule>
                  <name value="meta"/>
                  <source>
                    <context value="OrgPartOf"/>
                  </source>
                  <target>
                    <context value="organization1"/>
                    <contextType value="variable"/>
                    <element value="meta"/>
                    <variable value="meta"/>
                  </target>
                  <rule>
                    <name value="coding"/>
                    <source>
                      <context value="OrgPartOf"/>
                    </source>
                    <target>
                      <context value="meta"/>
                      <contextType value="variable"/>
                      <element value="tag"/>
                      <variable value="coding"/>
                      <transform value="create"/>
                      <parameter>
                        <valueString value="Coding"/>
                      </parameter>
                    </target>
                    <rule>
                      <name value="system"/>
                      <source>
                        <context value="OrgPartOf"/>
                      </source>
                      <target>
                        <context value="coding"/>
                        <contextType value="variable"/>
                        <element value="system"/>
                        <transform value="copy"/>
                        <parameter>
                          <valueString value="http://algoritmodiscoring"/>
                        </parameter>
                      </target>
                    </rule>
                    <rule>
                      <name value="code"/>
                      <source>
                        <context value="OrgPartOf"/>
                      </source>
                      <target>
                        <context value="coding"/>
                        <contextType value="variable"/>
                        <element value="code"/>
                        <transform value="copy"/>
                        <parameter>
                          <valueString
                                       value="ClinicalDocument/body/observation/performer/representedOrganization/asOrganizationPartOf"/>
                        </parameter>
                      </target>
                    </rule>
                  </rule>
                </rule>
                <rule>
                  <name value="identifier"/>
                  <source>
                    <context value="OrgPartOf"/>
                    <element value="id"/>
                    <variable value="id"/>
                  </source>
                  <target>
                    <context value="organization1"/>
                    <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="ext"/>
                    <source>
                      <context value="id"/>
                      <element value="extension"/>
                      <variable value="ext"/>
                    </source>
                    <target>
                      <context value="identifier"/>
                      <contextType value="variable"/>
                      <element value="value"/>
                      <transform value="copy"/>
                      <parameter>
                        <valueId value="ext"/>
                      </parameter>
                    </target>
                    <rule>
                      <name value="UUID"/>
                      <source>
                        <context value="OrgPartOf"/>
                      </source>
                      <target>
                        <context value="request"/>
                        <contextType value="variable"/>
                        <element value="url"/>
                        <transform value="append"/>
                        <parameter>
                          <valueString value="Organization?identifier="/>
                        </parameter>
                        <parameter>
                          <valueId value="ext"/>
                        </parameter>
                      </target>
                    </rule>
                  </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>
                    <name value="r"/>
                    <source>
                      <context value="id"/>
                      <element value="root"/>
                      <variable value="r"/>
                    </source>
                    <rule>
                      <name value="org"/>
                      <source>
                        <context value="id"/>
                        <element value="extension"/>
                        <variable value="ext"/>
                      </source>
                      <target>
                        <context value="organization1"/>
                        <contextType value="variable"/>
                        <element value="id"/>
                        <variable value="uuid4"/>
                        <transform value="evaluate"/>
                        <parameter>
                          <valueString value="r + '-' + ext"/>
                        </parameter>
                      </target>
                      <target>
                        <context value="e4"/>
                        <contextType value="variable"/>
                        <element value="fullUrl"/>
                        <transform value="append"/>
                        <parameter>
                          <valueString value="https://example/Organization/"/>
                        </parameter>
                        <parameter>
                          <valueId value="uuid4"/>
                        </parameter>
                      </target>
                      <target>
                        <context value="organization"/>
                        <contextType value="variable"/>
                        <element value="partOf"/>
                        <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/Organization/' + %organization1.id"/>
                        </parameter>
                      </target>
                    </rule>
                  </rule>
                </rule>
                <rule>
                  <name value="code"/>
                  <source>
                    <context value="OrgPartOf"/>
                    <element value="code"/>
                    <variable value="vvv"/>
                  </source>
                  <target>
                    <context value="organization1"/>
                    <contextType value="variable"/>
                    <element value="type"/>
                    <variable value="vvv"/>
                    <transform value="create"/>
                  </target>
                </rule>
                <rule>
                  <name value="statusCode"/>
                  <source>
                    <context value="OrgPartOf"/>
                    <element value="statusCode"/>
                    <variable value="status"/>
                    <condition value="(value = 'active')"/>
                  </source>
                  <target>
                    <context value="organization1"/>
                    <contextType value="variable"/>
                    <element value="active"/>
                    <transform value="create"/>
                    <parameter>
                      <valueString value="boolean"/>
                    </parameter>
                  </target>
                  <target>
                    <context value="organization1"/>
                    <contextType value="variable"/>
                    <element value="active"/>
                    <transform value="copy"/>
                    <parameter>
                      <valueString value="true"/>
                    </parameter>
                  </target>
                </rule>
                <rule>
                  <name value="wholeOrganization"/>
                  <source>
                    <context value="OrgPartOf"/>
                    <element value="wholeOrganization"/>
                    <variable value="wholeOrgan"/>
                  </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="PUT"/>
                    </parameter>
                  </target>
                  <target>
                    <context value="e5"/>
                    <contextType value="variable"/>
                    <element value="resource"/>
                    <variable value="organization2"/>
                    <transform value="create"/>
                    <parameter>
                      <valueString value="Organization"/>
                    </parameter>
                  </target>
                  <rule>
                    <name value="meta"/>
                    <source>
                      <context value="wholeOrgan"/>
                    </source>
                    <target>
                      <context value="organization2"/>
                      <contextType value="variable"/>
                      <element value="meta"/>
                      <variable value="meta"/>
                    </target>
                    <rule>
                      <name value="coding"/>
                      <source>
                        <context value="wholeOrgan"/>
                      </source>
                      <target>
                        <context value="meta"/>
                        <contextType value="variable"/>
                        <element value="tag"/>
                        <variable value="coding"/>
                        <transform value="create"/>
                        <parameter>
                          <valueString value="Coding"/>
                        </parameter>
                      </target>
                      <rule>
                        <name value="system"/>
                        <source>
                          <context value="wholeOrgan"/>
                        </source>
                        <target>
                          <context value="coding"/>
                          <contextType value="variable"/>
                          <element value="system"/>
                          <transform value="copy"/>
                          <parameter>
                            <valueString value="http://algoritmodiscoring"/>
                          </parameter>
                        </target>
                      </rule>
                      <rule>
                        <name value="code"/>
                        <source>
                          <context value="wholeOrgan"/>
                        </source>
                        <target>
                          <context value="coding"/>
                          <contextType value="variable"/>
                          <element value="code"/>
                          <transform value="copy"/>
                          <parameter>
                            <valueString
                                         value="ClinicalDocument/body/observation/performer/representedOrganization/wholeOrganization"/>
                          </parameter>
                        </target>
                      </rule>
                    </rule>
                  </rule>
                  <rule>
                    <name value="identifier"/>
                    <source>
                      <context value="wholeOrgan"/>
                      <element value="id"/>
                      <variable value="id"/>
                    </source>
                    <target>
                      <context value="organization2"/>
                      <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="ext"/>
                      <source>
                        <context value="id"/>
                        <element value="extension"/>
                        <variable value="ext"/>
                      </source>
                      <target>
                        <context value="identifier"/>
                        <contextType value="variable"/>
                        <element value="value"/>
                        <transform value="copy"/>
                        <parameter>
                          <valueId value="ext"/>
                        </parameter>
                      </target>
                      <rule>
                        <name value="UUID"/>
                        <source>
                          <context value="wholeOrgan"/>
                        </source>
                        <target>
                          <context value="request"/>
                          <contextType value="variable"/>
                          <element value="url"/>
                          <transform value="append"/>
                          <parameter>
                            <valueString value="Organization?identifier="/>
                          </parameter>
                          <parameter>
                            <valueId value="ext"/>
                          </parameter>
                        </target>
                      </rule>
                    </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>
                      <name value="r"/>
                      <source>
                        <context value="id"/>
                        <element value="root"/>
                        <variable value="r"/>
                      </source>
                      <rule>
                        <name value="org"/>
                        <source>
                          <context value="id"/>
                          <element value="extension"/>
                          <variable value="ext"/>
                        </source>
                        <target>
                          <context value="organization2"/>
                          <contextType value="variable"/>
                          <element value="id"/>
                          <variable value="uuid5"/>
                          <transform value="evaluate"/>
                          <parameter>
                            <valueString value="r + '-' + ext"/>
                          </parameter>
                        </target>
                        <target>
                          <context value="e5"/>
                          <contextType value="variable"/>
                          <element value="fullUrl"/>
                          <transform value="append"/>
                          <parameter>
                            <valueString
                                         value="https://example/Organization/"/>
                          </parameter>
                          <parameter>
                            <valueId value="uuid5"/>
                          </parameter>
                        </target>
                        <target>
                          <context value="organization1"/>
                          <contextType value="variable"/>
                          <element value="partOf"/>
                          <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/Organization/' + %organization2.id"/>
                          </parameter>
                        </target>
                      </rule>
                    </rule>
                  </rule>
                  <rule>
                    <name value="name"/>
                    <source>
                      <context value="wholeOrgan"/>
                      <element value="name"/>
                      <variable value="v"/>
                    </source>
                    <target>
                      <context value="organization2"/>
                      <contextType value="variable"/>
                      <element value="name"/>
                      <transform value="evaluate"/>
                      <parameter>
                        <valueString value="v.other"/>
                      </parameter>
                    </target>
                  </rule>
                  <rule>
                    <name value="telecom"/>
                    <source>
                      <context value="wholeOrgan"/>
                      <element value="telecom"/>
                      <variable value="vvv"/>
                    </source>
                    <target>
                      <context value="organization2"/>
                      <contextType value="variable"/>
                      <element value="telecom"/>
                      <variable value="vvv"/>
                      <transform value="create"/>
                    </target>
                  </rule>
                  <rule>
                    <name value="addr"/>
                    <source>
                      <context value="wholeOrgan"/>
                      <element value="addr"/>
                      <variable value="vvv"/>
                    </source>
                    <target>
                      <context value="organization2"/>
                      <contextType value="variable"/>
                      <element value="address"/>
                      <variable value="vvv"/>
                      <transform value="create"/>
                    </target>
                  </rule>
                </rule>
              </rule>
              <documentation value="organization"/>
            </rule>
          </rule>
        </rule>
      </rule>
      <documentation value="performer"/>
    </rule>
    <rule>
      <name value="author"/>
      <source>
        <context value="obs"/>
        <element value="author"/>
        <variable value="srcAuthor"/>
      </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="practitionerRole"/>
        <transform value="create"/>
        <parameter>
          <valueString value="PractitionerRole"/>
        </parameter>
      </target>
      <target>
        <context value="practitionerRole"/>
        <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/PractitionerRole/"/>
        </parameter>
        <parameter>
          <valueId value="uuid6"/>
        </parameter>
      </target>
      <target>
        <context value="request"/>
        <contextType value="variable"/>
        <element value="url"/>
        <transform value="copy"/>
        <parameter>
          <valueString value="PractitionerRole"/>
        </parameter>
      </target>
      <target>
        <context value="ob"/>
        <contextType value="variable"/>
        <element value="performer"/>
        <variable value="referenceaut"/>
        <transform value="create"/>
        <parameter>
          <valueString value="Reference"/>
        </parameter>
      </target>
      <target>
        <context value="referenceaut"/>
        <contextType value="variable"/>
        <element value="reference"/>
        <transform value="evaluate"/>
        <parameter>
          <valueString
                       value="'https://example/PractitionerRole/' + %practitionerRole.id"/>
        </parameter>
      </target>
      <rule>
        <name value="assignedAuthor"/>
        <source>
          <context value="srcAuthor"/>
          <element value="assignedAuthor"/>
          <variable value="assignedAuthor"/>
        </source>
        <rule>
          <name value="code"/>
          <source>
            <context value="assignedAuthor"/>
            <element value="code"/>
            <variable value="codice"/>
          </source>
          <target>
            <context value="practitionerRole"/>
            <contextType value="variable"/>
            <element value="code"/>
            <variable value="code2"/>
          </target>
          <dependent>
            <name value="CECodeableConcept"/>
            <variable value="codice"/>
            <variable value="code2"/>
          </dependent>
        </rule>
        <rule>
          <name value="ASSAUth"/>
          <source>
            <context value="assignedAuthor"/>
          </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="PUT"/>
            </parameter>
          </target>
          <target>
            <context value="e7"/>
            <contextType value="variable"/>
            <element value="resource"/>
            <variable value="practitioner"/>
            <transform value="create"/>
            <parameter>
              <valueString value="Practitioner"/>
            </parameter>
          </target>
          <target>
            <context value="practitioner"/>
            <contextType value="variable"/>
            <element value="id"/>
            <variable value="uuid7"/>
            <transform value="uuid"/>
          </target>
          <rule>
            <name value="functionCode"/>
            <source>
              <context value="srcAuthor"/>
              <element value="functionCode"/>
              <variable value="vvv"/>
            </source>
            <target>
              <context value="practitionerRole"/>
              <contextType value="variable"/>
              <element value="code"/>
              <variable value="vvv"/>
              <transform value="create"/>
            </target>
          </rule>
          <rule>
            <name value="meta"/>
            <source>
              <context value="assignedAuthor"/>
            </source>
            <target>
              <context value="practitioner"/>
              <contextType value="variable"/>
              <element value="meta"/>
              <variable value="meta"/>
            </target>
            <rule>
              <name value="coding"/>
              <source>
                <context value="assignedAuthor"/>
              </source>
              <target>
                <context value="meta"/>
                <contextType value="variable"/>
                <element value="tag"/>
                <variable value="coding"/>
                <transform value="create"/>
                <parameter>
                  <valueString value="Coding"/>
                </parameter>
              </target>
              <rule>
                <name value="system"/>
                <source>
                  <context value="assignedAuthor"/>
                </source>
                <target>
                  <context value="coding"/>
                  <contextType value="variable"/>
                  <element value="system"/>
                  <transform value="copy"/>
                  <parameter>
                    <valueString value="http://algoritmodiscoring"/>
                  </parameter>
                </target>
              </rule>
              <rule>
                <name value="code"/>
                <source>
                  <context value="assignedAuthor"/>
                </source>
                <target>
                  <context value="coding"/>
                  <contextType value="variable"/>
                  <element value="code"/>
                  <transform value="copy"/>
                  <parameter>
                    <valueString
                                 value="ClinicalDocument/body/observation/author"/>
                  </parameter>
                </target>
              </rule>
            </rule>
          </rule>
          <rule>
            <name value="identifier"/>
            <source>
              <context value="assignedAuthor"/>
              <element value="id"/>
              <variable value="id"/>
            </source>
            <target>
              <context value="practitioner"/>
              <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="ext"/>
              <source>
                <context value="id"/>
                <element value="extension"/>
                <variable value="ext"/>
              </source>
              <target>
                <context value="identifier"/>
                <contextType value="variable"/>
                <element value="value"/>
                <transform value="copy"/>
                <parameter>
                  <valueId value="ext"/>
                </parameter>
              </target>
              <rule>
                <name value="UUID"/>
                <source>
                  <context value="assignedAuthor"/>
                </source>
                <target>
                  <context value="request"/>
                  <contextType value="variable"/>
                  <element value="url"/>
                  <transform value="append"/>
                  <parameter>
                    <valueString value="Practitioner?identifier="/>
                  </parameter>
                  <parameter>
                    <valueId value="ext"/>
                  </parameter>
                </target>
              </rule>
            </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>
              <name value="r"/>
              <source>
                <context value="id"/>
                <element value="root"/>
                <variable value="r"/>
              </source>
              <rule>
                <name value="aut"/>
                <source>
                  <context value="id"/>
                  <element value="extension"/>
                  <variable value="ext"/>
                </source>
                <target>
                  <context value="practitioner"/>
                  <contextType value="variable"/>
                  <element value="id"/>
                  <variable value="uuid2"/>
                  <transform value="evaluate"/>
                  <parameter>
                    <valueString value="r + '-' + ext"/>
                  </parameter>
                </target>
                <target>
                  <context value="e7"/>
                  <contextType value="variable"/>
                  <element value="fullUrl"/>
                  <transform value="append"/>
                  <parameter>
                    <valueString value="https://example/Practitioner/"/>
                  </parameter>
                  <parameter>
                    <valueId value="uuid2"/>
                  </parameter>
                </target>
                <target>
                  <context value="practitionerRole"/>
                  <contextType value="variable"/>
                  <element value="practitioner"/>
                  <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/Practitioner/' + %practitioner.id"/>
                  </parameter>
                </target>
              </rule>
            </rule>
            <rule>
              <name value="2.16.840.1.113883.2.9.4.3.2"/>
              <source>
                <context value="assignedAuthor"/>
                <element value="id"/>
                <variable value="id"/>
                <condition value="(root = '2.16.840.1.113883.2.9.4.3.2')"/>
              </source>
              <rule>
                <name value="UUID"/>
                <source>
                  <context value="id"/>
                  <element value="extension"/>
                  <variable value="ext"/>
                </source>
                <target>
                  <context value="request"/>
                  <contextType value="variable"/>
                  <element value="url"/>
                  <transform value="append"/>
                  <parameter>
                    <valueString value="Practitioner?identifier="/>
                  </parameter>
                  <parameter>
                    <valueId value="ext"/>
                  </parameter>
                </target>
              </rule>
            </rule>
            <rule>
              <name value="diverso"/>
              <source>
                <context value="assignedAuthor"/>
                <element value="id"/>
                <variable value="id"/>
                <condition value="(root != '2.16.840.1.113883.2.9.4.3.2')"/>
              </source>
              <rule>
                <name value="UUID"/>
                <source>
                  <context value="id"/>
                  <element value="extension"/>
                  <variable value="ext"/>
                </source>
                <target>
                  <context value="request"/>
                  <contextType value="variable"/>
                  <element value="url"/>
                  <transform value="append"/>
                  <parameter>
                    <valueString value="Practitioner?identifier="/>
                  </parameter>
                  <parameter>
                    <valueId value="ext"/>
                  </parameter>
                </target>
              </rule>
            </rule>
          </rule>
          <rule>
            <name value="addr"/>
            <source>
              <context value="assignedAuthor"/>
              <element value="addr"/>
              <variable value="vvv"/>
            </source>
            <target>
              <context value="practitioner"/>
              <contextType value="variable"/>
              <element value="address"/>
              <variable value="vvv"/>
              <transform value="create"/>
            </target>
          </rule>
          <rule>
            <name value="telecom"/>
            <source>
              <context value="assignedAuthor"/>
              <element value="telecom"/>
              <variable value="vvv"/>
            </source>
            <target>
              <context value="practitioner"/>
              <contextType value="variable"/>
              <element value="telecom"/>
              <variable value="vvv"/>
              <transform value="create"/>
            </target>
          </rule>
          <rule>
            <name value="name"/>
            <source>
              <context value="assignedAuthor"/>
              <element value="assignedPerson"/>
              <variable value="person"/>
            </source>
            <rule>
              <name value="name"/>
              <source>
                <context value="person"/>
                <element value="name"/>
                <variable value="vvv"/>
              </source>
              <target>
                <context value="practitioner"/>
                <contextType value="variable"/>
                <element value="name"/>
                <variable value="vvv"/>
                <transform value="create"/>
              </target>
            </rule>
            <rule>
              <name value="birth"/>
              <source>
                <context value="person"/>
                <element value="birthTime"/>
                <variable value="birthTime"/>
              </source>
              <rule>
                <name value="value"/>
                <source>
                  <context value="birthTime"/>
                  <element value="value"/>
                  <variable value="date"/>
                </source>
                <target>
                  <context value="practitioner"/>
                  <contextType value="variable"/>
                  <element value="birthDate"/>
                  <transform value="truncate"/>
                  <parameter>
                    <valueId value="date"/>
                  </parameter>
                  <parameter>
                    <valueInteger value="10"/>
                  </parameter>
                </target>
              </rule>
            </rule>
            <documentation value="person"/>
          </rule>
        </rule>
        <rule>
          <name value="representedOrganization"/>
          <source>
            <context value="assignedAuthor"/>
            <element value="representedOrganization"/>
            <variable value="representedOrganization"/>
          </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="PUT"/>
            </parameter>
          </target>
          <target>
            <context value="e8"/>
            <contextType value="variable"/>
            <element value="resource"/>
            <variable value="organization"/>
            <transform value="create"/>
            <parameter>
              <valueString value="Organization"/>
            </parameter>
          </target>
          <rule>
            <name value="meta"/>
            <source>
              <context value="representedOrganization"/>
            </source>
            <target>
              <context value="organization"/>
              <contextType value="variable"/>
              <element value="meta"/>
              <variable value="meta"/>
            </target>
            <rule>
              <name value="coding"/>
              <source>
                <context value="representedOrganization"/>
              </source>
              <target>
                <context value="meta"/>
                <contextType value="variable"/>
                <element value="tag"/>
                <variable value="coding"/>
                <transform value="create"/>
                <parameter>
                  <valueString value="Coding"/>
                </parameter>
              </target>
              <rule>
                <name value="system"/>
                <source>
                  <context value="representedOrganization"/>
                </source>
                <target>
                  <context value="coding"/>
                  <contextType value="variable"/>
                  <element value="system"/>
                  <transform value="copy"/>
                  <parameter>
                    <valueString value="http://algoritmodiscoring"/>
                  </parameter>
                </target>
              </rule>
              <rule>
                <name value="code"/>
                <source>
                  <context value="representedOrganization"/>
                </source>
                <target>
                  <context value="coding"/>
                  <contextType value="variable"/>
                  <element value="code"/>
                  <transform value="copy"/>
                  <parameter>
                    <valueString
                                 value="ClinicalDocument/body/observation/author/representedOrganization"/>
                  </parameter>
                </target>
              </rule>
            </rule>
          </rule>
          <rule>
            <name value="identifier"/>
            <source>
              <context value="representedOrganization"/>
              <element value="id"/>
              <variable value="id"/>
            </source>
            <target>
              <context value="organization"/>
              <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="ext"/>
              <source>
                <context value="id"/>
                <element value="extension"/>
                <variable value="ext"/>
              </source>
              <target>
                <context value="identifier"/>
                <contextType value="variable"/>
                <element value="value"/>
                <transform value="copy"/>
                <parameter>
                  <valueId value="ext"/>
                </parameter>
              </target>
              <rule>
                <name value="UUID"/>
                <source>
                  <context value="representedOrganization"/>
                </source>
                <target>
                  <context value="request"/>
                  <contextType value="variable"/>
                  <element value="url"/>
                  <transform value="append"/>
                  <parameter>
                    <valueString value="Organization?identifier="/>
                  </parameter>
                  <parameter>
                    <valueId value="ext"/>
                  </parameter>
                </target>
              </rule>
            </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>
              <name value="r"/>
              <source>
                <context value="id"/>
                <element value="root"/>
                <variable value="r"/>
              </source>
              <rule>
                <name value="org"/>
                <source>
                  <context value="id"/>
                  <element value="extension"/>
                  <variable value="ext"/>
                </source>
                <target>
                  <context value="organization"/>
                  <contextType value="variable"/>
                  <element value="id"/>
                  <variable value="uuid3"/>
                  <transform value="evaluate"/>
                  <parameter>
                    <valueString value="r + '-' + ext"/>
                  </parameter>
                </target>
                <target>
                  <context value="e8"/>
                  <contextType value="variable"/>
                  <element value="fullUrl"/>
                  <transform value="append"/>
                  <parameter>
                    <valueString value="https://example/Organization/"/>
                  </parameter>
                  <parameter>
                    <valueId value="uuid3"/>
                  </parameter>
                </target>
                <target>
                  <context value="practitionerRole"/>
                  <contextType value="variable"/>
                  <element value="organization"/>
                  <variable value="referenceOrg"/>
                  <transform value="create"/>
                  <parameter>
                    <valueString value="Reference"/>
                  </parameter>
                </target>
                <target>
                  <context value="referenceOrg"/>
                  <contextType value="variable"/>
                  <element value="reference"/>
                  <transform value="append"/>
                  <parameter>
                    <valueString value="https://example/Organization/"/>
                  </parameter>
                  <parameter>
                    <valueId value="uuid3"/>
                  </parameter>
                </target>
              </rule>
            </rule>
          </rule>
          <rule>
            <name value="name"/>
            <source>
              <context value="representedOrganization"/>
              <element value="name"/>
              <variable value="v"/>
            </source>
            <target>
              <context value="organization"/>
              <contextType value="variable"/>
              <element value="name"/>
              <transform value="evaluate"/>
              <parameter>
                <valueString value="v.other"/>
              </parameter>
            </target>
          </rule>
          <rule>
            <name value="telecom"/>
            <source>
              <context value="representedOrganization"/>
              <element value="telecom"/>
              <variable value="vvv"/>
            </source>
            <target>
              <context value="organization"/>
              <contextType value="variable"/>
              <element value="telecom"/>
              <variable value="vvv"/>
              <transform value="create"/>
            </target>
          </rule>
          <rule>
            <name value="addr"/>
            <source>
              <context value="representedOrganization"/>
              <element value="addr"/>
              <variable value="vvv"/>
            </source>
            <target>
              <context value="organization"/>
              <contextType value="variable"/>
              <element value="address"/>
              <variable value="vvv"/>
              <transform value="create"/>
            </target>
          </rule>
          <rule>
            <name value="OrgPartOf"/>
            <source>
              <context value="representedOrganization"/>
              <element value="asOrganizationPartOf"/>
              <variable value="OrgPartOf"/>
            </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="PUT"/>
              </parameter>
            </target>
            <target>
              <context value="e9"/>
              <contextType value="variable"/>
              <element value="resource"/>
              <variable value="organization1"/>
              <transform value="create"/>
              <parameter>
                <valueString value="Organization"/>
              </parameter>
            </target>
            <rule>
              <name value="meta"/>
              <source>
                <context value="OrgPartOf"/>
              </source>
              <target>
                <context value="organization1"/>
                <contextType value="variable"/>
                <element value="meta"/>
                <variable value="meta"/>
              </target>
              <rule>
                <name value="coding"/>
                <source>
                  <context value="OrgPartOf"/>
                </source>
                <target>
                  <context value="meta"/>
                  <contextType value="variable"/>
                  <element value="tag"/>
                  <variable value="coding"/>
                  <transform value="create"/>
                  <parameter>
                    <valueString value="Coding"/>
                  </parameter>
                </target>
                <rule>
                  <name value="system"/>
                  <source>
                    <context value="OrgPartOf"/>
                  </source>
                  <target>
                    <context value="coding"/>
                    <contextType value="variable"/>
                    <element value="system"/>
                    <transform value="copy"/>
                    <parameter>
                      <valueString value="http://algoritmodiscoring"/>
                    </parameter>
                  </target>
                </rule>
                <rule>
                  <name value="code"/>
                  <source>
                    <context value="OrgPartOf"/>
                  </source>
                  <target>
                    <context value="coding"/>
                    <contextType value="variable"/>
                    <element value="code"/>
                    <transform value="copy"/>
                    <parameter>
                      <valueString
                                   value="ClinicalDocument/body/observation/author/representedOrganization/asOrganizationPartOf"/>
                    </parameter>
                  </target>
                </rule>
              </rule>
            </rule>
            <rule>
              <name value="identifier"/>
              <source>
                <context value="OrgPartOf"/>
                <element value="id"/>
                <variable value="id"/>
              </source>
              <target>
                <context value="organization1"/>
                <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="ext"/>
                <source>
                  <context value="id"/>
                  <element value="extension"/>
                  <variable value="ext"/>
                </source>
                <target>
                  <context value="identifier"/>
                  <contextType value="variable"/>
                  <element value="value"/>
                  <transform value="copy"/>
                  <parameter>
                    <valueId value="ext"/>
                  </parameter>
                </target>
                <rule>
                  <name value="UUID"/>
                  <source>
                    <context value="OrgPartOf"/>
                  </source>
                  <target>
                    <context value="request"/>
                    <contextType value="variable"/>
                    <element value="url"/>
                    <transform value="append"/>
                    <parameter>
                      <valueString value="Organization?identifier="/>
                    </parameter>
                    <parameter>
                      <valueId value="ext"/>
                    </parameter>
                  </target>
                </rule>
              </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>
                <name value="r"/>
                <source>
                  <context value="id"/>
                  <element value="root"/>
                  <variable value="r"/>
                </source>
                <rule>
                  <name value="org"/>
                  <source>
                    <context value="id"/>
                    <element value="extension"/>
                    <variable value="ext"/>
                  </source>
                  <target>
                    <context value="organization1"/>
                    <contextType value="variable"/>
                    <element value="id"/>
                    <variable value="uuid4"/>
                    <transform value="evaluate"/>
                    <parameter>
                      <valueString value="r + '-' + ext"/>
                    </parameter>
                  </target>
                  <target>
                    <context value="e9"/>
                    <contextType value="variable"/>
                    <element value="fullUrl"/>
                    <transform value="append"/>
                    <parameter>
                      <valueString value="https://example/Organization/"/>
                    </parameter>
                    <parameter>
                      <valueId value="uuid4"/>
                    </parameter>
                  </target>
                  <target>
                    <context value="organization"/>
                    <contextType value="variable"/>
                    <element value="partOf"/>
                    <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/Organization/' + %organization1.id"/>
                    </parameter>
                  </target>
                </rule>
              </rule>
            </rule>
            <rule>
              <name value="code"/>
              <source>
                <context value="OrgPartOf"/>
                <element value="code"/>
                <variable value="vvv"/>
              </source>
              <target>
                <context value="organization1"/>
                <contextType value="variable"/>
                <element value="type"/>
                <variable value="vvv"/>
                <transform value="create"/>
              </target>
            </rule>
            <rule>
              <name value="statusCode"/>
              <source>
                <context value="OrgPartOf"/>
                <element value="statusCode"/>
                <variable value="status"/>
                <condition value="(value = 'active')"/>
              </source>
              <target>
                <context value="organization1"/>
                <contextType value="variable"/>
                <element value="active"/>
                <transform value="create"/>
                <parameter>
                  <valueString value="boolean"/>
                </parameter>
              </target>
              <target>
                <context value="organization1"/>
                <contextType value="variable"/>
                <element value="active"/>
                <transform value="copy"/>
                <parameter>
                  <valueString value="true"/>
                </parameter>
              </target>
            </rule>
            <rule>
              <name value="wholeOrganization"/>
              <source>
                <context value="OrgPartOf"/>
                <element value="wholeOrganization"/>
                <variable value="wholeOrgan"/>
              </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="PUT"/>
                </parameter>
              </target>
              <target>
                <context value="e10"/>
                <contextType value="variable"/>
                <element value="resource"/>
                <variable value="organization2"/>
                <transform value="create"/>
                <parameter>
                  <valueString value="Organization"/>
                </parameter>
              </target>
              <rule>
                <name value="meta"/>
                <source>
                  <context value="wholeOrgan"/>
                </source>
                <target>
                  <context value="organization2"/>
                  <contextType value="variable"/>
                  <element value="meta"/>
                  <variable value="meta"/>
                </target>
                <rule>
                  <name value="coding"/>
                  <source>
                    <context value="wholeOrgan"/>
                  </source>
                  <target>
                    <context value="meta"/>
                    <contextType value="variable"/>
                    <element value="tag"/>
                    <variable value="coding"/>
                    <transform value="create"/>
                    <parameter>
                      <valueString value="Coding"/>
                    </parameter>
                  </target>
                  <rule>
                    <name value="system"/>
                    <source>
                      <context value="wholeOrgan"/>
                    </source>
                    <target>
                      <context value="coding"/>
                      <contextType value="variable"/>
                      <element value="system"/>
                      <transform value="copy"/>
                      <parameter>
                        <valueString value="http://algoritmodiscoring"/>
                      </parameter>
                    </target>
                  </rule>
                  <rule>
                    <name value="code"/>
                    <source>
                      <context value="wholeOrgan"/>
                    </source>
                    <target>
                      <context value="coding"/>
                      <contextType value="variable"/>
                      <element value="code"/>
                      <transform value="copy"/>
                      <parameter>
                        <valueString
                                     value="ClinicalDocument/body/observation/author/representedOrganization/asOrganizationPartOf/wholeOrganization"/>
                      </parameter>
                    </target>
                  </rule>
                </rule>
              </rule>
              <rule>
                <name value="identifier"/>
                <source>
                  <context value="wholeOrgan"/>
                  <element value="id"/>
                  <variable value="id"/>
                </source>
                <target>
                  <context value="organization2"/>
                  <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="ext"/>
                  <source>
                    <context value="id"/>
                    <element value="extension"/>
                    <variable value="ext"/>
                  </source>
                  <target>
                    <context value="identifier"/>
                    <contextType value="variable"/>
                    <element value="value"/>
                    <transform value="copy"/>
                    <parameter>
                      <valueId value="ext"/>
                    </parameter>
                  </target>
                  <rule>
                    <name value="UUID"/>
                    <source>
                      <context value="wholeOrgan"/>
                    </source>
                    <target>
                      <context value="request"/>
                      <contextType value="variable"/>
                      <element value="url"/>
                      <transform value="append"/>
                      <parameter>
                        <valueString value="Organization?identifier="/>
                      </parameter>
                      <parameter>
                        <valueId value="ext"/>
                      </parameter>
                    </target>
                  </rule>
                </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>
                  <name value="r"/>
                  <source>
                    <context value="id"/>
                    <element value="root"/>
                    <variable value="r"/>
                  </source>
                  <rule>
                    <name value="org"/>
                    <source>
                      <context value="id"/>
                      <element value="extension"/>
                      <variable value="ext"/>
                    </source>
                    <target>
                      <context value="organization2"/>
                      <contextType value="variable"/>
                      <element value="id"/>
                      <variable value="uuid4"/>
                      <transform value="evaluate"/>
                      <parameter>
                        <valueString value="r + '-' + ext"/>
                      </parameter>
                    </target>
                    <target>
                      <context value="e10"/>
                      <contextType value="variable"/>
                      <element value="fullUrl"/>
                      <transform value="append"/>
                      <parameter>
                        <valueString value="https://example/Organization/"/>
                      </parameter>
                      <parameter>
                        <valueId value="uuid4"/>
                      </parameter>
                    </target>
                    <target>
                      <context value="organization1"/>
                      <contextType value="variable"/>
                      <element value="partOf"/>
                      <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/Organization/' + %organization2.id"/>
                      </parameter>
                    </target>
                  </rule>
                </rule>
              </rule>
              <rule>
                <name value="name"/>
                <source>
                  <context value="wholeOrgan"/>
                  <element value="name"/>
                  <variable value="v"/>
                </source>
                <target>
                  <context value="organization2"/>
                  <contextType value="variable"/>
                  <element value="name"/>
                  <transform value="evaluate"/>
                  <parameter>
                    <valueString value="v.other"/>
                  </parameter>
                </target>
              </rule>
              <rule>
                <name value="telecom"/>
                <source>
                  <context value="wholeOrgan"/>
                  <element value="telecom"/>
                  <variable value="vvv"/>
                </source>
                <target>
                  <context value="organization2"/>
                  <contextType value="variable"/>
                  <element value="telecom"/>
                  <variable value="vvv"/>
                  <transform value="create"/>
                </target>
              </rule>
              <rule>
                <name value="addr"/>
                <source>
                  <context value="wholeOrgan"/>
                  <element value="addr"/>
                  <variable value="vvv"/>
                </source>
                <target>
                  <context value="organization2"/>
                  <contextType value="variable"/>
                  <element value="address"/>
                  <variable value="vvv"/>
                  <transform value="create"/>
                </target>
              </rule>
            </rule>
          </rule>
          <documentation value="organization"/>
        </rule>
        <rule>
          <name value="Device"/>
          <source>
            <context value="assignedAuthor"/>
            <element value="assignedAuthoringDevice"/>
            <variable value="assignedAuthoringDevice"/>
          </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="device"/>
            <transform value="create"/>
            <parameter>
              <valueString value="Device"/>
            </parameter>
          </target>
          <target>
            <context value="device"/>
            <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/Device/"/>
            </parameter>
            <parameter>
              <valueId value="uuid11"/>
            </parameter>
          </target>
          <target>
            <context value="request"/>
            <contextType value="variable"/>
            <element value="url"/>
            <transform value="copy"/>
            <parameter>
              <valueString value="Device"/>
            </parameter>
          </target>
          <target>
            <context value="tgt"/>
            <contextType value="variable"/>
            <element value="author"/>
            <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/Device/' + %device.id"/>
            </parameter>
          </target>
          <rule>
            <name value="templateId"/>
            <source>
              <context value="assignedAuthoringDevice"/>
              <element value="templateId"/>
              <variable value="vvv"/>
            </source>
            <target>
              <context value="device"/>
              <contextType value="variable"/>
              <element value="identifier"/>
              <variable value="vvv"/>
              <transform value="create"/>
            </target>
          </rule>
          <rule>
            <name value="code"/>
            <source>
              <context value="assignedAuthoringDevice"/>
              <element value="code"/>
              <variable value="vvv"/>
            </source>
            <target>
              <context value="device"/>
              <contextType value="variable"/>
              <element value="type"/>
              <variable value="vvv"/>
              <transform value="create"/>
            </target>
          </rule>
          <rule>
            <name value="manufacturer"/>
            <source>
              <context value="assignedAuthoringDevice"/>
              <element value="manufacturerModelName"/>
              <variable value="manufacturerModelName"/>
            </source>
            <rule>
              <name value="displayRule"/>
              <source>
                <context value="manufacturerModelName"/>
                <variable value="m"/>
              </source>
              <target>
                <context value="device"/>
                <contextType value="variable"/>
                <element value="manufacturer"/>
                <transform value="evaluate"/>
                <parameter>
                  <valueString value="m.displayName"/>
                </parameter>
              </target>
            </rule>
          </rule>
          <rule>
            <name value="deviceName"/>
            <source>
              <context value="assignedAuthoringDevice"/>
              <element value="softwareName"/>
              <variable value="softwareName"/>
            </source>
            <target>
              <context value="device"/>
              <contextType value="variable"/>
              <element value="deviceName"/>
              <variable value="deviceName"/>
            </target>
            <rule>
              <name value="typeName"/>
              <source>
                <context value="softwareName"/>
              </source>
              <target>
                <context value="deviceName"/>
                <contextType value="variable"/>
                <element value="type"/>
                <transform value="copy"/>
                <parameter>
                  <valueString value="other"/>
                </parameter>
              </target>
            </rule>
            <rule>
              <name value="name"/>
              <source>
                <context value="softwareName"/>
                <variable value="s"/>
              </source>
              <target>
                <context value="deviceName"/>
                <contextType value="variable"/>
                <element value="name"/>
                <transform value="evaluate"/>
                <parameter>
                  <valueString value="s.displayName"/>
                </parameter>
              </target>
            </rule>
          </rule>
          <documentation value="device"/>
        </rule>
      </rule>
      <documentation value="author"/>
    </rule>
    <rule>
      <name value="participantEncounter"/>
      <source>
        <context value="obs"/>
        <element value="participant"/>
        <variable value="participant"/>
        <condition value="(typeCode != 'DEV')"/>
      </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>
        <name value="fhirParticipant"/>
        <source>
          <context value="participant"/>
        </source>
        <target>
          <context value="encounter"/>
          <contextType value="variable"/>
          <element value="participant"/>
          <variable value="FhirParticipant"/>
        </target>
        <rule>
          <name value="type"/>
          <source>
            <context value="participant"/>
            <variable value="p"/>
          </source>
          <target>
            <context value="FhirParticipant"/>
            <contextType value="variable"/>
            <element value="type"/>
            <variable value="type"/>
          </target>
          <rule>
            <name value="codeType"/>
            <source>
              <context value="p"/>
            </source>
            <target>
              <context value="type"/>
              <contextType value="variable"/>
              <element value="coding"/>
              <variable value="coding"/>
            </target>
            <rule>
              <name value="codice"/>
              <source>
                <context value="p"/>
              </source>
              <target>
                <context value="coding"/>
                <contextType value="variable"/>
                <element value="code"/>
                <transform value="evaluate"/>
                <parameter>
                  <valueString value="p.typeCode"/>
                </parameter>
              </target>
            </rule>
            <rule>
              <name value="system"/>
              <source>
                <context value="p"/>
              </source>
              <target>
                <context value="coding"/>
                <contextType value="variable"/>
                <element value="system"/>
                <transform value="copy"/>
                <parameter>
                  <valueString
                               value="http://terminology.hl7.org/CodeSystem/v3-ParticipationType"/>
                </parameter>
              </target>
            </rule>
          </rule>
        </rule>
      </rule>
      <rule>
        <name value="partRole"/>
        <source>
          <context value="participant"/>
          <element value="participantRole"/>
          <variable value="participantRole"/>
        </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="practitionerRole"/>
          <transform value="create"/>
          <parameter>
            <valueString value="PractitionerRole"/>
          </parameter>
        </target>
        <target>
          <context value="practitionerRole"/>
          <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/PractitionerRole/"/>
          </parameter>
          <parameter>
            <valueId value="uuid12"/>
          </parameter>
        </target>
        <target>
          <context value="request"/>
          <contextType value="variable"/>
          <element value="url"/>
          <transform value="copy"/>
          <parameter>
            <valueString value="PractitionerRole"/>
          </parameter>
        </target>
        <target>
          <context value="encounter"/>
          <contextType value="variable"/>
          <element value="participant"/>
          <variable value="participant1"/>
          <transform value="create"/>
          <parameter>
            <valueString value="BackboneElement"/>
          </parameter>
        </target>
        <target>
          <context value="participant1"/>
          <contextType value="variable"/>
          <element value="individual"/>
          <variable value="referencepart"/>
          <transform value="create"/>
          <parameter>
            <valueString value="Reference"/>
          </parameter>
        </target>
        <target>
          <context value="referencepart"/>
          <contextType value="variable"/>
          <element value="reference"/>
          <transform value="evaluate"/>
          <parameter>
            <valueString
                         value="'https://example/Practitioner/' + %practitionerRole.id"/>
          </parameter>
        </target>
        <rule>
          <name value="time"/>
          <source>
            <context value="participant"/>
            <element value="time"/>
            <variable value="time1"/>
          </source>
          <target>
            <context value="participant1"/>
            <contextType value="variable"/>
            <element value="period"/>
            <variable value="period"/>
            <transform value="create"/>
            <parameter>
              <valueString value="Period"/>
            </parameter>
          </target>
          <rule>
            <name value="val"/>
            <source>
              <context value="time1"/>
            </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="time1"/>
              <variable value="start"/>
            </dependent>
          </rule>
          <documentation value="participant.time -&gt; participant1.period;"/>
        </rule>
        <rule>
          <name value="time"/>
          <source>
            <context value="participant"/>
            <element value="time"/>
            <variable value="time1"/>
          </source>
          <target>
            <context value="participant1"/>
            <contextType value="variable"/>
            <element value="period"/>
            <variable value="period"/>
            <transform value="create"/>
            <parameter>
              <valueString value="Period"/>
            </parameter>
          </target>
          <dependent>
            <name value="IVLTSPeriod"/>
            <variable value="time1"/>
            <variable value="period"/>
          </dependent>
        </rule>
        <rule>
          <name value="functionCode"/>
          <source>
            <context value="participant"/>
            <element value="functionCode"/>
            <variable value="vvv"/>
          </source>
          <target>
            <context value="practitionerRole"/>
            <contextType value="variable"/>
            <element value="code"/>
            <variable value="vvv"/>
            <transform value="create"/>
          </target>
        </rule>
        <rule>
          <name value="practitioner"/>
          <source>
            <context value="participantRole"/>
          </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="PUT"/>
            </parameter>
          </target>
          <target>
            <context value="e13"/>
            <contextType value="variable"/>
            <element value="resource"/>
            <variable value="practitioner"/>
            <transform value="create"/>
            <parameter>
              <valueString value="Practitioner"/>
            </parameter>
          </target>
          <rule>
            <name value="meta"/>
            <source>
              <context value="participantRole"/>
            </source>
            <target>
              <context value="practitioner"/>
              <contextType value="variable"/>
              <element value="meta"/>
              <variable value="meta"/>
            </target>
            <rule>
              <name value="coding"/>
              <source>
                <context value="participantRole"/>
              </source>
              <target>
                <context value="meta"/>
                <contextType value="variable"/>
                <element value="tag"/>
                <variable value="coding"/>
                <transform value="create"/>
                <parameter>
                  <valueString value="Coding"/>
                </parameter>
              </target>
              <rule>
                <name value="system"/>
                <source>
                  <context value="participantRole"/>
                </source>
                <target>
                  <context value="coding"/>
                  <contextType value="variable"/>
                  <element value="system"/>
                  <transform value="copy"/>
                  <parameter>
                    <valueString value="http://algoritmodiscoring"/>
                  </parameter>
                </target>
              </rule>
              <rule>
                <name value="code"/>
                <source>
                  <context value="participantRole"/>
                </source>
                <target>
                  <context value="coding"/>
                  <contextType value="variable"/>
                  <element value="code"/>
                  <transform value="copy"/>
                  <parameter>
                    <valueString
                                 value="ClinicalDocument/body/observation/participant"/>
                  </parameter>
                </target>
              </rule>
            </rule>
          </rule>
          <rule>
            <name value="identifier"/>
            <source>
              <context value="participantRole"/>
              <element value="id"/>
              <variable value="id"/>
            </source>
            <target>
              <context value="practitioner"/>
              <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="ext"/>
              <source>
                <context value="id"/>
                <element value="extension"/>
                <variable value="ext"/>
              </source>
              <target>
                <context value="identifier"/>
                <contextType value="variable"/>
                <element value="value"/>
                <transform value="copy"/>
                <parameter>
                  <valueId value="ext"/>
                </parameter>
              </target>
              <rule>
                <name value="UUID"/>
                <source>
                  <context value="participantRole"/>
                </source>
                <target>
                  <context value="request"/>
                  <contextType value="variable"/>
                  <element value="url"/>
                  <transform value="append"/>
                  <parameter>
                    <valueString value="Practitioner?identifier="/>
                  </parameter>
                  <parameter>
                    <valueId value="ext"/>
                  </parameter>
                </target>
              </rule>
            </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>
              <name value="r"/>
              <source>
                <context value="id"/>
                <element value="root"/>
                <variable value="r"/>
              </source>
              <rule>
                <name value="org"/>
                <source>
                  <context value="id"/>
                  <element value="extension"/>
                  <variable value="ext"/>
                </source>
                <target>
                  <context value="practitioner"/>
                  <contextType value="variable"/>
                  <element value="id"/>
                  <variable value="uuid4"/>
                  <transform value="evaluate"/>
                  <parameter>
                    <valueString value="r + '-' + ext"/>
                  </parameter>
                </target>
                <target>
                  <context value="e13"/>
                  <contextType value="variable"/>
                  <element value="fullUrl"/>
                  <transform value="append"/>
                  <parameter>
                    <valueString value="https://example/Practitioner/"/>
                  </parameter>
                  <parameter>
                    <valueId value="uuid4"/>
                  </parameter>
                </target>
                <target>
                  <context value="practitionerRole"/>
                  <contextType value="variable"/>
                  <element value="practitioner"/>
                  <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/Practitioner/' + %practitioner.id"/>
                  </parameter>
                </target>
              </rule>
            </rule>
          </rule>
          <rule>
            <name value="code"/>
            <source>
              <context value="participantRole"/>
              <element value="code"/>
              <variable value="vvv"/>
            </source>
            <target>
              <context value="practitionerRole"/>
              <contextType value="variable"/>
              <element value="code"/>
              <variable value="vvv"/>
              <transform value="create"/>
            </target>
          </rule>
          <rule>
            <name value="addr"/>
            <source>
              <context value="participantRole"/>
              <element value="addr"/>
              <variable value="vvv"/>
            </source>
            <target>
              <context value="practitioner"/>
              <contextType value="variable"/>
              <element value="address"/>
              <variable value="vvv"/>
              <transform value="create"/>
            </target>
          </rule>
          <rule>
            <name value="telecom"/>
            <source>
              <context value="participantRole"/>
              <element value="telecom"/>
              <variable value="vvv"/>
            </source>
            <target>
              <context value="practitioner"/>
              <contextType value="variable"/>
              <element value="telecom"/>
              <variable value="vvv"/>
              <transform value="create"/>
            </target>
          </rule>
          <rule>
            <name value="name"/>
            <source>
              <context value="participantRole"/>
              <element value="playingEntity"/>
              <variable value="playingEntity"/>
            </source>
            <rule>
              <name value="name"/>
              <source>
                <context value="playingEntity"/>
                <element value="name"/>
                <variable value="vvv"/>
              </source>
              <target>
                <context value="practitioner"/>
                <contextType value="variable"/>
                <element value="name"/>
                <variable value="vvv"/>
                <transform value="create"/>
              </target>
            </rule>
            <rule>
              <name value="birth"/>
              <source>
                <context value="playingEntity"/>
                <element value="birthTime"/>
                <variable value="birthTime"/>
              </source>
              <rule>
                <name value="value"/>
                <source>
                  <context value="birthTime"/>
                  <element value="value"/>
                  <variable value="date"/>
                </source>
                <target>
                  <context value="practitioner"/>
                  <contextType value="variable"/>
                  <element value="birthDate"/>
                  <transform value="truncate"/>
                  <parameter>
                    <valueId value="date"/>
                  </parameter>
                  <parameter>
                    <valueInteger value="10"/>
                  </parameter>
                </target>
              </rule>
            </rule>
          </rule>
          <documentation value="non mappa i 2 precedenti"/>
        </rule>
      </rule>
      <documentation value="participant person"/>
    </rule>
    <rule>
      <name value="devParticipant"/>
      <source>
        <context value="obs"/>
        <element value="participant"/>
        <variable value="devParticipant"/>
        <condition value="(typeCode = 'DEV')"/>
      </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="device"/>
        <transform value="create"/>
        <parameter>
          <valueString value="Device"/>
        </parameter>
      </target>
      <target>
        <context value="device"/>
        <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/Device/"/>
        </parameter>
        <parameter>
          <valueId value="uuid14"/>
        </parameter>
      </target>
      <target>
        <context value="request"/>
        <contextType value="variable"/>
        <element value="url"/>
        <transform value="copy"/>
        <parameter>
          <valueString value="Device"/>
        </parameter>
      </target>
      <target>
        <context value="ob"/>
        <contextType value="variable"/>
        <element value="device"/>
        <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/Device/' + %device.id"/>
        </parameter>
      </target>
      <rule>
        <name value="participantRoleDev"/>
        <source>
          <context value="devParticipant"/>
          <element value="participantRole"/>
          <variable value="participantRoleDev"/>
        </source>
        <rule>
          <name value="playingDevice"/>
          <source>
            <context value="participantRoleDev"/>
            <element value="playingDevice"/>
            <variable value="playingDevice"/>
          </source>
          <rule>
            <name value="code"/>
            <source>
              <context value="playingDevice"/>
              <element value="code"/>
              <variable value="vvv"/>
            </source>
            <target>
              <context value="device"/>
              <contextType value="variable"/>
              <element value="type"/>
              <variable value="vvv"/>
              <transform value="create"/>
            </target>
          </rule>
          <rule>
            <name value="manufacturer"/>
            <source>
              <context value="playingDevice"/>
              <element value="manufacturerModelName"/>
              <variable value="manufacturerModelName"/>
            </source>
            <rule>
              <name value="displayRule"/>
              <source>
                <context value="manufacturerModelName"/>
                <variable value="m"/>
              </source>
              <target>
                <context value="device"/>
                <contextType value="variable"/>
                <element value="manufacturer"/>
                <transform value="evaluate"/>
                <parameter>
                  <valueString value="m.displayName"/>
                </parameter>
              </target>
            </rule>
          </rule>
          <rule>
            <name value="deviceName"/>
            <source>
              <context value="playingDevice"/>
              <element value="softwareName"/>
              <variable value="softwareName"/>
            </source>
            <target>
              <context value="device"/>
              <contextType value="variable"/>
              <element value="deviceName"/>
              <variable value="deviceName"/>
            </target>
            <rule>
              <name value="typeName"/>
              <source>
                <context value="softwareName"/>
              </source>
              <target>
                <context value="deviceName"/>
                <contextType value="variable"/>
                <element value="type"/>
                <transform value="copy"/>
                <parameter>
                  <valueString value="other"/>
                </parameter>
              </target>
            </rule>
            <rule>
              <name value="name"/>
              <source>
                <context value="softwareName"/>
                <variable value="s"/>
              </source>
              <target>
                <context value="deviceName"/>
                <contextType value="variable"/>
                <element value="name"/>
                <transform value="evaluate"/>
                <parameter>
                  <valueString value="s.displayName"/>
                </parameter>
              </target>
            </rule>
          </rule>
        </rule>
      </rule>
      <documentation value="participant device"/>
    </rule>
    <rule>
      <name value="observationMedia"/>
      <source>
        <context value="obs"/>
        <element value="entryRelationship"/>
        <variable value="er"/>
      </source>
      <rule>
        <name value="media"/>
        <source>
          <context value="er"/>
          <element value="observationMedia"/>
          <variable value="obsMedia"/>
        </source>
        <target>
          <context value="bundle"/>
          <contextType value="variable"/>
          <element value="entry"/>
          <variable value="e15"/>
        </target>
        <target>
          <context value="e15"/>
          <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="e15"/>
          <contextType value="variable"/>
          <element value="resource"/>
          <variable value="media1"/>
          <transform value="create"/>
          <parameter>
            <valueString value="Media"/>
          </parameter>
        </target>
        <target>
          <context value="media1"/>
          <contextType value="variable"/>
          <element value="id"/>
          <variable value="uuid15"/>
          <transform value="uuid"/>
        </target>
        <target>
          <context value="e15"/>
          <contextType value="variable"/>
          <element value="fullUrl"/>
          <transform value="append"/>
          <parameter>
            <valueString value="https://example/Media/"/>
          </parameter>
          <parameter>
            <valueId value="uuid15"/>
          </parameter>
        </target>
        <target>
          <context value="request"/>
          <contextType value="variable"/>
          <element value="url"/>
          <transform value="copy"/>
          <parameter>
            <valueString value="Media"/>
          </parameter>
        </target>
        <target>
          <context value="ob"/>
          <contextType value="variable"/>
          <element value="derivedFrom"/>
          <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/Media/' + %media1.id"/>
          </parameter>
        </target>
        <rule>
          <name value="Attachment"/>
          <source>
            <context value="obsMedia"/>
          </source>
          <target>
            <context value="media1"/>
            <contextType value="variable"/>
            <element value="content"/>
            <variable value="Attachment"/>
            <transform value="create"/>
            <parameter>
              <valueString value="Attachment"/>
            </parameter>
          </target>
          <rule>
            <name value="status"/>
            <source>
              <context value="obsMedia"/>
            </source>
            <target>
              <context value="media1"/>
              <contextType value="variable"/>
              <element value="status"/>
              <transform value="copy"/>
              <parameter>
                <valueString value="unknown"/>
              </parameter>
            </target>
          </rule>
          <rule>
            <name value="valuemedia"/>
            <source>
              <context value="obsMedia"/>
              <element value="value"/>
              <variable value="valueMedia"/>
            </source>
            <rule>
              <name value="type"/>
              <source>
                <context value="valueMedia"/>
                <element value="mediaType"/>
                <variable value="type"/>
              </source>
              <target>
                <context value="Attachment"/>
                <contextType value="variable"/>
                <element value="contentType"/>
                <transform value="copy"/>
                <parameter>
                  <valueId value="type"/>
                </parameter>
              </target>
            </rule>
            <rule>
              <name value="data"/>
              <source>
                <context value="valueMedia"/>
              </source>
              <target>
                <context value="Attachment"/>
                <contextType value="variable"/>
                <element value="data"/>
                <transform value="evaluate"/>
                <parameter>
                  <valueString value="valueMedia.dataBase64Binary"/>
                </parameter>
              </target>
            </rule>
          </rule>
        </rule>
      </rule>
      <documentation value="observationMedia"/>
    </rule>
    <rule>
      <name value="ref"/>
      <source>
        <context value="obs"/>
        <element value="referenceRange"/>
        <variable value="refRange"/>
      </source>
      <target>
        <context value="ob"/>
        <contextType value="variable"/>
        <element value="referenceRange"/>
        <variable value="ref"/>
        <transform value="create"/>
        <parameter>
          <valueString value="BackboneElement"/>
        </parameter>
      </target>
      <rule>
        <name value="refRange"/>
        <source>
          <context value="refRange"/>
          <element value="observationRange"/>
          <variable value="obsRange"/>
        </source>
        <rule>
          <name value="value"/>
          <source>
            <context value="obsRange"/>
            <type value="ST"/>
            <element value="value"/>
            <variable value="value"/>
          </source>
          <target>
            <context value="ref"/>
            <contextType value="variable"/>
            <element value="text"/>
            <transform value="create"/>
            <parameter>
              <valueString value="string"/>
            </parameter>
          </target>
          <target>
            <context value="ref"/>
            <contextType value="variable"/>
            <element value="text"/>
            <transform value="evaluate"/>
            <parameter>
              <valueString value="value.dataString"/>
            </parameter>
          </target>
        </rule>
        <rule>
          <name value="obsRange"/>
          <source>
            <context value="obsRange"/>
          </source>
          <target>
            <context value="ref"/>
            <contextType value="variable"/>
            <element value="low"/>
            <variable value="Low"/>
            <transform value="create"/>
            <parameter>
              <valueString value="Quantity"/>
            </parameter>
          </target>
          <rule>
            <name value="IVLPQ"/>
            <source>
              <context value="obsRange"/>
              <type value="IVL_PQ"/>
              <element value="value"/>
              <variable value="v"/>
            </source>
            <rule>
              <name value="decValue"/>
              <source>
                <context value="v"/>
                <element value="low"/>
                <variable value="l1"/>
              </source>
              <rule>
                <name value="value"/>
                <source>
                  <context value="l1"/>
                  <element value="value"/>
                  <variable value="decValue"/>
                </source>
                <target>
                  <context value="Low"/>
                  <contextType value="variable"/>
                  <element value="value"/>
                  <transform value="copy"/>
                  <parameter>
                    <valueId value="decValue"/>
                  </parameter>
                </target>
              </rule>
              <rule>
                <name value="unit"/>
                <source>
                  <context value="l1"/>
                  <element value="unit"/>
                  <variable value="Unit"/>
                </source>
                <target>
                  <context value="Low"/>
                  <contextType value="variable"/>
                  <element value="unit"/>
                  <transform value="copy"/>
                  <parameter>
                    <valueId value="Unit"/>
                  </parameter>
                </target>
              </rule>
            </rule>
            <rule>
              <name value="high"/>
              <source>
                <context value="v"/>
              </source>
              <target>
                <context value="ref"/>
                <contextType value="variable"/>
                <element value="high"/>
                <variable value="high"/>
                <transform value="create"/>
                <parameter>
                  <valueString value="Quantity"/>
                </parameter>
              </target>
              <rule>
                <name value="decValue"/>
                <source>
                  <context value="v"/>
                  <element value="high"/>
                  <variable value="h1"/>
                </source>
                <rule>
                  <name value="value"/>
                  <source>
                    <context value="h1"/>
                    <element value="value"/>
                    <variable value="decValue1"/>
                  </source>
                  <target>
                    <context value="high"/>
                    <contextType value="variable"/>
                    <element value="value"/>
                    <transform value="copy"/>
                    <parameter>
                      <valueId value="decValue1"/>
                    </parameter>
                  </target>
                </rule>
                <rule>
                  <name value="unit"/>
                  <source>
                    <context value="h1"/>
                    <element value="unit"/>
                    <variable value="Unit1"/>
                  </source>
                  <target>
                    <context value="high"/>
                    <contextType value="variable"/>
                    <element value="unit"/>
                    <transform value="copy"/>
                    <parameter>
                      <valueId value="Unit1"/>
                    </parameter>
                  </target>
                </rule>
              </rule>
            </rule>
          </rule>
          <rule>
            <name value="interpretationCode"/>
            <source>
              <context value="obsRange"/>
              <element value="interpretationCode"/>
              <variable value="vvv"/>
            </source>
            <target>
              <context value="ref"/>
              <contextType value="variable"/>
              <element value="type"/>
              <variable value="vvv"/>
              <transform value="create"/>
            </target>
          </rule>
          <rule>
            <name value="precondition"/>
            <source>
              <context value="obsRange"/>
              <element value="precondition"/>
              <variable value="precondition"/>
            </source>
            <rule>
              <name value="criterion"/>
              <source>
                <context value="precondition"/>
                <element value="criterion"/>
                <variable value="criterion"/>
              </source>
              <rule>
                <name value="appliesTo"/>
                <source>
                  <context value="criterion"/>
                  <element value="code"/>
                  <variable value="vvv"/>
                </source>
                <target>
                  <context value="ref"/>
                  <contextType value="variable"/>
                  <element value="appliesTo"/>
                  <variable value="vvv"/>
                  <transform value="create"/>
                </target>
              </rule>
              <rule>
                <name value="v"/>
                <source>
                  <context value="criterion"/>
                  <type value="IVL_PQ"/>
                  <element value="value"/>
                  <variable value="v"/>
                </source>
                <rule>
                  <name value="low"/>
                  <source>
                    <context value="v"/>
                    <element value="high"/>
                    <variable value="l1"/>
                  </source>
                  <rule>
                    <name value="age"/>
                    <source>
                      <context value="l1"/>
                    </source>
                    <target>
                      <context value="ref"/>
                      <contextType value="variable"/>
                      <element value="age"/>
                      <variable value="age"/>
                      <transform value="create"/>
                      <parameter>
                        <valueString value="Quantity"/>
                      </parameter>
                    </target>
                    <rule>
                      <name value="high"/>
                      <source>
                        <context value="l1"/>
                      </source>
                      <target>
                        <context value="age"/>
                        <contextType value="variable"/>
                        <element value="high"/>
                        <variable value="high"/>
                      </target>
                      <rule>
                        <name value="value"/>
                        <source>
                          <context value="l1"/>
                          <element value="value"/>
                          <variable value="decValue"/>
                        </source>
                        <target>
                          <context value="high"/>
                          <contextType value="variable"/>
                          <element value="value"/>
                          <transform value="copy"/>
                          <parameter>
                            <valueId value="decValue"/>
                          </parameter>
                        </target>
                      </rule>
                      <rule>
                        <name value="unit"/>
                        <source>
                          <context value="l1"/>
                          <element value="unit"/>
                          <variable value="Unit1"/>
                        </source>
                        <target>
                          <context value="high"/>
                          <contextType value="variable"/>
                          <element value="unit"/>
                          <transform value="copy"/>
                          <parameter>
                            <valueId value="Unit1"/>
                          </parameter>
                        </target>
                      </rule>
                    </rule>
                  </rule>
                </rule>
              </rule>
            </rule>
          </rule>
        </rule>
      </rule>
      <documentation value="referenceRange"/>
    </rule>
  </group>
  <group>
    <name value="Act"/>
    <typeMode value="none"/>
    <input>
      <name value="cda"/>
      <type value="Act"/>
      <mode value="source"/>
    </input>
    <input>
      <name value="pat"/>
      <type value="Patient"/>
      <mode value="target"/>
    </input>
    <input>
      <name value="ac"/>
      <type value="DiagnosticReport"/>
      <mode value="target"/>
    </input>
    <input>
      <name value="enc"/>
      <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="cda"/>
        <element value="code"/>
        <variable value="vvv"/>
      </source>
      <target>
        <context value="ac"/>
        <contextType value="variable"/>
        <element value="code"/>
        <variable value="vvv"/>
        <transform value="create"/>
      </target>
    </rule>
    <rule>
      <name value="status"/>
      <source>
        <context value="cda"/>
        <condition value="cda.statusCode.exists().not()"/>
      </source>
      <rule>
        <name value="statuscode"/>
        <source>
          <context value="cda"/>
        </source>
        <target>
          <context value="ac"/>
          <contextType value="variable"/>
          <element value="status"/>
          <transform value="copy"/>
          <parameter>
            <valueString value="final"/>
          </parameter>
        </target>
      </rule>
    </rule>
    <rule>
      <name value="statusCode"/>
      <source>
        <context value="cda"/>
        <element value="statusCode"/>
        <variable value="statusc"/>
        <condition value="(code = 'completed')"/>
      </source>
      <target>
        <context value="ac"/>
        <contextType value="variable"/>
        <element value="status"/>
        <transform value="copy"/>
        <parameter>
          <valueString value="final"/>
        </parameter>
      </target>
    </rule>
    <rule>
      <name value="statusCode"/>
      <source>
        <context value="cda"/>
        <element value="statusCode"/>
        <variable value="statusc"/>
        <condition value="(code = 'active')"/>
      </source>
      <target>
        <context value="ac"/>
        <contextType value="variable"/>
        <element value="status"/>
        <transform value="copy"/>
        <parameter>
          <valueString value="registered"/>
        </parameter>
      </target>
    </rule>
    <rule>
      <name value="statusCode"/>
      <source>
        <context value="cda"/>
        <element value="statusCode"/>
        <variable value="statusc"/>
        <condition value="(code = 'aborted')"/>
      </source>
      <target>
        <context value="ac"/>
        <contextType value="variable"/>
        <element value="status"/>
        <transform value="copy"/>
        <parameter>
          <valueString value="cancelled"/>
        </parameter>
      </target>
    </rule>
    <rule>
      <name value="statusCode"/>
      <source>
        <context value="cda"/>
        <element value="statusCode"/>
        <variable value="statusc"/>
        <condition value="(code = 'suspended')"/>
      </source>
      <target>
        <context value="ac"/>
        <contextType value="variable"/>
        <element value="status"/>
        <transform value="copy"/>
        <parameter>
          <valueString value="partial"/>
        </parameter>
      </target>
    </rule>
    <rule>
      <name value="value3"/>
      <source>
        <context value="cda"/>
        <element value="effectiveTime"/>
        <variable value="effectiveTime"/>
      </source>
      <target>
        <context value="ac"/>
        <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"/>
        <condition
                   value="effectiveTime.low.exists() or effectiveTime.high.exists()"/>
      </source>
      <rule>
        <name value="effectiveTime"/>
        <source>
          <context value="cda"/>
          <element value="effectiveTime"/>
          <variable value="eff"/>
        </source>
        <target>
          <context value="ac"/>
          <contextType value="variable"/>
          <element value="effective"/>
          <variable value="period"/>
          <transform value="create"/>
          <parameter>
            <valueString value="Period"/>
          </parameter>
        </target>
        <dependent>
          <name value="IVLTSPeriod"/>
          <variable value="eff"/>
          <variable value="period"/>
        </dependent>
      </rule>
    </rule>
    <rule>
      <name value="reference"/>
      <source>
        <context value="cda"/>
      </source>
      <target>
        <context value="ac"/>
        <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/' + %pat.id"/>
        </parameter>
      </target>
    </rule>
    <rule>
      <name value="reference"/>
      <source>
        <context value="cda"/>
      </source>
      <target>
        <context value="ac"/>
        <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/' + %enc.id"/>
        </parameter>
      </target>
    </rule>
    <rule>
      <name value="exist"/>
      <source>
        <context value="cda"/>
        <condition value="cda.specimen.exists()"/>
      </source>
      <rule>
        <name value="specimen"/>
        <source>
          <context value="cda"/>
          <element value="specimen"/>
          <variable value="src"/>
        </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="specimen"/>
          <transform value="create"/>
          <parameter>
            <valueString value="Specimen"/>
          </parameter>
        </target>
        <target>
          <context value="specimen"/>
          <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/Specimen/"/>
          </parameter>
          <parameter>
            <valueId value="uuid4"/>
          </parameter>
        </target>
        <target>
          <context value="request"/>
          <contextType value="variable"/>
          <element value="url"/>
          <transform value="copy"/>
          <parameter>
            <valueString value="Specimen"/>
          </parameter>
        </target>
        <target>
          <context value="ac"/>
          <contextType value="variable"/>
          <element value="specimen"/>
          <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/Specimen/' + %specimen.id"/>
          </parameter>
        </target>
        <rule>
          <name value="SpecimenRole"/>
          <source>
            <context value="src"/>
            <element value="specimenRole"/>
            <variable value="specimenRole"/>
          </source>
          <rule>
            <name value="id"/>
            <source>
              <context value="specimenRole"/>
              <element value="id"/>
              <variable value="vvv"/>
            </source>
            <target>
              <context value="specimen"/>
              <contextType value="variable"/>
              <element value="identifier"/>
              <variable value="vvv"/>
              <transform value="create"/>
            </target>
          </rule>
          <rule>
            <name value="specimenPlayingEntity"/>
            <source>
              <context value="specimenRole"/>
              <element value="specimenPlayingEntity"/>
              <variable value="specimenPlayingEntity"/>
            </source>
            <rule>
              <name value="code"/>
              <source>
                <context value="specimenPlayingEntity"/>
                <element value="code"/>
                <variable value="vvv"/>
              </source>
              <target>
                <context value="specimen"/>
                <contextType value="variable"/>
                <element value="type"/>
                <variable value="vvv"/>
                <transform value="create"/>
              </target>
            </rule>
          </rule>
        </rule>
        <rule>
          <name value="reference"/>
          <source>
            <context value="src"/>
          </source>
          <target>
            <context value="specimen"/>
            <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="entryRelationshipobservation"/>
          <source>
            <context value="cda"/>
            <element value="entryRelationship"/>
            <variable value="entryRelationship"/>
          </source>
          <rule>
            <name value="observation"/>
            <source>
              <context value="entryRelationship"/>
              <element value="observation"/>
              <variable value="observation"/>
            </source>
            <rule>
              <name value="obs"/>
              <source>
                <context value="observation"/>
              </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="obs"/>
                <transform value="create"/>
                <parameter>
                  <valueString value="Observation"/>
                </parameter>
              </target>
              <target>
                <context value="obs"/>
                <contextType value="variable"/>
                <element value="id"/>
                <variable value="uuid13"/>
                <transform value="uuid"/>
              </target>
              <target>
                <context value="e12"/>
                <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="ac"/>
                <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/' + %obs.id"/>
                </parameter>
              </target>
              <rule>
                <name value="ORG"/>
                <source>
                  <context value="observation"/>
                </source>
                <dependent>
                  <name value="Observation2"/>
                  <variable value="observation"/>
                  <variable value="pat"/>
                  <variable value="enc"/>
                  <variable value="obs"/>
                  <variable value="bundle"/>
                  <variable value="cda"/>
                  <variable value="specimen"/>
                </dependent>
              </rule>
              <rule>
                <name value="entryRelationshipprocedure"/>
                <source>
                  <context value="cda"/>
                  <element value="entryRelationship"/>
                  <variable value="entryRelationship1"/>
                </source>
                <rule>
                  <name value="procedure"/>
                  <source>
                    <context value="entryRelationship1"/>
                    <element value="procedure"/>
                    <variable value="proc"/>
                  </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="procedure"/>
                    <transform value="create"/>
                    <parameter>
                      <valueString value="Procedure"/>
                    </parameter>
                  </target>
                  <target>
                    <context value="procedure"/>
                    <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/Procedure/"/>
                    </parameter>
                    <parameter>
                      <valueId value="uuid5"/>
                    </parameter>
                  </target>
                  <target>
                    <context value="request"/>
                    <contextType value="variable"/>
                    <element value="url"/>
                    <transform value="copy"/>
                    <parameter>
                      <valueString value="Procedure"/>
                    </parameter>
                  </target>
                  <target>
                    <context value="obs"/>
                    <contextType value="variable"/>
                    <element value="partOf"/>
                    <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/Procedure/' + %procedure.id"/>
                    </parameter>
                  </target>
                  <rule>
                    <name value="reference"/>
                    <source>
                      <context value="proc"/>
                    </source>
                    <target>
                      <context value="procedure"/>
                      <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="proc"/>
                    </source>
                    <target>
                      <context value="procedure"/>
                      <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="proc"/>
                      <condition value="proc.statusCode.exists().not()"/>
                    </source>
                    <rule>
                      <name value="statuscode"/>
                      <source>
                        <context value="proc"/>
                      </source>
                      <target>
                        <context value="procedure"/>
                        <contextType value="variable"/>
                        <element value="status"/>
                        <transform value="copy"/>
                        <parameter>
                          <valueString value="unknown"/>
                        </parameter>
                      </target>
                    </rule>
                  </rule>
                  <rule>
                    <name value="statusCode"/>
                    <source>
                      <context value="proc"/>
                      <element value="statusCode"/>
                      <variable value="statusc"/>
                      <condition value="(code = 'completed')"/>
                    </source>
                    <target>
                      <context value="procedure"/>
                      <contextType value="variable"/>
                      <element value="status"/>
                      <transform value="copy"/>
                      <parameter>
                        <valueString value="completed"/>
                      </parameter>
                    </target>
                  </rule>
                  <rule>
                    <name value="statusCode"/>
                    <source>
                      <context value="proc"/>
                      <element value="statusCode"/>
                      <variable value="statusc"/>
                      <condition value="(code = 'active')"/>
                    </source>
                    <target>
                      <context value="procedure"/>
                      <contextType value="variable"/>
                      <element value="status"/>
                      <transform value="copy"/>
                      <parameter>
                        <valueString value="in-progress"/>
                      </parameter>
                    </target>
                  </rule>
                  <rule>
                    <name value="statusCode"/>
                    <source>
                      <context value="proc"/>
                      <element value="statusCode"/>
                      <variable value="statusc"/>
                      <condition value="(code = 'aborted')"/>
                    </source>
                    <target>
                      <context value="procedure"/>
                      <contextType value="variable"/>
                      <element value="status"/>
                      <transform value="copy"/>
                      <parameter>
                        <valueString value="stopped"/>
                      </parameter>
                    </target>
                  </rule>
                  <rule>
                    <name value="statusCode"/>
                    <source>
                      <context value="proc"/>
                      <element value="statusCode"/>
                      <variable value="statusc"/>
                      <condition value="(code = 'suspended')"/>
                    </source>
                    <target>
                      <context value="procedure"/>
                      <contextType value="variable"/>
                      <element value="status"/>
                      <transform value="copy"/>
                      <parameter>
                        <valueString value="on-hold"/>
                      </parameter>
                    </target>
                  </rule>
                  <rule>
                    <name value="statusCode"/>
                    <source>
                      <context value="proc"/>
                      <element value="statusCode"/>
                      <variable value="statusc"/>
                      <condition value="(code = 'cancelled')"/>
                    </source>
                    <target>
                      <context value="procedure"/>
                      <contextType value="variable"/>
                      <element value="status"/>
                      <transform value="copy"/>
                      <parameter>
                        <valueString value="not-done"/>
                      </parameter>
                    </target>
                  </rule>
                  <rule>
                    <name value="statusCode"/>
                    <source>
                      <context value="proc"/>
                      <element value="statusCode"/>
                      <variable value="statusc"/>
                      <condition value="(code = 'held')"/>
                    </source>
                    <target>
                      <context value="procedure"/>
                      <contextType value="variable"/>
                      <element value="status"/>
                      <transform value="copy"/>
                      <parameter>
                        <valueString value="on-hold"/>
                      </parameter>
                    </target>
                  </rule>
                  <rule>
                    <name value="statusCode"/>
                    <source>
                      <context value="proc"/>
                      <element value="statusCode"/>
                      <variable value="statusc"/>
                      <condition value="(code = 'new')"/>
                    </source>
                    <target>
                      <context value="procedure"/>
                      <contextType value="variable"/>
                      <element value="status"/>
                      <transform value="copy"/>
                      <parameter>
                        <valueString value="preparation"/>
                      </parameter>
                    </target>
                  </rule>
                  <rule>
                    <name value="statusCode"/>
                    <source>
                      <context value="proc"/>
                      <element value="statusCode"/>
                      <variable value="statusc"/>
                      <condition value="(code = 'obsolete')"/>
                    </source>
                    <target>
                      <context value="procedure"/>
                      <contextType value="variable"/>
                      <element value="status"/>
                      <transform value="copy"/>
                      <parameter>
                        <valueString value="entered-in-error"/>
                      </parameter>
                    </target>
                  </rule>
                  <rule>
                    <name value="statusCode"/>
                    <source>
                      <context value="proc"/>
                      <element value="statusCode"/>
                      <variable value="statusc"/>
                      <condition value="(code = 'nullified')"/>
                    </source>
                    <target>
                      <context value="procedure"/>
                      <contextType value="variable"/>
                      <element value="status"/>
                      <transform value="copy"/>
                      <parameter>
                        <valueString value="unknown"/>
                      </parameter>
                    </target>
                  </rule>
                  <rule>
                    <name value="datetime"/>
                    <source>
                      <context value="proc"/>
                      <element value="effectiveTime"/>
                      <variable value="effectiveTime"/>
                    </source>
                    <target>
                      <context value="procedure"/>
                      <contextType value="variable"/>
                      <element value="performed"/>
                      <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="proc"/>
                      <condition
                                 value="effectiveTime.low.exists() or effectiveTime.high.exists()"/>
                    </source>
                    <rule>
                      <name value="effectiveTime"/>
                      <source>
                        <context value="proc"/>
                        <element value="effectiveTime"/>
                        <variable value="eff"/>
                      </source>
                      <target>
                        <context value="procedure"/>
                        <contextType value="variable"/>
                        <element value="performed"/>
                        <variable value="period"/>
                        <transform value="create"/>
                        <parameter>
                          <valueString value="Period"/>
                        </parameter>
                      </target>
                      <dependent>
                        <name value="IVLTSPeriod"/>
                        <variable value="eff"/>
                        <variable value="period"/>
                      </dependent>
                    </rule>
                  </rule>
                  <rule>
                    <name value="targetSiteCode"/>
                    <source>
                      <context value="proc"/>
                      <element value="targetSiteCode"/>
                      <variable value="vvv"/>
                    </source>
                    <target>
                      <context value="procedure"/>
                      <contextType value="variable"/>
                      <element value="bodySite"/>
                      <variable value="vvv"/>
                      <transform value="create"/>
                    </target>
                  </rule>
                </rule>
                <documentation value="procedure"/>
              </rule>
            </rule>
          </rule>
          <rule>
            <name value="organizer"/>
            <source>
              <context value="entryRelationship"/>
              <element value="organizer"/>
              <variable value="organizer"/>
            </source>
            <rule>
              <name value="Organizer"/>
              <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="obs"/>
                <transform value="create"/>
                <parameter>
                  <valueString value="Observation"/>
                </parameter>
              </target>
              <target>
                <context value="obs"/>
                <contextType value="variable"/>
                <element value="id"/>
                <variable value="uuid13"/>
                <transform value="uuid"/>
              </target>
              <target>
                <context value="e12"/>
                <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="ac"/>
                <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/' + %obs.id"/>
                </parameter>
              </target>
              <rule>
                <name value="ORG"/>
                <source>
                  <context value="organizer"/>
                </source>
                <dependent>
                  <name value="Organizer"/>
                  <variable value="cda"/>
                  <variable value="organizer"/>
                  <variable value="pat"/>
                  <variable value="enc"/>
                  <variable value="obs"/>
                  <variable value="bundle"/>
                </dependent>
              </rule>
              <rule>
                <name value="entryRelationshiprocedure"/>
                <source>
                  <context value="cda"/>
                  <element value="entryRelationship"/>
                  <variable value="entryRelationship1"/>
                </source>
                <rule>
                  <name value="pbservation"/>
                  <source>
                    <context value="entryRelationship1"/>
                    <element value="procedure"/>
                    <variable value="proc"/>
                  </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="procedure"/>
                    <transform value="create"/>
                    <parameter>
                      <valueString value="Procedure"/>
                    </parameter>
                  </target>
                  <target>
                    <context value="procedure"/>
                    <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/Procedure/"/>
                    </parameter>
                    <parameter>
                      <valueId value="uuid5"/>
                    </parameter>
                  </target>
                  <target>
                    <context value="request"/>
                    <contextType value="variable"/>
                    <element value="url"/>
                    <transform value="copy"/>
                    <parameter>
                      <valueString value="Procedure"/>
                    </parameter>
                  </target>
                  <target>
                    <context value="obs"/>
                    <contextType value="variable"/>
                    <element value="partOf"/>
                    <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/Procedure/' + %procedure.id"/>
                    </parameter>
                  </target>
                  <rule>
                    <name value="reference"/>
                    <source>
                      <context value="proc"/>
                    </source>
                    <target>
                      <context value="procedure"/>
                      <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="proc"/>
                    </source>
                    <target>
                      <context value="procedure"/>
                      <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="proc"/>
                      <condition value="proc.statusCode.exists().not()"/>
                    </source>
                    <rule>
                      <name value="statuscode"/>
                      <source>
                        <context value="proc"/>
                      </source>
                      <target>
                        <context value="procedure"/>
                        <contextType value="variable"/>
                        <element value="status"/>
                        <transform value="copy"/>
                        <parameter>
                          <valueString value="unknown"/>
                        </parameter>
                      </target>
                    </rule>
                  </rule>
                  <rule>
                    <name value="statusCode"/>
                    <source>
                      <context value="proc"/>
                      <element value="statusCode"/>
                      <variable value="statusc"/>
                      <condition value="(code = 'completed')"/>
                    </source>
                    <target>
                      <context value="procedure"/>
                      <contextType value="variable"/>
                      <element value="status"/>
                      <transform value="copy"/>
                      <parameter>
                        <valueString value="completed"/>
                      </parameter>
                    </target>
                  </rule>
                  <rule>
                    <name value="statusCode"/>
                    <source>
                      <context value="proc"/>
                      <element value="statusCode"/>
                      <variable value="statusc"/>
                      <condition value="(code = 'active')"/>
                    </source>
                    <target>
                      <context value="procedure"/>
                      <contextType value="variable"/>
                      <element value="status"/>
                      <transform value="copy"/>
                      <parameter>
                        <valueString value="in-progress"/>
                      </parameter>
                    </target>
                  </rule>
                  <rule>
                    <name value="statusCode"/>
                    <source>
                      <context value="proc"/>
                      <element value="statusCode"/>
                      <variable value="statusc"/>
                      <condition value="(code = 'aborted')"/>
                    </source>
                    <target>
                      <context value="procedure"/>
                      <contextType value="variable"/>
                      <element value="status"/>
                      <transform value="copy"/>
                      <parameter>
                        <valueString value="stopped"/>
                      </parameter>
                    </target>
                  </rule>
                  <rule>
                    <name value="statusCode"/>
                    <source>
                      <context value="proc"/>
                      <element value="statusCode"/>
                      <variable value="statusc"/>
                      <condition value="(code = 'suspended')"/>
                    </source>
                    <target>
                      <context value="procedure"/>
                      <contextType value="variable"/>
                      <element value="status"/>
                      <transform value="copy"/>
                      <parameter>
                        <valueString value="on-hold"/>
                      </parameter>
                    </target>
                  </rule>
                  <rule>
                    <name value="statusCode"/>
                    <source>
                      <context value="proc"/>
                      <element value="statusCode"/>
                      <variable value="statusc"/>
                      <condition value="(code = 'cancelled')"/>
                    </source>
                    <target>
                      <context value="procedure"/>
                      <contextType value="variable"/>
                      <element value="status"/>
                      <transform value="copy"/>
                      <parameter>
                        <valueString value="not-done"/>
                      </parameter>
                    </target>
                  </rule>
                  <rule>
                    <name value="statusCode"/>
                    <source>
                      <context value="proc"/>
                      <element value="statusCode"/>
                      <variable value="statusc"/>
                      <condition value="(code = 'held')"/>
                    </source>
                    <target>
                      <context value="procedure"/>
                      <contextType value="variable"/>
                      <element value="status"/>
                      <transform value="copy"/>
                      <parameter>
                        <valueString value="on-hold"/>
                      </parameter>
                    </target>
                  </rule>
                  <rule>
                    <name value="statusCode"/>
                    <source>
                      <context value="proc"/>
                      <element value="statusCode"/>
                      <variable value="statusc"/>
                      <condition value="(code = 'new')"/>
                    </source>
                    <target>
                      <context value="procedure"/>
                      <contextType value="variable"/>
                      <element value="status"/>
                      <transform value="copy"/>
                      <parameter>
                        <valueString value="preparation"/>
                      </parameter>
                    </target>
                  </rule>
                  <rule>
                    <name value="statusCode"/>
                    <source>
                      <context value="proc"/>
                      <element value="statusCode"/>
                      <variable value="statusc"/>
                      <condition value="(code = 'obsolete')"/>
                    </source>
                    <target>
                      <context value="procedure"/>
                      <contextType value="variable"/>
                      <element value="status"/>
                      <transform value="copy"/>
                      <parameter>
                        <valueString value="entered-in-error"/>
                      </parameter>
                    </target>
                  </rule>
                  <rule>
                    <name value="statusCode"/>
                    <source>
                      <context value="proc"/>
                      <element value="statusCode"/>
                      <variable value="statusc"/>
                      <condition value="(code = 'nullified')"/>
                    </source>
                    <target>
                      <context value="procedure"/>
                      <contextType value="variable"/>
                      <element value="status"/>
                      <transform value="copy"/>
                      <parameter>
                        <valueString value="unknown"/>
                      </parameter>
                    </target>
                  </rule>
                  <rule>
                    <name value="datetime"/>
                    <source>
                      <context value="proc"/>
                      <element value="effectiveTime"/>
                      <variable value="effectiveTime"/>
                    </source>
                    <target>
                      <context value="procedure"/>
                      <contextType value="variable"/>
                      <element value="performed"/>
                      <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="proc"/>
                      <condition
                                 value="effectiveTime.low.exists() or effectiveTime.high.exists()"/>
                    </source>
                    <rule>
                      <name value="effectiveTime"/>
                      <source>
                        <context value="proc"/>
                        <element value="effectiveTime"/>
                        <variable value="eff"/>
                      </source>
                      <target>
                        <context value="procedure"/>
                        <contextType value="variable"/>
                        <element value="performed"/>
                        <variable value="period"/>
                        <transform value="create"/>
                        <parameter>
                          <valueString value="Period"/>
                        </parameter>
                      </target>
                      <dependent>
                        <name value="IVLTSPeriod"/>
                        <variable value="eff"/>
                        <variable value="period"/>
                      </dependent>
                    </rule>
                  </rule>
                  <rule>
                    <name value="targetSiteCode"/>
                    <source>
                      <context value="proc"/>
                      <element value="targetSiteCode"/>
                      <variable value="vvv"/>
                    </source>
                    <target>
                      <context value="procedure"/>
                      <contextType value="variable"/>
                      <element value="bodySite"/>
                      <variable value="vvv"/>
                      <transform value="create"/>
                    </target>
                  </rule>
                </rule>
                <documentation value="procedure"/>
              </rule>
            </rule>
          </rule>
        </rule>
      </rule>
      <documentation value="specimen"/>
    </rule>
    <rule>
      <name value="existnot"/>
      <source>
        <context value="cda"/>
        <condition value="cda.specimen.exists().not()"/>
      </source>
      <rule>
        <name value="entryRelationshipobservation"/>
        <source>
          <context value="cda"/>
          <element value="entryRelationship"/>
          <variable value="entryRelationship"/>
        </source>
        <rule>
          <name value="observation"/>
          <source>
            <context value="entryRelationship"/>
            <element value="observation"/>
            <variable value="observation"/>
          </source>
          <rule>
            <name value="obs"/>
            <source>
              <context value="observation"/>
            </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="obs"/>
              <transform value="create"/>
              <parameter>
                <valueString value="Observation"/>
              </parameter>
            </target>
            <target>
              <context value="obs"/>
              <contextType value="variable"/>
              <element value="id"/>
              <variable value="uuid13"/>
              <transform value="uuid"/>
            </target>
            <target>
              <context value="e12"/>
              <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="ac"/>
              <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/' + %obs.id"/>
              </parameter>
            </target>
            <rule>
              <name value="ORG"/>
              <source>
                <context value="observation"/>
              </source>
              <dependent>
                <name value="Observation3"/>
                <variable value="observation"/>
                <variable value="pat"/>
                <variable value="enc"/>
                <variable value="obs"/>
                <variable value="bundle"/>
                <variable value="cda"/>
              </dependent>
            </rule>
            <rule>
              <name value="entryRelationshipprocedure"/>
              <source>
                <context value="cda"/>
                <element value="entryRelationship"/>
                <variable value="entryRelationship1"/>
              </source>
              <rule>
                <name value="procedure"/>
                <source>
                  <context value="entryRelationship1"/>
                  <element value="procedure"/>
                  <variable value="proc"/>
                </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="procedure"/>
                  <transform value="create"/>
                  <parameter>
                    <valueString value="Procedure"/>
                  </parameter>
                </target>
                <target>
                  <context value="procedure"/>
                  <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/Procedure/"/>
                  </parameter>
                  <parameter>
                    <valueId value="uuid5"/>
                  </parameter>
                </target>
                <target>
                  <context value="request"/>
                  <contextType value="variable"/>
                  <element value="url"/>
                  <transform value="copy"/>
                  <parameter>
                    <valueString value="Procedure"/>
                  </parameter>
                </target>
                <target>
                  <context value="obs"/>
                  <contextType value="variable"/>
                  <element value="partOf"/>
                  <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/Procedure/' + %procedure.id"/>
                  </parameter>
                </target>
                <rule>
                  <name value="reference"/>
                  <source>
                    <context value="proc"/>
                  </source>
                  <target>
                    <context value="procedure"/>
                    <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="proc"/>
                  </source>
                  <target>
                    <context value="procedure"/>
                    <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="proc"/>
                    <condition value="proc.statusCode.exists().not()"/>
                  </source>
                  <rule>
                    <name value="statuscode"/>
                    <source>
                      <context value="proc"/>
                    </source>
                    <target>
                      <context value="procedure"/>
                      <contextType value="variable"/>
                      <element value="status"/>
                      <transform value="copy"/>
                      <parameter>
                        <valueString value="unknown"/>
                      </parameter>
                    </target>
                  </rule>
                </rule>
                <rule>
                  <name value="statusCode"/>
                  <source>
                    <context value="proc"/>
                    <element value="statusCode"/>
                    <variable value="statusc"/>
                    <condition value="(code = 'completed')"/>
                  </source>
                  <target>
                    <context value="procedure"/>
                    <contextType value="variable"/>
                    <element value="status"/>
                    <transform value="copy"/>
                    <parameter>
                      <valueString value="completed"/>
                    </parameter>
                  </target>
                </rule>
                <rule>
                  <name value="statusCode"/>
                  <source>
                    <context value="proc"/>
                    <element value="statusCode"/>
                    <variable value="statusc"/>
                    <condition value="(code = 'active')"/>
                  </source>
                  <target>
                    <context value="procedure"/>
                    <contextType value="variable"/>
                    <element value="status"/>
                    <transform value="copy"/>
                    <parameter>
                      <valueString value="in-progress"/>
                    </parameter>
                  </target>
                </rule>
                <rule>
                  <name value="statusCode"/>
                  <source>
                    <context value="proc"/>
                    <element value="statusCode"/>
                    <variable value="statusc"/>
                    <condition value="(code = 'aborted')"/>
                  </source>
                  <target>
                    <context value="procedure"/>
                    <contextType value="variable"/>
                    <element value="status"/>
                    <transform value="copy"/>
                    <parameter>
                      <valueString value="stopped"/>
                    </parameter>
                  </target>
                </rule>
                <rule>
                  <name value="statusCode"/>
                  <source>
                    <context value="proc"/>
                    <element value="statusCode"/>
                    <variable value="statusc"/>
                    <condition value="(code = 'suspended')"/>
                  </source>
                  <target>
                    <context value="procedure"/>
                    <contextType value="variable"/>
                    <element value="status"/>
                    <transform value="copy"/>
                    <parameter>
                      <valueString value="on-hold"/>
                    </parameter>
                  </target>
                </rule>
                <rule>
                  <name value="statusCode"/>
                  <source>
                    <context value="proc"/>
                    <element value="statusCode"/>
                    <variable value="statusc"/>
                    <condition value="(code = 'cancelled')"/>
                  </source>
                  <target>
                    <context value="procedure"/>
                    <contextType value="variable"/>
                    <element value="status"/>
                    <transform value="copy"/>
                    <parameter>
                      <valueString value="not-done"/>
                    </parameter>
                  </target>
                </rule>
                <rule>
                  <name value="statusCode"/>
                  <source>
                    <context value="proc"/>
                    <element value="statusCode"/>
                    <variable value="statusc"/>
                    <condition value="(code = 'held')"/>
                  </source>
                  <target>
                    <context value="procedure"/>
                    <contextType value="variable"/>
                    <element value="status"/>
                    <transform value="copy"/>
                    <parameter>
                      <valueString value="on-hold"/>
                    </parameter>
                  </target>
                </rule>
                <rule>
                  <name value="statusCode"/>
                  <source>
                    <context value="proc"/>
                    <element value="statusCode"/>
                    <variable value="statusc"/>
                    <condition value="(code = 'new')"/>
                  </source>
                  <target>
                    <context value="procedure"/>
                    <contextType value="variable"/>
                    <element value="status"/>
                    <transform value="copy"/>
                    <parameter>
                      <valueString value="preparation"/>
                    </parameter>
                  </target>
                </rule>
                <rule>
                  <name value="statusCode"/>
                  <source>
                    <context value="proc"/>
                    <element value="statusCode"/>
                    <variable value="statusc"/>
                    <condition value="(code = 'obsolete')"/>
                  </source>
                  <target>
                    <context value="procedure"/>
                    <contextType value="variable"/>
                    <element value="status"/>
                    <transform value="copy"/>
                    <parameter>
                      <valueString value="entered-in-error"/>
                    </parameter>
                  </target>
                </rule>
                <rule>
                  <name value="statusCode"/>
                  <source>
                    <context value="proc"/>
                    <element value="statusCode"/>
                    <variable value="statusc"/>
                    <condition value="(code = 'nullified')"/>
                  </source>
                  <target>
                    <context value="procedure"/>
                    <contextType value="variable"/>
                    <element value="status"/>
                    <transform value="copy"/>
                    <parameter>
                      <valueString value="unknown"/>
                    </parameter>
                  </target>
                </rule>
                <rule>
                  <name value="datetime"/>
                  <source>
                    <context value="proc"/>
                    <element value="effectiveTime"/>
                    <variable value="effectiveTime"/>
                  </source>
                  <target>
                    <context value="procedure"/>
                    <contextType value="variable"/>
                    <element value="performed"/>
                    <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="proc"/>
                    <condition
                               value="effectiveTime.low.exists() or effectiveTime.high.exists()"/>
                  </source>
                  <rule>
                    <name value="effectiveTime"/>
                    <source>
                      <context value="proc"/>
                      <element value="effectiveTime"/>
                      <variable value="eff"/>
                    </source>
                    <target>
                      <context value="procedure"/>
                      <contextType value="variable"/>
                      <element value="performed"/>
                      <variable value="period"/>
                      <transform value="create"/>
                      <parameter>
                        <valueString value="Period"/>
                      </parameter>
                    </target>
                    <dependent>
                      <name value="IVLTSPeriod"/>
                      <variable value="eff"/>
                      <variable value="period"/>
                    </dependent>
                  </rule>
                </rule>
                <rule>
                  <name value="targetSiteCode"/>
                  <source>
                    <context value="proc"/>
                    <element value="targetSiteCode"/>
                    <variable value="vvv"/>
                  </source>
                  <target>
                    <context value="procedure"/>
                    <contextType value="variable"/>
                    <element value="bodySite"/>
                    <variable value="vvv"/>
                    <transform value="create"/>
                  </target>
                </rule>
              </rule>
              <documentation value="procedure"/>
            </rule>
          </rule>
        </rule>
        <rule>
          <name value="organizer"/>
          <source>
            <context value="entryRelationship"/>
            <element value="organizer"/>
            <variable value="organizer"/>
          </source>
          <rule>
            <name value="Organizer"/>
            <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="obs"/>
              <transform value="create"/>
              <parameter>
                <valueString value="Observation"/>
              </parameter>
            </target>
            <target>
              <context value="obs"/>
              <contextType value="variable"/>
              <element value="id"/>
              <variable value="uuid13"/>
              <transform value="uuid"/>
            </target>
            <target>
              <context value="e12"/>
              <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="ac"/>
              <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/' + %obs.id"/>
              </parameter>
            </target>
            <rule>
              <name value="ORG"/>
              <source>
                <context value="organizer"/>
              </source>
              <dependent>
                <name value="Organizer"/>
                <variable value="cda"/>
                <variable value="organizer"/>
                <variable value="pat"/>
                <variable value="enc"/>
                <variable value="obs"/>
                <variable value="bundle"/>
              </dependent>
            </rule>
            <rule>
              <name value="entryRelationshiprocedure"/>
              <source>
                <context value="cda"/>
                <element value="entryRelationship"/>
                <variable value="entryRelationship1"/>
              </source>
              <rule>
                <name value="pbservation"/>
                <source>
                  <context value="entryRelationship1"/>
                  <element value="procedure"/>
                  <variable value="proc"/>
                </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="procedure"/>
                  <transform value="create"/>
                  <parameter>
                    <valueString value="Procedure"/>
                  </parameter>
                </target>
                <target>
                  <context value="procedure"/>
                  <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/Procedure/"/>
                  </parameter>
                  <parameter>
                    <valueId value="uuid5"/>
                  </parameter>
                </target>
                <target>
                  <context value="request"/>
                  <contextType value="variable"/>
                  <element value="url"/>
                  <transform value="copy"/>
                  <parameter>
                    <valueString value="Procedure"/>
                  </parameter>
                </target>
                <target>
                  <context value="obs"/>
                  <contextType value="variable"/>
                  <element value="partOf"/>
                  <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/Procedure/' + %procedure.id"/>
                  </parameter>
                </target>
                <rule>
                  <name value="reference"/>
                  <source>
                    <context value="proc"/>
                  </source>
                  <target>
                    <context value="procedure"/>
                    <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="proc"/>
                  </source>
                  <target>
                    <context value="procedure"/>
                    <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="proc"/>
                    <condition value="proc.statusCode.exists().not()"/>
                  </source>
                  <rule>
                    <name value="statuscode"/>
                    <source>
                      <context value="proc"/>
                    </source>
                    <target>
                      <context value="procedure"/>
                      <contextType value="variable"/>
                      <element value="status"/>
                      <transform value="copy"/>
                      <parameter>
                        <valueString value="unknown"/>
                      </parameter>
                    </target>
                  </rule>
                </rule>
                <rule>
                  <name value="statusCode"/>
                  <source>
                    <context value="proc"/>
                    <element value="statusCode"/>
                    <variable value="statusc"/>
                    <condition value="(code = 'completed')"/>
                  </source>
                  <target>
                    <context value="procedure"/>
                    <contextType value="variable"/>
                    <element value="status"/>
                    <transform value="copy"/>
                    <parameter>
                      <valueString value="completed"/>
                    </parameter>
                  </target>
                </rule>
                <rule>
                  <name value="statusCode"/>
                  <source>
                    <context value="proc"/>
                    <element value="statusCode"/>
                    <variable value="statusc"/>
                    <condition value="(code = 'active')"/>
                  </source>
                  <target>
                    <context value="procedure"/>
                    <contextType value="variable"/>
                    <element value="status"/>
                    <transform value="copy"/>
                    <parameter>
                      <valueString value="in-progress"/>
                    </parameter>
                  </target>
                </rule>
                <rule>
                  <name value="statusCode"/>
                  <source>
                    <context value="proc"/>
                    <element value="statusCode"/>
                    <variable value="statusc"/>
                    <condition value="(code = 'aborted')"/>
                  </source>
                  <target>
                    <context value="procedure"/>
                    <contextType value="variable"/>
                    <element value="status"/>
                    <transform value="copy"/>
                    <parameter>
                      <valueString value="stopped"/>
                    </parameter>
                  </target>
                </rule>
                <rule>
                  <name value="statusCode"/>
                  <source>
                    <context value="proc"/>
                    <element value="statusCode"/>
                    <variable value="statusc"/>
                    <condition value="(code = 'suspended')"/>
                  </source>
                  <target>
                    <context value="procedure"/>
                    <contextType value="variable"/>
                    <element value="status"/>
                    <transform value="copy"/>
                    <parameter>
                      <valueString value="on-hold"/>
                    </parameter>
                  </target>
                </rule>
                <rule>
                  <name value="statusCode"/>
                  <source>
                    <context value="proc"/>
                    <element value="statusCode"/>
                    <variable value="statusc"/>
                    <condition value="(code = 'cancelled')"/>
                  </source>
                  <target>
                    <context value="procedure"/>
                    <contextType value="variable"/>
                    <element value="status"/>
                    <transform value="copy"/>
                    <parameter>
                      <valueString value="not-done"/>
                    </parameter>
                  </target>
                </rule>
                <rule>
                  <name value="statusCode"/>
                  <source>
                    <context value="proc"/>
                    <element value="statusCode"/>
                    <variable value="statusc"/>
                    <condition value="(code = 'held')"/>
                  </source>
                  <target>
                    <context value="procedure"/>
                    <contextType value="variable"/>
                    <element value="status"/>
                    <transform value="copy"/>
                    <parameter>
                      <valueString value="on-hold"/>
                    </parameter>
                  </target>
                </rule>
                <rule>
                  <name value="statusCode"/>
                  <source>
                    <context value="proc"/>
                    <element value="statusCode"/>
                    <variable value="statusc"/>
                    <condition value="(code = 'new')"/>
                  </source>
                  <target>
                    <context value="procedure"/>
                    <contextType value="variable"/>
                    <element value="status"/>
                    <transform value="copy"/>
                    <parameter>
                      <valueString value="preparation"/>
                    </parameter>
                  </target>
                </rule>
                <rule>
                  <name value="statusCode"/>
                  <source>
                    <context value="proc"/>
                    <element value="statusCode"/>
                    <variable value="statusc"/>
                    <condition value="(code = 'obsolete')"/>
                  </source>
                  <target>
                    <context value="procedure"/>
                    <contextType value="variable"/>
                    <element value="status"/>
                    <transform value="copy"/>
                    <parameter>
                      <valueString value="entered-in-error"/>
                    </parameter>
                  </target>
                </rule>
                <rule>
                  <name value="statusCode"/>
                  <source>
                    <context value="proc"/>
                    <element value="statusCode"/>
                    <variable value="statusc"/>
                    <condition value="(code = 'nullified')"/>
                  </source>
                  <target>
                    <context value="procedure"/>
                    <contextType value="variable"/>
                    <element value="status"/>
                    <transform value="copy"/>
                    <parameter>
                      <valueString value="unknown"/>
                    </parameter>
                  </target>
                </rule>
                <rule>
                  <name value="datetime"/>
                  <source>
                    <context value="proc"/>
                    <element value="effectiveTime"/>
                    <variable value="effectiveTime"/>
                  </source>
                  <target>
                    <context value="procedure"/>
                    <contextType value="variable"/>
                    <element value="performed"/>
                    <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="proc"/>
                    <condition
                               value="effectiveTime.low.exists() or effectiveTime.high.exists()"/>
                  </source>
                  <rule>
                    <name value="effectiveTime"/>
                    <source>
                      <context value="proc"/>
                      <element value="effectiveTime"/>
                      <variable value="eff"/>
                    </source>
                    <target>
                      <context value="procedure"/>
                      <contextType value="variable"/>
                      <element value="performed"/>
                      <variable value="period"/>
                      <transform value="create"/>
                      <parameter>
                        <valueString value="Period"/>
                      </parameter>
                    </target>
                    <dependent>
                      <name value="IVLTSPeriod"/>
                      <variable value="eff"/>
                      <variable value="period"/>
                    </dependent>
                  </rule>
                </rule>
                <rule>
                  <name value="targetSiteCode"/>
                  <source>
                    <context value="proc"/>
                    <element value="targetSiteCode"/>
                    <variable value="vvv"/>
                  </source>
                  <target>
                    <context value="procedure"/>
                    <contextType value="variable"/>
                    <element value="bodySite"/>
                    <variable value="vvv"/>
                    <transform value="create"/>
                  </target>
                </rule>
              </rule>
              <documentation value="procedure"/>
            </rule>
          </rule>
        </rule>
        <documentation
                       value="cda -&gt; bundle.entry as e4, e4.request = create('BackboneElement') as request, request.method = 'POST', e4.resource = create('Specimen') as specimen,  specimen.id = uuid() as uuid4,  e4.fullUrl = append('https://example/Specimen/', uuid4), request.url = 'Specimen' then {"/>
      </rule>
    </rule>
    <rule>
      <name value="participant"/>
      <source>
        <context value="cda"/>
        <element value="participant"/>
        <variable value="part"/>
        <condition value="(typeCode != 'DEV')"/>
      </source>
      <target>
        <context value="enc"/>
        <contextType value="variable"/>
        <element value="participant"/>
        <variable value="participant"/>
      </target>
      <rule>
        <name value="type"/>
        <source>
          <context value="part"/>
        </source>
        <target>
          <context value="participant"/>
          <contextType value="variable"/>
          <element value="type"/>
          <variable value="type"/>
        </target>
        <rule>
          <name value="codeType"/>
          <source>
            <context value="part"/>
          </source>
          <target>
            <context value="type"/>
            <contextType value="variable"/>
            <element value="coding"/>
            <variable value="coding"/>
          </target>
          <rule>
            <name value="codice"/>
            <source>
              <context value="part"/>
            </source>
            <target>
              <context value="coding"/>
              <contextType value="variable"/>
              <element value="code"/>
              <transform value="evaluate"/>
              <parameter>
                <valueString value="part.typeCode"/>
              </parameter>
            </target>
          </rule>
          <rule>
            <name value="system"/>
            <source>
              <context value="part"/>
            </source>
            <target>
              <context value="coding"/>
              <contextType value="variable"/>
              <element value="system"/>
              <transform value="copy"/>
              <parameter>
                <valueString
                             value="http://terminology.hl7.org/CodeSystem/v3-ParticipationType"/>
              </parameter>
            </target>
          </rule>
        </rule>
      </rule>
      <rule>
        <name value="participantRole"/>
        <source>
          <context value="part"/>
          <element value="participantRole"/>
          <variable value="participantRole"/>
        </source>
        <target>
          <context value="participant"/>
          <contextType value="variable"/>
          <element value="individual"/>
          <variable value="reference"/>
          <transform value="create"/>
          <parameter>
            <valueString value="Reference"/>
          </parameter>
        </target>
        <rule>
          <name value="participanRoleBund"/>
          <source>
            <context value="participantRole"/>
          </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="PUT"/>
            </parameter>
          </target>
          <target>
            <context value="e"/>
            <contextType value="variable"/>
            <element value="resource"/>
            <variable value="practitioner"/>
            <transform value="create"/>
            <parameter>
              <valueString value="Practitioner"/>
            </parameter>
          </target>
          <rule>
            <name value="time"/>
            <source>
              <context value="part"/>
              <element value="time"/>
              <variable value="time1"/>
            </source>
            <target>
              <context value="participant"/>
              <contextType value="variable"/>
              <element value="period"/>
              <variable value="period"/>
              <transform value="create"/>
              <parameter>
                <valueString value="Period"/>
              </parameter>
            </target>
            <rule>
              <name value="val"/>
              <source>
                <context value="time1"/>
              </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="time1"/>
                <variable value="start"/>
              </dependent>
            </rule>
          </rule>
          <rule>
            <name value="time"/>
            <source>
              <context value="part"/>
              <element value="time"/>
              <variable value="time1"/>
            </source>
            <target>
              <context value="participant"/>
              <contextType value="variable"/>
              <element value="period"/>
              <variable value="period"/>
              <transform value="create"/>
              <parameter>
                <valueString value="Period"/>
              </parameter>
            </target>
            <dependent>
              <name value="IVLTSPeriod"/>
              <variable value="time1"/>
              <variable value="period"/>
            </dependent>
          </rule>
          <rule>
            <name value="meta"/>
            <source>
              <context value="participantRole"/>
            </source>
            <target>
              <context value="practitioner"/>
              <contextType value="variable"/>
              <element value="meta"/>
              <variable value="meta"/>
            </target>
            <rule>
              <name value="coding"/>
              <source>
                <context value="participantRole"/>
              </source>
              <target>
                <context value="meta"/>
                <contextType value="variable"/>
                <element value="tag"/>
                <variable value="coding"/>
                <transform value="create"/>
                <parameter>
                  <valueString value="Coding"/>
                </parameter>
              </target>
              <rule>
                <name value="system"/>
                <source>
                  <context value="participantRole"/>
                </source>
                <target>
                  <context value="coding"/>
                  <contextType value="variable"/>
                  <element value="system"/>
                  <transform value="copy"/>
                  <parameter>
                    <valueString value="http://algoritmodiscoring"/>
                  </parameter>
                </target>
              </rule>
              <rule>
                <name value="code"/>
                <source>
                  <context value="participantRole"/>
                </source>
                <target>
                  <context value="coding"/>
                  <contextType value="variable"/>
                  <element value="code"/>
                  <transform value="copy"/>
                  <parameter>
                    <valueString
                                 value="ClinicalDocument/body/act/participant"/>
                  </parameter>
                </target>
              </rule>
            </rule>
          </rule>
          <rule>
            <name value="identifier"/>
            <source>
              <context value="participantRole"/>
              <element value="id"/>
              <variable value="id"/>
            </source>
            <target>
              <context value="practitioner"/>
              <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="ext"/>
              <source>
                <context value="id"/>
                <element value="extension"/>
                <variable value="ext"/>
              </source>
              <target>
                <context value="identifier"/>
                <contextType value="variable"/>
                <element value="value"/>
                <transform value="copy"/>
                <parameter>
                  <valueId value="ext"/>
                </parameter>
              </target>
              <rule>
                <name value="UUID"/>
                <source>
                  <context value="participantRole"/>
                </source>
                <target>
                  <context value="request"/>
                  <contextType value="variable"/>
                  <element value="url"/>
                  <transform value="append"/>
                  <parameter>
                    <valueString value="Practitioner?identifier="/>
                  </parameter>
                  <parameter>
                    <valueId value="ext"/>
                  </parameter>
                </target>
              </rule>
            </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>
              <name value="r"/>
              <source>
                <context value="id"/>
                <element value="root"/>
                <variable value="r"/>
              </source>
              <rule>
                <name value="org"/>
                <source>
                  <context value="id"/>
                  <element value="extension"/>
                  <variable value="ext"/>
                </source>
                <target>
                  <context value="practitioner"/>
                  <contextType value="variable"/>
                  <element value="id"/>
                  <variable value="uuid4"/>
                  <transform value="evaluate"/>
                  <parameter>
                    <valueString value="r + '-' + ext"/>
                  </parameter>
                </target>
                <target>
                  <context value="e"/>
                  <contextType value="variable"/>
                  <element value="fullUrl"/>
                  <transform value="append"/>
                  <parameter>
                    <valueString value="https://example/Practitioner/"/>
                  </parameter>
                  <parameter>
                    <valueId value="uuid4"/>
                  </parameter>
                </target>
                <target>
                  <context value="reference"/>
                  <contextType value="variable"/>
                  <element value="reference"/>
                  <transform value="evaluate"/>
                  <parameter>
                    <valueString
                                 value="'https://example/Practitioner/' + %practitioner.id"/>
                  </parameter>
                </target>
              </rule>
            </rule>
          </rule>
          <rule>
            <name value="addr"/>
            <source>
              <context value="participantRole"/>
              <element value="addr"/>
              <variable value="vvv"/>
            </source>
            <target>
              <context value="practitioner"/>
              <contextType value="variable"/>
              <element value="address"/>
              <variable value="vvv"/>
              <transform value="create"/>
            </target>
          </rule>
          <rule>
            <name value="playingEntity"/>
            <source>
              <context value="participantRole"/>
              <element value="playingEntity"/>
              <variable value="playingEntity"/>
            </source>
            <rule>
              <name value="name"/>
              <source>
                <context value="playingEntity"/>
                <element value="name"/>
                <variable value="vvv"/>
              </source>
              <target>
                <context value="practitioner"/>
                <contextType value="variable"/>
                <element value="name"/>
                <variable value="vvv"/>
                <transform value="create"/>
              </target>
            </rule>
          </rule>
        </rule>
      </rule>
      <documentation value="PARTICIPANT"/>
    </rule>
    <rule>
      <name value="performer"/>
      <source>
        <context value="cda"/>
        <element value="performer"/>
        <variable value="performer"/>
      </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="practitionerRole"/>
        <transform value="create"/>
        <parameter>
          <valueString value="PractitionerRole"/>
        </parameter>
      </target>
      <target>
        <context value="practitionerRole"/>
        <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/PractitionerRole/"/>
        </parameter>
        <parameter>
          <valueId value="uuid1"/>
        </parameter>
      </target>
      <target>
        <context value="request"/>
        <contextType value="variable"/>
        <element value="url"/>
        <transform value="copy"/>
        <parameter>
          <valueString value="PractitionerRole"/>
        </parameter>
      </target>
      <target>
        <context value="ac"/>
        <contextType value="variable"/>
        <element value="performer"/>
        <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/PractitionerRole/' + %practitionerRole.id"/>
        </parameter>
      </target>
      <rule>
        <name value="performer"/>
        <source>
          <context value="performer"/>
          <element value="assignedEntity"/>
          <variable value="assignedEntity"/>
        </source>
        <rule>
          <name value="code"/>
          <source>
            <context value="assignedEntity"/>
            <element value="code"/>
            <variable value="codice"/>
          </source>
          <target>
            <context value="practitionerRole"/>
            <contextType value="variable"/>
            <element value="code"/>
          </target>
        </rule>
        <rule>
          <name value="ASSAUth"/>
          <source>
            <context value="assignedEntity"/>
          </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="PUT"/>
            </parameter>
          </target>
          <target>
            <context value="e2"/>
            <contextType value="variable"/>
            <element value="resource"/>
            <variable value="practitioner"/>
            <transform value="create"/>
            <parameter>
              <valueString value="Practitioner"/>
            </parameter>
          </target>
          <rule>
            <name value="code"/>
            <source>
              <context value="assignedEntity"/>
              <element value="code"/>
              <variable value="vvv"/>
            </source>
            <target>
              <context value="practitionerRole"/>
              <contextType value="variable"/>
              <element value="code"/>
              <variable value="vvv"/>
              <transform value="create"/>
            </target>
          </rule>
          <rule>
            <name value="meta"/>
            <source>
              <context value="assignedEntity"/>
            </source>
            <target>
              <context value="practitioner"/>
              <contextType value="variable"/>
              <element value="meta"/>
              <variable value="meta"/>
            </target>
            <rule>
              <name value="coding"/>
              <source>
                <context value="assignedEntity"/>
              </source>
              <target>
                <context value="meta"/>
                <contextType value="variable"/>
                <element value="tag"/>
                <variable value="coding"/>
                <transform value="create"/>
                <parameter>
                  <valueString value="Coding"/>
                </parameter>
              </target>
              <rule>
                <name value="system"/>
                <source>
                  <context value="assignedEntity"/>
                </source>
                <target>
                  <context value="coding"/>
                  <contextType value="variable"/>
                  <element value="system"/>
                  <transform value="copy"/>
                  <parameter>
                    <valueString value="http://algoritmodiscoring"/>
                  </parameter>
                </target>
              </rule>
              <rule>
                <name value="code"/>
                <source>
                  <context value="assignedEntity"/>
                </source>
                <target>
                  <context value="coding"/>
                  <contextType value="variable"/>
                  <element value="code"/>
                  <transform value="copy"/>
                  <parameter>
                    <valueString value="ClinicalDocument/body/act/performer"/>
                  </parameter>
                </target>
              </rule>
            </rule>
          </rule>
          <rule>
            <name value="identifier"/>
            <source>
              <context value="assignedEntity"/>
              <element value="id"/>
              <variable value="id"/>
            </source>
            <target>
              <context value="practitioner"/>
              <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="ext"/>
              <source>
                <context value="id"/>
                <element value="extension"/>
                <variable value="ext"/>
              </source>
              <target>
                <context value="identifier"/>
                <contextType value="variable"/>
                <element value="value"/>
                <transform value="copy"/>
                <parameter>
                  <valueId value="ext"/>
                </parameter>
              </target>
              <rule>
                <name value="UUID"/>
                <source>
                  <context value="assignedEntity"/>
                </source>
                <target>
                  <context value="request"/>
                  <contextType value="variable"/>
                  <element value="url"/>
                  <transform value="append"/>
                  <parameter>
                    <valueString value="Practitioner?identifier="/>
                  </parameter>
                  <parameter>
                    <valueId value="ext"/>
                  </parameter>
                </target>
              </rule>
            </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>
              <name value="r"/>
              <source>
                <context value="id"/>
                <element value="root"/>
                <variable value="r"/>
              </source>
              <rule>
                <name value="pra"/>
                <source>
                  <context value="id"/>
                  <element value="extension"/>
                  <variable value="ext"/>
                </source>
                <target>
                  <context value="practitioner"/>
                  <contextType value="variable"/>
                  <element value="id"/>
                  <variable value="uuid4"/>
                  <transform value="evaluate"/>
                  <parameter>
                    <valueString value="r + '-' + ext"/>
                  </parameter>
                </target>
                <target>
                  <context value="e2"/>
                  <contextType value="variable"/>
                  <element value="fullUrl"/>
                  <transform value="append"/>
                  <parameter>
                    <valueString value="https://example/Practitioner/"/>
                  </parameter>
                  <parameter>
                    <valueId value="uuid4"/>
                  </parameter>
                </target>
                <target>
                  <context value="practitionerRole"/>
                  <contextType value="variable"/>
                  <element value="practitioner"/>
                  <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/Practitioner/' + %practitioner.id"/>
                  </parameter>
                </target>
              </rule>
            </rule>
          </rule>
          <rule>
            <name value="addr"/>
            <source>
              <context value="assignedEntity"/>
              <element value="addr"/>
              <variable value="vvv"/>
            </source>
            <target>
              <context value="practitioner"/>
              <contextType value="variable"/>
              <element value="address"/>
              <variable value="vvv"/>
              <transform value="create"/>
            </target>
          </rule>
          <rule>
            <name value="telecom"/>
            <source>
              <context value="assignedEntity"/>
              <element value="telecom"/>
              <variable value="vvv"/>
            </source>
            <target>
              <context value="practitioner"/>
              <contextType value="variable"/>
              <element value="telecom"/>
              <variable value="vvv"/>
              <transform value="create"/>
            </target>
          </rule>
          <rule>
            <name value="name"/>
            <source>
              <context value="assignedEntity"/>
              <element value="assignedPerson"/>
              <variable value="person"/>
            </source>
            <rule>
              <name value="name"/>
              <source>
                <context value="person"/>
                <element value="name"/>
                <variable value="vvv"/>
              </source>
              <target>
                <context value="practitioner"/>
                <contextType value="variable"/>
                <element value="name"/>
                <variable value="vvv"/>
                <transform value="create"/>
              </target>
            </rule>
            <rule>
              <name value="birth"/>
              <source>
                <context value="person"/>
                <element value="birthTime"/>
                <variable value="birthTime"/>
              </source>
              <rule>
                <name value="value"/>
                <source>
                  <context value="birthTime"/>
                  <element value="value"/>
                  <variable value="date"/>
                </source>
                <target>
                  <context value="practitioner"/>
                  <contextType value="variable"/>
                  <element value="birthDate"/>
                  <transform value="truncate"/>
                  <parameter>
                    <valueId value="date"/>
                  </parameter>
                  <parameter>
                    <valueInteger value="10"/>
                  </parameter>
                </target>
              </rule>
            </rule>
          </rule>
        </rule>
        <rule>
          <name value="representedOrganization"/>
          <source>
            <context value="assignedEntity"/>
            <element value="representedOrganization"/>
            <variable value="representedOrganization"/>
          </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="PUT"/>
            </parameter>
          </target>
          <target>
            <context value="e3"/>
            <contextType value="variable"/>
            <element value="resource"/>
            <variable value="organization"/>
            <transform value="create"/>
            <parameter>
              <valueString value="Organization"/>
            </parameter>
          </target>
          <rule>
            <name value="meta"/>
            <source>
              <context value="representedOrganization"/>
            </source>
            <target>
              <context value="organization"/>
              <contextType value="variable"/>
              <element value="meta"/>
              <variable value="meta"/>
            </target>
            <rule>
              <name value="coding"/>
              <source>
                <context value="representedOrganization"/>
              </source>
              <target>
                <context value="meta"/>
                <contextType value="variable"/>
                <element value="tag"/>
                <variable value="coding"/>
                <transform value="create"/>
                <parameter>
                  <valueString value="Coding"/>
                </parameter>
              </target>
              <rule>
                <name value="system"/>
                <source>
                  <context value="representedOrganization"/>
                </source>
                <target>
                  <context value="coding"/>
                  <contextType value="variable"/>
                  <element value="system"/>
                  <transform value="copy"/>
                  <parameter>
                    <valueString value="http://algoritmodiscoring"/>
                  </parameter>
                </target>
              </rule>
              <rule>
                <name value="code"/>
                <source>
                  <context value="representedOrganization"/>
                </source>
                <target>
                  <context value="coding"/>
                  <contextType value="variable"/>
                  <element value="code"/>
                  <transform value="copy"/>
                  <parameter>
                    <valueString
                                 value="ClinicalDocument/body/act/representedOrganization"/>
                  </parameter>
                </target>
              </rule>
            </rule>
          </rule>
          <rule>
            <name value="identifier"/>
            <source>
              <context value="representedOrganization"/>
              <element value="id"/>
              <variable value="id"/>
            </source>
            <target>
              <context value="organization"/>
              <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="ext"/>
              <source>
                <context value="id"/>
                <element value="extension"/>
                <variable value="ext"/>
              </source>
              <target>
                <context value="identifier"/>
                <contextType value="variable"/>
                <element value="value"/>
                <transform value="copy"/>
                <parameter>
                  <valueId value="ext"/>
                </parameter>
              </target>
              <rule>
                <name value="UUID"/>
                <source>
                  <context value="representedOrganization"/>
                </source>
                <target>
                  <context value="request"/>
                  <contextType value="variable"/>
                  <element value="url"/>
                  <transform value="append"/>
                  <parameter>
                    <valueString value="Organization?identifier="/>
                  </parameter>
                  <parameter>
                    <valueId value="ext"/>
                  </parameter>
                </target>
              </rule>
            </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>
              <name value="r"/>
              <source>
                <context value="id"/>
                <element value="root"/>
                <variable value="r"/>
              </source>
              <rule>
                <name value="org"/>
                <source>
                  <context value="id"/>
                  <element value="extension"/>
                  <variable value="ext"/>
                </source>
                <target>
                  <context value="organization"/>
                  <contextType value="variable"/>
                  <element value="id"/>
                  <variable value="uuid2"/>
                  <transform value="evaluate"/>
                  <parameter>
                    <valueString value="r + '-' + ext"/>
                  </parameter>
                </target>
                <target>
                  <context value="e3"/>
                  <contextType value="variable"/>
                  <element value="fullUrl"/>
                  <transform value="append"/>
                  <parameter>
                    <valueString value="https://example/Organization/"/>
                  </parameter>
                  <parameter>
                    <valueId value="uuid2"/>
                  </parameter>
                </target>
                <target>
                  <context value="practitionerRole"/>
                  <contextType value="variable"/>
                  <element value="organization"/>
                  <variable value="referenceOrg"/>
                  <transform value="create"/>
                  <parameter>
                    <valueString value="Reference"/>
                  </parameter>
                </target>
                <target>
                  <context value="referenceOrg"/>
                  <contextType value="variable"/>
                  <element value="reference"/>
                  <transform value="append"/>
                  <parameter>
                    <valueString value="https://example/Organization/"/>
                  </parameter>
                  <parameter>
                    <valueId value="uuid2"/>
                  </parameter>
                </target>
              </rule>
            </rule>
          </rule>
          <rule>
            <name value="name"/>
            <source>
              <context value="representedOrganization"/>
              <element value="name"/>
              <variable value="v"/>
            </source>
            <target>
              <context value="organization"/>
              <contextType value="variable"/>
              <element value="name"/>
              <transform value="evaluate"/>
              <parameter>
                <valueString value="v.other"/>
              </parameter>
            </target>
          </rule>
          <rule>
            <name value="telecom"/>
            <source>
              <context value="representedOrganization"/>
              <element value="telecom"/>
              <variable value="vvv"/>
            </source>
            <target>
              <context value="organization"/>
              <contextType value="variable"/>
              <element value="telecom"/>
              <variable value="vvv"/>
              <transform value="create"/>
            </target>
          </rule>
          <rule>
            <name value="addr"/>
            <source>
              <context value="representedOrganization"/>
              <element value="addr"/>
              <variable value="vvv"/>
            </source>
            <target>
              <context value="organization"/>
              <contextType value="variable"/>
              <element value="address"/>
              <variable value="vvv"/>
              <transform value="create"/>
            </target>
          </rule>
          <rule>
            <name value="OrgPartOf"/>
            <source>
              <context value="representedOrganization"/>
              <element value="asOrganizationPartOf"/>
              <variable value="OrgPartOf"/>
            </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="PUT"/>
              </parameter>
            </target>
            <target>
              <context value="e4"/>
              <contextType value="variable"/>
              <element value="resource"/>
              <variable value="organization1"/>
              <transform value="create"/>
              <parameter>
                <valueString value="Organization"/>
              </parameter>
            </target>
            <rule>
              <name value="meta"/>
              <source>
                <context value="OrgPartOf"/>
              </source>
              <target>
                <context value="organization1"/>
                <contextType value="variable"/>
                <element value="meta"/>
                <variable value="meta"/>
              </target>
              <rule>
                <name value="coding"/>
                <source>
                  <context value="OrgPartOf"/>
                </source>
                <target>
                  <context value="meta"/>
                  <contextType value="variable"/>
                  <element value="tag"/>
                  <variable value="coding"/>
                  <transform value="create"/>
                  <parameter>
                    <valueString value="Coding"/>
                  </parameter>
                </target>
                <rule>
                  <name value="system"/>
                  <source>
                    <context value="OrgPartOf"/>
                  </source>
                  <target>
                    <context value="coding"/>
                    <contextType value="variable"/>
                    <element value="system"/>
                    <transform value="copy"/>
                    <parameter>
                      <valueString value="http://algoritmodiscoring"/>
                    </parameter>
                  </target>
                </rule>
                <rule>
                  <name value="code"/>
                  <source>
                    <context value="OrgPartOf"/>
                  </source>
                  <target>
                    <context value="coding"/>
                    <contextType value="variable"/>
                    <element value="code"/>
                    <transform value="copy"/>
                    <parameter>
                      <valueString
                                   value="ClinicalDocument/body/act/representedOrganization/asOrganizationPartOf"/>
                    </parameter>
                  </target>
                </rule>
              </rule>
            </rule>
            <rule>
              <name value="identifier"/>
              <source>
                <context value="OrgPartOf"/>
                <element value="id"/>
                <variable value="id"/>
              </source>
              <target>
                <context value="organization1"/>
                <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="ext"/>
                <source>
                  <context value="id"/>
                  <element value="extension"/>
                  <variable value="ext"/>
                </source>
                <target>
                  <context value="identifier"/>
                  <contextType value="variable"/>
                  <element value="value"/>
                  <transform value="copy"/>
                  <parameter>
                    <valueId value="ext"/>
                  </parameter>
                </target>
                <rule>
                  <name value="UUID"/>
                  <source>
                    <context value="OrgPartOf"/>
                  </source>
                  <target>
                    <context value="request"/>
                    <contextType value="variable"/>
                    <element value="url"/>
                    <transform value="append"/>
                    <parameter>
                      <valueString value="Organization?identifier="/>
                    </parameter>
                    <parameter>
                      <valueId value="ext"/>
                    </parameter>
                  </target>
                </rule>
              </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>
                <name value="r"/>
                <source>
                  <context value="id"/>
                  <element value="root"/>
                  <variable value="r"/>
                </source>
                <rule>
                  <name value="org"/>
                  <source>
                    <context value="id"/>
                    <element value="extension"/>
                    <variable value="ext"/>
                  </source>
                  <target>
                    <context value="organization1"/>
                    <contextType value="variable"/>
                    <element value="id"/>
                    <variable value="uuid3"/>
                    <transform value="evaluate"/>
                    <parameter>
                      <valueString value="r + '-' + ext"/>
                    </parameter>
                  </target>
                  <target>
                    <context value="organization1"/>
                    <contextType value="variable"/>
                    <element value="id"/>
                    <variable value="uuid3"/>
                    <transform value="uuid"/>
                  </target>
                  <target>
                    <context value="e4"/>
                    <contextType value="variable"/>
                    <element value="fullUrl"/>
                    <transform value="append"/>
                    <parameter>
                      <valueString value="https://example/Organization/"/>
                    </parameter>
                    <parameter>
                      <valueId value="uuid3"/>
                    </parameter>
                  </target>
                  <target>
                    <context value="organization"/>
                    <contextType value="variable"/>
                    <element value="partOf"/>
                    <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/Organization/' + %organization1.id"/>
                    </parameter>
                  </target>
                </rule>
              </rule>
            </rule>
            <rule>
              <name value="code"/>
              <source>
                <context value="OrgPartOf"/>
                <element value="code"/>
                <variable value="vvv"/>
              </source>
              <target>
                <context value="organization1"/>
                <contextType value="variable"/>
                <element value="type"/>
                <variable value="vvv"/>
                <transform value="create"/>
              </target>
            </rule>
            <rule>
              <name value="statusCode"/>
              <source>
                <context value="OrgPartOf"/>
                <element value="statusCode"/>
                <variable value="status"/>
                <condition value="(value = 'active')"/>
              </source>
              <target>
                <context value="organization1"/>
                <contextType value="variable"/>
                <element value="active"/>
                <transform value="create"/>
                <parameter>
                  <valueString value="boolean"/>
                </parameter>
              </target>
              <target>
                <context value="organization1"/>
                <contextType value="variable"/>
                <element value="active"/>
                <transform value="copy"/>
                <parameter>
                  <valueString value="true"/>
                </parameter>
              </target>
            </rule>
            <rule>
              <name value="wholeOrganization"/>
              <source>
                <context value="OrgPartOf"/>
                <element value="wholeOrganization"/>
                <variable value="wholeOrgan"/>
              </source>
              <target>
                <context value="bundle"/>
                <contextType value="variable"/>
                <element value="entry"/>
                <variable value="e10bis"/>
              </target>
              <target>
                <context value="e10bis"/>
                <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="PUT"/>
                </parameter>
              </target>
              <target>
                <context value="e10bis"/>
                <contextType value="variable"/>
                <element value="resource"/>
                <variable value="organization2"/>
                <transform value="create"/>
                <parameter>
                  <valueString value="Organization"/>
                </parameter>
              </target>
              <rule>
                <name value="meta"/>
                <source>
                  <context value="OrgPartOf"/>
                </source>
                <target>
                  <context value="organization2"/>
                  <contextType value="variable"/>
                  <element value="meta"/>
                  <variable value="meta"/>
                </target>
                <rule>
                  <name value="coding"/>
                  <source>
                    <context value="OrgPartOf"/>
                  </source>
                  <target>
                    <context value="meta"/>
                    <contextType value="variable"/>
                    <element value="tag"/>
                    <variable value="coding"/>
                    <transform value="create"/>
                    <parameter>
                      <valueString value="Coding"/>
                    </parameter>
                  </target>
                  <rule>
                    <name value="system"/>
                    <source>
                      <context value="OrgPartOf"/>
                    </source>
                    <target>
                      <context value="coding"/>
                      <contextType value="variable"/>
                      <element value="system"/>
                      <transform value="copy"/>
                      <parameter>
                        <valueString value="http://algoritmodiscoring"/>
                      </parameter>
                    </target>
                  </rule>
                  <rule>
                    <name value="code"/>
                    <source>
                      <context value="OrgPartOf"/>
                    </source>
                    <target>
                      <context value="coding"/>
                      <contextType value="variable"/>
                      <element value="code"/>
                      <transform value="copy"/>
                      <parameter>
                        <valueString
                                     value="ClinicalDocument/body/act/representedOrganization/asOrganizationPartOf/wholeOrganization"/>
                      </parameter>
                    </target>
                  </rule>
                </rule>
              </rule>
              <rule>
                <name value="identifier"/>
                <source>
                  <context value="wholeOrgan"/>
                  <element value="id"/>
                  <variable value="id"/>
                </source>
                <target>
                  <context value="organization2"/>
                  <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="ext"/>
                  <source>
                    <context value="id"/>
                    <element value="extension"/>
                    <variable value="ext"/>
                  </source>
                  <target>
                    <context value="identifier"/>
                    <contextType value="variable"/>
                    <element value="value"/>
                    <transform value="copy"/>
                    <parameter>
                      <valueId value="ext"/>
                    </parameter>
                  </target>
                  <rule>
                    <name value="UUID"/>
                    <source>
                      <context value="wholeOrgan"/>
                    </source>
                    <target>
                      <context value="request"/>
                      <contextType value="variable"/>
                      <element value="url"/>
                      <transform value="append"/>
                      <parameter>
                        <valueString value="Organization?identifier="/>
                      </parameter>
                      <parameter>
                        <valueId value="ext"/>
                      </parameter>
                    </target>
                  </rule>
                </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>
                  <name value="r"/>
                  <source>
                    <context value="id"/>
                    <element value="root"/>
                    <variable value="r"/>
                  </source>
                  <rule>
                    <name value="org"/>
                    <source>
                      <context value="id"/>
                      <element value="extension"/>
                      <variable value="ext"/>
                    </source>
                    <target>
                      <context value="organization2"/>
                      <contextType value="variable"/>
                      <element value="id"/>
                      <variable value="uuid5"/>
                      <transform value="evaluate"/>
                      <parameter>
                        <valueString value="r + '-' + ext"/>
                      </parameter>
                    </target>
                    <target>
                      <context value="e10bis"/>
                      <contextType value="variable"/>
                      <element value="fullUrl"/>
                      <transform value="append"/>
                      <parameter>
                        <valueString value="https://example/Organization/"/>
                      </parameter>
                      <parameter>
                        <valueId value="uuid5"/>
                      </parameter>
                    </target>
                    <target>
                      <context value="organization1"/>
                      <contextType value="variable"/>
                      <element value="partOf"/>
                      <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/Organization/' + %organization2.id"/>
                      </parameter>
                    </target>
                  </rule>
                </rule>
              </rule>
              <rule>
                <name value="name"/>
                <source>
                  <context value="wholeOrgan"/>
                  <element value="name"/>
                  <variable value="v"/>
                </source>
                <target>
                  <context value="organization2"/>
                  <contextType value="variable"/>
                  <element value="name"/>
                  <transform value="evaluate"/>
                  <parameter>
                    <valueString value="v.other"/>
                  </parameter>
                </target>
              </rule>
              <rule>
                <name value="telecom"/>
                <source>
                  <context value="wholeOrgan"/>
                  <element value="telecom"/>
                  <variable value="vvv"/>
                </source>
                <target>
                  <context value="organization2"/>
                  <contextType value="variable"/>
                  <element value="telecom"/>
                  <variable value="vvv"/>
                  <transform value="create"/>
                </target>
              </rule>
              <rule>
                <name value="addr"/>
                <source>
                  <context value="wholeOrgan"/>
                  <element value="addr"/>
                  <variable value="vvv"/>
                </source>
                <target>
                  <context value="organization2"/>
                  <contextType value="variable"/>
                  <element value="address"/>
                  <variable value="vvv"/>
                  <transform value="create"/>
                </target>
              </rule>
            </rule>
          </rule>
        </rule>
      </rule>
      <documentation value="PERFORMER"/>
    </rule>
    <rule>
      <name value="author"/>
      <source>
        <context value="cda"/>
        <element value="author"/>
        <variable value="srcAuthor"/>
      </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="practitionerRole"/>
        <transform value="create"/>
        <parameter>
          <valueString value="PractitionerRole"/>
        </parameter>
      </target>
      <target>
        <context value="practitionerRole"/>
        <contextType value="variable"/>
        <element value="id"/>
        <variable value="uuid6"/>
        <transform value="uuid"/>
      </target>
      <target>
        <context value="e5"/>
        <contextType value="variable"/>
        <element value="fullUrl"/>
        <transform value="append"/>
        <parameter>
          <valueString value="https://example/PractitionerRole/"/>
        </parameter>
        <parameter>
          <valueId value="uuid6"/>
        </parameter>
      </target>
      <target>
        <context value="request"/>
        <contextType value="variable"/>
        <element value="url"/>
        <transform value="copy"/>
        <parameter>
          <valueString value="PractitionerRole"/>
        </parameter>
      </target>
      <target>
        <context value="ac"/>
        <contextType value="variable"/>
        <element value="performer"/>
        <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/PractitionerRole/' + %practitionerRole.id"/>
        </parameter>
      </target>
      <rule>
        <name value="author"/>
        <source>
          <context value="srcAuthor"/>
          <element value="assignedAuthor"/>
          <variable value="assignedAuthor"/>
        </source>
        <rule>
          <name value="code"/>
          <source>
            <context value="assignedAuthor"/>
            <element value="code"/>
            <variable value="codice"/>
          </source>
          <target>
            <context value="practitionerRole"/>
            <contextType value="variable"/>
            <element value="code"/>
          </target>
        </rule>
        <rule>
          <name value="ASSAUth"/>
          <source>
            <context value="assignedAuthor"/>
          </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="PUT"/>
            </parameter>
          </target>
          <target>
            <context value="e7"/>
            <contextType value="variable"/>
            <element value="resource"/>
            <variable value="practitioner"/>
            <transform value="create"/>
            <parameter>
              <valueString value="Practitioner"/>
            </parameter>
          </target>
          <rule>
            <name value="functionCode"/>
            <source>
              <context value="srcAuthor"/>
              <element value="functionCode"/>
              <variable value="vvv"/>
            </source>
            <target>
              <context value="practitionerRole"/>
              <contextType value="variable"/>
              <element value="code"/>
              <variable value="vvv"/>
              <transform value="create"/>
            </target>
          </rule>
          <rule>
            <name value="code"/>
            <source>
              <context value="assignedAuthor"/>
              <element value="code"/>
              <variable value="vvv"/>
            </source>
            <target>
              <context value="practitionerRole"/>
              <contextType value="variable"/>
              <element value="code"/>
              <variable value="vvv"/>
              <transform value="create"/>
            </target>
          </rule>
          <rule>
            <name value="meta"/>
            <source>
              <context value="assignedAuthor"/>
            </source>
            <target>
              <context value="practitioner"/>
              <contextType value="variable"/>
              <element value="meta"/>
              <variable value="meta"/>
            </target>
            <rule>
              <name value="coding"/>
              <source>
                <context value="assignedAuthor"/>
              </source>
              <target>
                <context value="meta"/>
                <contextType value="variable"/>
                <element value="tag"/>
                <variable value="coding"/>
                <transform value="create"/>
                <parameter>
                  <valueString value="Coding"/>
                </parameter>
              </target>
              <rule>
                <name value="system"/>
                <source>
                  <context value="assignedAuthor"/>
                </source>
                <target>
                  <context value="coding"/>
                  <contextType value="variable"/>
                  <element value="system"/>
                  <transform value="copy"/>
                  <parameter>
                    <valueString value="http://algoritmodiscoring"/>
                  </parameter>
                </target>
              </rule>
              <rule>
                <name value="code"/>
                <source>
                  <context value="assignedAuthor"/>
                </source>
                <target>
                  <context value="coding"/>
                  <contextType value="variable"/>
                  <element value="code"/>
                  <transform value="copy"/>
                  <parameter>
                    <valueString value="ClinicalDocument/body/act/author"/>
                  </parameter>
                </target>
              </rule>
            </rule>
          </rule>
          <rule>
            <name value="identifier"/>
            <source>
              <context value="assignedAuthor"/>
              <element value="id"/>
              <variable value="id"/>
            </source>
            <target>
              <context value="practitioner"/>
              <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="ext"/>
              <source>
                <context value="id"/>
                <element value="extension"/>
                <variable value="ext"/>
              </source>
              <target>
                <context value="identifier"/>
                <contextType value="variable"/>
                <element value="value"/>
                <transform value="copy"/>
                <parameter>
                  <valueId value="ext"/>
                </parameter>
              </target>
              <rule>
                <name value="UUID"/>
                <source>
                  <context value="assignedAuthor"/>
                </source>
                <target>
                  <context value="request"/>
                  <contextType value="variable"/>
                  <element value="url"/>
                  <transform value="append"/>
                  <parameter>
                    <valueString value="Practitioner?identifier="/>
                  </parameter>
                  <parameter>
                    <valueId value="ext"/>
                  </parameter>
                </target>
              </rule>
            </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>
              <name value="r"/>
              <source>
                <context value="id"/>
                <element value="root"/>
                <variable value="r"/>
              </source>
              <rule>
                <name value="aut"/>
                <source>
                  <context value="id"/>
                  <element value="extension"/>
                  <variable value="ext"/>
                </source>
                <target>
                  <context value="practitioner"/>
                  <contextType value="variable"/>
                  <element value="id"/>
                  <variable value="uuid2"/>
                  <transform value="evaluate"/>
                  <parameter>
                    <valueString value="r + '-' + ext"/>
                  </parameter>
                </target>
                <target>
                  <context value="e7"/>
                  <contextType value="variable"/>
                  <element value="fullUrl"/>
                  <transform value="append"/>
                  <parameter>
                    <valueString value="https://example/Practitioner/"/>
                  </parameter>
                  <parameter>
                    <valueId value="uuid2"/>
                  </parameter>
                </target>
                <target>
                  <context value="practitionerRole"/>
                  <contextType value="variable"/>
                  <element value="practitioner"/>
                  <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/Practitioner/' + %practitioner.id"/>
                  </parameter>
                </target>
              </rule>
            </rule>
          </rule>
          <rule>
            <name value="2.16.840.1.113883.2.9.4.3.2"/>
            <source>
              <context value="assignedAuthor"/>
              <element value="id"/>
              <variable value="id"/>
              <condition value="(root = '2.16.840.1.113883.2.9.4.3.2')"/>
            </source>
            <rule>
              <name value="UUID"/>
              <source>
                <context value="id"/>
                <element value="extension"/>
                <variable value="ext"/>
              </source>
              <target>
                <context value="request"/>
                <contextType value="variable"/>
                <element value="url"/>
                <transform value="append"/>
                <parameter>
                  <valueString value="Practitioner?identifier="/>
                </parameter>
                <parameter>
                  <valueId value="ext"/>
                </parameter>
              </target>
            </rule>
          </rule>
          <rule>
            <name value="diverso"/>
            <source>
              <context value="assignedAuthor"/>
              <element value="id"/>
              <variable value="id"/>
              <condition value="(root != '2.16.840.1.113883.2.9.4.3.2')"/>
            </source>
            <rule>
              <name value="UUID"/>
              <source>
                <context value="id"/>
                <element value="extension"/>
                <variable value="ext"/>
              </source>
              <target>
                <context value="request"/>
                <contextType value="variable"/>
                <element value="url"/>
                <transform value="append"/>
                <parameter>
                  <valueString value="Practitioner?identifier="/>
                </parameter>
                <parameter>
                  <valueId value="ext"/>
                </parameter>
              </target>
            </rule>
          </rule>
          <rule>
            <name value="addr"/>
            <source>
              <context value="assignedAuthor"/>
              <element value="addr"/>
              <variable value="vvv"/>
            </source>
            <target>
              <context value="practitioner"/>
              <contextType value="variable"/>
              <element value="address"/>
              <variable value="vvv"/>
              <transform value="create"/>
            </target>
          </rule>
          <rule>
            <name value="telecom"/>
            <source>
              <context value="assignedAuthor"/>
              <element value="telecom"/>
              <variable value="vvv"/>
            </source>
            <target>
              <context value="practitioner"/>
              <contextType value="variable"/>
              <element value="telecom"/>
              <variable value="vvv"/>
              <transform value="create"/>
            </target>
          </rule>
          <rule>
            <name value="name"/>
            <source>
              <context value="assignedAuthor"/>
              <element value="assignedPerson"/>
              <variable value="person"/>
            </source>
            <rule>
              <name value="name"/>
              <source>
                <context value="person"/>
                <element value="name"/>
                <variable value="vvv"/>
              </source>
              <target>
                <context value="practitioner"/>
                <contextType value="variable"/>
                <element value="name"/>
                <variable value="vvv"/>
                <transform value="create"/>
              </target>
            </rule>
            <rule>
              <name value="birth"/>
              <source>
                <context value="person"/>
                <element value="birthTime"/>
                <variable value="birthTime"/>
              </source>
              <rule>
                <name value="value"/>
                <source>
                  <context value="birthTime"/>
                  <element value="value"/>
                  <variable value="date"/>
                </source>
                <target>
                  <context value="practitioner"/>
                  <contextType value="variable"/>
                  <element value="birthDate"/>
                  <transform value="truncate"/>
                  <parameter>
                    <valueId value="date"/>
                  </parameter>
                  <parameter>
                    <valueInteger value="10"/>
                  </parameter>
                </target>
              </rule>
            </rule>
            <documentation value="person"/>
          </rule>
        </rule>
        <rule>
          <name value="representedOrganization"/>
          <source>
            <context value="assignedAuthor"/>
            <element value="representedOrganization"/>
            <variable value="representedOrganization"/>
          </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="PUT"/>
            </parameter>
          </target>
          <target>
            <context value="e8"/>
            <contextType value="variable"/>
            <element value="resource"/>
            <variable value="organization"/>
            <transform value="create"/>
            <parameter>
              <valueString value="Organization"/>
            </parameter>
          </target>
          <rule>
            <name value="meta"/>
            <source>
              <context value="representedOrganization"/>
            </source>
            <target>
              <context value="organization"/>
              <contextType value="variable"/>
              <element value="meta"/>
              <variable value="meta"/>
            </target>
            <rule>
              <name value="coding"/>
              <source>
                <context value="representedOrganization"/>
              </source>
              <target>
                <context value="meta"/>
                <contextType value="variable"/>
                <element value="tag"/>
                <variable value="coding"/>
                <transform value="create"/>
                <parameter>
                  <valueString value="Coding"/>
                </parameter>
              </target>
              <rule>
                <name value="system"/>
                <source>
                  <context value="representedOrganization"/>
                </source>
                <target>
                  <context value="coding"/>
                  <contextType value="variable"/>
                  <element value="system"/>
                  <transform value="copy"/>
                  <parameter>
                    <valueString value="http://algoritmodiscoring"/>
                  </parameter>
                </target>
              </rule>
              <rule>
                <name value="code"/>
                <source>
                  <context value="representedOrganization"/>
                </source>
                <target>
                  <context value="coding"/>
                  <contextType value="variable"/>
                  <element value="code"/>
                  <transform value="copy"/>
                  <parameter>
                    <valueString
                                 value="ClinicalDocument/body/act/author/representedOrganization"/>
                  </parameter>
                </target>
              </rule>
            </rule>
          </rule>
          <rule>
            <name value="identifier"/>
            <source>
              <context value="representedOrganization"/>
              <element value="id"/>
              <variable value="id"/>
            </source>
            <target>
              <context value="organization"/>
              <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="ext"/>
              <source>
                <context value="id"/>
                <element value="extension"/>
                <variable value="ext"/>
              </source>
              <target>
                <context value="identifier"/>
                <contextType value="variable"/>
                <element value="value"/>
                <transform value="copy"/>
                <parameter>
                  <valueId value="ext"/>
                </parameter>
              </target>
              <rule>
                <name value="UUID"/>
                <source>
                  <context value="representedOrganization"/>
                </source>
                <target>
                  <context value="request"/>
                  <contextType value="variable"/>
                  <element value="url"/>
                  <transform value="append"/>
                  <parameter>
                    <valueString value="Organization?identifier="/>
                  </parameter>
                  <parameter>
                    <valueId value="ext"/>
                  </parameter>
                </target>
              </rule>
            </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>
              <name value="r"/>
              <source>
                <context value="id"/>
                <element value="root"/>
                <variable value="r"/>
              </source>
              <rule>
                <name value="org"/>
                <source>
                  <context value="id"/>
                  <element value="extension"/>
                  <variable value="ext"/>
                </source>
                <target>
                  <context value="organization"/>
                  <contextType value="variable"/>
                  <element value="id"/>
                  <variable value="uuid8"/>
                  <transform value="evaluate"/>
                  <parameter>
                    <valueString value="r + '-' + ext"/>
                  </parameter>
                </target>
                <target>
                  <context value="e8"/>
                  <contextType value="variable"/>
                  <element value="fullUrl"/>
                  <transform value="append"/>
                  <parameter>
                    <valueString value="https://example/Organization/"/>
                  </parameter>
                  <parameter>
                    <valueId value="uuid8"/>
                  </parameter>
                </target>
                <target>
                  <context value="practitionerRole"/>
                  <contextType value="variable"/>
                  <element value="organization"/>
                  <variable value="referenceOrg"/>
                  <transform value="create"/>
                  <parameter>
                    <valueString value="Reference"/>
                  </parameter>
                </target>
                <target>
                  <context value="referenceOrg"/>
                  <contextType value="variable"/>
                  <element value="reference"/>
                  <transform value="append"/>
                  <parameter>
                    <valueString value="https://example/Organization/"/>
                  </parameter>
                  <parameter>
                    <valueId value="uuid8"/>
                  </parameter>
                </target>
              </rule>
            </rule>
          </rule>
          <rule>
            <name value="name"/>
            <source>
              <context value="representedOrganization"/>
              <element value="name"/>
              <variable value="v"/>
            </source>
            <target>
              <context value="organization"/>
              <contextType value="variable"/>
              <element value="name"/>
              <transform value="evaluate"/>
              <parameter>
                <valueString value="v.other"/>
              </parameter>
            </target>
          </rule>
          <rule>
            <name value="telecom"/>
            <source>
              <context value="representedOrganization"/>
              <element value="telecom"/>
              <variable value="vvv"/>
            </source>
            <target>
              <context value="organization"/>
              <contextType value="variable"/>
              <element value="telecom"/>
              <variable value="vvv"/>
              <transform value="create"/>
            </target>
          </rule>
          <rule>
            <name value="addr"/>
            <source>
              <context value="representedOrganization"/>
              <element value="addr"/>
              <variable value="vvv"/>
            </source>
            <target>
              <context value="organization"/>
              <contextType value="variable"/>
              <element value="address"/>
              <variable value="vvv"/>
              <transform value="create"/>
            </target>
          </rule>
          <rule>
            <name value="OrgPartOf"/>
            <source>
              <context value="representedOrganization"/>
              <element value="asOrganizationPartOf"/>
              <variable value="OrgPartOf"/>
            </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="PUT"/>
              </parameter>
            </target>
            <target>
              <context value="e9"/>
              <contextType value="variable"/>
              <element value="resource"/>
              <variable value="organization1"/>
              <transform value="create"/>
              <parameter>
                <valueString value="Organization"/>
              </parameter>
            </target>
            <rule>
              <name value="meta"/>
              <source>
                <context value="OrgPartOf"/>
              </source>
              <target>
                <context value="organization1"/>
                <contextType value="variable"/>
                <element value="meta"/>
                <variable value="meta"/>
              </target>
              <rule>
                <name value="coding"/>
                <source>
                  <context value="OrgPartOf"/>
                </source>
                <target>
                  <context value="meta"/>
                  <contextType value="variable"/>
                  <element value="tag"/>
                  <variable value="coding"/>
                  <transform value="create"/>
                  <parameter>
                    <valueString value="Coding"/>
                  </parameter>
                </target>
                <rule>
                  <name value="system"/>
                  <source>
                    <context value="OrgPartOf"/>
                  </source>
                  <target>
                    <context value="coding"/>
                    <contextType value="variable"/>
                    <element value="system"/>
                    <transform value="copy"/>
                    <parameter>
                      <valueString value="http://algoritmodiscoring"/>
                    </parameter>
                  </target>
                </rule>
                <rule>
                  <name value="code"/>
                  <source>
                    <context value="OrgPartOf"/>
                  </source>
                  <target>
                    <context value="coding"/>
                    <contextType value="variable"/>
                    <element value="code"/>
                    <transform value="copy"/>
                    <parameter>
                      <valueString
                                   value="ClinicalDocument/body/act/author/representedOrganization/asOrganizationPartOf"/>
                    </parameter>
                  </target>
                </rule>
              </rule>
            </rule>
            <rule>
              <name value="identifier"/>
              <source>
                <context value="OrgPartOf"/>
                <element value="id"/>
                <variable value="id"/>
              </source>
              <target>
                <context value="organization1"/>
                <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="ext"/>
                <source>
                  <context value="id"/>
                  <element value="extension"/>
                  <variable value="ext"/>
                </source>
                <target>
                  <context value="identifier"/>
                  <contextType value="variable"/>
                  <element value="value"/>
                  <transform value="copy"/>
                  <parameter>
                    <valueId value="ext"/>
                  </parameter>
                </target>
                <rule>
                  <name value="UUID"/>
                  <source>
                    <context value="OrgPartOf"/>
                  </source>
                  <target>
                    <context value="request"/>
                    <contextType value="variable"/>
                    <element value="url"/>
                    <transform value="append"/>
                    <parameter>
                      <valueString value="Organization?identifier="/>
                    </parameter>
                    <parameter>
                      <valueId value="ext"/>
                    </parameter>
                  </target>
                </rule>
              </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>
                <name value="r"/>
                <source>
                  <context value="id"/>
                  <element value="root"/>
                  <variable value="r"/>
                </source>
                <rule>
                  <name value="org"/>
                  <source>
                    <context value="id"/>
                    <element value="extension"/>
                    <variable value="ext"/>
                  </source>
                  <target>
                    <context value="organization1"/>
                    <contextType value="variable"/>
                    <element value="id"/>
                    <variable value="uuid9"/>
                    <transform value="evaluate"/>
                    <parameter>
                      <valueString value="r + '-' + ext"/>
                    </parameter>
                  </target>
                  <target>
                    <context value="e9"/>
                    <contextType value="variable"/>
                    <element value="fullUrl"/>
                    <transform value="append"/>
                    <parameter>
                      <valueString value="https://example/Organization/"/>
                    </parameter>
                    <parameter>
                      <valueId value="uuid9"/>
                    </parameter>
                  </target>
                  <target>
                    <context value="organization"/>
                    <contextType value="variable"/>
                    <element value="partOf"/>
                    <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/Organization/' + %organization1.id"/>
                    </parameter>
                  </target>
                </rule>
              </rule>
            </rule>
            <rule>
              <name value="code"/>
              <source>
                <context value="OrgPartOf"/>
                <element value="code"/>
                <variable value="vvv"/>
              </source>
              <target>
                <context value="organization1"/>
                <contextType value="variable"/>
                <element value="type"/>
                <variable value="vvv"/>
                <transform value="create"/>
              </target>
            </rule>
            <rule>
              <name value="statusCode"/>
              <source>
                <context value="OrgPartOf"/>
                <element value="statusCode"/>
                <variable value="status"/>
                <condition value="(value = 'active')"/>
              </source>
              <target>
                <context value="organization1"/>
                <contextType value="variable"/>
                <element value="active"/>
                <transform value="create"/>
                <parameter>
                  <valueString value="boolean"/>
                </parameter>
              </target>
              <target>
                <context value="organization1"/>
                <contextType value="variable"/>
                <element value="active"/>
                <transform value="copy"/>
                <parameter>
                  <valueString value="true"/>
                </parameter>
              </target>
            </rule>
            <rule>
              <name value="wholeOrganization"/>
              <source>
                <context value="OrgPartOf"/>
                <element value="wholeOrganization"/>
                <variable value="wholeOrgan"/>
              </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="PUT"/>
                </parameter>
              </target>
              <target>
                <context value="e10"/>
                <contextType value="variable"/>
                <element value="resource"/>
                <variable value="organization2"/>
                <transform value="create"/>
                <parameter>
                  <valueString value="Organization"/>
                </parameter>
              </target>
              <rule>
                <name value="meta"/>
                <source>
                  <context value="wholeOrgan"/>
                </source>
                <target>
                  <context value="organization2"/>
                  <contextType value="variable"/>
                  <element value="meta"/>
                  <variable value="meta"/>
                </target>
                <rule>
                  <name value="coding"/>
                  <source>
                    <context value="wholeOrgan"/>
                  </source>
                  <target>
                    <context value="meta"/>
                    <contextType value="variable"/>
                    <element value="tag"/>
                    <variable value="coding"/>
                    <transform value="create"/>
                    <parameter>
                      <valueString value="Coding"/>
                    </parameter>
                  </target>
                  <rule>
                    <name value="system"/>
                    <source>
                      <context value="wholeOrgan"/>
                    </source>
                    <target>
                      <context value="coding"/>
                      <contextType value="variable"/>
                      <element value="system"/>
                      <transform value="copy"/>
                      <parameter>
                        <valueString value="http://algoritmodiscoring"/>
                      </parameter>
                    </target>
                  </rule>
                  <rule>
                    <name value="code"/>
                    <source>
                      <context value="wholeOrgan"/>
                    </source>
                    <target>
                      <context value="coding"/>
                      <contextType value="variable"/>
                      <element value="code"/>
                      <transform value="copy"/>
                      <parameter>
                        <valueString
                                     value="ClinicalDocument/body/act/author/representedOrganization/asOrganizationPartOf/wholeOrganization"/>
                      </parameter>
                    </target>
                  </rule>
                </rule>
              </rule>
              <rule>
                <name value="identifier"/>
                <source>
                  <context value="wholeOrgan"/>
                  <element value="id"/>
                  <variable value="id"/>
                </source>
                <target>
                  <context value="organization2"/>
                  <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="ext"/>
                  <source>
                    <context value="id"/>
                    <element value="extension"/>
                    <variable value="ext"/>
                  </source>
                  <target>
                    <context value="identifier"/>
                    <contextType value="variable"/>
                    <element value="value"/>
                    <transform value="copy"/>
                    <parameter>
                      <valueId value="ext"/>
                    </parameter>
                  </target>
                  <rule>
                    <name value="UUID"/>
                    <source>
                      <context value="wholeOrgan"/>
                    </source>
                    <target>
                      <context value="request"/>
                      <contextType value="variable"/>
                      <element value="url"/>
                      <transform value="append"/>
                      <parameter>
                        <valueString value="Organization?identifier="/>
                      </parameter>
                      <parameter>
                        <valueId value="ext"/>
                      </parameter>
                    </target>
                  </rule>
                </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>
                  <name value="r"/>
                  <source>
                    <context value="id"/>
                    <element value="root"/>
                    <variable value="r"/>
                  </source>
                  <rule>
                    <name value="org"/>
                    <source>
                      <context value="id"/>
                      <element value="extension"/>
                      <variable value="ext"/>
                    </source>
                    <target>
                      <context value="organization2"/>
                      <contextType value="variable"/>
                      <element value="id"/>
                      <variable value="uuid10"/>
                      <transform value="evaluate"/>
                      <parameter>
                        <valueString value="r + '-' + ext"/>
                      </parameter>
                    </target>
                    <target>
                      <context value="e10"/>
                      <contextType value="variable"/>
                      <element value="fullUrl"/>
                      <transform value="append"/>
                      <parameter>
                        <valueString value="https://example/Organization/"/>
                      </parameter>
                      <parameter>
                        <valueId value="uuid10"/>
                      </parameter>
                    </target>
                    <target>
                      <context value="organization1"/>
                      <contextType value="variable"/>
                      <element value="partOf"/>
                      <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/Organization/' + %organization2.id"/>
                      </parameter>
                    </target>
                  </rule>
                </rule>
              </rule>
              <rule>
                <name value="name"/>
                <source>
                  <context value="wholeOrgan"/>
                  <element value="name"/>
                  <variable value="v"/>
                </source>
                <target>
                  <context value="organization2"/>
                  <contextType value="variable"/>
                  <element value="name"/>
                  <transform value="evaluate"/>
                  <parameter>
                    <valueString value="v.other"/>
                  </parameter>
                </target>
              </rule>
              <rule>
                <name value="telecom"/>
                <source>
                  <context value="wholeOrgan"/>
                  <element value="telecom"/>
                  <variable value="vvv"/>
                </source>
                <target>
                  <context value="organization2"/>
                  <contextType value="variable"/>
                  <element value="telecom"/>
                  <variable value="vvv"/>
                  <transform value="create"/>
                </target>
              </rule>
              <rule>
                <name value="addr"/>
                <source>
                  <context value="wholeOrgan"/>
                  <element value="addr"/>
                  <variable value="vvv"/>
                </source>
                <target>
                  <context value="organization2"/>
                  <contextType value="variable"/>
                  <element value="address"/>
                  <variable value="vvv"/>
                  <transform value="create"/>
                </target>
              </rule>
            </rule>
          </rule>
          <documentation value="organization"/>
        </rule>
      </rule>
      <documentation value="AUTHOR"/>
    </rule>
    <rule>
      <name value="entryRelationship"/>
      <source>
        <context value="cda"/>
        <element value="entryRelationship"/>
        <variable value="entryRelationship"/>
      </source>
      <rule>
        <name value="Act"/>
        <source>
          <context value="entryRelationship"/>
          <element value="act"/>
          <variable value="act"/>
        </source>
        <rule>
          <name value="text"/>
          <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="ac"/>
              <contextType value="variable"/>
              <element value="conclusion"/>
              <transform value="evaluate"/>
              <parameter>
                <valueString value="reference.value"/>
              </parameter>
            </target>
          </rule>
        </rule>
      </rule>
      <documentation
                     value="&lt;!--entryRelationship per la gestione delle note e commenti--&gt;"/>
    </rule>
  </group>
  <group>
    <name value="Organizer"/>
    <typeMode value="none"/>
    <input>
      <name value="cda"/>
      <type value="Act"/>
      <mode value="source"/>
    </input>
    <input>
      <name value="org"/>
      <type value="Organizer"/>
      <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="observation"/>
      <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="org"/>
      </source>
      <target>
        <context value="observation"/>
        <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="org"/>
      </source>
      <target>
        <context value="observation"/>
        <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="org"/>
        <element value="code"/>
        <variable value="vvv"/>
      </source>
      <target>
        <context value="observation"/>
        <contextType value="variable"/>
        <element value="code"/>
        <variable value="vvv"/>
        <transform value="create"/>
      </target>
    </rule>
    <rule>
      <name value="act"/>
      <source>
        <context value="org"/>
        <condition value="org.code.exists().not()"/>
      </source>
      <rule>
        <name value="code"/>
        <source>
          <context value="cda"/>
          <element value="code"/>
          <variable value="vvv"/>
        </source>
        <target>
          <context value="observation"/>
          <contextType value="variable"/>
          <element value="code"/>
          <variable value="vvv"/>
          <transform value="create"/>
        </target>
      </rule>
    </rule>
    <rule>
      <name value="statusCode"/>
      <source>
        <context value="org"/>
        <element value="statusCode"/>
        <variable value="statusc"/>
        <condition value="(code = 'completed')"/>
      </source>
      <target>
        <context value="observation"/>
        <contextType value="variable"/>
        <element value="status"/>
        <transform value="copy"/>
        <parameter>
          <valueString value="final"/>
        </parameter>
      </target>
    </rule>
    <rule>
      <name value="statusCode"/>
      <source>
        <context value="org"/>
        <element value="statusCode"/>
        <variable value="statusc"/>
        <condition value="(code = 'active')"/>
      </source>
      <target>
        <context value="observation"/>
        <contextType value="variable"/>
        <element value="status"/>
        <transform value="copy"/>
        <parameter>
          <valueString value="registered"/>
        </parameter>
      </target>
    </rule>
    <rule>
      <name value="statusCode"/>
      <source>
        <context value="org"/>
        <element value="statusCode"/>
        <variable value="statusc"/>
        <condition value="(code = 'aborted')"/>
      </source>
      <target>
        <context value="observation"/>
        <contextType value="variable"/>
        <element value="status"/>
        <transform value="copy"/>
        <parameter>
          <valueString value="cancelled"/>
        </parameter>
      </target>
    </rule>
    <rule>
      <name value="statusCode"/>
      <source>
        <context value="org"/>
        <element value="statusCode"/>
        <variable value="statusc"/>
        <condition value="(code = 'suspended')"/>
      </source>
      <target>
        <context value="observation"/>
        <contextType value="variable"/>
        <element value="status"/>
        <transform value="copy"/>
        <parameter>
          <valueString value="partial"/>
        </parameter>
      </target>
    </rule>
    <rule>
      <name value="value2"/>
      <source>
        <context value="org"/>
        <element value="effectiveTime"/>
        <variable value="effectiveTime"/>
      </source>
      <target>
        <context value="observation"/>
        <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="org"/>
        <condition
                   value="effectiveTime.low.exists() or effectiveTime.high.exists()"/>
      </source>
      <rule>
        <name value="effectiveTime"/>
        <source>
          <context value="org"/>
          <element value="effectiveTime"/>
          <variable value="eff"/>
        </source>
        <target>
          <context value="observation"/>
          <contextType value="variable"/>
          <element value="effective"/>
          <variable value="period"/>
          <transform value="create"/>
          <parameter>
            <valueString value="Period"/>
          </parameter>
        </target>
        <dependent>
          <name value="IVLTSPeriod"/>
          <variable value="eff"/>
          <variable value="period"/>
        </dependent>
      </rule>
    </rule>
    <rule>
      <name value="specimen"/>
      <source>
        <context value="org"/>
        <element value="specimen"/>
        <variable value="spmn"/>
      </source>
      <target>
        <context value="bundle"/>
        <contextType value="variable"/>
        <element value="entry"/>
        <variable value="e4o"/>
      </target>
      <target>
        <context value="e4o"/>
        <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="e4o"/>
        <contextType value="variable"/>
        <element value="resource"/>
        <variable value="specimen"/>
        <transform value="create"/>
        <parameter>
          <valueString value="Specimen"/>
        </parameter>
      </target>
      <target>
        <context value="specimen"/>
        <contextType value="variable"/>
        <element value="id"/>
        <variable value="uuid4o"/>
        <transform value="uuid"/>
      </target>
      <target>
        <context value="e4o"/>
        <contextType value="variable"/>
        <element value="fullUrl"/>
        <transform value="append"/>
        <parameter>
          <valueString value="https://example/Specimen/"/>
        </parameter>
        <parameter>
          <valueId value="uuid4o"/>
        </parameter>
      </target>
      <target>
        <context value="request"/>
        <contextType value="variable"/>
        <element value="url"/>
        <transform value="copy"/>
        <parameter>
          <valueString value="Specimen"/>
        </parameter>
      </target>
      <target>
        <context value="observation"/>
        <contextType value="variable"/>
        <element value="specimen"/>
        <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/Specimen/' + %specimen.id"/>
        </parameter>
      </target>
      <rule>
        <name value="specimenRole"/>
        <source>
          <context value="spmn"/>
          <element value="specimenRole"/>
          <variable value="specimenRole"/>
        </source>
        <rule>
          <name value="id"/>
          <source>
            <context value="specimenRole"/>
            <element value="id"/>
            <variable value="id"/>
          </source>
          <target>
            <context value="specimen"/>
            <contextType value="variable"/>
            <element value="identifier"/>
          </target>
        </rule>
        <rule>
          <name value="specimenPlayingEntity"/>
          <source>
            <context value="specimenRole"/>
            <element value="specimenPlayingEntity"/>
            <variable value="specimenPlayingEntity"/>
          </source>
          <rule>
            <name value="code"/>
            <source>
              <context value="specimenPlayingEntity"/>
              <element value="code"/>
              <variable value="vvv"/>
            </source>
            <target>
              <context value="specimen"/>
              <contextType value="variable"/>
              <element value="type"/>
              <variable value="vvv"/>
              <transform value="create"/>
            </target>
          </rule>
        </rule>
      </rule>
      <documentation value="specimen"/>
    </rule>
    <rule>
      <name value="subject"/>
      <source>
        <context value="org"/>
        <element value="subject"/>
        <variable value="sbj"/>
      </source>
      <rule>
        <name value="relatedSubject"/>
        <source>
          <context value="sbj"/>
          <element value="relatedSubject"/>
          <variable value="relatedSubj"/>
        </source>
        <target>
          <context value="patient"/>
          <contextType value="variable"/>
          <element value="extension"/>
          <variable value="extension2"/>
        </target>
        <dependent>
          <name value="ExtSubjectAnimal"/>
          <variable value="relatedSubj"/>
          <variable value="extension2"/>
        </dependent>
      </rule>
      <documentation value="subject"/>
    </rule>
    <rule>
      <name value="performer"/>
      <source>
        <context value="org"/>
        <element value="performer"/>
        <variable value="performer"/>
      </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="practitionerRole"/>
        <transform value="create"/>
        <parameter>
          <valueString value="PractitionerRole"/>
        </parameter>
      </target>
      <target>
        <context value="practitionerRole"/>
        <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/PractitionerRole/"/>
        </parameter>
        <parameter>
          <valueId value="uuid1"/>
        </parameter>
      </target>
      <target>
        <context value="request"/>
        <contextType value="variable"/>
        <element value="url"/>
        <transform value="copy"/>
        <parameter>
          <valueString value="PractitionerRole"/>
        </parameter>
      </target>
      <rule>
        <name value="practitionerRole"/>
        <source>
          <context value="performer"/>
        </source>
        <target>
          <context value="observation"/>
          <contextType value="variable"/>
          <element value="performer"/>
          <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/PractitionerRole/' + %practitionerRole.id"/>
          </parameter>
        </target>
        <rule>
          <name value="entity"/>
          <source>
            <context value="performer"/>
            <element value="assignedEntity"/>
            <variable value="entity"/>
          </source>
          <rule>
            <name value="code"/>
            <source>
              <context value="entity"/>
              <element value="code"/>
              <variable value="vvv"/>
            </source>
            <target>
              <context value="practitionerRole"/>
              <contextType value="variable"/>
              <element value="code"/>
              <variable value="vvv"/>
              <transform value="create"/>
            </target>
          </rule>
          <rule>
            <name value="practitioner"/>
            <source>
              <context value="entity"/>
            </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="PUT"/>
              </parameter>
            </target>
            <target>
              <context value="e2"/>
              <contextType value="variable"/>
              <element value="resource"/>
              <variable value="practitioner"/>
              <transform value="create"/>
              <parameter>
                <valueString value="Practitioner"/>
              </parameter>
            </target>
            <rule>
              <name value="meta"/>
              <source>
                <context value="entity"/>
              </source>
              <target>
                <context value="practitioner"/>
                <contextType value="variable"/>
                <element value="meta"/>
                <variable value="meta"/>
              </target>
              <rule>
                <name value="coding"/>
                <source>
                  <context value="entity"/>
                </source>
                <target>
                  <context value="meta"/>
                  <contextType value="variable"/>
                  <element value="tag"/>
                  <variable value="coding"/>
                  <transform value="create"/>
                  <parameter>
                    <valueString value="Coding"/>
                  </parameter>
                </target>
                <rule>
                  <name value="system"/>
                  <source>
                    <context value="entity"/>
                  </source>
                  <target>
                    <context value="coding"/>
                    <contextType value="variable"/>
                    <element value="system"/>
                    <transform value="copy"/>
                    <parameter>
                      <valueString value="http://algoritmodiscoring"/>
                    </parameter>
                  </target>
                </rule>
                <rule>
                  <name value="code"/>
                  <source>
                    <context value="entity"/>
                  </source>
                  <target>
                    <context value="coding"/>
                    <contextType value="variable"/>
                    <element value="code"/>
                    <transform value="copy"/>
                    <parameter>
                      <valueString
                                   value="ClinicalDocument/body/organizer/performer"/>
                    </parameter>
                  </target>
                </rule>
              </rule>
            </rule>
            <rule>
              <name value="identifier"/>
              <source>
                <context value="entity"/>
                <element value="id"/>
                <variable value="id"/>
              </source>
              <target>
                <context value="practitioner"/>
                <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="ext"/>
                <source>
                  <context value="id"/>
                  <element value="extension"/>
                  <variable value="ext"/>
                </source>
                <target>
                  <context value="identifier"/>
                  <contextType value="variable"/>
                  <element value="value"/>
                  <transform value="copy"/>
                  <parameter>
                    <valueId value="ext"/>
                  </parameter>
                </target>
                <rule>
                  <name value="UUID"/>
                  <source>
                    <context value="entity"/>
                  </source>
                  <target>
                    <context value="request"/>
                    <contextType value="variable"/>
                    <element value="url"/>
                    <transform value="append"/>
                    <parameter>
                      <valueString value="Practitioner?identifier="/>
                    </parameter>
                    <parameter>
                      <valueId value="ext"/>
                    </parameter>
                  </target>
                </rule>
              </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>
                <name value="r"/>
                <source>
                  <context value="id"/>
                  <element value="root"/>
                  <variable value="r"/>
                </source>
                <rule>
                  <name value="aut"/>
                  <source>
                    <context value="id"/>
                    <element value="extension"/>
                    <variable value="ext"/>
                  </source>
                  <target>
                    <context value="practitioner"/>
                    <contextType value="variable"/>
                    <element value="id"/>
                    <variable value="uuid2"/>
                    <transform value="evaluate"/>
                    <parameter>
                      <valueString value="r + '-' + ext"/>
                    </parameter>
                  </target>
                  <target>
                    <context value="e2"/>
                    <contextType value="variable"/>
                    <element value="fullUrl"/>
                    <transform value="append"/>
                    <parameter>
                      <valueString value="https://example/Practitioner/"/>
                    </parameter>
                    <parameter>
                      <valueId value="uuid2"/>
                    </parameter>
                  </target>
                  <target>
                    <context value="practitionerRole"/>
                    <contextType value="variable"/>
                    <element value="practitioner"/>
                    <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/Practitioner/' + %practitioner.id"/>
                    </parameter>
                  </target>
                </rule>
              </rule>
            </rule>
            <rule>
              <name value="2.16.840.1.113883.2.9.4.3.2"/>
              <source>
                <context value="entity"/>
                <element value="id"/>
                <variable value="id"/>
                <condition value="(root = '2.16.840.1.113883.2.9.4.3.2')"/>
              </source>
              <rule>
                <name value="UUID"/>
                <source>
                  <context value="id"/>
                  <element value="extension"/>
                  <variable value="ext"/>
                </source>
                <target>
                  <context value="request"/>
                  <contextType value="variable"/>
                  <element value="url"/>
                  <transform value="append"/>
                  <parameter>
                    <valueString value="Practitioner?identifier="/>
                  </parameter>
                  <parameter>
                    <valueId value="ext"/>
                  </parameter>
                </target>
              </rule>
            </rule>
            <rule>
              <name value="diverso"/>
              <source>
                <context value="entity"/>
                <element value="id"/>
                <variable value="id"/>
                <condition value="(root != '2.16.840.1.113883.2.9.4.3.2')"/>
              </source>
              <rule>
                <name value="UUID"/>
                <source>
                  <context value="id"/>
                  <element value="extension"/>
                  <variable value="ext"/>
                </source>
                <target>
                  <context value="request"/>
                  <contextType value="variable"/>
                  <element value="url"/>
                  <transform value="append"/>
                  <parameter>
                    <valueString value="Practitioner?identifier="/>
                  </parameter>
                  <parameter>
                    <valueId value="ext"/>
                  </parameter>
                </target>
              </rule>
            </rule>
            <rule>
              <name value="addr"/>
              <source>
                <context value="entity"/>
                <element value="addr"/>
                <variable value="vvv"/>
              </source>
              <target>
                <context value="practitioner"/>
                <contextType value="variable"/>
                <element value="address"/>
                <variable value="vvv"/>
                <transform value="create"/>
              </target>
            </rule>
            <rule>
              <name value="telecom"/>
              <source>
                <context value="entity"/>
                <element value="telecom"/>
                <variable value="vvv"/>
              </source>
              <target>
                <context value="practitioner"/>
                <contextType value="variable"/>
                <element value="telecom"/>
                <variable value="vvv"/>
                <transform value="create"/>
              </target>
            </rule>
            <rule>
              <name value="name"/>
              <source>
                <context value="entity"/>
                <element value="assignedPerson"/>
                <variable value="person"/>
              </source>
              <rule>
                <name value="name"/>
                <source>
                  <context value="person"/>
                  <element value="name"/>
                  <variable value="vvv"/>
                </source>
                <target>
                  <context value="practitioner"/>
                  <contextType value="variable"/>
                  <element value="name"/>
                  <variable value="vvv"/>
                  <transform value="create"/>
                </target>
              </rule>
              <rule>
                <name value="birth"/>
                <source>
                  <context value="person"/>
                  <element value="birthTime"/>
                  <variable value="birthTime"/>
                </source>
                <rule>
                  <name value="value"/>
                  <source>
                    <context value="birthTime"/>
                    <element value="value"/>
                    <variable value="date"/>
                  </source>
                  <target>
                    <context value="practitioner"/>
                    <contextType value="variable"/>
                    <element value="birthDate"/>
                    <transform value="truncate"/>
                    <parameter>
                      <valueId value="date"/>
                    </parameter>
                    <parameter>
                      <valueInteger value="10"/>
                    </parameter>
                  </target>
                </rule>
              </rule>
            </rule>
            <rule>
              <name value="representedOrganization"/>
              <source>
                <context value="entity"/>
                <element value="representedOrganization"/>
                <variable value="representedOrganization"/>
              </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="PUT"/>
                </parameter>
              </target>
              <target>
                <context value="e3"/>
                <contextType value="variable"/>
                <element value="resource"/>
                <variable value="organization"/>
                <transform value="create"/>
                <parameter>
                  <valueString value="Organization"/>
                </parameter>
              </target>
              <rule>
                <name value="meta"/>
                <source>
                  <context value="representedOrganization"/>
                </source>
                <target>
                  <context value="organization"/>
                  <contextType value="variable"/>
                  <element value="meta"/>
                  <variable value="meta"/>
                </target>
                <rule>
                  <name value="coding"/>
                  <source>
                    <context value="representedOrganization"/>
                  </source>
                  <target>
                    <context value="meta"/>
                    <contextType value="variable"/>
                    <element value="tag"/>
                    <variable value="coding"/>
                    <transform value="create"/>
                    <parameter>
                      <valueString value="Coding"/>
                    </parameter>
                  </target>
                  <rule>
                    <name value="system"/>
                    <source>
                      <context value="representedOrganization"/>
                    </source>
                    <target>
                      <context value="coding"/>
                      <contextType value="variable"/>
                      <element value="system"/>
                      <transform value="copy"/>
                      <parameter>
                        <valueString value="http://algoritmodiscoring"/>
                      </parameter>
                    </target>
                  </rule>
                  <rule>
                    <name value="code"/>
                    <source>
                      <context value="representedOrganization"/>
                    </source>
                    <target>
                      <context value="coding"/>
                      <contextType value="variable"/>
                      <element value="code"/>
                      <transform value="copy"/>
                      <parameter>
                        <valueString
                                     value="ClinicalDocument/body/organizer/performer/representedOrganization"/>
                      </parameter>
                    </target>
                  </rule>
                </rule>
              </rule>
              <rule>
                <name value="identifier"/>
                <source>
                  <context value="representedOrganization"/>
                  <element value="id"/>
                  <variable value="id"/>
                </source>
                <target>
                  <context value="organization"/>
                  <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="ext"/>
                  <source>
                    <context value="id"/>
                    <element value="extension"/>
                    <variable value="ext"/>
                  </source>
                  <target>
                    <context value="identifier"/>
                    <contextType value="variable"/>
                    <element value="value"/>
                    <transform value="copy"/>
                    <parameter>
                      <valueId value="ext"/>
                    </parameter>
                  </target>
                  <rule>
                    <name value="UUID"/>
                    <source>
                      <context value="representedOrganization"/>
                    </source>
                    <target>
                      <context value="request"/>
                      <contextType value="variable"/>
                      <element value="url"/>
                      <transform value="append"/>
                      <parameter>
                        <valueString value="Organization?identifier="/>
                      </parameter>
                      <parameter>
                        <valueId value="ext"/>
                      </parameter>
                    </target>
                  </rule>
                </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>
                  <name value="r"/>
                  <source>
                    <context value="id"/>
                    <element value="root"/>
                    <variable value="r"/>
                  </source>
                  <rule>
                    <name value="aut"/>
                    <source>
                      <context value="id"/>
                      <element value="extension"/>
                      <variable value="ext"/>
                    </source>
                    <target>
                      <context value="organization"/>
                      <contextType value="variable"/>
                      <element value="id"/>
                      <variable value="uuid3"/>
                      <transform value="evaluate"/>
                      <parameter>
                        <valueString value="r + '-' + ext"/>
                      </parameter>
                    </target>
                    <target>
                      <context value="e3"/>
                      <contextType value="variable"/>
                      <element value="fullUrl"/>
                      <transform value="append"/>
                      <parameter>
                        <valueString value="https://example/Organization/"/>
                      </parameter>
                      <parameter>
                        <valueId value="uuid3"/>
                      </parameter>
                    </target>
                    <target>
                      <context value="practitionerRole"/>
                      <contextType value="variable"/>
                      <element value="organization"/>
                      <variable value="referenceOrg"/>
                      <transform value="create"/>
                      <parameter>
                        <valueString value="Reference"/>
                      </parameter>
                    </target>
                    <target>
                      <context value="referenceOrg"/>
                      <contextType value="variable"/>
                      <element value="reference"/>
                      <transform value="append"/>
                      <parameter>
                        <valueString value="https://example/Organization/"/>
                      </parameter>
                      <parameter>
                        <valueId value="uuid3"/>
                      </parameter>
                    </target>
                  </rule>
                </rule>
              </rule>
              <rule>
                <name value="name"/>
                <source>
                  <context value="representedOrganization"/>
                  <element value="name"/>
                  <variable value="v"/>
                </source>
                <target>
                  <context value="organization"/>
                  <contextType value="variable"/>
                  <element value="name"/>
                  <transform value="evaluate"/>
                  <parameter>
                    <valueString value="v.other"/>
                  </parameter>
                </target>
              </rule>
              <rule>
                <name value="telecom"/>
                <source>
                  <context value="representedOrganization"/>
                  <element value="telecom"/>
                  <variable value="vvv"/>
                </source>
                <target>
                  <context value="organization"/>
                  <contextType value="variable"/>
                  <element value="telecom"/>
                  <variable value="vvv"/>
                  <transform value="create"/>
                </target>
              </rule>
              <rule>
                <name value="addr"/>
                <source>
                  <context value="representedOrganization"/>
                  <element value="addr"/>
                  <variable value="vvv"/>
                </source>
                <target>
                  <context value="organization"/>
                  <contextType value="variable"/>
                  <element value="address"/>
                  <variable value="vvv"/>
                  <transform value="create"/>
                </target>
              </rule>
              <rule>
                <name value="OrgPartOf"/>
                <source>
                  <context value="representedOrganization"/>
                  <element value="asOrganizationPartOf"/>
                  <variable value="OrgPartOf"/>
                </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="PUT"/>
                  </parameter>
                </target>
                <target>
                  <context value="e4"/>
                  <contextType value="variable"/>
                  <element value="resource"/>
                  <variable value="organization1"/>
                  <transform value="create"/>
                  <parameter>
                    <valueString value="Organization"/>
                  </parameter>
                </target>
                <rule>
                  <name value="meta"/>
                  <source>
                    <context value="OrgPartOf"/>
                  </source>
                  <target>
                    <context value="organization1"/>
                    <contextType value="variable"/>
                    <element value="meta"/>
                    <variable value="meta"/>
                  </target>
                  <rule>
                    <name value="coding"/>
                    <source>
                      <context value="OrgPartOf"/>
                    </source>
                    <target>
                      <context value="meta"/>
                      <contextType value="variable"/>
                      <element value="tag"/>
                      <variable value="coding"/>
                      <transform value="create"/>
                      <parameter>
                        <valueString value="Coding"/>
                      </parameter>
                    </target>
                    <rule>
                      <name value="system"/>
                      <source>
                        <context value="OrgPartOf"/>
                      </source>
                      <target>
                        <context value="coding"/>
                        <contextType value="variable"/>
                        <element value="system"/>
                        <transform value="copy"/>
                        <parameter>
                          <valueString value="http://algoritmodiscoring"/>
                        </parameter>
                      </target>
                    </rule>
                    <rule>
                      <name value="code"/>
                      <source>
                        <context value="OrgPartOf"/>
                      </source>
                      <target>
                        <context value="coding"/>
                        <contextType value="variable"/>
                        <element value="code"/>
                        <transform value="copy"/>
                        <parameter>
                          <valueString
                                       value="ClinicalDocument/body/organizer/performer/representedOrganization/asOrganizationPartOf"/>
                        </parameter>
                      </target>
                    </rule>
                  </rule>
                </rule>
                <rule>
                  <name value="identifier"/>
                  <source>
                    <context value="OrgPartOf"/>
                    <element value="id"/>
                    <variable value="id"/>
                  </source>
                  <target>
                    <context value="organization1"/>
                    <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="ext"/>
                    <source>
                      <context value="id"/>
                      <element value="extension"/>
                      <variable value="ext"/>
                    </source>
                    <target>
                      <context value="identifier"/>
                      <contextType value="variable"/>
                      <element value="value"/>
                      <transform value="copy"/>
                      <parameter>
                        <valueId value="ext"/>
                      </parameter>
                    </target>
                    <rule>
                      <name value="UUID"/>
                      <source>
                        <context value="OrgPartOf"/>
                      </source>
                      <target>
                        <context value="request"/>
                        <contextType value="variable"/>
                        <element value="url"/>
                        <transform value="append"/>
                        <parameter>
                          <valueString value="Organization?identifier="/>
                        </parameter>
                        <parameter>
                          <valueId value="ext"/>
                        </parameter>
                      </target>
                    </rule>
                  </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>
                    <name value="r"/>
                    <source>
                      <context value="id"/>
                      <element value="root"/>
                      <variable value="r"/>
                    </source>
                    <rule>
                      <name value="org"/>
                      <source>
                        <context value="id"/>
                        <element value="extension"/>
                        <variable value="ext"/>
                      </source>
                      <target>
                        <context value="organization1"/>
                        <contextType value="variable"/>
                        <element value="id"/>
                        <variable value="uuid4"/>
                        <transform value="evaluate"/>
                        <parameter>
                          <valueString value="r + '-' + ext"/>
                        </parameter>
                      </target>
                      <target>
                        <context value="e4"/>
                        <contextType value="variable"/>
                        <element value="fullUrl"/>
                        <transform value="append"/>
                        <parameter>
                          <valueString value="https://example/Organization/"/>
                        </parameter>
                        <parameter>
                          <valueId value="uuid4"/>
                        </parameter>
                      </target>
                      <target>
                        <context value="organization"/>
                        <contextType value="variable"/>
                        <element value="partOf"/>
                        <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/Organization/' + %organization1.id"/>
                        </parameter>
                      </target>
                    </rule>
                  </rule>
                </rule>
                <rule>
                  <name value="code"/>
                  <source>
                    <context value="OrgPartOf"/>
                    <element value="code"/>
                    <variable value="vvv"/>
                  </source>
                  <target>
                    <context value="organization1"/>
                    <contextType value="variable"/>
                    <element value="type"/>
                    <variable value="vvv"/>
                    <transform value="create"/>
                  </target>
                </rule>
                <rule>
                  <name value="statusCode"/>
                  <source>
                    <context value="OrgPartOf"/>
                    <element value="statusCode"/>
                    <variable value="status"/>
                    <condition value="(value = 'active')"/>
                  </source>
                  <target>
                    <context value="organization1"/>
                    <contextType value="variable"/>
                    <element value="active"/>
                    <transform value="create"/>
                    <parameter>
                      <valueString value="boolean"/>
                    </parameter>
                  </target>
                  <target>
                    <context value="organization1"/>
                    <contextType value="variable"/>
                    <element value="active"/>
                    <transform value="copy"/>
                    <parameter>
                      <valueString value="true"/>
                    </parameter>
                  </target>
                </rule>
                <rule>
                  <name value="wholeOrganization"/>
                  <source>
                    <context value="OrgPartOf"/>
                    <element value="wholeOrganization"/>
                    <variable value="wholeOrgan"/>
                  </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="PUT"/>
                    </parameter>
                  </target>
                  <target>
                    <context value="e5"/>
                    <contextType value="variable"/>
                    <element value="resource"/>
                    <variable value="organization2"/>
                    <transform value="create"/>
                    <parameter>
                      <valueString value="Organization"/>
                    </parameter>
                  </target>
                  <rule>
                    <name value="meta"/>
                    <source>
                      <context value="wholeOrgan"/>
                    </source>
                    <target>
                      <context value="organization2"/>
                      <contextType value="variable"/>
                      <element value="meta"/>
                      <variable value="meta"/>
                    </target>
                    <rule>
                      <name value="coding"/>
                      <source>
                        <context value="wholeOrgan"/>
                      </source>
                      <target>
                        <context value="meta"/>
                        <contextType value="variable"/>
                        <element value="tag"/>
                        <variable value="coding"/>
                        <transform value="create"/>
                        <parameter>
                          <valueString value="Coding"/>
                        </parameter>
                      </target>
                      <rule>
                        <name value="system"/>
                        <source>
                          <context value="wholeOrgan"/>
                        </source>
                        <target>
                          <context value="coding"/>
                          <contextType value="variable"/>
                          <element value="system"/>
                          <transform value="copy"/>
                          <parameter>
                            <valueString value="http://algoritmodiscoring"/>
                          </parameter>
                        </target>
                      </rule>
                      <rule>
                        <name value="code"/>
                        <source>
                          <context value="wholeOrgan"/>
                        </source>
                        <target>
                          <context value="coding"/>
                          <contextType value="variable"/>
                          <element value="code"/>
                          <transform value="copy"/>
                          <parameter>
                            <valueString
                                         value="ClinicalDocument/body/organizer/performer/representedOrganization/asOrganizationPartOf/wholeOrganization"/>
                          </parameter>
                        </target>
                      </rule>
                    </rule>
                  </rule>
                  <rule>
                    <name value="identifier"/>
                    <source>
                      <context value="wholeOrgan"/>
                      <element value="id"/>
                      <variable value="id"/>
                    </source>
                    <target>
                      <context value="organization2"/>
                      <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="ext"/>
                      <source>
                        <context value="id"/>
                        <element value="extension"/>
                        <variable value="ext"/>
                      </source>
                      <target>
                        <context value="identifier"/>
                        <contextType value="variable"/>
                        <element value="value"/>
                        <transform value="copy"/>
                        <parameter>
                          <valueId value="ext"/>
                        </parameter>
                      </target>
                      <rule>
                        <name value="UUID"/>
                        <source>
                          <context value="wholeOrgan"/>
                        </source>
                        <target>
                          <context value="request"/>
                          <contextType value="variable"/>
                          <element value="url"/>
                          <transform value="append"/>
                          <parameter>
                            <valueString value="Organization?identifier="/>
                          </parameter>
                          <parameter>
                            <valueId value="ext"/>
                          </parameter>
                        </target>
                      </rule>
                    </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>
                      <name value="r"/>
                      <source>
                        <context value="id"/>
                        <element value="root"/>
                        <variable value="r"/>
                      </source>
                      <rule>
                        <name value="org"/>
                        <source>
                          <context value="id"/>
                          <element value="extension"/>
                          <variable value="ext"/>
                        </source>
                        <target>
                          <context value="organization2"/>
                          <contextType value="variable"/>
                          <element value="id"/>
                          <variable value="uuid4"/>
                          <transform value="evaluate"/>
                          <parameter>
                            <valueString value="r + '-' + ext"/>
                          </parameter>
                        </target>
                        <target>
                          <context value="e5"/>
                          <contextType value="variable"/>
                          <element value="fullUrl"/>
                          <transform value="append"/>
                          <parameter>
                            <valueString
                                         value="https://example/Organization/"/>
                          </parameter>
                          <parameter>
                            <valueId value="uuid4"/>
                          </parameter>
                        </target>
                        <target>
                          <context value="organization1"/>
                          <contextType value="variable"/>
                          <element value="partOf"/>
                          <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/Organization/' + %organization2.id"/>
                          </parameter>
                        </target>
                      </rule>
                    </rule>
                  </rule>
                  <rule>
                    <name value="name"/>
                    <source>
                      <context value="wholeOrgan"/>
                      <element value="name"/>
                      <variable value="v"/>
                    </source>
                    <target>
                      <context value="organization2"/>
                      <contextType value="variable"/>
                      <element value="name"/>
                      <transform value="evaluate"/>
                      <parameter>
                        <valueString value="v.other"/>
                      </parameter>
                    </target>
                  </rule>
                  <rule>
                    <name value="telecom"/>
                    <source>
                      <context value="wholeOrgan"/>
                      <element value="telecom"/>
                      <variable value="vvv"/>
                    </source>
                    <target>
                      <context value="organization2"/>
                      <contextType value="variable"/>
                      <element value="telecom"/>
                      <variable value="vvv"/>
                      <transform value="create"/>
                    </target>
                  </rule>
                  <rule>
                    <name value="addr"/>
                    <source>
                      <context value="wholeOrgan"/>
                      <element value="addr"/>
                      <variable value="vvv"/>
                    </source>
                    <target>
                      <context value="organization2"/>
                      <contextType value="variable"/>
                      <element value="address"/>
                      <variable value="vvv"/>
                      <transform value="create"/>
                    </target>
                  </rule>
                </rule>
              </rule>
            </rule>
          </rule>
        </rule>
      </rule>
      <documentation value="performer"/>
    </rule>
    <rule>
      <name value="author"/>
      <source>
        <context value="org"/>
        <element value="author"/>
        <variable value="srcAuthor"/>
      </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="practitionerRole"/>
        <transform value="create"/>
        <parameter>
          <valueString value="PractitionerRole"/>
        </parameter>
      </target>
      <target>
        <context value="practitionerRole"/>
        <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/PractitionerRole/"/>
        </parameter>
        <parameter>
          <valueId value="uuid6"/>
        </parameter>
      </target>
      <target>
        <context value="request"/>
        <contextType value="variable"/>
        <element value="url"/>
        <transform value="copy"/>
        <parameter>
          <valueString value="PractitionerRole"/>
        </parameter>
      </target>
      <target>
        <context value="observation"/>
        <contextType value="variable"/>
        <element value="performer"/>
        <variable value="referenceaut"/>
        <transform value="create"/>
        <parameter>
          <valueString value="Reference"/>
        </parameter>
      </target>
      <target>
        <context value="referenceaut"/>
        <contextType value="variable"/>
        <element value="reference"/>
        <transform value="evaluate"/>
        <parameter>
          <valueString
                       value="'https://example/PractitionerRole/' + %practitionerRole.id"/>
        </parameter>
      </target>
      <rule>
        <name value="assignedAuthor"/>
        <source>
          <context value="srcAuthor"/>
          <element value="assignedAuthor"/>
          <variable value="assignedAuthor"/>
        </source>
        <rule>
          <name value="code"/>
          <source>
            <context value="assignedAuthor"/>
            <element value="code"/>
            <variable value="codice"/>
          </source>
          <target>
            <context value="practitionerRole"/>
            <contextType value="variable"/>
            <element value="code"/>
            <variable value="code2"/>
          </target>
          <dependent>
            <name value="CECodeableConcept"/>
            <variable value="codice"/>
            <variable value="code2"/>
          </dependent>
        </rule>
        <rule>
          <name value="ASSAUth"/>
          <source>
            <context value="assignedAuthor"/>
          </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="PUT"/>
            </parameter>
          </target>
          <target>
            <context value="e7"/>
            <contextType value="variable"/>
            <element value="resource"/>
            <variable value="practitioner"/>
            <transform value="create"/>
            <parameter>
              <valueString value="Practitioner"/>
            </parameter>
          </target>
          <rule>
            <name value="functionCode"/>
            <source>
              <context value="srcAuthor"/>
              <element value="functionCode"/>
              <variable value="vvv"/>
            </source>
            <target>
              <context value="practitionerRole"/>
              <contextType value="variable"/>
              <element value="code"/>
              <variable value="vvv"/>
              <transform value="create"/>
            </target>
          </rule>
          <rule>
            <name value="meta"/>
            <source>
              <context value="assignedAuthor"/>
            </source>
            <target>
              <context value="practitioner"/>
              <contextType value="variable"/>
              <element value="meta"/>
              <variable value="meta"/>
            </target>
            <rule>
              <name value="coding"/>
              <source>
                <context value="assignedAuthor"/>
              </source>
              <target>
                <context value="meta"/>
                <contextType value="variable"/>
                <element value="tag"/>
                <variable value="coding"/>
                <transform value="create"/>
                <parameter>
                  <valueString value="Coding"/>
                </parameter>
              </target>
              <rule>
                <name value="system"/>
                <source>
                  <context value="assignedAuthor"/>
                </source>
                <target>
                  <context value="coding"/>
                  <contextType value="variable"/>
                  <element value="system"/>
                  <transform value="copy"/>
                  <parameter>
                    <valueString value="http://algoritmodiscoring"/>
                  </parameter>
                </target>
              </rule>
              <rule>
                <name value="code"/>
                <source>
                  <context value="assignedAuthor"/>
                </source>
                <target>
                  <context value="coding"/>
                  <contextType value="variable"/>
                  <element value="code"/>
                  <transform value="copy"/>
                  <parameter>
                    <valueString
                                 value="ClinicalDocument/body/organizer/author"/>
                  </parameter>
                </target>
              </rule>
            </rule>
            <documentation
                           value="assignedAuthor.code -&gt; practitionerRole.code;"/>
          </rule>
          <rule>
            <name value="identifier"/>
            <source>
              <context value="assignedAuthor"/>
              <element value="id"/>
              <variable value="id"/>
            </source>
            <target>
              <context value="practitioner"/>
              <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="ext"/>
              <source>
                <context value="id"/>
                <element value="extension"/>
                <variable value="ext"/>
              </source>
              <target>
                <context value="identifier"/>
                <contextType value="variable"/>
                <element value="value"/>
                <transform value="copy"/>
                <parameter>
                  <valueId value="ext"/>
                </parameter>
              </target>
              <rule>
                <name value="UUID"/>
                <source>
                  <context value="assignedAuthor"/>
                </source>
                <target>
                  <context value="request"/>
                  <contextType value="variable"/>
                  <element value="url"/>
                  <transform value="append"/>
                  <parameter>
                    <valueString value="Practitioner?identifier="/>
                  </parameter>
                  <parameter>
                    <valueId value="ext"/>
                  </parameter>
                </target>
              </rule>
            </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>
              <name value="r"/>
              <source>
                <context value="id"/>
                <element value="root"/>
                <variable value="r"/>
              </source>
              <rule>
                <name value="aut"/>
                <source>
                  <context value="id"/>
                  <element value="extension"/>
                  <variable value="ext"/>
                </source>
                <target>
                  <context value="practitioner"/>
                  <contextType value="variable"/>
                  <element value="id"/>
                  <variable value="uuid7"/>
                  <transform value="evaluate"/>
                  <parameter>
                    <valueString value="r + '-' + ext"/>
                  </parameter>
                </target>
                <target>
                  <context value="e7"/>
                  <contextType value="variable"/>
                  <element value="fullUrl"/>
                  <transform value="append"/>
                  <parameter>
                    <valueString value="https://example/Practitioner/"/>
                  </parameter>
                  <parameter>
                    <valueId value="uuid7"/>
                  </parameter>
                </target>
                <target>
                  <context value="practitionerRole"/>
                  <contextType value="variable"/>
                  <element value="practitioner"/>
                  <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/Practitioner/' + %practitioner.id"/>
                  </parameter>
                </target>
              </rule>
            </rule>
          </rule>
          <rule>
            <name value="2.16.840.1.113883.2.9.4.3.2"/>
            <source>
              <context value="assignedAuthor"/>
              <element value="id"/>
              <variable value="id"/>
              <condition value="(root = '2.16.840.1.113883.2.9.4.3.2')"/>
            </source>
            <rule>
              <name value="UUID"/>
              <source>
                <context value="id"/>
                <element value="extension"/>
                <variable value="ext"/>
              </source>
              <target>
                <context value="request"/>
                <contextType value="variable"/>
                <element value="url"/>
                <transform value="append"/>
                <parameter>
                  <valueString value="Practitioner?identifier="/>
                </parameter>
                <parameter>
                  <valueId value="ext"/>
                </parameter>
              </target>
            </rule>
          </rule>
          <rule>
            <name value="diverso"/>
            <source>
              <context value="assignedAuthor"/>
              <element value="id"/>
              <variable value="id"/>
              <condition value="(root != '2.16.840.1.113883.2.9.4.3.2')"/>
            </source>
            <rule>
              <name value="UUID"/>
              <source>
                <context value="id"/>
                <element value="extension"/>
                <variable value="ext"/>
              </source>
              <target>
                <context value="request"/>
                <contextType value="variable"/>
                <element value="url"/>
                <transform value="append"/>
                <parameter>
                  <valueString value="Practitioner?identifier="/>
                </parameter>
                <parameter>
                  <valueId value="ext"/>
                </parameter>
              </target>
            </rule>
          </rule>
          <rule>
            <name value="addr"/>
            <source>
              <context value="assignedAuthor"/>
              <element value="addr"/>
              <variable value="vvv"/>
            </source>
            <target>
              <context value="practitioner"/>
              <contextType value="variable"/>
              <element value="address"/>
              <variable value="vvv"/>
              <transform value="create"/>
            </target>
          </rule>
          <rule>
            <name value="telecom"/>
            <source>
              <context value="assignedAuthor"/>
              <element value="telecom"/>
              <variable value="vvv"/>
            </source>
            <target>
              <context value="practitioner"/>
              <contextType value="variable"/>
              <element value="telecom"/>
              <variable value="vvv"/>
              <transform value="create"/>
            </target>
          </rule>
          <rule>
            <name value="name"/>
            <source>
              <context value="assignedAuthor"/>
              <element value="assignedPerson"/>
              <variable value="person"/>
            </source>
            <rule>
              <name value="name"/>
              <source>
                <context value="person"/>
                <element value="name"/>
                <variable value="vvv"/>
              </source>
              <target>
                <context value="practitioner"/>
                <contextType value="variable"/>
                <element value="name"/>
                <variable value="vvv"/>
                <transform value="create"/>
              </target>
            </rule>
            <rule>
              <name value="birth"/>
              <source>
                <context value="person"/>
                <element value="birthTime"/>
                <variable value="birthTime"/>
              </source>
              <rule>
                <name value="value"/>
                <source>
                  <context value="birthTime"/>
                  <element value="value"/>
                  <variable value="date"/>
                </source>
                <target>
                  <context value="practitioner"/>
                  <contextType value="variable"/>
                  <element value="birthDate"/>
                  <transform value="truncate"/>
                  <parameter>
                    <valueId value="date"/>
                  </parameter>
                  <parameter>
                    <valueInteger value="10"/>
                  </parameter>
                </target>
              </rule>
            </rule>
            <documentation value="person"/>
          </rule>
        </rule>
        <rule>
          <name value="representedOrganization"/>
          <source>
            <context value="assignedAuthor"/>
            <element value="representedOrganization"/>
            <variable value="representedOrganization"/>
          </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="PUT"/>
            </parameter>
          </target>
          <target>
            <context value="e8"/>
            <contextType value="variable"/>
            <element value="resource"/>
            <variable value="organization"/>
            <transform value="create"/>
            <parameter>
              <valueString value="Organization"/>
            </parameter>
          </target>
          <rule>
            <name value="meta"/>
            <source>
              <context value="representedOrganization"/>
            </source>
            <target>
              <context value="organization"/>
              <contextType value="variable"/>
              <element value="meta"/>
              <variable value="meta"/>
            </target>
            <rule>
              <name value="coding"/>
              <source>
                <context value="representedOrganization"/>
              </source>
              <target>
                <context value="meta"/>
                <contextType value="variable"/>
                <element value="tag"/>
                <variable value="coding"/>
                <transform value="create"/>
                <parameter>
                  <valueString value="Coding"/>
                </parameter>
              </target>
              <rule>
                <name value="system"/>
                <source>
                  <context value="representedOrganization"/>
                </source>
                <target>
                  <context value="coding"/>
                  <contextType value="variable"/>
                  <element value="system"/>
                  <transform value="copy"/>
                  <parameter>
                    <valueString value="http://algoritmodiscoring"/>
                  </parameter>
                </target>
              </rule>
              <rule>
                <name value="code"/>
                <source>
                  <context value="representedOrganization"/>
                </source>
                <target>
                  <context value="coding"/>
                  <contextType value="variable"/>
                  <element value="code"/>
                  <transform value="copy"/>
                  <parameter>
                    <valueString
                                 value="ClinicalDocument/body/organizer/author/representedOrganization"/>
                  </parameter>
                </target>
              </rule>
            </rule>
          </rule>
          <rule>
            <name value="identifier"/>
            <source>
              <context value="representedOrganization"/>
              <element value="id"/>
              <variable value="id"/>
            </source>
            <target>
              <context value="organization"/>
              <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="ext"/>
              <source>
                <context value="id"/>
                <element value="extension"/>
                <variable value="ext"/>
              </source>
              <target>
                <context value="identifier"/>
                <contextType value="variable"/>
                <element value="value"/>
                <transform value="copy"/>
                <parameter>
                  <valueId value="ext"/>
                </parameter>
              </target>
              <rule>
                <name value="UUID"/>
                <source>
                  <context value="representedOrganization"/>
                </source>
                <target>
                  <context value="request"/>
                  <contextType value="variable"/>
                  <element value="url"/>
                  <transform value="append"/>
                  <parameter>
                    <valueString value="Organization?identifier="/>
                  </parameter>
                  <parameter>
                    <valueId value="ext"/>
                  </parameter>
                </target>
              </rule>
            </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>
              <name value="r"/>
              <source>
                <context value="id"/>
                <element value="root"/>
                <variable value="r"/>
              </source>
              <rule>
                <name value="aut"/>
                <source>
                  <context value="id"/>
                  <element value="extension"/>
                  <variable value="ext"/>
                </source>
                <target>
                  <context value="organization"/>
                  <contextType value="variable"/>
                  <element value="id"/>
                  <variable value="uuid8"/>
                  <transform value="evaluate"/>
                  <parameter>
                    <valueString value="r + '-' + ext"/>
                  </parameter>
                </target>
                <target>
                  <context value="e8"/>
                  <contextType value="variable"/>
                  <element value="fullUrl"/>
                  <transform value="append"/>
                  <parameter>
                    <valueString value="https://example/Organization/"/>
                  </parameter>
                  <parameter>
                    <valueId value="uuid8"/>
                  </parameter>
                </target>
                <target>
                  <context value="practitionerRole"/>
                  <contextType value="variable"/>
                  <element value="organization"/>
                  <variable value="referenceOrg"/>
                  <transform value="create"/>
                  <parameter>
                    <valueString value="Reference"/>
                  </parameter>
                </target>
                <target>
                  <context value="referenceOrg"/>
                  <contextType value="variable"/>
                  <element value="reference"/>
                  <transform value="append"/>
                  <parameter>
                    <valueString value="https://example/Organization/"/>
                  </parameter>
                  <parameter>
                    <valueId value="uuid8"/>
                  </parameter>
                </target>
              </rule>
            </rule>
          </rule>
          <rule>
            <name value="name"/>
            <source>
              <context value="representedOrganization"/>
              <element value="name"/>
              <variable value="v"/>
            </source>
            <target>
              <context value="organization"/>
              <contextType value="variable"/>
              <element value="name"/>
              <transform value="evaluate"/>
              <parameter>
                <valueString value="v.other"/>
              </parameter>
            </target>
          </rule>
          <rule>
            <name value="telecom"/>
            <source>
              <context value="representedOrganization"/>
              <element value="telecom"/>
              <variable value="vvv"/>
            </source>
            <target>
              <context value="organization"/>
              <contextType value="variable"/>
              <element value="telecom"/>
              <variable value="vvv"/>
              <transform value="create"/>
            </target>
          </rule>
          <rule>
            <name value="addr"/>
            <source>
              <context value="representedOrganization"/>
              <element value="addr"/>
              <variable value="vvv"/>
            </source>
            <target>
              <context value="organization"/>
              <contextType value="variable"/>
              <element value="address"/>
              <variable value="vvv"/>
              <transform value="create"/>
            </target>
          </rule>
          <rule>
            <name value="OrgPartOf"/>
            <source>
              <context value="representedOrganization"/>
              <element value="asOrganizationPartOf"/>
              <variable value="OrgPartOf"/>
            </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="PUT"/>
              </parameter>
            </target>
            <target>
              <context value="e9"/>
              <contextType value="variable"/>
              <element value="resource"/>
              <variable value="organization1"/>
              <transform value="create"/>
              <parameter>
                <valueString value="Organization"/>
              </parameter>
            </target>
            <rule>
              <name value="meta"/>
              <source>
                <context value="OrgPartOf"/>
              </source>
              <target>
                <context value="organization1"/>
                <contextType value="variable"/>
                <element value="meta"/>
                <variable value="meta"/>
              </target>
              <rule>
                <name value="coding"/>
                <source>
                  <context value="OrgPartOf"/>
                </source>
                <target>
                  <context value="meta"/>
                  <contextType value="variable"/>
                  <element value="tag"/>
                  <variable value="coding"/>
                  <transform value="create"/>
                  <parameter>
                    <valueString value="Coding"/>
                  </parameter>
                </target>
                <rule>
                  <name value="system"/>
                  <source>
                    <context value="OrgPartOf"/>
                  </source>
                  <target>
                    <context value="coding"/>
                    <contextType value="variable"/>
                    <element value="system"/>
                    <transform value="copy"/>
                    <parameter>
                      <valueString value="http://algoritmodiscoring"/>
                    </parameter>
                  </target>
                </rule>
                <rule>
                  <name value="code"/>
                  <source>
                    <context value="OrgPartOf"/>
                  </source>
                  <target>
                    <context value="coding"/>
                    <contextType value="variable"/>
                    <element value="code"/>
                    <transform value="copy"/>
                    <parameter>
                      <valueString
                                   value="ClinicalDocument/body/organizer/author/representedOrganization/asOrganizationPartOf"/>
                    </parameter>
                  </target>
                </rule>
              </rule>
            </rule>
            <rule>
              <name value="identifier"/>
              <source>
                <context value="OrgPartOf"/>
                <element value="id"/>
                <variable value="id"/>
              </source>
              <target>
                <context value="organization1"/>
                <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="ext"/>
                <source>
                  <context value="id"/>
                  <element value="extension"/>
                  <variable value="ext"/>
                </source>
                <target>
                  <context value="identifier"/>
                  <contextType value="variable"/>
                  <element value="value"/>
                  <transform value="copy"/>
                  <parameter>
                    <valueId value="ext"/>
                  </parameter>
                </target>
                <rule>
                  <name value="UUID"/>
                  <source>
                    <context value="OrgPartOf"/>
                  </source>
                  <target>
                    <context value="request"/>
                    <contextType value="variable"/>
                    <element value="url"/>
                    <transform value="append"/>
                    <parameter>
                      <valueString value="Organization?identifier="/>
                    </parameter>
                    <parameter>
                      <valueId value="ext"/>
                    </parameter>
                  </target>
                </rule>
              </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>
                <name value="r"/>
                <source>
                  <context value="id"/>
                  <element value="root"/>
                  <variable value="r"/>
                </source>
                <rule>
                  <name value="aut"/>
                  <source>
                    <context value="id"/>
                    <element value="extension"/>
                    <variable value="ext"/>
                  </source>
                  <target>
                    <context value="organization1"/>
                    <contextType value="variable"/>
                    <element value="id"/>
                    <variable value="uuid9"/>
                    <transform value="evaluate"/>
                    <parameter>
                      <valueString value="r + '-' + ext"/>
                    </parameter>
                  </target>
                  <target>
                    <context value="e9"/>
                    <contextType value="variable"/>
                    <element value="fullUrl"/>
                    <transform value="append"/>
                    <parameter>
                      <valueString value="https://example/Organization/"/>
                    </parameter>
                    <parameter>
                      <valueId value="uuid9"/>
                    </parameter>
                  </target>
                  <target>
                    <context value="organization"/>
                    <contextType value="variable"/>
                    <element value="partOf"/>
                    <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/Organization/' + %organization1.id"/>
                    </parameter>
                  </target>
                </rule>
              </rule>
            </rule>
            <rule>
              <name value="code"/>
              <source>
                <context value="OrgPartOf"/>
                <element value="code"/>
                <variable value="vvv"/>
              </source>
              <target>
                <context value="organization1"/>
                <contextType value="variable"/>
                <element value="type"/>
                <variable value="vvv"/>
                <transform value="create"/>
              </target>
            </rule>
            <rule>
              <name value="statusCode"/>
              <source>
                <context value="OrgPartOf"/>
                <element value="statusCode"/>
                <variable value="status"/>
                <condition value="(value = 'active')"/>
              </source>
              <target>
                <context value="organization1"/>
                <contextType value="variable"/>
                <element value="active"/>
                <transform value="create"/>
                <parameter>
                  <valueString value="boolean"/>
                </parameter>
              </target>
              <target>
                <context value="organization1"/>
                <contextType value="variable"/>
                <element value="active"/>
                <transform value="copy"/>
                <parameter>
                  <valueString value="true"/>
                </parameter>
              </target>
            </rule>
            <rule>
              <name value="wholeOrganization"/>
              <source>
                <context value="OrgPartOf"/>
                <element value="wholeOrganization"/>
                <variable value="wholeOrgan"/>
              </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="PUT"/>
                </parameter>
              </target>
              <target>
                <context value="e10"/>
                <contextType value="variable"/>
                <element value="resource"/>
                <variable value="organization2"/>
                <transform value="create"/>
                <parameter>
                  <valueString value="Organization"/>
                </parameter>
              </target>
              <rule>
                <name value="meta"/>
                <source>
                  <context value="OrgPartOf"/>
                </source>
                <target>
                  <context value="organization2"/>
                  <contextType value="variable"/>
                  <element value="meta"/>
                  <variable value="meta"/>
                </target>
                <rule>
                  <name value="coding"/>
                  <source>
                    <context value="OrgPartOf"/>
                  </source>
                  <target>
                    <context value="meta"/>
                    <contextType value="variable"/>
                    <element value="tag"/>
                    <variable value="coding"/>
                    <transform value="create"/>
                    <parameter>
                      <valueString value="Coding"/>
                    </parameter>
                  </target>
                  <rule>
                    <name value="system"/>
                    <source>
                      <context value="OrgPartOf"/>
                    </source>
                    <target>
                      <context value="coding"/>
                      <contextType value="variable"/>
                      <element value="system"/>
                      <transform value="copy"/>
                      <parameter>
                        <valueString value="http://algoritmodiscoring"/>
                      </parameter>
                    </target>
                  </rule>
                  <rule>
                    <name value="code"/>
                    <source>
                      <context value="OrgPartOf"/>
                    </source>
                    <target>
                      <context value="coding"/>
                      <contextType value="variable"/>
                      <element value="code"/>
                      <transform value="copy"/>
                      <parameter>
                        <valueString
                                     value="ClinicalDocument/body/organizer/author/representedOrganization/asOrganizationPartOf/wholeOrganization"/>
                      </parameter>
                    </target>
                  </rule>
                </rule>
              </rule>
              <rule>
                <name value="identifier"/>
                <source>
                  <context value="wholeOrgan"/>
                  <element value="id"/>
                  <variable value="id"/>
                </source>
                <target>
                  <context value="organization2"/>
                  <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="ext"/>
                  <source>
                    <context value="id"/>
                    <element value="extension"/>
                    <variable value="ext"/>
                  </source>
                  <target>
                    <context value="identifier"/>
                    <contextType value="variable"/>
                    <element value="value"/>
                    <transform value="copy"/>
                    <parameter>
                      <valueId value="ext"/>
                    </parameter>
                  </target>
                  <rule>
                    <name value="UUID"/>
                    <source>
                      <context value="wholeOrgan"/>
                    </source>
                    <target>
                      <context value="request"/>
                      <contextType value="variable"/>
                      <element value="url"/>
                      <transform value="append"/>
                      <parameter>
                        <valueString value="Organization?identifier="/>
                      </parameter>
                      <parameter>
                        <valueId value="ext"/>
                      </parameter>
                    </target>
                  </rule>
                </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>
                  <name value="r"/>
                  <source>
                    <context value="id"/>
                    <element value="root"/>
                    <variable value="r"/>
                  </source>
                  <rule>
                    <name value="aut"/>
                    <source>
                      <context value="id"/>
                      <element value="extension"/>
                      <variable value="ext"/>
                    </source>
                    <target>
                      <context value="organization2"/>
                      <contextType value="variable"/>
                      <element value="id"/>
                      <variable value="uuid10"/>
                      <transform value="evaluate"/>
                      <parameter>
                        <valueString value="r + '-' + ext"/>
                      </parameter>
                    </target>
                    <target>
                      <context value="e10"/>
                      <contextType value="variable"/>
                      <element value="fullUrl"/>
                      <transform value="append"/>
                      <parameter>
                        <valueString value="https://example/Organization/"/>
                      </parameter>
                      <parameter>
                        <valueId value="uuid10"/>
                      </parameter>
                    </target>
                    <target>
                      <context value="organization1"/>
                      <contextType value="variable"/>
                      <element value="partOf"/>
                      <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/Organization/' + %organization2.id"/>
                      </parameter>
                    </target>
                  </rule>
                </rule>
              </rule>
              <rule>
                <name value="name"/>
                <source>
                  <context value="wholeOrgan"/>
                  <element value="name"/>
                  <variable value="v"/>
                </source>
                <target>
                  <context value="organization2"/>
                  <contextType value="variable"/>
                  <element value="name"/>
                  <transform value="evaluate"/>
                  <parameter>
                    <valueString value="v.other"/>
                  </parameter>
                </target>
              </rule>
              <rule>
                <name value="telecom"/>
                <source>
                  <context value="wholeOrgan"/>
                  <element value="telecom"/>
                  <variable value="vvv"/>
                </source>
                <target>
                  <context value="organization2"/>
                  <contextType value="variable"/>
                  <element value="telecom"/>
                  <variable value="vvv"/>
                  <transform value="create"/>
                </target>
              </rule>
              <rule>
                <name value="addr"/>
                <source>
                  <context value="wholeOrgan"/>
                  <element value="addr"/>
                  <variable value="vvv"/>
                </source>
                <target>
                  <context value="organization2"/>
                  <contextType value="variable"/>
                  <element value="address"/>
                  <variable value="vvv"/>
                  <transform value="create"/>
                </target>
              </rule>
            </rule>
          </rule>
          <documentation value="organization"/>
        </rule>
        <rule>
          <name value="Device"/>
          <source>
            <context value="assignedAuthor"/>
            <element value="assignedAuthoringDevice"/>
            <variable value="assignedAuthoringDevice"/>
          </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="device"/>
            <transform value="create"/>
            <parameter>
              <valueString value="Device"/>
            </parameter>
          </target>
          <target>
            <context value="device"/>
            <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/Device/"/>
            </parameter>
            <parameter>
              <valueId value="uuid11"/>
            </parameter>
          </target>
          <target>
            <context value="request"/>
            <contextType value="variable"/>
            <element value="url"/>
            <transform value="copy"/>
            <parameter>
              <valueString value="Device"/>
            </parameter>
          </target>
          <target>
            <context value="tgt"/>
            <contextType value="variable"/>
            <element value="author"/>
            <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/Device/' + %device.id"/>
            </parameter>
          </target>
          <rule>
            <name value="templateId"/>
            <source>
              <context value="assignedAuthoringDevice"/>
              <element value="templateId"/>
              <variable value="vvv"/>
            </source>
            <target>
              <context value="device"/>
              <contextType value="variable"/>
              <element value="identifier"/>
              <variable value="vvv"/>
              <transform value="create"/>
            </target>
          </rule>
          <rule>
            <name value="code"/>
            <source>
              <context value="assignedAuthoringDevice"/>
              <element value="code"/>
              <variable value="vvv"/>
            </source>
            <target>
              <context value="device"/>
              <contextType value="variable"/>
              <element value="type"/>
              <variable value="vvv"/>
              <transform value="create"/>
            </target>
          </rule>
          <rule>
            <name value="manufacturer"/>
            <source>
              <context value="assignedAuthoringDevice"/>
              <element value="manufacturerModelName"/>
              <variable value="manufacturerModelName"/>
            </source>
            <rule>
              <name value="displayRule"/>
              <source>
                <context value="manufacturerModelName"/>
                <variable value="m"/>
              </source>
              <target>
                <context value="device"/>
                <contextType value="variable"/>
                <element value="manufacturer"/>
                <transform value="evaluate"/>
                <parameter>
                  <valueString value="m.displayName"/>
                </parameter>
              </target>
            </rule>
          </rule>
          <rule>
            <name value="deviceName"/>
            <source>
              <context value="assignedAuthoringDevice"/>
              <element value="softwareName"/>
              <variable value="softwareName"/>
            </source>
            <target>
              <context value="device"/>
              <contextType value="variable"/>
              <element value="deviceName"/>
              <variable value="deviceName"/>
            </target>
            <rule>
              <name value="typeName"/>
              <source>
                <context value="softwareName"/>
              </source>
              <target>
                <context value="deviceName"/>
                <contextType value="variable"/>
                <element value="type"/>
                <transform value="copy"/>
                <parameter>
                  <valueString value="other"/>
                </parameter>
              </target>
            </rule>
            <rule>
              <name value="name"/>
              <source>
                <context value="softwareName"/>
                <variable value="s"/>
              </source>
              <target>
                <context value="deviceName"/>
                <contextType value="variable"/>
                <element value="name"/>
                <transform value="evaluate"/>
                <parameter>
                  <valueString value="s.displayName"/>
                </parameter>
              </target>
            </rule>
          </rule>
          <documentation value="device"/>
        </rule>
        <documentation value="srcAuthor.time as time -&gt; tgt.date;"/>
      </rule>
      <documentation value="author"/>
    </rule>
    <rule>
      <name value="participantEncounter"/>
      <source>
        <context value="org"/>
        <element value="participant"/>
        <variable value="participant"/>
        <condition value="(typeCode != 'DEV')"/>
      </source>
      <target>
        <context value="observation"/>
        <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>
        <name value="fhirParticipant"/>
        <source>
          <context value="participant"/>
        </source>
        <target>
          <context value="encounter"/>
          <contextType value="variable"/>
          <element value="participant"/>
          <variable value="FhirParticipant"/>
        </target>
        <rule>
          <name value="type"/>
          <source>
            <context value="participant"/>
            <variable value="p"/>
          </source>
          <target>
            <context value="FhirParticipant"/>
            <contextType value="variable"/>
            <element value="type"/>
            <variable value="type"/>
          </target>
          <rule>
            <name value="codeType"/>
            <source>
              <context value="p"/>
            </source>
            <target>
              <context value="type"/>
              <contextType value="variable"/>
              <element value="coding"/>
              <variable value="coding"/>
            </target>
            <rule>
              <name value="codice"/>
              <source>
                <context value="p"/>
              </source>
              <target>
                <context value="coding"/>
                <contextType value="variable"/>
                <element value="code"/>
                <transform value="evaluate"/>
                <parameter>
                  <valueString value="p.typeCode"/>
                </parameter>
              </target>
            </rule>
            <rule>
              <name value="system"/>
              <source>
                <context value="p"/>
              </source>
              <target>
                <context value="coding"/>
                <contextType value="variable"/>
                <element value="system"/>
                <transform value="copy"/>
                <parameter>
                  <valueString
                               value="http://terminology.hl7.org/CodeSystem/v3-ParticipationType"/>
                </parameter>
              </target>
            </rule>
          </rule>
        </rule>
      </rule>
      <rule>
        <name value="partRole"/>
        <source>
          <context value="participant"/>
          <element value="participantRole"/>
          <variable value="participantRole"/>
        </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="practitionerRole"/>
          <transform value="create"/>
          <parameter>
            <valueString value="PractitionerRole"/>
          </parameter>
        </target>
        <target>
          <context value="practitionerRole"/>
          <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/PractitionerRole/"/>
          </parameter>
          <parameter>
            <valueId value="uuid12"/>
          </parameter>
        </target>
        <target>
          <context value="request"/>
          <contextType value="variable"/>
          <element value="url"/>
          <transform value="copy"/>
          <parameter>
            <valueString value="PractitionerRole"/>
          </parameter>
        </target>
        <target>
          <context value="encounter"/>
          <contextType value="variable"/>
          <element value="participant"/>
          <variable value="participant1"/>
          <transform value="create"/>
          <parameter>
            <valueString value="BackboneElement"/>
          </parameter>
        </target>
        <rule>
          <name value="time"/>
          <source>
            <context value="participant"/>
            <element value="time"/>
            <variable value="time1"/>
          </source>
          <target>
            <context value="participant1"/>
            <contextType value="variable"/>
            <element value="period"/>
            <variable value="period"/>
            <transform value="create"/>
            <parameter>
              <valueString value="Period"/>
            </parameter>
          </target>
          <rule>
            <name value="val"/>
            <source>
              <context value="time1"/>
            </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="time1"/>
              <variable value="start"/>
            </dependent>
          </rule>
          <documentation value="participant.time -&gt; participant1.period;"/>
        </rule>
        <rule>
          <name value="time"/>
          <source>
            <context value="participant"/>
            <element value="time"/>
            <variable value="time1"/>
          </source>
          <target>
            <context value="participant1"/>
            <contextType value="variable"/>
            <element value="period"/>
            <variable value="period"/>
            <transform value="create"/>
            <parameter>
              <valueString value="Period"/>
            </parameter>
          </target>
          <dependent>
            <name value="IVLTSPeriod"/>
            <variable value="time1"/>
            <variable value="period"/>
          </dependent>
        </rule>
        <rule>
          <name value="functionCode"/>
          <source>
            <context value="participant"/>
            <element value="functionCode"/>
            <variable value="vvv"/>
          </source>
          <target>
            <context value="practitionerRole"/>
            <contextType value="variable"/>
            <element value="code"/>
            <variable value="vvv"/>
            <transform value="create"/>
          </target>
        </rule>
        <rule>
          <name value="practitioner"/>
          <source>
            <context value="participantRole"/>
          </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="PUT"/>
            </parameter>
          </target>
          <target>
            <context value="e13"/>
            <contextType value="variable"/>
            <element value="resource"/>
            <variable value="practitioner"/>
            <transform value="create"/>
            <parameter>
              <valueString value="Practitioner"/>
            </parameter>
          </target>
          <rule>
            <name value="par"/>
            <source>
              <context value="participantRole"/>
            </source>
            <target>
              <context value="participant1"/>
              <contextType value="variable"/>
              <element value="individual"/>
              <variable value="referencepart"/>
              <transform value="create"/>
              <parameter>
                <valueString value="Reference"/>
              </parameter>
            </target>
            <target>
              <context value="referencepart"/>
              <contextType value="variable"/>
              <element value="reference"/>
              <transform value="evaluate"/>
              <parameter>
                <valueString
                             value="'https://example/PractitionerRole/' + %practitionerRole.id"/>
              </parameter>
            </target>
          </rule>
          <rule>
            <name value="meta"/>
            <source>
              <context value="participantRole"/>
            </source>
            <target>
              <context value="practitioner"/>
              <contextType value="variable"/>
              <element value="meta"/>
              <variable value="meta"/>
            </target>
            <rule>
              <name value="coding"/>
              <source>
                <context value="participantRole"/>
              </source>
              <target>
                <context value="meta"/>
                <contextType value="variable"/>
                <element value="tag"/>
                <variable value="coding"/>
                <transform value="create"/>
                <parameter>
                  <valueString value="Coding"/>
                </parameter>
              </target>
              <rule>
                <name value="system"/>
                <source>
                  <context value="participantRole"/>
                </source>
                <target>
                  <context value="coding"/>
                  <contextType value="variable"/>
                  <element value="system"/>
                  <transform value="copy"/>
                  <parameter>
                    <valueString value="http://algoritmodiscoring"/>
                  </parameter>
                </target>
              </rule>
              <rule>
                <name value="code"/>
                <source>
                  <context value="participantRole"/>
                </source>
                <target>
                  <context value="coding"/>
                  <contextType value="variable"/>
                  <element value="code"/>
                  <transform value="copy"/>
                  <parameter>
                    <valueString
                                 value="ClinicalDocument/body/organizer/participant"/>
                  </parameter>
                </target>
              </rule>
            </rule>
          </rule>
          <rule>
            <name value="identifier"/>
            <source>
              <context value="participantRole"/>
              <element value="id"/>
              <variable value="id"/>
            </source>
            <target>
              <context value="practitioner"/>
              <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="ext"/>
              <source>
                <context value="id"/>
                <element value="extension"/>
                <variable value="ext"/>
              </source>
              <target>
                <context value="identifier"/>
                <contextType value="variable"/>
                <element value="value"/>
                <transform value="copy"/>
                <parameter>
                  <valueId value="ext"/>
                </parameter>
              </target>
              <rule>
                <name value="UUID"/>
                <source>
                  <context value="participantRole"/>
                </source>
                <target>
                  <context value="request"/>
                  <contextType value="variable"/>
                  <element value="url"/>
                  <transform value="append"/>
                  <parameter>
                    <valueString value="Practitioner?identifier="/>
                  </parameter>
                  <parameter>
                    <valueId value="ext"/>
                  </parameter>
                </target>
              </rule>
            </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>
              <name value="r"/>
              <source>
                <context value="id"/>
                <element value="root"/>
                <variable value="r"/>
              </source>
              <rule>
                <name value="part"/>
                <source>
                  <context value="id"/>
                  <element value="extension"/>
                  <variable value="ext"/>
                </source>
                <target>
                  <context value="practitioner"/>
                  <contextType value="variable"/>
                  <element value="id"/>
                  <variable value="uuid2"/>
                  <transform value="evaluate"/>
                  <parameter>
                    <valueString value="r + '-' + ext"/>
                  </parameter>
                </target>
                <target>
                  <context value="e13"/>
                  <contextType value="variable"/>
                  <element value="fullUrl"/>
                  <transform value="append"/>
                  <parameter>
                    <valueString value="https://example/Practitioner/"/>
                  </parameter>
                  <parameter>
                    <valueId value="uuid2"/>
                  </parameter>
                </target>
                <target>
                  <context value="practitionerRole"/>
                  <contextType value="variable"/>
                  <element value="practitioner"/>
                  <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/Practitioner/' + %practitioner.id"/>
                  </parameter>
                </target>
              </rule>
            </rule>
          </rule>
          <rule>
            <name value="2.16.840.1.113883.2.9.4.3.2"/>
            <source>
              <context value="participantRole"/>
              <element value="id"/>
              <variable value="id"/>
              <condition value="(root = '2.16.840.1.113883.2.9.4.3.2')"/>
            </source>
            <rule>
              <name value="UUID"/>
              <source>
                <context value="id"/>
                <element value="extension"/>
                <variable value="ext"/>
              </source>
              <target>
                <context value="request"/>
                <contextType value="variable"/>
                <element value="url"/>
                <transform value="append"/>
                <parameter>
                  <valueString value="Practitioner?identifier="/>
                </parameter>
                <parameter>
                  <valueId value="ext"/>
                </parameter>
              </target>
            </rule>
          </rule>
          <rule>
            <name value="diverso"/>
            <source>
              <context value="participantRole"/>
              <element value="id"/>
              <variable value="id"/>
              <condition value="(root != '2.16.840.1.113883.2.9.4.3.2')"/>
            </source>
            <rule>
              <name value="UUID"/>
              <source>
                <context value="id"/>
                <element value="extension"/>
                <variable value="ext"/>
              </source>
              <target>
                <context value="request"/>
                <contextType value="variable"/>
                <element value="url"/>
                <transform value="append"/>
                <parameter>
                  <valueString value="Practitioner?identifier="/>
                </parameter>
                <parameter>
                  <valueId value="ext"/>
                </parameter>
              </target>
            </rule>
          </rule>
          <rule>
            <name value="code"/>
            <source>
              <context value="participantRole"/>
              <element value="code"/>
              <variable value="vvv"/>
            </source>
            <target>
              <context value="practitionerRole"/>
              <contextType value="variable"/>
              <element value="code"/>
              <variable value="vvv"/>
              <transform value="create"/>
            </target>
          </rule>
          <rule>
            <name value="addr"/>
            <source>
              <context value="participantRole"/>
              <element value="addr"/>
              <variable value="vvv"/>
            </source>
            <target>
              <context value="practitioner"/>
              <contextType value="variable"/>
              <element value="address"/>
              <variable value="vvv"/>
              <transform value="create"/>
            </target>
          </rule>
          <rule>
            <name value="telecom"/>
            <source>
              <context value="participantRole"/>
              <element value="telecom"/>
              <variable value="vvv"/>
            </source>
            <target>
              <context value="practitioner"/>
              <contextType value="variable"/>
              <element value="telecom"/>
              <variable value="vvv"/>
              <transform value="create"/>
            </target>
          </rule>
          <rule>
            <name value="name"/>
            <source>
              <context value="participantRole"/>
              <element value="playingEntity"/>
              <variable value="playingEntity"/>
            </source>
            <rule>
              <name value="name"/>
              <source>
                <context value="playingEntity"/>
                <element value="name"/>
                <variable value="vvv"/>
              </source>
              <target>
                <context value="practitioner"/>
                <contextType value="variable"/>
                <element value="name"/>
                <variable value="vvv"/>
                <transform value="create"/>
              </target>
            </rule>
            <rule>
              <name value="birth"/>
              <source>
                <context value="playingEntity"/>
                <element value="birthTime"/>
                <variable value="birthTime"/>
              </source>
              <rule>
                <name value="value"/>
                <source>
                  <context value="birthTime"/>
                  <element value="value"/>
                  <variable value="date"/>
                </source>
                <target>
                  <context value="practitioner"/>
                  <contextType value="variable"/>
                  <element value="birthDate"/>
                  <transform value="truncate"/>
                  <parameter>
                    <valueId value="date"/>
                  </parameter>
                  <parameter>
                    <valueInteger value="10"/>
                  </parameter>
                </target>
              </rule>
            </rule>
          </rule>
          <documentation value="non mappa i 2 precedenti"/>
        </rule>
      </rule>
      <documentation value="participant person"/>
    </rule>
    <rule>
      <name value="devParticipant"/>
      <source>
        <context value="org"/>
        <element value="participant"/>
        <variable value="devParticipant"/>
        <condition value="(typeCode = 'DEV')"/>
      </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="device"/>
        <transform value="create"/>
        <parameter>
          <valueString value="Device"/>
        </parameter>
      </target>
      <target>
        <context value="device"/>
        <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/Device/"/>
        </parameter>
        <parameter>
          <valueId value="uuid14"/>
        </parameter>
      </target>
      <target>
        <context value="request"/>
        <contextType value="variable"/>
        <element value="url"/>
        <transform value="copy"/>
        <parameter>
          <valueString value="Device"/>
        </parameter>
      </target>
      <target>
        <context value="observation"/>
        <contextType value="variable"/>
        <element value="device"/>
        <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/Device/' + %device.id"/>
        </parameter>
      </target>
      <rule>
        <name value="participantRoleDev"/>
        <source>
          <context value="devParticipant"/>
          <element value="participantRole"/>
          <variable value="participantRoleDev"/>
        </source>
        <rule>
          <name value="playingDevice"/>
          <source>
            <context value="participantRoleDev"/>
            <element value="playingDevice"/>
            <variable value="playingDevice"/>
          </source>
          <rule>
            <name value="code"/>
            <source>
              <context value="playingDevice"/>
              <element value="code"/>
              <variable value="vvv"/>
            </source>
            <target>
              <context value="device"/>
              <contextType value="variable"/>
              <element value="type"/>
              <variable value="vvv"/>
              <transform value="create"/>
            </target>
          </rule>
          <rule>
            <name value="manufacturer"/>
            <source>
              <context value="playingDevice"/>
              <element value="manufacturerModelName"/>
              <variable value="manufacturerModelName"/>
            </source>
            <rule>
              <name value="displayRule"/>
              <source>
                <context value="manufacturerModelName"/>
                <variable value="m"/>
              </source>
              <target>
                <context value="device"/>
                <contextType value="variable"/>
                <element value="manufacturer"/>
                <transform value="evaluate"/>
                <parameter>
                  <valueString value="m.displayName"/>
                </parameter>
              </target>
            </rule>
          </rule>
          <rule>
            <name value="deviceName"/>
            <source>
              <context value="playingDevice"/>
              <element value="softwareName"/>
              <variable value="softwareName"/>
            </source>
            <target>
              <context value="device"/>
              <contextType value="variable"/>
              <element value="deviceName"/>
              <variable value="deviceName"/>
            </target>
            <rule>
              <name value="typeName"/>
              <source>
                <context value="softwareName"/>
              </source>
              <target>
                <context value="deviceName"/>
                <contextType value="variable"/>
                <element value="type"/>
                <transform value="copy"/>
                <parameter>
                  <valueString value="other"/>
                </parameter>
              </target>
            </rule>
            <rule>
              <name value="name"/>
              <source>
                <context value="softwareName"/>
                <variable value="s"/>
              </source>
              <target>
                <context value="deviceName"/>
                <contextType value="variable"/>
                <element value="name"/>
                <transform value="evaluate"/>
                <parameter>
                  <valueString value="s.displayName"/>
                </parameter>
              </target>
            </rule>
          </rule>
        </rule>
      </rule>
      <documentation value="participant device"/>
    </rule>
    <rule>
      <name value="componentobservation"/>
      <source>
        <context value="org"/>
        <element value="component"/>
        <variable value="component"/>
      </source>
      <rule>
        <name value="OBS"/>
        <source>
          <context value="component"/>
          <element value="observation"/>
          <variable value="observation"/>
        </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="observationhasmember"/>
          <transform value="create"/>
          <parameter>
            <valueString value="Observation"/>
          </parameter>
        </target>
        <target>
          <context value="observationhasmember"/>
          <contextType value="variable"/>
          <element value="id"/>
          <variable value="uuid2"/>
          <transform value="uuid"/>
        </target>
        <target>
          <context value="e"/>
          <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="observation"/>
          <contextType value="variable"/>
          <element value="hasMember"/>
          <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/' + %observationhasmember.id"/>
          </parameter>
        </target>
        <dependent>
          <name value="Observation"/>
          <variable value="observation"/>
          <variable value="patient"/>
          <variable value="encounter"/>
          <variable value="observationhasmember"/>
          <variable value="bundle"/>
        </dependent>
      </rule>
    </rule>
    <rule>
      <name value="componentorganizer"/>
      <source>
        <context value="org"/>
        <element value="component"/>
        <variable value="component"/>
      </source>
      <rule>
        <name value="organizer"/>
        <source>
          <context value="component"/>
          <element value="organizer"/>
          <variable value="organizer"/>
        </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="observationorganizer"/>
          <transform value="create"/>
          <parameter>
            <valueString value="Observation"/>
          </parameter>
        </target>
        <target>
          <context value="observationorganizer"/>
          <contextType value="variable"/>
          <element value="id"/>
          <variable value="uuid3"/>
          <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="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="observation"/>
          <contextType value="variable"/>
          <element value="hasMember"/>
          <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/' + %observationorganizer.id"/>
          </parameter>
        </target>
        <rule>
          <name value="ORG"/>
          <source>
            <context value="organizer"/>
          </source>
          <dependent>
            <name value="Organizer"/>
            <variable value="cda"/>
            <variable value="organizer"/>
            <variable value="patient"/>
            <variable value="encounter"/>
            <variable value="observationorganizer"/>
            <variable value="bundle"/>
          </dependent>
        </rule>
      </rule>
    </rule>
    <rule>
      <name value="component"/>
      <source>
        <context value="org"/>
        <element value="component"/>
        <variable value="component"/>
      </source>
      <rule>
        <name value="obsmedia"/>
        <source>
          <context value="component"/>
          <element value="observationMedia"/>
          <variable value="obsMedia"/>
        </source>
        <target>
          <context value="bundle"/>
          <contextType value="variable"/>
          <element value="entry"/>
          <variable value="e15"/>
        </target>
        <target>
          <context value="e15"/>
          <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="e15"/>
          <contextType value="variable"/>
          <element value="resource"/>
          <variable value="media1"/>
          <transform value="create"/>
          <parameter>
            <valueString value="Media"/>
          </parameter>
        </target>
        <target>
          <context value="media1"/>
          <contextType value="variable"/>
          <element value="id"/>
          <variable value="uuid15"/>
          <transform value="uuid"/>
        </target>
        <target>
          <context value="e15"/>
          <contextType value="variable"/>
          <element value="fullUrl"/>
          <transform value="append"/>
          <parameter>
            <valueString value="https://example/Media/"/>
          </parameter>
          <parameter>
            <valueId value="uuid15"/>
          </parameter>
        </target>
        <target>
          <context value="request"/>
          <contextType value="variable"/>
          <element value="url"/>
          <transform value="copy"/>
          <parameter>
            <valueString value="Media"/>
          </parameter>
        </target>
        <target>
          <context value="observation"/>
          <contextType value="variable"/>
          <element value="derivedFrom"/>
          <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/Media/' + %media1.id"/>
          </parameter>
        </target>
        <rule>
          <name value="Attachment"/>
          <source>
            <context value="obsMedia"/>
          </source>
          <target>
            <context value="media1"/>
            <contextType value="variable"/>
            <element value="content"/>
            <variable value="Attachment"/>
            <transform value="create"/>
            <parameter>
              <valueString value="Attachment"/>
            </parameter>
          </target>
          <rule>
            <name value="status"/>
            <source>
              <context value="obsMedia"/>
            </source>
            <target>
              <context value="media1"/>
              <contextType value="variable"/>
              <element value="status"/>
              <transform value="copy"/>
              <parameter>
                <valueString value="unknown"/>
              </parameter>
            </target>
          </rule>
          <rule>
            <name value="valuemedia"/>
            <source>
              <context value="obsMedia"/>
              <element value="value"/>
              <variable value="valueMedia"/>
            </source>
            <rule>
              <name value="type"/>
              <source>
                <context value="valueMedia"/>
                <element value="mediaType"/>
                <variable value="type"/>
              </source>
              <target>
                <context value="Attachment"/>
                <contextType value="variable"/>
                <element value="contentType"/>
                <transform value="copy"/>
                <parameter>
                  <valueId value="type"/>
                </parameter>
              </target>
            </rule>
            <rule>
              <name value="data"/>
              <source>
                <context value="valueMedia"/>
              </source>
              <target>
                <context value="Attachment"/>
                <contextType value="variable"/>
                <element value="data"/>
                <transform value="evaluate"/>
                <parameter>
                  <valueString value="valueMedia.dataBase64Binary"/>
                </parameter>
              </target>
            </rule>
          </rule>
        </rule>
      </rule>
      <documentation value="observationMedia"/>
    </rule>
    <rule>
      <name value="component"/>
      <source>
        <context value="org"/>
        <element value="component"/>
        <variable value="component"/>
      </source>
      <rule>
        <name value="componentact"/>
        <source>
          <context value="component"/>
          <element value="act"/>
          <variable value="act"/>
        </source>
        <rule>
          <name value="text"/>
          <source>
            <context value="act"/>
            <element value="text"/>
            <variable value="text"/>
          </source>
          <rule>
            <name value="note"/>
            <source>
              <context value="text"/>
              <element value="reference"/>
              <variable value="reference"/>
            </source>
            <target>
              <context value="observation"/>
              <contextType value="variable"/>
              <element value="note"/>
              <variable value="note"/>
            </target>
            <rule>
              <name value="reference"/>
              <source>
                <context 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>
      <documentation value="note"/>
    </rule>
  </group>
  <group>
    <name value="ExtSubjectAnimal"/>
    <typeMode value="none"/>
    <input>
      <name value="src"/>
      <type value="relatedSubject"/>
      <mode value="source"/>
    </input>
    <input>
      <name value="ext"/>
      <type value="Extension"/>
      <mode value="target"/>
    </input>
    <rule>
      <name value="url"/>
      <source>
        <context value="src"/>
      </source>
      <target>
        <context value="ext"/>
        <contextType value="variable"/>
        <element value="url"/>
        <transform value="copy"/>
        <parameter>
          <valueString
                       value="http://hl7.org/fhir/StructureDefinition/patient-animal"/>
        </parameter>
      </target>
    </rule>
    <rule>
      <name value="code"/>
      <source>
        <context value="src"/>
        <element value="code"/>
        <variable value="code"/>
      </source>
      <target>
        <context value="ext"/>
        <contextType value="variable"/>
        <element value="extension"/>
        <variable value="ext"/>
      </target>
      <target>
        <context value="ext"/>
        <contextType value="variable"/>
        <element value="url"/>
        <transform value="copy"/>
        <parameter>
          <valueString value="species"/>
        </parameter>
      </target>
      <target>
        <context value="ext"/>
        <contextType value="variable"/>
        <element value="value"/>
        <variable value="code1"/>
        <transform value="create"/>
        <parameter>
          <valueString value="CodeableConcept"/>
        </parameter>
      </target>
      <dependent>
        <name value="CECodeableConcept"/>
        <variable value="code"/>
        <variable value="code1"/>
      </dependent>
    </rule>
  </group>
</StructureMap>