CDA to FHIR Maps
0.1.0 - ci-build Italy flag

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

: CDA to FHIR - VPS - XML Representation

Draft as of 2024-04-11

Raw xml | Download



<StructureMap xmlns="http://hl7.org/fhir">
  <id value="cda2fhirEdReport"/>
  <text>
    <status value="generated"/>
    <div xmlns="http://www.w3.org/1999/xhtml">
         <pre>map &quot;http://hl7.it/fhir/cda2fhir/StructureMap/cda2fhirEdReport&quot; = &quot;cda2fhirEdReport&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/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/IVL-TS&quot; as source
uses &quot;http://hl7.org/fhir/cda/StructureDefinition/PQ&quot; alias PQ as source
uses &quot;http://hl7.org/fhir/StructureDefinition/SimpleQuantity&quot; alias SimpleQuantity as target

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

// --------------------------------------------------------------------------------------------
group CdaToBundle(source cda : ClinicalDocument, target bundle : Bundle) {
  cda -&gt;  bundle.entry as e,  e.request = create('BackboneElement') as request,  request.method = 'POST',  e.resource = create('Composition') as composition,  composition.id = uuid() as uuid1,  e.fullUrl = append('https://example/Composition/', uuid1),  request.url = 'Composition',  bundle.entry as e2,  e2.request = create('BackboneElement') as requestPAT,  requestPAT.method = 'PUT',  e2.resource = create('Patient') as patient,  patient.id = uuid() as uuid2,  e2.fullUrl = append('https://example/Patient/', uuid2),  bundle.entry as e3,  e3.request = create('BackboneElement') as request,  request.method = 'POST',  e3.resource = create('Encounter') as encounter,  encounter.id = uuid() as uuid3,  e3.fullUrl = append('https://example/Encounter/', uuid3),  request.url = 'Encounter',  bundle.entry as 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;recPat&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 where (code = '11459-5') -&gt; composition.section as tgtSection then ModalitadiTrasposto(cda, srcSection, patient, tgtSection, bundle, encounter) &quot;Modalitaditrasporto&quot;;
          srcSection.code where (code = '78337-3') -&gt; composition.section as tgtSection then InquadramentoClinicoIniziale(cda, srcSection, patient, tgtSection, bundle, encounter) &quot;Inquadramentoclinico&quot;;
          srcSection.code where (code = '46239-0') -&gt; composition.section as tgtSection then MotivoDellaVisita(cda, srcSection, patient, tgtSection, bundle, encounter) &quot;Inquadramentoclinico&quot;;
          srcSection.code where (code = '54094-8') -&gt; composition.section as tgtSection then Triage(cda, srcSection, patient, tgtSection, bundle, encounter) &quot;Triage&quot;;
          srcSection.code where (code = '46240-8') -&gt; composition.section as tgtSection then ClinicalDocumentSectionEncounter(cda, srcSection, patient, tgtSection, bundle, encounter) &quot;motivoricovero&quot;;
          srcSection.code where (code = '8648-8') -&gt; composition.section as tgtSection then ClinicalDocumentSectionDecorsoOspedaliero(cda, srcSection, patient, tgtSection, bundle, encounter) &quot;DecorsoOspedaliero&quot;;
          srcSection.code where (code = '55109-3') -&gt; composition.section as tgtSection then ClinicalDocumentSectionComplicanze(cda, srcSection, patient, tgtSection, bundle, encounter) &quot;Complicazioni&quot;;
          srcSection.code where (code = '62387-6') -&gt; composition.section as tgtSection then ClinicalDocumentSectionConsulenza(cda, srcSection, patient, tgtSection, bundle, encounter) &quot;Hospitaldischargestudiessummary&quot;;
          srcSection.code where (code = '30954-2') -&gt; composition.section as tgtSection then ClinicalDocumentSectionAccertamenti(cda, srcSection, patient, tgtSection, bundle, encounter) &quot;Accertamenti&quot;;
          srcSection.code where (code = '8716-3') -&gt; composition.section as tgtSection then ClinicalDocumentSectionParametriVitali(cda, srcSection, patient, tgtSection, bundle, encounter) &quot;Accertamenti&quot;;
          srcSection.code where (code = '29549-3') -&gt; composition.section as tgtSection then ClinicalDocumentSectionTerapiaFarmacoInPronto(cda, srcSection, patient, tgtSection, bundle, encounter) &quot;Accertamenti&quot;;
          srcSection.code where (code = '18776-5') -&gt; composition.section as tgtSection then ClinicalDocumentSectionPianoCuraDimissione(cda, srcSection, patient, tgtSection, bundle, encounter) &quot;Pianodicuraalladimissione&quot;;
          srcSection.code where (code = '28574-2') -&gt; composition.section as tgtSection then ClinicalDocumentSectionDimissione(cda, srcSection, patient, tgtSection, bundle, encounter) &quot;Dimissione&quot;;
          srcSection.code where (code = '75311-1') -&gt; composition.section as tgtSection then ClinicalDocumentSectionTerapiaFarmacologicaDimissione(cda, srcSection, patient, tgtSection, bundle, encounter) &quot;TerapiaFarmacologicaDimissione&quot;;
        };
      };
    } &quot;body&quot;;
  };
}

// Sezione complicanze--------------------------------------------------------------------------
group ClinicalDocumentSectionComplicanze(source cda : ClinicalDocument, source src : Section, target patient : Patient, target tgt, target bundle : Bundle, target enc : Encounter) {
  src.title as t -&gt; tgt.title = (t.dataString);
  src.code -&gt; tgt.code;
  src where src.entry.exists() then {
    src.text as cdaText -&gt; tgt.text as fhirText then {
      cdaText -&gt; fhirText.status = 'generated' &quot;narrativeStatus&quot;;
      cdaText as t -&gt; fhirText.div = t &quot;narrativeText&quot;;
    } &quot;cdaText&quot;;
  } &quot;entryexists&quot;;
  // Sezione Strutturata-----------------------------------------------------------------------------------------------------------------------------------------------
  src.entry as entry1 -&gt;  bundle.entry as e1,  e1.request = create('BackboneElement') as request,  request.method = 'POST',  e1.resource = create('Observation') as observation,  observation.id = uuid() as uuid1,  e1.fullUrl = append('https://example/Observation/', uuid1),  request.url = 'Observation',  tgt.entry = create('Reference') as reference,  reference.reference = ('https://example/Observation/' + %observation.id) then {
    entry1.observation as obs then Observation(obs, patient, enc, observation, bundle) &quot;act&quot;;
  };
  // Sezione Narrativa---------------------------------------------------------------------------------------------------------------------------------------------
  src where src.entry.exists().not() then {
    src.text as cdaText -&gt;  bundle.entry as e8,  e8.request = create('BackboneElement') as request,  request.method = 'POST',  e8.resource = create('Observation') as Observation,  Observation.id = uuid() as uuid8,  e8.fullUrl = append('https://example/Observation/', uuid8),  request.url = 'Observation',  tgt.entry = create('Reference') as reference,  reference.reference = ('https://example/Observation/' + %Observation.id) then {
      src -&gt;  Observation.subject = create('Reference') as reference,  reference.reference = ('https://example/Patient/' + %patient.id) &quot;reference&quot;;
      src -&gt;  Observation.encounter = create('Reference') as reference,  reference.reference = ('https://example/Encounter/' + %enc.id) &quot;reference&quot;;
      src.code -&gt; Observation.code;
      src where observation.statusCode.exists().not() then {
        src -&gt; Observation.status = 'final' &quot;status&quot;;
      } &quot;statuscode&quot;;
      cdaText -&gt; Observation.note as note then {
        cdaText as t -&gt; note.text = t &quot;reference&quot;;
      } &quot;reference&quot;;
    } &quot;cdaText&quot;;
  } &quot;where&quot;;
}

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 where obs.statusCode.exists().not() then {
    obs -&gt; ob.status = 'final' &quot;status&quot;;
  } &quot;statuscode&quot;;
  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.value : INT as int -&gt; ob.value = (int.value);
  obs.value : CD as val then {
    val -&gt; ob.value = create('CodeableConcept') as ce then {
      val.originalText -&gt; ce.text;
      val -&gt; ce.coding as coding then {
        val.code as code -&gt; coding.code = cast(code, 'string');
        val.codeSystem as system -&gt; coding.system = translate(system, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri');
        val.displayName as display -&gt; coding.display = cast(display, 'string');
      } &quot;code&quot;;
      val.translation as translation -&gt; ce.coding as coding then {
        translation.code as code -&gt; coding.code = cast(code, 'string');
        translation.codeSystem as system -&gt; coding.system = translate(system, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri');
        translation.displayName as display -&gt; coding.display = cast(display, 'string');
        translation.qualifier as qualifier then {
          qualifier.value as value -&gt; ce.coding as coding then {
            value.code as code -&gt; coding.code = cast(code, 'string');
            value.codeSystem as system -&gt; coding.system = translate(system, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri');
            value.displayName as display -&gt; coding.display = cast(display, 'string');
          };
        } &quot;translation1&quot;;
      };
    } &quot;coding&quot;;
  } &quot;val&quot;;
  obs.value : CE as val then {
    val -&gt; ob.value = create('CodeableConcept') as ce then {
      val.originalText -&gt; ce.text;
      val -&gt; ce.coding as coding then {
        val.code as code -&gt; coding.code = cast(code, 'string');
        val.codeSystem as system -&gt; coding.system = translate(system, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri');
        val.displayName as display -&gt; coding.display = cast(display, 'string');
      } &quot;code&quot;;
      val.translation as translation -&gt; ce.coding as coding then {
        translation.code as code -&gt; coding.code = cast(code, 'string');
        translation.codeSystem as system -&gt; coding.system = translate(system, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri');
        translation.displayName as display -&gt; coding.display = cast(display, 'string');
        translation.qualifier as qualifier then {
          qualifier.value as value -&gt; ce.coding as coding then {
            value.code as code -&gt; coding.code = cast(code, 'string');
            value.codeSystem as system -&gt; coding.system = translate(system, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri');
            value.displayName as display -&gt; coding.display = cast(display, 'string');
          };
        } &quot;translation1&quot;;
      };
    } &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 : BL as value -&gt;  ob.value = create('boolean'),  ob.value = (value.value);
  obs.value : ST as value -&gt;  ob.value = create('string'),  ob.value = (value.dataString);
  obs.interpretationCode -&gt; ob.interpretation;
  obs.methodCode -&gt; ob.method;
  obs.performer as performer -&gt;  bundle.entry as e1,  e1.request = create('BackboneElement') as request,  request.method = 'PUT',  e1.resource = create('Practitioner') as practitioner then {
    performer.assignedEntity as entity 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 uuid1,  e1.fullUrl = append('https://example/Practitioner/', uuid1),  ob.performer = create('Reference') as reference,  reference.reference = ('https://example/Practitioner/' + %practitioner.id) &quot;performer&quot;;
        } &quot;r&quot;;
      } &quot;identifier&quot;;
      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;;
    };
  };
  obs.referenceRange as refRange -&gt; ob.referenceRange = create('BackboneElement') as ref then {
    refRange.observationRange as obsRange -&gt; ref.low = create('SimpleQuantity') 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;;
      } &quot;IVL-PQ&quot;;
    } &quot;obsRange&quot;;
  } &quot;refRange&quot;;
}

// ------------------------------------------------------------------------------------------------------
// Sezione Decorso Ospedaliero----------------------------------------------------------------------------
group ClinicalDocumentSectionDecorsoOspedaliero(source cda : ClinicalDocument, source src : Section, target patient : Patient, target tgt, target bundle : Bundle, target enc : Encounter) {
  src.title as t -&gt; tgt.title = (t.dataString);
  src.code -&gt; tgt.code;
  src -&gt;  bundle.entry as e1,  e1.request = create('BackboneElement') as request,  request.method = 'POST',  e1.resource = create('Observation') as observation,  observation.id = uuid() as uuid1,  e1.fullUrl = append('https://example/Observation/', uuid1),  request.url = 'Observation',  tgt.entry = create('Reference') as reference,  reference.reference = ('https://example/Observation/' + %observation.id),  observation.note as note then {
    src.code -&gt; observation.code;
    src where observation.statusCode.exists().not() then {
      src -&gt; observation.status = 'final' &quot;status&quot;;
    } &quot;statuscode&quot;;
    src -&gt;  observation.subject = create('Reference') as reference,  reference.reference = ('https://example/Patient/' + %patient.id) &quot;reference&quot;;
    src -&gt;  observation.encounter = create('Reference') as reference,  reference.reference = ('https://example/Encounter/' + %enc.id) &quot;reference&quot;;
    src.text as t -&gt; note.text = t &quot;reference&quot;;
    src.author as auth -&gt;  bundle.entry as e1,  e1.request = create('BackboneElement') as request,  request.method = 'PUT',  e1.resource = create('Practitioner') as practitioner,  practitioner.id = uuid() as uuid1,  e1.fullUrl = append('https://example/Practitioner/', uuid1),  request.url = append('Practitioner/', uuid1) then {
      auth.time as ti -&gt; note.time = create('dateTime') as value then TSDateTime(ti, value);
      auth.assignedAuthor as assAuth then {
        // meta+identifier
        assAuth -&gt; practitioner.meta as meta then {
          assAuth -&gt; meta.tag = create('Coding') as coding then {
            assAuth -&gt; coding.system = 'http://algoritmodiscoring' &quot;system&quot;;
            assAuth -&gt; coding.code = 'ClinicalDocument/body/DecorsoOspedaliero/author' &quot;code&quot;;
          } &quot;coding&quot;;
        } &quot;meta&quot;;
        assAuth.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;
          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,  e1.fullUrl = append('https://example/Practitioner/', uuid2),  request.url = append('Practitioner/', uuid2),  note.author = create('Reference') as reference,  reference.reference = ('https://example/Practitioner/' + %practitioner.id) &quot;aut&quot;;
          } &quot;r&quot;;
        } &quot;identifier&quot;;
        assAuth.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;;
        assAuth.assignedPerson as assPers then {
          assPers.name -&gt; practitioner.name;
        } &quot;assPers&quot;;
      } &quot;assAuth&quot;;
    } &quot;Auth&quot;;
  } &quot;OB-note&quot;;
}

// --------------------------------------------------------------------------------------------------------
// Sezione Encounter---------------------------------------------------------------------------------------
group ClinicalDocumentSectionEncounter(source cda : ClinicalDocument, source src : Section, target patient : Patient, target tgt, target bundle : Bundle, target enc1 : Encounter) {
  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('Encounter') as encounter,  encounter.id = uuid() as uuid1,  e1.fullUrl = append('https://example/Encounter/', uuid1),  request.url = 'Encounter',  tgt.entry = create('Reference') as reference,  reference.reference = ('https://example/Encounter/' + %encounter.id) then {
    entry1 -&gt;  encounter.partOf = create('Reference') as reference,  reference.reference = ('https://example/Encounter/' + %enc1.id) &quot;refer&quot;;
    entry1 -&gt;  encounter.subject = create('Reference') as reference,  reference.reference = ('https://example/Patient/' + %patient.id) &quot;refer&quot;;
    entry1 -&gt; encounter.status = 'finished' &quot;status&quot;;
    entry1 -&gt; encounter.class = create('Coding') as cl then {
      entry1 -&gt; cl.code = 'AMB' &quot;code&quot;;
      entry1 -&gt; cl.display = 'ambulatory' &quot;code&quot;;
    } &quot;class&quot;;
    entry1.encounter as enc then {
      enc.code -&gt; encounter.type;
      // effectiveTime=period
      enc where effectiveTime.low.exists() or effectiveTime.high.exists() then {
        enc.effectiveTime as eff -&gt; encounter.period = create('Period') as period then IVLTSPeriod(eff, period);
      } &quot;where&quot;;
      // effectiveTime = time-stamp
      enc where effectiveTime.low.exists().not() or effectiveTime.high.exists().not() then {
        enc.effectiveTime as effectivetime1 -&gt; encounter.period = create('Period') as period then {
          effectivetime1 -&gt; period.start = create('dateTime') as start then TSDateTime(effectivetime1, start) &quot;val&quot;;
        } &quot;efft&quot;;
      } &quot;where&quot;;
      // enc.effectiveTime as eff -&gt; encounter.period = create('Period') as period then{
      enc.participant as part where (typeCode != 'LOC') -&gt; encounter.participant = create('BackboneElement') as patarg then {
        part -&gt; patarg.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.time as time1 -&gt; patarg.period = create('Period') as period then {
          time1 -&gt; period.start = create('dateTime') as start then TSDateTime(time1, start) &quot;val&quot;;
        };
        part.time as ti -&gt; patarg.period = create('Period') as period then IVLTSPeriod(ti, period);
        part.participantRole as partRole -&gt;  bundle.entry as e1,  e1.request = create('BackboneElement') as request,  request.method = 'PUT',  e1.resource = create('Practitioner') as practitioner,  practitioner.id = uuid() as uuid1,  e1.fullUrl = append('https://example/Practitioner/', uuid1),  request.url = append('Practitioner/', uuid1) then {
          // modifica meta+identifier
          partRole -&gt; practitioner.meta as meta then {
            partRole -&gt; meta.tag = create('Coding') as coding then {
              partRole -&gt; coding.system = 'http://algoritmodiscoring' &quot;system&quot;;
              partRole -&gt; coding.code = 'ClinicalDocument/body/Encounter/participant' &quot;code&quot;;
            } &quot;coding&quot;;
          } &quot;meta&quot;;
          partRole.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;
            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,  e1.fullUrl = append('https://example/Practitioner/', uuid2),  request.url = append('Practitioner/', uuid2),  patarg.individual = create('Reference') as reference,  reference.reference = ('https://example/Practitioner/' + %practitioner.id) &quot;aut&quot;;
            } &quot;r&quot;;
          } &quot;identifier&quot;;
          partRole.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;;
          partRole.playingEntity as playEnt then {
            playEnt.name -&gt; practitioner.name;
          } &quot;playEnt&quot;;
        } &quot;partRole&quot;;
      } &quot;participant-ADM&quot;;
      enc.participant as part where (typeCode = 'LOC') then {
        part.time as tim -&gt; encounter.location as locat then {
          tim -&gt; locat.period = create('Period') as period then IVLTSPeriod(tim, period) &quot;time&quot;;
          part.time as tim -&gt; locat.period = create('Period') as period then {
            tim -&gt; period.start = create('dateTime') as start then TSDateTime(tim, start) &quot;val&quot;;
          };
          part.participantRole as partRole -&gt;  bundle.entry as e1,  e1.request = create('BackboneElement') as request,  request.method = 'PUT',  e1.resource = create('Location') as location,  location.id = uuid() as uuid1,  e1.fullUrl = append('https://example/Location/', uuid1) then {
            part -&gt; location.meta as meta then {
              part -&gt; meta.tag = create('Coding') as coding then {
                part -&gt; coding.system = 'http://algoritmodiscoring' &quot;system&quot;;
                part -&gt; coding.code = 'ClinicalDocument/body/Encounter/participant' &quot;code&quot;;
              } &quot;coding&quot;;
            } &quot;meta&quot;;
            partRole.id as id -&gt; location.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 {
                partRole -&gt; request.url = append('Location?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;  location.id = (r + '-' + ext) as uuid,  e1.fullUrl = append('https://example/Location/', uuid),  locat.location = create('Reference') as reference,  reference.reference = ('https://example/Location/' + %location.id) &quot;idasi&quot;;
              } &quot;r&quot;;
            } &quot;identifier&quot;;
            partRole.code -&gt; location.type;
          } &quot;partRole&quot;;
        } &quot;location&quot;;
      } &quot;participant2&quot;;
      enc.entryRelationship as entr -&gt;  bundle.entry as e1,  e1.request = create('BackboneElement') as request,  request.method = 'POST',  e1.resource = create('Observation') as observation,  observation.id = uuid() as uuid1,  e1.fullUrl = append('https://example/Observation/', uuid1),  request.url = 'Observation',  encounter.reasonReference = create('Reference') as reference,  reference.reference = ('https://example/Observation/' + %observation.id) then {
        entr.act as act then {
          act.code -&gt; observation.code;
          act -&gt;  observation.subject = create('Reference') as reference,  reference.reference = ('https://example/Patient/' + %patient.id) &quot;reference&quot;;
          act -&gt;  observation.encounter = create('Reference') as reference,  reference.reference = ('https://example/Encounter/' + %enc1.id) &quot;reference&quot;;
          act where act.statusCode.exists().not() then {
            act -&gt; observation.status = 'final' &quot;status&quot;;
          } &quot;statuscode&quot;;
          act -&gt; observation.note = create('Annotation') as note then {
            act.text as text then {
              text.reference as reff -&gt; note.text = (reff.value);
            };
            act.text as tx then {
              tx.reference as ref -&gt; note.text = (ref.value) &quot;val&quot;;
            } &quot;String&quot;;
            act.author as auth -&gt;  bundle.entry as e1,  e1.request = create('BackboneElement') as request,  request.method = 'PUT',  e1.resource = create('Practitioner') as practitioner,  practitioner.id = uuid() as uuid1,  e1.fullUrl = append('https://example/Practitioner/', uuid1),  request.url = append('Practitioner/', uuid1) then {
              auth.time as ti -&gt; note.time = create('dateTime') as value then TSDateTime(ti, value) &quot;notetime&quot;;
              auth.assignedAuthor as assAuth then {
                assAuth -&gt; practitioner.meta as meta then {
                  assAuth -&gt; meta.tag = create('Coding') as coding then {
                    assAuth -&gt; coding.system = 'http://algoritmodiscoring' &quot;system&quot;;
                    assAuth -&gt; coding.code = 'ClinicalDocument/body/Encounter/author' &quot;code&quot;;
                  } &quot;coding&quot;;
                } &quot;meta&quot;;
                assAuth.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;
                  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,  e1.fullUrl = append('https://example/Practitioner/', uuid2),  request.url = append('Practitioner/', uuid2),  note.author = create('Reference') as reference,  reference.reference = ('https://example/Practitioner/' + %practitioner.id) &quot;aut&quot;;
                  } &quot;r&quot;;
                } &quot;identifier&quot;;
                assAuth.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;;
                // fine modifica
                assAuth.time as t -&gt; note.text = create('dateTime') as value then TSDateTime(t, value);
                assAuth.assignedPerson as assPers then {
                  assPers.name -&gt; practitioner.name;
                } &quot;name&quot;;
              } &quot;assAush&quot;;
            } &quot;practitioner&quot;;
          } &quot;note&quot;;
        };
      } &quot;entryRel-SUBJ&quot;;
    };
  };
}

// --------------------------------------------------------------------------------------------------------
// Sezione Consulenza--------------------------------------------------------------------------------------
group ClinicalDocumentSectionConsulenza(source cda : ClinicalDocument, source src : Section, target patient : Patient, target tgt, target bundle : Bundle, target enc : Encounter) {
  src.title as t -&gt; tgt.title = (t.dataString);
  src.code -&gt; tgt.code;
  src where src.entry.exists() then {
    src.text as cdaText -&gt; tgt.text as fhirText then {
      cdaText -&gt; fhirText.status = 'generated' &quot;narrativeStatus&quot;;
      cdaText as t -&gt; fhirText.div = t &quot;narrativeText&quot;;
    } &quot;cdaText&quot;;
  } &quot;entry-exists&quot;;
  // Sezione Narrativa--------------------------------------------------------------------------------------------------------------------------------------------------
  src where src.entry.exists().not() then {
    src.text as cdaText -&gt;  bundle.entry as e8,  e8.request = create('BackboneElement') as request,  request.method = 'POST',  e8.resource = create('ServiceRequest') as ServiceRequest,  ServiceRequest.id = uuid() as uuid8,  e8.fullUrl = append('https://example/ServiceRequest/', uuid8),  request.url = 'ServiceRequest',  tgt.entry = create('Reference') as reference,  reference.reference = ('https://example/ServiceRequest/' + %ServiceRequest.id) then {
      src -&gt;  ServiceRequest.subject = create('Reference') as reference,  reference.reference = ('https://example/Patient/' + %patient.id) &quot;reference&quot;;
      src -&gt;  ServiceRequest.encounter = create('Reference') as reference,  reference.reference = ('https://example/Encounter/' + %enc.id) &quot;reference&quot;;
      src -&gt; ServiceRequest.status = 'active' &quot;status&quot;;
      src -&gt; ServiceRequest.intent = 'order' &quot;intent&quot;;
      cdaText -&gt; ServiceRequest.note as note then {
        cdaText as t -&gt; note.text = t &quot;reference&quot;;
      } &quot;reference&quot;;
    } &quot;cdaText&quot;;
  } &quot;where&quot;;
  // Sezione Strutturata--------------------------------------------------------------------------------------------------------------------------------------------
  src.entry as entry1 -&gt;  bundle.entry as e1,  e1.request = create('BackboneElement') as request,  request.method = 'POST',  e1.resource = create('ServiceRequest') as serviceRequest,  serviceRequest.id = uuid() as uuid1,  e1.fullUrl = append('https://example/ServiceRequest/', uuid1),  request.url = 'ServiceRequest',  tgt.entry = create('Reference') as reference,  reference.reference = ('https://example/ServiceRequest/' + %serviceRequest.id),  serviceRequest.note as note then {
    entry1 -&gt;  serviceRequest.subject = create('Reference') as reference,  reference.reference = ('https://example/Patient/' + %patient.id) &quot;reference&quot;;
    entry1 -&gt;  serviceRequest.encounter = create('Reference') as reference,  reference.reference = ('https://example/Encounter/' + %enc.id) &quot;reference&quot;;
    entry1 -&gt; serviceRequest.status = 'active' &quot;status&quot;;
    entry1 -&gt; serviceRequest.intent = 'order' &quot;intent&quot;;
    entry1.act as act then {
      act.code -&gt; serviceRequest.code;
      act.text as t -&gt; note.text = (t.dataString);
      act.statusCode as code -&gt; serviceRequest.status = (code.code);
      act.performer as perf -&gt;  bundle.entry as e1,  e1.request = create('BackboneElement') as request,  request.method = 'PUT',  e1.resource = create('Practitioner') as practitioner,  practitioner.id = uuid() as uuid1,  e1.fullUrl = append('https://example/Practitioner/', uuid1),  request.url = append('Practitioner/', uuid1) then {
        perf.time as time -&gt; serviceRequest.occurrence = create('dateTime') as t then TSDateTime(time, t);
        perf.assignedEntity as assEnt then {
          assEnt -&gt; practitioner.meta as meta then {
            assEnt -&gt; meta.tag = create('Coding') as coding then {
              assEnt -&gt; coding.system = 'http://algoritmodiscoring' &quot;system&quot;;
              assEnt -&gt; coding.code = 'ClinicalDocument/body/Consulenze/performer' &quot;code&quot;;
            } &quot;coding&quot;;
          } &quot;meta&quot;;
          assEnt.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;
            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,  e1.fullUrl = append('https://example/Practitioner/', uuid2),  request.url = append('Practitioner/', uuid2),  serviceRequest.performer = create('Reference') as reference,  reference.reference = ('https://example/Practitioner/' + %practitioner.id) &quot;aut&quot;;
            } &quot;r&quot;;
          } &quot;identifier&quot;;
          assEnt.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;;
          assEnt.assignedPerson as assPer then {
            assPer.name -&gt; practitioner.name;
          } &quot;assPer&quot;;
        } &quot;assEnt&quot;;
      };
      act.participant as parti -&gt;  bundle.entry as e1,  e1.request = create('BackboneElement') as request,  request.method = 'PUT',  e1.resource = create('Practitioner') as practitioner,  practitioner.id = uuid() as uuid1,  e1.fullUrl = append('https://example/Practitioner/', uuid1),  request.url = append('Practitioner/', uuid1) then {
        parti.time as time -&gt; serviceRequest.authoredOn = create('dateTime') as t then TSDateTime(time, t);
        parti.participantRole as partRole then {
          partRole -&gt; practitioner.meta as meta then {
            partRole -&gt; meta.tag = create('Coding') as coding then {
              partRole -&gt; coding.system = 'http://algoritmodiscoring' &quot;system&quot;;
              partRole -&gt; coding.code = 'ClinicalDocument/body/Consulenze/participant' &quot;code&quot;;
            } &quot;coding&quot;;
          } &quot;meta&quot;;
          partRole.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;
            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,  e1.fullUrl = append('https://example/Practitioner/', uuid2),  request.url = append('Practitioner/', uuid2),  serviceRequest.requester = create('Reference') as reference,  reference.reference = ('https://example/Practitioner/' + %practitioner.id) &quot;aut&quot;;
            } &quot;r&quot;;
          } &quot;identifier&quot;;
          partRole.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;;
          partRole.playingEntity as entity then {
            entity.name -&gt; practitioner.name;
          } &quot;entity&quot;;
        } &quot;partRole&quot;;
      };
    } &quot;ACT&quot;;
  };
}

// ---------------------------------------------------------------------------------------------------------
// Sezione Accertamenti--------------------------------------------------------------------------------------
group ClinicalDocumentSectionAccertamenti(source cda : ClinicalDocument, source src : Section, target patient : Patient, target tgt, target bundle : Bundle, target enc : Encounter) {
  src.title as t -&gt; tgt.title = (t.dataString);
  src.code -&gt; tgt.code;
  src where src.entry.exists() then {
    src.text as cdaText -&gt; tgt.text as fhirText then {
      cdaText -&gt; fhirText.status = 'generated' &quot;narrativeStatus&quot;;
      cdaText as t -&gt; fhirText.div = t &quot;narrativeText&quot;;
    } &quot;cdaText&quot;;
  } &quot;entryExists&quot;;
  // Sezione Strutturata---------------------------------------------------------------------------------------------------------------------------------------------
  src.entry as entry1 -&gt;  bundle.entry as e1,  e1.request = create('BackboneElement') as request,  request.method = 'POST',  e1.resource = create('Observation') as observation,  observation.id = uuid() as uuid1,  e1.fullUrl = append('https://example/Observation/', uuid1),  request.url = 'Observation',  tgt.entry = create('Reference') as reference,  reference.reference = ('https://example/Observation/' + %observation.id) then {
    entry1.organizer as obs then {
      src.code -&gt; observation.code;
      obs then ObservationAccertamenti(obs, patient, enc, observation, bundle) &quot;act&quot;;
    } &quot;obs&quot;;
  };
  // Sezione Narrativa--------------------------------------------------------------------------------------------------------------------------------------------
  src where src.entry.exists().not() then {
    src.text as cdaText -&gt;  bundle.entry as e8,  e8.request = create('BackboneElement') as request,  request.method = 'POST',  e8.resource = create('Observation') as Observation,  Observation.id = uuid() as uuid8,  e8.fullUrl = append('https://example/Observation/', uuid8),  request.url = 'Observation',  tgt.entry = create('Reference') as reference,  reference.reference = ('https://example/Observation/' + %Observation.id) then {
      src -&gt;  Observation.subject = create('Reference') as reference,  reference.reference = ('https://example/Patient/' + %patient.id) &quot;reference&quot;;
      src -&gt;  Observation.encounter = create('Reference') as reference,  reference.reference = ('https://example/Encounter/' + %enc.id) &quot;reference&quot;;
      src.code -&gt; Observation.code;
      src where observation.statusCode.exists().not() then {
        src -&gt; Observation.status = 'final' &quot;status&quot;;
      } &quot;statuscode&quot;;
      cdaText -&gt; Observation.note as note then {
        cdaText as t -&gt; note.text = t &quot;reference&quot;;
      } &quot;reference&quot;;
    } &quot;cdaText&quot;;
  } &quot;where&quot;;
}

group ObservationAccertamenti(source obs : Observation, target patient : Patient, target encounter : Encounter, target ob : Observation, target bundle : Bundle) {
  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 where obs.statusCode.exists().not() then {
    obs -&gt; ob.status = 'final' &quot;status&quot;;
  } &quot;statuscode&quot;;
  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.value : CD as val then {
    val -&gt; ob.value = create('CodeableConcept') as ce then {
      val.originalText -&gt; ce.text;
      val -&gt; ce.coding as coding then {
        val.code as code -&gt; coding.code = cast(code, 'string');
        val.codeSystem as system -&gt; coding.system = translate(system, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri');
        val.displayName as display -&gt; coding.display = cast(display, 'string');
      } &quot;code&quot;;
      val.translation as translation -&gt; ce.coding as coding then {
        translation.code as code -&gt; coding.code = cast(code, 'string');
        translation.codeSystem as system -&gt; coding.system = translate(system, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri');
        translation.displayName as display -&gt; coding.display = cast(display, 'string');
        translation.qualifier as qualifier then {
          qualifier.value as value -&gt; ce.coding as coding then {
            value.code as code -&gt; coding.code = cast(code, 'string');
            value.codeSystem as system -&gt; coding.system = translate(system, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri');
            value.displayName as display -&gt; coding.display = cast(display, 'string');
          };
        } &quot;qual&quot;;
      };
    } &quot;coding&quot;;
  } &quot;val&quot;;
  obs.value : CE as val then {
    val -&gt; ob.value = create('CodeableConcept') as ce then {
      val.originalText -&gt; ce.text;
      val -&gt; ce.coding as coding then {
        val.code as code -&gt; coding.code = cast(code, 'string');
        val.codeSystem as system -&gt; coding.system = translate(system, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri');
        val.displayName as display -&gt; coding.display = cast(display, 'string');
      } &quot;code&quot;;
      val.translation as translation -&gt; ce.coding as coding then {
        translation.code as code -&gt; coding.code = cast(code, 'string');
        translation.codeSystem as system -&gt; coding.system = translate(system, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri');
        translation.displayName as display -&gt; coding.display = cast(display, 'string');
        translation.qualifier as qualifier then {
          qualifier.value as value -&gt; ce.coding as coding then {
            value.code as code -&gt; coding.code = cast(code, 'string');
            value.codeSystem as system -&gt; coding.system = translate(system, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri');
            value.displayName as display -&gt; coding.display = cast(display, 'string');
          };
        } &quot;qual&quot;;
      };
    } &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);
  obs.value : INT as int -&gt; ob.value = (int.value);
  obs.value : BL as boolean -&gt; ob.value = (boolean.value) &quot;boolean&quot;;
  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.interpretationCode -&gt; ob.interpretation;
  obs.methodCode -&gt; ob.method;
  obs.referenceRange as refRange -&gt; ob.referenceRange = create('BackboneElement') as ref then {
    refRange.observationRange as obsRange -&gt; ref.low = create('SimpleQuantity') 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;;
      } &quot;IVL-PQ&quot;;
    } &quot;obsRange&quot;;
  } &quot;refRange&quot;;
  obs.performer as performer -&gt;  bundle.entry as e1,  e1.request = create('BackboneElement') as request,  request.method = 'PUT',  e1.resource = create('Practitioner') as practitioner,  practitioner.id = uuid() as uuid1,  e1.fullUrl = append('https://example/Practitioner/', uuid1),  request.url = append('Practitioner/', uuid1) then {
    performer.assignedEntity as assEntity then {
      // inizio modifica identifier+meta
      assEntity -&gt; practitioner.meta as meta then {
        assEntity -&gt; meta.tag = create('Coding') as coding then {
          assEntity -&gt; coding.system = 'http://algoritmodiscoring' &quot;system&quot;;
          assEntity -&gt; coding.code = 'ClinicalDocument/body/Accertamenti/performer' &quot;code&quot;;
        } &quot;coding&quot;;
      } &quot;meta&quot;;
      assEntity.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;
        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,  e1.fullUrl = append('https://example/Practitioner/', uuid2),  request.url = append('Practitioner/', uuid2),  ob.performer = create('Reference') as reference,  reference.reference = ('https://example/Practitioner/' + %practitioner.id) &quot;aut&quot;;
        } &quot;r&quot;;
      } &quot;identifier&quot;;
      assEntity.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;;
      // fine modifica
      assEntity.assignedPerson as assi then {
        assi.name -&gt; practitioner.name;
      } &quot;assi&quot;;
    } &quot;assEntity&quot;;
  } &quot;perf&quot;;
  obs.participant as participant -&gt;  bundle.entry as e1,  e1.request = create('BackboneElement') as request,  request.method = 'POST',  e1.resource = create('ServiceRequest') as serviceRequest,  serviceRequest.id = uuid() as uuid1,  e1.fullUrl = append('https://example/ServiceRequest/', uuid1),  request.url = 'ServiceRequest',  ob.basedOn = create('Reference') as reference,  reference.reference = ('https://example/ServiceRequest/' + %serviceRequest.id) then {
    // participant.time as t -&gt; serviceRequest.authoredOn = (t.value);
    participant.time as t -&gt; serviceRequest.authoredOn = create('dateTime') as value then TSDateTime(t, value) &quot;value2&quot;;
    obs -&gt;  serviceRequest.subject = create('Reference') as reference,  reference.reference = ('https://example/Patient/' + %patient.id) &quot;reference&quot;;
    obs -&gt;  serviceRequest.encounter = create('Reference') as reference,  reference.reference = ('https://example/Encounter/' + %encounter.id) &quot;reference&quot;;
    obs -&gt; serviceRequest.status = 'active' &quot;status&quot;;
    obs -&gt; serviceRequest.intent = 'order' &quot;intent&quot;;
    participant.participantRole as participantRole -&gt;  bundle.entry as e1,  e1.request = create('BackboneElement') as request,  request.method = 'PUT',  e1.resource = create('Practitioner') as practitioner,  practitioner.id = uuid() as uuid1,  e1.fullUrl = append('https://example/Practitioner/', uuid1),  request.url = append('Practitioner/', uuid1) then {
      // modifica meta+identifier
      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/Accertamenti/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;
        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,  e1.fullUrl = append('https://example/Practitioner/', uuid2),  request.url = append('Practitioner/', uuid2),  serviceRequest.requester = create('Reference') as reference,  reference.reference = ('https://example/Practitioner/' + %practitioner.id) &quot;aut&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;;
      // fine modifica
      participantRole.playingEntity as pe then {
        pe.name -&gt; practitioner.name;
      } &quot;pe&quot;;
    };
  };
  obs.component as comp -&gt;  bundle.entry as e1,  e1.request = create('BackboneElement') as request,  request.method = 'POST',  e1.resource = create('Observation') as observation,  observation.id = uuid() as uuid1,  e1.fullUrl = append('https://example/Observation/', uuid1),  request.url = 'Observation',  ob.hasMember = create('Reference') as reference,  reference.reference = ('https://example/Observation/' + %observation.id) then {
    comp.observation as obs then {
      obs.code -&gt; observation.code;
      obs.statusCode as statusc where (code = 'completed') -&gt; observation.status = 'final';
      obs.statusCode as statusc where (code = 'active') -&gt; observation.status = 'registered';
      obs.statusCode as statusc where (code = 'aborted') -&gt; observation.status = 'cancelled';
      obs.statusCode as statusc where (code = 'suspended') -&gt; observation.status = 'partial';
      obs where obs.statusCode.exists().not() then {
        obs -&gt; observation.status = 'final' &quot;status&quot;;
      } &quot;statuscode&quot;;
      obs -&gt;  observation.subject = create('Reference') as reference,  reference.reference = ('https://example/Patient/' + %patient.id) &quot;reference&quot;;
      obs -&gt;  observation.encounter = create('Reference') as reference,  reference.reference = ('https://example/Encounter/' + %encounter.id) &quot;reference&quot;;
      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.value as val -&gt; observation.value = (val.dataString);
    } &quot;obs&quot;;
  } &quot;observation&quot;;
}

// -----------------------------------------------------------------------------------------------------------
// Sezione ParametriVitali--------------------------------------------------------------------------------------
group ClinicalDocumentSectionParametriVitali(source cda : ClinicalDocument, source src : Section, target patient : Patient, target tgt, target bundle : Bundle, target enc : Encounter) {
  src.title as t -&gt; tgt.title = (t.dataString);
  src.code -&gt; tgt.code;
  src where src.entry.exists() then {
    src.text as cdaText -&gt; tgt.text as fhirText then {
      cdaText -&gt; fhirText.status = 'generated' &quot;narrativeStatus&quot;;
      cdaText as t -&gt; fhirText.div = t &quot;narrativeText&quot;;
    } &quot;cdaText&quot;;
  } &quot;entry-exists&quot;;
  // Sezione Narrativa----------------------------------------------------------------------------------------------------------------------------------------------------
  src where src.entry.exists().not() then {
    src.text as cdaText -&gt;  bundle.entry as e8,  e8.request = create('BackboneElement') as request,  request.method = 'POST',  e8.resource = create('Observation') as Observation,  Observation.id = uuid() as uuid8,  e8.fullUrl = append('https://example/Observation/', uuid8),  request.url = 'Observation',  tgt.entry = create('Reference') as reference,  reference.reference = ('https://example/Observation/' + %Observation.id) then {
      src -&gt;  Observation.subject = create('Reference') as reference,  reference.reference = ('https://example/Patient/' + %patient.id) &quot;reference&quot;;
      src -&gt;  Observation.encounter = create('Reference') as reference,  reference.reference = ('https://example/Encounter/' + %enc.id) &quot;reference&quot;;
      src.code -&gt; Observation.code;
      src where observation.statusCode.exists().not() then {
        src -&gt; Observation.status = 'final' &quot;status&quot;;
      } &quot;statuscode&quot;;
      cdaText -&gt; Observation.note as note then {
        cdaText as t -&gt; note.text = t &quot;reference&quot;;
      } &quot;reference&quot;;
    } &quot;cdaText&quot;;
  } &quot;where&quot;;
  // Sezione Strutturata --------------------------------------------------------------------------------------------------------------------------------------------------------
  src.entry as entry1 -&gt;  bundle.entry as e1,  e1.request = create('BackboneElement') as request,  request.method = 'POST',  e1.resource = create('Observation') as observation,  observation.id = uuid() as uuid1,  e1.fullUrl = append('https://example/Observation/', uuid1),  request.url = 'Observation',  tgt.entry = create('Reference') as reference,  reference.reference = ('https://example/Observation/' + %observation.id) then {
    entry1.organizer as org then {
      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/' + %enc.id) &quot;reference&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 where obs.statusCode.exists().not() then {
        org -&gt; observation.status = 'final' &quot;status&quot;;
      } &quot;statuscode&quot;;
      org.code -&gt; observation.code;
      org where org.code.exists().not() then {
        src.code -&gt; observation.code;
      } &quot;code&quot;;
      org.component as component -&gt;  bundle.entry as e1,  e1.request = create('BackboneElement') as request,  request.method = 'POST',  e1.resource = create('Observation') as observation1,  observation1.id = uuid() as uuid1,  e1.fullUrl = append('https://example/Observation/', uuid1),  request.url = 'Observation',  observation.hasMember = create('Reference') as reference,  reference.reference = ('https://example/Observation/' + %observation1.id) then {
        component.observation as obs then {
          obs -&gt;  observation1.subject = create('Reference') as reference,  reference.reference = ('https://example/Patient/' + %patient.id) &quot;reference&quot;;
          obs -&gt;  observation1.encounter = create('Reference') as reference,  reference.reference = ('https://example/Encounter/' + %enc.id) &quot;reference&quot;;
          obs.code -&gt; observation1.code;
          obs.statusCode -&gt; observation1.status;
          obs.statusCode as statusc where (code = 'completed') -&gt; observation1.status = 'final';
          obs.statusCode as statusc where (code = 'active') -&gt; observation1.status = 'registered';
          obs.statusCode as statusc where (code = 'aborted') -&gt; observation1.status = 'cancelled';
          obs.statusCode as statusc where (code = 'suspended') -&gt; observation1.status = 'partial';
          obs where obs.statusCode.exists().not() then {
            obs -&gt; observation1.status = 'final' &quot;status&quot;;
          } &quot;statuscode&quot;;
          obs -&gt; observation1.value = create('Quantity') as quant then {
            obs.value as v -&gt; quant.value = (v.value);
            obs.value as v -&gt; quant.unit = (v.unit);
          } &quot;quant&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 : ST as value -&gt;  ob.value = create('string'),  ob.value = (value.dataString);
          obs.value : INT as int -&gt; ob.value = (int.value);
          obs.value : BL as boolean -&gt; ob.value = (boolean.value) &quot;boolean&quot;;
          obs.interpretationCode -&gt; observation1.interpretation;
          obs.methodCode -&gt; observation1.method;
          obs.targetSiteCode -&gt; observation1.bodySite;
          obs.performer as performer -&gt;  bundle.entry as e1,  e1.request = create('BackboneElement') as request,  request.method = 'PUT',  e1.resource = create('Practitioner') as practitioner,  practitioner.id = uuid() as uuid1,  e1.fullUrl = append('https://example/Practitioner/', uuid1),  request.url = append('Practitioner/', uuid1) then {
            performer.time as t -&gt; observation1.issued = create('dateTime') as date then TSDateTime(t, date);
            performer.assignedEntity as assEntity then {
              // inizio modifica meta+ identifier
              assEntity -&gt; practitioner.meta as meta then {
                assEntity -&gt; meta.tag = create('Coding') as coding then {
                  assEntity -&gt; coding.system = 'http://algoritmodiscoring' &quot;system&quot;;
                  assEntity -&gt; coding.code = 'ClinicalDocument/body/ParametriVitali/performer' &quot;code&quot;;
                } &quot;coding&quot;;
              } &quot;meta&quot;;
              assEntity.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;
                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,  e1.fullUrl = append('https://example/Practitioner/', uuid2),  request.url = append('Practitioner/', uuid2),  observation1.performer = create('Reference') as reference,  reference.reference = ('https://example/Practitioner/' + %practitioner.id) &quot;aut&quot;;
                } &quot;r&quot;;
              } &quot;identifier&quot;;
              assEntity.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;;
              // fine modifica
              assEntity.assignedPerson as assPerson then {
                assPerson.name -&gt; practitioner.name;
              } &quot;assPerson&quot;;
            } &quot;assEntity&quot;;
          };
          obs.participant as parti -&gt;  bundle.entry as e1,  e1.request = create('BackboneElement') as request,  request.method = 'POST',  e1.resource = create('ServiceRequest') as serviceRequest,  serviceRequest.id = uuid() as uuid1,  e1.fullUrl = append('https://example/ServiceRequest/', uuid1),  request.url = 'ServiceRequest',  observation1.basedOn = create('Reference') as reference,  reference.reference = ('https://example/ServiceRequest/' + %serviceRequest.id) then {
            parti -&gt;  serviceRequest.subject = create('Reference') as reference,  reference.reference = ('https://example/Patient/' + %patient.id) &quot;reference&quot;;
            parti -&gt;  serviceRequest.encounter = create('Reference') as reference,  reference.reference = ('https://example/Encounter/' + %enc.id) &quot;reference&quot;;
            parti -&gt; serviceRequest.status = 'active' &quot;status&quot;;
            parti -&gt; serviceRequest.intent = 'order' &quot;intent&quot;;
            parti.time as t -&gt; serviceRequest.authoredOn = create('dateTime') as value then TSDateTime(t, value) &quot;value2&quot;;
            parti.participantRole as partRole -&gt;  bundle.entry as e1,  e1.request = create('BackboneElement') as request,  request.method = 'PUT',  e1.resource = create('Practitioner') as practitioner,  practitioner.id = uuid() as uuid1,  e1.fullUrl = append('https://example/Practitioner/', uuid1),  request.url = append('Practitioner/', uuid1) then {
              // inizio modifica meta + identifier
              partRole -&gt; practitioner.meta as meta then {
                partRole -&gt; meta.tag = create('Coding') as coding then {
                  partRole -&gt; coding.system = 'http://algoritmodiscoring' &quot;system&quot;;
                  partRole -&gt; coding.code = 'ClinicalDocument/body/ParametriVitali/participant' &quot;code&quot;;
                } &quot;coding&quot;;
              } &quot;meta&quot;;
              partRole.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;
                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,  e1.fullUrl = append('https://example/Practitioner/', uuid2),  request.url = append('Practitioner/', uuid2),  serviceRequest.requester = create('Reference') as reference,  reference.reference = ('https://example/Practitioner/' + %practitioner.id) &quot;aut&quot;;
                } &quot;r&quot;;
              } &quot;identifier&quot;;
              partRole.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;;
              // fine modifica
              partRole.playingEntity as playingEntity then {
                playingEntity.name -&gt; practitioner.name;
              } &quot;name&quot;;
            } &quot;partRole&quot;;
          } &quot;parti&quot;;
        } &quot;obs&quot;;
      };
    } &quot;obs&quot;;
  } &quot;Observation&quot;;
}

// -----------------------------------------------------------------------------------------------------------------
// Sezione terapia Farma in Pronto----------------------------------------------------------------------------------
group ClinicalDocumentSectionTerapiaFarmacoInPronto(source cda : ClinicalDocument, source src : Section, target patient : Patient, target tgt, target bundle : Bundle, target enc : Encounter) {
  src.title as t -&gt; tgt.title = (t.dataString);
  src.code -&gt; tgt.code;
  src where src.entry.exists() then {
    src.text as cdaText -&gt; tgt.text as fhirText then {
      cdaText -&gt; fhirText.status = 'generated' &quot;narrativeStatus&quot;;
      cdaText as t -&gt; fhirText.div = t &quot;narrativeText&quot;;
    } &quot;cdaText&quot;;
  } &quot;entry-exists&quot;;
  // Sezione Narrativa------------------------------------------------------------------------------------------------------------------------------------------------
  src where src.entry.exists().not() then {
    src.text as cdaText -&gt;  bundle.entry as e8,  e8.request = create('BackboneElement') as request,  request.method = 'POST',  e8.resource = create('MedicationAdministration') as MedicationAdministration,  MedicationAdministration.id = uuid() as uuid8,  e8.fullUrl = append('https://example/MedicationAdministration/', uuid8),  request.url = 'MedicationAdministration',  tgt.entry = create('Reference') as reference,  reference.reference = ('https://example/MedicationAdministration/' + %MedicationAdministration.id) then {
      src -&gt;  MedicationAdministration.subject = create('Reference') as reference,  reference.reference = ('https://example/Patient/' + %patient.id) &quot;reference&quot;;
      src -&gt;  MedicationAdministration.context = create('Reference') as reference,  reference.reference = ('https://example/Encounter/' + %enc.id) &quot;reference&quot;;
      src -&gt; MedicationAdministration.effective = create('Period') as period then {
        src -&gt; period.start = (start.now()) &quot;low&quot;;
        src -&gt; period.end = (end.now()) &quot;high&quot;;
      } &quot;Period&quot;;
      src where sub.statusCode.exists().not() then {
        src -&gt; MedicationAdministration.status = 'completed' &quot;status&quot;;
      } &quot;statuscode&quot;;
      cdaText -&gt; MedicationAdministration.note as note then {
        cdaText as t -&gt; note.text = t &quot;reference&quot;;
        cdaText -&gt; MedicationAdministration.medication = create('CodeableConcept') as medication then {
          cdaText as txt -&gt; medication.text = txt &quot;text&quot;;
        } &quot;medication&quot;;
      } &quot;reference&quot;;
    } &quot;cdaText&quot;;
  } &quot;where&quot;;
  // Sezione Strutturata-------------------------------------------------------------------------------------------------------------------------------------------------
  src.entry as entry1 -&gt;  bundle.entry as e1,  e1.request = create('BackboneElement') as request,  request.method = 'POST',  e1.resource = create('MedicationAdministration') as medAdm,  medAdm.id = uuid() as uuid1,  e1.fullUrl = append('https://example/MedicationAdministration/', uuid1),  request.url = 'MedicationAdministration',  tgt.entry = create('Reference') as reference,  reference.reference = ('https://example/MedicationAdministration/' + %medAdm.id),  medAdm.note as note then {
    entry1 -&gt;  medAdm.subject = create('Reference') as reference,  reference.reference = ('https://example/Patient/' + %patient.id) &quot;reference&quot;;
    entry1 -&gt;  medAdm.context = create('Reference') as reference,  reference.reference = ('https://example/Encounter/' + %enc.id) &quot;reference&quot;;
    entry1.substanceAdministration as sub then {
      sub.text as tx then {
        tx.reference as reff -&gt; note.text = (reff.value);
      } &quot;txx&quot;;
      sub.statusCode -&gt; medAdm.status;
      // sub.effectiveTime: IVL_TS as eff -&gt; medAdm.effective =create('Period') as period then IVLTSPeriod(eff,period); CHECK THIS
      sub.effectiveTime as eff -&gt; medAdm.effective = create('Period') as period then IVLTSPeriod(eff, period);
      sub.effectiveTime : PIVL_TS as eff -&gt; medAdm.dosage as dosage then {
        eff -&gt; dosage.rate = create('Ratio') as ratio then {
          eff -&gt; ratio.numerator = create('Quantity') as num then {
            eff.period as per -&gt; num.value = (per.value);
            eff.period as per -&gt; num.unit = (per.unit);
          } &quot;num&quot;;
          eff -&gt; ratio.denominator = create('Quantity') as num then {
            eff.period as per -&gt; num.value = '1';
            eff.period as per -&gt; num.unit = (per.unit);
          } &quot;den&quot;;
        } &quot;ratio&quot;;
      } &quot;eff2&quot;;
      sub -&gt; medAdm.dosage as dosage then {
        sub.routeCode -&gt; dosage.route;
      } &quot;route&quot;;
      sub -&gt; medAdm.dosage as dosage then {
        sub.approachSiteCode -&gt; dosage.site;
      } &quot;route&quot;;
      sub -&gt;  bundle.entry as e1,  e1.request = create('BackboneElement') as request,  request.method = 'POST',  e1.resource = create('MedicationRequest') as medRq,  medRq.id = uuid() as uuid1,  e1.fullUrl = append('https://example/MedicationRequest/', uuid1),  request.url = 'MedicationRequest',  medAdm.request = create('Reference') as reference,  reference.reference = ('https://example/MedicationRequest/' + %medRq.id) then {
        sub.entryRelationship as rel then {
          rel.supply as supl -&gt; medRq.dispenseRequest = create('BackboneElement') as disp then {
            supl -&gt; disp.quantity = create('SimpleQuantity') as q then {
              supl.quantity as qua -&gt; q.value = (qua.value) &quot;fds&quot;;
            } &quot;SimpleQuantity&quot;;
          } &quot;obs&quot;;
        } &quot;rel&quot;;
        sub -&gt;  medRq.subject = create('Reference') as reference,  reference.reference = ('https://example/Patient/' + %patient.id) &quot;reference&quot;;
        sub -&gt;  medRq.encounter = create('Reference') as reference,  reference.reference = ('https://example/Encounter/' + %enc.id) &quot;reference&quot;;
        sub -&gt; medRq.status = 'active' &quot;status&quot;;
        sub -&gt; medRq.intent = 'order' &quot;intent&quot;;
        sub -&gt; medRq.medication = create('CodeableConcept') as cod then {
          sub -&gt; cod.text = 'medication' &quot;Medi&quot;;
        } &quot;code&quot;;
        sub.doseQuantity as quantity then {
          quantity -&gt; medRq.dosageInstruction = create('Dosage') as dosage then {
            quantity -&gt; dosage.doseAndRate as dosRange then {
              quantity -&gt; dosRange.dose = create('Range') as range then {
                quantity -&gt; range.low = create('SimpleQuantity') as quant then {
                  quantity.low as l -&gt; quant.value = (l.value) &quot;v1&quot;;
                  quantity.low as l -&gt; quant.unit = (l.unit) &quot;v1&quot;;
                } &quot;low&quot;;
                quantity -&gt; range.high = create('SimpleQuantity') as quant then {
                  quantity.high as h -&gt; quant.value = (h.value) &quot;v1&quot;;
                  quantity.high as h -&gt; quant.unit = (h.unit) &quot;v1&quot;;
                } &quot;high&quot;;
              } &quot;range&quot;;
            } &quot;dos&quot;;
          } &quot;dosage&quot;;
        } &quot;dose-quantity&quot;;
        sub.rateQuantity as rate then {
          rate -&gt; medRq.dosageInstruction = create('Dosage') as dosage then {
            rate -&gt; dosage.doseAndRate as dosRange then {
              rate -&gt; dosRange.dose = create('Range') as range then {
                rate -&gt; range.low = create('SimpleQuantity') as quant then {
                  rate.low as l -&gt; quant.value = (l.value) &quot;v1&quot;;
                  rate.low as l -&gt; quant.unit = (l.unit) &quot;v1&quot;;
                } &quot;low&quot;;
                rate -&gt; range.high = create('SimpleQuantity') as quant then {
                  rate.high as h -&gt; quant.value = (h.value) &quot;v1&quot;;
                  rate.high as h -&gt; quant.unit = (h.unit) &quot;v1&quot;;
                } &quot;high&quot;;
              } &quot;range&quot;;
            } &quot;dos&quot;;
          } &quot;dosage&quot;;
        } &quot;Rate-quantity&quot;;
        sub.participant as part then {
          part.time as t -&gt; medRq.authoredOn = create('dateTime') as date then TSDateTime(t, date);
          part.participantRole as partRole -&gt;  bundle.entry as e1,  e1.request = create('BackboneElement') as request,  request.method = 'PUT',  e1.resource = create('Practitioner') as practitioner,  practitioner.id = uuid() as uuid1,  e1.fullUrl = append('https://example/Practitioner/', uuid1),  request.url = append('Practitioner/', uuid1) then {
            // inizio meta+identifier
            partRole -&gt; practitioner.meta as meta then {
              partRole -&gt; meta.tag = create('Coding') as coding then {
                partRole -&gt; coding.system = 'http://algoritmodiscoring' &quot;system&quot;;
                partRole -&gt; coding.code = 'ClinicalDocument/body/TerapiaFarmacologicaPS/participant' &quot;code&quot;;
              } &quot;coding&quot;;
            } &quot;meta&quot;;
            partRole.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;
              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,  e1.fullUrl = append('https://example/Practitioner/', uuid2),  request.url = append('Practitioner/', uuid2),  medRq.requester = create('Reference') as reference,  reference.reference = ('https://example/Practitioner/' + %practitioner.id) &quot;aut&quot;;
              } &quot;r&quot;;
            } &quot;identifier&quot;;
            partRole.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;;
            // fine modifiche
            partRole.id -&gt; practitioner.identifier;
            partRole.playingEntity as play then {
              play.name -&gt; practitioner.name;
            } &quot;play&quot;;
          } &quot;Part&quot;;
        } &quot;part&quot;;
      } &quot;medicationRequest&quot;;
      sub -&gt;  bundle.entry as e1,  e1.request = create('BackboneElement') as request,  request.method = 'POST',  e1.resource = create('Medication') as med,  med.id = uuid() as uuid1,  e1.fullUrl = append('https://example/Medication/', uuid1),  request.url = 'Medication',  medAdm.medication = create('Reference') as reference,  reference.reference = ('https://example/Medication/' + %med.id) then {
        sub.administrationUnitCode as adduni then {
          sub.administrationUnitCode -&gt; med.form;
          sub.consumable as consum then {
            consum.manufacturedProduct as manuProd then {
              manuProd.manufacturedMaterial as manuMt then {
                manuMt.code -&gt; med.code;
              } &quot;manuMat&quot;;
            } &quot;manuMat&quot;;
          } &quot;consum&quot;;
        } &quot;unicode&quot;;
        sub.entryRelationship as entryR then {
          entryR.observation as observation then {
            observation.code where displayName = 'Grammatura' -&gt; med.ingredient as ingredient then {
              sub.consumable as consumable then {
                consumable.manufacturedProduct as manufacturedProduct then {
                  manufacturedProduct.manufacturedMaterial as manufacturedMaterial then {
                    manufacturedMaterial.code as code -&gt; ingredient.item = create('CodeableConcept') as value then CECodeableConcept(code, value) &quot;CE&quot;;
                  } &quot;material&quot;;
                } &quot;product&quot;;
              };
              observation.value as value -&gt; ingredient.strength as strength then {
                value -&gt; strength.numerator as numerator then {
                  value -&gt; numerator.value = (value.value) &quot;valueN&quot;;
                } &quot;numerator&quot;;
                value -&gt; strength.denominator as denominator then {
                  value -&gt; denominator.value = 1 &quot;valueD&quot;;
                } &quot;denominator&quot;;
              } &quot;strenght&quot;;
            } &quot;ingredient&quot;;
            observation.code where displayName = 'Quantità nella Confezione' then {
              observation.value as value -&gt; med.amount as amount then {
                value -&gt; amount.numerator as numerator then {
                  value -&gt; numerator.value = (value.value) &quot;valueN&quot;;
                } &quot;numerator&quot;;
                value -&gt; amount.denominator as denominator then {
                  value -&gt; denominator.value = 1 &quot;valueD&quot;;
                } &quot;denominator&quot;;
              } &quot;amount&quot;;
            } &quot;quantita&quot;;
          } &quot;obs&quot;;
        } &quot;entry-R&quot;;
      } &quot;med&quot;;
      sub.performer as perf -&gt;  bundle.entry as e1,  e1.request = create('BackboneElement') as request,  request.method = 'PUT',  e1.resource = create('Practitioner') as practitioner,  practitioner.id = uuid() as uuid1,  e1.fullUrl = append('https://example/Practitioner/', uuid1),  request.url = append('Practitioner/', uuid1) then {
        perf -&gt; medAdm.note as note then {
          perf -&gt; note.text = 'performertime' &quot;notaa&quot;;
          perf.time as t -&gt; note.time = create('dateTime') as value then TSDateTime(t, value) &quot;notetime&quot;;
        } &quot;preftime&quot;;
        perf.assignedEntity as ent then {
          // inizio modifica meta+identifier
          ent -&gt; practitioner.meta as meta then {
            ent -&gt; meta.tag = create('Coding') as coding then {
              ent -&gt; coding.system = 'http://algoritmodiscoring' &quot;system&quot;;
              ent -&gt; coding.code = 'ClinicalDocument/body/TerapiaFarmacologicaPS/performer' &quot;code&quot;;
            } &quot;coding&quot;;
          } &quot;meta&quot;;
          ent.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;
            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,  e1.fullUrl = append('https://example/Practitioner/', uuid2),  request.url = append('Practitioner/', uuid2),  medAdm.performer as p,  p.actor = create('Reference') as reference,  reference.reference = ('https://example/Practitioner/' + %practitioner.id) &quot;aut&quot;;
            } &quot;r&quot;;
          } &quot;identifier&quot;;
          ent.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;;
          // fine modifica
          ent.assignedPerson as assPerson then {
            assPerson.name -&gt; practitioner.name;
          } &quot;assperson&quot;;
        } &quot;ent&quot;;
      } &quot;perform&quot;;
    } &quot;MedAdm&quot;;
  };
}

// ------------------------------------------------------------------------------------------------------------------
// -
group ClinicalDocumentSectionPianoCuraDimissione(source cda : ClinicalDocument, source src : Section, target patient : Patient, target tgt, target bundle : Bundle, target enc : Encounter) {
  src.title as t -&gt; tgt.title = (t.dataString);
  src.code -&gt; tgt.code;
  src as entry1 -&gt;  bundle.entry as e1,  e1.request = create('BackboneElement') as request,  request.method = 'POST',  e1.resource = create('CarePlan') as careplan,  careplan.id = uuid() as uuid1,  e1.fullUrl = append('https://example/CarePlan/', uuid1),  request.url = 'CarePlan',  tgt.entry = create('Reference') as reference,  reference.reference = ('https://example/CarePlan/' + %careplan.id) then {
    src -&gt;  careplan.subject = create('Reference') as reference,  reference.reference = ('https://example/Patient/' + %patient.id) &quot;reference&quot;;
    src -&gt;  careplan.encounter = create('Reference') as reference,  reference.reference = ('https://example/Encounter/' + %enc.id) &quot;reference&quot;;
    src -&gt; careplan.status = 'active' &quot;status&quot;;
    src -&gt; careplan.intent = 'order' &quot;intent&quot;;
    src.text as cdaText -&gt; careplan.note as carenote then {
      cdaText as t -&gt; carenote.text = t &quot;notetxt&quot;;
      entry1.author as author then {
        author.time as t -&gt; carenote.time = create('dateTime') as value then TSDateTime(t, value) &quot;notetime&quot;;
        author.assignedAuthor as assauthor -&gt;  bundle.entry as e1,  e1.request = create('BackboneElement') as request,  request.method = 'PUT',  e1.resource = create('Practitioner') as practitioner,  practitioner.id = uuid() as uuid1,  e1.fullUrl = append('https://example/Practitioner/', uuid1),  request.url = append('Practitioner/', uuid1) then {
          // inizio modifica meta+identifier
          assauthor -&gt; practitioner.meta as meta then {
            assauthor -&gt; meta.tag = create('Coding') as coding then {
              assauthor -&gt; coding.system = 'http://algoritmodiscoring' &quot;system&quot;;
              assauthor -&gt; coding.code = 'ClinicalDocument/body/PianoCuraDimissione/author' &quot;code&quot;;
            } &quot;coding&quot;;
          } &quot;meta&quot;;
          assauthor.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;
            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,  e1.fullUrl = append('https://example/Practitioner/', uuid2),  request.url = append('Practitioner/', uuid2),  carenote.author = create('Reference') as reference,  reference.reference = ('https://example/Practitioner/' + %practitioner.id) &quot;aut&quot;;
            } &quot;r&quot;;
          } &quot;identifier&quot;;
          assauthor.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;;
          // fine modifica
          assauthor.assignedPerson as pers then {
            pers.name -&gt; practitioner.name;
          } &quot;namepers&quot;;
        } &quot;authpract&quot;;
      } &quot;CFauthor&quot;;
    } &quot;author&quot;;
    entry1.entry as entry2 then {
      entry2.act as entryact -&gt;  bundle.entry as e1,  e1.request = create('BackboneElement') as request,  request.method = 'POST',  e1.resource = create('ServiceRequest') as servicerequest,  servicerequest.id = uuid() as uuid1,  e1.fullUrl = append('https://example/ServiceRequest/', uuid1),  request.url = 'ServiceRequest',  careplan.activity = create('BackboneElement') as activ,  activ.reference = create('Reference') as reference,  reference.reference = ('https://example/ServiceRequest/' + %servicerequest.id) then {
        entryact -&gt;  servicerequest.subject = create('Reference') as reference,  reference.reference = ('https://example/Patient/' + %patient.id) &quot;reference&quot;;
        entryact -&gt;  servicerequest.encounter = create('Reference') as reference,  reference.reference = ('https://example/Encounter/' + %enc.id) &quot;reference&quot;;
        entryact -&gt; servicerequest.status = 'active' &quot;status&quot;;
        entryact -&gt; servicerequest.intent = 'order' &quot;intent&quot;;
        entryact -&gt; servicerequest.identifier = create('BackboneElement') as identif then {
          entryact.reference as actref then {
            actref.externalAct as extact then {
              extact -&gt; servicerequest.identifier = create('BackboneElement') as identif3 then {
                extact.id as id then {
                  id.root as r -&gt; identif3.system = translate(r, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri') &quot;root1&quot;;
                  id.extension as ext -&gt; identif3.value = ext then {
                    id.assigningAuthorityName as s -&gt;  identif3.assigner as a,  a.display = s;
                  } &quot;ext&quot;;
                } &quot;idnetn&quot;;
              } &quot;extact&quot;;
            } &quot;actref&quot;;
          } &quot;jarilemes&quot;;
          entryact.code -&gt; servicerequest.code;
          entryact.statusCode -&gt; servicerequest.status;
          entryact.author as actauthor then {
            actauthor.time as t -&gt; servicerequest.authoredOn = create('dateTime') as date then TSDateTime(t, date);
            actauthor.assignedAuthor as assauthor -&gt;  bundle.entry as e1,  e1.request = create('BackboneElement') as request,  request.method = 'PUT',  e1.resource = create('Practitioner') as practitioner,  practitioner.id = uuid() as uuid1,  e1.fullUrl = append('https://example/Practitioner/', uuid1),  request.url = append('Practitioner/', uuid1) then {
              // inizio modifica identifier
              assauthor -&gt; practitioner.meta as meta then {
                assauthor -&gt; meta.tag = create('Coding') as coding then {
                  assauthor -&gt; coding.system = 'http://algoritmodiscoring' &quot;system&quot;;
                  assauthor -&gt; coding.code = 'ClinicalDocument/body/PianoCuraDimissione/author' &quot;code&quot;;
                } &quot;coding&quot;;
              } &quot;meta&quot;;
              assauthor.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;
                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,  e1.fullUrl = append('https://example/Practitioner/', uuid2),  request.url = append('Practitioner/', uuid2),  servicerequest.requester = create('Reference') as reference,  reference.reference = ('https://example/Practitioner/' + %practitioner.id) &quot;aut&quot;;
                } &quot;r&quot;;
              } &quot;identifier&quot;;
              assauthor.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;;
              // fine modifica
              assauthor.assignedPerson as pers then {
                pers.name -&gt; practitioner.name;
              } &quot;namepers&quot;;
            } &quot;author&quot;;
          } &quot;servReq&quot;;
        } &quot;entry2&quot;;
      } &quot;carnote&quot;;
    } &quot;entry1&quot;;
  } &quot;entryident3&quot;;
}

// -------Dimissione------------------------------------------------------------------------------------------------------
group ClinicalDocumentSectionDimissione(source cda : ClinicalDocument, source src : Section, target patient : Patient, target tgt, target bundle : Bundle, target enc : Encounter) {
  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 then {
    entry1.act as act -&gt;  bundle.entry as e1,  e1.request = create('BackboneElement') as request,  request.method = 'POST',  e1.resource = create('Encounter') as encountert,  encountert.id = uuid() as uuid1,  e1.fullUrl = append('https://example/Encounter/', uuid1),  request.url = 'Encounter',  tgt.entry = create('Reference') as reference,  reference.reference = ('https://example/Encounter/' + %encountert.id) then {
      act -&gt; encountert.status = 'finished' &quot;status&quot;;
      act -&gt; encountert.class = create('Coding') as cl then {
        act -&gt; cl.code = 'AMB' &quot;code&quot;;
        act -&gt; cl.display = 'ambulatory' &quot;code&quot;;
      } &quot;class&quot;;
      act -&gt;  encountert.partOf = create('Reference') as reference,  reference.reference = ('https://example/Encounter/' + enc.id) &quot;refenc&quot;;
      act -&gt;  encountert.subject = create('Reference') as reference,  reference.reference = ('https://example/Patient/' + patient.id) &quot;refpatient&quot;;
      act.code -&gt; encountert.type;
      act where effectiveTime.low.exists() or effectiveTime.high.exists() then {
        act.effectiveTime as eff -&gt; encountert.period = create('Period') as period then IVLTSPeriod(eff, period);
      } &quot;where&quot;;
      // effectiveTime = time-stamp
      act where effectiveTime.low.exists().not() or effectiveTime.high.exists().not() then {
        act.effectiveTime as effectivetime1 -&gt; encountert.period = create('Period') as period then {
          effectivetime1 -&gt; period.start = create('dateTime') as start then TSDateTime(effectivetime1, start) &quot;val&quot;;
        } &quot;efft&quot;;
      } &quot;where&quot;;
      act.performer as performer -&gt;  bundle.entry as e1,  e1.request = create('BackboneElement') as request,  request.method = 'PUT',  e1.resource = create('Practitioner') as practitioner,  practitioner.id = uuid() as uuid1,  e1.fullUrl = append('https://example/Practitioner/', uuid1),  request.url = append('Practitioner/', uuid1) then {
        // performer.time as ti -&gt; note.time = (ti.value);
        performer.assignedEntity as assEnty then {
          assEnty -&gt; practitioner.meta as meta then {
            assEnty -&gt; meta.tag = create('Coding') as coding then {
              assEnty -&gt; coding.system = 'http://algoritmodiscoring' &quot;system&quot;;
              assEnty -&gt; coding.code = 'ClinicalDocument/body/Dimissione/performer' &quot;code&quot;;
            } &quot;coding&quot;;
          } &quot;meta&quot;;
          assEnty.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;
            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,  e1.fullUrl = append('https://example/Practitioner/', uuid2),  request.url = append('Practitioner/', uuid2),  encountert.participant as perf then {
                performer -&gt; perf.period = create('Period') as period then {
                  performer.time as time -&gt; period.start = create('dateTime') as start then TSDateTime(time, start);
                } &quot;period&quot;;
                performer -&gt;  perf.individual = create('Reference') as reference,  reference.reference = ('https://example/Practitioner/' + %practitioner.id) &quot;aut&quot;;
              } &quot;perf&quot;;
            } &quot;r&quot;;
          } &quot;identifier&quot;;
          assEnty.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;;
          assEnty.assignedPerson as assPers then {
            assPers.name -&gt; practitioner.name;
          } &quot;assPer&quot;;
        } &quot;ass&quot;;
      } &quot;erformer&quot;;
      // Encounter Post dimissione---------------------------------------------------------------------------------------------------------------------------------------
      act.entryRelationship as entriRel then {
        entriRel.encounter as enc1 then {
          enc1 -&gt;  bundle.entry as e1,  e1.request = create('BackboneElement') as request,  request.method = 'POST',  e1.resource = create('Encounter') as encountert1,  encountert1.id = uuid() as uuid1,  e1.fullUrl = append('https://example/Encounter/', uuid1),  request.url = 'Encounter',  tgt.entry = create('Reference') as reference,  reference.reference = ('https://example/Encounter/' + %encountert1.id),  encountert1.partOf = create('Reference') as reference,  reference.reference = ('https://example/Encounter/' + encountert.id) then {
            enc1 -&gt; encountert1.status = 'finished' &quot;status&quot;;
            enc1 -&gt; encountert1.class = create('Coding') as cl then {
              enc1 -&gt; cl.code = 'AMB' &quot;code&quot;;
              enc1 -&gt; cl.display = 'ambulatory' &quot;code&quot;;
            } &quot;class&quot;;
            enc1 -&gt;  encountert1.subject = create('Reference') as reference,  reference.reference = ('https://example/Patient/' + patient.id) &quot;refpatient&quot;;
            enc1.id -&gt; encountert1.identifier;
            // enc1.code -&gt; encountert1.type;
            enc1 -&gt; encountert1.type = create('CodeableConcept') as ti then {
              enc1 -&gt; ti.coding = create('Coding') as cod then {
                enc1.code as c -&gt; cod.code = (c.code);
                enc1.code as c then {
                  c.codeSystem as s -&gt; cod.system = translate(s, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri') &quot;system&quot;;
                } &quot;syst&quot;;
                enc1.code as c -&gt; cod.display = (c.displayName) &quot;dispaly&quot;;
              } &quot;coding&quot;;
              enc1.text as tx then {
                tx.reference as ref -&gt; ti.text = (ref.value) &quot;val&quot;;
              };
            } &quot;code&quot;;
            enc1 where effectiveTime.low.exists() or effectiveTime.high.exists() then {
              enc1.effectiveTime as eff -&gt; encountert1.period = create('Period') as period then IVLTSPeriod(eff, period);
            } &quot;where&quot;;
            // effectiveTime = time-stamp
            enc1 where effectiveTime.low.exists().not() or effectiveTime.high.exists().not() then {
              enc1.effectiveTime as effectivetime1 -&gt; encountert1.period = create('Period') as period then {
                effectivetime1 -&gt; period.start = create('dateTime') as start then TSDateTime(effectivetime1, start) &quot;val&quot;;
              } &quot;efft&quot;;
            } &quot;where&quot;;
            enc1.participant as part where (typeCode = 'LOC') -&gt;  bundle.entry as e1,  e1.request = create('BackboneElement') as request,  request.method = 'PUT',  e1.resource = create('Location') as location,  location.id = uuid() as uuid1,  e1.fullUrl = append('https://example/Location/', uuid1),  request.url = append('Location/', uuid1) then {
              part -&gt; location.meta as meta then {
                part -&gt; meta.tag = create('Coding') as coding then {
                  part -&gt; coding.system = 'http://algoritmodiscoring' &quot;system&quot;;
                  part -&gt; coding.code = 'ClinicalDocument/body/Dimissione/participant' &quot;code&quot;;
                } &quot;coding&quot;;
              } &quot;meta&quot;;
              part.time as tim -&gt; encountert1.location as locat then {
                tim -&gt; locat.period = create('Period') as period then IVLTSPeriod(tim, period) &quot;time&quot;;
                part.time as tim -&gt; locat.period = create('Period') as period then {
                  tim -&gt; period.start = create('dateTime') as start then TSDateTime(tim, start) &quot;val&quot;;
                };
                part.participantRole as partRole then {
                  partRole.id as id -&gt; location.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 {
                      partRole -&gt; request.url = append('Location?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;  location.id = (r + '-' + ext) as uuid,  e1.fullUrl = append('https://example/Location/', uuid),  locat.location = create('Reference') as reference,  reference.reference = ('https://example/Location/' + %location.id) &quot;idasi&quot;;
                    } &quot;r&quot;;
                  } &quot;identifier&quot;;
                  // partRole.id -&gt; location.identifier;
                  partRole.code -&gt; location.type;
                } &quot;partRole&quot;;
              } &quot;location1&quot;;
            } &quot;Location&quot;;
            enc1.entryRelationship as entryrel2 -&gt;  bundle.entry as e1,  e1.request = create('BackboneElement') as request,  request.method = 'POST',  e1.resource = create('Observation') as observation,  observation.id = uuid() as uuid1,  e1.fullUrl = append('https://example/Observation/', uuid1),  request.url = 'Observation',  encountert1.reasonReference = create('BackboneElement') as reference,  reference.reference = ('https://example/Observation/' + %observation.id) then {
              entryrel2.observation as obs then {
                obs -&gt;  observation.subject = create('Reference') as reference,  reference.reference = ('https://example/Patient/' + %patient.id) &quot;reference&quot;;
                obs -&gt;  observation.encounter = create('Reference') as reference,  reference.reference = ('https://example/Encounter/' + %encountert1.id) &quot;reference&quot;;
                obs.code -&gt; observation.code;
                obs.statusCode as statusc where (code = 'completed') -&gt; observation.status = 'final';
                obs.statusCode as statusc where (code = 'active') -&gt; observation.status = 'registered';
                obs.statusCode as statusc where (code = 'aborted') -&gt; observation.status = 'cancelled';
                obs.statusCode as statusc where (code = 'suspended') -&gt; observation.status = 'partial';
                obs -&gt; observation.status = 'final' &quot;notpresent&quot;;
                obs.effectiveTime as effectiveTime -&gt; observation.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; observation.effective = create('Period') as period then IVLTSPeriod(eff, period);
                } &quot;where&quot;;
                obs.value : INT as int -&gt; observation.value = (int.value);
                obs.value : BL as boolean -&gt; observation.value = (boolean.value) &quot;boolean&quot;;
                obs.value : CE as val then {
                  val -&gt; observation.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; observation.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; observation.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;  observation.value = create('string'),  observation.value = (value.dataString);
              } &quot;obs&quot;;
            } &quot;entryrel2&quot;;
          } &quot;enc1&quot;;
        } &quot;enc&quot;;
      } &quot;entriRel&quot;;
      // Trasferimento post dimissione-------------------------------------------------------------------------------------------------------------------------------------
      act.entryRelationship as entriRel2 then {
        entriRel2.act as a then {
          a -&gt;  bundle.entry as e1,  e1.request = create('BackboneElement') as request,  request.method = 'POST',  e1.resource = create('Encounter') as encountert2,  encountert2.id = uuid() as uuid1,  e1.fullUrl = append('https://example/Encounter/', uuid1),  request.url = 'Encounter',  tgt.entry = create('Reference') as reference,  reference.reference = ('https://example/Encounter/' + encountert2.id),  encountert2.partOf = create('Reference') as reference,  reference.reference = ('https://example/Encounter/' + encountert.id) then {
            a -&gt; encountert2.status = 'finished' &quot;status&quot;;
            a -&gt; encountert2.class = create('Coding') as cl then {
              a -&gt; cl.code = 'AMB' &quot;code&quot;;
              a -&gt; cl.display = 'ambulatory' &quot;code&quot;;
            } &quot;class&quot;;
            a -&gt;  encountert2.subject = create('Reference') as reference,  reference.reference = ('https://example/Patient/' + patient.id) &quot;refpatient&quot;;
            a where effectiveTime.low.exists() or effectiveTime.high.exists() then {
              a.effectiveTime as eff -&gt; encountert2.period = create('Period') as period then IVLTSPeriod(eff, period);
            } &quot;where&quot;;
            // effectiveTime = time-stamp
            a where effectiveTime.low.exists().not() or effectiveTime.high.exists().not() then {
              a.effectiveTime as effectivetime1 -&gt; encountert2.period = create('Period') as period then {
                effectivetime1 -&gt; period.start = create('dateTime') as start then TSDateTime(effectivetime1, start) &quot;val&quot;;
              } &quot;efft&quot;;
            } &quot;where&quot;;
            a -&gt;  bundle.entry as e1,  e1.request = create('BackboneElement') as request,  request.method = 'PUT',  e1.resource = create('Location') as location,  location.id = uuid() as uuid1,  e1.fullUrl = append('https://example/Location/', uuid1),  request.url = append('Location/', uuid1) then {
              a.text as tx then {
                tx.reference as ref -&gt; location.description = (ref.value) &quot;dfs&quot;;
              };
              a.participant as part then {
                part -&gt; location.meta as meta then {
                  part -&gt; meta.tag = create('Coding') as coding then {
                    part -&gt; coding.system = 'http://algoritmodiscoring' &quot;system&quot;;
                    part -&gt; coding.code = 'ClinicalDocument/body/Dimissione/act' &quot;code&quot;;
                  } &quot;coding&quot;;
                } &quot;meta&quot;;
                part.time as tim -&gt; encountert2.location as locat then {
                  tim -&gt; locat.period = create('Period') as period then IVLTSPeriod(tim, period) &quot;time&quot;;
                  part.time as tim -&gt; locat.period = create('Period') as period then {
                    tim -&gt; period.start = create('dateTime') as start then TSDateTime(tim, start) &quot;val&quot;;
                  };
                  part.participantRole as partRole then {
                    partRole.id as id -&gt; location.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 {
                        partRole -&gt; request.url = append('Location?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;  location.id = (r + '-' + ext) as uuid,  e1.fullUrl = append('https://example/Location/', uuid),  locat.location = create('Reference') as reference,  reference.reference = ('https://example/Location/' + %location.id) &quot;idasi&quot;;
                      } &quot;r&quot;;
                    } &quot;identifier&quot;;
                    // partRole.id -&gt; location.identifier;
                    partRole.code -&gt; location.type;
                  } &quot;partRole&quot;;
                } &quot;loc2&quot;;
              } &quot;Location&quot;;
            } &quot;loc&quot;;
            a.entryRelationship as entryrel2 -&gt;  bundle.entry as e1,  e1.request = create('BackboneElement') as request,  request.method = 'POST',  e1.resource = create('Observation') as observation,  observation.id = uuid() as uuid1,  e1.fullUrl = append('https://example/Observation/', uuid1),  request.url = 'Observation',  encountert2.reasonReference = create('BackboneElement') as reference,  reference.reference = ('https://example/Observation/' + %observation.id) then {
              entryrel2.observation as obs then {
                obs -&gt;  observation.subject = create('Reference') as reference,  reference.reference = ('https://example/Patient/' + %patient.id) &quot;reference&quot;;
                obs -&gt;  observation.encounter = create('Reference') as reference,  reference.reference = ('https://example/Encounter/' + %encountert2.id) &quot;reference&quot;;
                obs.code -&gt; observation.code;
                obs.statusCode as statusc where (code = 'completed') -&gt; observation.status = 'final';
                obs.statusCode as statusc where (code = 'active') -&gt; observation.status = 'registered';
                obs.statusCode as statusc where (code = 'aborted') -&gt; observation.status = 'cancelled';
                obs.statusCode as statusc where (code = 'suspended') -&gt; observation.status = 'partial';
                obs -&gt; observation.status = 'final' &quot;notpresent&quot;;
                obs.effectiveTime as effectiveTime -&gt; observation.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; observation.effective = create('Period') as period then IVLTSPeriod(eff, period);
                } &quot;where&quot;;
                obs.value : INT as int -&gt; observation.value = (int.value);
                obs.value : BL as boolean -&gt; observation.value = (boolean.value) &quot;boolean&quot;;
                obs.value : CE as val then {
                  val -&gt; observation.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; observation.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; observation.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;  observation.value = create('string'),  observation.value = (value.dataString);
              } &quot;obs&quot;;
            } &quot;entryrel2&quot;;
          } &quot;act&quot;;
        } &quot;a&quot;;
      } &quot;entri-act&quot;;
      // --------------Diagnosi alla dimissione-------------------------------------------------------------
      act.entryRelationship as entryrel2 then {
        entryrel2.observation as obs then {
          obs.code as code where (code = '29308-4') -&gt;  bundle.entry as e1,  e1.request = create('BackboneElement') as request,  request.method = 'POST',  e1.resource = create('Observation') as observation,  observation.id = uuid() as uuid1,  e1.fullUrl = append('https://example/Observation/', uuid1),  request.url = 'Observation',  encountert.reasonReference = create('Reference') as reference,  reference.reference = ('https://example/Observation/' + %observation.id) then {
            obs -&gt;  observation.subject = create('Reference') as reference,  reference.reference = ('https://example/Patient/' + %patient.id) &quot;reference&quot;;
            obs -&gt;  observation.encounter = create('Reference') as reference,  reference.reference = ('https://example/Encounter/' + %encountert.id) &quot;reference&quot;;
            obs.code -&gt; observation.code;
            obs.statusCode as statusc where (code = 'completed') -&gt; observation.status = 'final';
            obs.statusCode as statusc where (code = 'active') -&gt; observation.status = 'registered';
            obs.statusCode as statusc where (code = 'aborted') -&gt; observation.status = 'cancelled';
            obs.statusCode as statusc where (code = 'suspended') -&gt; observation.status = 'partial';
            // obs where obs.statusCode.exists().not() then {
            obs -&gt; observation.status = 'final' &quot;status&quot;;
            // }&quot;statuscode&quot;;
            obs.effectiveTime as effectiveTime -&gt; observation.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; observation.effective = create('Period') as period then IVLTSPeriod(eff, period);
            } &quot;where&quot;;
            obs.value as val then {
              val -&gt; observation.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 : INT as int -&gt; ob.value = (int.value);
            obs.value : BL as boolean -&gt; ob.value = (boolean.value) &quot;boolean&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);
          } &quot;222&quot;;
        } &quot;obs&quot;;
      } &quot;entryrel2&quot;;
      // --------Esito----------------------------
      act.entryRelationship as entriRel3 then {
        entriRel3.observation as obs2 then {
          obs2.code as code then {
            code.code where (code.code = '11302-7') then {
              obs2 -&gt; encountert.hospitalization as hospital then {
                obs2.value -&gt; hospital.dischargeDisposition;
              } &quot;hospital&quot;;
            } &quot;entry-obs1&quot;;
          } &quot;act&quot;;
        } &quot;x&quot;;
      } &quot;3&quot;;
    };
  } &quot;entry1&quot;;
  src.entry as entry1 then {
    entry1.observation as obs then {
      obs -&gt;  bundle.entry as e1,  e1.request = create('BackboneElement') as request,  request.method = 'POST',  e1.resource = create('Observation') as observation,  observation.id = uuid() as uuid1,  e1.fullUrl = append('https://example/Observation/', uuid1),  request.url = 'Observation',  tgt.entry = create('Reference') as reference,  reference.reference = ('https://example/Observation/' + %observation.id) then {
        obs.value as val where ('xsi:type' = 'BL') -&gt; observation.value = (val.value);
        obs then Observation(obs, patient, enc, observation, bundle) &quot;act&quot;;
      } &quot;obstarg&quot;;
    } &quot;obs&quot;;
  };
}

// -----------------------------------------------------------------------------------------------------------------------
// ------------------------------TerapiaFarmacologicaDimissione-----------------------------------------------------------------------------------------
group ClinicalDocumentSectionTerapiaFarmacologicaDimissione(source cda : ClinicalDocument, source src : Section, target patient : Patient, target tgt, target bundle : Bundle, target enc : Encounter) {
  src.title as t -&gt; tgt.title = (t.dataString);
  src.code -&gt; tgt.code;
  // Sezione Narrativa------------------------------------------------------------------------------------------------------------------------------------------------
  src where src.entry.exists().not() then {
    src.text as cdaText -&gt;  bundle.entry as e1,  e1.request = create('BackboneElement') as request,  request.method = 'POST',  e1.resource = create('MedicationRequest') as medRq,  medRq.id = uuid() as uuid1,  e1.fullUrl = append('https://example/MedicationRequest/', uuid1),  request.url = 'MedicationRequest',  tgt.entry = create('Reference') as reference,  reference.reference = ('https://example/MedicationRequest/' + %medRq.id),  medRq.note = create('Annotation') as note then {
      cdaText -&gt; note.text = cdaText &quot;reference&quot;;
      cdaText -&gt;  medRq.subject = create('Reference') as reference,  reference.reference = ('https://example/Patient/' + %patient.id) &quot;reference&quot;;
      cdaText -&gt;  medRq.encounter = create('Reference') as reference,  reference.reference = ('https://example/Encounter/' + %enc.id) &quot;reference&quot;;
      cdaText -&gt; medRq.status = 'active' &quot;status&quot;;
      cdaText -&gt; medRq.intent = 'order' &quot;intent&quot;;
      src.author as auth -&gt;  bundle.entry as e1,  e1.request = create('BackboneElement') as request,  request.method = 'PUT',  e1.resource = create('Practitioner') as practitioner,  practitioner.id = uuid() as uuid1,  e1.fullUrl = append('https://example/Practitioner/', uuid1),  request.url = append('Practitioner/', uuid1) then {
        auth.time as t -&gt; note.time = create('dateTime') as value then TSDateTime(t, value);
        auth.assignedAuthor as assAuth then {
          // assAuth.time -&gt; note.time;
          assAuth -&gt; practitioner.meta as meta then {
            assAuth -&gt; meta.tag = create('Coding') as coding then {
              assAuth -&gt; coding.system = 'http://algoritmodiscoring' &quot;system&quot;;
              assAuth -&gt; coding.code = 'ClinicalDocument/body/TerapiaFarmacologicaDimissione/author' &quot;code&quot;;
            } &quot;coding&quot;;
          } &quot;meta&quot;;
          assAuth.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;
            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,  e1.fullUrl = append('https://example/Practitioner/', uuid2),  request.url = append('Practitioner/', uuid2),  note.author = create('Reference') as reference,  reference.reference = ('https://example/Practitioner/' + %practitioner.id) &quot;aut&quot;;
            } &quot;r&quot;;
          } &quot;identifier&quot;;
          assAuth.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;;
          assAuth.assignedPerson as asspers then {
            asspers.name -&gt; practitioner.name;
          } &quot;assPers&quot;;
        } &quot;assAuth&quot;;
      } &quot;auth&quot;;
      src -&gt; medRq.medication = create('CodeableConcept') as medication then {
        src.text as txt -&gt; medication.text = txt;
      } &quot;medicationesiste&quot;;
    } &quot;note&quot;;
  } &quot;text&quot;;
  // Sezione Strutturata------------------------------------------------------------------------------------------------------------------------------------------
  src where src.entry.exists() then {
    src -&gt;  bundle.entry as e1,  e1.request = create('BackboneElement') as request,  request.method = 'POST',  e1.resource = create('MedicationRequest') as medRq,  medRq.id = uuid() as uuid1,  e1.fullUrl = append('https://example/MedicationRequest/', uuid1),  request.url = 'MedicationRequest',  tgt.entry = create('Reference') as reference,  reference.reference = ('https://example/MedicationRequest/' + %medRq.id),  medRq.note = create('Annotation') as note then {
      src.text as t -&gt; note.text = t &quot;reference&quot;;
      src -&gt;  medRq.subject = create('Reference') as reference,  reference.reference = ('https://example/Patient/' + %patient.id) &quot;reference&quot;;
      src -&gt;  medRq.encounter = create('Reference') as reference,  reference.reference = ('https://example/Encounter/' + %enc.id) &quot;reference&quot;;
      src -&gt; medRq.status = 'active' &quot;status&quot;;
      src -&gt; medRq.intent = 'order' &quot;intent&quot;;
      src.author as auth -&gt;  bundle.entry as e1,  e1.request = create('BackboneElement') as request,  request.method = 'PUT',  e1.resource = create('Practitioner') as practitioner,  practitioner.id = uuid() as uuid1,  e1.fullUrl = append('https://example/Practitioner/', uuid1),  request.url = append('Practitioner/', uuid1) then {
        auth.time as t -&gt; note.time = create('dateTime') as value then TSDateTime(t, value);
        auth.assignedAuthor as assAuth then {
          // assAuth.time -&gt; note.time;
          assAuth -&gt; practitioner.meta as meta then {
            assAuth -&gt; meta.tag = create('Coding') as coding then {
              assAuth -&gt; coding.system = 'http://algoritmodiscoring' &quot;system&quot;;
              assAuth -&gt; coding.code = 'ClinicalDocument/body/TerapiaFarmacologicaDimissione/author' &quot;code&quot;;
            } &quot;coding&quot;;
          } &quot;meta&quot;;
          assAuth.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;
            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,  e1.fullUrl = append('https://example/Practitioner/', uuid2),  request.url = append('Practitioner/', uuid2),  note.author = create('Reference') as reference,  reference.reference = ('https://example/Practitioner/' + %practitioner.id) &quot;aut&quot;;
            } &quot;r&quot;;
          } &quot;identifier&quot;;
          assAuth.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;;
          assAuth.assignedPerson as asspers then {
            asspers.name -&gt; practitioner.name;
          } &quot;assPers&quot;;
        } &quot;assAuth&quot;;
      } &quot;auth&quot;;
      src.entry as entry1 then {
        entry1.substanceAdministration as sub then {
          sub.statusCode -&gt; medRq.status;
          sub -&gt; medRq.dosageInstruction = create('Dosage') as dosage then {
            sub -&gt; dosage.timing = create('Timing') as tim then {
              sub.effectiveTime as eff -&gt; tim.repeat as repeat then {
                eff -&gt; repeat.bounds = create('Period') as period then IVLTSPeriod(eff, period) &quot;boundsperiod&quot;;
              } &quot;repeat&quot;;
            } &quot;timing&quot;;
          } &quot;dosage&quot;;
          sub.effectiveTime : PIVL_TS as eff -&gt; medRq.dosageInstruction = create('Dosage') as dosage then {
            eff -&gt; dosage.timing = create('Timing') as timing then periodTiming(eff, timing) &quot;cod&quot;;
          } &quot;eff&quot;;
          sub -&gt; medRq.dosageInstruction = create('Dosage') as dosage then {
            sub.routeCode -&gt; dosage.route;
          } &quot;dosage&quot;;
          sub -&gt; medRq.dosageInstruction = create('Dosage') as dosage then {
            sub.approachSiteCode -&gt; dosage.site;
          } &quot;dosage&quot;;
          sub.doseQuantity as doseQuant then {
            doseQuant -&gt; medRq.dosageInstruction = create('Dosage') as dosageInstruction then {
              doseQuant.originalText as ot then {
                ot.reference -&gt; dosageInstruction.text;
              } &quot;ot&quot;;
              doseQuant -&gt; dosageInstruction.doseAndRate as dosageRate then {
                doseQuant -&gt; dosageRate.dose = create('Range') as d then {
                  doseQuant -&gt; d.low = create('SimpleQuantity') as l then {
                    doseQuant.low as lo -&gt; l.value = (lo.value);
                    doseQuant.low as lo -&gt; l.unit = (lo.unit);
                  } &quot;low&quot;;
                  doseQuant -&gt; d.high = create('SimpleQuantity') as h then {
                    doseQuant.high as hi -&gt; h.value = (hi.value);
                    doseQuant.high as hi -&gt; h.unit = (hi.unit);
                  } &quot;low&quot;;
                } &quot;d&quot;;
              } &quot;dosageRate&quot;;
              sub.rateQuantity as rateQuantity -&gt; medRq.dosageInstruction = create('Dosage') as dosageInstruction1 then {
                rateQuantity.originalText as ot then {
                  ot.reference -&gt; dosageInstruction1.text;
                } &quot;ot&quot;;
                rateQuantity -&gt; dosageInstruction1.doseAndRate as dosageRate then {
                  rateQuantity -&gt; dosageRate.rate = create('Range') as d then {
                    rateQuantity -&gt; d.low = create('SimpleQuantity') as l then {
                      rateQuantity.low as lo -&gt; l.value = (lo.value);
                      rateQuantity.low as lo -&gt; l.unit = (lo.unit);
                    } &quot;low&quot;;
                    rateQuantity -&gt; d.high = create('SimpleQuantity') as h then {
                      rateQuantity.high as hi -&gt; h.value = (hi.value);
                      rateQuantity.high as hi -&gt; h.unit = (hi.unit);
                    } &quot;low&quot;;
                  } &quot;d&quot;;
                } &quot;qualcosa&quot;;
              } &quot;dosageRate&quot;;
            } &quot;Dosage&quot;;
          } &quot;doseQuant&quot;;
          sub -&gt;  bundle.entry as e1,  e1.request = create('BackboneElement') as request,  request.method = 'POST',  e1.resource = create('Medication') as medication,  medication.id = uuid() as uuid1,  e1.fullUrl = append('https://example/Medication/', uuid1),  request.url = 'Medication',  medRq.medication = create('Reference') as reference,  reference.reference = ('https://example/Medication/' + %medication.id) then {
            sub.administrationUnitCode -&gt; medication.form;
            sub.consumable as cons then {
              cons.manufacturedProduct as manuprod then {
                manuprod.manufacturedMaterial as manufact then {
                  manufact.code -&gt; medication.code;
                } &quot;manuFact&quot;;
              } &quot;manumat&quot;;
            } &quot;cons&quot;;
            sub.entryRelationship as entryR then {
              entryR.observation as observation then {
                observation.code where displayName = 'Grammatura' -&gt; medication.ingredient as ingredient then {
                  sub.consumable as consumable then {
                    consumable.manufacturedProduct as manufacturedProduct then {
                      manufacturedProduct.manufacturedMaterial as manufacturedMaterial then {
                        manufacturedMaterial.code as code -&gt; ingredient.item = create('CodeableConcept') as value then CECodeableConcept(code, value) &quot;CE&quot;;
                      } &quot;material&quot;;
                    } &quot;product&quot;;
                  };
                  observation.value as value -&gt; ingredient.strength as strength then {
                    value -&gt; strength.numerator as numerator then {
                      value -&gt; numerator.value = (value.value) &quot;valueN&quot;;
                    } &quot;numerator&quot;;
                    value -&gt; strength.denominator as denominator then {
                      value -&gt; denominator.value = 1 &quot;valueD&quot;;
                    } &quot;denominator&quot;;
                  } &quot;strenght&quot;;
                } &quot;ingredient&quot;;
                observation.code where displayName = 'Quantità nella Confezione' then {
                  observation.value as value -&gt; medication.amount as amount then {
                    value -&gt; amount.numerator as numerator then {
                      value -&gt; numerator.value = (value.value) &quot;valueN&quot;;
                    } &quot;numerator&quot;;
                    value -&gt; amount.denominator as denominator then {
                      value -&gt; denominator.value = 1 &quot;valueD&quot;;
                    } &quot;denominator&quot;;
                  } &quot;amount&quot;;
                } &quot;quantita&quot;;
              } &quot;obs&quot;;
            } &quot;entryR&quot;;
            sub.participant as part -&gt;  bundle.entry as e1,  e1.request = create('BackboneElement') as request,  request.method = 'PUT',  e1.resource = create('Practitioner') as participant,  participant.id = uuid() as uuid1,  e1.fullUrl = append('https://example/Participant/', uuid1),  request.url = append('Participant/', uuid1) then {
              part.time as t -&gt; medRq.authoredOn = create('dateTime') as date then TSDateTime(t, date) &quot;authoredOn&quot;;
              part.participantRole as partRole then {
                partRole -&gt; participant.meta as meta then {
                  partRole -&gt; meta.tag = create('Coding') as coding then {
                    partRole -&gt; coding.system = 'http://algoritmodiscoring' &quot;system&quot;;
                    partRole -&gt; coding.code = 'ClinicalDocument/body/TerapiaFarmacologicaDimissione/participant' &quot;code&quot;;
                  } &quot;coding&quot;;
                } &quot;meta&quot;;
                partRole.id as id -&gt; participant.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;
                  id.assigningAuthorityName as s -&gt;  identifier.assigner as a,  a.display = s;
                  id.root as r then {
                    id.extension as ext -&gt;  participant.id = (r + '-' + ext) as uuid2,  e1.fullUrl = append('https://example/Practitioner/', uuid2),  request.url = append('Practitioner/', uuid2),  medRq.requester = create('Reference') as reference,  reference.reference = ('https://example/Practitioner/' + %participant.id) &quot;aut&quot;;
                  } &quot;r&quot;;
                } &quot;identifier&quot;;
                partRole.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;;
                partRole.playingEntity as playent then {
                  playent.name -&gt; participant.name;
                } &quot;playent&quot;;
              } &quot;partRole&quot;;
            };
            sub.reference as ref then {
              ref.externalAct as external then {
                external.id -&gt; medRq.identifier;
              } &quot;external&quot;;
            } &quot;ref&quot;;
            sub.entryRelationship as entryRelationship then {
              entryRelationship.supply as sup -&gt; medRq.dispenseRequest as dispreq then {
                sup -&gt; dispreq.quantity = create('SimpleQuantity') as quantity then {
                  sup.quantity as q -&gt; quantity.value = (q.value);
                } &quot;quantity&quot;;
              } &quot;sub&quot;;
            } &quot;med&quot;;
          } &quot;admnistrationUnicode&quot;;
        } &quot;sub&quot;;
      };
    } &quot;medication&quot;;
  } &quot;sezioneesiste&quot;;
}

// -----------------------------------------------------------------------------------------------------------------------
// ______1._____________Sections________________________
group ModalitadiTrasposto(source cda : ClinicalDocument, source src : Section, target patient : Patient, target tgt, target bundle : Bundle, target enc : Encounter) {
  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 then {
    src.entry as entry1 -&gt;  tgt.entry = create('Reference') as reference,  reference.reference = ('https://example/Encounter/' + %enc.id) then {
      entry1.act as act1 then Act(act1, patient, enc, bundle);
    } &quot;entry1&quot;;
  };
}

group MotivoDellaVisita(source cda : ClinicalDocument, source src : Section, target patient : Patient, target tgt, target bundle : Bundle, target enc : Encounter) {
  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 entry -&gt;  bundle.entry as e2,  e2.request = create('BackboneElement') as request,  request.method = 'POST',  e2.resource = create('Observation') as observation,  observation.id = uuid() as uuid2,  e2.fullUrl = append('https://example/Observation/', uuid2),  request.url = 'Observation',  tgt.entry = create('Reference') as reference,  reference.reference = ('https://example/Observation/' + %observation.id) then {
    entry.observation as obs then Observation(obs, patient, enc, observation, bundle);
  };
}

group Triage(source cda : ClinicalDocument, source src : Section, target patient : Patient, target tgt, target bundle : Bundle, target enc : Encounter) {
  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 entry -&gt;  bundle.entry as e2,  e2.request = create('BackboneElement') as request,  request.method = 'POST',  e2.resource = create('Observation') as observation,  observation.id = uuid() as uuid2,  e2.fullUrl = append('https://example/Observation/', uuid2),  request.url = 'Observation',  tgt.entry = create('Reference') as reference,  reference.reference = ('https://example/Observation/' + %observation.id) then {
    entry.observation as obs then Observation(obs, patient, enc, observation, bundle);
  };
}

group InquadramentoClinicoIniziale(source cda : ClinicalDocument, source src : Section, target patient : Patient, target tgt, target bundle : Bundle, target enc : Encounter) {
  src.title as t -&gt; tgt.title = (t.dataString);
  src.code -&gt; tgt.code;
  src.text as cdaText -&gt;  bundle.entry as e1,  e1.request = create('BackboneElement') as request,  request.method = 'POST',  e1.resource = create('Observation') as observation,  observation.id = uuid() as uuid1,  e1.fullUrl = append('https://example/Observation/', uuid1),  request.url = 'Observation',  tgt.entry = create('Reference') as reference,  reference.reference = ('https://example/Observation/' + %observation.id),  tgt.text as fhirText then {
    src.code -&gt; observation.code;
    src where observation.statusCode.exists().not() then {
      src -&gt; observation.status = 'final' &quot;status&quot;;
    } &quot;statuscode&quot;;
    src -&gt;  observation.subject = create('Reference') as reference,  reference.reference = ('https://example/Patient/' + %patient.id) &quot;reference&quot;;
    src -&gt;  observation.encounter = create('Reference') as reference,  reference.reference = ('https://example/Encounter/' + %enc.id) &quot;reference&quot;;
    cdaText -&gt; observation.note as note then {
      src.author as author then {
        author -&gt;  bundle.entry as e2,  e2.request = create('BackboneElement') as request,  request.method = 'PUT',  e2.resource = create('Practitioner') as practitioner then {
          author.assignedAuthor as assignedAuthor then {
            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/InquadramentoClinicoIniziale/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;
              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),  request.url = append('Practitioner/', uuid2),  note.author = 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.assignedPerson as person then {
              person.name -&gt; practitioner.name;
            } &quot;name&quot;;
          };
        } &quot;practitioner&quot;;
        author.time as t -&gt; note.time = create('dateTime') as value then TSDateTime(t, value);
      } &quot;Author&quot;;
      cdaText as t -&gt; note.text = t &quot;reference&quot;;
    } &quot;reference&quot;;
  } &quot;cdaText&quot;;
  // START sottosections
  src.component as component then {
    component.section as sottosection then {
      sottosection -&gt; tgt.section as section then {
        // 1. Anamnesi Narrativa-------------------------------------------------------------------------------------------------------------------------------------------
        sottosection.code where (code = '11329-0') -&gt; section.code;
        sottosection.code as code1 where (code = '11329-0') then {
          src where sottosection.entry.exists().not() then {
            sottosection.title as t -&gt; section.title = (t.dataString);
            sottosection.text as cdaText -&gt;  bundle.entry as e8,  e8.request = create('BackboneElement') as request,  request.method = 'POST',  e8.resource = create('Observation') as observation,  observation.id = uuid() as uuid8,  e8.fullUrl = append('https://example/Observation/', uuid8),  request.url = 'Observation',  section.entry = create('Reference') as reference,  reference.reference = ('https://example/Observation/' + %observation.id) then {
              cdaText -&gt;  observation.subject = create('Reference') as reference,  reference.reference = ('https://example/Patient/' + %patient.id) &quot;reference&quot;;
              cdaText -&gt;  observation.encounter = create('Reference') as reference,  reference.reference = ('https://example/Encounter/' + %enc.id) &quot;reference&quot;;
              sottosection.code -&gt; observation.code;
              src where observation.statusCode.exists().not() then {
                src -&gt; observation.status = 'final' &quot;status&quot;;
              } &quot;statuscode&quot;;
              cdaText -&gt; observation.note as note then {
                cdaText as t -&gt; note.text = t &quot;reference&quot;;
                sottosection.author as authors then {
                  authors.time as time -&gt; note.time = create('dateTime') as value then TSDateTime(time, value) &quot;timeAuthor&quot;;
                  authors.assignedAuthor as assignedAuthor -&gt;  bundle.entry as e9,  e9.request = create('BackboneElement') as request,  request.method = 'PUT',  e9.resource = create('Practitioner') as practitioner then {
                    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/EsameObiettivo/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;
                      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 uuid9,  e9.fullUrl = append('https://example/Practitioner/', uuid9),  request.url = append('Practitioner/', uuid9),  note.author = create('Reference') as reference,  reference.reference = ('https://example/Practitioner/' + %practitioner.id) &quot;autore&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.assignedPerson as person then {
                      person.name -&gt; practitioner.name;
                    };
                  } &quot;assighedAuthor&quot;;
                };
              } &quot;reference&quot;;
            } &quot;cdaText&quot;;
          } &quot;where&quot;;
          // Anamnesi Strutturata-----------------------------------------------------------------------------------------------------------------------------------------
          sottosection.entry as entry1 then {
            entry1.observation as obs then {
              obs.code where (code = '75326-9') then {
                obs -&gt;  bundle.entry as e1,  e1.request = create('BackboneElement') as request,  request.method = 'POST',  e1.resource = create('Condition') as condition,  condition.id = uuid() as uuid1,  e1.fullUrl = append('https://example/Condition/', uuid1),  request.url = 'Condition',  section.entry = create('Reference') as reference,  reference.reference = ('https://example/Condition/' + %condition.id) then {
                  obs.code -&gt; condition.category;
                  obs -&gt;  condition.subject = create('Reference') as reference,  reference.reference = ('https://example/Patient/' + %patient.id) &quot;reference&quot;;
                  obs -&gt;  condition.encounter = create('Reference') as reference,  reference.reference = ('https://example/Encounter/' + %enc.id) &quot;reference&quot;;
                  obs.statusCode as status where (code = 'completed') -&gt; condition.verificationStatus as status2 then {
                    status -&gt; status2.coding as status3 then {
                      status -&gt; status3.code = 'confirmed' &quot;finald&quot;;
                      status -&gt; status3.system = 'http://terminology.hl7.org/CodeSystem/condition-ver-status' &quot;system&quot;;
                    } &quot;st3&quot;;
                  } &quot;status&quot;;
                  // blocco Narrativo
                  sottosection.text as cdaText1 -&gt; condition.note as note then {
                    cdaText1 as t -&gt; note.text = t &quot;reference&quot;;
                    sottosection.author as authors then {
                      authors.time as time -&gt; note.time = create('dateTime') as value then TSDateTime(time, value) &quot;timeAuthor&quot;;
                      authors.assignedAuthor as assignedAuthor -&gt;  bundle.entry as e5,  e5.request = create('BackboneElement') as request,  request.method = 'PUT',  e5.resource = create('Practitioner') as practitioner then {
                        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/Anamnesi/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;
                          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 uuid5,  e5.fullUrl = append('https://example/Practitioner/', uuid5),  request.url = append('Practitioner/', uuid5),  note.author = create('Reference') as reference,  reference.reference = ('https://example/Practitioner/' + %practitioner.id);
                          } &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.assignedPerson as person then {
                          person.name -&gt; practitioner.name;
                        };
                      } &quot;assighedAuthor&quot;;
                    };
                  } &quot;cdaText1&quot;;
                  obs.effectiveTime as effective1 then {
                    effective1 where effective1.low.exists() or effective1.high.exists() then {
                      effective1 -&gt; condition.onset = create('Period') as periodonset then IVLTSPeriod(effective1, periodonset) &quot;onsetperiod&quot;;
                    } &quot;ef&quot;;
                  } &quot;effectivetime1&quot;;
                  obs.effectiveTime as effectiveTime -&gt; condition.onset = create('dateTime') as value then TSDateTime(effectiveTime, value) &quot;onsetDateTime&quot;;
                  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 : ST as value -&gt;  ob.value = create('string'),  ob.value = (value.dataString);
                  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; condition.code = create('CodeableConcept') as ce then {
                      val.originalText -&gt; ce.text;
                      val -&gt; ce.coding as coding then {
                        val.code as code -&gt; coding.code = cast(code, 'string');
                        val.codeSystem as system -&gt; coding.system = translate(system, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri');
                        val.displayName as display -&gt; coding.display = cast(display, 'string');
                      } &quot;coding&quot;;
                    } &quot;Ce&quot;;
                  } &quot;Value&quot;;
                  obs.entryRelationship as entriRel then {
                    entriRel -&gt; condition.evidence = create('BackboneElement') as evidence then {
                      entriRel.observation as observation2 then {
                        observation2.code as code then {
                          code.code where (code.code = '89261-2') then {
                            obs -&gt;  bundle.entry as e1,  e1.request = create('BackboneElement') as request,  request.method = 'POST',  e1.resource = create('Observation') as observation,  observation.id = uuid() as uuid1,  e1.fullUrl = append('https://example/Observation/', uuid1),  request.url = 'Observation' then {
                              entriRel -&gt;  evidence.detail = create('Reference') as reference,  reference.reference = ('https://example/Observation/' + %observation.id) &quot;ref&quot;;
                              observation2.code -&gt; observation.code;
                              observation2 where observation.statusCode.exists().not() then {
                                observation2 -&gt; observation.status = 'final' &quot;status&quot;;
                              } &quot;statuscode&quot;;
                              observation2.text as text -&gt; observation.note = create('Annotation') as note then {
                                text.reference as ref -&gt; note.text = (ref.value) &quot;val&quot;;
                              } &quot;Annontation&quot;;
                              obs -&gt;  observation.subject = create('Reference') as reference,  reference.reference = ('https://example/Patient/' + %patient.id) &quot;reference&quot;;
                              obs -&gt;  observation.encounter = create('Reference') as reference,  reference.reference = ('https://example/Encounter/' + %enc.id) &quot;reference&quot;;
                              observation2.statusCode as statusc where (code = 'completed') -&gt; ob.status = 'final';
                              observation2.statusCode as statusc where (code = 'active') -&gt; ob.status = 'registered';
                              observation2.statusCode as statusc where (code = 'aborted') -&gt; ob.status = 'cancelled';
                              observation2.statusCode as statusc where (code = 'suspended') -&gt; ob.status = 'partial';
                              observation2.value : INT as int -&gt; observation.value = (int.value);
                              observation2.value : BL as boolean -&gt; observation.value = (boolean.value) &quot;boolean&quot;;
                              observation2.value : ST as value -&gt;  observation.value = create('string'),  observation.value = (value.dataString);
                              observation2.effectiveTime as effectiveTime -&gt; observation.effective = create('dateTime') as value then TSDateTime(effectiveTime, value) &quot;value2&quot;;
                              observation2 where effectiveTime.low.exists() or effectiveTime.high.exists() then {
                                observation2.effectiveTime as eff -&gt; observation.effective = create('Period') as period then IVLTSPeriod(eff, period);
                              } &quot;where&quot;;
                              observation2.value : PQ as val then {
                                val -&gt; observation.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;;
                              observation2.value : CE as val then {
                                val -&gt; observation.value = create('CodeableConcept') as ce then {
                                  val.originalText -&gt; ce.text;
                                  val -&gt; ce.coding as coding then {
                                    val.code as code -&gt; coding.code = cast(code, 'string');
                                    val.codeSystem as system -&gt; coding.system = translate(system, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri');
                                    val.displayName as display -&gt; coding.display = cast(display, 'string');
                                  } &quot;coding&quot;;
                                } &quot;Ce&quot;;
                              } &quot;Value&quot;;
                            } &quot;obser&quot;;
                          } &quot;whereDecorsoClinico&quot;;
                        };
                      } &quot;Observation2&quot;;
                    } &quot;evidence&quot;;
                  } &quot;EntryRelationship1&quot;;
                  obs.entryRelationship as entriRel then {
                    entriRel.observation as observation2 then {
                      observation2.code as code then {
                        code.code where (code.code = '33999-4') then {
                          observation2 -&gt; condition.clinicalStatus = create('CodeableConcept') as status then {
                            observation2.text as text then {
                              text.reference as refstat -&gt; status.text = (refstat.value) &quot;statref&quot;;
                            } &quot;textstat&quot;;
                            observation2 -&gt; status.coding = create('Coding') as coding then {
                              observation2.value as value then {
                                value.code where (value.code = 'LA16666-2') -&gt; coding.code = 'active' &quot;active&quot;;
                                value.code where (value.code = 'LA18632-2') -&gt; coding.code = 'inactive' &quot;inactive&quot;;
                                value.codeSystem as system -&gt; coding.system = 'http://terminology.hl7.org/CodeSystem/condition-clinical' &quot;system&quot;;
                                value.displayName as display -&gt; coding.display = cast(display, 'string');
                              } &quot;value1&quot;;
                            } &quot;coding&quot;;
                          } &quot;code&quot;;
                        } &quot;whereDecorsoClinico&quot;;
                      } &quot;codestatus&quot;;
                    } &quot;observationstatus&quot;;
                  } &quot;entryrelationshipstatus&quot;;
                } &quot;condition&quot;;
              } &quot;89261-2&quot;;
            } &quot;entryobservation1&quot;;
            // Anamnesi Familiare---------------------------------------------------------------------------------------------------------------------------------------------
            entry1.organizer as organizer then {
              organizer.code where (code = '10157-6') then {
                organizer -&gt;  bundle.entry as e4,  e4.request = create('BackboneElement') as request,  request.method = 'POST',  e4.resource = create('FamilyMemberHistory') as FamilyMemberHistory,  FamilyMemberHistory.id = uuid() as uuid5,  e4.fullUrl = append('https://example/FamilyMemberHistory/', uuid5),  request.url = 'FamilyMemberHistory',  section.entry = create('Reference') as reference,  reference.reference = ('https://example/FamilyMemberHistory/' + %FamilyMemberHistory.id) then {
                  organizer.effectiveTime as effective then {
                    effective.value as eff -&gt; FamilyMemberHistory.date = create('dateTime') as value then TSDateTime(eff, value) &quot;date&quot;;
                  } &quot;effective&quot;;
                  organizer -&gt;  FamilyMemberHistory.patient = create('Reference') as reference,  reference.reference = ('https://example/Patient/' + %patient.id) &quot;reference&quot;;
                  organizer.subject as subject then {
                    subject.relatedSubject as relatedSubject then {
                      relatedSubject.code -&gt; FamilyMemberHistory.relationship &quot;relationship&quot;;
                      relatedSubject.subject as subject -&gt; FamilyMemberHistory.sex as sex then {
                        subject.administrativeGenderCode as administrativeGenderCode -&gt; sex.coding as coding then {
                          administrativeGenderCode.code as code -&gt; coding.code = translate(code, '#AdministrativeGender', 'code') &quot;gender&quot;;
                          administrativeGenderCode -&gt; coding.system = 'http://hl7.org/fhir/administrative-gender' &quot;system&quot;;
                        } &quot;coding&quot;;
                      } &quot;subject1&quot;;
                    };
                  };
                  // blocco Narrativo
                  sottosection.text as cdaText1 -&gt; FamilyMemberHistory.note as note then {
                    cdaText1 as t -&gt; note.text = t &quot;reference&quot;;
                    sottosection.author as authors then {
                      authors.time as time -&gt; note.time = create('dateTime') as value then TSDateTime(time, value) &quot;timeAuthor&quot;;
                      authors.assignedAuthor as assignedAuthor -&gt;  bundle.entry as e7,  e7.request = create('BackboneElement') as request,  request.method = 'PUT',  e7.resource = create('Practitioner') as practitioner then {
                        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/Anamnesi/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;
                          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),  request.url = append('Practitioner/', uuid7),  note.author = create('Reference') as reference,  reference.reference = ('https://example/Practitioner/' + %practitioner.id);
                          } &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.assignedPerson as person then {
                          person.name -&gt; practitioner.name;
                        };
                      } &quot;assighedAuthor&quot;;
                    };
                  } &quot;cdaText1&quot;;
                  organizer.component as component -&gt; FamilyMemberHistory.condition as condition then {
                    component.observation as observation then {
                      observation.code -&gt; condition.code;
                      observation.text as text -&gt; FamilyMemberHistory.note as note then {
                        text.reference as reference -&gt; note.text = (reference.value) &quot;value&quot;;
                      } &quot;reference&quot;;
                      observation.statusCode -&gt; FamilyMemberHistory.status;
                      observation.value -&gt; condition.outcome &quot;codeable&quot;;
                      observation.entryRelationship as entryRelationship then {
                        entryRelationship.observation as obsservation1 then {
                          obsservation1.code as code then {
                            code.code where (code.code = '35267-4') then {
                              obsservation1.value as value -&gt; condition.onset = create('Age') as Age then {
                                value.value as valueAge -&gt; Age.value = valueAge &quot;age&quot;;
                                value.unit as unit -&gt; Age.code = unit;
                                value.unit as unit -&gt; Age.unit = unit;
                                value -&gt; Age.system = 'http://unitsofmeasure.org' &quot;system&quot;;
                              };
                            } &quot;insorgenza&quot;;
                          };
                          obsservation1.code as code then {
                            code.code where (code.code = '39016-1') then {
                              obsservation1.value as value -&gt; FamilyMemberHistory.deceased = create('Age') as Age then {
                                value.value as valueAge -&gt; Age.value = valueAge &quot;age&quot;;
                                value.unit as unit -&gt; Age.code = unit;
                                value.unit as unit -&gt; Age.unit = unit;
                                value -&gt; Age.system = 'http://unitsofmeasure.org' &quot;system&quot;;
                              };
                            } &quot;deceased&quot;;
                          };
                        } &quot;obser&quot;;
                      } &quot;EntryRel&quot;;
                      observation where observation.effectiveTime.exists() then {
                        observation.effectiveTime as effectiveTime -&gt; FamilyMemberHistory.condition = create('BackboneElement') as condition then {
                          effectiveTime -&gt; condition.onset = create('Period') as period then {
                            effectiveTime -&gt; period.start = create('dateTime') as start then TSDateTime(effectiveTime, start) &quot;val&quot;;
                          } &quot;efft&quot;;
                          observation.code -&gt; condition.code;
                          observation.value -&gt; condition.outcome &quot;codeable&quot;;
                        } &quot;effttemp&quot;;
                      } &quot;cont&quot;;
                    } &quot;observationCondition&quot;;
                  };
                } &quot;organizer&quot;;
              } &quot;10157-6&quot;;
            } &quot;observation1&quot;;
          } &quot;subsection1&quot;;
        } &quot;11329-0&quot;;
        // 2. Esame Obiettivo Narrativa-----------------------------------------------------------------------------------------------------------------------------------
        sottosection.code where (code = '29545-1') -&gt; section.code;
        sottosection.code as code1 where (code = '29545-1') then {
          sottosection.title as t -&gt; section.title = (t.dataString);
          sottosection.text as cdaText -&gt;  bundle.entry as e8,  e8.request = create('BackboneElement') as request,  request.method = 'POST',  e8.resource = create('Observation') as observation,  observation.id = uuid() as uuid8,  e8.fullUrl = append('https://example/Observation/', uuid8),  request.url = 'Observation',  section.entry = create('Reference') as reference,  reference.reference = ('https://example/Observation/' + %observation.id) then {
            cdaText -&gt;  observation.subject = create('Reference') as reference,  reference.reference = ('https://example/Patient/' + %patient.id) &quot;reference&quot;;
            cdaText -&gt;  observation.encounter = create('Reference') as reference,  reference.reference = ('https://example/Encounter/' + %enc.id) &quot;reference&quot;;
            sottosection.code -&gt; observation.code;
            sottosection where observation.statusCode.exists().not() then {
              sottosection -&gt; observation.status = 'final' &quot;status&quot;;
            } &quot;statuscode&quot;;
            cdaText -&gt; observation.note as note then {
              cdaText as t -&gt; note.text = t &quot;reference&quot;;
              sottosection.author as authors then {
                authors.time as time -&gt; note.time = create('dateTime') as value then TSDateTime(time, value) &quot;timeAuthor&quot;;
                authors.assignedAuthor as assignedAuthor -&gt;  bundle.entry as e9,  e9.request = create('BackboneElement') as request,  request.method = 'PUT',  e9.resource = create('Practitioner') as practitioner then {
                  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/EsameObiettivo/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;
                    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 uuid9,  e9.fullUrl = append('https://example/Practitioner/', uuid9),  request.url = append('Practitioner/', uuid9),  note.author = create('Reference') as reference,  reference.reference = ('https://example/Practitioner/' + %practitioner.id) &quot;autore&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.assignedPerson as person then {
                    person.name -&gt; practitioner.name;
                  };
                } &quot;assighedAuthor&quot;;
              };
            } &quot;reference&quot;;
          } &quot;cdaText&quot;;
        } &quot;condizioneesameObiettivo&quot;;
        // 3. Terapia Farmacologica all'ingresso Narrativa --------------------------------------------------------------------------------------------------------------
        sottosection.code where (code = '42346-7') -&gt; section.code;
        sottosection.code as code1 where (code = '42346-7') then {
          sottosection.title as t -&gt; section.title = (t.dataString);
          sottosection.text as cdaText -&gt;  bundle.entry as e10,  e10.request = create('BackboneElement') as request,  request.method = 'POST',  e10.resource = create('MedicationStatement') as medicStatement,  medicStatement.id = uuid() as uuid10,  e10.fullUrl = append('https://example/MedicationStatement/', uuid10),  request.url = 'MedicationStatement',  section.entry = create('Reference') as reference,  reference.reference = ('https://example/MedicationStatement/' + %medicStatement.id) then {
            cdaText -&gt;  medicStatement.subject = create('Reference') as reference,  reference.reference = ('https://example/Patient/' + %patient.id) &quot;reference&quot;;
            sottosection where medicStatement.statusCode.exists().not() then {
              sottosection -&gt; medicStatement.status = 'completed' &quot;status&quot;;
            } &quot;statuscode&quot;;
            cdaText -&gt; medicStatement.medication = create('CodeableConcept') as medication then {
              cdaText as txt -&gt; medication.text = txt &quot;text&quot;;
            } &quot;medication&quot;;
            cdaText -&gt; medicStatement.note as note then {
              cdaText as t -&gt; note.text = t &quot;reference&quot;;
              sottosection.author as authors then {
                authors.time as time -&gt; note.time = create('dateTime') as value then TSDateTime(time, value) &quot;timeAuthor&quot;;
                authors.assignedAuthor as assignedAuthor -&gt;  bundle.entry as e11,  e11.request = create('BackboneElement') as request,  request.method = 'PUT',  e11.resource = create('Practitioner') as practitioner then {
                  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/TerapiaFarmacologicaIngresso/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;
                    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 uuid11,  e11.fullUrl = append('https://example/Practitioner/', uuid11),  request.url = append('Practitioner/', uuid11),  note.author = create('Reference') as reference,  reference.reference = ('https://example/Practitioner/' + %practitioner.id);
                    } &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.assignedPerson as person then {
                    person.name -&gt; practitioner.name;
                  };
                } &quot;assighedAuthor&quot;;
              };
            } &quot;reference&quot;;
          } &quot;cdaText&quot;;
        } &quot;condizioneterapiaingresso&quot;;
        // 4. Allergie
        sottosection.code where (code = '48765-2') -&gt; section.code;
        sottosection.code as code1 where (code = '48765-2') then {
          sottosection.title as t -&gt; section.title = (t.dataString);
          // Allergia Narrativa-------------------------------------------------------------------------------------------------------------------------------------------
          src where sottosection.entry.exists().not() then {
            sottosection.title as t -&gt; section.title = (t.dataString);
            sottosection.text as cdaText -&gt;  bundle.entry as e8,  e8.request = create('BackboneElement') as request,  request.method = 'POST',  e8.resource = create('AllergyIntolerance') as AllergyIntolerance,  AllergyIntolerance.id = uuid() as uuid8,  e8.fullUrl = append('https://example/AllergyIntolerance/', uuid8),  request.url = 'AllergyIntolerance',  section.entry = create('Reference') as reference,  reference.reference = ('https://example/AllergyIntolerance/' + %AllergyIntolerance.id) then {
              cdaText -&gt;  AllergyIntolerance.patient = create('Reference') as reference,  reference.reference = ('https://example/Patient/' + %patient.id) &quot;reference&quot;;
              cdaText -&gt;  AllergyIntolerance.encounter = create('Reference') as reference,  reference.reference = ('https://example/Encounter/' + %enc.id) &quot;reference&quot;;
              cdaText -&gt; AllergyIntolerance.clinicalStatus = create('CodeableConcept') as status then {
                cdaText -&gt; status.coding = create('Coding') as coding then {
                  cdaText -&gt; coding.code = 'active' &quot;active&quot;;
                  cdaText -&gt; coding.system = 'http://terminology.hl7.org/CodeSystem/allergyintolerance-clinical' &quot;system&quot;;
                  cdaText -&gt; coding.display = 'active' &quot;active&quot;;
                } &quot;coding&quot;;
              } &quot;clinicalStatus&quot;;
              cdaText -&gt; AllergyIntolerance.note as note then {
                cdaText as t -&gt; note.text = t &quot;reference&quot;;
                sottosection.author as authors then {
                  authors.time as time -&gt; note.time = create('dateTime') as value then TSDateTime(time, value) &quot;timeAuthor&quot;;
                  authors.assignedAuthor as assignedAuthor -&gt;  bundle.entry as e9,  e9.request = create('BackboneElement') as request,  request.method = 'PUT',  e9.resource = create('Practitioner') as practitioner then {
                    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/EsameObiettivo/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;
                      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 uuid9,  e9.fullUrl = append('https://example/Practitioner/', uuid9),  request.url = append('Practitioner/', uuid9),  note.author = create('Reference') as reference,  reference.reference = ('https://example/Practitioner/' + %practitioner.id) &quot;autore&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.assignedPerson as person then {
                      person.name -&gt; practitioner.name;
                    };
                  } &quot;assighedAuthor&quot;;
                };
              } &quot;reference&quot;;
            } &quot;cdaText&quot;;
          } &quot;where&quot;;
          // Allergia Strutturata----------------------------------------------------------------------------------------------------------------------------------------
          sottosection.entry as entry1 -&gt;  bundle.entry as e12,  e12.request = create('BackboneElement') as request,  request.method = 'POST',  e12.resource = create('AllergyIntolerance') as allergy,  allergy.id = uuid() as uuid12,  e12.fullUrl = append('https://example/AllergyIntolerance/', uuid12),  request.url = 'AllergyIntolerance',  section.entry = create('Reference') as reference,  reference.reference = ('https://example/AllergyIntolerance/' + %allergy.id) then {
            src -&gt;  allergy.patient = create('Reference') as reference,  reference.reference = ('https://example/Patient/' + %patient.id) &quot;reference&quot;;
            src -&gt;  allergy.encounter = create('Reference') as reference,  reference.reference = ('https://example/Encounter/' + %enc.id) &quot;reference&quot;;
            entry1.act as actallint then {
              actallint.effectiveTime as effectiveTime -&gt; allergy.onset = create('dateTime') as value then TSDateTime(effectiveTime, value) &quot;onsetDateTime&quot;;
              actallint where effectiveTime.low.exists() or effectiveTime.high.exists() then {
                actallint.effectiveTime as eff -&gt; allergy.onset = create('Period') as period then IVLTSPeriod(eff, period) &quot;onsetPeriod&quot;;
              } &quot;where&quot;;
              // mapping note
              sottosection.text as cdaText1 -&gt; allergy.note as note then {
                cdaText1 as t -&gt; note.text = t &quot;reference&quot;;
                sottosection.author as authors then {
                  authors.time as time -&gt; note.time = create('dateTime') as value then TSDateTime(time, value) &quot;timeAuthor&quot;;
                  authors.assignedAuthor as assignedAuthor -&gt;  bundle.entry as e13,  e13.request = create('BackboneElement') as request,  request.method = 'PUT',  e13.resource = create('Practitioner') as practitioner then {
                    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/Allergie/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;
                      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 uuid13,  e13.fullUrl = append('https://example/Practitioner/', uuid13),  request.url = append('Practitioner/', uuid13),  note.author = create('Reference') as reference,  reference.reference = ('https://example/Practitioner/' + %practitioner.id);
                      } &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.assignedPerson as person then {
                      person.name -&gt; practitioner.name;
                    };
                  } &quot;assighedAuthor&quot;;
                };
              } &quot;cdaText1&quot;;
              actallint.entryRelationship as entryact then {
                entryact.observation as entryobs then {
                  entryobs.value as code then {
                    code.code as code1 -&gt; allergy.type = translate(code1, '#AllergyTypeMap', 'code') &quot;type&quot;;
                    code.code as code2 -&gt; allergy.category = translate(code2, '#AllergyCategoryMap', 'code') &quot;category&quot;;
                  } &quot;code&quot;;
                  entryobs.participant as partic then {
                    partic.participantRole as pratRole then {
                      pratRole.playingEntity as pratent then {
                        pratent -&gt; allergy.reaction = create('BackboneElement') as reaction then {
                          pratent.code -&gt; reaction.substance &quot;subs&quot;;
                          entryobs.entryRelationship as entryobs1 where (typeCode = 'MFST') then {
                            entryobs1.observation as entobs then {
                              entobs.effectiveTime as eff then {
                                eff.low as l -&gt; reaction.onset = create('dateTime') as value then TSDateTime(l, value);
                              } &quot;eff&quot;;
                              entobs.value -&gt; reaction.manifestation &quot;manifest&quot;;
                            } &quot;entryobservation&quot;;
                          };
                        } &quot;reaction&quot;;
                      };
                    };
                  };
                  entryobs.entryRelationship as entryobs2 then {
                    entryobs2.observation as entobs then {
                      entobs.code as code where (code = 'SEV') then {
                        entobs.value as value then {
                          value.code where (value.code = 'M') -&gt; allergy.criticality = 'unable-to-assess' &quot;active&quot;;
                          value.code where (value.code = 'L') -&gt; allergy.criticality = 'low' &quot;active&quot;;
                          value.code where (value.code = 'H') -&gt; allergy.criticality = 'high' &quot;active&quot;;
                        };
                      } &quot;severity&quot;;
                    } &quot;entryobservation2&quot;;
                  } &quot;entryrelationship2&quot;;
                  entryobs.entryRelationship as entryobs3 then {
                    entryobs3.observation as entobs then {
                      entobs.code as code where (code = '33999-4') then {
                        // entobs.value-&gt;allergy.clinicalStatus &quot;cstatus&quot;;
                        entobs -&gt; allergy.clinicalStatus = create('CodeableConcept') as status then {
                          entobs -&gt; status.coding = create('Coding') as coding then {
                            entobs.value as value then {
                              value.code where (value.code = 'LA16666-2') -&gt; coding.code = 'active' &quot;active&quot;;
                              value.code where (value.code = 'LA18632-2') -&gt; coding.code = 'inactive' &quot;active&quot;;
                              value.codeSystem as system -&gt; coding.system = 'http://terminology.hl7.org/CodeSystem/allergyintolerance-clinical' &quot;system&quot;;
                              // value-&gt;coding.version='ConditionClinicalStatusCodes 4.0.1'&quot;version&quot;;
                              value.displayName as display -&gt; coding.display = cast(display, 'string');
                            } &quot;value1&quot;;
                          } &quot;coding&quot;;
                        } &quot;clinicalStatus&quot;;
                      } &quot;33999-4&quot;;
                    } &quot;entryobservation3&quot;;
                  } &quot;entryrelationship3&quot;;
                  entryobs.entryRelationship as entryobs4 then {
                    entryobs4.act as entact then {
                      entact.text as actext then {
                        actext.reference as reftxt -&gt; allergy.note = create('BackboneElement') as note then {
                          reftxt as ref -&gt; note.text = (ref.value) &quot;notxt&quot;;
                        } &quot;notetxt&quot;;
                      } &quot;txtact&quot;;
                    } &quot;entryact1&quot;;
                  } &quot;entryrelationshi4&quot;;
                } &quot;entryobservation&quot;;
              } &quot;entryrelationshipact&quot;;
            } &quot;entryact2&quot;;
          } &quot;allergy&quot;;
        } &quot;condizioneallergie&quot;;
        // 5. Problemi aperti
        sottosection.code where (code = '11450-4') -&gt; section.code;
        sottosection.code as code1 where (code = '11450-4') then {
          sottosection.title as t -&gt; section.title = (t.dataString);
          sottosection.text as cdaText -&gt;  bundle.entry as e14,  e14.request = create('BackboneElement') as request,  request.method = 'POST',  e14.resource = create('Condition') as condition,  condition.id = uuid() as uuid14,  e14.fullUrl = append('https://example/Condition/', uuid14),  request.url = 'Condition',  section.entry = create('Reference') as reference,  reference.reference = ('https://example/Condition/' + %condition.id) then {
            cdaText -&gt;  condition.subject = create('Reference') as reference,  reference.reference = ('https://example/Patient/' + %patient.id) &quot;reference&quot;;
            cdaText -&gt;  condition.encounter = create('Reference') as reference,  reference.reference = ('https://example/Encounter/' + %enc.id) &quot;reference&quot;;
            sottosection.code -&gt; condition.code;
            cdaText -&gt; condition.note as note then {
              cdaText as t -&gt; note.text = t &quot;reference&quot;;
              sottosection.author as authors then {
                authors.time as time -&gt; note.time = create('dateTime') as value then TSDateTime(time, value) &quot;timeAuthor&quot;;
                authors.assignedAuthor as assignedAuthor -&gt;  bundle.entry as e15,  e15.request = create('BackboneElement') as request,  request.method = 'PUT',  e15.resource = create('Practitioner') as practitioner then {
                  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/ProblemiAperti/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;
                    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 uuid15,  e15.fullUrl = append('https://example/Practitioner/', uuid15),  request.url = append('Practitioner/', uuid15),  note.author = 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.assignedPerson as person then {
                    person.name -&gt; practitioner.name;
                  };
                } &quot;assighedAuthor&quot;;
              };
            } &quot;reference&quot;;
          } &quot;cdaText&quot;;
        } &quot;condizioneproblemiaperti&quot;;
      } &quot;Sectionfhir&quot;;
    } &quot;Sottosection&quot;;
  };
}

// ______2._____________ClinicalStatements________________________
group Act(source cda : Act, target pat : Patient, target enc : Encounter, target bundle : Bundle) {
  cda.code as code -&gt; enc.extension as extension2 then modeOfArrival(code, extension2);
  cda.participant as participant then {
    participant -&gt; enc.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 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',  enc.participant = create('BackboneElement') as participant1,  participant1.individual = create('Reference') as referencepart,  referencepart.reference = ('https://example/PractitionerRole/' + %practitionerRole.id) then {
      participantRole.code -&gt; practitionerRole.code;
    } &quot;participantrole&quot;;
  };
}

// ______3._____________Extensions_DtType________________________
group modeOfArrival(source src : CE, target ext : Extension) {
  src -&gt; ext.url = 'http://hl7.org/fhir/StructureDefinition/encounter-modeOfArrival' &quot;url&quot;;
  src -&gt; ext.value = create('Coding') as code1 then coding(src, code1) &quot;coding&quot;;
}

group coding(source src : CE, target tgt : Coding) {
  src.code as code -&gt; tgt.code = cast(code, 'string');
  src.codeSystem as system -&gt; tgt.system = translate(system, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri');
  src.displayName as display -&gt; tgt.display = cast(display, 'string');
  src.codeSystemVersion as version -&gt; tgt.version = cast(version, 'string');
}

group periodTiming(source effectiveTime : PIVL_TS, target timing : Timing) {
  effectiveTime -&gt; timing.repeat as r then {
    effectiveTime.period as p -&gt; r.period = (p.value);
    effectiveTime.period as p -&gt; r.periodUnit = (p.unit);
  } &quot;repeat&quot;;
}

</pre>
      </div>
  </text>
  <url value="http://hl7.it/fhir/cda2fhir/StructureMap/cda2fhirEdReport"/>
  <version value="0.1.0"/>
  <name value="cda2fhirEdReport"/>
  <status value="draft"/>
  <date value="2024-04-11T12:48:57+00:00"/>
  <publisher value="HL7 Italy"/>
  <contact>
    <name value="HL7 Italy"/>
    <telecom>
      <system value="url"/>
      <value value="http://hl7.it"/>
    </telecom>
  </contact>
  <jurisdiction>
    <coding>
      <system value="urn:iso:std:iso:3166"/>
      <code value="IT"/>
      <display value="Italy"/>
    </coding>
  </jurisdiction>
  <structure>
    <url
         value="http://hl7.org/fhir/cda/StructureDefinition/ClinicalDocument"/>
    <mode value="source"/>
    <alias value="ClinicalDocument"/>
  </structure>
  <structure>
    <url value="http://hl7.org/fhir/cda/StructureDefinition/AssignedAuthor"/>
    <mode value="queried"/>
    <alias value="AssignedAuthor"/>
  </structure>
  <structure>
    <url value="http://hl7.org/fhir/cda/StructureDefinition/AssignedEntity"/>
    <mode value="queried"/>
    <alias value="AssignedEntity"/>
  </structure>
  <structure>
    <url
         value="http://hl7.org/fhir/cda/StructureDefinition/AssociatedEntity"/>
    <mode value="queried"/>
    <alias value="AssociatedEntity"/>
  </structure>
  <structure>
    <url
         value="http://hl7.org/fhir/cda/StructureDefinition/CustodianOrganization"/>
    <mode value="queried"/>
    <alias value="CustodianOrganization"/>
  </structure>
  <structure>
    <url
         value="http://hl7.org/fhir/cda/StructureDefinition/OrganizationPartOf"/>
    <mode value="queried"/>
    <alias value="OrganizationPartOf"/>
  </structure>
  <structure>
    <url value="http://hl7.org/fhir/cda/StructureDefinition/Organization"/>
    <mode value="queried"/>
    <alias value="rapresentedOrganization"/>
  </structure>
  <structure>
    <url value="http://hl7.org/fhir/cda/StructureDefinition/Section"/>
    <mode value="queried"/>
    <alias value="Section"/>
  </structure>
  <structure>
    <url value="http://hl7.org/fhir/cda/StructureDefinition/PatientRole"/>
    <mode value="queried"/>
    <alias value="PatientRole"/>
  </structure>
  <structure>
    <url value="http://hl7.org/fhir/cda/StructureDefinition/AD"/>
    <mode value="source"/>
    <alias value="AD"/>
  </structure>
  <structure>
    <url value="http://hl7.org/fhir/StructureDefinition/Bundle"/>
    <mode value="target"/>
    <alias value="Bundle"/>
  </structure>
  <structure>
    <url value="http://hl7.org/fhir/StructureDefinition/Composition"/>
    <mode value="produced"/>
    <alias value="Composition"/>
  </structure>
  <structure>
    <url value="http://hl7.org/fhir/StructureDefinition/Patient"/>
    <mode value="produced"/>
    <alias value="Patient"/>
  </structure>
  <structure>
    <url value="http://hl7.org/fhir/StructureDefinition/Encounter"/>
    <mode value="produced"/>
    <alias value="Encounter"/>
  </structure>
  <structure>
    <url value="http://hl7.org/fhir/StructureDefinition/Person"/>
    <mode value="produced"/>
    <alias value="Patient"/>
  </structure>
  <structure>
    <url value="http://hl7.org/fhir/StructureDefinition/Practitioner"/>
    <mode value="produced"/>
    <alias value="Practitioner"/>
  </structure>
  <structure>
    <url value="http://hl7.org/fhir/StructureDefinition/Organization"/>
    <mode value="produced"/>
    <alias value="Organization"/>
  </structure>
  <structure>
    <url value="http://hl7.org/fhir/cda/StructureDefinition/Act"/>
    <mode value="produced"/>
    <alias value="Act"/>
  </structure>
  <structure>
    <url value="http://hl7.org/fhir/cda/StructureDefinition/IVL-PQ"/>
    <mode value="source"/>
    <alias value="IVL_PQ"/>
  </structure>
  <structure>
    <url value="http://hl7.org/fhir/cda/StructureDefinition/IVL-TS"/>
    <mode value="source"/>
  </structure>
  <structure>
    <url value="http://hl7.org/fhir/cda/StructureDefinition/PQ"/>
    <mode value="source"/>
    <alias value="PQ"/>
  </structure>
  <structure>
    <url value="http://hl7.org/fhir/StructureDefinition/SimpleQuantity"/>
    <mode value="target"/>
    <alias value="SimpleQuantity"/>
  </structure>
  <import value="http://hl7.it/fhir/cda2fhir/StructureMap/cda2fhirDataTypes"/>
  <import value="http://hl7.it/fhir/cda2fhir/StructureMap/cda2fhirHeader"/>
  <group>
    <name value="CdaToBundle"/>
    <typeMode value="none"/>
    <documentation
                   value="--------------------------------------------------------------------------------------------"/>
    <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="recPat"/>
        <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="Modalitaditrasporto"/>
              <source>
                <context value="srcSection"/>
                <element value="code"/>
                <condition value="(code = '11459-5')"/>
              </source>
              <target>
                <context value="composition"/>
                <contextType value="variable"/>
                <element value="section"/>
                <variable value="tgtSection"/>
              </target>
              <dependent>
                <name value="ModalitadiTrasposto"/>
                <variable value="cda"/>
                <variable value="srcSection"/>
                <variable value="patient"/>
                <variable value="tgtSection"/>
                <variable value="bundle"/>
                <variable value="encounter"/>
              </dependent>
            </rule>
            <rule>
              <name value="Inquadramentoclinico"/>
              <source>
                <context value="srcSection"/>
                <element value="code"/>
                <condition value="(code = '78337-3')"/>
              </source>
              <target>
                <context value="composition"/>
                <contextType value="variable"/>
                <element value="section"/>
                <variable value="tgtSection"/>
              </target>
              <dependent>
                <name value="InquadramentoClinicoIniziale"/>
                <variable value="cda"/>
                <variable value="srcSection"/>
                <variable value="patient"/>
                <variable value="tgtSection"/>
                <variable value="bundle"/>
                <variable value="encounter"/>
              </dependent>
            </rule>
            <rule>
              <name value="Inquadramentoclinico"/>
              <source>
                <context value="srcSection"/>
                <element value="code"/>
                <condition value="(code = '46239-0')"/>
              </source>
              <target>
                <context value="composition"/>
                <contextType value="variable"/>
                <element value="section"/>
                <variable value="tgtSection"/>
              </target>
              <dependent>
                <name value="MotivoDellaVisita"/>
                <variable value="cda"/>
                <variable value="srcSection"/>
                <variable value="patient"/>
                <variable value="tgtSection"/>
                <variable value="bundle"/>
                <variable value="encounter"/>
              </dependent>
            </rule>
            <rule>
              <name value="Triage"/>
              <source>
                <context value="srcSection"/>
                <element value="code"/>
                <condition value="(code = '54094-8')"/>
              </source>
              <target>
                <context value="composition"/>
                <contextType value="variable"/>
                <element value="section"/>
                <variable value="tgtSection"/>
              </target>
              <dependent>
                <name value="Triage"/>
                <variable value="cda"/>
                <variable value="srcSection"/>
                <variable value="patient"/>
                <variable value="tgtSection"/>
                <variable value="bundle"/>
                <variable value="encounter"/>
              </dependent>
            </rule>
            <rule>
              <name value="motivoricovero"/>
              <source>
                <context value="srcSection"/>
                <element value="code"/>
                <condition value="(code = '46240-8')"/>
              </source>
              <target>
                <context value="composition"/>
                <contextType value="variable"/>
                <element value="section"/>
                <variable value="tgtSection"/>
              </target>
              <dependent>
                <name value="ClinicalDocumentSectionEncounter"/>
                <variable value="cda"/>
                <variable value="srcSection"/>
                <variable value="patient"/>
                <variable value="tgtSection"/>
                <variable value="bundle"/>
                <variable value="encounter"/>
              </dependent>
            </rule>
            <rule>
              <name value="DecorsoOspedaliero"/>
              <source>
                <context value="srcSection"/>
                <element value="code"/>
                <condition value="(code = '8648-8')"/>
              </source>
              <target>
                <context value="composition"/>
                <contextType value="variable"/>
                <element value="section"/>
                <variable value="tgtSection"/>
              </target>
              <dependent>
                <name value="ClinicalDocumentSectionDecorsoOspedaliero"/>
                <variable value="cda"/>
                <variable value="srcSection"/>
                <variable value="patient"/>
                <variable value="tgtSection"/>
                <variable value="bundle"/>
                <variable value="encounter"/>
              </dependent>
            </rule>
            <rule>
              <name value="Complicazioni"/>
              <source>
                <context value="srcSection"/>
                <element value="code"/>
                <condition value="(code = '55109-3')"/>
              </source>
              <target>
                <context value="composition"/>
                <contextType value="variable"/>
                <element value="section"/>
                <variable value="tgtSection"/>
              </target>
              <dependent>
                <name value="ClinicalDocumentSectionComplicanze"/>
                <variable value="cda"/>
                <variable value="srcSection"/>
                <variable value="patient"/>
                <variable value="tgtSection"/>
                <variable value="bundle"/>
                <variable value="encounter"/>
              </dependent>
            </rule>
            <rule>
              <name value="Hospitaldischargestudiessummary"/>
              <source>
                <context value="srcSection"/>
                <element value="code"/>
                <condition value="(code = '62387-6')"/>
              </source>
              <target>
                <context value="composition"/>
                <contextType value="variable"/>
                <element value="section"/>
                <variable value="tgtSection"/>
              </target>
              <dependent>
                <name value="ClinicalDocumentSectionConsulenza"/>
                <variable value="cda"/>
                <variable value="srcSection"/>
                <variable value="patient"/>
                <variable value="tgtSection"/>
                <variable value="bundle"/>
                <variable value="encounter"/>
              </dependent>
            </rule>
            <rule>
              <name value="Accertamenti"/>
              <source>
                <context value="srcSection"/>
                <element value="code"/>
                <condition value="(code = '30954-2')"/>
              </source>
              <target>
                <context value="composition"/>
                <contextType value="variable"/>
                <element value="section"/>
                <variable value="tgtSection"/>
              </target>
              <dependent>
                <name value="ClinicalDocumentSectionAccertamenti"/>
                <variable value="cda"/>
                <variable value="srcSection"/>
                <variable value="patient"/>
                <variable value="tgtSection"/>
                <variable value="bundle"/>
                <variable value="encounter"/>
              </dependent>
            </rule>
            <rule>
              <name value="Accertamenti"/>
              <source>
                <context value="srcSection"/>
                <element value="code"/>
                <condition value="(code = '8716-3')"/>
              </source>
              <target>
                <context value="composition"/>
                <contextType value="variable"/>
                <element value="section"/>
                <variable value="tgtSection"/>
              </target>
              <dependent>
                <name value="ClinicalDocumentSectionParametriVitali"/>
                <variable value="cda"/>
                <variable value="srcSection"/>
                <variable value="patient"/>
                <variable value="tgtSection"/>
                <variable value="bundle"/>
                <variable value="encounter"/>
              </dependent>
            </rule>
            <rule>
              <name value="Accertamenti"/>
              <source>
                <context value="srcSection"/>
                <element value="code"/>
                <condition value="(code = '29549-3')"/>
              </source>
              <target>
                <context value="composition"/>
                <contextType value="variable"/>
                <element value="section"/>
                <variable value="tgtSection"/>
              </target>
              <dependent>
                <name value="ClinicalDocumentSectionTerapiaFarmacoInPronto"/>
                <variable value="cda"/>
                <variable value="srcSection"/>
                <variable value="patient"/>
                <variable value="tgtSection"/>
                <variable value="bundle"/>
                <variable value="encounter"/>
              </dependent>
            </rule>
            <rule>
              <name value="Pianodicuraalladimissione"/>
              <source>
                <context value="srcSection"/>
                <element value="code"/>
                <condition value="(code = '18776-5')"/>
              </source>
              <target>
                <context value="composition"/>
                <contextType value="variable"/>
                <element value="section"/>
                <variable value="tgtSection"/>
              </target>
              <dependent>
                <name value="ClinicalDocumentSectionPianoCuraDimissione"/>
                <variable value="cda"/>
                <variable value="srcSection"/>
                <variable value="patient"/>
                <variable value="tgtSection"/>
                <variable value="bundle"/>
                <variable value="encounter"/>
              </dependent>
            </rule>
            <rule>
              <name value="Dimissione"/>
              <source>
                <context value="srcSection"/>
                <element value="code"/>
                <condition value="(code = '28574-2')"/>
              </source>
              <target>
                <context value="composition"/>
                <contextType value="variable"/>
                <element value="section"/>
                <variable value="tgtSection"/>
              </target>
              <dependent>
                <name value="ClinicalDocumentSectionDimissione"/>
                <variable value="cda"/>
                <variable value="srcSection"/>
                <variable value="patient"/>
                <variable value="tgtSection"/>
                <variable value="bundle"/>
                <variable value="encounter"/>
              </dependent>
            </rule>
            <rule>
              <name value="TerapiaFarmacologicaDimissione"/>
              <source>
                <context value="srcSection"/>
                <element value="code"/>
                <condition value="(code = '75311-1')"/>
              </source>
              <target>
                <context value="composition"/>
                <contextType value="variable"/>
                <element value="section"/>
                <variable value="tgtSection"/>
              </target>
              <dependent>
                <name
                      value="ClinicalDocumentSectionTerapiaFarmacologicaDimissione"/>
                <variable value="cda"/>
                <variable value="srcSection"/>
                <variable value="patient"/>
                <variable value="tgtSection"/>
                <variable value="bundle"/>
                <variable value="encounter"/>
              </dependent>
            </rule>
          </rule>
        </rule>
      </rule>
    </rule>
  </group>
  <group>
    <name value="ClinicalDocumentSectionComplicanze"/>
    <typeMode value="none"/>
    <documentation
                   value="Sezione complicanze--------------------------------------------------------------------------"/>
    <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>
    <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="entryexists"/>
      <source>
        <context value="src"/>
        <condition value="src.entry.exists()"/>
      </source>
      <rule>
        <name value="cdaText"/>
        <source>
          <context value="src"/>
          <element value="text"/>
          <variable value="cdaText"/>
        </source>
        <target>
          <context value="tgt"/>
          <contextType value="variable"/>
          <element value="text"/>
          <variable value="fhirText"/>
        </target>
        <rule>
          <name value="narrativeStatus"/>
          <source>
            <context value="cdaText"/>
          </source>
          <target>
            <context value="fhirText"/>
            <contextType value="variable"/>
            <element value="status"/>
            <transform value="copy"/>
            <parameter>
              <valueString value="generated"/>
            </parameter>
          </target>
        </rule>
        <rule>
          <name value="narrativeText"/>
          <source>
            <context value="cdaText"/>
            <variable value="t"/>
          </source>
          <target>
            <context value="fhirText"/>
            <contextType value="variable"/>
            <element value="div"/>
            <transform value="copy"/>
            <parameter>
              <valueId value="t"/>
            </parameter>
          </target>
        </rule>
      </rule>
    </rule>
    <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="observation"/>
        <transform value="create"/>
        <parameter>
          <valueString value="Observation"/>
        </parameter>
      </target>
      <target>
        <context value="observation"/>
        <contextType value="variable"/>
        <element value="id"/>
        <variable value="uuid1"/>
        <transform value="uuid"/>
      </target>
      <target>
        <context value="e1"/>
        <contextType value="variable"/>
        <element value="fullUrl"/>
        <transform value="append"/>
        <parameter>
          <valueString value="https://example/Observation/"/>
        </parameter>
        <parameter>
          <valueId value="uuid1"/>
        </parameter>
      </target>
      <target>
        <context value="request"/>
        <contextType value="variable"/>
        <element value="url"/>
        <transform value="copy"/>
        <parameter>
          <valueString value="Observation"/>
        </parameter>
      </target>
      <target>
        <context value="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/Observation/' + %observation.id"/>
        </parameter>
      </target>
      <rule>
        <name value="act"/>
        <source>
          <context value="entry1"/>
          <element value="observation"/>
          <variable value="obs"/>
        </source>
        <dependent>
          <name value="Observation"/>
          <variable value="obs"/>
          <variable value="patient"/>
          <variable value="enc"/>
          <variable value="observation"/>
          <variable value="bundle"/>
        </dependent>
      </rule>
      <documentation
                     value="Sezione Strutturata-----------------------------------------------------------------------------------------------------------------------------------------------"/>
    </rule>
    <rule>
      <name value="where"/>
      <source>
        <context value="src"/>
        <condition value="src.entry.exists().not()"/>
      </source>
      <rule>
        <name value="cdaText"/>
        <source>
          <context value="src"/>
          <element value="text"/>
          <variable value="cdaText"/>
        </source>
        <target>
          <context value="bundle"/>
          <contextType value="variable"/>
          <element value="entry"/>
          <variable value="e8"/>
        </target>
        <target>
          <context value="e8"/>
          <contextType value="variable"/>
          <element value="request"/>
          <variable value="request"/>
          <transform value="create"/>
          <parameter>
            <valueString value="BackboneElement"/>
          </parameter>
        </target>
        <target>
          <context value="request"/>
          <contextType value="variable"/>
          <element value="method"/>
          <transform value="copy"/>
          <parameter>
            <valueString value="POST"/>
          </parameter>
        </target>
        <target>
          <context value="e8"/>
          <contextType value="variable"/>
          <element value="resource"/>
          <variable value="Observation"/>
          <transform value="create"/>
          <parameter>
            <valueString value="Observation"/>
          </parameter>
        </target>
        <target>
          <context value="Observation"/>
          <contextType value="variable"/>
          <element value="id"/>
          <variable value="uuid8"/>
          <transform value="uuid"/>
        </target>
        <target>
          <context value="e8"/>
          <contextType value="variable"/>
          <element value="fullUrl"/>
          <transform value="append"/>
          <parameter>
            <valueString value="https://example/Observation/"/>
          </parameter>
          <parameter>
            <valueId value="uuid8"/>
          </parameter>
        </target>
        <target>
          <context value="request"/>
          <contextType value="variable"/>
          <element value="url"/>
          <transform value="copy"/>
          <parameter>
            <valueString value="Observation"/>
          </parameter>
        </target>
        <target>
          <context value="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/Observation/' + %Observation.id"/>
          </parameter>
        </target>
        <rule>
          <name value="reference"/>
          <source>
            <context value="src"/>
          </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="src"/>
          </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/' + %enc.id"/>
            </parameter>
          </target>
        </rule>
        <rule>
          <name value="code"/>
          <source>
            <context value="src"/>
            <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="statuscode"/>
          <source>
            <context value="src"/>
            <condition value="observation.statusCode.exists().not()"/>
          </source>
          <rule>
            <name value="status"/>
            <source>
              <context value="src"/>
            </source>
            <target>
              <context value="Observation"/>
              <contextType value="variable"/>
              <element value="status"/>
              <transform value="copy"/>
              <parameter>
                <valueString value="final"/>
              </parameter>
            </target>
          </rule>
        </rule>
        <rule>
          <name value="reference"/>
          <source>
            <context value="cdaText"/>
          </source>
          <target>
            <context value="Observation"/>
            <contextType value="variable"/>
            <element value="note"/>
            <variable value="note"/>
          </target>
          <rule>
            <name value="reference"/>
            <source>
              <context value="cdaText"/>
              <variable value="t"/>
            </source>
            <target>
              <context value="note"/>
              <contextType value="variable"/>
              <element value="text"/>
              <transform value="copy"/>
              <parameter>
                <valueId value="t"/>
              </parameter>
            </target>
          </rule>
        </rule>
      </rule>
      <documentation
                     value="Sezione Narrativa---------------------------------------------------------------------------------------------------------------------------------------------"/>
    </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="statuscode"/>
      <source>
        <context value="obs"/>
        <condition value="obs.statusCode.exists().not()"/>
      </source>
      <rule>
        <name value="status"/>
        <source>
          <context value="obs"/>
        </source>
        <target>
          <context value="ob"/>
          <contextType value="variable"/>
          <element value="status"/>
          <transform value="copy"/>
          <parameter>
            <valueString value="final"/>
          </parameter>
        </target>
      </rule>
    </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="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="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="originalText"/>
          <source>
            <context value="val"/>
            <element value="originalText"/>
            <variable value="vvv"/>
          </source>
          <target>
            <context value="ce"/>
            <contextType value="variable"/>
            <element value="text"/>
            <variable value="vvv"/>
            <transform value="create"/>
          </target>
        </rule>
        <rule>
          <name value="code"/>
          <source>
            <context value="val"/>
          </source>
          <target>
            <context value="ce"/>
            <contextType value="variable"/>
            <element value="coding"/>
            <variable value="coding"/>
          </target>
          <rule>
            <name value="code"/>
            <source>
              <context value="val"/>
              <element value="code"/>
              <variable value="code"/>
            </source>
            <target>
              <context value="coding"/>
              <contextType value="variable"/>
              <element value="code"/>
              <transform value="cast"/>
              <parameter>
                <valueId value="code"/>
              </parameter>
              <parameter>
                <valueString value="string"/>
              </parameter>
            </target>
          </rule>
          <rule>
            <name value="codeSystem"/>
            <source>
              <context value="val"/>
              <element value="codeSystem"/>
              <variable value="system"/>
            </source>
            <target>
              <context value="coding"/>
              <contextType value="variable"/>
              <element value="system"/>
              <transform value="translate"/>
              <parameter>
                <valueId value="system"/>
              </parameter>
              <parameter>
                <valueString
                             value="http://hl7.org/fhir/ConceptMap/special-oid2uri"/>
              </parameter>
              <parameter>
                <valueString value="uri"/>
              </parameter>
            </target>
          </rule>
          <rule>
            <name value="displayName"/>
            <source>
              <context value="val"/>
              <element value="displayName"/>
              <variable value="display"/>
            </source>
            <target>
              <context value="coding"/>
              <contextType value="variable"/>
              <element value="display"/>
              <transform value="cast"/>
              <parameter>
                <valueId value="display"/>
              </parameter>
              <parameter>
                <valueString value="string"/>
              </parameter>
            </target>
          </rule>
        </rule>
        <rule>
          <name value="translation"/>
          <source>
            <context value="val"/>
            <element value="translation"/>
            <variable value="translation"/>
          </source>
          <target>
            <context value="ce"/>
            <contextType value="variable"/>
            <element value="coding"/>
            <variable value="coding"/>
          </target>
          <rule>
            <name value="code"/>
            <source>
              <context value="translation"/>
              <element value="code"/>
              <variable value="code"/>
            </source>
            <target>
              <context value="coding"/>
              <contextType value="variable"/>
              <element value="code"/>
              <transform value="cast"/>
              <parameter>
                <valueId value="code"/>
              </parameter>
              <parameter>
                <valueString value="string"/>
              </parameter>
            </target>
          </rule>
          <rule>
            <name value="codeSystem"/>
            <source>
              <context value="translation"/>
              <element value="codeSystem"/>
              <variable value="system"/>
            </source>
            <target>
              <context value="coding"/>
              <contextType value="variable"/>
              <element value="system"/>
              <transform value="translate"/>
              <parameter>
                <valueId value="system"/>
              </parameter>
              <parameter>
                <valueString
                             value="http://hl7.org/fhir/ConceptMap/special-oid2uri"/>
              </parameter>
              <parameter>
                <valueString value="uri"/>
              </parameter>
            </target>
          </rule>
          <rule>
            <name value="displayName"/>
            <source>
              <context value="translation"/>
              <element value="displayName"/>
              <variable value="display"/>
            </source>
            <target>
              <context value="coding"/>
              <contextType value="variable"/>
              <element value="display"/>
              <transform value="cast"/>
              <parameter>
                <valueId value="display"/>
              </parameter>
              <parameter>
                <valueString value="string"/>
              </parameter>
            </target>
          </rule>
          <rule>
            <name value="translation1"/>
            <source>
              <context value="translation"/>
              <element value="qualifier"/>
              <variable value="qualifier"/>
            </source>
            <rule>
              <name value="value"/>
              <source>
                <context value="qualifier"/>
                <element value="value"/>
                <variable value="value"/>
              </source>
              <target>
                <context value="ce"/>
                <contextType value="variable"/>
                <element value="coding"/>
                <variable value="coding"/>
              </target>
              <rule>
                <name value="code"/>
                <source>
                  <context value="value"/>
                  <element value="code"/>
                  <variable value="code"/>
                </source>
                <target>
                  <context value="coding"/>
                  <contextType value="variable"/>
                  <element value="code"/>
                  <transform value="cast"/>
                  <parameter>
                    <valueId value="code"/>
                  </parameter>
                  <parameter>
                    <valueString value="string"/>
                  </parameter>
                </target>
              </rule>
              <rule>
                <name value="codeSystem"/>
                <source>
                  <context value="value"/>
                  <element value="codeSystem"/>
                  <variable value="system"/>
                </source>
                <target>
                  <context value="coding"/>
                  <contextType value="variable"/>
                  <element value="system"/>
                  <transform value="translate"/>
                  <parameter>
                    <valueId value="system"/>
                  </parameter>
                  <parameter>
                    <valueString
                                 value="http://hl7.org/fhir/ConceptMap/special-oid2uri"/>
                  </parameter>
                  <parameter>
                    <valueString value="uri"/>
                  </parameter>
                </target>
              </rule>
              <rule>
                <name value="displayName"/>
                <source>
                  <context value="value"/>
                  <element value="displayName"/>
                  <variable value="display"/>
                </source>
                <target>
                  <context value="coding"/>
                  <contextType value="variable"/>
                  <element value="display"/>
                  <transform value="cast"/>
                  <parameter>
                    <valueId value="display"/>
                  </parameter>
                  <parameter>
                    <valueString value="string"/>
                  </parameter>
                </target>
              </rule>
            </rule>
          </rule>
        </rule>
      </rule>
    </rule>
    <rule>
      <name value="val"/>
      <source>
        <context value="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="originalText"/>
          <source>
            <context value="val"/>
            <element value="originalText"/>
            <variable value="vvv"/>
          </source>
          <target>
            <context value="ce"/>
            <contextType value="variable"/>
            <element value="text"/>
            <variable value="vvv"/>
            <transform value="create"/>
          </target>
        </rule>
        <rule>
          <name value="code"/>
          <source>
            <context value="val"/>
          </source>
          <target>
            <context value="ce"/>
            <contextType value="variable"/>
            <element value="coding"/>
            <variable value="coding"/>
          </target>
          <rule>
            <name value="code"/>
            <source>
              <context value="val"/>
              <element value="code"/>
              <variable value="code"/>
            </source>
            <target>
              <context value="coding"/>
              <contextType value="variable"/>
              <element value="code"/>
              <transform value="cast"/>
              <parameter>
                <valueId value="code"/>
              </parameter>
              <parameter>
                <valueString value="string"/>
              </parameter>
            </target>
          </rule>
          <rule>
            <name value="codeSystem"/>
            <source>
              <context value="val"/>
              <element value="codeSystem"/>
              <variable value="system"/>
            </source>
            <target>
              <context value="coding"/>
              <contextType value="variable"/>
              <element value="system"/>
              <transform value="translate"/>
              <parameter>
                <valueId value="system"/>
              </parameter>
              <parameter>
                <valueString
                             value="http://hl7.org/fhir/ConceptMap/special-oid2uri"/>
              </parameter>
              <parameter>
                <valueString value="uri"/>
              </parameter>
            </target>
          </rule>
          <rule>
            <name value="displayName"/>
            <source>
              <context value="val"/>
              <element value="displayName"/>
              <variable value="display"/>
            </source>
            <target>
              <context value="coding"/>
              <contextType value="variable"/>
              <element value="display"/>
              <transform value="cast"/>
              <parameter>
                <valueId value="display"/>
              </parameter>
              <parameter>
                <valueString value="string"/>
              </parameter>
            </target>
          </rule>
        </rule>
        <rule>
          <name value="translation"/>
          <source>
            <context value="val"/>
            <element value="translation"/>
            <variable value="translation"/>
          </source>
          <target>
            <context value="ce"/>
            <contextType value="variable"/>
            <element value="coding"/>
            <variable value="coding"/>
          </target>
          <rule>
            <name value="code"/>
            <source>
              <context value="translation"/>
              <element value="code"/>
              <variable value="code"/>
            </source>
            <target>
              <context value="coding"/>
              <contextType value="variable"/>
              <element value="code"/>
              <transform value="cast"/>
              <parameter>
                <valueId value="code"/>
              </parameter>
              <parameter>
                <valueString value="string"/>
              </parameter>
            </target>
          </rule>
          <rule>
            <name value="codeSystem"/>
            <source>
              <context value="translation"/>
              <element value="codeSystem"/>
              <variable value="system"/>
            </source>
            <target>
              <context value="coding"/>
              <contextType value="variable"/>
              <element value="system"/>
              <transform value="translate"/>
              <parameter>
                <valueId value="system"/>
              </parameter>
              <parameter>
                <valueString
                             value="http://hl7.org/fhir/ConceptMap/special-oid2uri"/>
              </parameter>
              <parameter>
                <valueString value="uri"/>
              </parameter>
            </target>
          </rule>
          <rule>
            <name value="displayName"/>
            <source>
              <context value="translation"/>
              <element value="displayName"/>
              <variable value="display"/>
            </source>
            <target>
              <context value="coding"/>
              <contextType value="variable"/>
              <element value="display"/>
              <transform value="cast"/>
              <parameter>
                <valueId value="display"/>
              </parameter>
              <parameter>
                <valueString value="string"/>
              </parameter>
            </target>
          </rule>
          <rule>
            <name value="translation1"/>
            <source>
              <context value="translation"/>
              <element value="qualifier"/>
              <variable value="qualifier"/>
            </source>
            <rule>
              <name value="value"/>
              <source>
                <context value="qualifier"/>
                <element value="value"/>
                <variable value="value"/>
              </source>
              <target>
                <context value="ce"/>
                <contextType value="variable"/>
                <element value="coding"/>
                <variable value="coding"/>
              </target>
              <rule>
                <name value="code"/>
                <source>
                  <context value="value"/>
                  <element value="code"/>
                  <variable value="code"/>
                </source>
                <target>
                  <context value="coding"/>
                  <contextType value="variable"/>
                  <element value="code"/>
                  <transform value="cast"/>
                  <parameter>
                    <valueId value="code"/>
                  </parameter>
                  <parameter>
                    <valueString value="string"/>
                  </parameter>
                </target>
              </rule>
              <rule>
                <name value="codeSystem"/>
                <source>
                  <context value="value"/>
                  <element value="codeSystem"/>
                  <variable value="system"/>
                </source>
                <target>
                  <context value="coding"/>
                  <contextType value="variable"/>
                  <element value="system"/>
                  <transform value="translate"/>
                  <parameter>
                    <valueId value="system"/>
                  </parameter>
                  <parameter>
                    <valueString
                                 value="http://hl7.org/fhir/ConceptMap/special-oid2uri"/>
                  </parameter>
                  <parameter>
                    <valueString value="uri"/>
                  </parameter>
                </target>
              </rule>
              <rule>
                <name value="displayName"/>
                <source>
                  <context value="value"/>
                  <element value="displayName"/>
                  <variable value="display"/>
                </source>
                <target>
                  <context value="coding"/>
                  <contextType value="variable"/>
                  <element value="display"/>
                  <transform value="cast"/>
                  <parameter>
                    <valueId value="display"/>
                  </parameter>
                  <parameter>
                    <valueString value="string"/>
                  </parameter>
                </target>
              </rule>
            </rule>
          </rule>
        </rule>
      </rule>
    </rule>
    <rule>
      <name value="valueQuantity"/>
      <source>
        <context value="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="BL"/>
        <element value="value"/>
        <variable value="value"/>
      </source>
      <target>
        <context value="ob"/>
        <contextType value="variable"/>
        <element value="value"/>
        <transform value="create"/>
        <parameter>
          <valueString value="boolean"/>
        </parameter>
      </target>
      <target>
        <context value="ob"/>
        <contextType value="variable"/>
        <element value="value"/>
        <transform value="evaluate"/>
        <parameter>
          <valueString value="value.value"/>
        </parameter>
      </target>
    </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="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="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="PUT"/>
        </parameter>
      </target>
      <target>
        <context value="e1"/>
        <contextType value="variable"/>
        <element value="resource"/>
        <variable value="practitioner"/>
        <transform value="create"/>
        <parameter>
          <valueString value="Practitioner"/>
        </parameter>
      </target>
      <rule>
        <name value="assignedEntity"/>
        <source>
          <context value="performer"/>
          <element value="assignedEntity"/>
          <variable value="entity"/>
        </source>
        <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="uuid1"/>
                <transform value="evaluate"/>
                <parameter>
                  <valueString value="r + '-' + ext"/>
                </parameter>
              </target>
              <target>
                <context value="e1"/>
                <contextType value="variable"/>
                <element value="fullUrl"/>
                <transform value="append"/>
                <parameter>
                  <valueString value="https://example/Practitioner/"/>
                </parameter>
                <parameter>
                  <valueId value="uuid1"/>
                </parameter>
              </target>
              <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/Practitioner/' + %practitioner.id"/>
                </parameter>
              </target>
            </rule>
          </rule>
        </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>
    </rule>
    <rule>
      <name value="refRange"/>
      <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="obsRange"/>
        <source>
          <context value="refRange"/>
          <element value="observationRange"/>
          <variable value="obsRange"/>
        </source>
        <target>
          <context value="ref"/>
          <contextType value="variable"/>
          <element value="low"/>
          <variable value="Low"/>
          <transform value="create"/>
          <parameter>
            <valueString value="SimpleQuantity"/>
          </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>
      </rule>
    </rule>
  </group>
  <group>
    <name value="ClinicalDocumentSectionDecorsoOspedaliero"/>
    <typeMode value="none"/>
    <documentation
                   value="------------------------------------------------------------------------------------------------------
Sezione Decorso Ospedaliero----------------------------------------------------------------------------"/>
    <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>
    <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="OB-note"/>
      <source>
        <context value="src"/>
      </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="observation"/>
        <transform value="create"/>
        <parameter>
          <valueString value="Observation"/>
        </parameter>
      </target>
      <target>
        <context value="observation"/>
        <contextType value="variable"/>
        <element value="id"/>
        <variable value="uuid1"/>
        <transform value="uuid"/>
      </target>
      <target>
        <context value="e1"/>
        <contextType value="variable"/>
        <element value="fullUrl"/>
        <transform value="append"/>
        <parameter>
          <valueString value="https://example/Observation/"/>
        </parameter>
        <parameter>
          <valueId value="uuid1"/>
        </parameter>
      </target>
      <target>
        <context value="request"/>
        <contextType value="variable"/>
        <element value="url"/>
        <transform value="copy"/>
        <parameter>
          <valueString value="Observation"/>
        </parameter>
      </target>
      <target>
        <context value="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/Observation/' + %observation.id"/>
        </parameter>
      </target>
      <target>
        <context value="observation"/>
        <contextType value="variable"/>
        <element value="note"/>
        <variable value="note"/>
      </target>
      <rule>
        <name value="code"/>
        <source>
          <context value="src"/>
          <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="statuscode"/>
        <source>
          <context value="src"/>
          <condition value="observation.statusCode.exists().not()"/>
        </source>
        <rule>
          <name value="status"/>
          <source>
            <context value="src"/>
          </source>
          <target>
            <context value="observation"/>
            <contextType value="variable"/>
            <element value="status"/>
            <transform value="copy"/>
            <parameter>
              <valueString value="final"/>
            </parameter>
          </target>
        </rule>
      </rule>
      <rule>
        <name value="reference"/>
        <source>
          <context value="src"/>
        </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="src"/>
        </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/' + %enc.id"/>
          </parameter>
        </target>
      </rule>
      <rule>
        <name value="reference"/>
        <source>
          <context value="src"/>
          <element value="text"/>
          <variable value="t"/>
        </source>
        <target>
          <context value="note"/>
          <contextType value="variable"/>
          <element value="text"/>
          <transform value="copy"/>
          <parameter>
            <valueId value="t"/>
          </parameter>
        </target>
      </rule>
      <rule>
        <name value="Auth"/>
        <source>
          <context value="src"/>
          <element value="author"/>
          <variable value="auth"/>
        </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="PUT"/>
          </parameter>
        </target>
        <target>
          <context value="e1"/>
          <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="uuid1"/>
          <transform value="uuid"/>
        </target>
        <target>
          <context value="e1"/>
          <contextType value="variable"/>
          <element value="fullUrl"/>
          <transform value="append"/>
          <parameter>
            <valueString value="https://example/Practitioner/"/>
          </parameter>
          <parameter>
            <valueId value="uuid1"/>
          </parameter>
        </target>
        <target>
          <context value="request"/>
          <contextType value="variable"/>
          <element value="url"/>
          <transform value="append"/>
          <parameter>
            <valueString value="Practitioner/"/>
          </parameter>
          <parameter>
            <valueId value="uuid1"/>
          </parameter>
        </target>
        <rule>
          <name value="time"/>
          <source>
            <context value="auth"/>
            <element value="time"/>
            <variable value="ti"/>
          </source>
          <target>
            <context value="note"/>
            <contextType value="variable"/>
            <element value="time"/>
            <variable value="value"/>
            <transform value="create"/>
            <parameter>
              <valueString value="dateTime"/>
            </parameter>
          </target>
          <dependent>
            <name value="TSDateTime"/>
            <variable value="ti"/>
            <variable value="value"/>
          </dependent>
        </rule>
        <rule>
          <name value="assAuth"/>
          <source>
            <context value="auth"/>
            <element value="assignedAuthor"/>
            <variable value="assAuth"/>
          </source>
          <rule>
            <name value="meta"/>
            <source>
              <context value="assAuth"/>
            </source>
            <target>
              <context value="practitioner"/>
              <contextType value="variable"/>
              <element value="meta"/>
              <variable value="meta"/>
            </target>
            <rule>
              <name value="coding"/>
              <source>
                <context value="assAuth"/>
              </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="assAuth"/>
                </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="assAuth"/>
                </source>
                <target>
                  <context value="coding"/>
                  <contextType value="variable"/>
                  <element value="code"/>
                  <transform value="copy"/>
                  <parameter>
                    <valueString
                                 value="ClinicalDocument/body/DecorsoOspedaliero/author"/>
                  </parameter>
                </target>
              </rule>
            </rule>
            <documentation value="meta+identifier"/>
          </rule>
          <rule>
            <name value="identifier"/>
            <source>
              <context value="assAuth"/>
              <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="extension"/>
              <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>
            <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="e1"/>
                  <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="request"/>
                  <contextType value="variable"/>
                  <element value="url"/>
                  <transform value="append"/>
                  <parameter>
                    <valueString value="Practitioner/"/>
                  </parameter>
                  <parameter>
                    <valueId value="uuid2"/>
                  </parameter>
                </target>
                <target>
                  <context value="note"/>
                  <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/Practitioner/' + %practitioner.id"/>
                  </parameter>
                </target>
              </rule>
            </rule>
          </rule>
          <rule>
            <name value="2.16.840.1.113883.2.9.4.3.2"/>
            <source>
              <context value="assAuth"/>
              <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="assPers"/>
            <source>
              <context value="assAuth"/>
              <element value="assignedPerson"/>
              <variable value="assPers"/>
            </source>
            <rule>
              <name value="name"/>
              <source>
                <context value="assPers"/>
                <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>
  </group>
  <group>
    <name value="ClinicalDocumentSectionEncounter"/>
    <typeMode value="none"/>
    <documentation
                   value="--------------------------------------------------------------------------------------------------------
Sezione Encounter---------------------------------------------------------------------------------------"/>
    <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="enc1"/>
      <type value="Encounter"/>
      <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="encounter"/>
        <transform value="create"/>
        <parameter>
          <valueString value="Encounter"/>
        </parameter>
      </target>
      <target>
        <context value="encounter"/>
        <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/Encounter/"/>
        </parameter>
        <parameter>
          <valueId value="uuid1"/>
        </parameter>
      </target>
      <target>
        <context value="request"/>
        <contextType value="variable"/>
        <element value="url"/>
        <transform value="copy"/>
        <parameter>
          <valueString value="Encounter"/>
        </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/Encounter/' + %encounter.id"/>
        </parameter>
      </target>
      <rule>
        <name value="refer"/>
        <source>
          <context value="entry1"/>
        </source>
        <target>
          <context value="encounter"/>
          <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/Encounter/' + %enc1.id"/>
          </parameter>
        </target>
      </rule>
      <rule>
        <name value="refer"/>
        <source>
          <context value="entry1"/>
        </source>
        <target>
          <context value="encounter"/>
          <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="status"/>
        <source>
          <context value="entry1"/>
        </source>
        <target>
          <context value="encounter"/>
          <contextType value="variable"/>
          <element value="status"/>
          <transform value="copy"/>
          <parameter>
            <valueString value="finished"/>
          </parameter>
        </target>
      </rule>
      <rule>
        <name value="class"/>
        <source>
          <context value="entry1"/>
        </source>
        <target>
          <context value="encounter"/>
          <contextType value="variable"/>
          <element value="class"/>
          <variable value="cl"/>
          <transform value="create"/>
          <parameter>
            <valueString value="Coding"/>
          </parameter>
        </target>
        <rule>
          <name value="code"/>
          <source>
            <context value="entry1"/>
          </source>
          <target>
            <context value="cl"/>
            <contextType value="variable"/>
            <element value="code"/>
            <transform value="copy"/>
            <parameter>
              <valueString value="AMB"/>
            </parameter>
          </target>
        </rule>
        <rule>
          <name value="code"/>
          <source>
            <context value="entry1"/>
          </source>
          <target>
            <context value="cl"/>
            <contextType value="variable"/>
            <element value="display"/>
            <transform value="copy"/>
            <parameter>
              <valueString value="ambulatory"/>
            </parameter>
          </target>
        </rule>
      </rule>
      <rule>
        <name value="encounter"/>
        <source>
          <context value="entry1"/>
          <element value="encounter"/>
          <variable value="enc"/>
        </source>
        <rule>
          <name value="code"/>
          <source>
            <context value="enc"/>
            <element value="code"/>
            <variable value="vvv"/>
          </source>
          <target>
            <context value="encounter"/>
            <contextType value="variable"/>
            <element value="type"/>
            <variable value="vvv"/>
            <transform value="create"/>
          </target>
        </rule>
        <rule>
          <name value="where"/>
          <source>
            <context value="enc"/>
            <condition
                       value="effectiveTime.low.exists() or effectiveTime.high.exists()"/>
          </source>
          <rule>
            <name value="effectiveTime"/>
            <source>
              <context value="enc"/>
              <element value="effectiveTime"/>
              <variable value="eff"/>
            </source>
            <target>
              <context value="encounter"/>
              <contextType value="variable"/>
              <element value="period"/>
              <variable value="period"/>
              <transform value="create"/>
              <parameter>
                <valueString value="Period"/>
              </parameter>
            </target>
            <dependent>
              <name value="IVLTSPeriod"/>
              <variable value="eff"/>
              <variable value="period"/>
            </dependent>
          </rule>
          <documentation value="effectiveTime=period"/>
        </rule>
        <rule>
          <name value="where"/>
          <source>
            <context value="enc"/>
            <condition
                       value="effectiveTime.low.exists().not() or effectiveTime.high.exists().not()"/>
          </source>
          <rule>
            <name value="efft"/>
            <source>
              <context value="enc"/>
              <element value="effectiveTime"/>
              <variable value="effectivetime1"/>
            </source>
            <target>
              <context value="encounter"/>
              <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="effectivetime1"/>
              </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="effectivetime1"/>
                <variable value="start"/>
              </dependent>
            </rule>
          </rule>
          <documentation value="effectiveTime = time-stamp"/>
        </rule>
        <rule>
          <name value="participant-ADM"/>
          <source>
            <context value="enc"/>
            <element value="participant"/>
            <variable value="part"/>
            <condition value="(typeCode != 'LOC')"/>
          </source>
          <target>
            <context value="encounter"/>
            <contextType value="variable"/>
            <element value="participant"/>
            <variable value="patarg"/>
            <transform value="create"/>
            <parameter>
              <valueString value="BackboneElement"/>
            </parameter>
          </target>
          <rule>
            <name value="type"/>
            <source>
              <context value="part"/>
            </source>
            <target>
              <context value="patarg"/>
              <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="time"/>
            <source>
              <context value="part"/>
              <element value="time"/>
              <variable value="time1"/>
            </source>
            <target>
              <context value="patarg"/>
              <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="ti"/>
            </source>
            <target>
              <context value="patarg"/>
              <contextType value="variable"/>
              <element value="period"/>
              <variable value="period"/>
              <transform value="create"/>
              <parameter>
                <valueString value="Period"/>
              </parameter>
            </target>
            <dependent>
              <name value="IVLTSPeriod"/>
              <variable value="ti"/>
              <variable value="period"/>
            </dependent>
          </rule>
          <rule>
            <name value="partRole"/>
            <source>
              <context value="part"/>
              <element value="participantRole"/>
              <variable value="partRole"/>
            </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="PUT"/>
              </parameter>
            </target>
            <target>
              <context value="e1"/>
              <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="uuid1"/>
              <transform value="uuid"/>
            </target>
            <target>
              <context value="e1"/>
              <contextType value="variable"/>
              <element value="fullUrl"/>
              <transform value="append"/>
              <parameter>
                <valueString value="https://example/Practitioner/"/>
              </parameter>
              <parameter>
                <valueId value="uuid1"/>
              </parameter>
            </target>
            <target>
              <context value="request"/>
              <contextType value="variable"/>
              <element value="url"/>
              <transform value="append"/>
              <parameter>
                <valueString value="Practitioner/"/>
              </parameter>
              <parameter>
                <valueId value="uuid1"/>
              </parameter>
            </target>
            <rule>
              <name value="meta"/>
              <source>
                <context value="partRole"/>
              </source>
              <target>
                <context value="practitioner"/>
                <contextType value="variable"/>
                <element value="meta"/>
                <variable value="meta"/>
              </target>
              <rule>
                <name value="coding"/>
                <source>
                  <context value="partRole"/>
                </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="partRole"/>
                  </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="partRole"/>
                  </source>
                  <target>
                    <context value="coding"/>
                    <contextType value="variable"/>
                    <element value="code"/>
                    <transform value="copy"/>
                    <parameter>
                      <valueString
                                   value="ClinicalDocument/body/Encounter/participant"/>
                    </parameter>
                  </target>
                </rule>
              </rule>
              <documentation value="modifica meta+identifier"/>
            </rule>
            <rule>
              <name value="identifier"/>
              <source>
                <context value="partRole"/>
                <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="extension"/>
                <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>
              <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="e1"/>
                    <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="request"/>
                    <contextType value="variable"/>
                    <element value="url"/>
                    <transform value="append"/>
                    <parameter>
                      <valueString value="Practitioner/"/>
                    </parameter>
                    <parameter>
                      <valueId value="uuid2"/>
                    </parameter>
                  </target>
                  <target>
                    <context value="patarg"/>
                    <contextType value="variable"/>
                    <element value="individual"/>
                    <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="partRole"/>
                <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="playEnt"/>
              <source>
                <context value="partRole"/>
                <element value="playingEntity"/>
                <variable value="playEnt"/>
              </source>
              <rule>
                <name value="name"/>
                <source>
                  <context value="playEnt"/>
                  <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>
          <documentation
                         value="enc.effectiveTime as eff -&gt; encounter.period = create('Period') as period then{"/>
        </rule>
        <rule>
          <name value="participant2"/>
          <source>
            <context value="enc"/>
            <element value="participant"/>
            <variable value="part"/>
            <condition value="(typeCode = 'LOC')"/>
          </source>
          <rule>
            <name value="location"/>
            <source>
              <context value="part"/>
              <element value="time"/>
              <variable value="tim"/>
            </source>
            <target>
              <context value="encounter"/>
              <contextType value="variable"/>
              <element value="location"/>
              <variable value="locat"/>
            </target>
            <rule>
              <name value="time"/>
              <source>
                <context value="tim"/>
              </source>
              <target>
                <context value="locat"/>
                <contextType value="variable"/>
                <element value="period"/>
                <variable value="period"/>
                <transform value="create"/>
                <parameter>
                  <valueString value="Period"/>
                </parameter>
              </target>
              <dependent>
                <name value="IVLTSPeriod"/>
                <variable value="tim"/>
                <variable value="period"/>
              </dependent>
            </rule>
            <rule>
              <name value="time"/>
              <source>
                <context value="part"/>
                <element value="time"/>
                <variable value="tim"/>
              </source>
              <target>
                <context value="locat"/>
                <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="tim"/>
                </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="tim"/>
                  <variable value="start"/>
                </dependent>
              </rule>
            </rule>
            <rule>
              <name value="partRole"/>
              <source>
                <context value="part"/>
                <element value="participantRole"/>
                <variable value="partRole"/>
              </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="PUT"/>
                </parameter>
              </target>
              <target>
                <context value="e1"/>
                <contextType value="variable"/>
                <element value="resource"/>
                <variable value="location"/>
                <transform value="create"/>
                <parameter>
                  <valueString value="Location"/>
                </parameter>
              </target>
              <target>
                <context value="location"/>
                <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/Location/"/>
                </parameter>
                <parameter>
                  <valueId value="uuid1"/>
                </parameter>
              </target>
              <rule>
                <name value="meta"/>
                <source>
                  <context value="part"/>
                </source>
                <target>
                  <context value="location"/>
                  <contextType value="variable"/>
                  <element value="meta"/>
                  <variable value="meta"/>
                </target>
                <rule>
                  <name value="coding"/>
                  <source>
                    <context value="part"/>
                  </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="part"/>
                    </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="part"/>
                    </source>
                    <target>
                      <context value="coding"/>
                      <contextType value="variable"/>
                      <element value="code"/>
                      <transform value="copy"/>
                      <parameter>
                        <valueString
                                     value="ClinicalDocument/body/Encounter/participant"/>
                      </parameter>
                    </target>
                  </rule>
                </rule>
              </rule>
              <rule>
                <name value="identifier"/>
                <source>
                  <context value="partRole"/>
                  <element value="id"/>
                  <variable value="id"/>
                </source>
                <target>
                  <context value="location"/>
                  <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="partRole"/>
                    </source>
                    <target>
                      <context value="request"/>
                      <contextType value="variable"/>
                      <element value="url"/>
                      <transform value="append"/>
                      <parameter>
                        <valueString value="Location?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="idasi"/>
                    <source>
                      <context value="id"/>
                      <element value="extension"/>
                      <variable value="ext"/>
                    </source>
                    <target>
                      <context value="location"/>
                      <contextType value="variable"/>
                      <element value="id"/>
                      <variable value="uuid"/>
                      <transform value="evaluate"/>
                      <parameter>
                        <valueString value="r + '-' + ext"/>
                      </parameter>
                    </target>
                    <target>
                      <context value="e1"/>
                      <contextType value="variable"/>
                      <element value="fullUrl"/>
                      <transform value="append"/>
                      <parameter>
                        <valueString value="https://example/Location/"/>
                      </parameter>
                      <parameter>
                        <valueId value="uuid"/>
                      </parameter>
                    </target>
                    <target>
                      <context value="locat"/>
                      <contextType value="variable"/>
                      <element value="location"/>
                      <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/Location/' + %location.id"/>
                      </parameter>
                    </target>
                  </rule>
                </rule>
              </rule>
              <rule>
                <name value="code"/>
                <source>
                  <context value="partRole"/>
                  <element value="code"/>
                  <variable value="vvv"/>
                </source>
                <target>
                  <context value="location"/>
                  <contextType value="variable"/>
                  <element value="type"/>
                  <variable value="vvv"/>
                  <transform value="create"/>
                </target>
              </rule>
            </rule>
          </rule>
        </rule>
        <rule>
          <name value="entryRel-SUBJ"/>
          <source>
            <context value="enc"/>
            <element value="entryRelationship"/>
            <variable value="entr"/>
          </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="observation"/>
            <transform value="create"/>
            <parameter>
              <valueString value="Observation"/>
            </parameter>
          </target>
          <target>
            <context value="observation"/>
            <contextType value="variable"/>
            <element value="id"/>
            <variable value="uuid1"/>
            <transform value="uuid"/>
          </target>
          <target>
            <context value="e1"/>
            <contextType value="variable"/>
            <element value="fullUrl"/>
            <transform value="append"/>
            <parameter>
              <valueString value="https://example/Observation/"/>
            </parameter>
            <parameter>
              <valueId value="uuid1"/>
            </parameter>
          </target>
          <target>
            <context value="request"/>
            <contextType value="variable"/>
            <element value="url"/>
            <transform value="copy"/>
            <parameter>
              <valueString value="Observation"/>
            </parameter>
          </target>
          <target>
            <context value="encounter"/>
            <contextType value="variable"/>
            <element value="reasonReference"/>
            <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/' + %observation.id"/>
            </parameter>
          </target>
          <rule>
            <name value="act"/>
            <source>
              <context value="entr"/>
              <element value="act"/>
              <variable value="act"/>
            </source>
            <rule>
              <name value="code"/>
              <source>
                <context value="act"/>
                <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="reference"/>
              <source>
                <context value="act"/>
              </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="act"/>
              </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/' + %enc1.id"/>
                </parameter>
              </target>
            </rule>
            <rule>
              <name value="statuscode"/>
              <source>
                <context value="act"/>
                <condition value="act.statusCode.exists().not()"/>
              </source>
              <rule>
                <name value="status"/>
                <source>
                  <context value="act"/>
                </source>
                <target>
                  <context value="observation"/>
                  <contextType value="variable"/>
                  <element value="status"/>
                  <transform value="copy"/>
                  <parameter>
                    <valueString value="final"/>
                  </parameter>
                </target>
              </rule>
            </rule>
            <rule>
              <name value="note"/>
              <source>
                <context value="act"/>
              </source>
              <target>
                <context value="observation"/>
                <contextType value="variable"/>
                <element value="note"/>
                <variable value="note"/>
                <transform value="create"/>
                <parameter>
                  <valueString value="Annotation"/>
                </parameter>
              </target>
              <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="reff"/>
                  </source>
                  <target>
                    <context value="note"/>
                    <contextType value="variable"/>
                    <element value="text"/>
                    <transform value="evaluate"/>
                    <parameter>
                      <valueString value="reff.value"/>
                    </parameter>
                  </target>
                </rule>
              </rule>
              <rule>
                <name value="String"/>
                <source>
                  <context value="act"/>
                  <element value="text"/>
                  <variable value="tx"/>
                </source>
                <rule>
                  <name value="val"/>
                  <source>
                    <context value="tx"/>
                    <element value="reference"/>
                    <variable value="ref"/>
                  </source>
                  <target>
                    <context value="note"/>
                    <contextType value="variable"/>
                    <element value="text"/>
                    <transform value="evaluate"/>
                    <parameter>
                      <valueString value="ref.value"/>
                    </parameter>
                  </target>
                </rule>
              </rule>
              <rule>
                <name value="practitioner"/>
                <source>
                  <context value="act"/>
                  <element value="author"/>
                  <variable value="auth"/>
                </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="PUT"/>
                  </parameter>
                </target>
                <target>
                  <context value="e1"/>
                  <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="uuid1"/>
                  <transform value="uuid"/>
                </target>
                <target>
                  <context value="e1"/>
                  <contextType value="variable"/>
                  <element value="fullUrl"/>
                  <transform value="append"/>
                  <parameter>
                    <valueString value="https://example/Practitioner/"/>
                  </parameter>
                  <parameter>
                    <valueId value="uuid1"/>
                  </parameter>
                </target>
                <target>
                  <context value="request"/>
                  <contextType value="variable"/>
                  <element value="url"/>
                  <transform value="append"/>
                  <parameter>
                    <valueString value="Practitioner/"/>
                  </parameter>
                  <parameter>
                    <valueId value="uuid1"/>
                  </parameter>
                </target>
                <rule>
                  <name value="notetime"/>
                  <source>
                    <context value="auth"/>
                    <element value="time"/>
                    <variable value="ti"/>
                  </source>
                  <target>
                    <context value="note"/>
                    <contextType value="variable"/>
                    <element value="time"/>
                    <variable value="value"/>
                    <transform value="create"/>
                    <parameter>
                      <valueString value="dateTime"/>
                    </parameter>
                  </target>
                  <dependent>
                    <name value="TSDateTime"/>
                    <variable value="ti"/>
                    <variable value="value"/>
                  </dependent>
                </rule>
                <rule>
                  <name value="assAush"/>
                  <source>
                    <context value="auth"/>
                    <element value="assignedAuthor"/>
                    <variable value="assAuth"/>
                  </source>
                  <rule>
                    <name value="meta"/>
                    <source>
                      <context value="assAuth"/>
                    </source>
                    <target>
                      <context value="practitioner"/>
                      <contextType value="variable"/>
                      <element value="meta"/>
                      <variable value="meta"/>
                    </target>
                    <rule>
                      <name value="coding"/>
                      <source>
                        <context value="assAuth"/>
                      </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="assAuth"/>
                        </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="assAuth"/>
                        </source>
                        <target>
                          <context value="coding"/>
                          <contextType value="variable"/>
                          <element value="code"/>
                          <transform value="copy"/>
                          <parameter>
                            <valueString
                                         value="ClinicalDocument/body/Encounter/author"/>
                          </parameter>
                        </target>
                      </rule>
                    </rule>
                  </rule>
                  <rule>
                    <name value="identifier"/>
                    <source>
                      <context value="assAuth"/>
                      <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="extension"/>
                      <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>
                    <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="e1"/>
                          <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="request"/>
                          <contextType value="variable"/>
                          <element value="url"/>
                          <transform value="append"/>
                          <parameter>
                            <valueString value="Practitioner/"/>
                          </parameter>
                          <parameter>
                            <valueId value="uuid2"/>
                          </parameter>
                        </target>
                        <target>
                          <context value="note"/>
                          <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/Practitioner/' + %practitioner.id"/>
                          </parameter>
                        </target>
                      </rule>
                    </rule>
                  </rule>
                  <rule>
                    <name value="2.16.840.1.113883.2.9.4.3.2"/>
                    <source>
                      <context value="assAuth"/>
                      <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="time"/>
                    <source>
                      <context value="assAuth"/>
                      <element value="time"/>
                      <variable value="t"/>
                    </source>
                    <target>
                      <context value="note"/>
                      <contextType value="variable"/>
                      <element value="text"/>
                      <variable value="value"/>
                      <transform value="create"/>
                      <parameter>
                        <valueString value="dateTime"/>
                      </parameter>
                    </target>
                    <dependent>
                      <name value="TSDateTime"/>
                      <variable value="t"/>
                      <variable value="value"/>
                    </dependent>
                    <documentation value="fine modifica"/>
                  </rule>
                  <rule>
                    <name value="name"/>
                    <source>
                      <context value="assAuth"/>
                      <element value="assignedPerson"/>
                      <variable value="assPers"/>
                    </source>
                    <rule>
                      <name value="name"/>
                      <source>
                        <context value="assPers"/>
                        <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>
  </group>
  <group>
    <name value="ClinicalDocumentSectionConsulenza"/>
    <typeMode value="none"/>
    <documentation
                   value="--------------------------------------------------------------------------------------------------------
Sezione Consulenza--------------------------------------------------------------------------------------"/>
    <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>
    <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="entry-exists"/>
      <source>
        <context value="src"/>
        <condition value="src.entry.exists()"/>
      </source>
      <rule>
        <name value="cdaText"/>
        <source>
          <context value="src"/>
          <element value="text"/>
          <variable value="cdaText"/>
        </source>
        <target>
          <context value="tgt"/>
          <contextType value="variable"/>
          <element value="text"/>
          <variable value="fhirText"/>
        </target>
        <rule>
          <name value="narrativeStatus"/>
          <source>
            <context value="cdaText"/>
          </source>
          <target>
            <context value="fhirText"/>
            <contextType value="variable"/>
            <element value="status"/>
            <transform value="copy"/>
            <parameter>
              <valueString value="generated"/>
            </parameter>
          </target>
        </rule>
        <rule>
          <name value="narrativeText"/>
          <source>
            <context value="cdaText"/>
            <variable value="t"/>
          </source>
          <target>
            <context value="fhirText"/>
            <contextType value="variable"/>
            <element value="div"/>
            <transform value="copy"/>
            <parameter>
              <valueId value="t"/>
            </parameter>
          </target>
        </rule>
      </rule>
    </rule>
    <rule>
      <name value="where"/>
      <source>
        <context value="src"/>
        <condition value="src.entry.exists().not()"/>
      </source>
      <rule>
        <name value="cdaText"/>
        <source>
          <context value="src"/>
          <element value="text"/>
          <variable value="cdaText"/>
        </source>
        <target>
          <context value="bundle"/>
          <contextType value="variable"/>
          <element value="entry"/>
          <variable value="e8"/>
        </target>
        <target>
          <context value="e8"/>
          <contextType value="variable"/>
          <element value="request"/>
          <variable value="request"/>
          <transform value="create"/>
          <parameter>
            <valueString value="BackboneElement"/>
          </parameter>
        </target>
        <target>
          <context value="request"/>
          <contextType value="variable"/>
          <element value="method"/>
          <transform value="copy"/>
          <parameter>
            <valueString value="POST"/>
          </parameter>
        </target>
        <target>
          <context value="e8"/>
          <contextType value="variable"/>
          <element value="resource"/>
          <variable value="ServiceRequest"/>
          <transform value="create"/>
          <parameter>
            <valueString value="ServiceRequest"/>
          </parameter>
        </target>
        <target>
          <context value="ServiceRequest"/>
          <contextType value="variable"/>
          <element value="id"/>
          <variable value="uuid8"/>
          <transform value="uuid"/>
        </target>
        <target>
          <context value="e8"/>
          <contextType value="variable"/>
          <element value="fullUrl"/>
          <transform value="append"/>
          <parameter>
            <valueString value="https://example/ServiceRequest/"/>
          </parameter>
          <parameter>
            <valueId value="uuid8"/>
          </parameter>
        </target>
        <target>
          <context value="request"/>
          <contextType value="variable"/>
          <element value="url"/>
          <transform value="copy"/>
          <parameter>
            <valueString value="ServiceRequest"/>
          </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/ServiceRequest/' + %ServiceRequest.id"/>
          </parameter>
        </target>
        <rule>
          <name value="reference"/>
          <source>
            <context value="src"/>
          </source>
          <target>
            <context value="ServiceRequest"/>
            <contextType value="variable"/>
            <element value="subject"/>
            <variable value="reference"/>
            <transform value="create"/>
            <parameter>
              <valueString value="Reference"/>
            </parameter>
          </target>
          <target>
            <context value="reference"/>
            <contextType value="variable"/>
            <element value="reference"/>
            <transform value="evaluate"/>
            <parameter>
              <valueString value="'https://example/Patient/' + %patient.id"/>
            </parameter>
          </target>
        </rule>
        <rule>
          <name value="reference"/>
          <source>
            <context value="src"/>
          </source>
          <target>
            <context value="ServiceRequest"/>
            <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="status"/>
          <source>
            <context value="src"/>
          </source>
          <target>
            <context value="ServiceRequest"/>
            <contextType value="variable"/>
            <element value="status"/>
            <transform value="copy"/>
            <parameter>
              <valueString value="active"/>
            </parameter>
          </target>
        </rule>
        <rule>
          <name value="intent"/>
          <source>
            <context value="src"/>
          </source>
          <target>
            <context value="ServiceRequest"/>
            <contextType value="variable"/>
            <element value="intent"/>
            <transform value="copy"/>
            <parameter>
              <valueString value="order"/>
            </parameter>
          </target>
        </rule>
        <rule>
          <name value="reference"/>
          <source>
            <context value="cdaText"/>
          </source>
          <target>
            <context value="ServiceRequest"/>
            <contextType value="variable"/>
            <element value="note"/>
            <variable value="note"/>
          </target>
          <rule>
            <name value="reference"/>
            <source>
              <context value="cdaText"/>
              <variable value="t"/>
            </source>
            <target>
              <context value="note"/>
              <contextType value="variable"/>
              <element value="text"/>
              <transform value="copy"/>
              <parameter>
                <valueId value="t"/>
              </parameter>
            </target>
          </rule>
        </rule>
      </rule>
      <documentation
                     value="Sezione Narrativa--------------------------------------------------------------------------------------------------------------------------------------------------"/>
    </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="serviceRequest"/>
        <transform value="create"/>
        <parameter>
          <valueString value="ServiceRequest"/>
        </parameter>
      </target>
      <target>
        <context value="serviceRequest"/>
        <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/ServiceRequest/"/>
        </parameter>
        <parameter>
          <valueId value="uuid1"/>
        </parameter>
      </target>
      <target>
        <context value="request"/>
        <contextType value="variable"/>
        <element value="url"/>
        <transform value="copy"/>
        <parameter>
          <valueString value="ServiceRequest"/>
        </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/ServiceRequest/' + %serviceRequest.id"/>
        </parameter>
      </target>
      <target>
        <context value="serviceRequest"/>
        <contextType value="variable"/>
        <element value="note"/>
        <variable value="note"/>
      </target>
      <rule>
        <name value="reference"/>
        <source>
          <context value="entry1"/>
        </source>
        <target>
          <context value="serviceRequest"/>
          <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="entry1"/>
        </source>
        <target>
          <context value="serviceRequest"/>
          <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="status"/>
        <source>
          <context value="entry1"/>
        </source>
        <target>
          <context value="serviceRequest"/>
          <contextType value="variable"/>
          <element value="status"/>
          <transform value="copy"/>
          <parameter>
            <valueString value="active"/>
          </parameter>
        </target>
      </rule>
      <rule>
        <name value="intent"/>
        <source>
          <context value="entry1"/>
        </source>
        <target>
          <context value="serviceRequest"/>
          <contextType value="variable"/>
          <element value="intent"/>
          <transform value="copy"/>
          <parameter>
            <valueString value="order"/>
          </parameter>
        </target>
      </rule>
      <rule>
        <name value="ACT"/>
        <source>
          <context value="entry1"/>
          <element value="act"/>
          <variable value="act"/>
        </source>
        <rule>
          <name value="code"/>
          <source>
            <context value="act"/>
            <element value="code"/>
            <variable value="vvv"/>
          </source>
          <target>
            <context value="serviceRequest"/>
            <contextType value="variable"/>
            <element value="code"/>
            <variable value="vvv"/>
            <transform value="create"/>
          </target>
        </rule>
        <rule>
          <name value="text"/>
          <source>
            <context value="act"/>
            <element value="text"/>
            <variable value="t"/>
          </source>
          <target>
            <context value="note"/>
            <contextType value="variable"/>
            <element value="text"/>
            <transform value="evaluate"/>
            <parameter>
              <valueString value="t.dataString"/>
            </parameter>
          </target>
        </rule>
        <rule>
          <name value="statusCode"/>
          <source>
            <context value="act"/>
            <element value="statusCode"/>
            <variable value="code"/>
          </source>
          <target>
            <context value="serviceRequest"/>
            <contextType value="variable"/>
            <element value="status"/>
            <transform value="evaluate"/>
            <parameter>
              <valueString value="code.code"/>
            </parameter>
          </target>
        </rule>
        <rule>
          <name value="performer"/>
          <source>
            <context value="act"/>
            <element value="performer"/>
            <variable value="perf"/>
          </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="PUT"/>
            </parameter>
          </target>
          <target>
            <context value="e1"/>
            <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="uuid1"/>
            <transform value="uuid"/>
          </target>
          <target>
            <context value="e1"/>
            <contextType value="variable"/>
            <element value="fullUrl"/>
            <transform value="append"/>
            <parameter>
              <valueString value="https://example/Practitioner/"/>
            </parameter>
            <parameter>
              <valueId value="uuid1"/>
            </parameter>
          </target>
          <target>
            <context value="request"/>
            <contextType value="variable"/>
            <element value="url"/>
            <transform value="append"/>
            <parameter>
              <valueString value="Practitioner/"/>
            </parameter>
            <parameter>
              <valueId value="uuid1"/>
            </parameter>
          </target>
          <rule>
            <name value="time"/>
            <source>
              <context value="perf"/>
              <element value="time"/>
              <variable value="time"/>
            </source>
            <target>
              <context value="serviceRequest"/>
              <contextType value="variable"/>
              <element value="occurrence"/>
              <variable value="t"/>
              <transform value="create"/>
              <parameter>
                <valueString value="dateTime"/>
              </parameter>
            </target>
            <dependent>
              <name value="TSDateTime"/>
              <variable value="time"/>
              <variable value="t"/>
            </dependent>
          </rule>
          <rule>
            <name value="assEnt"/>
            <source>
              <context value="perf"/>
              <element value="assignedEntity"/>
              <variable value="assEnt"/>
            </source>
            <rule>
              <name value="meta"/>
              <source>
                <context value="assEnt"/>
              </source>
              <target>
                <context value="practitioner"/>
                <contextType value="variable"/>
                <element value="meta"/>
                <variable value="meta"/>
              </target>
              <rule>
                <name value="coding"/>
                <source>
                  <context value="assEnt"/>
                </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="assEnt"/>
                  </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="assEnt"/>
                  </source>
                  <target>
                    <context value="coding"/>
                    <contextType value="variable"/>
                    <element value="code"/>
                    <transform value="copy"/>
                    <parameter>
                      <valueString
                                   value="ClinicalDocument/body/Consulenze/performer"/>
                    </parameter>
                  </target>
                </rule>
              </rule>
            </rule>
            <rule>
              <name value="identifier"/>
              <source>
                <context value="assEnt"/>
                <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="extension"/>
                <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>
              <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="e1"/>
                    <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="request"/>
                    <contextType value="variable"/>
                    <element value="url"/>
                    <transform value="append"/>
                    <parameter>
                      <valueString value="Practitioner/"/>
                    </parameter>
                    <parameter>
                      <valueId value="uuid2"/>
                    </parameter>
                  </target>
                  <target>
                    <context value="serviceRequest"/>
                    <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/Practitioner/' + %practitioner.id"/>
                    </parameter>
                  </target>
                </rule>
              </rule>
            </rule>
            <rule>
              <name value="2.16.840.1.113883.2.9.4.3.2"/>
              <source>
                <context value="assEnt"/>
                <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="assPer"/>
              <source>
                <context value="assEnt"/>
                <element value="assignedPerson"/>
                <variable value="assPer"/>
              </source>
              <rule>
                <name value="name"/>
                <source>
                  <context value="assPer"/>
                  <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>
          <name value="participant"/>
          <source>
            <context value="act"/>
            <element value="participant"/>
            <variable value="parti"/>
          </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="PUT"/>
            </parameter>
          </target>
          <target>
            <context value="e1"/>
            <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="uuid1"/>
            <transform value="uuid"/>
          </target>
          <target>
            <context value="e1"/>
            <contextType value="variable"/>
            <element value="fullUrl"/>
            <transform value="append"/>
            <parameter>
              <valueString value="https://example/Practitioner/"/>
            </parameter>
            <parameter>
              <valueId value="uuid1"/>
            </parameter>
          </target>
          <target>
            <context value="request"/>
            <contextType value="variable"/>
            <element value="url"/>
            <transform value="append"/>
            <parameter>
              <valueString value="Practitioner/"/>
            </parameter>
            <parameter>
              <valueId value="uuid1"/>
            </parameter>
          </target>
          <rule>
            <name value="time"/>
            <source>
              <context value="parti"/>
              <element value="time"/>
              <variable value="time"/>
            </source>
            <target>
              <context value="serviceRequest"/>
              <contextType value="variable"/>
              <element value="authoredOn"/>
              <variable value="t"/>
              <transform value="create"/>
              <parameter>
                <valueString value="dateTime"/>
              </parameter>
            </target>
            <dependent>
              <name value="TSDateTime"/>
              <variable value="time"/>
              <variable value="t"/>
            </dependent>
          </rule>
          <rule>
            <name value="partRole"/>
            <source>
              <context value="parti"/>
              <element value="participantRole"/>
              <variable value="partRole"/>
            </source>
            <rule>
              <name value="meta"/>
              <source>
                <context value="partRole"/>
              </source>
              <target>
                <context value="practitioner"/>
                <contextType value="variable"/>
                <element value="meta"/>
                <variable value="meta"/>
              </target>
              <rule>
                <name value="coding"/>
                <source>
                  <context value="partRole"/>
                </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="partRole"/>
                  </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="partRole"/>
                  </source>
                  <target>
                    <context value="coding"/>
                    <contextType value="variable"/>
                    <element value="code"/>
                    <transform value="copy"/>
                    <parameter>
                      <valueString
                                   value="ClinicalDocument/body/Consulenze/participant"/>
                    </parameter>
                  </target>
                </rule>
              </rule>
            </rule>
            <rule>
              <name value="identifier"/>
              <source>
                <context value="partRole"/>
                <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="extension"/>
                <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>
              <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="e1"/>
                    <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="request"/>
                    <contextType value="variable"/>
                    <element value="url"/>
                    <transform value="append"/>
                    <parameter>
                      <valueString value="Practitioner/"/>
                    </parameter>
                    <parameter>
                      <valueId value="uuid2"/>
                    </parameter>
                  </target>
                  <target>
                    <context value="serviceRequest"/>
                    <contextType value="variable"/>
                    <element value="requester"/>
                    <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="partRole"/>
                <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="entity"/>
              <source>
                <context value="partRole"/>
                <element value="playingEntity"/>
                <variable value="entity"/>
              </source>
              <rule>
                <name value="name"/>
                <source>
                  <context value="entity"/>
                  <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>
      <documentation
                     value="Sezione Strutturata--------------------------------------------------------------------------------------------------------------------------------------------"/>
    </rule>
  </group>
  <group>
    <name value="ClinicalDocumentSectionAccertamenti"/>
    <typeMode value="none"/>
    <documentation
                   value="---------------------------------------------------------------------------------------------------------
Sezione Accertamenti--------------------------------------------------------------------------------------"/>
    <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>
    <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="entryExists"/>
      <source>
        <context value="src"/>
        <condition value="src.entry.exists()"/>
      </source>
      <rule>
        <name value="cdaText"/>
        <source>
          <context value="src"/>
          <element value="text"/>
          <variable value="cdaText"/>
        </source>
        <target>
          <context value="tgt"/>
          <contextType value="variable"/>
          <element value="text"/>
          <variable value="fhirText"/>
        </target>
        <rule>
          <name value="narrativeStatus"/>
          <source>
            <context value="cdaText"/>
          </source>
          <target>
            <context value="fhirText"/>
            <contextType value="variable"/>
            <element value="status"/>
            <transform value="copy"/>
            <parameter>
              <valueString value="generated"/>
            </parameter>
          </target>
        </rule>
        <rule>
          <name value="narrativeText"/>
          <source>
            <context value="cdaText"/>
            <variable value="t"/>
          </source>
          <target>
            <context value="fhirText"/>
            <contextType value="variable"/>
            <element value="div"/>
            <transform value="copy"/>
            <parameter>
              <valueId value="t"/>
            </parameter>
          </target>
        </rule>
      </rule>
    </rule>
    <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="observation"/>
        <transform value="create"/>
        <parameter>
          <valueString value="Observation"/>
        </parameter>
      </target>
      <target>
        <context value="observation"/>
        <contextType value="variable"/>
        <element value="id"/>
        <variable value="uuid1"/>
        <transform value="uuid"/>
      </target>
      <target>
        <context value="e1"/>
        <contextType value="variable"/>
        <element value="fullUrl"/>
        <transform value="append"/>
        <parameter>
          <valueString value="https://example/Observation/"/>
        </parameter>
        <parameter>
          <valueId value="uuid1"/>
        </parameter>
      </target>
      <target>
        <context value="request"/>
        <contextType value="variable"/>
        <element value="url"/>
        <transform value="copy"/>
        <parameter>
          <valueString value="Observation"/>
        </parameter>
      </target>
      <target>
        <context value="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/Observation/' + %observation.id"/>
        </parameter>
      </target>
      <rule>
        <name value="obs"/>
        <source>
          <context value="entry1"/>
          <element value="organizer"/>
          <variable value="obs"/>
        </source>
        <rule>
          <name value="code"/>
          <source>
            <context value="src"/>
            <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="obs"/>
          </source>
          <dependent>
            <name value="ObservationAccertamenti"/>
            <variable value="obs"/>
            <variable value="patient"/>
            <variable value="enc"/>
            <variable value="observation"/>
            <variable value="bundle"/>
          </dependent>
        </rule>
      </rule>
      <documentation
                     value="Sezione Strutturata---------------------------------------------------------------------------------------------------------------------------------------------"/>
    </rule>
    <rule>
      <name value="where"/>
      <source>
        <context value="src"/>
        <condition value="src.entry.exists().not()"/>
      </source>
      <rule>
        <name value="cdaText"/>
        <source>
          <context value="src"/>
          <element value="text"/>
          <variable value="cdaText"/>
        </source>
        <target>
          <context value="bundle"/>
          <contextType value="variable"/>
          <element value="entry"/>
          <variable value="e8"/>
        </target>
        <target>
          <context value="e8"/>
          <contextType value="variable"/>
          <element value="request"/>
          <variable value="request"/>
          <transform value="create"/>
          <parameter>
            <valueString value="BackboneElement"/>
          </parameter>
        </target>
        <target>
          <context value="request"/>
          <contextType value="variable"/>
          <element value="method"/>
          <transform value="copy"/>
          <parameter>
            <valueString value="POST"/>
          </parameter>
        </target>
        <target>
          <context value="e8"/>
          <contextType value="variable"/>
          <element value="resource"/>
          <variable value="Observation"/>
          <transform value="create"/>
          <parameter>
            <valueString value="Observation"/>
          </parameter>
        </target>
        <target>
          <context value="Observation"/>
          <contextType value="variable"/>
          <element value="id"/>
          <variable value="uuid8"/>
          <transform value="uuid"/>
        </target>
        <target>
          <context value="e8"/>
          <contextType value="variable"/>
          <element value="fullUrl"/>
          <transform value="append"/>
          <parameter>
            <valueString value="https://example/Observation/"/>
          </parameter>
          <parameter>
            <valueId value="uuid8"/>
          </parameter>
        </target>
        <target>
          <context value="request"/>
          <contextType value="variable"/>
          <element value="url"/>
          <transform value="copy"/>
          <parameter>
            <valueString value="Observation"/>
          </parameter>
        </target>
        <target>
          <context value="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/Observation/' + %Observation.id"/>
          </parameter>
        </target>
        <rule>
          <name value="reference"/>
          <source>
            <context value="src"/>
          </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="src"/>
          </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/' + %enc.id"/>
            </parameter>
          </target>
        </rule>
        <rule>
          <name value="code"/>
          <source>
            <context value="src"/>
            <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="statuscode"/>
          <source>
            <context value="src"/>
            <condition value="observation.statusCode.exists().not()"/>
          </source>
          <rule>
            <name value="status"/>
            <source>
              <context value="src"/>
            </source>
            <target>
              <context value="Observation"/>
              <contextType value="variable"/>
              <element value="status"/>
              <transform value="copy"/>
              <parameter>
                <valueString value="final"/>
              </parameter>
            </target>
          </rule>
        </rule>
        <rule>
          <name value="reference"/>
          <source>
            <context value="cdaText"/>
          </source>
          <target>
            <context value="Observation"/>
            <contextType value="variable"/>
            <element value="note"/>
            <variable value="note"/>
          </target>
          <rule>
            <name value="reference"/>
            <source>
              <context value="cdaText"/>
              <variable value="t"/>
            </source>
            <target>
              <context value="note"/>
              <contextType value="variable"/>
              <element value="text"/>
              <transform value="copy"/>
              <parameter>
                <valueId value="t"/>
              </parameter>
            </target>
          </rule>
        </rule>
      </rule>
      <documentation
                     value="Sezione Narrativa--------------------------------------------------------------------------------------------------------------------------------------------"/>
    </rule>
  </group>
  <group>
    <name value="ObservationAccertamenti"/>
    <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="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="statuscode"/>
      <source>
        <context value="obs"/>
        <condition value="obs.statusCode.exists().not()"/>
      </source>
      <rule>
        <name value="status"/>
        <source>
          <context value="obs"/>
        </source>
        <target>
          <context value="ob"/>
          <contextType value="variable"/>
          <element value="status"/>
          <transform value="copy"/>
          <parameter>
            <valueString value="final"/>
          </parameter>
        </target>
      </rule>
    </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="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="originalText"/>
          <source>
            <context value="val"/>
            <element value="originalText"/>
            <variable value="vvv"/>
          </source>
          <target>
            <context value="ce"/>
            <contextType value="variable"/>
            <element value="text"/>
            <variable value="vvv"/>
            <transform value="create"/>
          </target>
        </rule>
        <rule>
          <name value="code"/>
          <source>
            <context value="val"/>
          </source>
          <target>
            <context value="ce"/>
            <contextType value="variable"/>
            <element value="coding"/>
            <variable value="coding"/>
          </target>
          <rule>
            <name value="code"/>
            <source>
              <context value="val"/>
              <element value="code"/>
              <variable value="code"/>
            </source>
            <target>
              <context value="coding"/>
              <contextType value="variable"/>
              <element value="code"/>
              <transform value="cast"/>
              <parameter>
                <valueId value="code"/>
              </parameter>
              <parameter>
                <valueString value="string"/>
              </parameter>
            </target>
          </rule>
          <rule>
            <name value="codeSystem"/>
            <source>
              <context value="val"/>
              <element value="codeSystem"/>
              <variable value="system"/>
            </source>
            <target>
              <context value="coding"/>
              <contextType value="variable"/>
              <element value="system"/>
              <transform value="translate"/>
              <parameter>
                <valueId value="system"/>
              </parameter>
              <parameter>
                <valueString
                             value="http://hl7.org/fhir/ConceptMap/special-oid2uri"/>
              </parameter>
              <parameter>
                <valueString value="uri"/>
              </parameter>
            </target>
          </rule>
          <rule>
            <name value="displayName"/>
            <source>
              <context value="val"/>
              <element value="displayName"/>
              <variable value="display"/>
            </source>
            <target>
              <context value="coding"/>
              <contextType value="variable"/>
              <element value="display"/>
              <transform value="cast"/>
              <parameter>
                <valueId value="display"/>
              </parameter>
              <parameter>
                <valueString value="string"/>
              </parameter>
            </target>
          </rule>
        </rule>
        <rule>
          <name value="translation"/>
          <source>
            <context value="val"/>
            <element value="translation"/>
            <variable value="translation"/>
          </source>
          <target>
            <context value="ce"/>
            <contextType value="variable"/>
            <element value="coding"/>
            <variable value="coding"/>
          </target>
          <rule>
            <name value="code"/>
            <source>
              <context value="translation"/>
              <element value="code"/>
              <variable value="code"/>
            </source>
            <target>
              <context value="coding"/>
              <contextType value="variable"/>
              <element value="code"/>
              <transform value="cast"/>
              <parameter>
                <valueId value="code"/>
              </parameter>
              <parameter>
                <valueString value="string"/>
              </parameter>
            </target>
          </rule>
          <rule>
            <name value="codeSystem"/>
            <source>
              <context value="translation"/>
              <element value="codeSystem"/>
              <variable value="system"/>
            </source>
            <target>
              <context value="coding"/>
              <contextType value="variable"/>
              <element value="system"/>
              <transform value="translate"/>
              <parameter>
                <valueId value="system"/>
              </parameter>
              <parameter>
                <valueString
                             value="http://hl7.org/fhir/ConceptMap/special-oid2uri"/>
              </parameter>
              <parameter>
                <valueString value="uri"/>
              </parameter>
            </target>
          </rule>
          <rule>
            <name value="displayName"/>
            <source>
              <context value="translation"/>
              <element value="displayName"/>
              <variable value="display"/>
            </source>
            <target>
              <context value="coding"/>
              <contextType value="variable"/>
              <element value="display"/>
              <transform value="cast"/>
              <parameter>
                <valueId value="display"/>
              </parameter>
              <parameter>
                <valueString value="string"/>
              </parameter>
            </target>
          </rule>
          <rule>
            <name value="qual"/>
            <source>
              <context value="translation"/>
              <element value="qualifier"/>
              <variable value="qualifier"/>
            </source>
            <rule>
              <name value="value"/>
              <source>
                <context value="qualifier"/>
                <element value="value"/>
                <variable value="value"/>
              </source>
              <target>
                <context value="ce"/>
                <contextType value="variable"/>
                <element value="coding"/>
                <variable value="coding"/>
              </target>
              <rule>
                <name value="code"/>
                <source>
                  <context value="value"/>
                  <element value="code"/>
                  <variable value="code"/>
                </source>
                <target>
                  <context value="coding"/>
                  <contextType value="variable"/>
                  <element value="code"/>
                  <transform value="cast"/>
                  <parameter>
                    <valueId value="code"/>
                  </parameter>
                  <parameter>
                    <valueString value="string"/>
                  </parameter>
                </target>
              </rule>
              <rule>
                <name value="codeSystem"/>
                <source>
                  <context value="value"/>
                  <element value="codeSystem"/>
                  <variable value="system"/>
                </source>
                <target>
                  <context value="coding"/>
                  <contextType value="variable"/>
                  <element value="system"/>
                  <transform value="translate"/>
                  <parameter>
                    <valueId value="system"/>
                  </parameter>
                  <parameter>
                    <valueString
                                 value="http://hl7.org/fhir/ConceptMap/special-oid2uri"/>
                  </parameter>
                  <parameter>
                    <valueString value="uri"/>
                  </parameter>
                </target>
              </rule>
              <rule>
                <name value="displayName"/>
                <source>
                  <context value="value"/>
                  <element value="displayName"/>
                  <variable value="display"/>
                </source>
                <target>
                  <context value="coding"/>
                  <contextType value="variable"/>
                  <element value="display"/>
                  <transform value="cast"/>
                  <parameter>
                    <valueId value="display"/>
                  </parameter>
                  <parameter>
                    <valueString value="string"/>
                  </parameter>
                </target>
              </rule>
            </rule>
          </rule>
        </rule>
      </rule>
    </rule>
    <rule>
      <name value="val"/>
      <source>
        <context value="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="originalText"/>
          <source>
            <context value="val"/>
            <element value="originalText"/>
            <variable value="vvv"/>
          </source>
          <target>
            <context value="ce"/>
            <contextType value="variable"/>
            <element value="text"/>
            <variable value="vvv"/>
            <transform value="create"/>
          </target>
        </rule>
        <rule>
          <name value="code"/>
          <source>
            <context value="val"/>
          </source>
          <target>
            <context value="ce"/>
            <contextType value="variable"/>
            <element value="coding"/>
            <variable value="coding"/>
          </target>
          <rule>
            <name value="code"/>
            <source>
              <context value="val"/>
              <element value="code"/>
              <variable value="code"/>
            </source>
            <target>
              <context value="coding"/>
              <contextType value="variable"/>
              <element value="code"/>
              <transform value="cast"/>
              <parameter>
                <valueId value="code"/>
              </parameter>
              <parameter>
                <valueString value="string"/>
              </parameter>
            </target>
          </rule>
          <rule>
            <name value="codeSystem"/>
            <source>
              <context value="val"/>
              <element value="codeSystem"/>
              <variable value="system"/>
            </source>
            <target>
              <context value="coding"/>
              <contextType value="variable"/>
              <element value="system"/>
              <transform value="translate"/>
              <parameter>
                <valueId value="system"/>
              </parameter>
              <parameter>
                <valueString
                             value="http://hl7.org/fhir/ConceptMap/special-oid2uri"/>
              </parameter>
              <parameter>
                <valueString value="uri"/>
              </parameter>
            </target>
          </rule>
          <rule>
            <name value="displayName"/>
            <source>
              <context value="val"/>
              <element value="displayName"/>
              <variable value="display"/>
            </source>
            <target>
              <context value="coding"/>
              <contextType value="variable"/>
              <element value="display"/>
              <transform value="cast"/>
              <parameter>
                <valueId value="display"/>
              </parameter>
              <parameter>
                <valueString value="string"/>
              </parameter>
            </target>
          </rule>
        </rule>
        <rule>
          <name value="translation"/>
          <source>
            <context value="val"/>
            <element value="translation"/>
            <variable value="translation"/>
          </source>
          <target>
            <context value="ce"/>
            <contextType value="variable"/>
            <element value="coding"/>
            <variable value="coding"/>
          </target>
          <rule>
            <name value="code"/>
            <source>
              <context value="translation"/>
              <element value="code"/>
              <variable value="code"/>
            </source>
            <target>
              <context value="coding"/>
              <contextType value="variable"/>
              <element value="code"/>
              <transform value="cast"/>
              <parameter>
                <valueId value="code"/>
              </parameter>
              <parameter>
                <valueString value="string"/>
              </parameter>
            </target>
          </rule>
          <rule>
            <name value="codeSystem"/>
            <source>
              <context value="translation"/>
              <element value="codeSystem"/>
              <variable value="system"/>
            </source>
            <target>
              <context value="coding"/>
              <contextType value="variable"/>
              <element value="system"/>
              <transform value="translate"/>
              <parameter>
                <valueId value="system"/>
              </parameter>
              <parameter>
                <valueString
                             value="http://hl7.org/fhir/ConceptMap/special-oid2uri"/>
              </parameter>
              <parameter>
                <valueString value="uri"/>
              </parameter>
            </target>
          </rule>
          <rule>
            <name value="displayName"/>
            <source>
              <context value="translation"/>
              <element value="displayName"/>
              <variable value="display"/>
            </source>
            <target>
              <context value="coding"/>
              <contextType value="variable"/>
              <element value="display"/>
              <transform value="cast"/>
              <parameter>
                <valueId value="display"/>
              </parameter>
              <parameter>
                <valueString value="string"/>
              </parameter>
            </target>
          </rule>
          <rule>
            <name value="qual"/>
            <source>
              <context value="translation"/>
              <element value="qualifier"/>
              <variable value="qualifier"/>
            </source>
            <rule>
              <name value="value"/>
              <source>
                <context value="qualifier"/>
                <element value="value"/>
                <variable value="value"/>
              </source>
              <target>
                <context value="ce"/>
                <contextType value="variable"/>
                <element value="coding"/>
                <variable value="coding"/>
              </target>
              <rule>
                <name value="code"/>
                <source>
                  <context value="value"/>
                  <element value="code"/>
                  <variable value="code"/>
                </source>
                <target>
                  <context value="coding"/>
                  <contextType value="variable"/>
                  <element value="code"/>
                  <transform value="cast"/>
                  <parameter>
                    <valueId value="code"/>
                  </parameter>
                  <parameter>
                    <valueString value="string"/>
                  </parameter>
                </target>
              </rule>
              <rule>
                <name value="codeSystem"/>
                <source>
                  <context value="value"/>
                  <element value="codeSystem"/>
                  <variable value="system"/>
                </source>
                <target>
                  <context value="coding"/>
                  <contextType value="variable"/>
                  <element value="system"/>
                  <transform value="translate"/>
                  <parameter>
                    <valueId value="system"/>
                  </parameter>
                  <parameter>
                    <valueString
                                 value="http://hl7.org/fhir/ConceptMap/special-oid2uri"/>
                  </parameter>
                  <parameter>
                    <valueString value="uri"/>
                  </parameter>
                </target>
              </rule>
              <rule>
                <name value="displayName"/>
                <source>
                  <context value="value"/>
                  <element value="displayName"/>
                  <variable value="display"/>
                </source>
                <target>
                  <context value="coding"/>
                  <contextType value="variable"/>
                  <element value="display"/>
                  <transform value="cast"/>
                  <parameter>
                    <valueId value="display"/>
                  </parameter>
                  <parameter>
                    <valueString value="string"/>
                  </parameter>
                </target>
              </rule>
            </rule>
          </rule>
        </rule>
      </rule>
    </rule>
    <rule>
      <name value="valueQuantity"/>
      <source>
        <context value="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="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="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="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="refRange"/>
      <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="obsRange"/>
        <source>
          <context value="refRange"/>
          <element value="observationRange"/>
          <variable value="obsRange"/>
        </source>
        <target>
          <context value="ref"/>
          <contextType value="variable"/>
          <element value="low"/>
          <variable value="Low"/>
          <transform value="create"/>
          <parameter>
            <valueString value="SimpleQuantity"/>
          </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>
      </rule>
    </rule>
    <rule>
      <name value="perf"/>
      <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="PUT"/>
        </parameter>
      </target>
      <target>
        <context value="e1"/>
        <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="uuid1"/>
        <transform value="uuid"/>
      </target>
      <target>
        <context value="e1"/>
        <contextType value="variable"/>
        <element value="fullUrl"/>
        <transform value="append"/>
        <parameter>
          <valueString value="https://example/Practitioner/"/>
        </parameter>
        <parameter>
          <valueId value="uuid1"/>
        </parameter>
      </target>
      <target>
        <context value="request"/>
        <contextType value="variable"/>
        <element value="url"/>
        <transform value="append"/>
        <parameter>
          <valueString value="Practitioner/"/>
        </parameter>
        <parameter>
          <valueId value="uuid1"/>
        </parameter>
      </target>
      <rule>
        <name value="assEntity"/>
        <source>
          <context value="performer"/>
          <element value="assignedEntity"/>
          <variable value="assEntity"/>
        </source>
        <rule>
          <name value="meta"/>
          <source>
            <context value="assEntity"/>
          </source>
          <target>
            <context value="practitioner"/>
            <contextType value="variable"/>
            <element value="meta"/>
            <variable value="meta"/>
          </target>
          <rule>
            <name value="coding"/>
            <source>
              <context value="assEntity"/>
            </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="assEntity"/>
              </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="assEntity"/>
              </source>
              <target>
                <context value="coding"/>
                <contextType value="variable"/>
                <element value="code"/>
                <transform value="copy"/>
                <parameter>
                  <valueString
                               value="ClinicalDocument/body/Accertamenti/performer"/>
                </parameter>
              </target>
            </rule>
          </rule>
          <documentation value="inizio modifica identifier+meta"/>
        </rule>
        <rule>
          <name value="identifier"/>
          <source>
            <context value="assEntity"/>
            <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="extension"/>
            <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>
          <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="e1"/>
                <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="request"/>
                <contextType value="variable"/>
                <element value="url"/>
                <transform value="append"/>
                <parameter>
                  <valueString value="Practitioner/"/>
                </parameter>
                <parameter>
                  <valueId value="uuid2"/>
                </parameter>
              </target>
              <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/Practitioner/' + %practitioner.id"/>
                </parameter>
              </target>
            </rule>
          </rule>
        </rule>
        <rule>
          <name value="2.16.840.1.113883.2.9.4.3.2"/>
          <source>
            <context value="assEntity"/>
            <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="assi"/>
          <source>
            <context value="assEntity"/>
            <element value="assignedPerson"/>
            <variable value="assi"/>
          </source>
          <rule>
            <name value="name"/>
            <source>
              <context value="assi"/>
              <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>
          <documentation value="fine modifica"/>
        </rule>
      </rule>
    </rule>
    <rule>
      <name value="participant"/>
      <source>
        <context value="obs"/>
        <element value="participant"/>
        <variable value="participant"/>
      </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="serviceRequest"/>
        <transform value="create"/>
        <parameter>
          <valueString value="ServiceRequest"/>
        </parameter>
      </target>
      <target>
        <context value="serviceRequest"/>
        <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/ServiceRequest/"/>
        </parameter>
        <parameter>
          <valueId value="uuid1"/>
        </parameter>
      </target>
      <target>
        <context value="request"/>
        <contextType value="variable"/>
        <element value="url"/>
        <transform value="copy"/>
        <parameter>
          <valueString value="ServiceRequest"/>
        </parameter>
      </target>
      <target>
        <context value="ob"/>
        <contextType value="variable"/>
        <element value="basedOn"/>
        <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/ServiceRequest/' + %serviceRequest.id"/>
        </parameter>
      </target>
      <rule>
        <name value="value2"/>
        <source>
          <context value="participant"/>
          <element value="time"/>
          <variable value="t"/>
        </source>
        <target>
          <context value="serviceRequest"/>
          <contextType value="variable"/>
          <element value="authoredOn"/>
          <variable value="value"/>
          <transform value="create"/>
          <parameter>
            <valueString value="dateTime"/>
          </parameter>
        </target>
        <dependent>
          <name value="TSDateTime"/>
          <variable value="t"/>
          <variable value="value"/>
        </dependent>
        <documentation
                       value="participant.time as t -&gt; serviceRequest.authoredOn = (t.value);"/>
      </rule>
      <rule>
        <name value="reference"/>
        <source>
          <context value="obs"/>
        </source>
        <target>
          <context value="serviceRequest"/>
          <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="serviceRequest"/>
          <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="obs"/>
        </source>
        <target>
          <context value="serviceRequest"/>
          <contextType value="variable"/>
          <element value="status"/>
          <transform value="copy"/>
          <parameter>
            <valueString value="active"/>
          </parameter>
        </target>
      </rule>
      <rule>
        <name value="intent"/>
        <source>
          <context value="obs"/>
        </source>
        <target>
          <context value="serviceRequest"/>
          <contextType value="variable"/>
          <element value="intent"/>
          <transform value="copy"/>
          <parameter>
            <valueString value="order"/>
          </parameter>
        </target>
      </rule>
      <rule>
        <name value="participantRole"/>
        <source>
          <context value="participant"/>
          <element value="participantRole"/>
          <variable value="participantRole"/>
        </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="PUT"/>
          </parameter>
        </target>
        <target>
          <context value="e1"/>
          <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="uuid1"/>
          <transform value="uuid"/>
        </target>
        <target>
          <context value="e1"/>
          <contextType value="variable"/>
          <element value="fullUrl"/>
          <transform value="append"/>
          <parameter>
            <valueString value="https://example/Practitioner/"/>
          </parameter>
          <parameter>
            <valueId value="uuid1"/>
          </parameter>
        </target>
        <target>
          <context value="request"/>
          <contextType value="variable"/>
          <element value="url"/>
          <transform value="append"/>
          <parameter>
            <valueString value="Practitioner/"/>
          </parameter>
          <parameter>
            <valueId value="uuid1"/>
          </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/Accertamenti/participant"/>
                </parameter>
              </target>
            </rule>
          </rule>
          <documentation value="modifica meta+identifier"/>
        </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="extension"/>
            <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>
          <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="e1"/>
                <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="request"/>
                <contextType value="variable"/>
                <element value="url"/>
                <transform value="append"/>
                <parameter>
                  <valueString value="Practitioner/"/>
                </parameter>
                <parameter>
                  <valueId value="uuid2"/>
                </parameter>
              </target>
              <target>
                <context value="serviceRequest"/>
                <contextType value="variable"/>
                <element value="requester"/>
                <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="pe"/>
          <source>
            <context value="participantRole"/>
            <element value="playingEntity"/>
            <variable value="pe"/>
          </source>
          <rule>
            <name value="name"/>
            <source>
              <context value="pe"/>
              <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>
          <documentation value="fine modifica"/>
        </rule>
      </rule>
    </rule>
    <rule>
      <name value="observation"/>
      <source>
        <context value="obs"/>
        <element value="component"/>
        <variable value="comp"/>
      </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="observation"/>
        <transform value="create"/>
        <parameter>
          <valueString value="Observation"/>
        </parameter>
      </target>
      <target>
        <context value="observation"/>
        <contextType value="variable"/>
        <element value="id"/>
        <variable value="uuid1"/>
        <transform value="uuid"/>
      </target>
      <target>
        <context value="e1"/>
        <contextType value="variable"/>
        <element value="fullUrl"/>
        <transform value="append"/>
        <parameter>
          <valueString value="https://example/Observation/"/>
        </parameter>
        <parameter>
          <valueId value="uuid1"/>
        </parameter>
      </target>
      <target>
        <context value="request"/>
        <contextType value="variable"/>
        <element value="url"/>
        <transform value="copy"/>
        <parameter>
          <valueString value="Observation"/>
        </parameter>
      </target>
      <target>
        <context value="ob"/>
        <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/' + %observation.id"/>
        </parameter>
      </target>
      <rule>
        <name value="obs"/>
        <source>
          <context value="comp"/>
          <element value="observation"/>
          <variable value="obs"/>
        </source>
        <rule>
          <name value="code"/>
          <source>
            <context value="obs"/>
            <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="statusCode"/>
          <source>
            <context value="obs"/>
            <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="obs"/>
            <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="obs"/>
            <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="obs"/>
            <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="statuscode"/>
          <source>
            <context value="obs"/>
            <condition value="obs.statusCode.exists().not()"/>
          </source>
          <rule>
            <name value="status"/>
            <source>
              <context value="obs"/>
            </source>
            <target>
              <context value="observation"/>
              <contextType value="variable"/>
              <element value="status"/>
              <transform value="copy"/>
              <parameter>
                <valueString value="final"/>
              </parameter>
            </target>
          </rule>
        </rule>
        <rule>
          <name value="reference"/>
          <source>
            <context value="obs"/>
          </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="obs"/>
          </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="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="value"/>
          <source>
            <context value="obs"/>
            <element value="value"/>
            <variable value="val"/>
          </source>
          <target>
            <context value="observation"/>
            <contextType value="variable"/>
            <element value="value"/>
            <transform value="evaluate"/>
            <parameter>
              <valueString value="val.dataString"/>
            </parameter>
          </target>
        </rule>
      </rule>
    </rule>
  </group>
  <group>
    <name value="ClinicalDocumentSectionParametriVitali"/>
    <typeMode value="none"/>
    <documentation
                   value="-----------------------------------------------------------------------------------------------------------
Sezione ParametriVitali--------------------------------------------------------------------------------------"/>
    <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>
    <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="entry-exists"/>
      <source>
        <context value="src"/>
        <condition value="src.entry.exists()"/>
      </source>
      <rule>
        <name value="cdaText"/>
        <source>
          <context value="src"/>
          <element value="text"/>
          <variable value="cdaText"/>
        </source>
        <target>
          <context value="tgt"/>
          <contextType value="variable"/>
          <element value="text"/>
          <variable value="fhirText"/>
        </target>
        <rule>
          <name value="narrativeStatus"/>
          <source>
            <context value="cdaText"/>
          </source>
          <target>
            <context value="fhirText"/>
            <contextType value="variable"/>
            <element value="status"/>
            <transform value="copy"/>
            <parameter>
              <valueString value="generated"/>
            </parameter>
          </target>
        </rule>
        <rule>
          <name value="narrativeText"/>
          <source>
            <context value="cdaText"/>
            <variable value="t"/>
          </source>
          <target>
            <context value="fhirText"/>
            <contextType value="variable"/>
            <element value="div"/>
            <transform value="copy"/>
            <parameter>
              <valueId value="t"/>
            </parameter>
          </target>
        </rule>
      </rule>
    </rule>
    <rule>
      <name value="where"/>
      <source>
        <context value="src"/>
        <condition value="src.entry.exists().not()"/>
      </source>
      <rule>
        <name value="cdaText"/>
        <source>
          <context value="src"/>
          <element value="text"/>
          <variable value="cdaText"/>
        </source>
        <target>
          <context value="bundle"/>
          <contextType value="variable"/>
          <element value="entry"/>
          <variable value="e8"/>
        </target>
        <target>
          <context value="e8"/>
          <contextType value="variable"/>
          <element value="request"/>
          <variable value="request"/>
          <transform value="create"/>
          <parameter>
            <valueString value="BackboneElement"/>
          </parameter>
        </target>
        <target>
          <context value="request"/>
          <contextType value="variable"/>
          <element value="method"/>
          <transform value="copy"/>
          <parameter>
            <valueString value="POST"/>
          </parameter>
        </target>
        <target>
          <context value="e8"/>
          <contextType value="variable"/>
          <element value="resource"/>
          <variable value="Observation"/>
          <transform value="create"/>
          <parameter>
            <valueString value="Observation"/>
          </parameter>
        </target>
        <target>
          <context value="Observation"/>
          <contextType value="variable"/>
          <element value="id"/>
          <variable value="uuid8"/>
          <transform value="uuid"/>
        </target>
        <target>
          <context value="e8"/>
          <contextType value="variable"/>
          <element value="fullUrl"/>
          <transform value="append"/>
          <parameter>
            <valueString value="https://example/Observation/"/>
          </parameter>
          <parameter>
            <valueId value="uuid8"/>
          </parameter>
        </target>
        <target>
          <context value="request"/>
          <contextType value="variable"/>
          <element value="url"/>
          <transform value="copy"/>
          <parameter>
            <valueString value="Observation"/>
          </parameter>
        </target>
        <target>
          <context value="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/Observation/' + %Observation.id"/>
          </parameter>
        </target>
        <rule>
          <name value="reference"/>
          <source>
            <context value="src"/>
          </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="src"/>
          </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/' + %enc.id"/>
            </parameter>
          </target>
        </rule>
        <rule>
          <name value="code"/>
          <source>
            <context value="src"/>
            <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="statuscode"/>
          <source>
            <context value="src"/>
            <condition value="observation.statusCode.exists().not()"/>
          </source>
          <rule>
            <name value="status"/>
            <source>
              <context value="src"/>
            </source>
            <target>
              <context value="Observation"/>
              <contextType value="variable"/>
              <element value="status"/>
              <transform value="copy"/>
              <parameter>
                <valueString value="final"/>
              </parameter>
            </target>
          </rule>
        </rule>
        <rule>
          <name value="reference"/>
          <source>
            <context value="cdaText"/>
          </source>
          <target>
            <context value="Observation"/>
            <contextType value="variable"/>
            <element value="note"/>
            <variable value="note"/>
          </target>
          <rule>
            <name value="reference"/>
            <source>
              <context value="cdaText"/>
              <variable value="t"/>
            </source>
            <target>
              <context value="note"/>
              <contextType value="variable"/>
              <element value="text"/>
              <transform value="copy"/>
              <parameter>
                <valueId value="t"/>
              </parameter>
            </target>
          </rule>
        </rule>
      </rule>
      <documentation
                     value="Sezione Narrativa----------------------------------------------------------------------------------------------------------------------------------------------------"/>
    </rule>
    <rule>
      <name value="Observation"/>
      <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="observation"/>
        <transform value="create"/>
        <parameter>
          <valueString value="Observation"/>
        </parameter>
      </target>
      <target>
        <context value="observation"/>
        <contextType value="variable"/>
        <element value="id"/>
        <variable value="uuid1"/>
        <transform value="uuid"/>
      </target>
      <target>
        <context value="e1"/>
        <contextType value="variable"/>
        <element value="fullUrl"/>
        <transform value="append"/>
        <parameter>
          <valueString value="https://example/Observation/"/>
        </parameter>
        <parameter>
          <valueId value="uuid1"/>
        </parameter>
      </target>
      <target>
        <context value="request"/>
        <contextType value="variable"/>
        <element value="url"/>
        <transform value="copy"/>
        <parameter>
          <valueString value="Observation"/>
        </parameter>
      </target>
      <target>
        <context value="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/Observation/' + %observation.id"/>
        </parameter>
      </target>
      <rule>
        <name value="obs"/>
        <source>
          <context value="entry1"/>
          <element value="organizer"/>
          <variable value="org"/>
        </source>
        <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/' + %enc.id"/>
            </parameter>
          </target>
        </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="statuscode"/>
          <source>
            <context value="org"/>
            <condition value="obs.statusCode.exists().not()"/>
          </source>
          <rule>
            <name value="status"/>
            <source>
              <context value="org"/>
            </source>
            <target>
              <context value="observation"/>
              <contextType value="variable"/>
              <element value="status"/>
              <transform value="copy"/>
              <parameter>
                <valueString value="final"/>
              </parameter>
            </target>
          </rule>
        </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="code"/>
          <source>
            <context value="org"/>
            <condition value="org.code.exists().not()"/>
          </source>
          <rule>
            <name value="code"/>
            <source>
              <context value="src"/>
              <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="component"/>
          <source>
            <context value="org"/>
            <element value="component"/>
            <variable value="component"/>
          </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="observation1"/>
            <transform value="create"/>
            <parameter>
              <valueString value="Observation"/>
            </parameter>
          </target>
          <target>
            <context value="observation1"/>
            <contextType value="variable"/>
            <element value="id"/>
            <variable value="uuid1"/>
            <transform value="uuid"/>
          </target>
          <target>
            <context value="e1"/>
            <contextType value="variable"/>
            <element value="fullUrl"/>
            <transform value="append"/>
            <parameter>
              <valueString value="https://example/Observation/"/>
            </parameter>
            <parameter>
              <valueId value="uuid1"/>
            </parameter>
          </target>
          <target>
            <context value="request"/>
            <contextType value="variable"/>
            <element value="url"/>
            <transform value="copy"/>
            <parameter>
              <valueString value="Observation"/>
            </parameter>
          </target>
          <target>
            <context value="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/' + %observation1.id"/>
            </parameter>
          </target>
          <rule>
            <name value="obs"/>
            <source>
              <context value="component"/>
              <element value="observation"/>
              <variable value="obs"/>
            </source>
            <rule>
              <name value="reference"/>
              <source>
                <context value="obs"/>
              </source>
              <target>
                <context value="observation1"/>
                <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="observation1"/>
                <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="code"/>
              <source>
                <context value="obs"/>
                <element value="code"/>
                <variable value="vvv"/>
              </source>
              <target>
                <context value="observation1"/>
                <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="vvv"/>
              </source>
              <target>
                <context value="observation1"/>
                <contextType value="variable"/>
                <element value="status"/>
                <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="observation1"/>
                <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="observation1"/>
                <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="observation1"/>
                <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="observation1"/>
                <contextType value="variable"/>
                <element value="status"/>
                <transform value="copy"/>
                <parameter>
                  <valueString value="partial"/>
                </parameter>
              </target>
            </rule>
            <rule>
              <name value="statuscode"/>
              <source>
                <context value="obs"/>
                <condition value="obs.statusCode.exists().not()"/>
              </source>
              <rule>
                <name value="status"/>
                <source>
                  <context value="obs"/>
                </source>
                <target>
                  <context value="observation1"/>
                  <contextType value="variable"/>
                  <element value="status"/>
                  <transform value="copy"/>
                  <parameter>
                    <valueString value="final"/>
                  </parameter>
                </target>
              </rule>
            </rule>
            <rule>
              <name value="quant"/>
              <source>
                <context value="obs"/>
              </source>
              <target>
                <context value="observation1"/>
                <contextType value="variable"/>
                <element value="value"/>
                <variable value="quant"/>
                <transform value="create"/>
                <parameter>
                  <valueString value="Quantity"/>
                </parameter>
              </target>
              <rule>
                <name value="value"/>
                <source>
                  <context value="obs"/>
                  <element value="value"/>
                  <variable value="v"/>
                </source>
                <target>
                  <context value="quant"/>
                  <contextType value="variable"/>
                  <element value="value"/>
                  <transform value="evaluate"/>
                  <parameter>
                    <valueString value="v.value"/>
                  </parameter>
                </target>
              </rule>
              <rule>
                <name value="value"/>
                <source>
                  <context value="obs"/>
                  <element value="value"/>
                  <variable value="v"/>
                </source>
                <target>
                  <context value="quant"/>
                  <contextType value="variable"/>
                  <element value="unit"/>
                  <transform value="evaluate"/>
                  <parameter>
                    <valueString value="v.unit"/>
                  </parameter>
                </target>
              </rule>
            </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="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="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="interpretationCode"/>
              <source>
                <context value="obs"/>
                <element value="interpretationCode"/>
                <variable value="vvv"/>
              </source>
              <target>
                <context value="observation1"/>
                <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="observation1"/>
                <contextType value="variable"/>
                <element value="method"/>
                <variable value="vvv"/>
                <transform value="create"/>
              </target>
            </rule>
            <rule>
              <name value="targetSiteCode"/>
              <source>
                <context value="obs"/>
                <element value="targetSiteCode"/>
                <variable value="vvv"/>
              </source>
              <target>
                <context value="observation1"/>
                <contextType value="variable"/>
                <element value="bodySite"/>
                <variable value="vvv"/>
                <transform value="create"/>
              </target>
            </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="PUT"/>
                </parameter>
              </target>
              <target>
                <context value="e1"/>
                <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="uuid1"/>
                <transform value="uuid"/>
              </target>
              <target>
                <context value="e1"/>
                <contextType value="variable"/>
                <element value="fullUrl"/>
                <transform value="append"/>
                <parameter>
                  <valueString value="https://example/Practitioner/"/>
                </parameter>
                <parameter>
                  <valueId value="uuid1"/>
                </parameter>
              </target>
              <target>
                <context value="request"/>
                <contextType value="variable"/>
                <element value="url"/>
                <transform value="append"/>
                <parameter>
                  <valueString value="Practitioner/"/>
                </parameter>
                <parameter>
                  <valueId value="uuid1"/>
                </parameter>
              </target>
              <rule>
                <name value="time"/>
                <source>
                  <context value="performer"/>
                  <element value="time"/>
                  <variable value="t"/>
                </source>
                <target>
                  <context value="observation1"/>
                  <contextType value="variable"/>
                  <element value="issued"/>
                  <variable value="date"/>
                  <transform value="create"/>
                  <parameter>
                    <valueString value="dateTime"/>
                  </parameter>
                </target>
                <dependent>
                  <name value="TSDateTime"/>
                  <variable value="t"/>
                  <variable value="date"/>
                </dependent>
              </rule>
              <rule>
                <name value="assEntity"/>
                <source>
                  <context value="performer"/>
                  <element value="assignedEntity"/>
                  <variable value="assEntity"/>
                </source>
                <rule>
                  <name value="meta"/>
                  <source>
                    <context value="assEntity"/>
                  </source>
                  <target>
                    <context value="practitioner"/>
                    <contextType value="variable"/>
                    <element value="meta"/>
                    <variable value="meta"/>
                  </target>
                  <rule>
                    <name value="coding"/>
                    <source>
                      <context value="assEntity"/>
                    </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="assEntity"/>
                      </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="assEntity"/>
                      </source>
                      <target>
                        <context value="coding"/>
                        <contextType value="variable"/>
                        <element value="code"/>
                        <transform value="copy"/>
                        <parameter>
                          <valueString
                                       value="ClinicalDocument/body/ParametriVitali/performer"/>
                        </parameter>
                      </target>
                    </rule>
                  </rule>
                  <documentation value="inizio modifica meta+ identifier"/>
                </rule>
                <rule>
                  <name value="identifier"/>
                  <source>
                    <context value="assEntity"/>
                    <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="extension"/>
                    <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>
                  <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="e1"/>
                        <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="request"/>
                        <contextType value="variable"/>
                        <element value="url"/>
                        <transform value="append"/>
                        <parameter>
                          <valueString value="Practitioner/"/>
                        </parameter>
                        <parameter>
                          <valueId value="uuid2"/>
                        </parameter>
                      </target>
                      <target>
                        <context value="observation1"/>
                        <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/Practitioner/' + %practitioner.id"/>
                        </parameter>
                      </target>
                    </rule>
                  </rule>
                </rule>
                <rule>
                  <name value="2.16.840.1.113883.2.9.4.3.2"/>
                  <source>
                    <context value="assEntity"/>
                    <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="assPerson"/>
                  <source>
                    <context value="assEntity"/>
                    <element value="assignedPerson"/>
                    <variable value="assPerson"/>
                  </source>
                  <rule>
                    <name value="name"/>
                    <source>
                      <context value="assPerson"/>
                      <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>
                  <documentation value="fine modifica"/>
                </rule>
              </rule>
            </rule>
            <rule>
              <name value="parti"/>
              <source>
                <context value="obs"/>
                <element value="participant"/>
                <variable value="parti"/>
              </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="serviceRequest"/>
                <transform value="create"/>
                <parameter>
                  <valueString value="ServiceRequest"/>
                </parameter>
              </target>
              <target>
                <context value="serviceRequest"/>
                <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/ServiceRequest/"/>
                </parameter>
                <parameter>
                  <valueId value="uuid1"/>
                </parameter>
              </target>
              <target>
                <context value="request"/>
                <contextType value="variable"/>
                <element value="url"/>
                <transform value="copy"/>
                <parameter>
                  <valueString value="ServiceRequest"/>
                </parameter>
              </target>
              <target>
                <context value="observation1"/>
                <contextType value="variable"/>
                <element value="basedOn"/>
                <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/ServiceRequest/' + %serviceRequest.id"/>
                </parameter>
              </target>
              <rule>
                <name value="reference"/>
                <source>
                  <context value="parti"/>
                </source>
                <target>
                  <context value="serviceRequest"/>
                  <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="parti"/>
                </source>
                <target>
                  <context value="serviceRequest"/>
                  <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="status"/>
                <source>
                  <context value="parti"/>
                </source>
                <target>
                  <context value="serviceRequest"/>
                  <contextType value="variable"/>
                  <element value="status"/>
                  <transform value="copy"/>
                  <parameter>
                    <valueString value="active"/>
                  </parameter>
                </target>
              </rule>
              <rule>
                <name value="intent"/>
                <source>
                  <context value="parti"/>
                </source>
                <target>
                  <context value="serviceRequest"/>
                  <contextType value="variable"/>
                  <element value="intent"/>
                  <transform value="copy"/>
                  <parameter>
                    <valueString value="order"/>
                  </parameter>
                </target>
              </rule>
              <rule>
                <name value="value2"/>
                <source>
                  <context value="parti"/>
                  <element value="time"/>
                  <variable value="t"/>
                </source>
                <target>
                  <context value="serviceRequest"/>
                  <contextType value="variable"/>
                  <element value="authoredOn"/>
                  <variable value="value"/>
                  <transform value="create"/>
                  <parameter>
                    <valueString value="dateTime"/>
                  </parameter>
                </target>
                <dependent>
                  <name value="TSDateTime"/>
                  <variable value="t"/>
                  <variable value="value"/>
                </dependent>
              </rule>
              <rule>
                <name value="partRole"/>
                <source>
                  <context value="parti"/>
                  <element value="participantRole"/>
                  <variable value="partRole"/>
                </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="PUT"/>
                  </parameter>
                </target>
                <target>
                  <context value="e1"/>
                  <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="uuid1"/>
                  <transform value="uuid"/>
                </target>
                <target>
                  <context value="e1"/>
                  <contextType value="variable"/>
                  <element value="fullUrl"/>
                  <transform value="append"/>
                  <parameter>
                    <valueString value="https://example/Practitioner/"/>
                  </parameter>
                  <parameter>
                    <valueId value="uuid1"/>
                  </parameter>
                </target>
                <target>
                  <context value="request"/>
                  <contextType value="variable"/>
                  <element value="url"/>
                  <transform value="append"/>
                  <parameter>
                    <valueString value="Practitioner/"/>
                  </parameter>
                  <parameter>
                    <valueId value="uuid1"/>
                  </parameter>
                </target>
                <rule>
                  <name value="meta"/>
                  <source>
                    <context value="partRole"/>
                  </source>
                  <target>
                    <context value="practitioner"/>
                    <contextType value="variable"/>
                    <element value="meta"/>
                    <variable value="meta"/>
                  </target>
                  <rule>
                    <name value="coding"/>
                    <source>
                      <context value="partRole"/>
                    </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="partRole"/>
                      </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="partRole"/>
                      </source>
                      <target>
                        <context value="coding"/>
                        <contextType value="variable"/>
                        <element value="code"/>
                        <transform value="copy"/>
                        <parameter>
                          <valueString
                                       value="ClinicalDocument/body/ParametriVitali/participant"/>
                        </parameter>
                      </target>
                    </rule>
                  </rule>
                  <documentation value="inizio modifica meta + identifier"/>
                </rule>
                <rule>
                  <name value="identifier"/>
                  <source>
                    <context value="partRole"/>
                    <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="extension"/>
                    <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>
                  <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="e1"/>
                        <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="request"/>
                        <contextType value="variable"/>
                        <element value="url"/>
                        <transform value="append"/>
                        <parameter>
                          <valueString value="Practitioner/"/>
                        </parameter>
                        <parameter>
                          <valueId value="uuid2"/>
                        </parameter>
                      </target>
                      <target>
                        <context value="serviceRequest"/>
                        <contextType value="variable"/>
                        <element value="requester"/>
                        <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="partRole"/>
                    <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="name"/>
                  <source>
                    <context value="partRole"/>
                    <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>
                  <documentation value="fine modifica"/>
                </rule>
              </rule>
            </rule>
          </rule>
        </rule>
      </rule>
      <documentation
                     value="Sezione Strutturata --------------------------------------------------------------------------------------------------------------------------------------------------------"/>
    </rule>
  </group>
  <group>
    <name value="ClinicalDocumentSectionTerapiaFarmacoInPronto"/>
    <typeMode value="none"/>
    <documentation
                   value="-----------------------------------------------------------------------------------------------------------------
Sezione terapia Farma in Pronto----------------------------------------------------------------------------------"/>
    <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>
    <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="entry-exists"/>
      <source>
        <context value="src"/>
        <condition value="src.entry.exists()"/>
      </source>
      <rule>
        <name value="cdaText"/>
        <source>
          <context value="src"/>
          <element value="text"/>
          <variable value="cdaText"/>
        </source>
        <target>
          <context value="tgt"/>
          <contextType value="variable"/>
          <element value="text"/>
          <variable value="fhirText"/>
        </target>
        <rule>
          <name value="narrativeStatus"/>
          <source>
            <context value="cdaText"/>
          </source>
          <target>
            <context value="fhirText"/>
            <contextType value="variable"/>
            <element value="status"/>
            <transform value="copy"/>
            <parameter>
              <valueString value="generated"/>
            </parameter>
          </target>
        </rule>
        <rule>
          <name value="narrativeText"/>
          <source>
            <context value="cdaText"/>
            <variable value="t"/>
          </source>
          <target>
            <context value="fhirText"/>
            <contextType value="variable"/>
            <element value="div"/>
            <transform value="copy"/>
            <parameter>
              <valueId value="t"/>
            </parameter>
          </target>
        </rule>
      </rule>
    </rule>
    <rule>
      <name value="where"/>
      <source>
        <context value="src"/>
        <condition value="src.entry.exists().not()"/>
      </source>
      <rule>
        <name value="cdaText"/>
        <source>
          <context value="src"/>
          <element value="text"/>
          <variable value="cdaText"/>
        </source>
        <target>
          <context value="bundle"/>
          <contextType value="variable"/>
          <element value="entry"/>
          <variable value="e8"/>
        </target>
        <target>
          <context value="e8"/>
          <contextType value="variable"/>
          <element value="request"/>
          <variable value="request"/>
          <transform value="create"/>
          <parameter>
            <valueString value="BackboneElement"/>
          </parameter>
        </target>
        <target>
          <context value="request"/>
          <contextType value="variable"/>
          <element value="method"/>
          <transform value="copy"/>
          <parameter>
            <valueString value="POST"/>
          </parameter>
        </target>
        <target>
          <context value="e8"/>
          <contextType value="variable"/>
          <element value="resource"/>
          <variable value="MedicationAdministration"/>
          <transform value="create"/>
          <parameter>
            <valueString value="MedicationAdministration"/>
          </parameter>
        </target>
        <target>
          <context value="MedicationAdministration"/>
          <contextType value="variable"/>
          <element value="id"/>
          <variable value="uuid8"/>
          <transform value="uuid"/>
        </target>
        <target>
          <context value="e8"/>
          <contextType value="variable"/>
          <element value="fullUrl"/>
          <transform value="append"/>
          <parameter>
            <valueString value="https://example/MedicationAdministration/"/>
          </parameter>
          <parameter>
            <valueId value="uuid8"/>
          </parameter>
        </target>
        <target>
          <context value="request"/>
          <contextType value="variable"/>
          <element value="url"/>
          <transform value="copy"/>
          <parameter>
            <valueString value="MedicationAdministration"/>
          </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/MedicationAdministration/' + %MedicationAdministration.id"/>
          </parameter>
        </target>
        <rule>
          <name value="reference"/>
          <source>
            <context value="src"/>
          </source>
          <target>
            <context value="MedicationAdministration"/>
            <contextType value="variable"/>
            <element value="subject"/>
            <variable value="reference"/>
            <transform value="create"/>
            <parameter>
              <valueString value="Reference"/>
            </parameter>
          </target>
          <target>
            <context value="reference"/>
            <contextType value="variable"/>
            <element value="reference"/>
            <transform value="evaluate"/>
            <parameter>
              <valueString value="'https://example/Patient/' + %patient.id"/>
            </parameter>
          </target>
        </rule>
        <rule>
          <name value="reference"/>
          <source>
            <context value="src"/>
          </source>
          <target>
            <context value="MedicationAdministration"/>
            <contextType value="variable"/>
            <element value="context"/>
            <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="Period"/>
          <source>
            <context value="src"/>
          </source>
          <target>
            <context value="MedicationAdministration"/>
            <contextType value="variable"/>
            <element value="effective"/>
            <variable value="period"/>
            <transform value="create"/>
            <parameter>
              <valueString value="Period"/>
            </parameter>
          </target>
          <rule>
            <name value="low"/>
            <source>
              <context value="src"/>
            </source>
            <target>
              <context value="period"/>
              <contextType value="variable"/>
              <element value="start"/>
              <transform value="evaluate"/>
              <parameter>
                <valueString value="start.now()"/>
              </parameter>
            </target>
          </rule>
          <rule>
            <name value="high"/>
            <source>
              <context value="src"/>
            </source>
            <target>
              <context value="period"/>
              <contextType value="variable"/>
              <element value="end"/>
              <transform value="evaluate"/>
              <parameter>
                <valueString value="end.now()"/>
              </parameter>
            </target>
          </rule>
        </rule>
        <rule>
          <name value="statuscode"/>
          <source>
            <context value="src"/>
            <condition value="sub.statusCode.exists().not()"/>
          </source>
          <rule>
            <name value="status"/>
            <source>
              <context value="src"/>
            </source>
            <target>
              <context value="MedicationAdministration"/>
              <contextType value="variable"/>
              <element value="status"/>
              <transform value="copy"/>
              <parameter>
                <valueString value="completed"/>
              </parameter>
            </target>
          </rule>
        </rule>
        <rule>
          <name value="reference"/>
          <source>
            <context value="cdaText"/>
          </source>
          <target>
            <context value="MedicationAdministration"/>
            <contextType value="variable"/>
            <element value="note"/>
            <variable value="note"/>
          </target>
          <rule>
            <name value="reference"/>
            <source>
              <context value="cdaText"/>
              <variable value="t"/>
            </source>
            <target>
              <context value="note"/>
              <contextType value="variable"/>
              <element value="text"/>
              <transform value="copy"/>
              <parameter>
                <valueId value="t"/>
              </parameter>
            </target>
          </rule>
          <rule>
            <name value="medication"/>
            <source>
              <context value="cdaText"/>
            </source>
            <target>
              <context value="MedicationAdministration"/>
              <contextType value="variable"/>
              <element value="medication"/>
              <variable value="medication"/>
              <transform value="create"/>
              <parameter>
                <valueString value="CodeableConcept"/>
              </parameter>
            </target>
            <rule>
              <name value="text"/>
              <source>
                <context value="cdaText"/>
                <variable value="txt"/>
              </source>
              <target>
                <context value="medication"/>
                <contextType value="variable"/>
                <element value="text"/>
                <transform value="copy"/>
                <parameter>
                  <valueId value="txt"/>
                </parameter>
              </target>
            </rule>
          </rule>
        </rule>
      </rule>
      <documentation
                     value="Sezione Narrativa------------------------------------------------------------------------------------------------------------------------------------------------"/>
    </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="medAdm"/>
        <transform value="create"/>
        <parameter>
          <valueString value="MedicationAdministration"/>
        </parameter>
      </target>
      <target>
        <context value="medAdm"/>
        <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/MedicationAdministration/"/>
        </parameter>
        <parameter>
          <valueId value="uuid1"/>
        </parameter>
      </target>
      <target>
        <context value="request"/>
        <contextType value="variable"/>
        <element value="url"/>
        <transform value="copy"/>
        <parameter>
          <valueString value="MedicationAdministration"/>
        </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/MedicationAdministration/' + %medAdm.id"/>
        </parameter>
      </target>
      <target>
        <context value="medAdm"/>
        <contextType value="variable"/>
        <element value="note"/>
        <variable value="note"/>
      </target>
      <rule>
        <name value="reference"/>
        <source>
          <context value="entry1"/>
        </source>
        <target>
          <context value="medAdm"/>
          <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="entry1"/>
        </source>
        <target>
          <context value="medAdm"/>
          <contextType value="variable"/>
          <element value="context"/>
          <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="MedAdm"/>
        <source>
          <context value="entry1"/>
          <element value="substanceAdministration"/>
          <variable value="sub"/>
        </source>
        <rule>
          <name value="txx"/>
          <source>
            <context value="sub"/>
            <element value="text"/>
            <variable value="tx"/>
          </source>
          <rule>
            <name value="reference"/>
            <source>
              <context value="tx"/>
              <element value="reference"/>
              <variable value="reff"/>
            </source>
            <target>
              <context value="note"/>
              <contextType value="variable"/>
              <element value="text"/>
              <transform value="evaluate"/>
              <parameter>
                <valueString value="reff.value"/>
              </parameter>
            </target>
          </rule>
        </rule>
        <rule>
          <name value="statusCode"/>
          <source>
            <context value="sub"/>
            <element value="statusCode"/>
            <variable value="vvv"/>
          </source>
          <target>
            <context value="medAdm"/>
            <contextType value="variable"/>
            <element value="status"/>
            <variable value="vvv"/>
            <transform value="create"/>
          </target>
        </rule>
        <rule>
          <name value="effectiveTime"/>
          <source>
            <context value="sub"/>
            <element value="effectiveTime"/>
            <variable value="eff"/>
          </source>
          <target>
            <context value="medAdm"/>
            <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>
          <documentation
                         value="sub.effectiveTime: IVL_TS as eff -&gt; medAdm.effective =create('Period') as period then IVLTSPeriod(eff,period); CHECK THIS"/>
        </rule>
        <rule>
          <name value="eff2"/>
          <source>
            <context value="sub"/>
            <type value="PIVL_TS"/>
            <element value="effectiveTime"/>
            <variable value="eff"/>
          </source>
          <target>
            <context value="medAdm"/>
            <contextType value="variable"/>
            <element value="dosage"/>
            <variable value="dosage"/>
          </target>
          <rule>
            <name value="ratio"/>
            <source>
              <context value="eff"/>
            </source>
            <target>
              <context value="dosage"/>
              <contextType value="variable"/>
              <element value="rate"/>
              <variable value="ratio"/>
              <transform value="create"/>
              <parameter>
                <valueString value="Ratio"/>
              </parameter>
            </target>
            <rule>
              <name value="num"/>
              <source>
                <context value="eff"/>
              </source>
              <target>
                <context value="ratio"/>
                <contextType value="variable"/>
                <element value="numerator"/>
                <variable value="num"/>
                <transform value="create"/>
                <parameter>
                  <valueString value="Quantity"/>
                </parameter>
              </target>
              <rule>
                <name value="period"/>
                <source>
                  <context value="eff"/>
                  <element value="period"/>
                  <variable value="per"/>
                </source>
                <target>
                  <context value="num"/>
                  <contextType value="variable"/>
                  <element value="value"/>
                  <transform value="evaluate"/>
                  <parameter>
                    <valueString value="per.value"/>
                  </parameter>
                </target>
              </rule>
              <rule>
                <name value="period"/>
                <source>
                  <context value="eff"/>
                  <element value="period"/>
                  <variable value="per"/>
                </source>
                <target>
                  <context value="num"/>
                  <contextType value="variable"/>
                  <element value="unit"/>
                  <transform value="evaluate"/>
                  <parameter>
                    <valueString value="per.unit"/>
                  </parameter>
                </target>
              </rule>
            </rule>
            <rule>
              <name value="den"/>
              <source>
                <context value="eff"/>
              </source>
              <target>
                <context value="ratio"/>
                <contextType value="variable"/>
                <element value="denominator"/>
                <variable value="num"/>
                <transform value="create"/>
                <parameter>
                  <valueString value="Quantity"/>
                </parameter>
              </target>
              <rule>
                <name value="period"/>
                <source>
                  <context value="eff"/>
                  <element value="period"/>
                  <variable value="per"/>
                </source>
                <target>
                  <context value="num"/>
                  <contextType value="variable"/>
                  <element value="value"/>
                  <transform value="copy"/>
                  <parameter>
                    <valueString value="1"/>
                  </parameter>
                </target>
              </rule>
              <rule>
                <name value="period"/>
                <source>
                  <context value="eff"/>
                  <element value="period"/>
                  <variable value="per"/>
                </source>
                <target>
                  <context value="num"/>
                  <contextType value="variable"/>
                  <element value="unit"/>
                  <transform value="evaluate"/>
                  <parameter>
                    <valueString value="per.unit"/>
                  </parameter>
                </target>
              </rule>
            </rule>
          </rule>
        </rule>
        <rule>
          <name value="route"/>
          <source>
            <context value="sub"/>
          </source>
          <target>
            <context value="medAdm"/>
            <contextType value="variable"/>
            <element value="dosage"/>
            <variable value="dosage"/>
          </target>
          <rule>
            <name value="routeCode"/>
            <source>
              <context value="sub"/>
              <element value="routeCode"/>
              <variable value="vvv"/>
            </source>
            <target>
              <context value="dosage"/>
              <contextType value="variable"/>
              <element value="route"/>
              <variable value="vvv"/>
              <transform value="create"/>
            </target>
          </rule>
        </rule>
        <rule>
          <name value="route"/>
          <source>
            <context value="sub"/>
          </source>
          <target>
            <context value="medAdm"/>
            <contextType value="variable"/>
            <element value="dosage"/>
            <variable value="dosage"/>
          </target>
          <rule>
            <name value="approachSiteCode"/>
            <source>
              <context value="sub"/>
              <element value="approachSiteCode"/>
              <variable value="vvv"/>
            </source>
            <target>
              <context value="dosage"/>
              <contextType value="variable"/>
              <element value="site"/>
              <variable value="vvv"/>
              <transform value="create"/>
            </target>
          </rule>
        </rule>
        <rule>
          <name value="medicationRequest"/>
          <source>
            <context value="sub"/>
          </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="medRq"/>
            <transform value="create"/>
            <parameter>
              <valueString value="MedicationRequest"/>
            </parameter>
          </target>
          <target>
            <context value="medRq"/>
            <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/MedicationRequest/"/>
            </parameter>
            <parameter>
              <valueId value="uuid1"/>
            </parameter>
          </target>
          <target>
            <context value="request"/>
            <contextType value="variable"/>
            <element value="url"/>
            <transform value="copy"/>
            <parameter>
              <valueString value="MedicationRequest"/>
            </parameter>
          </target>
          <target>
            <context value="medAdm"/>
            <contextType value="variable"/>
            <element value="request"/>
            <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/MedicationRequest/' + %medRq.id"/>
            </parameter>
          </target>
          <rule>
            <name value="rel"/>
            <source>
              <context value="sub"/>
              <element value="entryRelationship"/>
              <variable value="rel"/>
            </source>
            <rule>
              <name value="obs"/>
              <source>
                <context value="rel"/>
                <element value="supply"/>
                <variable value="supl"/>
              </source>
              <target>
                <context value="medRq"/>
                <contextType value="variable"/>
                <element value="dispenseRequest"/>
                <variable value="disp"/>
                <transform value="create"/>
                <parameter>
                  <valueString value="BackboneElement"/>
                </parameter>
              </target>
              <rule>
                <name value="SimpleQuantity"/>
                <source>
                  <context value="supl"/>
                </source>
                <target>
                  <context value="disp"/>
                  <contextType value="variable"/>
                  <element value="quantity"/>
                  <variable value="q"/>
                  <transform value="create"/>
                  <parameter>
                    <valueString value="SimpleQuantity"/>
                  </parameter>
                </target>
                <rule>
                  <name value="fds"/>
                  <source>
                    <context value="supl"/>
                    <element value="quantity"/>
                    <variable value="qua"/>
                  </source>
                  <target>
                    <context value="q"/>
                    <contextType value="variable"/>
                    <element value="value"/>
                    <transform value="evaluate"/>
                    <parameter>
                      <valueString value="qua.value"/>
                    </parameter>
                  </target>
                </rule>
              </rule>
            </rule>
          </rule>
          <rule>
            <name value="reference"/>
            <source>
              <context value="sub"/>
            </source>
            <target>
              <context value="medRq"/>
              <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="sub"/>
            </source>
            <target>
              <context value="medRq"/>
              <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="status"/>
            <source>
              <context value="sub"/>
            </source>
            <target>
              <context value="medRq"/>
              <contextType value="variable"/>
              <element value="status"/>
              <transform value="copy"/>
              <parameter>
                <valueString value="active"/>
              </parameter>
            </target>
          </rule>
          <rule>
            <name value="intent"/>
            <source>
              <context value="sub"/>
            </source>
            <target>
              <context value="medRq"/>
              <contextType value="variable"/>
              <element value="intent"/>
              <transform value="copy"/>
              <parameter>
                <valueString value="order"/>
              </parameter>
            </target>
          </rule>
          <rule>
            <name value="code"/>
            <source>
              <context value="sub"/>
            </source>
            <target>
              <context value="medRq"/>
              <contextType value="variable"/>
              <element value="medication"/>
              <variable value="cod"/>
              <transform value="create"/>
              <parameter>
                <valueString value="CodeableConcept"/>
              </parameter>
            </target>
            <rule>
              <name value="Medi"/>
              <source>
                <context value="sub"/>
              </source>
              <target>
                <context value="cod"/>
                <contextType value="variable"/>
                <element value="text"/>
                <transform value="copy"/>
                <parameter>
                  <valueString value="medication"/>
                </parameter>
              </target>
            </rule>
          </rule>
          <rule>
            <name value="dose-quantity"/>
            <source>
              <context value="sub"/>
              <element value="doseQuantity"/>
              <variable value="quantity"/>
            </source>
            <rule>
              <name value="dosage"/>
              <source>
                <context value="quantity"/>
              </source>
              <target>
                <context value="medRq"/>
                <contextType value="variable"/>
                <element value="dosageInstruction"/>
                <variable value="dosage"/>
                <transform value="create"/>
                <parameter>
                  <valueString value="Dosage"/>
                </parameter>
              </target>
              <rule>
                <name value="dos"/>
                <source>
                  <context value="quantity"/>
                </source>
                <target>
                  <context value="dosage"/>
                  <contextType value="variable"/>
                  <element value="doseAndRate"/>
                  <variable value="dosRange"/>
                </target>
                <rule>
                  <name value="range"/>
                  <source>
                    <context value="quantity"/>
                  </source>
                  <target>
                    <context value="dosRange"/>
                    <contextType value="variable"/>
                    <element value="dose"/>
                    <variable value="range"/>
                    <transform value="create"/>
                    <parameter>
                      <valueString value="Range"/>
                    </parameter>
                  </target>
                  <rule>
                    <name value="low"/>
                    <source>
                      <context value="quantity"/>
                    </source>
                    <target>
                      <context value="range"/>
                      <contextType value="variable"/>
                      <element value="low"/>
                      <variable value="quant"/>
                      <transform value="create"/>
                      <parameter>
                        <valueString value="SimpleQuantity"/>
                      </parameter>
                    </target>
                    <rule>
                      <name value="v1"/>
                      <source>
                        <context value="quantity"/>
                        <element value="low"/>
                        <variable value="l"/>
                      </source>
                      <target>
                        <context value="quant"/>
                        <contextType value="variable"/>
                        <element value="value"/>
                        <transform value="evaluate"/>
                        <parameter>
                          <valueString value="l.value"/>
                        </parameter>
                      </target>
                    </rule>
                    <rule>
                      <name value="v1"/>
                      <source>
                        <context value="quantity"/>
                        <element value="low"/>
                        <variable value="l"/>
                      </source>
                      <target>
                        <context value="quant"/>
                        <contextType value="variable"/>
                        <element value="unit"/>
                        <transform value="evaluate"/>
                        <parameter>
                          <valueString value="l.unit"/>
                        </parameter>
                      </target>
                    </rule>
                  </rule>
                  <rule>
                    <name value="high"/>
                    <source>
                      <context value="quantity"/>
                    </source>
                    <target>
                      <context value="range"/>
                      <contextType value="variable"/>
                      <element value="high"/>
                      <variable value="quant"/>
                      <transform value="create"/>
                      <parameter>
                        <valueString value="SimpleQuantity"/>
                      </parameter>
                    </target>
                    <rule>
                      <name value="v1"/>
                      <source>
                        <context value="quantity"/>
                        <element value="high"/>
                        <variable value="h"/>
                      </source>
                      <target>
                        <context value="quant"/>
                        <contextType value="variable"/>
                        <element value="value"/>
                        <transform value="evaluate"/>
                        <parameter>
                          <valueString value="h.value"/>
                        </parameter>
                      </target>
                    </rule>
                    <rule>
                      <name value="v1"/>
                      <source>
                        <context value="quantity"/>
                        <element value="high"/>
                        <variable value="h"/>
                      </source>
                      <target>
                        <context value="quant"/>
                        <contextType value="variable"/>
                        <element value="unit"/>
                        <transform value="evaluate"/>
                        <parameter>
                          <valueString value="h.unit"/>
                        </parameter>
                      </target>
                    </rule>
                  </rule>
                </rule>
              </rule>
            </rule>
          </rule>
          <rule>
            <name value="Rate-quantity"/>
            <source>
              <context value="sub"/>
              <element value="rateQuantity"/>
              <variable value="rate"/>
            </source>
            <rule>
              <name value="dosage"/>
              <source>
                <context value="rate"/>
              </source>
              <target>
                <context value="medRq"/>
                <contextType value="variable"/>
                <element value="dosageInstruction"/>
                <variable value="dosage"/>
                <transform value="create"/>
                <parameter>
                  <valueString value="Dosage"/>
                </parameter>
              </target>
              <rule>
                <name value="dos"/>
                <source>
                  <context value="rate"/>
                </source>
                <target>
                  <context value="dosage"/>
                  <contextType value="variable"/>
                  <element value="doseAndRate"/>
                  <variable value="dosRange"/>
                </target>
                <rule>
                  <name value="range"/>
                  <source>
                    <context value="rate"/>
                  </source>
                  <target>
                    <context value="dosRange"/>
                    <contextType value="variable"/>
                    <element value="dose"/>
                    <variable value="range"/>
                    <transform value="create"/>
                    <parameter>
                      <valueString value="Range"/>
                    </parameter>
                  </target>
                  <rule>
                    <name value="low"/>
                    <source>
                      <context value="rate"/>
                    </source>
                    <target>
                      <context value="range"/>
                      <contextType value="variable"/>
                      <element value="low"/>
                      <variable value="quant"/>
                      <transform value="create"/>
                      <parameter>
                        <valueString value="SimpleQuantity"/>
                      </parameter>
                    </target>
                    <rule>
                      <name value="v1"/>
                      <source>
                        <context value="rate"/>
                        <element value="low"/>
                        <variable value="l"/>
                      </source>
                      <target>
                        <context value="quant"/>
                        <contextType value="variable"/>
                        <element value="value"/>
                        <transform value="evaluate"/>
                        <parameter>
                          <valueString value="l.value"/>
                        </parameter>
                      </target>
                    </rule>
                    <rule>
                      <name value="v1"/>
                      <source>
                        <context value="rate"/>
                        <element value="low"/>
                        <variable value="l"/>
                      </source>
                      <target>
                        <context value="quant"/>
                        <contextType value="variable"/>
                        <element value="unit"/>
                        <transform value="evaluate"/>
                        <parameter>
                          <valueString value="l.unit"/>
                        </parameter>
                      </target>
                    </rule>
                  </rule>
                  <rule>
                    <name value="high"/>
                    <source>
                      <context value="rate"/>
                    </source>
                    <target>
                      <context value="range"/>
                      <contextType value="variable"/>
                      <element value="high"/>
                      <variable value="quant"/>
                      <transform value="create"/>
                      <parameter>
                        <valueString value="SimpleQuantity"/>
                      </parameter>
                    </target>
                    <rule>
                      <name value="v1"/>
                      <source>
                        <context value="rate"/>
                        <element value="high"/>
                        <variable value="h"/>
                      </source>
                      <target>
                        <context value="quant"/>
                        <contextType value="variable"/>
                        <element value="value"/>
                        <transform value="evaluate"/>
                        <parameter>
                          <valueString value="h.value"/>
                        </parameter>
                      </target>
                    </rule>
                    <rule>
                      <name value="v1"/>
                      <source>
                        <context value="rate"/>
                        <element value="high"/>
                        <variable value="h"/>
                      </source>
                      <target>
                        <context value="quant"/>
                        <contextType value="variable"/>
                        <element value="unit"/>
                        <transform value="evaluate"/>
                        <parameter>
                          <valueString value="h.unit"/>
                        </parameter>
                      </target>
                    </rule>
                  </rule>
                </rule>
              </rule>
            </rule>
          </rule>
          <rule>
            <name value="part"/>
            <source>
              <context value="sub"/>
              <element value="participant"/>
              <variable value="part"/>
            </source>
            <rule>
              <name value="time"/>
              <source>
                <context value="part"/>
                <element value="time"/>
                <variable value="t"/>
              </source>
              <target>
                <context value="medRq"/>
                <contextType value="variable"/>
                <element value="authoredOn"/>
                <variable value="date"/>
                <transform value="create"/>
                <parameter>
                  <valueString value="dateTime"/>
                </parameter>
              </target>
              <dependent>
                <name value="TSDateTime"/>
                <variable value="t"/>
                <variable value="date"/>
              </dependent>
            </rule>
            <rule>
              <name value="Part"/>
              <source>
                <context value="part"/>
                <element value="participantRole"/>
                <variable value="partRole"/>
              </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="PUT"/>
                </parameter>
              </target>
              <target>
                <context value="e1"/>
                <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="uuid1"/>
                <transform value="uuid"/>
              </target>
              <target>
                <context value="e1"/>
                <contextType value="variable"/>
                <element value="fullUrl"/>
                <transform value="append"/>
                <parameter>
                  <valueString value="https://example/Practitioner/"/>
                </parameter>
                <parameter>
                  <valueId value="uuid1"/>
                </parameter>
              </target>
              <target>
                <context value="request"/>
                <contextType value="variable"/>
                <element value="url"/>
                <transform value="append"/>
                <parameter>
                  <valueString value="Practitioner/"/>
                </parameter>
                <parameter>
                  <valueId value="uuid1"/>
                </parameter>
              </target>
              <rule>
                <name value="meta"/>
                <source>
                  <context value="partRole"/>
                </source>
                <target>
                  <context value="practitioner"/>
                  <contextType value="variable"/>
                  <element value="meta"/>
                  <variable value="meta"/>
                </target>
                <rule>
                  <name value="coding"/>
                  <source>
                    <context value="partRole"/>
                  </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="partRole"/>
                    </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="partRole"/>
                    </source>
                    <target>
                      <context value="coding"/>
                      <contextType value="variable"/>
                      <element value="code"/>
                      <transform value="copy"/>
                      <parameter>
                        <valueString
                                     value="ClinicalDocument/body/TerapiaFarmacologicaPS/participant"/>
                      </parameter>
                    </target>
                  </rule>
                </rule>
                <documentation value="inizio meta+identifier"/>
              </rule>
              <rule>
                <name value="identifier"/>
                <source>
                  <context value="partRole"/>
                  <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="extension"/>
                  <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>
                <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="e1"/>
                      <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="request"/>
                      <contextType value="variable"/>
                      <element value="url"/>
                      <transform value="append"/>
                      <parameter>
                        <valueString value="Practitioner/"/>
                      </parameter>
                      <parameter>
                        <valueId value="uuid2"/>
                      </parameter>
                    </target>
                    <target>
                      <context value="medRq"/>
                      <contextType value="variable"/>
                      <element value="requester"/>
                      <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="partRole"/>
                  <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="id"/>
                <source>
                  <context value="partRole"/>
                  <element value="id"/>
                  <variable value="vvv"/>
                </source>
                <target>
                  <context value="practitioner"/>
                  <contextType value="variable"/>
                  <element value="identifier"/>
                  <variable value="vvv"/>
                  <transform value="create"/>
                </target>
                <documentation value="fine modifiche"/>
              </rule>
              <rule>
                <name value="play"/>
                <source>
                  <context value="partRole"/>
                  <element value="playingEntity"/>
                  <variable value="play"/>
                </source>
                <rule>
                  <name value="name"/>
                  <source>
                    <context value="play"/>
                    <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>
          <name value="med"/>
          <source>
            <context value="sub"/>
          </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="med"/>
            <transform value="create"/>
            <parameter>
              <valueString value="Medication"/>
            </parameter>
          </target>
          <target>
            <context value="med"/>
            <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/Medication/"/>
            </parameter>
            <parameter>
              <valueId value="uuid1"/>
            </parameter>
          </target>
          <target>
            <context value="request"/>
            <contextType value="variable"/>
            <element value="url"/>
            <transform value="copy"/>
            <parameter>
              <valueString value="Medication"/>
            </parameter>
          </target>
          <target>
            <context value="medAdm"/>
            <contextType value="variable"/>
            <element value="medication"/>
            <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/Medication/' + %med.id"/>
            </parameter>
          </target>
          <rule>
            <name value="unicode"/>
            <source>
              <context value="sub"/>
              <element value="administrationUnitCode"/>
              <variable value="adduni"/>
            </source>
            <rule>
              <name value="administrationUnitCode"/>
              <source>
                <context value="sub"/>
                <element value="administrationUnitCode"/>
                <variable value="vvv"/>
              </source>
              <target>
                <context value="med"/>
                <contextType value="variable"/>
                <element value="form"/>
                <variable value="vvv"/>
                <transform value="create"/>
              </target>
            </rule>
            <rule>
              <name value="consum"/>
              <source>
                <context value="sub"/>
                <element value="consumable"/>
                <variable value="consum"/>
              </source>
              <rule>
                <name value="manuMat"/>
                <source>
                  <context value="consum"/>
                  <element value="manufacturedProduct"/>
                  <variable value="manuProd"/>
                </source>
                <rule>
                  <name value="manuMat"/>
                  <source>
                    <context value="manuProd"/>
                    <element value="manufacturedMaterial"/>
                    <variable value="manuMt"/>
                  </source>
                  <rule>
                    <name value="code"/>
                    <source>
                      <context value="manuMt"/>
                      <element value="code"/>
                      <variable value="vvv"/>
                    </source>
                    <target>
                      <context value="med"/>
                      <contextType value="variable"/>
                      <element value="code"/>
                      <variable value="vvv"/>
                      <transform value="create"/>
                    </target>
                  </rule>
                </rule>
              </rule>
            </rule>
          </rule>
          <rule>
            <name value="entry-R"/>
            <source>
              <context value="sub"/>
              <element value="entryRelationship"/>
              <variable value="entryR"/>
            </source>
            <rule>
              <name value="obs"/>
              <source>
                <context value="entryR"/>
                <element value="observation"/>
                <variable value="observation"/>
              </source>
              <rule>
                <name value="ingredient"/>
                <source>
                  <context value="observation"/>
                  <element value="code"/>
                  <condition value="displayName = 'Grammatura'"/>
                </source>
                <target>
                  <context value="med"/>
                  <contextType value="variable"/>
                  <element value="ingredient"/>
                  <variable value="ingredient"/>
                </target>
                <rule>
                  <name value="consumable"/>
                  <source>
                    <context value="sub"/>
                    <element value="consumable"/>
                    <variable value="consumable"/>
                  </source>
                  <rule>
                    <name value="product"/>
                    <source>
                      <context value="consumable"/>
                      <element value="manufacturedProduct"/>
                      <variable value="manufacturedProduct"/>
                    </source>
                    <rule>
                      <name value="material"/>
                      <source>
                        <context value="manufacturedProduct"/>
                        <element value="manufacturedMaterial"/>
                        <variable value="manufacturedMaterial"/>
                      </source>
                      <rule>
                        <name value="CE"/>
                        <source>
                          <context value="manufacturedMaterial"/>
                          <element value="code"/>
                          <variable value="code"/>
                        </source>
                        <target>
                          <context value="ingredient"/>
                          <contextType value="variable"/>
                          <element value="item"/>
                          <variable value="value"/>
                          <transform value="create"/>
                          <parameter>
                            <valueString value="CodeableConcept"/>
                          </parameter>
                        </target>
                        <dependent>
                          <name value="CECodeableConcept"/>
                          <variable value="code"/>
                          <variable value="value"/>
                        </dependent>
                      </rule>
                    </rule>
                  </rule>
                </rule>
                <rule>
                  <name value="strenght"/>
                  <source>
                    <context value="observation"/>
                    <element value="value"/>
                    <variable value="value"/>
                  </source>
                  <target>
                    <context value="ingredient"/>
                    <contextType value="variable"/>
                    <element value="strength"/>
                    <variable value="strength"/>
                  </target>
                  <rule>
                    <name value="numerator"/>
                    <source>
                      <context value="value"/>
                    </source>
                    <target>
                      <context value="strength"/>
                      <contextType value="variable"/>
                      <element value="numerator"/>
                      <variable value="numerator"/>
                    </target>
                    <rule>
                      <name value="valueN"/>
                      <source>
                        <context value="value"/>
                      </source>
                      <target>
                        <context value="numerator"/>
                        <contextType value="variable"/>
                        <element value="value"/>
                        <transform value="evaluate"/>
                        <parameter>
                          <valueString value="value.value"/>
                        </parameter>
                      </target>
                    </rule>
                  </rule>
                  <rule>
                    <name value="denominator"/>
                    <source>
                      <context value="value"/>
                    </source>
                    <target>
                      <context value="strength"/>
                      <contextType value="variable"/>
                      <element value="denominator"/>
                      <variable value="denominator"/>
                    </target>
                    <rule>
                      <name value="valueD"/>
                      <source>
                        <context value="value"/>
                      </source>
                      <target>
                        <context value="denominator"/>
                        <contextType value="variable"/>
                        <element value="value"/>
                        <transform value="copy"/>
                        <parameter>
                          <valueInteger value="1"/>
                        </parameter>
                      </target>
                    </rule>
                  </rule>
                </rule>
              </rule>
              <rule>
                <name value="quantita"/>
                <source>
                  <context value="observation"/>
                  <element value="code"/>
                  <condition
                             value="displayName = 'Quantità nella Confezione'"/>
                </source>
                <rule>
                  <name value="amount"/>
                  <source>
                    <context value="observation"/>
                    <element value="value"/>
                    <variable value="value"/>
                  </source>
                  <target>
                    <context value="med"/>
                    <contextType value="variable"/>
                    <element value="amount"/>
                    <variable value="amount"/>
                  </target>
                  <rule>
                    <name value="numerator"/>
                    <source>
                      <context value="value"/>
                    </source>
                    <target>
                      <context value="amount"/>
                      <contextType value="variable"/>
                      <element value="numerator"/>
                      <variable value="numerator"/>
                    </target>
                    <rule>
                      <name value="valueN"/>
                      <source>
                        <context value="value"/>
                      </source>
                      <target>
                        <context value="numerator"/>
                        <contextType value="variable"/>
                        <element value="value"/>
                        <transform value="evaluate"/>
                        <parameter>
                          <valueString value="value.value"/>
                        </parameter>
                      </target>
                    </rule>
                  </rule>
                  <rule>
                    <name value="denominator"/>
                    <source>
                      <context value="value"/>
                    </source>
                    <target>
                      <context value="amount"/>
                      <contextType value="variable"/>
                      <element value="denominator"/>
                      <variable value="denominator"/>
                    </target>
                    <rule>
                      <name value="valueD"/>
                      <source>
                        <context value="value"/>
                      </source>
                      <target>
                        <context value="denominator"/>
                        <contextType value="variable"/>
                        <element value="value"/>
                        <transform value="copy"/>
                        <parameter>
                          <valueInteger value="1"/>
                        </parameter>
                      </target>
                    </rule>
                  </rule>
                </rule>
              </rule>
            </rule>
          </rule>
        </rule>
        <rule>
          <name value="perform"/>
          <source>
            <context value="sub"/>
            <element value="performer"/>
            <variable value="perf"/>
          </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="PUT"/>
            </parameter>
          </target>
          <target>
            <context value="e1"/>
            <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="uuid1"/>
            <transform value="uuid"/>
          </target>
          <target>
            <context value="e1"/>
            <contextType value="variable"/>
            <element value="fullUrl"/>
            <transform value="append"/>
            <parameter>
              <valueString value="https://example/Practitioner/"/>
            </parameter>
            <parameter>
              <valueId value="uuid1"/>
            </parameter>
          </target>
          <target>
            <context value="request"/>
            <contextType value="variable"/>
            <element value="url"/>
            <transform value="append"/>
            <parameter>
              <valueString value="Practitioner/"/>
            </parameter>
            <parameter>
              <valueId value="uuid1"/>
            </parameter>
          </target>
          <rule>
            <name value="preftime"/>
            <source>
              <context value="perf"/>
            </source>
            <target>
              <context value="medAdm"/>
              <contextType value="variable"/>
              <element value="note"/>
              <variable value="note"/>
            </target>
            <rule>
              <name value="notaa"/>
              <source>
                <context value="perf"/>
              </source>
              <target>
                <context value="note"/>
                <contextType value="variable"/>
                <element value="text"/>
                <transform value="copy"/>
                <parameter>
                  <valueString value="performertime"/>
                </parameter>
              </target>
            </rule>
            <rule>
              <name value="notetime"/>
              <source>
                <context value="perf"/>
                <element value="time"/>
                <variable value="t"/>
              </source>
              <target>
                <context value="note"/>
                <contextType value="variable"/>
                <element value="time"/>
                <variable value="value"/>
                <transform value="create"/>
                <parameter>
                  <valueString value="dateTime"/>
                </parameter>
              </target>
              <dependent>
                <name value="TSDateTime"/>
                <variable value="t"/>
                <variable value="value"/>
              </dependent>
            </rule>
          </rule>
          <rule>
            <name value="ent"/>
            <source>
              <context value="perf"/>
              <element value="assignedEntity"/>
              <variable value="ent"/>
            </source>
            <rule>
              <name value="meta"/>
              <source>
                <context value="ent"/>
              </source>
              <target>
                <context value="practitioner"/>
                <contextType value="variable"/>
                <element value="meta"/>
                <variable value="meta"/>
              </target>
              <rule>
                <name value="coding"/>
                <source>
                  <context value="ent"/>
                </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="ent"/>
                  </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="ent"/>
                  </source>
                  <target>
                    <context value="coding"/>
                    <contextType value="variable"/>
                    <element value="code"/>
                    <transform value="copy"/>
                    <parameter>
                      <valueString
                                   value="ClinicalDocument/body/TerapiaFarmacologicaPS/performer"/>
                    </parameter>
                  </target>
                </rule>
              </rule>
              <documentation value="inizio modifica meta+identifier"/>
            </rule>
            <rule>
              <name value="identifier"/>
              <source>
                <context value="ent"/>
                <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="extension"/>
                <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>
              <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="e1"/>
                    <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="request"/>
                    <contextType value="variable"/>
                    <element value="url"/>
                    <transform value="append"/>
                    <parameter>
                      <valueString value="Practitioner/"/>
                    </parameter>
                    <parameter>
                      <valueId value="uuid2"/>
                    </parameter>
                  </target>
                  <target>
                    <context value="medAdm"/>
                    <contextType value="variable"/>
                    <element value="performer"/>
                    <variable value="p"/>
                  </target>
                  <target>
                    <context value="p"/>
                    <contextType value="variable"/>
                    <element value="actor"/>
                    <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="ent"/>
                <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="assperson"/>
              <source>
                <context value="ent"/>
                <element value="assignedPerson"/>
                <variable value="assPerson"/>
              </source>
              <rule>
                <name value="name"/>
                <source>
                  <context value="assPerson"/>
                  <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>
              <documentation value="fine modifica"/>
            </rule>
          </rule>
        </rule>
      </rule>
      <documentation
                     value="Sezione Strutturata-------------------------------------------------------------------------------------------------------------------------------------------------"/>
    </rule>
  </group>
  <group>
    <name value="ClinicalDocumentSectionPianoCuraDimissione"/>
    <typeMode value="none"/>
    <documentation
                   value="------------------------------------------------------------------------------------------------------------------
-"/>
    <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>
    <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="entryident3"/>
      <source>
        <context value="src"/>
        <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="careplan"/>
        <transform value="create"/>
        <parameter>
          <valueString value="CarePlan"/>
        </parameter>
      </target>
      <target>
        <context value="careplan"/>
        <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/CarePlan/"/>
        </parameter>
        <parameter>
          <valueId value="uuid1"/>
        </parameter>
      </target>
      <target>
        <context value="request"/>
        <contextType value="variable"/>
        <element value="url"/>
        <transform value="copy"/>
        <parameter>
          <valueString value="CarePlan"/>
        </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/CarePlan/' + %careplan.id"/>
        </parameter>
      </target>
      <rule>
        <name value="reference"/>
        <source>
          <context value="src"/>
        </source>
        <target>
          <context value="careplan"/>
          <contextType value="variable"/>
          <element value="subject"/>
          <variable value="reference"/>
          <transform value="create"/>
          <parameter>
            <valueString value="Reference"/>
          </parameter>
        </target>
        <target>
          <context value="reference"/>
          <contextType value="variable"/>
          <element value="reference"/>
          <transform value="evaluate"/>
          <parameter>
            <valueString value="'https://example/Patient/' + %patient.id"/>
          </parameter>
        </target>
      </rule>
      <rule>
        <name value="reference"/>
        <source>
          <context value="src"/>
        </source>
        <target>
          <context value="careplan"/>
          <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="status"/>
        <source>
          <context value="src"/>
        </source>
        <target>
          <context value="careplan"/>
          <contextType value="variable"/>
          <element value="status"/>
          <transform value="copy"/>
          <parameter>
            <valueString value="active"/>
          </parameter>
        </target>
      </rule>
      <rule>
        <name value="intent"/>
        <source>
          <context value="src"/>
        </source>
        <target>
          <context value="careplan"/>
          <contextType value="variable"/>
          <element value="intent"/>
          <transform value="copy"/>
          <parameter>
            <valueString value="order"/>
          </parameter>
        </target>
      </rule>
      <rule>
        <name value="author"/>
        <source>
          <context value="src"/>
          <element value="text"/>
          <variable value="cdaText"/>
        </source>
        <target>
          <context value="careplan"/>
          <contextType value="variable"/>
          <element value="note"/>
          <variable value="carenote"/>
        </target>
        <rule>
          <name value="notetxt"/>
          <source>
            <context value="cdaText"/>
            <variable value="t"/>
          </source>
          <target>
            <context value="carenote"/>
            <contextType value="variable"/>
            <element value="text"/>
            <transform value="copy"/>
            <parameter>
              <valueId value="t"/>
            </parameter>
          </target>
        </rule>
        <rule>
          <name value="CFauthor"/>
          <source>
            <context value="entry1"/>
            <element value="author"/>
            <variable value="author"/>
          </source>
          <rule>
            <name value="notetime"/>
            <source>
              <context value="author"/>
              <element value="time"/>
              <variable value="t"/>
            </source>
            <target>
              <context value="carenote"/>
              <contextType value="variable"/>
              <element value="time"/>
              <variable value="value"/>
              <transform value="create"/>
              <parameter>
                <valueString value="dateTime"/>
              </parameter>
            </target>
            <dependent>
              <name value="TSDateTime"/>
              <variable value="t"/>
              <variable value="value"/>
            </dependent>
          </rule>
          <rule>
            <name value="authpract"/>
            <source>
              <context value="author"/>
              <element value="assignedAuthor"/>
              <variable value="assauthor"/>
            </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="PUT"/>
              </parameter>
            </target>
            <target>
              <context value="e1"/>
              <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="uuid1"/>
              <transform value="uuid"/>
            </target>
            <target>
              <context value="e1"/>
              <contextType value="variable"/>
              <element value="fullUrl"/>
              <transform value="append"/>
              <parameter>
                <valueString value="https://example/Practitioner/"/>
              </parameter>
              <parameter>
                <valueId value="uuid1"/>
              </parameter>
            </target>
            <target>
              <context value="request"/>
              <contextType value="variable"/>
              <element value="url"/>
              <transform value="append"/>
              <parameter>
                <valueString value="Practitioner/"/>
              </parameter>
              <parameter>
                <valueId value="uuid1"/>
              </parameter>
            </target>
            <rule>
              <name value="meta"/>
              <source>
                <context value="assauthor"/>
              </source>
              <target>
                <context value="practitioner"/>
                <contextType value="variable"/>
                <element value="meta"/>
                <variable value="meta"/>
              </target>
              <rule>
                <name value="coding"/>
                <source>
                  <context value="assauthor"/>
                </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="assauthor"/>
                  </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="assauthor"/>
                  </source>
                  <target>
                    <context value="coding"/>
                    <contextType value="variable"/>
                    <element value="code"/>
                    <transform value="copy"/>
                    <parameter>
                      <valueString
                                   value="ClinicalDocument/body/PianoCuraDimissione/author"/>
                    </parameter>
                  </target>
                </rule>
              </rule>
              <documentation value="inizio modifica meta+identifier"/>
            </rule>
            <rule>
              <name value="identifier"/>
              <source>
                <context value="assauthor"/>
                <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="extension"/>
                <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>
              <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="e1"/>
                    <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="request"/>
                    <contextType value="variable"/>
                    <element value="url"/>
                    <transform value="append"/>
                    <parameter>
                      <valueString value="Practitioner/"/>
                    </parameter>
                    <parameter>
                      <valueId value="uuid2"/>
                    </parameter>
                  </target>
                  <target>
                    <context value="carenote"/>
                    <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/Practitioner/' + %practitioner.id"/>
                    </parameter>
                  </target>
                </rule>
              </rule>
            </rule>
            <rule>
              <name value="2.16.840.1.113883.2.9.4.3.2"/>
              <source>
                <context value="assauthor"/>
                <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="namepers"/>
              <source>
                <context value="assauthor"/>
                <element value="assignedPerson"/>
                <variable value="pers"/>
              </source>
              <rule>
                <name value="name"/>
                <source>
                  <context value="pers"/>
                  <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>
              <documentation value="fine modifica"/>
            </rule>
          </rule>
        </rule>
      </rule>
      <rule>
        <name value="entry1"/>
        <source>
          <context value="entry1"/>
          <element value="entry"/>
          <variable value="entry2"/>
        </source>
        <rule>
          <name value="carnote"/>
          <source>
            <context value="entry2"/>
            <element value="act"/>
            <variable value="entryact"/>
          </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="servicerequest"/>
            <transform value="create"/>
            <parameter>
              <valueString value="ServiceRequest"/>
            </parameter>
          </target>
          <target>
            <context value="servicerequest"/>
            <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/ServiceRequest/"/>
            </parameter>
            <parameter>
              <valueId value="uuid1"/>
            </parameter>
          </target>
          <target>
            <context value="request"/>
            <contextType value="variable"/>
            <element value="url"/>
            <transform value="copy"/>
            <parameter>
              <valueString value="ServiceRequest"/>
            </parameter>
          </target>
          <target>
            <context value="careplan"/>
            <contextType value="variable"/>
            <element value="activity"/>
            <variable value="activ"/>
            <transform value="create"/>
            <parameter>
              <valueString value="BackboneElement"/>
            </parameter>
          </target>
          <target>
            <context value="activ"/>
            <contextType value="variable"/>
            <element value="reference"/>
            <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/ServiceRequest/' + %servicerequest.id"/>
            </parameter>
          </target>
          <rule>
            <name value="reference"/>
            <source>
              <context value="entryact"/>
            </source>
            <target>
              <context value="servicerequest"/>
              <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="entryact"/>
            </source>
            <target>
              <context value="servicerequest"/>
              <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="status"/>
            <source>
              <context value="entryact"/>
            </source>
            <target>
              <context value="servicerequest"/>
              <contextType value="variable"/>
              <element value="status"/>
              <transform value="copy"/>
              <parameter>
                <valueString value="active"/>
              </parameter>
            </target>
          </rule>
          <rule>
            <name value="intent"/>
            <source>
              <context value="entryact"/>
            </source>
            <target>
              <context value="servicerequest"/>
              <contextType value="variable"/>
              <element value="intent"/>
              <transform value="copy"/>
              <parameter>
                <valueString value="order"/>
              </parameter>
            </target>
          </rule>
          <rule>
            <name value="entry2"/>
            <source>
              <context value="entryact"/>
            </source>
            <target>
              <context value="servicerequest"/>
              <contextType value="variable"/>
              <element value="identifier"/>
              <variable value="identif"/>
              <transform value="create"/>
              <parameter>
                <valueString value="BackboneElement"/>
              </parameter>
            </target>
            <rule>
              <name value="jarilemes"/>
              <source>
                <context value="entryact"/>
                <element value="reference"/>
                <variable value="actref"/>
              </source>
              <rule>
                <name value="actref"/>
                <source>
                  <context value="actref"/>
                  <element value="externalAct"/>
                  <variable value="extact"/>
                </source>
                <rule>
                  <name value="extact"/>
                  <source>
                    <context value="extact"/>
                  </source>
                  <target>
                    <context value="servicerequest"/>
                    <contextType value="variable"/>
                    <element value="identifier"/>
                    <variable value="identif3"/>
                    <transform value="create"/>
                    <parameter>
                      <valueString value="BackboneElement"/>
                    </parameter>
                  </target>
                  <rule>
                    <name value="idnetn"/>
                    <source>
                      <context value="extact"/>
                      <element value="id"/>
                      <variable value="id"/>
                    </source>
                    <rule>
                      <name value="root1"/>
                      <source>
                        <context value="id"/>
                        <element value="root"/>
                        <variable value="r"/>
                      </source>
                      <target>
                        <context value="identif3"/>
                        <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="identif3"/>
                        <contextType value="variable"/>
                        <element value="value"/>
                        <transform value="copy"/>
                        <parameter>
                          <valueId value="ext"/>
                        </parameter>
                      </target>
                      <rule>
                        <name value="assigningAuthorityName"/>
                        <source>
                          <context value="id"/>
                          <element value="assigningAuthorityName"/>
                          <variable value="s"/>
                        </source>
                        <target>
                          <context value="identif3"/>
                          <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>
                </rule>
              </rule>
            </rule>
            <rule>
              <name value="code"/>
              <source>
                <context value="entryact"/>
                <element value="code"/>
                <variable value="vvv"/>
              </source>
              <target>
                <context value="servicerequest"/>
                <contextType value="variable"/>
                <element value="code"/>
                <variable value="vvv"/>
                <transform value="create"/>
              </target>
            </rule>
            <rule>
              <name value="statusCode"/>
              <source>
                <context value="entryact"/>
                <element value="statusCode"/>
                <variable value="vvv"/>
              </source>
              <target>
                <context value="servicerequest"/>
                <contextType value="variable"/>
                <element value="status"/>
                <variable value="vvv"/>
                <transform value="create"/>
              </target>
            </rule>
            <rule>
              <name value="servReq"/>
              <source>
                <context value="entryact"/>
                <element value="author"/>
                <variable value="actauthor"/>
              </source>
              <rule>
                <name value="time"/>
                <source>
                  <context value="actauthor"/>
                  <element value="time"/>
                  <variable value="t"/>
                </source>
                <target>
                  <context value="servicerequest"/>
                  <contextType value="variable"/>
                  <element value="authoredOn"/>
                  <variable value="date"/>
                  <transform value="create"/>
                  <parameter>
                    <valueString value="dateTime"/>
                  </parameter>
                </target>
                <dependent>
                  <name value="TSDateTime"/>
                  <variable value="t"/>
                  <variable value="date"/>
                </dependent>
              </rule>
              <rule>
                <name value="author"/>
                <source>
                  <context value="actauthor"/>
                  <element value="assignedAuthor"/>
                  <variable value="assauthor"/>
                </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="PUT"/>
                  </parameter>
                </target>
                <target>
                  <context value="e1"/>
                  <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="uuid1"/>
                  <transform value="uuid"/>
                </target>
                <target>
                  <context value="e1"/>
                  <contextType value="variable"/>
                  <element value="fullUrl"/>
                  <transform value="append"/>
                  <parameter>
                    <valueString value="https://example/Practitioner/"/>
                  </parameter>
                  <parameter>
                    <valueId value="uuid1"/>
                  </parameter>
                </target>
                <target>
                  <context value="request"/>
                  <contextType value="variable"/>
                  <element value="url"/>
                  <transform value="append"/>
                  <parameter>
                    <valueString value="Practitioner/"/>
                  </parameter>
                  <parameter>
                    <valueId value="uuid1"/>
                  </parameter>
                </target>
                <rule>
                  <name value="meta"/>
                  <source>
                    <context value="assauthor"/>
                  </source>
                  <target>
                    <context value="practitioner"/>
                    <contextType value="variable"/>
                    <element value="meta"/>
                    <variable value="meta"/>
                  </target>
                  <rule>
                    <name value="coding"/>
                    <source>
                      <context value="assauthor"/>
                    </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="assauthor"/>
                      </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="assauthor"/>
                      </source>
                      <target>
                        <context value="coding"/>
                        <contextType value="variable"/>
                        <element value="code"/>
                        <transform value="copy"/>
                        <parameter>
                          <valueString
                                       value="ClinicalDocument/body/PianoCuraDimissione/author"/>
                        </parameter>
                      </target>
                    </rule>
                  </rule>
                  <documentation value="inizio modifica identifier"/>
                </rule>
                <rule>
                  <name value="identifier"/>
                  <source>
                    <context value="assauthor"/>
                    <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="extension"/>
                    <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>
                  <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="e1"/>
                        <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="request"/>
                        <contextType value="variable"/>
                        <element value="url"/>
                        <transform value="append"/>
                        <parameter>
                          <valueString value="Practitioner/"/>
                        </parameter>
                        <parameter>
                          <valueId value="uuid2"/>
                        </parameter>
                      </target>
                      <target>
                        <context value="servicerequest"/>
                        <contextType value="variable"/>
                        <element value="requester"/>
                        <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="assauthor"/>
                    <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="namepers"/>
                  <source>
                    <context value="assauthor"/>
                    <element value="assignedPerson"/>
                    <variable value="pers"/>
                  </source>
                  <rule>
                    <name value="name"/>
                    <source>
                      <context value="pers"/>
                      <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>
                  <documentation value="fine modifica"/>
                </rule>
              </rule>
            </rule>
          </rule>
        </rule>
      </rule>
    </rule>
  </group>
  <group>
    <name value="ClinicalDocumentSectionDimissione"/>
    <typeMode value="none"/>
    <documentation
                   value="-------Dimissione------------------------------------------------------------------------------------------------------"/>
    <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>
    <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="entry1"/>
      <source>
        <context value="src"/>
        <element value="entry"/>
        <variable value="entry1"/>
      </source>
      <rule>
        <name value="act"/>
        <source>
          <context value="entry1"/>
          <element value="act"/>
          <variable value="act"/>
        </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="encountert"/>
          <transform value="create"/>
          <parameter>
            <valueString value="Encounter"/>
          </parameter>
        </target>
        <target>
          <context value="encountert"/>
          <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/Encounter/"/>
          </parameter>
          <parameter>
            <valueId value="uuid1"/>
          </parameter>
        </target>
        <target>
          <context value="request"/>
          <contextType value="variable"/>
          <element value="url"/>
          <transform value="copy"/>
          <parameter>
            <valueString value="Encounter"/>
          </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/Encounter/' + %encountert.id"/>
          </parameter>
        </target>
        <rule>
          <name value="status"/>
          <source>
            <context value="act"/>
          </source>
          <target>
            <context value="encountert"/>
            <contextType value="variable"/>
            <element value="status"/>
            <transform value="copy"/>
            <parameter>
              <valueString value="finished"/>
            </parameter>
          </target>
        </rule>
        <rule>
          <name value="class"/>
          <source>
            <context value="act"/>
          </source>
          <target>
            <context value="encountert"/>
            <contextType value="variable"/>
            <element value="class"/>
            <variable value="cl"/>
            <transform value="create"/>
            <parameter>
              <valueString value="Coding"/>
            </parameter>
          </target>
          <rule>
            <name value="code"/>
            <source>
              <context value="act"/>
            </source>
            <target>
              <context value="cl"/>
              <contextType value="variable"/>
              <element value="code"/>
              <transform value="copy"/>
              <parameter>
                <valueString value="AMB"/>
              </parameter>
            </target>
          </rule>
          <rule>
            <name value="code"/>
            <source>
              <context value="act"/>
            </source>
            <target>
              <context value="cl"/>
              <contextType value="variable"/>
              <element value="display"/>
              <transform value="copy"/>
              <parameter>
                <valueString value="ambulatory"/>
              </parameter>
            </target>
          </rule>
        </rule>
        <rule>
          <name value="refenc"/>
          <source>
            <context value="act"/>
          </source>
          <target>
            <context value="encountert"/>
            <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/Encounter/' + enc.id"/>
            </parameter>
          </target>
        </rule>
        <rule>
          <name value="refpatient"/>
          <source>
            <context value="act"/>
          </source>
          <target>
            <context value="encountert"/>
            <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="code"/>
          <source>
            <context value="act"/>
            <element value="code"/>
            <variable value="vvv"/>
          </source>
          <target>
            <context value="encountert"/>
            <contextType value="variable"/>
            <element value="type"/>
            <variable value="vvv"/>
            <transform value="create"/>
          </target>
        </rule>
        <rule>
          <name value="where"/>
          <source>
            <context value="act"/>
            <condition
                       value="effectiveTime.low.exists() or effectiveTime.high.exists()"/>
          </source>
          <rule>
            <name value="effectiveTime"/>
            <source>
              <context value="act"/>
              <element value="effectiveTime"/>
              <variable value="eff"/>
            </source>
            <target>
              <context value="encountert"/>
              <contextType value="variable"/>
              <element value="period"/>
              <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="where"/>
          <source>
            <context value="act"/>
            <condition
                       value="effectiveTime.low.exists().not() or effectiveTime.high.exists().not()"/>
          </source>
          <rule>
            <name value="efft"/>
            <source>
              <context value="act"/>
              <element value="effectiveTime"/>
              <variable value="effectivetime1"/>
            </source>
            <target>
              <context value="encountert"/>
              <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="effectivetime1"/>
              </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="effectivetime1"/>
                <variable value="start"/>
              </dependent>
            </rule>
          </rule>
          <documentation value="effectiveTime = time-stamp"/>
        </rule>
        <rule>
          <name value="erformer"/>
          <source>
            <context value="act"/>
            <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="PUT"/>
            </parameter>
          </target>
          <target>
            <context value="e1"/>
            <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="uuid1"/>
            <transform value="uuid"/>
          </target>
          <target>
            <context value="e1"/>
            <contextType value="variable"/>
            <element value="fullUrl"/>
            <transform value="append"/>
            <parameter>
              <valueString value="https://example/Practitioner/"/>
            </parameter>
            <parameter>
              <valueId value="uuid1"/>
            </parameter>
          </target>
          <target>
            <context value="request"/>
            <contextType value="variable"/>
            <element value="url"/>
            <transform value="append"/>
            <parameter>
              <valueString value="Practitioner/"/>
            </parameter>
            <parameter>
              <valueId value="uuid1"/>
            </parameter>
          </target>
          <rule>
            <name value="ass"/>
            <source>
              <context value="performer"/>
              <element value="assignedEntity"/>
              <variable value="assEnty"/>
            </source>
            <rule>
              <name value="meta"/>
              <source>
                <context value="assEnty"/>
              </source>
              <target>
                <context value="practitioner"/>
                <contextType value="variable"/>
                <element value="meta"/>
                <variable value="meta"/>
              </target>
              <rule>
                <name value="coding"/>
                <source>
                  <context value="assEnty"/>
                </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="assEnty"/>
                  </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="assEnty"/>
                  </source>
                  <target>
                    <context value="coding"/>
                    <contextType value="variable"/>
                    <element value="code"/>
                    <transform value="copy"/>
                    <parameter>
                      <valueString
                                   value="ClinicalDocument/body/Dimissione/performer"/>
                    </parameter>
                  </target>
                </rule>
              </rule>
            </rule>
            <rule>
              <name value="identifier"/>
              <source>
                <context value="assEnty"/>
                <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="extension"/>
                <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>
              <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="perf"/>
                  <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="e1"/>
                    <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="request"/>
                    <contextType value="variable"/>
                    <element value="url"/>
                    <transform value="append"/>
                    <parameter>
                      <valueString value="Practitioner/"/>
                    </parameter>
                    <parameter>
                      <valueId value="uuid2"/>
                    </parameter>
                  </target>
                  <target>
                    <context value="encountert"/>
                    <contextType value="variable"/>
                    <element value="participant"/>
                    <variable value="perf"/>
                  </target>
                  <rule>
                    <name value="period"/>
                    <source>
                      <context value="performer"/>
                    </source>
                    <target>
                      <context value="perf"/>
                      <contextType value="variable"/>
                      <element value="period"/>
                      <variable value="period"/>
                      <transform value="create"/>
                      <parameter>
                        <valueString value="Period"/>
                      </parameter>
                    </target>
                    <rule>
                      <name value="time"/>
                      <source>
                        <context value="performer"/>
                        <element value="time"/>
                        <variable value="time"/>
                      </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="time"/>
                        <variable value="start"/>
                      </dependent>
                    </rule>
                  </rule>
                  <rule>
                    <name value="aut"/>
                    <source>
                      <context value="performer"/>
                    </source>
                    <target>
                      <context value="perf"/>
                      <contextType value="variable"/>
                      <element value="individual"/>
                      <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>
            <rule>
              <name value="2.16.840.1.113883.2.9.4.3.2"/>
              <source>
                <context value="assEnty"/>
                <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="assPer"/>
              <source>
                <context value="assEnty"/>
                <element value="assignedPerson"/>
                <variable value="assPers"/>
              </source>
              <rule>
                <name value="name"/>
                <source>
                  <context value="assPers"/>
                  <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>
            <documentation
                           value="performer.time as ti -&gt; note.time = (ti.value);"/>
          </rule>
        </rule>
        <rule>
          <name value="entriRel"/>
          <source>
            <context value="act"/>
            <element value="entryRelationship"/>
            <variable value="entriRel"/>
          </source>
          <rule>
            <name value="enc"/>
            <source>
              <context value="entriRel"/>
              <element value="encounter"/>
              <variable value="enc1"/>
            </source>
            <rule>
              <name value="enc1"/>
              <source>
                <context value="enc1"/>
              </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="encountert1"/>
                <transform value="create"/>
                <parameter>
                  <valueString value="Encounter"/>
                </parameter>
              </target>
              <target>
                <context value="encountert1"/>
                <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/Encounter/"/>
                </parameter>
                <parameter>
                  <valueId value="uuid1"/>
                </parameter>
              </target>
              <target>
                <context value="request"/>
                <contextType value="variable"/>
                <element value="url"/>
                <transform value="copy"/>
                <parameter>
                  <valueString value="Encounter"/>
                </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/Encounter/' + %encountert1.id"/>
                </parameter>
              </target>
              <target>
                <context value="encountert1"/>
                <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/Encounter/' + encountert.id"/>
                </parameter>
              </target>
              <rule>
                <name value="status"/>
                <source>
                  <context value="enc1"/>
                </source>
                <target>
                  <context value="encountert1"/>
                  <contextType value="variable"/>
                  <element value="status"/>
                  <transform value="copy"/>
                  <parameter>
                    <valueString value="finished"/>
                  </parameter>
                </target>
              </rule>
              <rule>
                <name value="class"/>
                <source>
                  <context value="enc1"/>
                </source>
                <target>
                  <context value="encountert1"/>
                  <contextType value="variable"/>
                  <element value="class"/>
                  <variable value="cl"/>
                  <transform value="create"/>
                  <parameter>
                    <valueString value="Coding"/>
                  </parameter>
                </target>
                <rule>
                  <name value="code"/>
                  <source>
                    <context value="enc1"/>
                  </source>
                  <target>
                    <context value="cl"/>
                    <contextType value="variable"/>
                    <element value="code"/>
                    <transform value="copy"/>
                    <parameter>
                      <valueString value="AMB"/>
                    </parameter>
                  </target>
                </rule>
                <rule>
                  <name value="code"/>
                  <source>
                    <context value="enc1"/>
                  </source>
                  <target>
                    <context value="cl"/>
                    <contextType value="variable"/>
                    <element value="display"/>
                    <transform value="copy"/>
                    <parameter>
                      <valueString value="ambulatory"/>
                    </parameter>
                  </target>
                </rule>
              </rule>
              <rule>
                <name value="refpatient"/>
                <source>
                  <context value="enc1"/>
                </source>
                <target>
                  <context value="encountert1"/>
                  <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="id"/>
                <source>
                  <context value="enc1"/>
                  <element value="id"/>
                  <variable value="vvv"/>
                </source>
                <target>
                  <context value="encountert1"/>
                  <contextType value="variable"/>
                  <element value="identifier"/>
                  <variable value="vvv"/>
                  <transform value="create"/>
                </target>
              </rule>
              <rule>
                <name value="code"/>
                <source>
                  <context value="enc1"/>
                </source>
                <target>
                  <context value="encountert1"/>
                  <contextType value="variable"/>
                  <element value="type"/>
                  <variable value="ti"/>
                  <transform value="create"/>
                  <parameter>
                    <valueString value="CodeableConcept"/>
                  </parameter>
                </target>
                <rule>
                  <name value="coding"/>
                  <source>
                    <context value="enc1"/>
                  </source>
                  <target>
                    <context value="ti"/>
                    <contextType value="variable"/>
                    <element value="coding"/>
                    <variable value="cod"/>
                    <transform value="create"/>
                    <parameter>
                      <valueString value="Coding"/>
                    </parameter>
                  </target>
                  <rule>
                    <name value="code"/>
                    <source>
                      <context value="enc1"/>
                      <element value="code"/>
                      <variable value="c"/>
                    </source>
                    <target>
                      <context value="cod"/>
                      <contextType value="variable"/>
                      <element value="code"/>
                      <transform value="evaluate"/>
                      <parameter>
                        <valueString value="c.code"/>
                      </parameter>
                    </target>
                  </rule>
                  <rule>
                    <name value="syst"/>
                    <source>
                      <context value="enc1"/>
                      <element value="code"/>
                      <variable value="c"/>
                    </source>
                    <rule>
                      <name value="system"/>
                      <source>
                        <context value="c"/>
                        <element value="codeSystem"/>
                        <variable value="s"/>
                      </source>
                      <target>
                        <context value="cod"/>
                        <contextType value="variable"/>
                        <element value="system"/>
                        <transform value="translate"/>
                        <parameter>
                          <valueId value="s"/>
                        </parameter>
                        <parameter>
                          <valueString
                                       value="http://hl7.org/fhir/ConceptMap/special-oid2uri"/>
                        </parameter>
                        <parameter>
                          <valueString value="uri"/>
                        </parameter>
                      </target>
                    </rule>
                  </rule>
                  <rule>
                    <name value="dispaly"/>
                    <source>
                      <context value="enc1"/>
                      <element value="code"/>
                      <variable value="c"/>
                    </source>
                    <target>
                      <context value="cod"/>
                      <contextType value="variable"/>
                      <element value="display"/>
                      <transform value="evaluate"/>
                      <parameter>
                        <valueString value="c.displayName"/>
                      </parameter>
                    </target>
                  </rule>
                </rule>
                <rule>
                  <name value="text"/>
                  <source>
                    <context value="enc1"/>
                    <element value="text"/>
                    <variable value="tx"/>
                  </source>
                  <rule>
                    <name value="val"/>
                    <source>
                      <context value="tx"/>
                      <element value="reference"/>
                      <variable value="ref"/>
                    </source>
                    <target>
                      <context value="ti"/>
                      <contextType value="variable"/>
                      <element value="text"/>
                      <transform value="evaluate"/>
                      <parameter>
                        <valueString value="ref.value"/>
                      </parameter>
                    </target>
                  </rule>
                </rule>
                <documentation value="enc1.code -&gt; encountert1.type;"/>
              </rule>
              <rule>
                <name value="where"/>
                <source>
                  <context value="enc1"/>
                  <condition
                             value="effectiveTime.low.exists() or effectiveTime.high.exists()"/>
                </source>
                <rule>
                  <name value="effectiveTime"/>
                  <source>
                    <context value="enc1"/>
                    <element value="effectiveTime"/>
                    <variable value="eff"/>
                  </source>
                  <target>
                    <context value="encountert1"/>
                    <contextType value="variable"/>
                    <element value="period"/>
                    <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="where"/>
                <source>
                  <context value="enc1"/>
                  <condition
                             value="effectiveTime.low.exists().not() or effectiveTime.high.exists().not()"/>
                </source>
                <rule>
                  <name value="efft"/>
                  <source>
                    <context value="enc1"/>
                    <element value="effectiveTime"/>
                    <variable value="effectivetime1"/>
                  </source>
                  <target>
                    <context value="encountert1"/>
                    <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="effectivetime1"/>
                    </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="effectivetime1"/>
                      <variable value="start"/>
                    </dependent>
                  </rule>
                </rule>
                <documentation value="effectiveTime = time-stamp"/>
              </rule>
              <rule>
                <name value="Location"/>
                <source>
                  <context value="enc1"/>
                  <element value="participant"/>
                  <variable value="part"/>
                  <condition value="(typeCode = 'LOC')"/>
                </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="PUT"/>
                  </parameter>
                </target>
                <target>
                  <context value="e1"/>
                  <contextType value="variable"/>
                  <element value="resource"/>
                  <variable value="location"/>
                  <transform value="create"/>
                  <parameter>
                    <valueString value="Location"/>
                  </parameter>
                </target>
                <target>
                  <context value="location"/>
                  <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/Location/"/>
                  </parameter>
                  <parameter>
                    <valueId value="uuid1"/>
                  </parameter>
                </target>
                <target>
                  <context value="request"/>
                  <contextType value="variable"/>
                  <element value="url"/>
                  <transform value="append"/>
                  <parameter>
                    <valueString value="Location/"/>
                  </parameter>
                  <parameter>
                    <valueId value="uuid1"/>
                  </parameter>
                </target>
                <rule>
                  <name value="meta"/>
                  <source>
                    <context value="part"/>
                  </source>
                  <target>
                    <context value="location"/>
                    <contextType value="variable"/>
                    <element value="meta"/>
                    <variable value="meta"/>
                  </target>
                  <rule>
                    <name value="coding"/>
                    <source>
                      <context value="part"/>
                    </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="part"/>
                      </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="part"/>
                      </source>
                      <target>
                        <context value="coding"/>
                        <contextType value="variable"/>
                        <element value="code"/>
                        <transform value="copy"/>
                        <parameter>
                          <valueString
                                       value="ClinicalDocument/body/Dimissione/participant"/>
                        </parameter>
                      </target>
                    </rule>
                  </rule>
                </rule>
                <rule>
                  <name value="location1"/>
                  <source>
                    <context value="part"/>
                    <element value="time"/>
                    <variable value="tim"/>
                  </source>
                  <target>
                    <context value="encountert1"/>
                    <contextType value="variable"/>
                    <element value="location"/>
                    <variable value="locat"/>
                  </target>
                  <rule>
                    <name value="time"/>
                    <source>
                      <context value="tim"/>
                    </source>
                    <target>
                      <context value="locat"/>
                      <contextType value="variable"/>
                      <element value="period"/>
                      <variable value="period"/>
                      <transform value="create"/>
                      <parameter>
                        <valueString value="Period"/>
                      </parameter>
                    </target>
                    <dependent>
                      <name value="IVLTSPeriod"/>
                      <variable value="tim"/>
                      <variable value="period"/>
                    </dependent>
                  </rule>
                  <rule>
                    <name value="time"/>
                    <source>
                      <context value="part"/>
                      <element value="time"/>
                      <variable value="tim"/>
                    </source>
                    <target>
                      <context value="locat"/>
                      <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="tim"/>
                      </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="tim"/>
                        <variable value="start"/>
                      </dependent>
                    </rule>
                  </rule>
                  <rule>
                    <name value="partRole"/>
                    <source>
                      <context value="part"/>
                      <element value="participantRole"/>
                      <variable value="partRole"/>
                    </source>
                    <rule>
                      <name value="identifier"/>
                      <source>
                        <context value="partRole"/>
                        <element value="id"/>
                        <variable value="id"/>
                      </source>
                      <target>
                        <context value="location"/>
                        <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="partRole"/>
                          </source>
                          <target>
                            <context value="request"/>
                            <contextType value="variable"/>
                            <element value="url"/>
                            <transform value="append"/>
                            <parameter>
                              <valueString value="Location?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="idasi"/>
                          <source>
                            <context value="id"/>
                            <element value="extension"/>
                            <variable value="ext"/>
                          </source>
                          <target>
                            <context value="location"/>
                            <contextType value="variable"/>
                            <element value="id"/>
                            <variable value="uuid"/>
                            <transform value="evaluate"/>
                            <parameter>
                              <valueString value="r + '-' + ext"/>
                            </parameter>
                          </target>
                          <target>
                            <context value="e1"/>
                            <contextType value="variable"/>
                            <element value="fullUrl"/>
                            <transform value="append"/>
                            <parameter>
                              <valueString value="https://example/Location/"/>
                            </parameter>
                            <parameter>
                              <valueId value="uuid"/>
                            </parameter>
                          </target>
                          <target>
                            <context value="locat"/>
                            <contextType value="variable"/>
                            <element value="location"/>
                            <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/Location/' + %location.id"/>
                            </parameter>
                          </target>
                        </rule>
                      </rule>
                    </rule>
                    <rule>
                      <name value="code"/>
                      <source>
                        <context value="partRole"/>
                        <element value="code"/>
                        <variable value="vvv"/>
                      </source>
                      <target>
                        <context value="location"/>
                        <contextType value="variable"/>
                        <element value="type"/>
                        <variable value="vvv"/>
                        <transform value="create"/>
                      </target>
                      <documentation
                                     value="partRole.id -&gt; location.identifier;"/>
                    </rule>
                  </rule>
                </rule>
              </rule>
              <rule>
                <name value="entryrel2"/>
                <source>
                  <context value="enc1"/>
                  <element value="entryRelationship"/>
                  <variable value="entryrel2"/>
                </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="observation"/>
                  <transform value="create"/>
                  <parameter>
                    <valueString value="Observation"/>
                  </parameter>
                </target>
                <target>
                  <context value="observation"/>
                  <contextType value="variable"/>
                  <element value="id"/>
                  <variable value="uuid1"/>
                  <transform value="uuid"/>
                </target>
                <target>
                  <context value="e1"/>
                  <contextType value="variable"/>
                  <element value="fullUrl"/>
                  <transform value="append"/>
                  <parameter>
                    <valueString value="https://example/Observation/"/>
                  </parameter>
                  <parameter>
                    <valueId value="uuid1"/>
                  </parameter>
                </target>
                <target>
                  <context value="request"/>
                  <contextType value="variable"/>
                  <element value="url"/>
                  <transform value="copy"/>
                  <parameter>
                    <valueString value="Observation"/>
                  </parameter>
                </target>
                <target>
                  <context value="encountert1"/>
                  <contextType value="variable"/>
                  <element value="reasonReference"/>
                  <variable value="reference"/>
                  <transform value="create"/>
                  <parameter>
                    <valueString value="BackboneElement"/>
                  </parameter>
                </target>
                <target>
                  <context value="reference"/>
                  <contextType value="variable"/>
                  <element value="reference"/>
                  <transform value="evaluate"/>
                  <parameter>
                    <valueString
                                 value="'https://example/Observation/' + %observation.id"/>
                  </parameter>
                </target>
                <rule>
                  <name value="obs"/>
                  <source>
                    <context value="entryrel2"/>
                    <element value="observation"/>
                    <variable value="obs"/>
                  </source>
                  <rule>
                    <name value="reference"/>
                    <source>
                      <context value="obs"/>
                    </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="obs"/>
                    </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/' + %encountert1.id"/>
                      </parameter>
                    </target>
                  </rule>
                  <rule>
                    <name value="code"/>
                    <source>
                      <context value="obs"/>
                      <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="statusCode"/>
                    <source>
                      <context value="obs"/>
                      <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="obs"/>
                      <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="obs"/>
                      <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="obs"/>
                      <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="notpresent"/>
                    <source>
                      <context value="obs"/>
                    </source>
                    <target>
                      <context value="observation"/>
                      <contextType value="variable"/>
                      <element value="status"/>
                      <transform value="copy"/>
                      <parameter>
                        <valueString value="final"/>
                      </parameter>
                    </target>
                  </rule>
                  <rule>
                    <name value="value2"/>
                    <source>
                      <context value="obs"/>
                      <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="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="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="value"/>
                    <source>
                      <context value="obs"/>
                      <type value="INT"/>
                      <element value="value"/>
                      <variable value="int"/>
                    </source>
                    <target>
                      <context value="observation"/>
                      <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="observation"/>
                      <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="observation"/>
                        <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="observation"/>
                        <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="observation"/>
                        <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="observation"/>
                      <contextType value="variable"/>
                      <element value="value"/>
                      <transform value="create"/>
                      <parameter>
                        <valueString value="string"/>
                      </parameter>
                    </target>
                    <target>
                      <context value="observation"/>
                      <contextType value="variable"/>
                      <element value="value"/>
                      <transform value="evaluate"/>
                      <parameter>
                        <valueString value="value.dataString"/>
                      </parameter>
                    </target>
                  </rule>
                </rule>
              </rule>
            </rule>
          </rule>
          <documentation
                         value="Encounter Post dimissione---------------------------------------------------------------------------------------------------------------------------------------"/>
        </rule>
        <rule>
          <name value="entri-act"/>
          <source>
            <context value="act"/>
            <element value="entryRelationship"/>
            <variable value="entriRel2"/>
          </source>
          <rule>
            <name value="a"/>
            <source>
              <context value="entriRel2"/>
              <element value="act"/>
              <variable value="a"/>
            </source>
            <rule>
              <name value="act"/>
              <source>
                <context value="a"/>
              </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="encountert2"/>
                <transform value="create"/>
                <parameter>
                  <valueString value="Encounter"/>
                </parameter>
              </target>
              <target>
                <context value="encountert2"/>
                <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/Encounter/"/>
                </parameter>
                <parameter>
                  <valueId value="uuid1"/>
                </parameter>
              </target>
              <target>
                <context value="request"/>
                <contextType value="variable"/>
                <element value="url"/>
                <transform value="copy"/>
                <parameter>
                  <valueString value="Encounter"/>
                </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/Encounter/' + encountert2.id"/>
                </parameter>
              </target>
              <target>
                <context value="encountert2"/>
                <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/Encounter/' + encountert.id"/>
                </parameter>
              </target>
              <rule>
                <name value="status"/>
                <source>
                  <context value="a"/>
                </source>
                <target>
                  <context value="encountert2"/>
                  <contextType value="variable"/>
                  <element value="status"/>
                  <transform value="copy"/>
                  <parameter>
                    <valueString value="finished"/>
                  </parameter>
                </target>
              </rule>
              <rule>
                <name value="class"/>
                <source>
                  <context value="a"/>
                </source>
                <target>
                  <context value="encountert2"/>
                  <contextType value="variable"/>
                  <element value="class"/>
                  <variable value="cl"/>
                  <transform value="create"/>
                  <parameter>
                    <valueString value="Coding"/>
                  </parameter>
                </target>
                <rule>
                  <name value="code"/>
                  <source>
                    <context value="a"/>
                  </source>
                  <target>
                    <context value="cl"/>
                    <contextType value="variable"/>
                    <element value="code"/>
                    <transform value="copy"/>
                    <parameter>
                      <valueString value="AMB"/>
                    </parameter>
                  </target>
                </rule>
                <rule>
                  <name value="code"/>
                  <source>
                    <context value="a"/>
                  </source>
                  <target>
                    <context value="cl"/>
                    <contextType value="variable"/>
                    <element value="display"/>
                    <transform value="copy"/>
                    <parameter>
                      <valueString value="ambulatory"/>
                    </parameter>
                  </target>
                </rule>
              </rule>
              <rule>
                <name value="refpatient"/>
                <source>
                  <context value="a"/>
                </source>
                <target>
                  <context value="encountert2"/>
                  <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="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="encountert2"/>
                    <contextType value="variable"/>
                    <element value="period"/>
                    <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="where"/>
                <source>
                  <context value="a"/>
                  <condition
                             value="effectiveTime.low.exists().not() or effectiveTime.high.exists().not()"/>
                </source>
                <rule>
                  <name value="efft"/>
                  <source>
                    <context value="a"/>
                    <element value="effectiveTime"/>
                    <variable value="effectivetime1"/>
                  </source>
                  <target>
                    <context value="encountert2"/>
                    <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="effectivetime1"/>
                    </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="effectivetime1"/>
                      <variable value="start"/>
                    </dependent>
                  </rule>
                </rule>
                <documentation value="effectiveTime = time-stamp"/>
              </rule>
              <rule>
                <name value="loc"/>
                <source>
                  <context value="a"/>
                </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="PUT"/>
                  </parameter>
                </target>
                <target>
                  <context value="e1"/>
                  <contextType value="variable"/>
                  <element value="resource"/>
                  <variable value="location"/>
                  <transform value="create"/>
                  <parameter>
                    <valueString value="Location"/>
                  </parameter>
                </target>
                <target>
                  <context value="location"/>
                  <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/Location/"/>
                  </parameter>
                  <parameter>
                    <valueId value="uuid1"/>
                  </parameter>
                </target>
                <target>
                  <context value="request"/>
                  <contextType value="variable"/>
                  <element value="url"/>
                  <transform value="append"/>
                  <parameter>
                    <valueString value="Location/"/>
                  </parameter>
                  <parameter>
                    <valueId value="uuid1"/>
                  </parameter>
                </target>
                <rule>
                  <name value="text"/>
                  <source>
                    <context value="a"/>
                    <element value="text"/>
                    <variable value="tx"/>
                  </source>
                  <rule>
                    <name value="dfs"/>
                    <source>
                      <context value="tx"/>
                      <element value="reference"/>
                      <variable value="ref"/>
                    </source>
                    <target>
                      <context value="location"/>
                      <contextType value="variable"/>
                      <element value="description"/>
                      <transform value="evaluate"/>
                      <parameter>
                        <valueString value="ref.value"/>
                      </parameter>
                    </target>
                  </rule>
                </rule>
                <rule>
                  <name value="Location"/>
                  <source>
                    <context value="a"/>
                    <element value="participant"/>
                    <variable value="part"/>
                  </source>
                  <rule>
                    <name value="meta"/>
                    <source>
                      <context value="part"/>
                    </source>
                    <target>
                      <context value="location"/>
                      <contextType value="variable"/>
                      <element value="meta"/>
                      <variable value="meta"/>
                    </target>
                    <rule>
                      <name value="coding"/>
                      <source>
                        <context value="part"/>
                      </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="part"/>
                        </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="part"/>
                        </source>
                        <target>
                          <context value="coding"/>
                          <contextType value="variable"/>
                          <element value="code"/>
                          <transform value="copy"/>
                          <parameter>
                            <valueString
                                         value="ClinicalDocument/body/Dimissione/act"/>
                          </parameter>
                        </target>
                      </rule>
                    </rule>
                  </rule>
                  <rule>
                    <name value="loc2"/>
                    <source>
                      <context value="part"/>
                      <element value="time"/>
                      <variable value="tim"/>
                    </source>
                    <target>
                      <context value="encountert2"/>
                      <contextType value="variable"/>
                      <element value="location"/>
                      <variable value="locat"/>
                    </target>
                    <rule>
                      <name value="time"/>
                      <source>
                        <context value="tim"/>
                      </source>
                      <target>
                        <context value="locat"/>
                        <contextType value="variable"/>
                        <element value="period"/>
                        <variable value="period"/>
                        <transform value="create"/>
                        <parameter>
                          <valueString value="Period"/>
                        </parameter>
                      </target>
                      <dependent>
                        <name value="IVLTSPeriod"/>
                        <variable value="tim"/>
                        <variable value="period"/>
                      </dependent>
                    </rule>
                    <rule>
                      <name value="time"/>
                      <source>
                        <context value="part"/>
                        <element value="time"/>
                        <variable value="tim"/>
                      </source>
                      <target>
                        <context value="locat"/>
                        <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="tim"/>
                        </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="tim"/>
                          <variable value="start"/>
                        </dependent>
                      </rule>
                    </rule>
                    <rule>
                      <name value="partRole"/>
                      <source>
                        <context value="part"/>
                        <element value="participantRole"/>
                        <variable value="partRole"/>
                      </source>
                      <rule>
                        <name value="identifier"/>
                        <source>
                          <context value="partRole"/>
                          <element value="id"/>
                          <variable value="id"/>
                        </source>
                        <target>
                          <context value="location"/>
                          <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="partRole"/>
                            </source>
                            <target>
                              <context value="request"/>
                              <contextType value="variable"/>
                              <element value="url"/>
                              <transform value="append"/>
                              <parameter>
                                <valueString value="Location?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="idasi"/>
                            <source>
                              <context value="id"/>
                              <element value="extension"/>
                              <variable value="ext"/>
                            </source>
                            <target>
                              <context value="location"/>
                              <contextType value="variable"/>
                              <element value="id"/>
                              <variable value="uuid"/>
                              <transform value="evaluate"/>
                              <parameter>
                                <valueString value="r + '-' + ext"/>
                              </parameter>
                            </target>
                            <target>
                              <context value="e1"/>
                              <contextType value="variable"/>
                              <element value="fullUrl"/>
                              <transform value="append"/>
                              <parameter>
                                <valueString
                                             value="https://example/Location/"/>
                              </parameter>
                              <parameter>
                                <valueId value="uuid"/>
                              </parameter>
                            </target>
                            <target>
                              <context value="locat"/>
                              <contextType value="variable"/>
                              <element value="location"/>
                              <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/Location/' + %location.id"/>
                              </parameter>
                            </target>
                          </rule>
                        </rule>
                      </rule>
                      <rule>
                        <name value="code"/>
                        <source>
                          <context value="partRole"/>
                          <element value="code"/>
                          <variable value="vvv"/>
                        </source>
                        <target>
                          <context value="location"/>
                          <contextType value="variable"/>
                          <element value="type"/>
                          <variable value="vvv"/>
                          <transform value="create"/>
                        </target>
                        <documentation
                                       value="partRole.id -&gt; location.identifier;"/>
                      </rule>
                    </rule>
                  </rule>
                </rule>
              </rule>
              <rule>
                <name value="entryrel2"/>
                <source>
                  <context value="a"/>
                  <element value="entryRelationship"/>
                  <variable value="entryrel2"/>
                </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="observation"/>
                  <transform value="create"/>
                  <parameter>
                    <valueString value="Observation"/>
                  </parameter>
                </target>
                <target>
                  <context value="observation"/>
                  <contextType value="variable"/>
                  <element value="id"/>
                  <variable value="uuid1"/>
                  <transform value="uuid"/>
                </target>
                <target>
                  <context value="e1"/>
                  <contextType value="variable"/>
                  <element value="fullUrl"/>
                  <transform value="append"/>
                  <parameter>
                    <valueString value="https://example/Observation/"/>
                  </parameter>
                  <parameter>
                    <valueId value="uuid1"/>
                  </parameter>
                </target>
                <target>
                  <context value="request"/>
                  <contextType value="variable"/>
                  <element value="url"/>
                  <transform value="copy"/>
                  <parameter>
                    <valueString value="Observation"/>
                  </parameter>
                </target>
                <target>
                  <context value="encountert2"/>
                  <contextType value="variable"/>
                  <element value="reasonReference"/>
                  <variable value="reference"/>
                  <transform value="create"/>
                  <parameter>
                    <valueString value="BackboneElement"/>
                  </parameter>
                </target>
                <target>
                  <context value="reference"/>
                  <contextType value="variable"/>
                  <element value="reference"/>
                  <transform value="evaluate"/>
                  <parameter>
                    <valueString
                                 value="'https://example/Observation/' + %observation.id"/>
                  </parameter>
                </target>
                <rule>
                  <name value="obs"/>
                  <source>
                    <context value="entryrel2"/>
                    <element value="observation"/>
                    <variable value="obs"/>
                  </source>
                  <rule>
                    <name value="reference"/>
                    <source>
                      <context value="obs"/>
                    </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="obs"/>
                    </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/' + %encountert2.id"/>
                      </parameter>
                    </target>
                  </rule>
                  <rule>
                    <name value="code"/>
                    <source>
                      <context value="obs"/>
                      <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="statusCode"/>
                    <source>
                      <context value="obs"/>
                      <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="obs"/>
                      <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="obs"/>
                      <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="obs"/>
                      <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="notpresent"/>
                    <source>
                      <context value="obs"/>
                    </source>
                    <target>
                      <context value="observation"/>
                      <contextType value="variable"/>
                      <element value="status"/>
                      <transform value="copy"/>
                      <parameter>
                        <valueString value="final"/>
                      </parameter>
                    </target>
                  </rule>
                  <rule>
                    <name value="value2"/>
                    <source>
                      <context value="obs"/>
                      <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="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="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="value"/>
                    <source>
                      <context value="obs"/>
                      <type value="INT"/>
                      <element value="value"/>
                      <variable value="int"/>
                    </source>
                    <target>
                      <context value="observation"/>
                      <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="observation"/>
                      <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="observation"/>
                        <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="observation"/>
                        <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="observation"/>
                        <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="observation"/>
                      <contextType value="variable"/>
                      <element value="value"/>
                      <transform value="create"/>
                      <parameter>
                        <valueString value="string"/>
                      </parameter>
                    </target>
                    <target>
                      <context value="observation"/>
                      <contextType value="variable"/>
                      <element value="value"/>
                      <transform value="evaluate"/>
                      <parameter>
                        <valueString value="value.dataString"/>
                      </parameter>
                    </target>
                  </rule>
                </rule>
              </rule>
            </rule>
          </rule>
          <documentation
                         value="Trasferimento post dimissione-------------------------------------------------------------------------------------------------------------------------------------"/>
        </rule>
        <rule>
          <name value="entryrel2"/>
          <source>
            <context value="act"/>
            <element value="entryRelationship"/>
            <variable value="entryrel2"/>
          </source>
          <rule>
            <name value="obs"/>
            <source>
              <context value="entryrel2"/>
              <element value="observation"/>
              <variable value="obs"/>
            </source>
            <rule>
              <name value="222"/>
              <source>
                <context value="obs"/>
                <element value="code"/>
                <variable value="code"/>
                <condition value="(code = '29308-4')"/>
              </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="observation"/>
                <transform value="create"/>
                <parameter>
                  <valueString value="Observation"/>
                </parameter>
              </target>
              <target>
                <context value="observation"/>
                <contextType value="variable"/>
                <element value="id"/>
                <variable value="uuid1"/>
                <transform value="uuid"/>
              </target>
              <target>
                <context value="e1"/>
                <contextType value="variable"/>
                <element value="fullUrl"/>
                <transform value="append"/>
                <parameter>
                  <valueString value="https://example/Observation/"/>
                </parameter>
                <parameter>
                  <valueId value="uuid1"/>
                </parameter>
              </target>
              <target>
                <context value="request"/>
                <contextType value="variable"/>
                <element value="url"/>
                <transform value="copy"/>
                <parameter>
                  <valueString value="Observation"/>
                </parameter>
              </target>
              <target>
                <context value="encountert"/>
                <contextType value="variable"/>
                <element value="reasonReference"/>
                <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/' + %observation.id"/>
                </parameter>
              </target>
              <rule>
                <name value="reference"/>
                <source>
                  <context value="obs"/>
                </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="obs"/>
                </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/' + %encountert.id"/>
                  </parameter>
                </target>
              </rule>
              <rule>
                <name value="code"/>
                <source>
                  <context value="obs"/>
                  <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="statusCode"/>
                <source>
                  <context value="obs"/>
                  <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="obs"/>
                  <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="obs"/>
                  <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="obs"/>
                  <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="status"/>
                <source>
                  <context value="obs"/>
                </source>
                <target>
                  <context value="observation"/>
                  <contextType value="variable"/>
                  <element value="status"/>
                  <transform value="copy"/>
                  <parameter>
                    <valueString value="final"/>
                  </parameter>
                </target>
                <documentation
                               value="obs where obs.statusCode.exists().not() then {"/>
              </rule>
              <rule>
                <name value="value2"/>
                <source>
                  <context value="obs"/>
                  <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>
                <documentation value="}&quot;statuscode&quot;;"/>
              </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="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="val"/>
                <source>
                  <context value="obs"/>
                  <element value="value"/>
                  <variable value="val"/>
                </source>
                <rule>
                  <name value="coding"/>
                  <source>
                    <context value="val"/>
                  </source>
                  <target>
                    <context value="observation"/>
                    <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="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="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>
          </rule>
          <documentation
                         value="--------------Diagnosi alla dimissione-------------------------------------------------------------"/>
        </rule>
        <rule>
          <name value="3"/>
          <source>
            <context value="act"/>
            <element value="entryRelationship"/>
            <variable value="entriRel3"/>
          </source>
          <rule>
            <name value="x"/>
            <source>
              <context value="entriRel3"/>
              <element value="observation"/>
              <variable value="obs2"/>
            </source>
            <rule>
              <name value="act"/>
              <source>
                <context value="obs2"/>
                <element value="code"/>
                <variable value="code"/>
              </source>
              <rule>
                <name value="entry-obs1"/>
                <source>
                  <context value="code"/>
                  <element value="code"/>
                  <condition value="(code.code = '11302-7')"/>
                </source>
                <rule>
                  <name value="hospital"/>
                  <source>
                    <context value="obs2"/>
                  </source>
                  <target>
                    <context value="encountert"/>
                    <contextType value="variable"/>
                    <element value="hospitalization"/>
                    <variable value="hospital"/>
                  </target>
                  <rule>
                    <name value="value"/>
                    <source>
                      <context value="obs2"/>
                      <element value="value"/>
                      <variable value="vvv"/>
                    </source>
                    <target>
                      <context value="hospital"/>
                      <contextType value="variable"/>
                      <element value="dischargeDisposition"/>
                      <variable value="vvv"/>
                      <transform value="create"/>
                    </target>
                  </rule>
                </rule>
              </rule>
            </rule>
          </rule>
          <documentation value="--------Esito----------------------------"/>
        </rule>
      </rule>
    </rule>
    <rule>
      <name value="entry"/>
      <source>
        <context value="src"/>
        <element value="entry"/>
        <variable value="entry1"/>
      </source>
      <rule>
        <name value="obs"/>
        <source>
          <context value="entry1"/>
          <element value="observation"/>
          <variable value="obs"/>
        </source>
        <rule>
          <name value="obstarg"/>
          <source>
            <context value="obs"/>
          </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="observation"/>
            <transform value="create"/>
            <parameter>
              <valueString value="Observation"/>
            </parameter>
          </target>
          <target>
            <context value="observation"/>
            <contextType value="variable"/>
            <element value="id"/>
            <variable value="uuid1"/>
            <transform value="uuid"/>
          </target>
          <target>
            <context value="e1"/>
            <contextType value="variable"/>
            <element value="fullUrl"/>
            <transform value="append"/>
            <parameter>
              <valueString value="https://example/Observation/"/>
            </parameter>
            <parameter>
              <valueId value="uuid1"/>
            </parameter>
          </target>
          <target>
            <context value="request"/>
            <contextType value="variable"/>
            <element value="url"/>
            <transform value="copy"/>
            <parameter>
              <valueString value="Observation"/>
            </parameter>
          </target>
          <target>
            <context value="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/Observation/' + %observation.id"/>
            </parameter>
          </target>
          <rule>
            <name value="value"/>
            <source>
              <context value="obs"/>
              <element value="value"/>
              <variable value="val"/>
              <condition value="('xsi:type' = 'BL')"/>
            </source>
            <target>
              <context value="observation"/>
              <contextType value="variable"/>
              <element value="value"/>
              <transform value="evaluate"/>
              <parameter>
                <valueString value="val.value"/>
              </parameter>
            </target>
          </rule>
          <rule>
            <name value="act"/>
            <source>
              <context value="obs"/>
            </source>
            <dependent>
              <name value="Observation"/>
              <variable value="obs"/>
              <variable value="patient"/>
              <variable value="enc"/>
              <variable value="observation"/>
              <variable value="bundle"/>
            </dependent>
          </rule>
        </rule>
      </rule>
    </rule>
  </group>
  <group>
    <name value="ClinicalDocumentSectionTerapiaFarmacologicaDimissione"/>
    <typeMode value="none"/>
    <documentation
                   value="-----------------------------------------------------------------------------------------------------------------------
------------------------------TerapiaFarmacologicaDimissione-----------------------------------------------------------------------------------------"/>
    <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>
    <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="text"/>
      <source>
        <context value="src"/>
        <condition value="src.entry.exists().not()"/>
      </source>
      <rule>
        <name value="note"/>
        <source>
          <context value="src"/>
          <element value="text"/>
          <variable value="cdaText"/>
        </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="medRq"/>
          <transform value="create"/>
          <parameter>
            <valueString value="MedicationRequest"/>
          </parameter>
        </target>
        <target>
          <context value="medRq"/>
          <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/MedicationRequest/"/>
          </parameter>
          <parameter>
            <valueId value="uuid1"/>
          </parameter>
        </target>
        <target>
          <context value="request"/>
          <contextType value="variable"/>
          <element value="url"/>
          <transform value="copy"/>
          <parameter>
            <valueString value="MedicationRequest"/>
          </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/MedicationRequest/' + %medRq.id"/>
          </parameter>
        </target>
        <target>
          <context value="medRq"/>
          <contextType value="variable"/>
          <element value="note"/>
          <variable value="note"/>
          <transform value="create"/>
          <parameter>
            <valueString value="Annotation"/>
          </parameter>
        </target>
        <rule>
          <name value="reference"/>
          <source>
            <context value="cdaText"/>
          </source>
          <target>
            <context value="note"/>
            <contextType value="variable"/>
            <element value="text"/>
            <transform value="copy"/>
            <parameter>
              <valueId value="cdaText"/>
            </parameter>
          </target>
        </rule>
        <rule>
          <name value="reference"/>
          <source>
            <context value="cdaText"/>
          </source>
          <target>
            <context value="medRq"/>
            <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="cdaText"/>
          </source>
          <target>
            <context value="medRq"/>
            <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="status"/>
          <source>
            <context value="cdaText"/>
          </source>
          <target>
            <context value="medRq"/>
            <contextType value="variable"/>
            <element value="status"/>
            <transform value="copy"/>
            <parameter>
              <valueString value="active"/>
            </parameter>
          </target>
        </rule>
        <rule>
          <name value="intent"/>
          <source>
            <context value="cdaText"/>
          </source>
          <target>
            <context value="medRq"/>
            <contextType value="variable"/>
            <element value="intent"/>
            <transform value="copy"/>
            <parameter>
              <valueString value="order"/>
            </parameter>
          </target>
        </rule>
        <rule>
          <name value="auth"/>
          <source>
            <context value="src"/>
            <element value="author"/>
            <variable value="auth"/>
          </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="PUT"/>
            </parameter>
          </target>
          <target>
            <context value="e1"/>
            <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="uuid1"/>
            <transform value="uuid"/>
          </target>
          <target>
            <context value="e1"/>
            <contextType value="variable"/>
            <element value="fullUrl"/>
            <transform value="append"/>
            <parameter>
              <valueString value="https://example/Practitioner/"/>
            </parameter>
            <parameter>
              <valueId value="uuid1"/>
            </parameter>
          </target>
          <target>
            <context value="request"/>
            <contextType value="variable"/>
            <element value="url"/>
            <transform value="append"/>
            <parameter>
              <valueString value="Practitioner/"/>
            </parameter>
            <parameter>
              <valueId value="uuid1"/>
            </parameter>
          </target>
          <rule>
            <name value="time"/>
            <source>
              <context value="auth"/>
              <element value="time"/>
              <variable value="t"/>
            </source>
            <target>
              <context value="note"/>
              <contextType value="variable"/>
              <element value="time"/>
              <variable value="value"/>
              <transform value="create"/>
              <parameter>
                <valueString value="dateTime"/>
              </parameter>
            </target>
            <dependent>
              <name value="TSDateTime"/>
              <variable value="t"/>
              <variable value="value"/>
            </dependent>
          </rule>
          <rule>
            <name value="assAuth"/>
            <source>
              <context value="auth"/>
              <element value="assignedAuthor"/>
              <variable value="assAuth"/>
            </source>
            <rule>
              <name value="meta"/>
              <source>
                <context value="assAuth"/>
              </source>
              <target>
                <context value="practitioner"/>
                <contextType value="variable"/>
                <element value="meta"/>
                <variable value="meta"/>
              </target>
              <rule>
                <name value="coding"/>
                <source>
                  <context value="assAuth"/>
                </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="assAuth"/>
                  </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="assAuth"/>
                  </source>
                  <target>
                    <context value="coding"/>
                    <contextType value="variable"/>
                    <element value="code"/>
                    <transform value="copy"/>
                    <parameter>
                      <valueString
                                   value="ClinicalDocument/body/TerapiaFarmacologicaDimissione/author"/>
                    </parameter>
                  </target>
                </rule>
              </rule>
              <documentation value="assAuth.time -&gt; note.time;"/>
            </rule>
            <rule>
              <name value="identifier"/>
              <source>
                <context value="assAuth"/>
                <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="extension"/>
                <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>
              <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="e1"/>
                    <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="request"/>
                    <contextType value="variable"/>
                    <element value="url"/>
                    <transform value="append"/>
                    <parameter>
                      <valueString value="Practitioner/"/>
                    </parameter>
                    <parameter>
                      <valueId value="uuid2"/>
                    </parameter>
                  </target>
                  <target>
                    <context value="note"/>
                    <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/Practitioner/' + %practitioner.id"/>
                    </parameter>
                  </target>
                </rule>
              </rule>
            </rule>
            <rule>
              <name value="2.16.840.1.113883.2.9.4.3.2"/>
              <source>
                <context value="assAuth"/>
                <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="assPers"/>
              <source>
                <context value="assAuth"/>
                <element value="assignedPerson"/>
                <variable value="asspers"/>
              </source>
              <rule>
                <name value="name"/>
                <source>
                  <context value="asspers"/>
                  <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>
          <name value="medicationesiste"/>
          <source>
            <context value="src"/>
          </source>
          <target>
            <context value="medRq"/>
            <contextType value="variable"/>
            <element value="medication"/>
            <variable value="medication"/>
            <transform value="create"/>
            <parameter>
              <valueString value="CodeableConcept"/>
            </parameter>
          </target>
          <rule>
            <name value="text"/>
            <source>
              <context value="src"/>
              <element value="text"/>
              <variable value="txt"/>
            </source>
            <target>
              <context value="medication"/>
              <contextType value="variable"/>
              <element value="text"/>
              <transform value="copy"/>
              <parameter>
                <valueId value="txt"/>
              </parameter>
            </target>
          </rule>
        </rule>
      </rule>
      <documentation
                     value="Sezione Narrativa------------------------------------------------------------------------------------------------------------------------------------------------"/>
    </rule>
    <rule>
      <name value="sezioneesiste"/>
      <source>
        <context value="src"/>
        <condition value="src.entry.exists()"/>
      </source>
      <rule>
        <name value="medication"/>
        <source>
          <context value="src"/>
        </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="medRq"/>
          <transform value="create"/>
          <parameter>
            <valueString value="MedicationRequest"/>
          </parameter>
        </target>
        <target>
          <context value="medRq"/>
          <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/MedicationRequest/"/>
          </parameter>
          <parameter>
            <valueId value="uuid1"/>
          </parameter>
        </target>
        <target>
          <context value="request"/>
          <contextType value="variable"/>
          <element value="url"/>
          <transform value="copy"/>
          <parameter>
            <valueString value="MedicationRequest"/>
          </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/MedicationRequest/' + %medRq.id"/>
          </parameter>
        </target>
        <target>
          <context value="medRq"/>
          <contextType value="variable"/>
          <element value="note"/>
          <variable value="note"/>
          <transform value="create"/>
          <parameter>
            <valueString value="Annotation"/>
          </parameter>
        </target>
        <rule>
          <name value="reference"/>
          <source>
            <context value="src"/>
            <element value="text"/>
            <variable value="t"/>
          </source>
          <target>
            <context value="note"/>
            <contextType value="variable"/>
            <element value="text"/>
            <transform value="copy"/>
            <parameter>
              <valueId value="t"/>
            </parameter>
          </target>
        </rule>
        <rule>
          <name value="reference"/>
          <source>
            <context value="src"/>
          </source>
          <target>
            <context value="medRq"/>
            <contextType value="variable"/>
            <element value="subject"/>
            <variable value="reference"/>
            <transform value="create"/>
            <parameter>
              <valueString value="Reference"/>
            </parameter>
          </target>
          <target>
            <context value="reference"/>
            <contextType value="variable"/>
            <element value="reference"/>
            <transform value="evaluate"/>
            <parameter>
              <valueString value="'https://example/Patient/' + %patient.id"/>
            </parameter>
          </target>
        </rule>
        <rule>
          <name value="reference"/>
          <source>
            <context value="src"/>
          </source>
          <target>
            <context value="medRq"/>
            <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="status"/>
          <source>
            <context value="src"/>
          </source>
          <target>
            <context value="medRq"/>
            <contextType value="variable"/>
            <element value="status"/>
            <transform value="copy"/>
            <parameter>
              <valueString value="active"/>
            </parameter>
          </target>
        </rule>
        <rule>
          <name value="intent"/>
          <source>
            <context value="src"/>
          </source>
          <target>
            <context value="medRq"/>
            <contextType value="variable"/>
            <element value="intent"/>
            <transform value="copy"/>
            <parameter>
              <valueString value="order"/>
            </parameter>
          </target>
        </rule>
        <rule>
          <name value="auth"/>
          <source>
            <context value="src"/>
            <element value="author"/>
            <variable value="auth"/>
          </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="PUT"/>
            </parameter>
          </target>
          <target>
            <context value="e1"/>
            <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="uuid1"/>
            <transform value="uuid"/>
          </target>
          <target>
            <context value="e1"/>
            <contextType value="variable"/>
            <element value="fullUrl"/>
            <transform value="append"/>
            <parameter>
              <valueString value="https://example/Practitioner/"/>
            </parameter>
            <parameter>
              <valueId value="uuid1"/>
            </parameter>
          </target>
          <target>
            <context value="request"/>
            <contextType value="variable"/>
            <element value="url"/>
            <transform value="append"/>
            <parameter>
              <valueString value="Practitioner/"/>
            </parameter>
            <parameter>
              <valueId value="uuid1"/>
            </parameter>
          </target>
          <rule>
            <name value="time"/>
            <source>
              <context value="auth"/>
              <element value="time"/>
              <variable value="t"/>
            </source>
            <target>
              <context value="note"/>
              <contextType value="variable"/>
              <element value="time"/>
              <variable value="value"/>
              <transform value="create"/>
              <parameter>
                <valueString value="dateTime"/>
              </parameter>
            </target>
            <dependent>
              <name value="TSDateTime"/>
              <variable value="t"/>
              <variable value="value"/>
            </dependent>
          </rule>
          <rule>
            <name value="assAuth"/>
            <source>
              <context value="auth"/>
              <element value="assignedAuthor"/>
              <variable value="assAuth"/>
            </source>
            <rule>
              <name value="meta"/>
              <source>
                <context value="assAuth"/>
              </source>
              <target>
                <context value="practitioner"/>
                <contextType value="variable"/>
                <element value="meta"/>
                <variable value="meta"/>
              </target>
              <rule>
                <name value="coding"/>
                <source>
                  <context value="assAuth"/>
                </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="assAuth"/>
                  </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="assAuth"/>
                  </source>
                  <target>
                    <context value="coding"/>
                    <contextType value="variable"/>
                    <element value="code"/>
                    <transform value="copy"/>
                    <parameter>
                      <valueString
                                   value="ClinicalDocument/body/TerapiaFarmacologicaDimissione/author"/>
                    </parameter>
                  </target>
                </rule>
              </rule>
              <documentation value="assAuth.time -&gt; note.time;"/>
            </rule>
            <rule>
              <name value="identifier"/>
              <source>
                <context value="assAuth"/>
                <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="extension"/>
                <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>
              <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="e1"/>
                    <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="request"/>
                    <contextType value="variable"/>
                    <element value="url"/>
                    <transform value="append"/>
                    <parameter>
                      <valueString value="Practitioner/"/>
                    </parameter>
                    <parameter>
                      <valueId value="uuid2"/>
                    </parameter>
                  </target>
                  <target>
                    <context value="note"/>
                    <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/Practitioner/' + %practitioner.id"/>
                    </parameter>
                  </target>
                </rule>
              </rule>
            </rule>
            <rule>
              <name value="2.16.840.1.113883.2.9.4.3.2"/>
              <source>
                <context value="assAuth"/>
                <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="assPers"/>
              <source>
                <context value="assAuth"/>
                <element value="assignedPerson"/>
                <variable value="asspers"/>
              </source>
              <rule>
                <name value="name"/>
                <source>
                  <context value="asspers"/>
                  <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>
          <name value="entry"/>
          <source>
            <context value="src"/>
            <element value="entry"/>
            <variable value="entry1"/>
          </source>
          <rule>
            <name value="sub"/>
            <source>
              <context value="entry1"/>
              <element value="substanceAdministration"/>
              <variable value="sub"/>
            </source>
            <rule>
              <name value="statusCode"/>
              <source>
                <context value="sub"/>
                <element value="statusCode"/>
                <variable value="vvv"/>
              </source>
              <target>
                <context value="medRq"/>
                <contextType value="variable"/>
                <element value="status"/>
                <variable value="vvv"/>
                <transform value="create"/>
              </target>
            </rule>
            <rule>
              <name value="dosage"/>
              <source>
                <context value="sub"/>
              </source>
              <target>
                <context value="medRq"/>
                <contextType value="variable"/>
                <element value="dosageInstruction"/>
                <variable value="dosage"/>
                <transform value="create"/>
                <parameter>
                  <valueString value="Dosage"/>
                </parameter>
              </target>
              <rule>
                <name value="timing"/>
                <source>
                  <context value="sub"/>
                </source>
                <target>
                  <context value="dosage"/>
                  <contextType value="variable"/>
                  <element value="timing"/>
                  <variable value="tim"/>
                  <transform value="create"/>
                  <parameter>
                    <valueString value="Timing"/>
                  </parameter>
                </target>
                <rule>
                  <name value="repeat"/>
                  <source>
                    <context value="sub"/>
                    <element value="effectiveTime"/>
                    <variable value="eff"/>
                  </source>
                  <target>
                    <context value="tim"/>
                    <contextType value="variable"/>
                    <element value="repeat"/>
                    <variable value="repeat"/>
                  </target>
                  <rule>
                    <name value="boundsperiod"/>
                    <source>
                      <context value="eff"/>
                    </source>
                    <target>
                      <context value="repeat"/>
                      <contextType value="variable"/>
                      <element value="bounds"/>
                      <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>
            </rule>
            <rule>
              <name value="eff"/>
              <source>
                <context value="sub"/>
                <type value="PIVL_TS"/>
                <element value="effectiveTime"/>
                <variable value="eff"/>
              </source>
              <target>
                <context value="medRq"/>
                <contextType value="variable"/>
                <element value="dosageInstruction"/>
                <variable value="dosage"/>
                <transform value="create"/>
                <parameter>
                  <valueString value="Dosage"/>
                </parameter>
              </target>
              <rule>
                <name value="cod"/>
                <source>
                  <context value="eff"/>
                </source>
                <target>
                  <context value="dosage"/>
                  <contextType value="variable"/>
                  <element value="timing"/>
                  <variable value="timing"/>
                  <transform value="create"/>
                  <parameter>
                    <valueString value="Timing"/>
                  </parameter>
                </target>
                <dependent>
                  <name value="periodTiming"/>
                  <variable value="eff"/>
                  <variable value="timing"/>
                </dependent>
              </rule>
            </rule>
            <rule>
              <name value="dosage"/>
              <source>
                <context value="sub"/>
              </source>
              <target>
                <context value="medRq"/>
                <contextType value="variable"/>
                <element value="dosageInstruction"/>
                <variable value="dosage"/>
                <transform value="create"/>
                <parameter>
                  <valueString value="Dosage"/>
                </parameter>
              </target>
              <rule>
                <name value="routeCode"/>
                <source>
                  <context value="sub"/>
                  <element value="routeCode"/>
                  <variable value="vvv"/>
                </source>
                <target>
                  <context value="dosage"/>
                  <contextType value="variable"/>
                  <element value="route"/>
                  <variable value="vvv"/>
                  <transform value="create"/>
                </target>
              </rule>
            </rule>
            <rule>
              <name value="dosage"/>
              <source>
                <context value="sub"/>
              </source>
              <target>
                <context value="medRq"/>
                <contextType value="variable"/>
                <element value="dosageInstruction"/>
                <variable value="dosage"/>
                <transform value="create"/>
                <parameter>
                  <valueString value="Dosage"/>
                </parameter>
              </target>
              <rule>
                <name value="approachSiteCode"/>
                <source>
                  <context value="sub"/>
                  <element value="approachSiteCode"/>
                  <variable value="vvv"/>
                </source>
                <target>
                  <context value="dosage"/>
                  <contextType value="variable"/>
                  <element value="site"/>
                  <variable value="vvv"/>
                  <transform value="create"/>
                </target>
              </rule>
            </rule>
            <rule>
              <name value="doseQuant"/>
              <source>
                <context value="sub"/>
                <element value="doseQuantity"/>
                <variable value="doseQuant"/>
              </source>
              <rule>
                <name value="Dosage"/>
                <source>
                  <context value="doseQuant"/>
                </source>
                <target>
                  <context value="medRq"/>
                  <contextType value="variable"/>
                  <element value="dosageInstruction"/>
                  <variable value="dosageInstruction"/>
                  <transform value="create"/>
                  <parameter>
                    <valueString value="Dosage"/>
                  </parameter>
                </target>
                <rule>
                  <name value="ot"/>
                  <source>
                    <context value="doseQuant"/>
                    <element value="originalText"/>
                    <variable value="ot"/>
                  </source>
                  <rule>
                    <name value="reference"/>
                    <source>
                      <context value="ot"/>
                      <element value="reference"/>
                      <variable value="vvv"/>
                    </source>
                    <target>
                      <context value="dosageInstruction"/>
                      <contextType value="variable"/>
                      <element value="text"/>
                      <variable value="vvv"/>
                      <transform value="create"/>
                    </target>
                  </rule>
                </rule>
                <rule>
                  <name value="dosageRate"/>
                  <source>
                    <context value="doseQuant"/>
                  </source>
                  <target>
                    <context value="dosageInstruction"/>
                    <contextType value="variable"/>
                    <element value="doseAndRate"/>
                    <variable value="dosageRate"/>
                  </target>
                  <rule>
                    <name value="d"/>
                    <source>
                      <context value="doseQuant"/>
                    </source>
                    <target>
                      <context value="dosageRate"/>
                      <contextType value="variable"/>
                      <element value="dose"/>
                      <variable value="d"/>
                      <transform value="create"/>
                      <parameter>
                        <valueString value="Range"/>
                      </parameter>
                    </target>
                    <rule>
                      <name value="low"/>
                      <source>
                        <context value="doseQuant"/>
                      </source>
                      <target>
                        <context value="d"/>
                        <contextType value="variable"/>
                        <element value="low"/>
                        <variable value="l"/>
                        <transform value="create"/>
                        <parameter>
                          <valueString value="SimpleQuantity"/>
                        </parameter>
                      </target>
                      <rule>
                        <name value="low"/>
                        <source>
                          <context value="doseQuant"/>
                          <element value="low"/>
                          <variable value="lo"/>
                        </source>
                        <target>
                          <context value="l"/>
                          <contextType value="variable"/>
                          <element value="value"/>
                          <transform value="evaluate"/>
                          <parameter>
                            <valueString value="lo.value"/>
                          </parameter>
                        </target>
                      </rule>
                      <rule>
                        <name value="low"/>
                        <source>
                          <context value="doseQuant"/>
                          <element value="low"/>
                          <variable value="lo"/>
                        </source>
                        <target>
                          <context value="l"/>
                          <contextType value="variable"/>
                          <element value="unit"/>
                          <transform value="evaluate"/>
                          <parameter>
                            <valueString value="lo.unit"/>
                          </parameter>
                        </target>
                      </rule>
                    </rule>
                    <rule>
                      <name value="low"/>
                      <source>
                        <context value="doseQuant"/>
                      </source>
                      <target>
                        <context value="d"/>
                        <contextType value="variable"/>
                        <element value="high"/>
                        <variable value="h"/>
                        <transform value="create"/>
                        <parameter>
                          <valueString value="SimpleQuantity"/>
                        </parameter>
                      </target>
                      <rule>
                        <name value="high"/>
                        <source>
                          <context value="doseQuant"/>
                          <element value="high"/>
                          <variable value="hi"/>
                        </source>
                        <target>
                          <context value="h"/>
                          <contextType value="variable"/>
                          <element value="value"/>
                          <transform value="evaluate"/>
                          <parameter>
                            <valueString value="hi.value"/>
                          </parameter>
                        </target>
                      </rule>
                      <rule>
                        <name value="high"/>
                        <source>
                          <context value="doseQuant"/>
                          <element value="high"/>
                          <variable value="hi"/>
                        </source>
                        <target>
                          <context value="h"/>
                          <contextType value="variable"/>
                          <element value="unit"/>
                          <transform value="evaluate"/>
                          <parameter>
                            <valueString value="hi.unit"/>
                          </parameter>
                        </target>
                      </rule>
                    </rule>
                  </rule>
                </rule>
                <rule>
                  <name value="dosageRate"/>
                  <source>
                    <context value="sub"/>
                    <element value="rateQuantity"/>
                    <variable value="rateQuantity"/>
                  </source>
                  <target>
                    <context value="medRq"/>
                    <contextType value="variable"/>
                    <element value="dosageInstruction"/>
                    <variable value="dosageInstruction1"/>
                    <transform value="create"/>
                    <parameter>
                      <valueString value="Dosage"/>
                    </parameter>
                  </target>
                  <rule>
                    <name value="ot"/>
                    <source>
                      <context value="rateQuantity"/>
                      <element value="originalText"/>
                      <variable value="ot"/>
                    </source>
                    <rule>
                      <name value="reference"/>
                      <source>
                        <context value="ot"/>
                        <element value="reference"/>
                        <variable value="vvv"/>
                      </source>
                      <target>
                        <context value="dosageInstruction1"/>
                        <contextType value="variable"/>
                        <element value="text"/>
                        <variable value="vvv"/>
                        <transform value="create"/>
                      </target>
                    </rule>
                  </rule>
                  <rule>
                    <name value="qualcosa"/>
                    <source>
                      <context value="rateQuantity"/>
                    </source>
                    <target>
                      <context value="dosageInstruction1"/>
                      <contextType value="variable"/>
                      <element value="doseAndRate"/>
                      <variable value="dosageRate"/>
                    </target>
                    <rule>
                      <name value="d"/>
                      <source>
                        <context value="rateQuantity"/>
                      </source>
                      <target>
                        <context value="dosageRate"/>
                        <contextType value="variable"/>
                        <element value="rate"/>
                        <variable value="d"/>
                        <transform value="create"/>
                        <parameter>
                          <valueString value="Range"/>
                        </parameter>
                      </target>
                      <rule>
                        <name value="low"/>
                        <source>
                          <context value="rateQuantity"/>
                        </source>
                        <target>
                          <context value="d"/>
                          <contextType value="variable"/>
                          <element value="low"/>
                          <variable value="l"/>
                          <transform value="create"/>
                          <parameter>
                            <valueString value="SimpleQuantity"/>
                          </parameter>
                        </target>
                        <rule>
                          <name value="low"/>
                          <source>
                            <context value="rateQuantity"/>
                            <element value="low"/>
                            <variable value="lo"/>
                          </source>
                          <target>
                            <context value="l"/>
                            <contextType value="variable"/>
                            <element value="value"/>
                            <transform value="evaluate"/>
                            <parameter>
                              <valueString value="lo.value"/>
                            </parameter>
                          </target>
                        </rule>
                        <rule>
                          <name value="low"/>
                          <source>
                            <context value="rateQuantity"/>
                            <element value="low"/>
                            <variable value="lo"/>
                          </source>
                          <target>
                            <context value="l"/>
                            <contextType value="variable"/>
                            <element value="unit"/>
                            <transform value="evaluate"/>
                            <parameter>
                              <valueString value="lo.unit"/>
                            </parameter>
                          </target>
                        </rule>
                      </rule>
                      <rule>
                        <name value="low"/>
                        <source>
                          <context value="rateQuantity"/>
                        </source>
                        <target>
                          <context value="d"/>
                          <contextType value="variable"/>
                          <element value="high"/>
                          <variable value="h"/>
                          <transform value="create"/>
                          <parameter>
                            <valueString value="SimpleQuantity"/>
                          </parameter>
                        </target>
                        <rule>
                          <name value="high"/>
                          <source>
                            <context value="rateQuantity"/>
                            <element value="high"/>
                            <variable value="hi"/>
                          </source>
                          <target>
                            <context value="h"/>
                            <contextType value="variable"/>
                            <element value="value"/>
                            <transform value="evaluate"/>
                            <parameter>
                              <valueString value="hi.value"/>
                            </parameter>
                          </target>
                        </rule>
                        <rule>
                          <name value="high"/>
                          <source>
                            <context value="rateQuantity"/>
                            <element value="high"/>
                            <variable value="hi"/>
                          </source>
                          <target>
                            <context value="h"/>
                            <contextType value="variable"/>
                            <element value="unit"/>
                            <transform value="evaluate"/>
                            <parameter>
                              <valueString value="hi.unit"/>
                            </parameter>
                          </target>
                        </rule>
                      </rule>
                    </rule>
                  </rule>
                </rule>
              </rule>
            </rule>
            <rule>
              <name value="admnistrationUnicode"/>
              <source>
                <context value="sub"/>
              </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="medication"/>
                <transform value="create"/>
                <parameter>
                  <valueString value="Medication"/>
                </parameter>
              </target>
              <target>
                <context value="medication"/>
                <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/Medication/"/>
                </parameter>
                <parameter>
                  <valueId value="uuid1"/>
                </parameter>
              </target>
              <target>
                <context value="request"/>
                <contextType value="variable"/>
                <element value="url"/>
                <transform value="copy"/>
                <parameter>
                  <valueString value="Medication"/>
                </parameter>
              </target>
              <target>
                <context value="medRq"/>
                <contextType value="variable"/>
                <element value="medication"/>
                <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/Medication/' + %medication.id"/>
                </parameter>
              </target>
              <rule>
                <name value="administrationUnitCode"/>
                <source>
                  <context value="sub"/>
                  <element value="administrationUnitCode"/>
                  <variable value="vvv"/>
                </source>
                <target>
                  <context value="medication"/>
                  <contextType value="variable"/>
                  <element value="form"/>
                  <variable value="vvv"/>
                  <transform value="create"/>
                </target>
              </rule>
              <rule>
                <name value="cons"/>
                <source>
                  <context value="sub"/>
                  <element value="consumable"/>
                  <variable value="cons"/>
                </source>
                <rule>
                  <name value="manumat"/>
                  <source>
                    <context value="cons"/>
                    <element value="manufacturedProduct"/>
                    <variable value="manuprod"/>
                  </source>
                  <rule>
                    <name value="manuFact"/>
                    <source>
                      <context value="manuprod"/>
                      <element value="manufacturedMaterial"/>
                      <variable value="manufact"/>
                    </source>
                    <rule>
                      <name value="code"/>
                      <source>
                        <context value="manufact"/>
                        <element value="code"/>
                        <variable value="vvv"/>
                      </source>
                      <target>
                        <context value="medication"/>
                        <contextType value="variable"/>
                        <element value="code"/>
                        <variable value="vvv"/>
                        <transform value="create"/>
                      </target>
                    </rule>
                  </rule>
                </rule>
              </rule>
              <rule>
                <name value="entryR"/>
                <source>
                  <context value="sub"/>
                  <element value="entryRelationship"/>
                  <variable value="entryR"/>
                </source>
                <rule>
                  <name value="obs"/>
                  <source>
                    <context value="entryR"/>
                    <element value="observation"/>
                    <variable value="observation"/>
                  </source>
                  <rule>
                    <name value="ingredient"/>
                    <source>
                      <context value="observation"/>
                      <element value="code"/>
                      <condition value="displayName = 'Grammatura'"/>
                    </source>
                    <target>
                      <context value="medication"/>
                      <contextType value="variable"/>
                      <element value="ingredient"/>
                      <variable value="ingredient"/>
                    </target>
                    <rule>
                      <name value="consumable"/>
                      <source>
                        <context value="sub"/>
                        <element value="consumable"/>
                        <variable value="consumable"/>
                      </source>
                      <rule>
                        <name value="product"/>
                        <source>
                          <context value="consumable"/>
                          <element value="manufacturedProduct"/>
                          <variable value="manufacturedProduct"/>
                        </source>
                        <rule>
                          <name value="material"/>
                          <source>
                            <context value="manufacturedProduct"/>
                            <element value="manufacturedMaterial"/>
                            <variable value="manufacturedMaterial"/>
                          </source>
                          <rule>
                            <name value="CE"/>
                            <source>
                              <context value="manufacturedMaterial"/>
                              <element value="code"/>
                              <variable value="code"/>
                            </source>
                            <target>
                              <context value="ingredient"/>
                              <contextType value="variable"/>
                              <element value="item"/>
                              <variable value="value"/>
                              <transform value="create"/>
                              <parameter>
                                <valueString value="CodeableConcept"/>
                              </parameter>
                            </target>
                            <dependent>
                              <name value="CECodeableConcept"/>
                              <variable value="code"/>
                              <variable value="value"/>
                            </dependent>
                          </rule>
                        </rule>
                      </rule>
                    </rule>
                    <rule>
                      <name value="strenght"/>
                      <source>
                        <context value="observation"/>
                        <element value="value"/>
                        <variable value="value"/>
                      </source>
                      <target>
                        <context value="ingredient"/>
                        <contextType value="variable"/>
                        <element value="strength"/>
                        <variable value="strength"/>
                      </target>
                      <rule>
                        <name value="numerator"/>
                        <source>
                          <context value="value"/>
                        </source>
                        <target>
                          <context value="strength"/>
                          <contextType value="variable"/>
                          <element value="numerator"/>
                          <variable value="numerator"/>
                        </target>
                        <rule>
                          <name value="valueN"/>
                          <source>
                            <context value="value"/>
                          </source>
                          <target>
                            <context value="numerator"/>
                            <contextType value="variable"/>
                            <element value="value"/>
                            <transform value="evaluate"/>
                            <parameter>
                              <valueString value="value.value"/>
                            </parameter>
                          </target>
                        </rule>
                      </rule>
                      <rule>
                        <name value="denominator"/>
                        <source>
                          <context value="value"/>
                        </source>
                        <target>
                          <context value="strength"/>
                          <contextType value="variable"/>
                          <element value="denominator"/>
                          <variable value="denominator"/>
                        </target>
                        <rule>
                          <name value="valueD"/>
                          <source>
                            <context value="value"/>
                          </source>
                          <target>
                            <context value="denominator"/>
                            <contextType value="variable"/>
                            <element value="value"/>
                            <transform value="copy"/>
                            <parameter>
                              <valueInteger value="1"/>
                            </parameter>
                          </target>
                        </rule>
                      </rule>
                    </rule>
                  </rule>
                  <rule>
                    <name value="quantita"/>
                    <source>
                      <context value="observation"/>
                      <element value="code"/>
                      <condition
                                 value="displayName = 'Quantità nella Confezione'"/>
                    </source>
                    <rule>
                      <name value="amount"/>
                      <source>
                        <context value="observation"/>
                        <element value="value"/>
                        <variable value="value"/>
                      </source>
                      <target>
                        <context value="medication"/>
                        <contextType value="variable"/>
                        <element value="amount"/>
                        <variable value="amount"/>
                      </target>
                      <rule>
                        <name value="numerator"/>
                        <source>
                          <context value="value"/>
                        </source>
                        <target>
                          <context value="amount"/>
                          <contextType value="variable"/>
                          <element value="numerator"/>
                          <variable value="numerator"/>
                        </target>
                        <rule>
                          <name value="valueN"/>
                          <source>
                            <context value="value"/>
                          </source>
                          <target>
                            <context value="numerator"/>
                            <contextType value="variable"/>
                            <element value="value"/>
                            <transform value="evaluate"/>
                            <parameter>
                              <valueString value="value.value"/>
                            </parameter>
                          </target>
                        </rule>
                      </rule>
                      <rule>
                        <name value="denominator"/>
                        <source>
                          <context value="value"/>
                        </source>
                        <target>
                          <context value="amount"/>
                          <contextType value="variable"/>
                          <element value="denominator"/>
                          <variable value="denominator"/>
                        </target>
                        <rule>
                          <name value="valueD"/>
                          <source>
                            <context value="value"/>
                          </source>
                          <target>
                            <context value="denominator"/>
                            <contextType value="variable"/>
                            <element value="value"/>
                            <transform value="copy"/>
                            <parameter>
                              <valueInteger value="1"/>
                            </parameter>
                          </target>
                        </rule>
                      </rule>
                    </rule>
                  </rule>
                </rule>
              </rule>
              <rule>
                <name value="participant"/>
                <source>
                  <context value="sub"/>
                  <element value="participant"/>
                  <variable value="part"/>
                </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="PUT"/>
                  </parameter>
                </target>
                <target>
                  <context value="e1"/>
                  <contextType value="variable"/>
                  <element value="resource"/>
                  <variable value="participant"/>
                  <transform value="create"/>
                  <parameter>
                    <valueString value="Practitioner"/>
                  </parameter>
                </target>
                <target>
                  <context value="participant"/>
                  <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/Participant/"/>
                  </parameter>
                  <parameter>
                    <valueId value="uuid1"/>
                  </parameter>
                </target>
                <target>
                  <context value="request"/>
                  <contextType value="variable"/>
                  <element value="url"/>
                  <transform value="append"/>
                  <parameter>
                    <valueString value="Participant/"/>
                  </parameter>
                  <parameter>
                    <valueId value="uuid1"/>
                  </parameter>
                </target>
                <rule>
                  <name value="authoredOn"/>
                  <source>
                    <context value="part"/>
                    <element value="time"/>
                    <variable value="t"/>
                  </source>
                  <target>
                    <context value="medRq"/>
                    <contextType value="variable"/>
                    <element value="authoredOn"/>
                    <variable value="date"/>
                    <transform value="create"/>
                    <parameter>
                      <valueString value="dateTime"/>
                    </parameter>
                  </target>
                  <dependent>
                    <name value="TSDateTime"/>
                    <variable value="t"/>
                    <variable value="date"/>
                  </dependent>
                </rule>
                <rule>
                  <name value="partRole"/>
                  <source>
                    <context value="part"/>
                    <element value="participantRole"/>
                    <variable value="partRole"/>
                  </source>
                  <rule>
                    <name value="meta"/>
                    <source>
                      <context value="partRole"/>
                    </source>
                    <target>
                      <context value="participant"/>
                      <contextType value="variable"/>
                      <element value="meta"/>
                      <variable value="meta"/>
                    </target>
                    <rule>
                      <name value="coding"/>
                      <source>
                        <context value="partRole"/>
                      </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="partRole"/>
                        </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="partRole"/>
                        </source>
                        <target>
                          <context value="coding"/>
                          <contextType value="variable"/>
                          <element value="code"/>
                          <transform value="copy"/>
                          <parameter>
                            <valueString
                                         value="ClinicalDocument/body/TerapiaFarmacologicaDimissione/participant"/>
                          </parameter>
                        </target>
                      </rule>
                    </rule>
                  </rule>
                  <rule>
                    <name value="identifier"/>
                    <source>
                      <context value="partRole"/>
                      <element value="id"/>
                      <variable value="id"/>
                    </source>
                    <target>
                      <context value="participant"/>
                      <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="extension"/>
                      <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>
                    <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="participant"/>
                          <contextType value="variable"/>
                          <element value="id"/>
                          <variable value="uuid2"/>
                          <transform value="evaluate"/>
                          <parameter>
                            <valueString value="r + '-' + ext"/>
                          </parameter>
                        </target>
                        <target>
                          <context value="e1"/>
                          <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="request"/>
                          <contextType value="variable"/>
                          <element value="url"/>
                          <transform value="append"/>
                          <parameter>
                            <valueString value="Practitioner/"/>
                          </parameter>
                          <parameter>
                            <valueId value="uuid2"/>
                          </parameter>
                        </target>
                        <target>
                          <context value="medRq"/>
                          <contextType value="variable"/>
                          <element value="requester"/>
                          <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/' + %participant.id"/>
                          </parameter>
                        </target>
                      </rule>
                    </rule>
                  </rule>
                  <rule>
                    <name value="2.16.840.1.113883.2.9.4.3.2"/>
                    <source>
                      <context value="partRole"/>
                      <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="playent"/>
                    <source>
                      <context value="partRole"/>
                      <element value="playingEntity"/>
                      <variable value="playent"/>
                    </source>
                    <rule>
                      <name value="name"/>
                      <source>
                        <context value="playent"/>
                        <element value="name"/>
                        <variable value="vvv"/>
                      </source>
                      <target>
                        <context value="participant"/>
                        <contextType value="variable"/>
                        <element value="name"/>
                        <variable value="vvv"/>
                        <transform value="create"/>
                      </target>
                    </rule>
                  </rule>
                </rule>
              </rule>
              <rule>
                <name value="ref"/>
                <source>
                  <context value="sub"/>
                  <element value="reference"/>
                  <variable value="ref"/>
                </source>
                <rule>
                  <name value="external"/>
                  <source>
                    <context value="ref"/>
                    <element value="externalAct"/>
                    <variable value="external"/>
                  </source>
                  <rule>
                    <name value="id"/>
                    <source>
                      <context value="external"/>
                      <element value="id"/>
                      <variable value="vvv"/>
                    </source>
                    <target>
                      <context value="medRq"/>
                      <contextType value="variable"/>
                      <element value="identifier"/>
                      <variable value="vvv"/>
                      <transform value="create"/>
                    </target>
                  </rule>
                </rule>
              </rule>
              <rule>
                <name value="med"/>
                <source>
                  <context value="sub"/>
                  <element value="entryRelationship"/>
                  <variable value="entryRelationship"/>
                </source>
                <rule>
                  <name value="sub"/>
                  <source>
                    <context value="entryRelationship"/>
                    <element value="supply"/>
                    <variable value="sup"/>
                  </source>
                  <target>
                    <context value="medRq"/>
                    <contextType value="variable"/>
                    <element value="dispenseRequest"/>
                    <variable value="dispreq"/>
                  </target>
                  <rule>
                    <name value="quantity"/>
                    <source>
                      <context value="sup"/>
                    </source>
                    <target>
                      <context value="dispreq"/>
                      <contextType value="variable"/>
                      <element value="quantity"/>
                      <variable value="quantity"/>
                      <transform value="create"/>
                      <parameter>
                        <valueString value="SimpleQuantity"/>
                      </parameter>
                    </target>
                    <rule>
                      <name value="quantity"/>
                      <source>
                        <context value="sup"/>
                        <element value="quantity"/>
                        <variable value="q"/>
                      </source>
                      <target>
                        <context value="quantity"/>
                        <contextType value="variable"/>
                        <element value="value"/>
                        <transform value="evaluate"/>
                        <parameter>
                          <valueString value="q.value"/>
                        </parameter>
                      </target>
                    </rule>
                  </rule>
                </rule>
              </rule>
            </rule>
          </rule>
        </rule>
      </rule>
      <documentation
                     value="Sezione Strutturata------------------------------------------------------------------------------------------------------------------------------------------"/>
    </rule>
  </group>
  <group>
    <name value="ModalitadiTrasposto"/>
    <typeMode value="none"/>
    <documentation
                   value="-----------------------------------------------------------------------------------------------------------------------
______1._____________Sections________________________"/>
    <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>
    <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>
      <rule>
        <name value="entry1"/>
        <source>
          <context value="src"/>
          <element value="entry"/>
          <variable value="entry1"/>
        </source>
        <target>
          <context value="tgt"/>
          <contextType value="variable"/>
          <element value="entry"/>
          <variable value="reference"/>
          <transform value="create"/>
          <parameter>
            <valueString value="Reference"/>
          </parameter>
        </target>
        <target>
          <context value="reference"/>
          <contextType value="variable"/>
          <element value="reference"/>
          <transform value="evaluate"/>
          <parameter>
            <valueString value="'https://example/Encounter/' + %enc.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="enc"/>
            <variable value="bundle"/>
          </dependent>
        </rule>
      </rule>
    </rule>
  </group>
  <group>
    <name value="MotivoDellaVisita"/>
    <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>
    <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="entry"/>
      </source>
      <target>
        <context value="bundle"/>
        <contextType value="variable"/>
        <element value="entry"/>
        <variable value="e2"/>
      </target>
      <target>
        <context value="e2"/>
        <contextType value="variable"/>
        <element value="request"/>
        <variable value="request"/>
        <transform value="create"/>
        <parameter>
          <valueString value="BackboneElement"/>
        </parameter>
      </target>
      <target>
        <context value="request"/>
        <contextType value="variable"/>
        <element value="method"/>
        <transform value="copy"/>
        <parameter>
          <valueString value="POST"/>
        </parameter>
      </target>
      <target>
        <context value="e2"/>
        <contextType value="variable"/>
        <element value="resource"/>
        <variable value="observation"/>
        <transform value="create"/>
        <parameter>
          <valueString value="Observation"/>
        </parameter>
      </target>
      <target>
        <context value="observation"/>
        <contextType value="variable"/>
        <element value="id"/>
        <variable value="uuid2"/>
        <transform value="uuid"/>
      </target>
      <target>
        <context value="e2"/>
        <contextType value="variable"/>
        <element value="fullUrl"/>
        <transform value="append"/>
        <parameter>
          <valueString value="https://example/Observation/"/>
        </parameter>
        <parameter>
          <valueId value="uuid2"/>
        </parameter>
      </target>
      <target>
        <context value="request"/>
        <contextType value="variable"/>
        <element value="url"/>
        <transform value="copy"/>
        <parameter>
          <valueString value="Observation"/>
        </parameter>
      </target>
      <target>
        <context value="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/Observation/' + %observation.id"/>
        </parameter>
      </target>
      <rule>
        <name value="observation"/>
        <source>
          <context value="entry"/>
          <element value="observation"/>
          <variable value="obs"/>
        </source>
        <dependent>
          <name value="Observation"/>
          <variable value="obs"/>
          <variable value="patient"/>
          <variable value="enc"/>
          <variable value="observation"/>
          <variable value="bundle"/>
        </dependent>
      </rule>
    </rule>
  </group>
  <group>
    <name value="Triage"/>
    <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>
    <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="entry"/>
      </source>
      <target>
        <context value="bundle"/>
        <contextType value="variable"/>
        <element value="entry"/>
        <variable value="e2"/>
      </target>
      <target>
        <context value="e2"/>
        <contextType value="variable"/>
        <element value="request"/>
        <variable value="request"/>
        <transform value="create"/>
        <parameter>
          <valueString value="BackboneElement"/>
        </parameter>
      </target>
      <target>
        <context value="request"/>
        <contextType value="variable"/>
        <element value="method"/>
        <transform value="copy"/>
        <parameter>
          <valueString value="POST"/>
        </parameter>
      </target>
      <target>
        <context value="e2"/>
        <contextType value="variable"/>
        <element value="resource"/>
        <variable value="observation"/>
        <transform value="create"/>
        <parameter>
          <valueString value="Observation"/>
        </parameter>
      </target>
      <target>
        <context value="observation"/>
        <contextType value="variable"/>
        <element value="id"/>
        <variable value="uuid2"/>
        <transform value="uuid"/>
      </target>
      <target>
        <context value="e2"/>
        <contextType value="variable"/>
        <element value="fullUrl"/>
        <transform value="append"/>
        <parameter>
          <valueString value="https://example/Observation/"/>
        </parameter>
        <parameter>
          <valueId value="uuid2"/>
        </parameter>
      </target>
      <target>
        <context value="request"/>
        <contextType value="variable"/>
        <element value="url"/>
        <transform value="copy"/>
        <parameter>
          <valueString value="Observation"/>
        </parameter>
      </target>
      <target>
        <context value="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/Observation/' + %observation.id"/>
        </parameter>
      </target>
      <rule>
        <name value="observation"/>
        <source>
          <context value="entry"/>
          <element value="observation"/>
          <variable value="obs"/>
        </source>
        <dependent>
          <name value="Observation"/>
          <variable value="obs"/>
          <variable value="patient"/>
          <variable value="enc"/>
          <variable value="observation"/>
          <variable value="bundle"/>
        </dependent>
      </rule>
    </rule>
  </group>
  <group>
    <name value="InquadramentoClinicoIniziale"/>
    <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>
    <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="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="observation"/>
        <transform value="create"/>
        <parameter>
          <valueString value="Observation"/>
        </parameter>
      </target>
      <target>
        <context value="observation"/>
        <contextType value="variable"/>
        <element value="id"/>
        <variable value="uuid1"/>
        <transform value="uuid"/>
      </target>
      <target>
        <context value="e1"/>
        <contextType value="variable"/>
        <element value="fullUrl"/>
        <transform value="append"/>
        <parameter>
          <valueString value="https://example/Observation/"/>
        </parameter>
        <parameter>
          <valueId value="uuid1"/>
        </parameter>
      </target>
      <target>
        <context value="request"/>
        <contextType value="variable"/>
        <element value="url"/>
        <transform value="copy"/>
        <parameter>
          <valueString value="Observation"/>
        </parameter>
      </target>
      <target>
        <context value="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/Observation/' + %observation.id"/>
        </parameter>
      </target>
      <target>
        <context value="tgt"/>
        <contextType value="variable"/>
        <element value="text"/>
        <variable value="fhirText"/>
      </target>
      <rule>
        <name value="code"/>
        <source>
          <context value="src"/>
          <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="statuscode"/>
        <source>
          <context value="src"/>
          <condition value="observation.statusCode.exists().not()"/>
        </source>
        <rule>
          <name value="status"/>
          <source>
            <context value="src"/>
          </source>
          <target>
            <context value="observation"/>
            <contextType value="variable"/>
            <element value="status"/>
            <transform value="copy"/>
            <parameter>
              <valueString value="final"/>
            </parameter>
          </target>
        </rule>
      </rule>
      <rule>
        <name value="reference"/>
        <source>
          <context value="src"/>
        </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="src"/>
        </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/' + %enc.id"/>
          </parameter>
        </target>
      </rule>
      <rule>
        <name value="reference"/>
        <source>
          <context value="cdaText"/>
        </source>
        <target>
          <context value="observation"/>
          <contextType value="variable"/>
          <element value="note"/>
          <variable value="note"/>
        </target>
        <rule>
          <name value="Author"/>
          <source>
            <context value="src"/>
            <element value="author"/>
            <variable value="author"/>
          </source>
          <rule>
            <name value="practitioner"/>
            <source>
              <context value="author"/>
            </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="assignedAuthor"/>
              <source>
                <context value="author"/>
                <element value="assignedAuthor"/>
                <variable value="assignedAuthor"/>
              </source>
              <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/InquadramentoClinicoIniziale/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="extension"/>
                  <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>
                <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="request"/>
                      <contextType value="variable"/>
                      <element value="url"/>
                      <transform value="append"/>
                      <parameter>
                        <valueString value="Practitioner/"/>
                      </parameter>
                      <parameter>
                        <valueId value="uuid2"/>
                      </parameter>
                    </target>
                    <target>
                      <context value="note"/>
                      <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/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="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>
            </rule>
          </rule>
          <rule>
            <name value="time"/>
            <source>
              <context value="author"/>
              <element value="time"/>
              <variable value="t"/>
            </source>
            <target>
              <context value="note"/>
              <contextType value="variable"/>
              <element value="time"/>
              <variable value="value"/>
              <transform value="create"/>
              <parameter>
                <valueString value="dateTime"/>
              </parameter>
            </target>
            <dependent>
              <name value="TSDateTime"/>
              <variable value="t"/>
              <variable value="value"/>
            </dependent>
          </rule>
        </rule>
        <rule>
          <name value="reference"/>
          <source>
            <context value="cdaText"/>
            <variable value="t"/>
          </source>
          <target>
            <context value="note"/>
            <contextType value="variable"/>
            <element value="text"/>
            <transform value="copy"/>
            <parameter>
              <valueId value="t"/>
            </parameter>
          </target>
        </rule>
      </rule>
    </rule>
    <rule>
      <name value="component"/>
      <source>
        <context value="src"/>
        <element value="component"/>
        <variable value="component"/>
      </source>
      <rule>
        <name value="Sottosection"/>
        <source>
          <context value="component"/>
          <element value="section"/>
          <variable value="sottosection"/>
        </source>
        <rule>
          <name value="Sectionfhir"/>
          <source>
            <context value="sottosection"/>
          </source>
          <target>
            <context value="tgt"/>
            <contextType value="variable"/>
            <element value="section"/>
            <variable value="section"/>
          </target>
          <rule>
            <name value="code"/>
            <source>
              <context value="sottosection"/>
              <element value="code"/>
              <variable value="vvv"/>
              <condition value="(code = '11329-0')"/>
            </source>
            <target>
              <context value="section"/>
              <contextType value="variable"/>
              <element value="code"/>
              <variable value="vvv"/>
              <transform value="create"/>
            </target>
            <documentation
                           value="1. Anamnesi Narrativa-------------------------------------------------------------------------------------------------------------------------------------------"/>
          </rule>
          <rule>
            <name value="11329-0"/>
            <source>
              <context value="sottosection"/>
              <element value="code"/>
              <variable value="code1"/>
              <condition value="(code = '11329-0')"/>
            </source>
            <rule>
              <name value="where"/>
              <source>
                <context value="src"/>
                <condition value="sottosection.entry.exists().not()"/>
              </source>
              <rule>
                <name value="title"/>
                <source>
                  <context value="sottosection"/>
                  <element value="title"/>
                  <variable value="t"/>
                </source>
                <target>
                  <context value="section"/>
                  <contextType value="variable"/>
                  <element value="title"/>
                  <transform value="evaluate"/>
                  <parameter>
                    <valueString value="t.dataString"/>
                  </parameter>
                </target>
              </rule>
              <rule>
                <name value="cdaText"/>
                <source>
                  <context value="sottosection"/>
                  <element value="text"/>
                  <variable value="cdaText"/>
                </source>
                <target>
                  <context value="bundle"/>
                  <contextType value="variable"/>
                  <element value="entry"/>
                  <variable value="e8"/>
                </target>
                <target>
                  <context value="e8"/>
                  <contextType value="variable"/>
                  <element value="request"/>
                  <variable value="request"/>
                  <transform value="create"/>
                  <parameter>
                    <valueString value="BackboneElement"/>
                  </parameter>
                </target>
                <target>
                  <context value="request"/>
                  <contextType value="variable"/>
                  <element value="method"/>
                  <transform value="copy"/>
                  <parameter>
                    <valueString value="POST"/>
                  </parameter>
                </target>
                <target>
                  <context value="e8"/>
                  <contextType value="variable"/>
                  <element value="resource"/>
                  <variable value="observation"/>
                  <transform value="create"/>
                  <parameter>
                    <valueString value="Observation"/>
                  </parameter>
                </target>
                <target>
                  <context value="observation"/>
                  <contextType value="variable"/>
                  <element value="id"/>
                  <variable value="uuid8"/>
                  <transform value="uuid"/>
                </target>
                <target>
                  <context value="e8"/>
                  <contextType value="variable"/>
                  <element value="fullUrl"/>
                  <transform value="append"/>
                  <parameter>
                    <valueString value="https://example/Observation/"/>
                  </parameter>
                  <parameter>
                    <valueId value="uuid8"/>
                  </parameter>
                </target>
                <target>
                  <context value="request"/>
                  <contextType value="variable"/>
                  <element value="url"/>
                  <transform value="copy"/>
                  <parameter>
                    <valueString value="Observation"/>
                  </parameter>
                </target>
                <target>
                  <context value="section"/>
                  <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/Observation/' + %observation.id"/>
                  </parameter>
                </target>
                <rule>
                  <name value="reference"/>
                  <source>
                    <context value="cdaText"/>
                  </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="cdaText"/>
                  </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/' + %enc.id"/>
                    </parameter>
                  </target>
                </rule>
                <rule>
                  <name value="code"/>
                  <source>
                    <context value="sottosection"/>
                    <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="statuscode"/>
                  <source>
                    <context value="src"/>
                    <condition value="observation.statusCode.exists().not()"/>
                  </source>
                  <rule>
                    <name value="status"/>
                    <source>
                      <context value="src"/>
                    </source>
                    <target>
                      <context value="observation"/>
                      <contextType value="variable"/>
                      <element value="status"/>
                      <transform value="copy"/>
                      <parameter>
                        <valueString value="final"/>
                      </parameter>
                    </target>
                  </rule>
                </rule>
                <rule>
                  <name value="reference"/>
                  <source>
                    <context value="cdaText"/>
                  </source>
                  <target>
                    <context value="observation"/>
                    <contextType value="variable"/>
                    <element value="note"/>
                    <variable value="note"/>
                  </target>
                  <rule>
                    <name value="reference"/>
                    <source>
                      <context value="cdaText"/>
                      <variable value="t"/>
                    </source>
                    <target>
                      <context value="note"/>
                      <contextType value="variable"/>
                      <element value="text"/>
                      <transform value="copy"/>
                      <parameter>
                        <valueId value="t"/>
                      </parameter>
                    </target>
                  </rule>
                  <rule>
                    <name value="author"/>
                    <source>
                      <context value="sottosection"/>
                      <element value="author"/>
                      <variable value="authors"/>
                    </source>
                    <rule>
                      <name value="timeAuthor"/>
                      <source>
                        <context value="authors"/>
                        <element value="time"/>
                        <variable value="time"/>
                      </source>
                      <target>
                        <context value="note"/>
                        <contextType value="variable"/>
                        <element value="time"/>
                        <variable value="value"/>
                        <transform value="create"/>
                        <parameter>
                          <valueString value="dateTime"/>
                        </parameter>
                      </target>
                      <dependent>
                        <name value="TSDateTime"/>
                        <variable value="time"/>
                        <variable value="value"/>
                      </dependent>
                    </rule>
                    <rule>
                      <name value="assighedAuthor"/>
                      <source>
                        <context value="authors"/>
                        <element value="assignedAuthor"/>
                        <variable value="assignedAuthor"/>
                      </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="practitioner"/>
                        <transform value="create"/>
                        <parameter>
                          <valueString value="Practitioner"/>
                        </parameter>
                      </target>
                      <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/EsameObiettivo/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="extension"/>
                          <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>
                        <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="autore"/>
                            <source>
                              <context value="id"/>
                              <element value="extension"/>
                              <variable value="ext"/>
                            </source>
                            <target>
                              <context value="practitioner"/>
                              <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/Practitioner/"/>
                              </parameter>
                              <parameter>
                                <valueId value="uuid9"/>
                              </parameter>
                            </target>
                            <target>
                              <context value="request"/>
                              <contextType value="variable"/>
                              <element value="url"/>
                              <transform value="append"/>
                              <parameter>
                                <valueString value="Practitioner/"/>
                              </parameter>
                              <parameter>
                                <valueId value="uuid9"/>
                              </parameter>
                            </target>
                            <target>
                              <context value="note"/>
                              <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/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="assignedPerson"/>
                        <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>
                    </rule>
                  </rule>
                </rule>
              </rule>
            </rule>
            <rule>
              <name value="subsection1"/>
              <source>
                <context value="sottosection"/>
                <element value="entry"/>
                <variable value="entry1"/>
              </source>
              <rule>
                <name value="entryobservation1"/>
                <source>
                  <context value="entry1"/>
                  <element value="observation"/>
                  <variable value="obs"/>
                </source>
                <rule>
                  <name value="89261-2"/>
                  <source>
                    <context value="obs"/>
                    <element value="code"/>
                    <condition value="(code = '75326-9')"/>
                  </source>
                  <rule>
                    <name value="condition"/>
                    <source>
                      <context value="obs"/>
                    </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="condition"/>
                      <transform value="create"/>
                      <parameter>
                        <valueString value="Condition"/>
                      </parameter>
                    </target>
                    <target>
                      <context value="condition"/>
                      <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/Condition/"/>
                      </parameter>
                      <parameter>
                        <valueId value="uuid1"/>
                      </parameter>
                    </target>
                    <target>
                      <context value="request"/>
                      <contextType value="variable"/>
                      <element value="url"/>
                      <transform value="copy"/>
                      <parameter>
                        <valueString value="Condition"/>
                      </parameter>
                    </target>
                    <target>
                      <context value="section"/>
                      <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/Condition/' + %condition.id"/>
                      </parameter>
                    </target>
                    <rule>
                      <name value="code"/>
                      <source>
                        <context value="obs"/>
                        <element value="code"/>
                        <variable value="vvv"/>
                      </source>
                      <target>
                        <context value="condition"/>
                        <contextType value="variable"/>
                        <element value="category"/>
                        <variable value="vvv"/>
                        <transform value="create"/>
                      </target>
                    </rule>
                    <rule>
                      <name value="reference"/>
                      <source>
                        <context value="obs"/>
                      </source>
                      <target>
                        <context value="condition"/>
                        <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="condition"/>
                        <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="status"/>
                      <source>
                        <context value="obs"/>
                        <element value="statusCode"/>
                        <variable value="status"/>
                        <condition value="(code = 'completed')"/>
                      </source>
                      <target>
                        <context value="condition"/>
                        <contextType value="variable"/>
                        <element value="verificationStatus"/>
                        <variable value="status2"/>
                      </target>
                      <rule>
                        <name value="st3"/>
                        <source>
                          <context value="status"/>
                        </source>
                        <target>
                          <context value="status2"/>
                          <contextType value="variable"/>
                          <element value="coding"/>
                          <variable value="status3"/>
                        </target>
                        <rule>
                          <name value="finald"/>
                          <source>
                            <context value="status"/>
                          </source>
                          <target>
                            <context value="status3"/>
                            <contextType value="variable"/>
                            <element value="code"/>
                            <transform value="copy"/>
                            <parameter>
                              <valueString value="confirmed"/>
                            </parameter>
                          </target>
                        </rule>
                        <rule>
                          <name value="system"/>
                          <source>
                            <context value="status"/>
                          </source>
                          <target>
                            <context value="status3"/>
                            <contextType value="variable"/>
                            <element value="system"/>
                            <transform value="copy"/>
                            <parameter>
                              <valueString
                                           value="http://terminology.hl7.org/CodeSystem/condition-ver-status"/>
                            </parameter>
                          </target>
                        </rule>
                      </rule>
                    </rule>
                    <rule>
                      <name value="cdaText1"/>
                      <source>
                        <context value="sottosection"/>
                        <element value="text"/>
                        <variable value="cdaText1"/>
                      </source>
                      <target>
                        <context value="condition"/>
                        <contextType value="variable"/>
                        <element value="note"/>
                        <variable value="note"/>
                      </target>
                      <rule>
                        <name value="reference"/>
                        <source>
                          <context value="cdaText1"/>
                          <variable value="t"/>
                        </source>
                        <target>
                          <context value="note"/>
                          <contextType value="variable"/>
                          <element value="text"/>
                          <transform value="copy"/>
                          <parameter>
                            <valueId value="t"/>
                          </parameter>
                        </target>
                      </rule>
                      <rule>
                        <name value="author"/>
                        <source>
                          <context value="sottosection"/>
                          <element value="author"/>
                          <variable value="authors"/>
                        </source>
                        <rule>
                          <name value="timeAuthor"/>
                          <source>
                            <context value="authors"/>
                            <element value="time"/>
                            <variable value="time"/>
                          </source>
                          <target>
                            <context value="note"/>
                            <contextType value="variable"/>
                            <element value="time"/>
                            <variable value="value"/>
                            <transform value="create"/>
                            <parameter>
                              <valueString value="dateTime"/>
                            </parameter>
                          </target>
                          <dependent>
                            <name value="TSDateTime"/>
                            <variable value="time"/>
                            <variable value="value"/>
                          </dependent>
                        </rule>
                        <rule>
                          <name value="assighedAuthor"/>
                          <source>
                            <context value="authors"/>
                            <element value="assignedAuthor"/>
                            <variable value="assignedAuthor"/>
                          </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="practitioner"/>
                            <transform value="create"/>
                            <parameter>
                              <valueString value="Practitioner"/>
                            </parameter>
                          </target>
                          <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/Anamnesi/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="extension"/>
                              <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>
                            <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="extension"/>
                                <source>
                                  <context value="id"/>
                                  <element value="extension"/>
                                  <variable value="ext"/>
                                </source>
                                <target>
                                  <context value="practitioner"/>
                                  <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/Practitioner/"/>
                                  </parameter>
                                  <parameter>
                                    <valueId value="uuid5"/>
                                  </parameter>
                                </target>
                                <target>
                                  <context value="request"/>
                                  <contextType value="variable"/>
                                  <element value="url"/>
                                  <transform value="append"/>
                                  <parameter>
                                    <valueString value="Practitioner/"/>
                                  </parameter>
                                  <parameter>
                                    <valueId value="uuid5"/>
                                  </parameter>
                                </target>
                                <target>
                                  <context value="note"/>
                                  <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/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="assignedPerson"/>
                            <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>
                        </rule>
                      </rule>
                      <documentation value="blocco Narrativo"/>
                    </rule>
                    <rule>
                      <name value="effectivetime1"/>
                      <source>
                        <context value="obs"/>
                        <element value="effectiveTime"/>
                        <variable value="effective1"/>
                      </source>
                      <rule>
                        <name value="ef"/>
                        <source>
                          <context value="effective1"/>
                          <condition
                                     value="effective1.low.exists() or effective1.high.exists()"/>
                        </source>
                        <rule>
                          <name value="onsetperiod"/>
                          <source>
                            <context value="effective1"/>
                          </source>
                          <target>
                            <context value="condition"/>
                            <contextType value="variable"/>
                            <element value="onset"/>
                            <variable value="periodonset"/>
                            <transform value="create"/>
                            <parameter>
                              <valueString value="Period"/>
                            </parameter>
                          </target>
                          <dependent>
                            <name value="IVLTSPeriod"/>
                            <variable value="effective1"/>
                            <variable value="periodonset"/>
                          </dependent>
                        </rule>
                      </rule>
                    </rule>
                    <rule>
                      <name value="onsetDateTime"/>
                      <source>
                        <context value="obs"/>
                        <element value="effectiveTime"/>
                        <variable value="effectiveTime"/>
                      </source>
                      <target>
                        <context value="condition"/>
                        <contextType value="variable"/>
                        <element value="onset"/>
                        <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="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="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="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="Value"/>
                      <source>
                        <context value="obs"/>
                        <type value="CD"/>
                        <element value="value"/>
                        <variable value="val"/>
                      </source>
                      <rule>
                        <name value="Ce"/>
                        <source>
                          <context value="val"/>
                        </source>
                        <target>
                          <context value="condition"/>
                          <contextType value="variable"/>
                          <element value="code"/>
                          <variable value="ce"/>
                          <transform value="create"/>
                          <parameter>
                            <valueString value="CodeableConcept"/>
                          </parameter>
                        </target>
                        <rule>
                          <name value="originalText"/>
                          <source>
                            <context value="val"/>
                            <element value="originalText"/>
                            <variable value="vvv"/>
                          </source>
                          <target>
                            <context value="ce"/>
                            <contextType value="variable"/>
                            <element value="text"/>
                            <variable value="vvv"/>
                            <transform value="create"/>
                          </target>
                        </rule>
                        <rule>
                          <name value="coding"/>
                          <source>
                            <context value="val"/>
                          </source>
                          <target>
                            <context value="ce"/>
                            <contextType value="variable"/>
                            <element value="coding"/>
                            <variable value="coding"/>
                          </target>
                          <rule>
                            <name value="code"/>
                            <source>
                              <context value="val"/>
                              <element value="code"/>
                              <variable value="code"/>
                            </source>
                            <target>
                              <context value="coding"/>
                              <contextType value="variable"/>
                              <element value="code"/>
                              <transform value="cast"/>
                              <parameter>
                                <valueId value="code"/>
                              </parameter>
                              <parameter>
                                <valueString value="string"/>
                              </parameter>
                            </target>
                          </rule>
                          <rule>
                            <name value="codeSystem"/>
                            <source>
                              <context value="val"/>
                              <element value="codeSystem"/>
                              <variable value="system"/>
                            </source>
                            <target>
                              <context value="coding"/>
                              <contextType value="variable"/>
                              <element value="system"/>
                              <transform value="translate"/>
                              <parameter>
                                <valueId value="system"/>
                              </parameter>
                              <parameter>
                                <valueString
                                             value="http://hl7.org/fhir/ConceptMap/special-oid2uri"/>
                              </parameter>
                              <parameter>
                                <valueString value="uri"/>
                              </parameter>
                            </target>
                          </rule>
                          <rule>
                            <name value="displayName"/>
                            <source>
                              <context value="val"/>
                              <element value="displayName"/>
                              <variable value="display"/>
                            </source>
                            <target>
                              <context value="coding"/>
                              <contextType value="variable"/>
                              <element value="display"/>
                              <transform value="cast"/>
                              <parameter>
                                <valueId value="display"/>
                              </parameter>
                              <parameter>
                                <valueString value="string"/>
                              </parameter>
                            </target>
                          </rule>
                        </rule>
                      </rule>
                    </rule>
                    <rule>
                      <name value="EntryRelationship1"/>
                      <source>
                        <context value="obs"/>
                        <element value="entryRelationship"/>
                        <variable value="entriRel"/>
                      </source>
                      <rule>
                        <name value="evidence"/>
                        <source>
                          <context value="entriRel"/>
                        </source>
                        <target>
                          <context value="condition"/>
                          <contextType value="variable"/>
                          <element value="evidence"/>
                          <variable value="evidence"/>
                          <transform value="create"/>
                          <parameter>
                            <valueString value="BackboneElement"/>
                          </parameter>
                        </target>
                        <rule>
                          <name value="Observation2"/>
                          <source>
                            <context value="entriRel"/>
                            <element value="observation"/>
                            <variable value="observation2"/>
                          </source>
                          <rule>
                            <name value="code"/>
                            <source>
                              <context value="observation2"/>
                              <element value="code"/>
                              <variable value="code"/>
                            </source>
                            <rule>
                              <name value="whereDecorsoClinico"/>
                              <source>
                                <context value="code"/>
                                <element value="code"/>
                                <condition value="(code.code = '89261-2')"/>
                              </source>
                              <rule>
                                <name value="obser"/>
                                <source>
                                  <context value="obs"/>
                                </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="observation"/>
                                  <transform value="create"/>
                                  <parameter>
                                    <valueString value="Observation"/>
                                  </parameter>
                                </target>
                                <target>
                                  <context value="observation"/>
                                  <contextType value="variable"/>
                                  <element value="id"/>
                                  <variable value="uuid1"/>
                                  <transform value="uuid"/>
                                </target>
                                <target>
                                  <context value="e1"/>
                                  <contextType value="variable"/>
                                  <element value="fullUrl"/>
                                  <transform value="append"/>
                                  <parameter>
                                    <valueString
                                                 value="https://example/Observation/"/>
                                  </parameter>
                                  <parameter>
                                    <valueId value="uuid1"/>
                                  </parameter>
                                </target>
                                <target>
                                  <context value="request"/>
                                  <contextType value="variable"/>
                                  <element value="url"/>
                                  <transform value="copy"/>
                                  <parameter>
                                    <valueString value="Observation"/>
                                  </parameter>
                                </target>
                                <rule>
                                  <name value="ref"/>
                                  <source>
                                    <context value="entriRel"/>
                                  </source>
                                  <target>
                                    <context value="evidence"/>
                                    <contextType value="variable"/>
                                    <element value="detail"/>
                                    <variable value="reference"/>
                                    <transform value="create"/>
                                    <parameter>
                                      <valueString value="Reference"/>
                                    </parameter>
                                  </target>
                                  <target>
                                    <context value="reference"/>
                                    <contextType value="variable"/>
                                    <element value="reference"/>
                                    <transform value="evaluate"/>
                                    <parameter>
                                      <valueString
                                                   value="'https://example/Observation/' + %observation.id"/>
                                    </parameter>
                                  </target>
                                </rule>
                                <rule>
                                  <name value="code"/>
                                  <source>
                                    <context value="observation2"/>
                                    <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="statuscode"/>
                                  <source>
                                    <context value="observation2"/>
                                    <condition
                                               value="observation.statusCode.exists().not()"/>
                                  </source>
                                  <rule>
                                    <name value="status"/>
                                    <source>
                                      <context value="observation2"/>
                                    </source>
                                    <target>
                                      <context value="observation"/>
                                      <contextType value="variable"/>
                                      <element value="status"/>
                                      <transform value="copy"/>
                                      <parameter>
                                        <valueString value="final"/>
                                      </parameter>
                                    </target>
                                  </rule>
                                </rule>
                                <rule>
                                  <name value="Annontation"/>
                                  <source>
                                    <context value="observation2"/>
                                    <element value="text"/>
                                    <variable value="text"/>
                                  </source>
                                  <target>
                                    <context value="observation"/>
                                    <contextType value="variable"/>
                                    <element value="note"/>
                                    <variable value="note"/>
                                    <transform value="create"/>
                                    <parameter>
                                      <valueString value="Annotation"/>
                                    </parameter>
                                  </target>
                                  <rule>
                                    <name value="val"/>
                                    <source>
                                      <context value="text"/>
                                      <element value="reference"/>
                                      <variable value="ref"/>
                                    </source>
                                    <target>
                                      <context value="note"/>
                                      <contextType value="variable"/>
                                      <element value="text"/>
                                      <transform value="evaluate"/>
                                      <parameter>
                                        <valueString value="ref.value"/>
                                      </parameter>
                                    </target>
                                  </rule>
                                </rule>
                                <rule>
                                  <name value="reference"/>
                                  <source>
                                    <context value="obs"/>
                                  </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="obs"/>
                                  </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/' + %enc.id"/>
                                    </parameter>
                                  </target>
                                </rule>
                                <rule>
                                  <name value="statusCode"/>
                                  <source>
                                    <context value="observation2"/>
                                    <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="observation2"/>
                                    <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="observation2"/>
                                    <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="observation2"/>
                                    <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="value"/>
                                  <source>
                                    <context value="observation2"/>
                                    <type value="INT"/>
                                    <element value="value"/>
                                    <variable value="int"/>
                                  </source>
                                  <target>
                                    <context value="observation"/>
                                    <contextType value="variable"/>
                                    <element value="value"/>
                                    <transform value="evaluate"/>
                                    <parameter>
                                      <valueString value="int.value"/>
                                    </parameter>
                                  </target>
                                </rule>
                                <rule>
                                  <name value="boolean"/>
                                  <source>
                                    <context value="observation2"/>
                                    <type value="BL"/>
                                    <element value="value"/>
                                    <variable value="boolean"/>
                                  </source>
                                  <target>
                                    <context value="observation"/>
                                    <contextType value="variable"/>
                                    <element value="value"/>
                                    <transform value="evaluate"/>
                                    <parameter>
                                      <valueString value="boolean.value"/>
                                    </parameter>
                                  </target>
                                </rule>
                                <rule>
                                  <name value="value"/>
                                  <source>
                                    <context value="observation2"/>
                                    <type value="ST"/>
                                    <element value="value"/>
                                    <variable value="value"/>
                                  </source>
                                  <target>
                                    <context value="observation"/>
                                    <contextType value="variable"/>
                                    <element value="value"/>
                                    <transform value="create"/>
                                    <parameter>
                                      <valueString value="string"/>
                                    </parameter>
                                  </target>
                                  <target>
                                    <context value="observation"/>
                                    <contextType value="variable"/>
                                    <element value="value"/>
                                    <transform value="evaluate"/>
                                    <parameter>
                                      <valueString value="value.dataString"/>
                                    </parameter>
                                  </target>
                                </rule>
                                <rule>
                                  <name value="value2"/>
                                  <source>
                                    <context value="observation2"/>
                                    <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="observation2"/>
                                    <condition
                                               value="effectiveTime.low.exists() or effectiveTime.high.exists()"/>
                                  </source>
                                  <rule>
                                    <name value="effectiveTime"/>
                                    <source>
                                      <context value="observation2"/>
                                      <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="valueQuantity"/>
                                  <source>
                                    <context value="observation2"/>
                                    <type value="PQ"/>
                                    <element value="value"/>
                                    <variable value="val"/>
                                  </source>
                                  <rule>
                                    <name value="quantity"/>
                                    <source>
                                      <context value="val"/>
                                    </source>
                                    <target>
                                      <context value="observation"/>
                                      <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="observation2"/>
                                    <type value="CE"/>
                                    <element value="value"/>
                                    <variable value="val"/>
                                  </source>
                                  <rule>
                                    <name value="Ce"/>
                                    <source>
                                      <context value="val"/>
                                    </source>
                                    <target>
                                      <context value="observation"/>
                                      <contextType value="variable"/>
                                      <element value="value"/>
                                      <variable value="ce"/>
                                      <transform value="create"/>
                                      <parameter>
                                        <valueString value="CodeableConcept"/>
                                      </parameter>
                                    </target>
                                    <rule>
                                      <name value="originalText"/>
                                      <source>
                                        <context value="val"/>
                                        <element value="originalText"/>
                                        <variable value="vvv"/>
                                      </source>
                                      <target>
                                        <context value="ce"/>
                                        <contextType value="variable"/>
                                        <element value="text"/>
                                        <variable value="vvv"/>
                                        <transform value="create"/>
                                      </target>
                                    </rule>
                                    <rule>
                                      <name value="coding"/>
                                      <source>
                                        <context value="val"/>
                                      </source>
                                      <target>
                                        <context value="ce"/>
                                        <contextType value="variable"/>
                                        <element value="coding"/>
                                        <variable value="coding"/>
                                      </target>
                                      <rule>
                                        <name value="code"/>
                                        <source>
                                          <context value="val"/>
                                          <element value="code"/>
                                          <variable value="code"/>
                                        </source>
                                        <target>
                                          <context value="coding"/>
                                          <contextType value="variable"/>
                                          <element value="code"/>
                                          <transform value="cast"/>
                                          <parameter>
                                            <valueId value="code"/>
                                          </parameter>
                                          <parameter>
                                            <valueString value="string"/>
                                          </parameter>
                                        </target>
                                      </rule>
                                      <rule>
                                        <name value="codeSystem"/>
                                        <source>
                                          <context value="val"/>
                                          <element value="codeSystem"/>
                                          <variable value="system"/>
                                        </source>
                                        <target>
                                          <context value="coding"/>
                                          <contextType value="variable"/>
                                          <element value="system"/>
                                          <transform value="translate"/>
                                          <parameter>
                                            <valueId value="system"/>
                                          </parameter>
                                          <parameter>
                                            <valueString
                                                         value="http://hl7.org/fhir/ConceptMap/special-oid2uri"/>
                                          </parameter>
                                          <parameter>
                                            <valueString value="uri"/>
                                          </parameter>
                                        </target>
                                      </rule>
                                      <rule>
                                        <name value="displayName"/>
                                        <source>
                                          <context value="val"/>
                                          <element value="displayName"/>
                                          <variable value="display"/>
                                        </source>
                                        <target>
                                          <context value="coding"/>
                                          <contextType value="variable"/>
                                          <element value="display"/>
                                          <transform value="cast"/>
                                          <parameter>
                                            <valueId value="display"/>
                                          </parameter>
                                          <parameter>
                                            <valueString value="string"/>
                                          </parameter>
                                        </target>
                                      </rule>
                                    </rule>
                                  </rule>
                                </rule>
                              </rule>
                            </rule>
                          </rule>
                        </rule>
                      </rule>
                    </rule>
                    <rule>
                      <name value="entryrelationshipstatus"/>
                      <source>
                        <context value="obs"/>
                        <element value="entryRelationship"/>
                        <variable value="entriRel"/>
                      </source>
                      <rule>
                        <name value="observationstatus"/>
                        <source>
                          <context value="entriRel"/>
                          <element value="observation"/>
                          <variable value="observation2"/>
                        </source>
                        <rule>
                          <name value="codestatus"/>
                          <source>
                            <context value="observation2"/>
                            <element value="code"/>
                            <variable value="code"/>
                          </source>
                          <rule>
                            <name value="whereDecorsoClinico"/>
                            <source>
                              <context value="code"/>
                              <element value="code"/>
                              <condition value="(code.code = '33999-4')"/>
                            </source>
                            <rule>
                              <name value="code"/>
                              <source>
                                <context value="observation2"/>
                              </source>
                              <target>
                                <context value="condition"/>
                                <contextType value="variable"/>
                                <element value="clinicalStatus"/>
                                <variable value="status"/>
                                <transform value="create"/>
                                <parameter>
                                  <valueString value="CodeableConcept"/>
                                </parameter>
                              </target>
                              <rule>
                                <name value="textstat"/>
                                <source>
                                  <context value="observation2"/>
                                  <element value="text"/>
                                  <variable value="text"/>
                                </source>
                                <rule>
                                  <name value="statref"/>
                                  <source>
                                    <context value="text"/>
                                    <element value="reference"/>
                                    <variable value="refstat"/>
                                  </source>
                                  <target>
                                    <context value="status"/>
                                    <contextType value="variable"/>
                                    <element value="text"/>
                                    <transform value="evaluate"/>
                                    <parameter>
                                      <valueString value="refstat.value"/>
                                    </parameter>
                                  </target>
                                </rule>
                              </rule>
                              <rule>
                                <name value="coding"/>
                                <source>
                                  <context value="observation2"/>
                                </source>
                                <target>
                                  <context value="status"/>
                                  <contextType value="variable"/>
                                  <element value="coding"/>
                                  <variable value="coding"/>
                                  <transform value="create"/>
                                  <parameter>
                                    <valueString value="Coding"/>
                                  </parameter>
                                </target>
                                <rule>
                                  <name value="value1"/>
                                  <source>
                                    <context value="observation2"/>
                                    <element value="value"/>
                                    <variable value="value"/>
                                  </source>
                                  <rule>
                                    <name value="active"/>
                                    <source>
                                      <context value="value"/>
                                      <element value="code"/>
                                      <condition
                                                 value="(value.code = 'LA16666-2')"/>
                                    </source>
                                    <target>
                                      <context value="coding"/>
                                      <contextType value="variable"/>
                                      <element value="code"/>
                                      <transform value="copy"/>
                                      <parameter>
                                        <valueString value="active"/>
                                      </parameter>
                                    </target>
                                  </rule>
                                  <rule>
                                    <name value="inactive"/>
                                    <source>
                                      <context value="value"/>
                                      <element value="code"/>
                                      <condition
                                                 value="(value.code = 'LA18632-2')"/>
                                    </source>
                                    <target>
                                      <context value="coding"/>
                                      <contextType value="variable"/>
                                      <element value="code"/>
                                      <transform value="copy"/>
                                      <parameter>
                                        <valueString value="inactive"/>
                                      </parameter>
                                    </target>
                                  </rule>
                                  <rule>
                                    <name value="system"/>
                                    <source>
                                      <context value="value"/>
                                      <element value="codeSystem"/>
                                      <variable value="system"/>
                                    </source>
                                    <target>
                                      <context value="coding"/>
                                      <contextType value="variable"/>
                                      <element value="system"/>
                                      <transform value="copy"/>
                                      <parameter>
                                        <valueString
                                                     value="http://terminology.hl7.org/CodeSystem/condition-clinical"/>
                                      </parameter>
                                    </target>
                                  </rule>
                                  <rule>
                                    <name value="displayName"/>
                                    <source>
                                      <context value="value"/>
                                      <element value="displayName"/>
                                      <variable value="display"/>
                                    </source>
                                    <target>
                                      <context value="coding"/>
                                      <contextType value="variable"/>
                                      <element value="display"/>
                                      <transform value="cast"/>
                                      <parameter>
                                        <valueId value="display"/>
                                      </parameter>
                                      <parameter>
                                        <valueString value="string"/>
                                      </parameter>
                                    </target>
                                  </rule>
                                </rule>
                              </rule>
                            </rule>
                          </rule>
                        </rule>
                      </rule>
                    </rule>
                  </rule>
                </rule>
              </rule>
              <rule>
                <name value="observation1"/>
                <source>
                  <context value="entry1"/>
                  <element value="organizer"/>
                  <variable value="organizer"/>
                </source>
                <rule>
                  <name value="10157-6"/>
                  <source>
                    <context value="organizer"/>
                    <element value="code"/>
                    <condition value="(code = '10157-6')"/>
                  </source>
                  <rule>
                    <name value="organizer"/>
                    <source>
                      <context value="organizer"/>
                    </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="FamilyMemberHistory"/>
                      <transform value="create"/>
                      <parameter>
                        <valueString value="FamilyMemberHistory"/>
                      </parameter>
                    </target>
                    <target>
                      <context value="FamilyMemberHistory"/>
                      <contextType value="variable"/>
                      <element value="id"/>
                      <variable value="uuid5"/>
                      <transform value="uuid"/>
                    </target>
                    <target>
                      <context value="e4"/>
                      <contextType value="variable"/>
                      <element value="fullUrl"/>
                      <transform value="append"/>
                      <parameter>
                        <valueString
                                     value="https://example/FamilyMemberHistory/"/>
                      </parameter>
                      <parameter>
                        <valueId value="uuid5"/>
                      </parameter>
                    </target>
                    <target>
                      <context value="request"/>
                      <contextType value="variable"/>
                      <element value="url"/>
                      <transform value="copy"/>
                      <parameter>
                        <valueString value="FamilyMemberHistory"/>
                      </parameter>
                    </target>
                    <target>
                      <context value="section"/>
                      <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/FamilyMemberHistory/' + %FamilyMemberHistory.id"/>
                      </parameter>
                    </target>
                    <rule>
                      <name value="effective"/>
                      <source>
                        <context value="organizer"/>
                        <element value="effectiveTime"/>
                        <variable value="effective"/>
                      </source>
                      <rule>
                        <name value="date"/>
                        <source>
                          <context value="effective"/>
                          <element value="value"/>
                          <variable value="eff"/>
                        </source>
                        <target>
                          <context value="FamilyMemberHistory"/>
                          <contextType value="variable"/>
                          <element value="date"/>
                          <variable value="value"/>
                          <transform value="create"/>
                          <parameter>
                            <valueString value="dateTime"/>
                          </parameter>
                        </target>
                        <dependent>
                          <name value="TSDateTime"/>
                          <variable value="eff"/>
                          <variable value="value"/>
                        </dependent>
                      </rule>
                    </rule>
                    <rule>
                      <name value="reference"/>
                      <source>
                        <context value="organizer"/>
                      </source>
                      <target>
                        <context value="FamilyMemberHistory"/>
                        <contextType value="variable"/>
                        <element value="patient"/>
                        <variable value="reference"/>
                        <transform value="create"/>
                        <parameter>
                          <valueString value="Reference"/>
                        </parameter>
                      </target>
                      <target>
                        <context value="reference"/>
                        <contextType value="variable"/>
                        <element value="reference"/>
                        <transform value="evaluate"/>
                        <parameter>
                          <valueString
                                       value="'https://example/Patient/' + %patient.id"/>
                        </parameter>
                      </target>
                    </rule>
                    <rule>
                      <name value="subject"/>
                      <source>
                        <context value="organizer"/>
                        <element value="subject"/>
                        <variable value="subject"/>
                      </source>
                      <rule>
                        <name value="relatedSubject"/>
                        <source>
                          <context value="subject"/>
                          <element value="relatedSubject"/>
                          <variable value="relatedSubject"/>
                        </source>
                        <rule>
                          <name value="relationship"/>
                          <source>
                            <context value="relatedSubject"/>
                            <element value="code"/>
                            <variable value="vvv"/>
                          </source>
                          <target>
                            <context value="FamilyMemberHistory"/>
                            <contextType value="variable"/>
                            <element value="relationship"/>
                            <variable value="vvv"/>
                            <transform value="create"/>
                          </target>
                        </rule>
                        <rule>
                          <name value="subject1"/>
                          <source>
                            <context value="relatedSubject"/>
                            <element value="subject"/>
                            <variable value="subject"/>
                          </source>
                          <target>
                            <context value="FamilyMemberHistory"/>
                            <contextType value="variable"/>
                            <element value="sex"/>
                            <variable value="sex"/>
                          </target>
                          <rule>
                            <name value="coding"/>
                            <source>
                              <context value="subject"/>
                              <element value="administrativeGenderCode"/>
                              <variable value="administrativeGenderCode"/>
                            </source>
                            <target>
                              <context value="sex"/>
                              <contextType value="variable"/>
                              <element value="coding"/>
                              <variable value="coding"/>
                            </target>
                            <rule>
                              <name value="gender"/>
                              <source>
                                <context value="administrativeGenderCode"/>
                                <element value="code"/>
                                <variable value="code"/>
                              </source>
                              <target>
                                <context value="coding"/>
                                <contextType value="variable"/>
                                <element value="code"/>
                                <transform value="translate"/>
                                <parameter>
                                  <valueId value="code"/>
                                </parameter>
                                <parameter>
                                  <valueString value="#AdministrativeGender"/>
                                </parameter>
                                <parameter>
                                  <valueString value="code"/>
                                </parameter>
                              </target>
                            </rule>
                            <rule>
                              <name value="system"/>
                              <source>
                                <context value="administrativeGenderCode"/>
                              </source>
                              <target>
                                <context value="coding"/>
                                <contextType value="variable"/>
                                <element value="system"/>
                                <transform value="copy"/>
                                <parameter>
                                  <valueString
                                               value="http://hl7.org/fhir/administrative-gender"/>
                                </parameter>
                              </target>
                            </rule>
                          </rule>
                        </rule>
                      </rule>
                    </rule>
                    <rule>
                      <name value="cdaText1"/>
                      <source>
                        <context value="sottosection"/>
                        <element value="text"/>
                        <variable value="cdaText1"/>
                      </source>
                      <target>
                        <context value="FamilyMemberHistory"/>
                        <contextType value="variable"/>
                        <element value="note"/>
                        <variable value="note"/>
                      </target>
                      <rule>
                        <name value="reference"/>
                        <source>
                          <context value="cdaText1"/>
                          <variable value="t"/>
                        </source>
                        <target>
                          <context value="note"/>
                          <contextType value="variable"/>
                          <element value="text"/>
                          <transform value="copy"/>
                          <parameter>
                            <valueId value="t"/>
                          </parameter>
                        </target>
                      </rule>
                      <rule>
                        <name value="author"/>
                        <source>
                          <context value="sottosection"/>
                          <element value="author"/>
                          <variable value="authors"/>
                        </source>
                        <rule>
                          <name value="timeAuthor"/>
                          <source>
                            <context value="authors"/>
                            <element value="time"/>
                            <variable value="time"/>
                          </source>
                          <target>
                            <context value="note"/>
                            <contextType value="variable"/>
                            <element value="time"/>
                            <variable value="value"/>
                            <transform value="create"/>
                            <parameter>
                              <valueString value="dateTime"/>
                            </parameter>
                          </target>
                          <dependent>
                            <name value="TSDateTime"/>
                            <variable value="time"/>
                            <variable value="value"/>
                          </dependent>
                        </rule>
                        <rule>
                          <name value="assighedAuthor"/>
                          <source>
                            <context value="authors"/>
                            <element value="assignedAuthor"/>
                            <variable 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="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/Anamnesi/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="extension"/>
                              <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>
                            <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="extension"/>
                                <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="request"/>
                                  <contextType value="variable"/>
                                  <element value="url"/>
                                  <transform value="append"/>
                                  <parameter>
                                    <valueString value="Practitioner/"/>
                                  </parameter>
                                  <parameter>
                                    <valueId value="uuid7"/>
                                  </parameter>
                                </target>
                                <target>
                                  <context value="note"/>
                                  <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/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="assignedPerson"/>
                            <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>
                        </rule>
                      </rule>
                      <documentation value="blocco Narrativo"/>
                    </rule>
                    <rule>
                      <name value="component"/>
                      <source>
                        <context value="organizer"/>
                        <element value="component"/>
                        <variable value="component"/>
                      </source>
                      <target>
                        <context value="FamilyMemberHistory"/>
                        <contextType value="variable"/>
                        <element value="condition"/>
                        <variable value="condition"/>
                      </target>
                      <rule>
                        <name value="observationCondition"/>
                        <source>
                          <context value="component"/>
                          <element value="observation"/>
                          <variable value="observation"/>
                        </source>
                        <rule>
                          <name value="code"/>
                          <source>
                            <context value="observation"/>
                            <element value="code"/>
                            <variable value="vvv"/>
                          </source>
                          <target>
                            <context value="condition"/>
                            <contextType value="variable"/>
                            <element value="code"/>
                            <variable value="vvv"/>
                            <transform value="create"/>
                          </target>
                        </rule>
                        <rule>
                          <name value="reference"/>
                          <source>
                            <context value="observation"/>
                            <element value="text"/>
                            <variable value="text"/>
                          </source>
                          <target>
                            <context value="FamilyMemberHistory"/>
                            <contextType value="variable"/>
                            <element value="note"/>
                            <variable value="note"/>
                          </target>
                          <rule>
                            <name value="value"/>
                            <source>
                              <context value="text"/>
                              <element value="reference"/>
                              <variable value="reference"/>
                            </source>
                            <target>
                              <context value="note"/>
                              <contextType value="variable"/>
                              <element value="text"/>
                              <transform value="evaluate"/>
                              <parameter>
                                <valueString value="reference.value"/>
                              </parameter>
                            </target>
                          </rule>
                        </rule>
                        <rule>
                          <name value="statusCode"/>
                          <source>
                            <context value="observation"/>
                            <element value="statusCode"/>
                            <variable value="vvv"/>
                          </source>
                          <target>
                            <context value="FamilyMemberHistory"/>
                            <contextType value="variable"/>
                            <element value="status"/>
                            <variable value="vvv"/>
                            <transform value="create"/>
                          </target>
                        </rule>
                        <rule>
                          <name value="codeable"/>
                          <source>
                            <context value="observation"/>
                            <element value="value"/>
                            <variable value="vvv"/>
                          </source>
                          <target>
                            <context value="condition"/>
                            <contextType value="variable"/>
                            <element value="outcome"/>
                            <variable value="vvv"/>
                            <transform value="create"/>
                          </target>
                        </rule>
                        <rule>
                          <name value="EntryRel"/>
                          <source>
                            <context value="observation"/>
                            <element value="entryRelationship"/>
                            <variable value="entryRelationship"/>
                          </source>
                          <rule>
                            <name value="obser"/>
                            <source>
                              <context value="entryRelationship"/>
                              <element value="observation"/>
                              <variable value="obsservation1"/>
                            </source>
                            <rule>
                              <name value="code"/>
                              <source>
                                <context value="obsservation1"/>
                                <element value="code"/>
                                <variable value="code"/>
                              </source>
                              <rule>
                                <name value="insorgenza"/>
                                <source>
                                  <context value="code"/>
                                  <element value="code"/>
                                  <condition value="(code.code = '35267-4')"/>
                                </source>
                                <rule>
                                  <name value="value"/>
                                  <source>
                                    <context value="obsservation1"/>
                                    <element value="value"/>
                                    <variable value="value"/>
                                  </source>
                                  <target>
                                    <context value="condition"/>
                                    <contextType value="variable"/>
                                    <element value="onset"/>
                                    <variable value="Age"/>
                                    <transform value="create"/>
                                    <parameter>
                                      <valueString value="Age"/>
                                    </parameter>
                                  </target>
                                  <rule>
                                    <name value="age"/>
                                    <source>
                                      <context value="value"/>
                                      <element value="value"/>
                                      <variable value="valueAge"/>
                                    </source>
                                    <target>
                                      <context value="Age"/>
                                      <contextType value="variable"/>
                                      <element value="value"/>
                                      <transform value="copy"/>
                                      <parameter>
                                        <valueId value="valueAge"/>
                                      </parameter>
                                    </target>
                                  </rule>
                                  <rule>
                                    <name value="unit"/>
                                    <source>
                                      <context value="value"/>
                                      <element value="unit"/>
                                      <variable value="unit"/>
                                    </source>
                                    <target>
                                      <context value="Age"/>
                                      <contextType value="variable"/>
                                      <element value="code"/>
                                      <transform value="copy"/>
                                      <parameter>
                                        <valueId value="unit"/>
                                      </parameter>
                                    </target>
                                  </rule>
                                  <rule>
                                    <name value="unit"/>
                                    <source>
                                      <context value="value"/>
                                      <element value="unit"/>
                                      <variable value="unit"/>
                                    </source>
                                    <target>
                                      <context value="Age"/>
                                      <contextType value="variable"/>
                                      <element value="unit"/>
                                      <transform value="copy"/>
                                      <parameter>
                                        <valueId value="unit"/>
                                      </parameter>
                                    </target>
                                  </rule>
                                  <rule>
                                    <name value="system"/>
                                    <source>
                                      <context value="value"/>
                                    </source>
                                    <target>
                                      <context value="Age"/>
                                      <contextType value="variable"/>
                                      <element value="system"/>
                                      <transform value="copy"/>
                                      <parameter>
                                        <valueString
                                                     value="http://unitsofmeasure.org"/>
                                      </parameter>
                                    </target>
                                  </rule>
                                </rule>
                              </rule>
                            </rule>
                            <rule>
                              <name value="code"/>
                              <source>
                                <context value="obsservation1"/>
                                <element value="code"/>
                                <variable value="code"/>
                              </source>
                              <rule>
                                <name value="deceased"/>
                                <source>
                                  <context value="code"/>
                                  <element value="code"/>
                                  <condition value="(code.code = '39016-1')"/>
                                </source>
                                <rule>
                                  <name value="value"/>
                                  <source>
                                    <context value="obsservation1"/>
                                    <element value="value"/>
                                    <variable value="value"/>
                                  </source>
                                  <target>
                                    <context value="FamilyMemberHistory"/>
                                    <contextType value="variable"/>
                                    <element value="deceased"/>
                                    <variable value="Age"/>
                                    <transform value="create"/>
                                    <parameter>
                                      <valueString value="Age"/>
                                    </parameter>
                                  </target>
                                  <rule>
                                    <name value="age"/>
                                    <source>
                                      <context value="value"/>
                                      <element value="value"/>
                                      <variable value="valueAge"/>
                                    </source>
                                    <target>
                                      <context value="Age"/>
                                      <contextType value="variable"/>
                                      <element value="value"/>
                                      <transform value="copy"/>
                                      <parameter>
                                        <valueId value="valueAge"/>
                                      </parameter>
                                    </target>
                                  </rule>
                                  <rule>
                                    <name value="unit"/>
                                    <source>
                                      <context value="value"/>
                                      <element value="unit"/>
                                      <variable value="unit"/>
                                    </source>
                                    <target>
                                      <context value="Age"/>
                                      <contextType value="variable"/>
                                      <element value="code"/>
                                      <transform value="copy"/>
                                      <parameter>
                                        <valueId value="unit"/>
                                      </parameter>
                                    </target>
                                  </rule>
                                  <rule>
                                    <name value="unit"/>
                                    <source>
                                      <context value="value"/>
                                      <element value="unit"/>
                                      <variable value="unit"/>
                                    </source>
                                    <target>
                                      <context value="Age"/>
                                      <contextType value="variable"/>
                                      <element value="unit"/>
                                      <transform value="copy"/>
                                      <parameter>
                                        <valueId value="unit"/>
                                      </parameter>
                                    </target>
                                  </rule>
                                  <rule>
                                    <name value="system"/>
                                    <source>
                                      <context value="value"/>
                                    </source>
                                    <target>
                                      <context value="Age"/>
                                      <contextType value="variable"/>
                                      <element value="system"/>
                                      <transform value="copy"/>
                                      <parameter>
                                        <valueString
                                                     value="http://unitsofmeasure.org"/>
                                      </parameter>
                                    </target>
                                  </rule>
                                </rule>
                              </rule>
                            </rule>
                          </rule>
                        </rule>
                        <rule>
                          <name value="cont"/>
                          <source>
                            <context value="observation"/>
                            <condition
                                       value="observation.effectiveTime.exists()"/>
                          </source>
                          <rule>
                            <name value="effttemp"/>
                            <source>
                              <context value="observation"/>
                              <element value="effectiveTime"/>
                              <variable value="effectiveTime"/>
                            </source>
                            <target>
                              <context value="FamilyMemberHistory"/>
                              <contextType value="variable"/>
                              <element value="condition"/>
                              <variable value="condition"/>
                              <transform value="create"/>
                              <parameter>
                                <valueString value="BackboneElement"/>
                              </parameter>
                            </target>
                            <rule>
                              <name value="efft"/>
                              <source>
                                <context value="effectiveTime"/>
                              </source>
                              <target>
                                <context value="condition"/>
                                <contextType value="variable"/>
                                <element value="onset"/>
                                <variable value="period"/>
                                <transform value="create"/>
                                <parameter>
                                  <valueString value="Period"/>
                                </parameter>
                              </target>
                              <rule>
                                <name value="val"/>
                                <source>
                                  <context value="effectiveTime"/>
                                </source>
                                <target>
                                  <context value="period"/>
                                  <contextType value="variable"/>
                                  <element value="start"/>
                                  <variable value="start"/>
                                  <transform value="create"/>
                                  <parameter>
                                    <valueString value="dateTime"/>
                                  </parameter>
                                </target>
                                <dependent>
                                  <name value="TSDateTime"/>
                                  <variable value="effectiveTime"/>
                                  <variable value="start"/>
                                </dependent>
                              </rule>
                            </rule>
                            <rule>
                              <name value="code"/>
                              <source>
                                <context value="observation"/>
                                <element value="code"/>
                                <variable value="vvv"/>
                              </source>
                              <target>
                                <context value="condition"/>
                                <contextType value="variable"/>
                                <element value="code"/>
                                <variable value="vvv"/>
                                <transform value="create"/>
                              </target>
                            </rule>
                            <rule>
                              <name value="codeable"/>
                              <source>
                                <context value="observation"/>
                                <element value="value"/>
                                <variable value="vvv"/>
                              </source>
                              <target>
                                <context value="condition"/>
                                <contextType value="variable"/>
                                <element value="outcome"/>
                                <variable value="vvv"/>
                                <transform value="create"/>
                              </target>
                            </rule>
                          </rule>
                        </rule>
                      </rule>
                    </rule>
                  </rule>
                </rule>
                <documentation
                               value="Anamnesi Familiare---------------------------------------------------------------------------------------------------------------------------------------------"/>
              </rule>
              <documentation
                             value="Anamnesi Strutturata-----------------------------------------------------------------------------------------------------------------------------------------"/>
            </rule>
          </rule>
          <rule>
            <name value="code"/>
            <source>
              <context value="sottosection"/>
              <element value="code"/>
              <variable value="vvv"/>
              <condition value="(code = '29545-1')"/>
            </source>
            <target>
              <context value="section"/>
              <contextType value="variable"/>
              <element value="code"/>
              <variable value="vvv"/>
              <transform value="create"/>
            </target>
            <documentation
                           value="2. Esame Obiettivo Narrativa-----------------------------------------------------------------------------------------------------------------------------------"/>
          </rule>
          <rule>
            <name value="condizioneesameObiettivo"/>
            <source>
              <context value="sottosection"/>
              <element value="code"/>
              <variable value="code1"/>
              <condition value="(code = '29545-1')"/>
            </source>
            <rule>
              <name value="title"/>
              <source>
                <context value="sottosection"/>
                <element value="title"/>
                <variable value="t"/>
              </source>
              <target>
                <context value="section"/>
                <contextType value="variable"/>
                <element value="title"/>
                <transform value="evaluate"/>
                <parameter>
                  <valueString value="t.dataString"/>
                </parameter>
              </target>
            </rule>
            <rule>
              <name value="cdaText"/>
              <source>
                <context value="sottosection"/>
                <element value="text"/>
                <variable value="cdaText"/>
              </source>
              <target>
                <context value="bundle"/>
                <contextType value="variable"/>
                <element value="entry"/>
                <variable value="e8"/>
              </target>
              <target>
                <context value="e8"/>
                <contextType value="variable"/>
                <element value="request"/>
                <variable value="request"/>
                <transform value="create"/>
                <parameter>
                  <valueString value="BackboneElement"/>
                </parameter>
              </target>
              <target>
                <context value="request"/>
                <contextType value="variable"/>
                <element value="method"/>
                <transform value="copy"/>
                <parameter>
                  <valueString value="POST"/>
                </parameter>
              </target>
              <target>
                <context value="e8"/>
                <contextType value="variable"/>
                <element value="resource"/>
                <variable value="observation"/>
                <transform value="create"/>
                <parameter>
                  <valueString value="Observation"/>
                </parameter>
              </target>
              <target>
                <context value="observation"/>
                <contextType value="variable"/>
                <element value="id"/>
                <variable value="uuid8"/>
                <transform value="uuid"/>
              </target>
              <target>
                <context value="e8"/>
                <contextType value="variable"/>
                <element value="fullUrl"/>
                <transform value="append"/>
                <parameter>
                  <valueString value="https://example/Observation/"/>
                </parameter>
                <parameter>
                  <valueId value="uuid8"/>
                </parameter>
              </target>
              <target>
                <context value="request"/>
                <contextType value="variable"/>
                <element value="url"/>
                <transform value="copy"/>
                <parameter>
                  <valueString value="Observation"/>
                </parameter>
              </target>
              <target>
                <context value="section"/>
                <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/Observation/' + %observation.id"/>
                </parameter>
              </target>
              <rule>
                <name value="reference"/>
                <source>
                  <context value="cdaText"/>
                </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="cdaText"/>
                </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/' + %enc.id"/>
                  </parameter>
                </target>
              </rule>
              <rule>
                <name value="code"/>
                <source>
                  <context value="sottosection"/>
                  <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="statuscode"/>
                <source>
                  <context value="sottosection"/>
                  <condition value="observation.statusCode.exists().not()"/>
                </source>
                <rule>
                  <name value="status"/>
                  <source>
                    <context value="sottosection"/>
                  </source>
                  <target>
                    <context value="observation"/>
                    <contextType value="variable"/>
                    <element value="status"/>
                    <transform value="copy"/>
                    <parameter>
                      <valueString value="final"/>
                    </parameter>
                  </target>
                </rule>
              </rule>
              <rule>
                <name value="reference"/>
                <source>
                  <context value="cdaText"/>
                </source>
                <target>
                  <context value="observation"/>
                  <contextType value="variable"/>
                  <element value="note"/>
                  <variable value="note"/>
                </target>
                <rule>
                  <name value="reference"/>
                  <source>
                    <context value="cdaText"/>
                    <variable value="t"/>
                  </source>
                  <target>
                    <context value="note"/>
                    <contextType value="variable"/>
                    <element value="text"/>
                    <transform value="copy"/>
                    <parameter>
                      <valueId value="t"/>
                    </parameter>
                  </target>
                </rule>
                <rule>
                  <name value="author"/>
                  <source>
                    <context value="sottosection"/>
                    <element value="author"/>
                    <variable value="authors"/>
                  </source>
                  <rule>
                    <name value="timeAuthor"/>
                    <source>
                      <context value="authors"/>
                      <element value="time"/>
                      <variable value="time"/>
                    </source>
                    <target>
                      <context value="note"/>
                      <contextType value="variable"/>
                      <element value="time"/>
                      <variable value="value"/>
                      <transform value="create"/>
                      <parameter>
                        <valueString value="dateTime"/>
                      </parameter>
                    </target>
                    <dependent>
                      <name value="TSDateTime"/>
                      <variable value="time"/>
                      <variable value="value"/>
                    </dependent>
                  </rule>
                  <rule>
                    <name value="assighedAuthor"/>
                    <source>
                      <context value="authors"/>
                      <element value="assignedAuthor"/>
                      <variable value="assignedAuthor"/>
                    </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="practitioner"/>
                      <transform value="create"/>
                      <parameter>
                        <valueString value="Practitioner"/>
                      </parameter>
                    </target>
                    <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/EsameObiettivo/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="extension"/>
                        <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>
                      <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="autore"/>
                          <source>
                            <context value="id"/>
                            <element value="extension"/>
                            <variable value="ext"/>
                          </source>
                          <target>
                            <context value="practitioner"/>
                            <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/Practitioner/"/>
                            </parameter>
                            <parameter>
                              <valueId value="uuid9"/>
                            </parameter>
                          </target>
                          <target>
                            <context value="request"/>
                            <contextType value="variable"/>
                            <element value="url"/>
                            <transform value="append"/>
                            <parameter>
                              <valueString value="Practitioner/"/>
                            </parameter>
                            <parameter>
                              <valueId value="uuid9"/>
                            </parameter>
                          </target>
                          <target>
                            <context value="note"/>
                            <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/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="assignedPerson"/>
                      <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>
                  </rule>
                </rule>
              </rule>
            </rule>
          </rule>
          <rule>
            <name value="code"/>
            <source>
              <context value="sottosection"/>
              <element value="code"/>
              <variable value="vvv"/>
              <condition value="(code = '42346-7')"/>
            </source>
            <target>
              <context value="section"/>
              <contextType value="variable"/>
              <element value="code"/>
              <variable value="vvv"/>
              <transform value="create"/>
            </target>
            <documentation
                           value="3. Terapia Farmacologica all'ingresso Narrativa --------------------------------------------------------------------------------------------------------------"/>
          </rule>
          <rule>
            <name value="condizioneterapiaingresso"/>
            <source>
              <context value="sottosection"/>
              <element value="code"/>
              <variable value="code1"/>
              <condition value="(code = '42346-7')"/>
            </source>
            <rule>
              <name value="title"/>
              <source>
                <context value="sottosection"/>
                <element value="title"/>
                <variable value="t"/>
              </source>
              <target>
                <context value="section"/>
                <contextType value="variable"/>
                <element value="title"/>
                <transform value="evaluate"/>
                <parameter>
                  <valueString value="t.dataString"/>
                </parameter>
              </target>
            </rule>
            <rule>
              <name value="cdaText"/>
              <source>
                <context value="sottosection"/>
                <element value="text"/>
                <variable value="cdaText"/>
              </source>
              <target>
                <context value="bundle"/>
                <contextType value="variable"/>
                <element value="entry"/>
                <variable value="e10"/>
              </target>
              <target>
                <context value="e10"/>
                <contextType value="variable"/>
                <element value="request"/>
                <variable value="request"/>
                <transform value="create"/>
                <parameter>
                  <valueString value="BackboneElement"/>
                </parameter>
              </target>
              <target>
                <context value="request"/>
                <contextType value="variable"/>
                <element value="method"/>
                <transform value="copy"/>
                <parameter>
                  <valueString value="POST"/>
                </parameter>
              </target>
              <target>
                <context value="e10"/>
                <contextType value="variable"/>
                <element value="resource"/>
                <variable value="medicStatement"/>
                <transform value="create"/>
                <parameter>
                  <valueString value="MedicationStatement"/>
                </parameter>
              </target>
              <target>
                <context value="medicStatement"/>
                <contextType value="variable"/>
                <element value="id"/>
                <variable value="uuid10"/>
                <transform value="uuid"/>
              </target>
              <target>
                <context value="e10"/>
                <contextType value="variable"/>
                <element value="fullUrl"/>
                <transform value="append"/>
                <parameter>
                  <valueString value="https://example/MedicationStatement/"/>
                </parameter>
                <parameter>
                  <valueId value="uuid10"/>
                </parameter>
              </target>
              <target>
                <context value="request"/>
                <contextType value="variable"/>
                <element value="url"/>
                <transform value="copy"/>
                <parameter>
                  <valueString value="MedicationStatement"/>
                </parameter>
              </target>
              <target>
                <context value="section"/>
                <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/MedicationStatement/' + %medicStatement.id"/>
                </parameter>
              </target>
              <rule>
                <name value="reference"/>
                <source>
                  <context value="cdaText"/>
                </source>
                <target>
                  <context value="medicStatement"/>
                  <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="statuscode"/>
                <source>
                  <context value="sottosection"/>
                  <condition
                             value="medicStatement.statusCode.exists().not()"/>
                </source>
                <rule>
                  <name value="status"/>
                  <source>
                    <context value="sottosection"/>
                  </source>
                  <target>
                    <context value="medicStatement"/>
                    <contextType value="variable"/>
                    <element value="status"/>
                    <transform value="copy"/>
                    <parameter>
                      <valueString value="completed"/>
                    </parameter>
                  </target>
                </rule>
              </rule>
              <rule>
                <name value="medication"/>
                <source>
                  <context value="cdaText"/>
                </source>
                <target>
                  <context value="medicStatement"/>
                  <contextType value="variable"/>
                  <element value="medication"/>
                  <variable value="medication"/>
                  <transform value="create"/>
                  <parameter>
                    <valueString value="CodeableConcept"/>
                  </parameter>
                </target>
                <rule>
                  <name value="text"/>
                  <source>
                    <context value="cdaText"/>
                    <variable value="txt"/>
                  </source>
                  <target>
                    <context value="medication"/>
                    <contextType value="variable"/>
                    <element value="text"/>
                    <transform value="copy"/>
                    <parameter>
                      <valueId value="txt"/>
                    </parameter>
                  </target>
                </rule>
              </rule>
              <rule>
                <name value="reference"/>
                <source>
                  <context value="cdaText"/>
                </source>
                <target>
                  <context value="medicStatement"/>
                  <contextType value="variable"/>
                  <element value="note"/>
                  <variable value="note"/>
                </target>
                <rule>
                  <name value="reference"/>
                  <source>
                    <context value="cdaText"/>
                    <variable value="t"/>
                  </source>
                  <target>
                    <context value="note"/>
                    <contextType value="variable"/>
                    <element value="text"/>
                    <transform value="copy"/>
                    <parameter>
                      <valueId value="t"/>
                    </parameter>
                  </target>
                </rule>
                <rule>
                  <name value="author"/>
                  <source>
                    <context value="sottosection"/>
                    <element value="author"/>
                    <variable value="authors"/>
                  </source>
                  <rule>
                    <name value="timeAuthor"/>
                    <source>
                      <context value="authors"/>
                      <element value="time"/>
                      <variable value="time"/>
                    </source>
                    <target>
                      <context value="note"/>
                      <contextType value="variable"/>
                      <element value="time"/>
                      <variable value="value"/>
                      <transform value="create"/>
                      <parameter>
                        <valueString value="dateTime"/>
                      </parameter>
                    </target>
                    <dependent>
                      <name value="TSDateTime"/>
                      <variable value="time"/>
                      <variable value="value"/>
                    </dependent>
                  </rule>
                  <rule>
                    <name value="assighedAuthor"/>
                    <source>
                      <context value="authors"/>
                      <element value="assignedAuthor"/>
                      <variable value="assignedAuthor"/>
                    </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="PUT"/>
                      </parameter>
                    </target>
                    <target>
                      <context value="e11"/>
                      <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="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/TerapiaFarmacologicaIngresso/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="extension"/>
                        <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>
                      <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="extension"/>
                          <source>
                            <context value="id"/>
                            <element value="extension"/>
                            <variable value="ext"/>
                          </source>
                          <target>
                            <context value="practitioner"/>
                            <contextType value="variable"/>
                            <element value="id"/>
                            <variable value="uuid11"/>
                            <transform value="evaluate"/>
                            <parameter>
                              <valueString value="r + '-' + ext"/>
                            </parameter>
                          </target>
                          <target>
                            <context value="e11"/>
                            <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="request"/>
                            <contextType value="variable"/>
                            <element value="url"/>
                            <transform value="append"/>
                            <parameter>
                              <valueString value="Practitioner/"/>
                            </parameter>
                            <parameter>
                              <valueId value="uuid11"/>
                            </parameter>
                          </target>
                          <target>
                            <context value="note"/>
                            <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/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="assignedPerson"/>
                      <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>
                  </rule>
                </rule>
              </rule>
            </rule>
          </rule>
          <rule>
            <name value="code"/>
            <source>
              <context value="sottosection"/>
              <element value="code"/>
              <variable value="vvv"/>
              <condition value="(code = '48765-2')"/>
            </source>
            <target>
              <context value="section"/>
              <contextType value="variable"/>
              <element value="code"/>
              <variable value="vvv"/>
              <transform value="create"/>
            </target>
            <documentation value="4. Allergie"/>
          </rule>
          <rule>
            <name value="condizioneallergie"/>
            <source>
              <context value="sottosection"/>
              <element value="code"/>
              <variable value="code1"/>
              <condition value="(code = '48765-2')"/>
            </source>
            <rule>
              <name value="title"/>
              <source>
                <context value="sottosection"/>
                <element value="title"/>
                <variable value="t"/>
              </source>
              <target>
                <context value="section"/>
                <contextType value="variable"/>
                <element value="title"/>
                <transform value="evaluate"/>
                <parameter>
                  <valueString value="t.dataString"/>
                </parameter>
              </target>
            </rule>
            <rule>
              <name value="where"/>
              <source>
                <context value="src"/>
                <condition value="sottosection.entry.exists().not()"/>
              </source>
              <rule>
                <name value="title"/>
                <source>
                  <context value="sottosection"/>
                  <element value="title"/>
                  <variable value="t"/>
                </source>
                <target>
                  <context value="section"/>
                  <contextType value="variable"/>
                  <element value="title"/>
                  <transform value="evaluate"/>
                  <parameter>
                    <valueString value="t.dataString"/>
                  </parameter>
                </target>
              </rule>
              <rule>
                <name value="cdaText"/>
                <source>
                  <context value="sottosection"/>
                  <element value="text"/>
                  <variable value="cdaText"/>
                </source>
                <target>
                  <context value="bundle"/>
                  <contextType value="variable"/>
                  <element value="entry"/>
                  <variable value="e8"/>
                </target>
                <target>
                  <context value="e8"/>
                  <contextType value="variable"/>
                  <element value="request"/>
                  <variable value="request"/>
                  <transform value="create"/>
                  <parameter>
                    <valueString value="BackboneElement"/>
                  </parameter>
                </target>
                <target>
                  <context value="request"/>
                  <contextType value="variable"/>
                  <element value="method"/>
                  <transform value="copy"/>
                  <parameter>
                    <valueString value="POST"/>
                  </parameter>
                </target>
                <target>
                  <context value="e8"/>
                  <contextType value="variable"/>
                  <element value="resource"/>
                  <variable value="AllergyIntolerance"/>
                  <transform value="create"/>
                  <parameter>
                    <valueString value="AllergyIntolerance"/>
                  </parameter>
                </target>
                <target>
                  <context value="AllergyIntolerance"/>
                  <contextType value="variable"/>
                  <element value="id"/>
                  <variable value="uuid8"/>
                  <transform value="uuid"/>
                </target>
                <target>
                  <context value="e8"/>
                  <contextType value="variable"/>
                  <element value="fullUrl"/>
                  <transform value="append"/>
                  <parameter>
                    <valueString value="https://example/AllergyIntolerance/"/>
                  </parameter>
                  <parameter>
                    <valueId value="uuid8"/>
                  </parameter>
                </target>
                <target>
                  <context value="request"/>
                  <contextType value="variable"/>
                  <element value="url"/>
                  <transform value="copy"/>
                  <parameter>
                    <valueString value="AllergyIntolerance"/>
                  </parameter>
                </target>
                <target>
                  <context value="section"/>
                  <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/AllergyIntolerance/' + %AllergyIntolerance.id"/>
                  </parameter>
                </target>
                <rule>
                  <name value="reference"/>
                  <source>
                    <context value="cdaText"/>
                  </source>
                  <target>
                    <context value="AllergyIntolerance"/>
                    <contextType value="variable"/>
                    <element value="patient"/>
                    <variable value="reference"/>
                    <transform value="create"/>
                    <parameter>
                      <valueString value="Reference"/>
                    </parameter>
                  </target>
                  <target>
                    <context value="reference"/>
                    <contextType value="variable"/>
                    <element value="reference"/>
                    <transform value="evaluate"/>
                    <parameter>
                      <valueString
                                   value="'https://example/Patient/' + %patient.id"/>
                    </parameter>
                  </target>
                </rule>
                <rule>
                  <name value="reference"/>
                  <source>
                    <context value="cdaText"/>
                  </source>
                  <target>
                    <context value="AllergyIntolerance"/>
                    <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="clinicalStatus"/>
                  <source>
                    <context value="cdaText"/>
                  </source>
                  <target>
                    <context value="AllergyIntolerance"/>
                    <contextType value="variable"/>
                    <element value="clinicalStatus"/>
                    <variable value="status"/>
                    <transform value="create"/>
                    <parameter>
                      <valueString value="CodeableConcept"/>
                    </parameter>
                  </target>
                  <rule>
                    <name value="coding"/>
                    <source>
                      <context value="cdaText"/>
                    </source>
                    <target>
                      <context value="status"/>
                      <contextType value="variable"/>
                      <element value="coding"/>
                      <variable value="coding"/>
                      <transform value="create"/>
                      <parameter>
                        <valueString value="Coding"/>
                      </parameter>
                    </target>
                    <rule>
                      <name value="active"/>
                      <source>
                        <context value="cdaText"/>
                      </source>
                      <target>
                        <context value="coding"/>
                        <contextType value="variable"/>
                        <element value="code"/>
                        <transform value="copy"/>
                        <parameter>
                          <valueString value="active"/>
                        </parameter>
                      </target>
                    </rule>
                    <rule>
                      <name value="system"/>
                      <source>
                        <context value="cdaText"/>
                      </source>
                      <target>
                        <context value="coding"/>
                        <contextType value="variable"/>
                        <element value="system"/>
                        <transform value="copy"/>
                        <parameter>
                          <valueString
                                       value="http://terminology.hl7.org/CodeSystem/allergyintolerance-clinical"/>
                        </parameter>
                      </target>
                    </rule>
                    <rule>
                      <name value="active"/>
                      <source>
                        <context value="cdaText"/>
                      </source>
                      <target>
                        <context value="coding"/>
                        <contextType value="variable"/>
                        <element value="display"/>
                        <transform value="copy"/>
                        <parameter>
                          <valueString value="active"/>
                        </parameter>
                      </target>
                    </rule>
                  </rule>
                </rule>
                <rule>
                  <name value="reference"/>
                  <source>
                    <context value="cdaText"/>
                  </source>
                  <target>
                    <context value="AllergyIntolerance"/>
                    <contextType value="variable"/>
                    <element value="note"/>
                    <variable value="note"/>
                  </target>
                  <rule>
                    <name value="reference"/>
                    <source>
                      <context value="cdaText"/>
                      <variable value="t"/>
                    </source>
                    <target>
                      <context value="note"/>
                      <contextType value="variable"/>
                      <element value="text"/>
                      <transform value="copy"/>
                      <parameter>
                        <valueId value="t"/>
                      </parameter>
                    </target>
                  </rule>
                  <rule>
                    <name value="author"/>
                    <source>
                      <context value="sottosection"/>
                      <element value="author"/>
                      <variable value="authors"/>
                    </source>
                    <rule>
                      <name value="timeAuthor"/>
                      <source>
                        <context value="authors"/>
                        <element value="time"/>
                        <variable value="time"/>
                      </source>
                      <target>
                        <context value="note"/>
                        <contextType value="variable"/>
                        <element value="time"/>
                        <variable value="value"/>
                        <transform value="create"/>
                        <parameter>
                          <valueString value="dateTime"/>
                        </parameter>
                      </target>
                      <dependent>
                        <name value="TSDateTime"/>
                        <variable value="time"/>
                        <variable value="value"/>
                      </dependent>
                    </rule>
                    <rule>
                      <name value="assighedAuthor"/>
                      <source>
                        <context value="authors"/>
                        <element value="assignedAuthor"/>
                        <variable value="assignedAuthor"/>
                      </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="practitioner"/>
                        <transform value="create"/>
                        <parameter>
                          <valueString value="Practitioner"/>
                        </parameter>
                      </target>
                      <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/EsameObiettivo/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="extension"/>
                          <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>
                        <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="autore"/>
                            <source>
                              <context value="id"/>
                              <element value="extension"/>
                              <variable value="ext"/>
                            </source>
                            <target>
                              <context value="practitioner"/>
                              <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/Practitioner/"/>
                              </parameter>
                              <parameter>
                                <valueId value="uuid9"/>
                              </parameter>
                            </target>
                            <target>
                              <context value="request"/>
                              <contextType value="variable"/>
                              <element value="url"/>
                              <transform value="append"/>
                              <parameter>
                                <valueString value="Practitioner/"/>
                              </parameter>
                              <parameter>
                                <valueId value="uuid9"/>
                              </parameter>
                            </target>
                            <target>
                              <context value="note"/>
                              <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/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="assignedPerson"/>
                        <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>
                    </rule>
                  </rule>
                </rule>
              </rule>
              <documentation
                             value="Allergia Narrativa-------------------------------------------------------------------------------------------------------------------------------------------"/>
            </rule>
            <rule>
              <name value="allergy"/>
              <source>
                <context value="sottosection"/>
                <element value="entry"/>
                <variable value="entry1"/>
              </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="allergy"/>
                <transform value="create"/>
                <parameter>
                  <valueString value="AllergyIntolerance"/>
                </parameter>
              </target>
              <target>
                <context value="allergy"/>
                <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/AllergyIntolerance/"/>
                </parameter>
                <parameter>
                  <valueId value="uuid12"/>
                </parameter>
              </target>
              <target>
                <context value="request"/>
                <contextType value="variable"/>
                <element value="url"/>
                <transform value="copy"/>
                <parameter>
                  <valueString value="AllergyIntolerance"/>
                </parameter>
              </target>
              <target>
                <context value="section"/>
                <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/AllergyIntolerance/' + %allergy.id"/>
                </parameter>
              </target>
              <rule>
                <name value="reference"/>
                <source>
                  <context value="src"/>
                </source>
                <target>
                  <context value="allergy"/>
                  <contextType value="variable"/>
                  <element value="patient"/>
                  <variable value="reference"/>
                  <transform value="create"/>
                  <parameter>
                    <valueString value="Reference"/>
                  </parameter>
                </target>
                <target>
                  <context value="reference"/>
                  <contextType value="variable"/>
                  <element value="reference"/>
                  <transform value="evaluate"/>
                  <parameter>
                    <valueString
                                 value="'https://example/Patient/' + %patient.id"/>
                  </parameter>
                </target>
              </rule>
              <rule>
                <name value="reference"/>
                <source>
                  <context value="src"/>
                </source>
                <target>
                  <context value="allergy"/>
                  <contextType value="variable"/>
                  <element value="encounter"/>
                  <variable value="reference"/>
                  <transform value="create"/>
                  <parameter>
                    <valueString value="Reference"/>
                  </parameter>
                </target>
                <target>
                  <context value="reference"/>
                  <contextType value="variable"/>
                  <element value="reference"/>
                  <transform value="evaluate"/>
                  <parameter>
                    <valueString
                                 value="'https://example/Encounter/' + %enc.id"/>
                  </parameter>
                </target>
              </rule>
              <rule>
                <name value="entryact2"/>
                <source>
                  <context value="entry1"/>
                  <element value="act"/>
                  <variable value="actallint"/>
                </source>
                <rule>
                  <name value="onsetDateTime"/>
                  <source>
                    <context value="actallint"/>
                    <element value="effectiveTime"/>
                    <variable value="effectiveTime"/>
                  </source>
                  <target>
                    <context value="allergy"/>
                    <contextType value="variable"/>
                    <element value="onset"/>
                    <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="actallint"/>
                    <condition
                               value="effectiveTime.low.exists() or effectiveTime.high.exists()"/>
                  </source>
                  <rule>
                    <name value="onsetPeriod"/>
                    <source>
                      <context value="actallint"/>
                      <element value="effectiveTime"/>
                      <variable value="eff"/>
                    </source>
                    <target>
                      <context value="allergy"/>
                      <contextType value="variable"/>
                      <element value="onset"/>
                      <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="cdaText1"/>
                  <source>
                    <context value="sottosection"/>
                    <element value="text"/>
                    <variable value="cdaText1"/>
                  </source>
                  <target>
                    <context value="allergy"/>
                    <contextType value="variable"/>
                    <element value="note"/>
                    <variable value="note"/>
                  </target>
                  <rule>
                    <name value="reference"/>
                    <source>
                      <context value="cdaText1"/>
                      <variable value="t"/>
                    </source>
                    <target>
                      <context value="note"/>
                      <contextType value="variable"/>
                      <element value="text"/>
                      <transform value="copy"/>
                      <parameter>
                        <valueId value="t"/>
                      </parameter>
                    </target>
                  </rule>
                  <rule>
                    <name value="author"/>
                    <source>
                      <context value="sottosection"/>
                      <element value="author"/>
                      <variable value="authors"/>
                    </source>
                    <rule>
                      <name value="timeAuthor"/>
                      <source>
                        <context value="authors"/>
                        <element value="time"/>
                        <variable value="time"/>
                      </source>
                      <target>
                        <context value="note"/>
                        <contextType value="variable"/>
                        <element value="time"/>
                        <variable value="value"/>
                        <transform value="create"/>
                        <parameter>
                          <valueString value="dateTime"/>
                        </parameter>
                      </target>
                      <dependent>
                        <name value="TSDateTime"/>
                        <variable value="time"/>
                        <variable value="value"/>
                      </dependent>
                    </rule>
                    <rule>
                      <name value="assighedAuthor"/>
                      <source>
                        <context value="authors"/>
                        <element value="assignedAuthor"/>
                        <variable value="assignedAuthor"/>
                      </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="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/Allergie/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="extension"/>
                          <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>
                        <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="extension"/>
                            <source>
                              <context value="id"/>
                              <element value="extension"/>
                              <variable value="ext"/>
                            </source>
                            <target>
                              <context value="practitioner"/>
                              <contextType value="variable"/>
                              <element value="id"/>
                              <variable value="uuid13"/>
                              <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="uuid13"/>
                              </parameter>
                            </target>
                            <target>
                              <context value="request"/>
                              <contextType value="variable"/>
                              <element value="url"/>
                              <transform value="append"/>
                              <parameter>
                                <valueString value="Practitioner/"/>
                              </parameter>
                              <parameter>
                                <valueId value="uuid13"/>
                              </parameter>
                            </target>
                            <target>
                              <context value="note"/>
                              <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/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="assignedPerson"/>
                        <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>
                    </rule>
                  </rule>
                  <documentation value="mapping note"/>
                </rule>
                <rule>
                  <name value="entryrelationshipact"/>
                  <source>
                    <context value="actallint"/>
                    <element value="entryRelationship"/>
                    <variable value="entryact"/>
                  </source>
                  <rule>
                    <name value="entryobservation"/>
                    <source>
                      <context value="entryact"/>
                      <element value="observation"/>
                      <variable value="entryobs"/>
                    </source>
                    <rule>
                      <name value="code"/>
                      <source>
                        <context value="entryobs"/>
                        <element value="value"/>
                        <variable value="code"/>
                      </source>
                      <rule>
                        <name value="type"/>
                        <source>
                          <context value="code"/>
                          <element value="code"/>
                          <variable value="code1"/>
                        </source>
                        <target>
                          <context value="allergy"/>
                          <contextType value="variable"/>
                          <element value="type"/>
                          <transform value="translate"/>
                          <parameter>
                            <valueId value="code1"/>
                          </parameter>
                          <parameter>
                            <valueString value="#AllergyTypeMap"/>
                          </parameter>
                          <parameter>
                            <valueString value="code"/>
                          </parameter>
                        </target>
                      </rule>
                      <rule>
                        <name value="category"/>
                        <source>
                          <context value="code"/>
                          <element value="code"/>
                          <variable value="code2"/>
                        </source>
                        <target>
                          <context value="allergy"/>
                          <contextType value="variable"/>
                          <element value="category"/>
                          <transform value="translate"/>
                          <parameter>
                            <valueId value="code2"/>
                          </parameter>
                          <parameter>
                            <valueString value="#AllergyCategoryMap"/>
                          </parameter>
                          <parameter>
                            <valueString value="code"/>
                          </parameter>
                        </target>
                      </rule>
                    </rule>
                    <rule>
                      <name value="participant"/>
                      <source>
                        <context value="entryobs"/>
                        <element value="participant"/>
                        <variable value="partic"/>
                      </source>
                      <rule>
                        <name value="participantRole"/>
                        <source>
                          <context value="partic"/>
                          <element value="participantRole"/>
                          <variable value="pratRole"/>
                        </source>
                        <rule>
                          <name value="playingEntity"/>
                          <source>
                            <context value="pratRole"/>
                            <element value="playingEntity"/>
                            <variable value="pratent"/>
                          </source>
                          <rule>
                            <name value="reaction"/>
                            <source>
                              <context value="pratent"/>
                            </source>
                            <target>
                              <context value="allergy"/>
                              <contextType value="variable"/>
                              <element value="reaction"/>
                              <variable value="reaction"/>
                              <transform value="create"/>
                              <parameter>
                                <valueString value="BackboneElement"/>
                              </parameter>
                            </target>
                            <rule>
                              <name value="subs"/>
                              <source>
                                <context value="pratent"/>
                                <element value="code"/>
                                <variable value="vvv"/>
                              </source>
                              <target>
                                <context value="reaction"/>
                                <contextType value="variable"/>
                                <element value="substance"/>
                                <variable value="vvv"/>
                                <transform value="create"/>
                              </target>
                            </rule>
                            <rule>
                              <name value="entryRelationship"/>
                              <source>
                                <context value="entryobs"/>
                                <element value="entryRelationship"/>
                                <variable value="entryobs1"/>
                                <condition value="(typeCode = 'MFST')"/>
                              </source>
                              <rule>
                                <name value="entryobservation"/>
                                <source>
                                  <context value="entryobs1"/>
                                  <element value="observation"/>
                                  <variable value="entobs"/>
                                </source>
                                <rule>
                                  <name value="eff"/>
                                  <source>
                                    <context value="entobs"/>
                                    <element value="effectiveTime"/>
                                    <variable value="eff"/>
                                  </source>
                                  <rule>
                                    <name value="low"/>
                                    <source>
                                      <context value="eff"/>
                                      <element value="low"/>
                                      <variable value="l"/>
                                    </source>
                                    <target>
                                      <context value="reaction"/>
                                      <contextType value="variable"/>
                                      <element value="onset"/>
                                      <variable value="value"/>
                                      <transform value="create"/>
                                      <parameter>
                                        <valueString value="dateTime"/>
                                      </parameter>
                                    </target>
                                    <dependent>
                                      <name value="TSDateTime"/>
                                      <variable value="l"/>
                                      <variable value="value"/>
                                    </dependent>
                                  </rule>
                                </rule>
                                <rule>
                                  <name value="manifest"/>
                                  <source>
                                    <context value="entobs"/>
                                    <element value="value"/>
                                    <variable value="vvv"/>
                                  </source>
                                  <target>
                                    <context value="reaction"/>
                                    <contextType value="variable"/>
                                    <element value="manifestation"/>
                                    <variable value="vvv"/>
                                    <transform value="create"/>
                                  </target>
                                </rule>
                              </rule>
                            </rule>
                          </rule>
                        </rule>
                      </rule>
                    </rule>
                    <rule>
                      <name value="entryrelationship2"/>
                      <source>
                        <context value="entryobs"/>
                        <element value="entryRelationship"/>
                        <variable value="entryobs2"/>
                      </source>
                      <rule>
                        <name value="entryobservation2"/>
                        <source>
                          <context value="entryobs2"/>
                          <element value="observation"/>
                          <variable value="entobs"/>
                        </source>
                        <rule>
                          <name value="severity"/>
                          <source>
                            <context value="entobs"/>
                            <element value="code"/>
                            <variable value="code"/>
                            <condition value="(code = 'SEV')"/>
                          </source>
                          <rule>
                            <name value="value"/>
                            <source>
                              <context value="entobs"/>
                              <element value="value"/>
                              <variable value="value"/>
                            </source>
                            <rule>
                              <name value="active"/>
                              <source>
                                <context value="value"/>
                                <element value="code"/>
                                <condition value="(value.code = 'M')"/>
                              </source>
                              <target>
                                <context value="allergy"/>
                                <contextType value="variable"/>
                                <element value="criticality"/>
                                <transform value="copy"/>
                                <parameter>
                                  <valueString value="unable-to-assess"/>
                                </parameter>
                              </target>
                            </rule>
                            <rule>
                              <name value="active"/>
                              <source>
                                <context value="value"/>
                                <element value="code"/>
                                <condition value="(value.code = 'L')"/>
                              </source>
                              <target>
                                <context value="allergy"/>
                                <contextType value="variable"/>
                                <element value="criticality"/>
                                <transform value="copy"/>
                                <parameter>
                                  <valueString value="low"/>
                                </parameter>
                              </target>
                            </rule>
                            <rule>
                              <name value="active"/>
                              <source>
                                <context value="value"/>
                                <element value="code"/>
                                <condition value="(value.code = 'H')"/>
                              </source>
                              <target>
                                <context value="allergy"/>
                                <contextType value="variable"/>
                                <element value="criticality"/>
                                <transform value="copy"/>
                                <parameter>
                                  <valueString value="high"/>
                                </parameter>
                              </target>
                            </rule>
                          </rule>
                        </rule>
                      </rule>
                    </rule>
                    <rule>
                      <name value="entryrelationship3"/>
                      <source>
                        <context value="entryobs"/>
                        <element value="entryRelationship"/>
                        <variable value="entryobs3"/>
                      </source>
                      <rule>
                        <name value="entryobservation3"/>
                        <source>
                          <context value="entryobs3"/>
                          <element value="observation"/>
                          <variable value="entobs"/>
                        </source>
                        <rule>
                          <name value="33999-4"/>
                          <source>
                            <context value="entobs"/>
                            <element value="code"/>
                            <variable value="code"/>
                            <condition value="(code = '33999-4')"/>
                          </source>
                          <rule>
                            <name value="clinicalStatus"/>
                            <source>
                              <context value="entobs"/>
                            </source>
                            <target>
                              <context value="allergy"/>
                              <contextType value="variable"/>
                              <element value="clinicalStatus"/>
                              <variable value="status"/>
                              <transform value="create"/>
                              <parameter>
                                <valueString value="CodeableConcept"/>
                              </parameter>
                            </target>
                            <rule>
                              <name value="coding"/>
                              <source>
                                <context value="entobs"/>
                              </source>
                              <target>
                                <context value="status"/>
                                <contextType value="variable"/>
                                <element value="coding"/>
                                <variable value="coding"/>
                                <transform value="create"/>
                                <parameter>
                                  <valueString value="Coding"/>
                                </parameter>
                              </target>
                              <rule>
                                <name value="value1"/>
                                <source>
                                  <context value="entobs"/>
                                  <element value="value"/>
                                  <variable value="value"/>
                                </source>
                                <rule>
                                  <name value="active"/>
                                  <source>
                                    <context value="value"/>
                                    <element value="code"/>
                                    <condition
                                               value="(value.code = 'LA16666-2')"/>
                                  </source>
                                  <target>
                                    <context value="coding"/>
                                    <contextType value="variable"/>
                                    <element value="code"/>
                                    <transform value="copy"/>
                                    <parameter>
                                      <valueString value="active"/>
                                    </parameter>
                                  </target>
                                </rule>
                                <rule>
                                  <name value="active"/>
                                  <source>
                                    <context value="value"/>
                                    <element value="code"/>
                                    <condition
                                               value="(value.code = 'LA18632-2')"/>
                                  </source>
                                  <target>
                                    <context value="coding"/>
                                    <contextType value="variable"/>
                                    <element value="code"/>
                                    <transform value="copy"/>
                                    <parameter>
                                      <valueString value="inactive"/>
                                    </parameter>
                                  </target>
                                </rule>
                                <rule>
                                  <name value="system"/>
                                  <source>
                                    <context value="value"/>
                                    <element value="codeSystem"/>
                                    <variable value="system"/>
                                  </source>
                                  <target>
                                    <context value="coding"/>
                                    <contextType value="variable"/>
                                    <element value="system"/>
                                    <transform value="copy"/>
                                    <parameter>
                                      <valueString
                                                   value="http://terminology.hl7.org/CodeSystem/allergyintolerance-clinical"/>
                                    </parameter>
                                  </target>
                                </rule>
                                <rule>
                                  <name value="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>
                                  <documentation
                                                 value="value-&gt;coding.version='ConditionClinicalStatusCodes 4.0.1'&quot;version&quot;;"/>
                                </rule>
                              </rule>
                            </rule>
                            <documentation
                                           value="entobs.value-&gt;allergy.clinicalStatus &quot;cstatus&quot;;"/>
                          </rule>
                        </rule>
                      </rule>
                    </rule>
                    <rule>
                      <name value="entryrelationshi4"/>
                      <source>
                        <context value="entryobs"/>
                        <element value="entryRelationship"/>
                        <variable value="entryobs4"/>
                      </source>
                      <rule>
                        <name value="entryact1"/>
                        <source>
                          <context value="entryobs4"/>
                          <element value="act"/>
                          <variable value="entact"/>
                        </source>
                        <rule>
                          <name value="txtact"/>
                          <source>
                            <context value="entact"/>
                            <element value="text"/>
                            <variable value="actext"/>
                          </source>
                          <rule>
                            <name value="notetxt"/>
                            <source>
                              <context value="actext"/>
                              <element value="reference"/>
                              <variable value="reftxt"/>
                            </source>
                            <target>
                              <context value="allergy"/>
                              <contextType value="variable"/>
                              <element value="note"/>
                              <variable value="note"/>
                              <transform value="create"/>
                              <parameter>
                                <valueString value="BackboneElement"/>
                              </parameter>
                            </target>
                            <rule>
                              <name value="notxt"/>
                              <source>
                                <context value="reftxt"/>
                                <variable value="ref"/>
                              </source>
                              <target>
                                <context value="note"/>
                                <contextType value="variable"/>
                                <element value="text"/>
                                <transform value="evaluate"/>
                                <parameter>
                                  <valueString value="ref.value"/>
                                </parameter>
                              </target>
                            </rule>
                          </rule>
                        </rule>
                      </rule>
                    </rule>
                  </rule>
                </rule>
              </rule>
              <documentation
                             value="Allergia Strutturata----------------------------------------------------------------------------------------------------------------------------------------"/>
            </rule>
          </rule>
          <rule>
            <name value="code"/>
            <source>
              <context value="sottosection"/>
              <element value="code"/>
              <variable value="vvv"/>
              <condition value="(code = '11450-4')"/>
            </source>
            <target>
              <context value="section"/>
              <contextType value="variable"/>
              <element value="code"/>
              <variable value="vvv"/>
              <transform value="create"/>
            </target>
            <documentation value="5. Problemi aperti"/>
          </rule>
          <rule>
            <name value="condizioneproblemiaperti"/>
            <source>
              <context value="sottosection"/>
              <element value="code"/>
              <variable value="code1"/>
              <condition value="(code = '11450-4')"/>
            </source>
            <rule>
              <name value="title"/>
              <source>
                <context value="sottosection"/>
                <element value="title"/>
                <variable value="t"/>
              </source>
              <target>
                <context value="section"/>
                <contextType value="variable"/>
                <element value="title"/>
                <transform value="evaluate"/>
                <parameter>
                  <valueString value="t.dataString"/>
                </parameter>
              </target>
            </rule>
            <rule>
              <name value="cdaText"/>
              <source>
                <context value="sottosection"/>
                <element value="text"/>
                <variable value="cdaText"/>
              </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="condition"/>
                <transform value="create"/>
                <parameter>
                  <valueString value="Condition"/>
                </parameter>
              </target>
              <target>
                <context value="condition"/>
                <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/Condition/"/>
                </parameter>
                <parameter>
                  <valueId value="uuid14"/>
                </parameter>
              </target>
              <target>
                <context value="request"/>
                <contextType value="variable"/>
                <element value="url"/>
                <transform value="copy"/>
                <parameter>
                  <valueString value="Condition"/>
                </parameter>
              </target>
              <target>
                <context value="section"/>
                <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/Condition/' + %condition.id"/>
                </parameter>
              </target>
              <rule>
                <name value="reference"/>
                <source>
                  <context value="cdaText"/>
                </source>
                <target>
                  <context value="condition"/>
                  <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="cdaText"/>
                </source>
                <target>
                  <context value="condition"/>
                  <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="code"/>
                <source>
                  <context value="sottosection"/>
                  <element value="code"/>
                  <variable value="vvv"/>
                </source>
                <target>
                  <context value="condition"/>
                  <contextType value="variable"/>
                  <element value="code"/>
                  <variable value="vvv"/>
                  <transform value="create"/>
                </target>
              </rule>
              <rule>
                <name value="reference"/>
                <source>
                  <context value="cdaText"/>
                </source>
                <target>
                  <context value="condition"/>
                  <contextType value="variable"/>
                  <element value="note"/>
                  <variable value="note"/>
                </target>
                <rule>
                  <name value="reference"/>
                  <source>
                    <context value="cdaText"/>
                    <variable value="t"/>
                  </source>
                  <target>
                    <context value="note"/>
                    <contextType value="variable"/>
                    <element value="text"/>
                    <transform value="copy"/>
                    <parameter>
                      <valueId value="t"/>
                    </parameter>
                  </target>
                </rule>
                <rule>
                  <name value="author"/>
                  <source>
                    <context value="sottosection"/>
                    <element value="author"/>
                    <variable value="authors"/>
                  </source>
                  <rule>
                    <name value="timeAuthor"/>
                    <source>
                      <context value="authors"/>
                      <element value="time"/>
                      <variable value="time"/>
                    </source>
                    <target>
                      <context value="note"/>
                      <contextType value="variable"/>
                      <element value="time"/>
                      <variable value="value"/>
                      <transform value="create"/>
                      <parameter>
                        <valueString value="dateTime"/>
                      </parameter>
                    </target>
                    <dependent>
                      <name value="TSDateTime"/>
                      <variable value="time"/>
                      <variable value="value"/>
                    </dependent>
                  </rule>
                  <rule>
                    <name value="assighedAuthor"/>
                    <source>
                      <context value="authors"/>
                      <element value="assignedAuthor"/>
                      <variable value="assignedAuthor"/>
                    </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="PUT"/>
                      </parameter>
                    </target>
                    <target>
                      <context value="e15"/>
                      <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="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/ProblemiAperti/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="extension"/>
                        <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>
                      <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="uuid15"/>
                            <transform value="evaluate"/>
                            <parameter>
                              <valueString value="r + '-' + ext"/>
                            </parameter>
                          </target>
                          <target>
                            <context value="e15"/>
                            <contextType value="variable"/>
                            <element value="fullUrl"/>
                            <transform value="append"/>
                            <parameter>
                              <valueString
                                           value="https://example/Practitioner/"/>
                            </parameter>
                            <parameter>
                              <valueId value="uuid15"/>
                            </parameter>
                          </target>
                          <target>
                            <context value="request"/>
                            <contextType value="variable"/>
                            <element value="url"/>
                            <transform value="append"/>
                            <parameter>
                              <valueString value="Practitioner/"/>
                            </parameter>
                            <parameter>
                              <valueId value="uuid15"/>
                            </parameter>
                          </target>
                          <target>
                            <context value="note"/>
                            <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/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="assignedPerson"/>
                      <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>
                  </rule>
                </rule>
              </rule>
            </rule>
          </rule>
        </rule>
      </rule>
      <documentation value="START sottosections"/>
    </rule>
  </group>
  <group>
    <name value="Act"/>
    <typeMode value="none"/>
    <documentation
                   value="______2._____________ClinicalStatements________________________"/>
    <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="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="code"/>
      </source>
      <target>
        <context value="enc"/>
        <contextType value="variable"/>
        <element value="extension"/>
        <variable value="extension2"/>
      </target>
      <dependent>
        <name value="modeOfArrival"/>
        <variable value="code"/>
        <variable value="extension2"/>
      </dependent>
    </rule>
    <rule>
      <name value="participant"/>
      <source>
        <context value="cda"/>
        <element value="participant"/>
        <variable value="participant"/>
      </source>
      <rule>
        <name value="fhirParticipant"/>
        <source>
          <context value="participant"/>
        </source>
        <target>
          <context value="enc"/>
          <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="participantrole"/>
        <source>
          <context value="participant"/>
          <element value="participantRole"/>
          <variable value="participantRole"/>
        </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="enc"/>
          <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/PractitionerRole/' + %practitionerRole.id"/>
          </parameter>
        </target>
        <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>
    </rule>
  </group>
  <group>
    <name value="modeOfArrival"/>
    <typeMode value="none"/>
    <documentation
                   value="______3._____________Extensions_DtType________________________"/>
    <input>
      <name value="src"/>
      <type value="CE"/>
      <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/encounter-modeOfArrival"/>
        </parameter>
      </target>
    </rule>
    <rule>
      <name value="coding"/>
      <source>
        <context value="src"/>
      </source>
      <target>
        <context value="ext"/>
        <contextType value="variable"/>
        <element value="value"/>
        <variable value="code1"/>
        <transform value="create"/>
        <parameter>
          <valueString value="Coding"/>
        </parameter>
      </target>
      <dependent>
        <name value="coding"/>
        <variable value="src"/>
        <variable value="code1"/>
      </dependent>
    </rule>
  </group>
  <group>
    <name value="coding"/>
    <typeMode value="none"/>
    <input>
      <name value="src"/>
      <type value="CE"/>
      <mode value="source"/>
    </input>
    <input>
      <name value="tgt"/>
      <type value="Coding"/>
      <mode value="target"/>
    </input>
    <rule>
      <name value="code"/>
      <source>
        <context value="src"/>
        <element value="code"/>
        <variable value="code"/>
      </source>
      <target>
        <context value="tgt"/>
        <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="src"/>
        <element value="codeSystem"/>
        <variable value="system"/>
      </source>
      <target>
        <context value="tgt"/>
        <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="src"/>
        <element value="displayName"/>
        <variable value="display"/>
      </source>
      <target>
        <context value="tgt"/>
        <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="src"/>
        <element value="codeSystemVersion"/>
        <variable value="version"/>
      </source>
      <target>
        <context value="tgt"/>
        <contextType value="variable"/>
        <element value="version"/>
        <transform value="cast"/>
        <parameter>
          <valueId value="version"/>
        </parameter>
        <parameter>
          <valueString value="string"/>
        </parameter>
      </target>
    </rule>
  </group>
  <group>
    <name value="periodTiming"/>
    <typeMode value="none"/>
    <input>
      <name value="effectiveTime"/>
      <type value="PIVL_TS"/>
      <mode value="source"/>
    </input>
    <input>
      <name value="timing"/>
      <type value="Timing"/>
      <mode value="target"/>
    </input>
    <rule>
      <name value="repeat"/>
      <source>
        <context value="effectiveTime"/>
      </source>
      <target>
        <context value="timing"/>
        <contextType value="variable"/>
        <element value="repeat"/>
        <variable value="r"/>
      </target>
      <rule>
        <name value="period"/>
        <source>
          <context value="effectiveTime"/>
          <element value="period"/>
          <variable value="p"/>
        </source>
        <target>
          <context value="r"/>
          <contextType value="variable"/>
          <element value="period"/>
          <transform value="evaluate"/>
          <parameter>
            <valueString value="p.value"/>
          </parameter>
        </target>
      </rule>
      <rule>
        <name value="period"/>
        <source>
          <context value="effectiveTime"/>
          <element value="period"/>
          <variable value="p"/>
        </source>
        <target>
          <context value="r"/>
          <contextType value="variable"/>
          <element value="periodUnit"/>
          <transform value="evaluate"/>
          <parameter>
            <valueString value="p.unit"/>
          </parameter>
        </target>
      </rule>
    </rule>
  </group>
</StructureMap>