CDA to FHIR Maps
0.1.0 - ci-build IT

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

: CDA to FHIR - VPS - JSON Representation

Draft as of 2024-04-11

Raw json | Download


{
  "resourceType" : "StructureMap",
  "id" : "cda2fhirEdReport",
  "text" : {
    "status" : "generated",
    "div" : "<div xmlns=\"http://www.w3.org/1999/xhtml\">\n         <pre>map &quot;http://hl7.it/fhir/cda2fhir/StructureMap/cda2fhirEdReport&quot; = &quot;cda2fhirEdReport&quot;\n\nuses &quot;http://hl7.org/fhir/cda/StructureDefinition/ClinicalDocument&quot; alias ClinicalDocument as source\nuses &quot;http://hl7.org/fhir/cda/StructureDefinition/AssignedAuthor&quot; alias AssignedAuthor as queried\nuses &quot;http://hl7.org/fhir/cda/StructureDefinition/AssignedEntity&quot; alias AssignedEntity as queried\nuses &quot;http://hl7.org/fhir/cda/StructureDefinition/AssociatedEntity&quot; alias AssociatedEntity as queried\nuses &quot;http://hl7.org/fhir/cda/StructureDefinition/CustodianOrganization&quot; alias CustodianOrganization as queried\nuses &quot;http://hl7.org/fhir/cda/StructureDefinition/OrganizationPartOf&quot; alias OrganizationPartOf as queried\nuses &quot;http://hl7.org/fhir/cda/StructureDefinition/Organization&quot; alias rapresentedOrganization as queried\nuses &quot;http://hl7.org/fhir/cda/StructureDefinition/Section&quot; alias Section as queried\nuses &quot;http://hl7.org/fhir/cda/StructureDefinition/PatientRole&quot; alias PatientRole as queried\nuses &quot;http://hl7.org/fhir/cda/StructureDefinition/AD&quot; alias AD as source\nuses &quot;http://hl7.org/fhir/StructureDefinition/Bundle&quot; alias Bundle as target\nuses &quot;http://hl7.org/fhir/StructureDefinition/Composition&quot; alias Composition as produced\nuses &quot;http://hl7.org/fhir/StructureDefinition/Patient&quot; alias Patient as produced\nuses &quot;http://hl7.org/fhir/StructureDefinition/Encounter&quot; alias Encounter as produced\nuses &quot;http://hl7.org/fhir/StructureDefinition/Person&quot; alias Patient as produced\nuses &quot;http://hl7.org/fhir/StructureDefinition/Practitioner&quot; alias Practitioner as produced\nuses &quot;http://hl7.org/fhir/StructureDefinition/Organization&quot; alias Organization as produced\nuses &quot;http://hl7.org/fhir/cda/StructureDefinition/Act&quot; alias Act as produced\nuses &quot;http://hl7.org/fhir/cda/StructureDefinition/IVL-PQ&quot; alias IVL_PQ as source\nuses &quot;http://hl7.org/fhir/cda/StructureDefinition/IVL-TS&quot; as source\nuses &quot;http://hl7.org/fhir/cda/StructureDefinition/PQ&quot; alias PQ as source\nuses &quot;http://hl7.org/fhir/StructureDefinition/SimpleQuantity&quot; alias SimpleQuantity as target\n\nimports &quot;http://hl7.it/fhir/cda2fhir/StructureMap/cda2fhirDataTypes&quot;\nimports &quot;http://hl7.it/fhir/cda2fhir/StructureMap/cda2fhirHeader&quot;\n\n// --------------------------------------------------------------------------------------------\ngroup CdaToBundle(source cda : ClinicalDocument, target bundle : Bundle) {\n  cda -&gt;  bundle.entry as e,  e.request = create('BackboneElement') as request,  request.method = 'POST',  e.resource = create('Composition') as composition,  composition.id = uuid() as uuid1,  e.fullUrl = append('https://example/Composition/', uuid1),  request.url = 'Composition',  bundle.entry as e2,  e2.request = create('BackboneElement') as requestPAT,  requestPAT.method = 'PUT',  e2.resource = create('Patient') as patient,  patient.id = uuid() as uuid2,  e2.fullUrl = append('https://example/Patient/', uuid2),  bundle.entry as e3,  e3.request = create('BackboneElement') as request,  request.method = 'POST',  e3.resource = create('Encounter') as encounter,  encounter.id = uuid() as uuid3,  e3.fullUrl = append('https://example/Encounter/', uuid3),  request.url = 'Encounter',  bundle.entry as 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 {\n    cda then ClinicalDocumentToBundle(cda, patient, composition, encounter, bundle, DocumentReference) &quot;cdatobundle&quot;;\n    cda.recordTarget as recordTarget then {\n      recordTarget.patientRole as patient then {\n        patient.id as id -&gt; patient.identifier as identifier then {\n          id.root as r -&gt; identifier.system = translate(r, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri') &quot;root1&quot;;\n          id.extension as ext1 -&gt; identifier.value = ext1 &quot;value&quot;;\n          id.assigningAuthorityName as s -&gt;  identifier.assigner as a,  a.display = s;\n        } &quot;idfr&quot;;\n        patient.id as id where (root = '2.16.840.1.113883.2.9.4.3.2') or (root = '2.16.840.1.113883.2.9.4.3.7') or (root = '2.16.840.1.113883.2.9.4.3.3') or (root = '2.16.840.1.113883.2.9.4.3.17') or (root = '2.16.840.1.113883.2.9.4.3.18') or (root = '2.16.840.1.113883.2.9.2.10.4.1.1') or (root = '2.16.840.1.113883.2.9.2.20.4.1.1') or (root = '2.16.840.1.113883.2.9.2.30.4.1.1') or (root = '2.16.840.1.113883.2.9.2.41.4.1.1') or (root = '2.16.840.1.113883.2.9.2.42.4.1.1') or (root = '2.16.840.1.113883.2.9.2.50.4.1.1') or (root = '2.16.840.1.113883.2.9.2.60.4.1.1') or (root = '2.16.840.1.113883.2.9.2.70.4.1.1') or (root = '2.16.840.1.113883.2.9.2.80.4.1.1') or (root = '2.16.840.1.113883.2.9.2.90.4.1.1') or (root = '2.16.840.1.113883.2.9.2.100.4.1.1') or (root = '2.16.840.1.113883.2.9.2.110.4.1.1') or (root = '2.16.840.1.113883.2.9.2.120.4.1.1') or (root = '2.16.840.1.113883.2.9.2.130.4.1.1') or (root = '2.16.840.1.113883.2.9.2.140.4.1.1') or (root = '2.16.840.1.113883.2.9.2.150.4.1.1') or (root = '2.16.840.1.113883.2.9.2.160.4.1.1') or (root = '2.16.840.1.113883.2.9.2.170.4.1.1') or (root = '2.16.840.1.113883.2.9.2.180.4.1.1') or (root = '2.16.840.1.113883.2.9.2.190.4.1.1') or (root = '2.16.840.1.113883.2.9.2.200.4.1.1') or (root = '2.16.840.1.113883.2.9.2.10.4.1') or (root = '2.16.840.1.113883.2.9.2.20.4.1') or (root = '2.16.840.1.113883.2.9.2.30.4.1') or (root = '2.16.840.1.113883.2.9.2.41.4.1') or (root = '2.16.840.1.113883.2.9.2.42.4.1') or (root = '2.16.840.1.113883.2.9.2.50.4.1') or (root = '2.16.840.1.113883.2.9.2.60.4.1') or (root = '2.16.840.1.113883.2.9.2.70.4.1') or (root = '2.16.840.1.113883.2.9.2.80.4.1') or (root = '2.16.840.1.113883.2.9.2.90.4.1') or (root = '2.16.840.1.113883.2.9.2.100.4.1') or (root = '2.16.840.1.113883.2.9.2.110.4.1') or (root = '2.16.840.1.113883.2.9.2.120.4.1') or (root = '2.16.840.1.113883.2.9.2.130.4.1') or (root = '2.16.840.1.113883.2.9.2.140.4.1') or (root = '2.16.840.1.113883.2.9.2.150.4.1') or (root = '2.16.840.1.113883.2.9.2.160.4.1') or (root = '2.16.840.1.113883.2.9.2.170.4.1') or (root = '2.16.840.1.113883.2.9.2.180.4.1') or (root = '2.16.840.1.113883.2.9.2.190.4.1') or (root = '2.16.840.1.113883.2.9.2.200.4.1') or (root = '2.16.840.1.113883.2.9.4.3.15') then {\n          id.extension as ext -&gt; requestPAT.url = append('Patient?identifier=', ext) &quot;UUID&quot;;\n        } &quot;ext&quot;;\n      } &quot;record&quot;;\n    } &quot;recPat&quot;;\n  } &quot;ClinicalDocumentToBody&quot;;\n}\n\ngroup ClinicalDocumentToBundle(source cda : ClinicalDocument, target patient : Patient, target composition : Composition, target encounter : Encounter, target bundle : Bundle, target documentreference : DocumentReference) {\n  cda -&gt; bundle.id = uuid() &quot;id&quot;;\n  cda.id -&gt; bundle.identifier &quot;identifier&quot;;\n  cda -&gt; bundle.type = 'transaction' &quot;type&quot;;\n  cda -&gt; bundle.timestamp = (timestamp.now()) &quot;date&quot;;\n  cda then ClinicalDocumentComposition(cda, composition, patient, encounter, bundle, documentreference) &quot;composition&quot;;\n  cda.component as component then {\n    component.structuredBody as body then {\n      body.component as component then {\n        component.section as srcSection then {\n          srcSection.code where (code = '11459-5') -&gt; composition.section as tgtSection then ModalitadiTrasposto(cda, srcSection, patient, tgtSection, bundle, encounter) &quot;Modalitaditrasporto&quot;;\n          srcSection.code where (code = '78337-3') -&gt; composition.section as tgtSection then InquadramentoClinicoIniziale(cda, srcSection, patient, tgtSection, bundle, encounter) &quot;Inquadramentoclinico&quot;;\n          srcSection.code where (code = '46239-0') -&gt; composition.section as tgtSection then MotivoDellaVisita(cda, srcSection, patient, tgtSection, bundle, encounter) &quot;Inquadramentoclinico&quot;;\n          srcSection.code where (code = '54094-8') -&gt; composition.section as tgtSection then Triage(cda, srcSection, patient, tgtSection, bundle, encounter) &quot;Triage&quot;;\n          srcSection.code where (code = '46240-8') -&gt; composition.section as tgtSection then ClinicalDocumentSectionEncounter(cda, srcSection, patient, tgtSection, bundle, encounter) &quot;motivoricovero&quot;;\n          srcSection.code where (code = '8648-8') -&gt; composition.section as tgtSection then ClinicalDocumentSectionDecorsoOspedaliero(cda, srcSection, patient, tgtSection, bundle, encounter) &quot;DecorsoOspedaliero&quot;;\n          srcSection.code where (code = '55109-3') -&gt; composition.section as tgtSection then ClinicalDocumentSectionComplicanze(cda, srcSection, patient, tgtSection, bundle, encounter) &quot;Complicazioni&quot;;\n          srcSection.code where (code = '62387-6') -&gt; composition.section as tgtSection then ClinicalDocumentSectionConsulenza(cda, srcSection, patient, tgtSection, bundle, encounter) &quot;Hospitaldischargestudiessummary&quot;;\n          srcSection.code where (code = '30954-2') -&gt; composition.section as tgtSection then ClinicalDocumentSectionAccertamenti(cda, srcSection, patient, tgtSection, bundle, encounter) &quot;Accertamenti&quot;;\n          srcSection.code where (code = '8716-3') -&gt; composition.section as tgtSection then ClinicalDocumentSectionParametriVitali(cda, srcSection, patient, tgtSection, bundle, encounter) &quot;Accertamenti&quot;;\n          srcSection.code where (code = '29549-3') -&gt; composition.section as tgtSection then ClinicalDocumentSectionTerapiaFarmacoInPronto(cda, srcSection, patient, tgtSection, bundle, encounter) &quot;Accertamenti&quot;;\n          srcSection.code where (code = '18776-5') -&gt; composition.section as tgtSection then ClinicalDocumentSectionPianoCuraDimissione(cda, srcSection, patient, tgtSection, bundle, encounter) &quot;Pianodicuraalladimissione&quot;;\n          srcSection.code where (code = '28574-2') -&gt; composition.section as tgtSection then ClinicalDocumentSectionDimissione(cda, srcSection, patient, tgtSection, bundle, encounter) &quot;Dimissione&quot;;\n          srcSection.code where (code = '75311-1') -&gt; composition.section as tgtSection then ClinicalDocumentSectionTerapiaFarmacologicaDimissione(cda, srcSection, patient, tgtSection, bundle, encounter) &quot;TerapiaFarmacologicaDimissione&quot;;\n        };\n      };\n    } &quot;body&quot;;\n  };\n}\n\n// Sezione complicanze--------------------------------------------------------------------------\ngroup ClinicalDocumentSectionComplicanze(source cda : ClinicalDocument, source src : Section, target patient : Patient, target tgt, target bundle : Bundle, target enc : Encounter) {\n  src.title as t -&gt; tgt.title = (t.dataString);\n  src.code -&gt; tgt.code;\n  src where src.entry.exists() then {\n    src.text as cdaText -&gt; tgt.text as fhirText then {\n      cdaText -&gt; fhirText.status = 'generated' &quot;narrativeStatus&quot;;\n      cdaText as t -&gt; fhirText.div = t &quot;narrativeText&quot;;\n    } &quot;cdaText&quot;;\n  } &quot;entryexists&quot;;\n  // Sezione Strutturata-----------------------------------------------------------------------------------------------------------------------------------------------\n  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 {\n    entry1.observation as obs then Observation(obs, patient, enc, observation, bundle) &quot;act&quot;;\n  };\n  // Sezione Narrativa---------------------------------------------------------------------------------------------------------------------------------------------\n  src where src.entry.exists().not() then {\n    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 {\n      src -&gt;  Observation.subject = create('Reference') as reference,  reference.reference = ('https://example/Patient/' + %patient.id) &quot;reference&quot;;\n      src -&gt;  Observation.encounter = create('Reference') as reference,  reference.reference = ('https://example/Encounter/' + %enc.id) &quot;reference&quot;;\n      src.code -&gt; Observation.code;\n      src where observation.statusCode.exists().not() then {\n        src -&gt; Observation.status = 'final' &quot;status&quot;;\n      } &quot;statuscode&quot;;\n      cdaText -&gt; Observation.note as note then {\n        cdaText as t -&gt; note.text = t &quot;reference&quot;;\n      } &quot;reference&quot;;\n    } &quot;cdaText&quot;;\n  } &quot;where&quot;;\n}\n\ngroup Observation(source obs : Observation, target patient : Patient, target encounter : Encounter, target ob : Observation, target bundle : Bundle) {\n  obs -&gt;  ob.subject = create('Reference') as reference,  reference.reference = ('https://example/Patient/' + %patient.id) &quot;reference&quot;;\n  obs -&gt;  ob.encounter = create('Reference') as reference,  reference.reference = ('https://example/Encounter/' + %encounter.id) &quot;reference&quot;;\n  obs.code -&gt; ob.code;\n  obs.statusCode as statusc where (code = 'completed') -&gt; ob.status = 'final';\n  obs.statusCode as statusc where (code = 'active') -&gt; ob.status = 'registered';\n  obs.statusCode as statusc where (code = 'aborted') -&gt; ob.status = 'cancelled';\n  obs.statusCode as statusc where (code = 'suspended') -&gt; ob.status = 'partial';\n  obs where obs.statusCode.exists().not() then {\n    obs -&gt; ob.status = 'final' &quot;status&quot;;\n  } &quot;statuscode&quot;;\n  obs.effectiveTime as effectiveTime -&gt; ob.effective = create('dateTime') as value then TSDateTime(effectiveTime, value) &quot;value2&quot;;\n  obs where effectiveTime.low.exists() or effectiveTime.high.exists() then {\n    obs.effectiveTime as eff -&gt; ob.effective = create('Period') as period then IVLTSPeriod(eff, period);\n  } &quot;where&quot;;\n  obs.value : INT as int -&gt; ob.value = (int.value);\n  obs.value : CD as val then {\n    val -&gt; ob.value = create('CodeableConcept') as ce then {\n      val.originalText -&gt; ce.text;\n      val -&gt; ce.coding as coding then {\n        val.code as code -&gt; coding.code = cast(code, 'string');\n        val.codeSystem as system -&gt; coding.system = translate(system, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri');\n        val.displayName as display -&gt; coding.display = cast(display, 'string');\n      } &quot;code&quot;;\n      val.translation as translation -&gt; ce.coding as coding then {\n        translation.code as code -&gt; coding.code = cast(code, 'string');\n        translation.codeSystem as system -&gt; coding.system = translate(system, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri');\n        translation.displayName as display -&gt; coding.display = cast(display, 'string');\n        translation.qualifier as qualifier then {\n          qualifier.value as value -&gt; ce.coding as coding then {\n            value.code as code -&gt; coding.code = cast(code, 'string');\n            value.codeSystem as system -&gt; coding.system = translate(system, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri');\n            value.displayName as display -&gt; coding.display = cast(display, 'string');\n          };\n        } &quot;translation1&quot;;\n      };\n    } &quot;coding&quot;;\n  } &quot;val&quot;;\n  obs.value : CE as val then {\n    val -&gt; ob.value = create('CodeableConcept') as ce then {\n      val.originalText -&gt; ce.text;\n      val -&gt; ce.coding as coding then {\n        val.code as code -&gt; coding.code = cast(code, 'string');\n        val.codeSystem as system -&gt; coding.system = translate(system, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri');\n        val.displayName as display -&gt; coding.display = cast(display, 'string');\n      } &quot;code&quot;;\n      val.translation as translation -&gt; ce.coding as coding then {\n        translation.code as code -&gt; coding.code = cast(code, 'string');\n        translation.codeSystem as system -&gt; coding.system = translate(system, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri');\n        translation.displayName as display -&gt; coding.display = cast(display, 'string');\n        translation.qualifier as qualifier then {\n          qualifier.value as value -&gt; ce.coding as coding then {\n            value.code as code -&gt; coding.code = cast(code, 'string');\n            value.codeSystem as system -&gt; coding.system = translate(system, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri');\n            value.displayName as display -&gt; coding.display = cast(display, 'string');\n          };\n        } &quot;translation1&quot;;\n      };\n    } &quot;coding&quot;;\n  } &quot;val&quot;;\n  obs.value : PQ as val then {\n    val -&gt; ob.value = create('Quantity') as quantity then {\n      val.value as value -&gt; quantity.value = value;\n      val.unit as unit -&gt; quantity.unit = unit;\n    } &quot;quantity&quot;;\n  } &quot;valueQuantity&quot;;\n  obs.value : BL as value -&gt;  ob.value = create('boolean'),  ob.value = (value.value);\n  obs.value : ST as value -&gt;  ob.value = create('string'),  ob.value = (value.dataString);\n  obs.interpretationCode -&gt; ob.interpretation;\n  obs.methodCode -&gt; ob.method;\n  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 {\n    performer.assignedEntity as entity then {\n      entity -&gt; practitioner.meta as meta then {\n        entity -&gt; meta.tag = create('Coding') as coding then {\n          entity -&gt; coding.system = 'http://algoritmodiscoring' &quot;system&quot;;\n          entity -&gt; coding.code = 'ClinicalDocument/body/observation/performer' &quot;code&quot;;\n        } &quot;coding&quot;;\n      } &quot;meta&quot;;\n      entity.id as id -&gt; practitioner.identifier as identifier then {\n        id.root as r -&gt; identifier.system = translate(r, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri') &quot;root1&quot;;\n        id.extension as ext -&gt; identifier.value = ext then {\n          entity -&gt; request.url = append('Practitioner?identifier=', ext) &quot;UUID&quot;;\n        } &quot;ext&quot;;\n        id.assigningAuthorityName as s -&gt;  identifier.assigner as a,  a.display = s;\n        id.root as r then {\n          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;;\n        } &quot;r&quot;;\n      } &quot;identifier&quot;;\n      entity.assignedPerson as person then {\n        person.name -&gt; practitioner.name;\n        person.birthTime as birthTime then {\n          birthTime.value as date -&gt; practitioner.birthDate = truncate(date, 10);\n        } &quot;birth&quot;;\n      } &quot;name&quot;;\n    };\n  };\n  obs.referenceRange as refRange -&gt; ob.referenceRange = create('BackboneElement') as ref then {\n    refRange.observationRange as obsRange -&gt; ref.low = create('SimpleQuantity') as Low then {\n      obsRange.value : IVL_PQ as v then {\n        v.low as l1 then {\n          l1.value as decValue -&gt; Low.value = decValue;\n          l1.unit as Unit -&gt; Low.unit = Unit;\n        } &quot;decValue&quot;;\n      } &quot;IVL-PQ&quot;;\n    } &quot;obsRange&quot;;\n  } &quot;refRange&quot;;\n}\n\n// ------------------------------------------------------------------------------------------------------\n// Sezione Decorso Ospedaliero----------------------------------------------------------------------------\ngroup ClinicalDocumentSectionDecorsoOspedaliero(source cda : ClinicalDocument, source src : Section, target patient : Patient, target tgt, target bundle : Bundle, target enc : Encounter) {\n  src.title as t -&gt; tgt.title = (t.dataString);\n  src.code -&gt; tgt.code;\n  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 {\n    src.code -&gt; observation.code;\n    src where observation.statusCode.exists().not() then {\n      src -&gt; observation.status = 'final' &quot;status&quot;;\n    } &quot;statuscode&quot;;\n    src -&gt;  observation.subject = create('Reference') as reference,  reference.reference = ('https://example/Patient/' + %patient.id) &quot;reference&quot;;\n    src -&gt;  observation.encounter = create('Reference') as reference,  reference.reference = ('https://example/Encounter/' + %enc.id) &quot;reference&quot;;\n    src.text as t -&gt; note.text = t &quot;reference&quot;;\n    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 {\n      auth.time as ti -&gt; note.time = create('dateTime') as value then TSDateTime(ti, value);\n      auth.assignedAuthor as assAuth then {\n        // meta+identifier\n        assAuth -&gt; practitioner.meta as meta then {\n          assAuth -&gt; meta.tag = create('Coding') as coding then {\n            assAuth -&gt; coding.system = 'http://algoritmodiscoring' &quot;system&quot;;\n            assAuth -&gt; coding.code = 'ClinicalDocument/body/DecorsoOspedaliero/author' &quot;code&quot;;\n          } &quot;coding&quot;;\n        } &quot;meta&quot;;\n        assAuth.id as id -&gt; practitioner.identifier as identifier then {\n          id.root as r -&gt; identifier.system = translate(r, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri') &quot;root1&quot;;\n          id.extension as ext -&gt; identifier.value = ext;\n          id.assigningAuthorityName as s -&gt;  identifier.assigner as a,  a.display = s;\n          id.root as r then {\n            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;;\n          } &quot;r&quot;;\n        } &quot;identifier&quot;;\n        assAuth.id as id where (root = '2.16.840.1.113883.2.9.4.3.2') then {\n          id.extension as ext -&gt; request.url = append('Practitioner?identifier=', ext) &quot;UUID&quot;;\n        } &quot;2&quot;;\n        assAuth.assignedPerson as assPers then {\n          assPers.name -&gt; practitioner.name;\n        } &quot;assPers&quot;;\n      } &quot;assAuth&quot;;\n    } &quot;Auth&quot;;\n  } &quot;OB-note&quot;;\n}\n\n// --------------------------------------------------------------------------------------------------------\n// Sezione Encounter---------------------------------------------------------------------------------------\ngroup ClinicalDocumentSectionEncounter(source cda : ClinicalDocument, source src : Section, target patient : Patient, target tgt, target bundle : Bundle, target enc1 : Encounter) {\n  src.title as t -&gt; tgt.title = (t.dataString);\n  src.code -&gt; tgt.code;\n  src.text as cdaText -&gt; tgt.text as fhirText then {\n    cdaText -&gt; fhirText.status = 'generated' &quot;narrativeStatus&quot;;\n    cdaText as t -&gt; fhirText.div = t &quot;narrativeText&quot;;\n  } &quot;cdaText&quot;;\n  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 {\n    entry1 -&gt;  encounter.partOf = create('Reference') as reference,  reference.reference = ('https://example/Encounter/' + %enc1.id) &quot;refer&quot;;\n    entry1 -&gt;  encounter.subject = create('Reference') as reference,  reference.reference = ('https://example/Patient/' + %patient.id) &quot;refer&quot;;\n    entry1 -&gt; encounter.status = 'finished' &quot;status&quot;;\n    entry1 -&gt; encounter.class = create('Coding') as cl then {\n      entry1 -&gt; cl.code = 'AMB' &quot;code&quot;;\n      entry1 -&gt; cl.display = 'ambulatory' &quot;code&quot;;\n    } &quot;class&quot;;\n    entry1.encounter as enc then {\n      enc.code -&gt; encounter.type;\n      // effectiveTime=period\n      enc where effectiveTime.low.exists() or effectiveTime.high.exists() then {\n        enc.effectiveTime as eff -&gt; encounter.period = create('Period') as period then IVLTSPeriod(eff, period);\n      } &quot;where&quot;;\n      // effectiveTime = time-stamp\n      enc where effectiveTime.low.exists().not() or effectiveTime.high.exists().not() then {\n        enc.effectiveTime as effectivetime1 -&gt; encounter.period = create('Period') as period then {\n          effectivetime1 -&gt; period.start = create('dateTime') as start then TSDateTime(effectivetime1, start) &quot;val&quot;;\n        } &quot;efft&quot;;\n      } &quot;where&quot;;\n      // enc.effectiveTime as eff -&gt; encounter.period = create('Period') as period then{\n      enc.participant as part where (typeCode != 'LOC') -&gt; encounter.participant = create('BackboneElement') as patarg then {\n        part -&gt; patarg.type as type then {\n          part -&gt; type.coding as coding then {\n            part -&gt; coding.code = (part.typeCode) &quot;codice&quot;;\n            part -&gt; coding.system = 'http://terminology.hl7.org/CodeSystem/v3-ParticipationType' &quot;system&quot;;\n          } &quot;codeType&quot;;\n        } &quot;type&quot;;\n        part.time as time1 -&gt; patarg.period = create('Period') as period then {\n          time1 -&gt; period.start = create('dateTime') as start then TSDateTime(time1, start) &quot;val&quot;;\n        };\n        part.time as ti -&gt; patarg.period = create('Period') as period then IVLTSPeriod(ti, period);\n        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 {\n          // modifica meta+identifier\n          partRole -&gt; practitioner.meta as meta then {\n            partRole -&gt; meta.tag = create('Coding') as coding then {\n              partRole -&gt; coding.system = 'http://algoritmodiscoring' &quot;system&quot;;\n              partRole -&gt; coding.code = 'ClinicalDocument/body/Encounter/participant' &quot;code&quot;;\n            } &quot;coding&quot;;\n          } &quot;meta&quot;;\n          partRole.id as id -&gt; practitioner.identifier as identifier then {\n            id.root as r -&gt; identifier.system = translate(r, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri') &quot;root1&quot;;\n            id.extension as ext -&gt; identifier.value = ext;\n            id.assigningAuthorityName as s -&gt;  identifier.assigner as a,  a.display = s;\n            id.root as r then {\n              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;;\n            } &quot;r&quot;;\n          } &quot;identifier&quot;;\n          partRole.id as id where (root = '2.16.840.1.113883.2.9.4.3.2') then {\n            id.extension as ext -&gt; request.url = append('Practitioner?identifier=', ext) &quot;UUID&quot;;\n          } &quot;2&quot;;\n          partRole.playingEntity as playEnt then {\n            playEnt.name -&gt; practitioner.name;\n          } &quot;playEnt&quot;;\n        } &quot;partRole&quot;;\n      } &quot;participant-ADM&quot;;\n      enc.participant as part where (typeCode = 'LOC') then {\n        part.time as tim -&gt; encounter.location as locat then {\n          tim -&gt; locat.period = create('Period') as period then IVLTSPeriod(tim, period) &quot;time&quot;;\n          part.time as tim -&gt; locat.period = create('Period') as period then {\n            tim -&gt; period.start = create('dateTime') as start then TSDateTime(tim, start) &quot;val&quot;;\n          };\n          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 {\n            part -&gt; location.meta as meta then {\n              part -&gt; meta.tag = create('Coding') as coding then {\n                part -&gt; coding.system = 'http://algoritmodiscoring' &quot;system&quot;;\n                part -&gt; coding.code = 'ClinicalDocument/body/Encounter/participant' &quot;code&quot;;\n              } &quot;coding&quot;;\n            } &quot;meta&quot;;\n            partRole.id as id -&gt; location.identifier as identifier then {\n              id.root as r -&gt; identifier.system = translate(r, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri') &quot;root1&quot;;\n              id.extension as ext -&gt; identifier.value = ext then {\n                partRole -&gt; request.url = append('Location?identifier=', ext) &quot;UUID&quot;;\n              } &quot;ext&quot;;\n              id.assigningAuthorityName as s -&gt;  identifier.assigner as a,  a.display = s;\n              id.root as r then {\n                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;;\n              } &quot;r&quot;;\n            } &quot;identifier&quot;;\n            partRole.code -&gt; location.type;\n          } &quot;partRole&quot;;\n        } &quot;location&quot;;\n      } &quot;participant2&quot;;\n      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 {\n        entr.act as act then {\n          act.code -&gt; observation.code;\n          act -&gt;  observation.subject = create('Reference') as reference,  reference.reference = ('https://example/Patient/' + %patient.id) &quot;reference&quot;;\n          act -&gt;  observation.encounter = create('Reference') as reference,  reference.reference = ('https://example/Encounter/' + %enc1.id) &quot;reference&quot;;\n          act where act.statusCode.exists().not() then {\n            act -&gt; observation.status = 'final' &quot;status&quot;;\n          } &quot;statuscode&quot;;\n          act -&gt; observation.note = create('Annotation') as note then {\n            act.text as text then {\n              text.reference as reff -&gt; note.text = (reff.value);\n            };\n            act.text as tx then {\n              tx.reference as ref -&gt; note.text = (ref.value) &quot;val&quot;;\n            } &quot;String&quot;;\n            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 {\n              auth.time as ti -&gt; note.time = create('dateTime') as value then TSDateTime(ti, value) &quot;notetime&quot;;\n              auth.assignedAuthor as assAuth then {\n                assAuth -&gt; practitioner.meta as meta then {\n                  assAuth -&gt; meta.tag = create('Coding') as coding then {\n                    assAuth -&gt; coding.system = 'http://algoritmodiscoring' &quot;system&quot;;\n                    assAuth -&gt; coding.code = 'ClinicalDocument/body/Encounter/author' &quot;code&quot;;\n                  } &quot;coding&quot;;\n                } &quot;meta&quot;;\n                assAuth.id as id -&gt; practitioner.identifier as identifier then {\n                  id.root as r -&gt; identifier.system = translate(r, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri') &quot;root1&quot;;\n                  id.extension as ext -&gt; identifier.value = ext;\n                  id.assigningAuthorityName as s -&gt;  identifier.assigner as a,  a.display = s;\n                  id.root as r then {\n                    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;;\n                  } &quot;r&quot;;\n                } &quot;identifier&quot;;\n                assAuth.id as id where (root = '2.16.840.1.113883.2.9.4.3.2') then {\n                  id.extension as ext -&gt; request.url = append('Practitioner?identifier=', ext) &quot;UUID&quot;;\n                } &quot;2&quot;;\n                // fine modifica\n                assAuth.time as t -&gt; note.text = create('dateTime') as value then TSDateTime(t, value);\n                assAuth.assignedPerson as assPers then {\n                  assPers.name -&gt; practitioner.name;\n                } &quot;name&quot;;\n              } &quot;assAush&quot;;\n            } &quot;practitioner&quot;;\n          } &quot;note&quot;;\n        };\n      } &quot;entryRel-SUBJ&quot;;\n    };\n  };\n}\n\n// --------------------------------------------------------------------------------------------------------\n// Sezione Consulenza--------------------------------------------------------------------------------------\ngroup ClinicalDocumentSectionConsulenza(source cda : ClinicalDocument, source src : Section, target patient : Patient, target tgt, target bundle : Bundle, target enc : Encounter) {\n  src.title as t -&gt; tgt.title = (t.dataString);\n  src.code -&gt; tgt.code;\n  src where src.entry.exists() then {\n    src.text as cdaText -&gt; tgt.text as fhirText then {\n      cdaText -&gt; fhirText.status = 'generated' &quot;narrativeStatus&quot;;\n      cdaText as t -&gt; fhirText.div = t &quot;narrativeText&quot;;\n    } &quot;cdaText&quot;;\n  } &quot;entry-exists&quot;;\n  // Sezione Narrativa--------------------------------------------------------------------------------------------------------------------------------------------------\n  src where src.entry.exists().not() then {\n    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 {\n      src -&gt;  ServiceRequest.subject = create('Reference') as reference,  reference.reference = ('https://example/Patient/' + %patient.id) &quot;reference&quot;;\n      src -&gt;  ServiceRequest.encounter = create('Reference') as reference,  reference.reference = ('https://example/Encounter/' + %enc.id) &quot;reference&quot;;\n      src -&gt; ServiceRequest.status = 'active' &quot;status&quot;;\n      src -&gt; ServiceRequest.intent = 'order' &quot;intent&quot;;\n      cdaText -&gt; ServiceRequest.note as note then {\n        cdaText as t -&gt; note.text = t &quot;reference&quot;;\n      } &quot;reference&quot;;\n    } &quot;cdaText&quot;;\n  } &quot;where&quot;;\n  // Sezione Strutturata--------------------------------------------------------------------------------------------------------------------------------------------\n  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 {\n    entry1 -&gt;  serviceRequest.subject = create('Reference') as reference,  reference.reference = ('https://example/Patient/' + %patient.id) &quot;reference&quot;;\n    entry1 -&gt;  serviceRequest.encounter = create('Reference') as reference,  reference.reference = ('https://example/Encounter/' + %enc.id) &quot;reference&quot;;\n    entry1 -&gt; serviceRequest.status = 'active' &quot;status&quot;;\n    entry1 -&gt; serviceRequest.intent = 'order' &quot;intent&quot;;\n    entry1.act as act then {\n      act.code -&gt; serviceRequest.code;\n      act.text as t -&gt; note.text = (t.dataString);\n      act.statusCode as code -&gt; serviceRequest.status = (code.code);\n      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 {\n        perf.time as time -&gt; serviceRequest.occurrence = create('dateTime') as t then TSDateTime(time, t);\n        perf.assignedEntity as assEnt then {\n          assEnt -&gt; practitioner.meta as meta then {\n            assEnt -&gt; meta.tag = create('Coding') as coding then {\n              assEnt -&gt; coding.system = 'http://algoritmodiscoring' &quot;system&quot;;\n              assEnt -&gt; coding.code = 'ClinicalDocument/body/Consulenze/performer' &quot;code&quot;;\n            } &quot;coding&quot;;\n          } &quot;meta&quot;;\n          assEnt.id as id -&gt; practitioner.identifier as identifier then {\n            id.root as r -&gt; identifier.system = translate(r, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri') &quot;root1&quot;;\n            id.extension as ext -&gt; identifier.value = ext;\n            id.assigningAuthorityName as s -&gt;  identifier.assigner as a,  a.display = s;\n            id.root as r then {\n              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;;\n            } &quot;r&quot;;\n          } &quot;identifier&quot;;\n          assEnt.id as id where (root = '2.16.840.1.113883.2.9.4.3.2') then {\n            id.extension as ext -&gt; request.url = append('Practitioner?identifier=', ext) &quot;UUID&quot;;\n          } &quot;2&quot;;\n          assEnt.assignedPerson as assPer then {\n            assPer.name -&gt; practitioner.name;\n          } &quot;assPer&quot;;\n        } &quot;assEnt&quot;;\n      };\n      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 {\n        parti.time as time -&gt; serviceRequest.authoredOn = create('dateTime') as t then TSDateTime(time, t);\n        parti.participantRole as partRole then {\n          partRole -&gt; practitioner.meta as meta then {\n            partRole -&gt; meta.tag = create('Coding') as coding then {\n              partRole -&gt; coding.system = 'http://algoritmodiscoring' &quot;system&quot;;\n              partRole -&gt; coding.code = 'ClinicalDocument/body/Consulenze/participant' &quot;code&quot;;\n            } &quot;coding&quot;;\n          } &quot;meta&quot;;\n          partRole.id as id -&gt; practitioner.identifier as identifier then {\n            id.root as r -&gt; identifier.system = translate(r, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri') &quot;root1&quot;;\n            id.extension as ext -&gt; identifier.value = ext;\n            id.assigningAuthorityName as s -&gt;  identifier.assigner as a,  a.display = s;\n            id.root as r then {\n              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;;\n            } &quot;r&quot;;\n          } &quot;identifier&quot;;\n          partRole.id as id where (root = '2.16.840.1.113883.2.9.4.3.2') then {\n            id.extension as ext -&gt; request.url = append('Practitioner?identifier=', ext) &quot;UUID&quot;;\n          } &quot;2&quot;;\n          partRole.playingEntity as entity then {\n            entity.name -&gt; practitioner.name;\n          } &quot;entity&quot;;\n        } &quot;partRole&quot;;\n      };\n    } &quot;ACT&quot;;\n  };\n}\n\n// ---------------------------------------------------------------------------------------------------------\n// Sezione Accertamenti--------------------------------------------------------------------------------------\ngroup ClinicalDocumentSectionAccertamenti(source cda : ClinicalDocument, source src : Section, target patient : Patient, target tgt, target bundle : Bundle, target enc : Encounter) {\n  src.title as t -&gt; tgt.title = (t.dataString);\n  src.code -&gt; tgt.code;\n  src where src.entry.exists() then {\n    src.text as cdaText -&gt; tgt.text as fhirText then {\n      cdaText -&gt; fhirText.status = 'generated' &quot;narrativeStatus&quot;;\n      cdaText as t -&gt; fhirText.div = t &quot;narrativeText&quot;;\n    } &quot;cdaText&quot;;\n  } &quot;entryExists&quot;;\n  // Sezione Strutturata---------------------------------------------------------------------------------------------------------------------------------------------\n  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 {\n    entry1.organizer as obs then {\n      src.code -&gt; observation.code;\n      obs then ObservationAccertamenti(obs, patient, enc, observation, bundle) &quot;act&quot;;\n    } &quot;obs&quot;;\n  };\n  // Sezione Narrativa--------------------------------------------------------------------------------------------------------------------------------------------\n  src where src.entry.exists().not() then {\n    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 {\n      src -&gt;  Observation.subject = create('Reference') as reference,  reference.reference = ('https://example/Patient/' + %patient.id) &quot;reference&quot;;\n      src -&gt;  Observation.encounter = create('Reference') as reference,  reference.reference = ('https://example/Encounter/' + %enc.id) &quot;reference&quot;;\n      src.code -&gt; Observation.code;\n      src where observation.statusCode.exists().not() then {\n        src -&gt; Observation.status = 'final' &quot;status&quot;;\n      } &quot;statuscode&quot;;\n      cdaText -&gt; Observation.note as note then {\n        cdaText as t -&gt; note.text = t &quot;reference&quot;;\n      } &quot;reference&quot;;\n    } &quot;cdaText&quot;;\n  } &quot;where&quot;;\n}\n\ngroup ObservationAccertamenti(source obs : Observation, target patient : Patient, target encounter : Encounter, target ob : Observation, target bundle : Bundle) {\n  obs.code -&gt; ob.code;\n  obs.statusCode as statusc where (code = 'completed') -&gt; ob.status = 'final';\n  obs.statusCode as statusc where (code = 'active') -&gt; ob.status = 'registered';\n  obs.statusCode as statusc where (code = 'aborted') -&gt; ob.status = 'cancelled';\n  obs.statusCode as statusc where (code = 'suspended') -&gt; ob.status = 'partial';\n  obs where obs.statusCode.exists().not() then {\n    obs -&gt; ob.status = 'final' &quot;status&quot;;\n  } &quot;statuscode&quot;;\n  obs.effectiveTime as effectiveTime -&gt; ob.effective = create('dateTime') as value then TSDateTime(effectiveTime, value) &quot;value2&quot;;\n  obs where effectiveTime.low.exists() or effectiveTime.high.exists() then {\n    obs.effectiveTime as eff -&gt; ob.effective = create('Period') as period then IVLTSPeriod(eff, period);\n  } &quot;where&quot;;\n  obs.value : CD as val then {\n    val -&gt; ob.value = create('CodeableConcept') as ce then {\n      val.originalText -&gt; ce.text;\n      val -&gt; ce.coding as coding then {\n        val.code as code -&gt; coding.code = cast(code, 'string');\n        val.codeSystem as system -&gt; coding.system = translate(system, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri');\n        val.displayName as display -&gt; coding.display = cast(display, 'string');\n      } &quot;code&quot;;\n      val.translation as translation -&gt; ce.coding as coding then {\n        translation.code as code -&gt; coding.code = cast(code, 'string');\n        translation.codeSystem as system -&gt; coding.system = translate(system, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri');\n        translation.displayName as display -&gt; coding.display = cast(display, 'string');\n        translation.qualifier as qualifier then {\n          qualifier.value as value -&gt; ce.coding as coding then {\n            value.code as code -&gt; coding.code = cast(code, 'string');\n            value.codeSystem as system -&gt; coding.system = translate(system, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri');\n            value.displayName as display -&gt; coding.display = cast(display, 'string');\n          };\n        } &quot;qual&quot;;\n      };\n    } &quot;coding&quot;;\n  } &quot;val&quot;;\n  obs.value : CE as val then {\n    val -&gt; ob.value = create('CodeableConcept') as ce then {\n      val.originalText -&gt; ce.text;\n      val -&gt; ce.coding as coding then {\n        val.code as code -&gt; coding.code = cast(code, 'string');\n        val.codeSystem as system -&gt; coding.system = translate(system, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri');\n        val.displayName as display -&gt; coding.display = cast(display, 'string');\n      } &quot;code&quot;;\n      val.translation as translation -&gt; ce.coding as coding then {\n        translation.code as code -&gt; coding.code = cast(code, 'string');\n        translation.codeSystem as system -&gt; coding.system = translate(system, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri');\n        translation.displayName as display -&gt; coding.display = cast(display, 'string');\n        translation.qualifier as qualifier then {\n          qualifier.value as value -&gt; ce.coding as coding then {\n            value.code as code -&gt; coding.code = cast(code, 'string');\n            value.codeSystem as system -&gt; coding.system = translate(system, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri');\n            value.displayName as display -&gt; coding.display = cast(display, 'string');\n          };\n        } &quot;qual&quot;;\n      };\n    } &quot;coding&quot;;\n  } &quot;val&quot;;\n  obs.value : PQ as val then {\n    val -&gt; ob.value = create('Quantity') as quantity then {\n      val.value as value -&gt; quantity.value = value;\n      val.unit as unit -&gt; quantity.unit = unit;\n    } &quot;quantity&quot;;\n  } &quot;valueQuantity&quot;;\n  obs.value : ST as value -&gt;  ob.value = create('string'),  ob.value = (value.dataString);\n  obs.value : INT as int -&gt; ob.value = (int.value);\n  obs.value : BL as boolean -&gt; ob.value = (boolean.value) &quot;boolean&quot;;\n  obs -&gt;  ob.subject = create('Reference') as reference,  reference.reference = ('https://example/Patient/' + %patient.id) &quot;reference&quot;;\n  obs -&gt;  ob.encounter = create('Reference') as reference,  reference.reference = ('https://example/Encounter/' + %encounter.id) &quot;reference&quot;;\n  obs.interpretationCode -&gt; ob.interpretation;\n  obs.methodCode -&gt; ob.method;\n  obs.referenceRange as refRange -&gt; ob.referenceRange = create('BackboneElement') as ref then {\n    refRange.observationRange as obsRange -&gt; ref.low = create('SimpleQuantity') as Low then {\n      obsRange.value : IVL_PQ as v then {\n        v.low as l1 then {\n          l1.value as decValue -&gt; Low.value = decValue;\n          l1.unit as Unit -&gt; Low.unit = Unit;\n        } &quot;decValue&quot;;\n      } &quot;IVL-PQ&quot;;\n    } &quot;obsRange&quot;;\n  } &quot;refRange&quot;;\n  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 {\n    performer.assignedEntity as assEntity then {\n      // inizio modifica identifier+meta\n      assEntity -&gt; practitioner.meta as meta then {\n        assEntity -&gt; meta.tag = create('Coding') as coding then {\n          assEntity -&gt; coding.system = 'http://algoritmodiscoring' &quot;system&quot;;\n          assEntity -&gt; coding.code = 'ClinicalDocument/body/Accertamenti/performer' &quot;code&quot;;\n        } &quot;coding&quot;;\n      } &quot;meta&quot;;\n      assEntity.id as id -&gt; practitioner.identifier as identifier then {\n        id.root as r -&gt; identifier.system = translate(r, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri') &quot;root1&quot;;\n        id.extension as ext -&gt; identifier.value = ext;\n        id.assigningAuthorityName as s -&gt;  identifier.assigner as a,  a.display = s;\n        id.root as r then {\n          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;;\n        } &quot;r&quot;;\n      } &quot;identifier&quot;;\n      assEntity.id as id where (root = '2.16.840.1.113883.2.9.4.3.2') then {\n        id.extension as ext -&gt; request.url = append('Practitioner?identifier=', ext) &quot;UUID&quot;;\n      } &quot;2&quot;;\n      // fine modifica\n      assEntity.assignedPerson as assi then {\n        assi.name -&gt; practitioner.name;\n      } &quot;assi&quot;;\n    } &quot;assEntity&quot;;\n  } &quot;perf&quot;;\n  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 {\n    // participant.time as t -&gt; serviceRequest.authoredOn = (t.value);\n    participant.time as t -&gt; serviceRequest.authoredOn = create('dateTime') as value then TSDateTime(t, value) &quot;value2&quot;;\n    obs -&gt;  serviceRequest.subject = create('Reference') as reference,  reference.reference = ('https://example/Patient/' + %patient.id) &quot;reference&quot;;\n    obs -&gt;  serviceRequest.encounter = create('Reference') as reference,  reference.reference = ('https://example/Encounter/' + %encounter.id) &quot;reference&quot;;\n    obs -&gt; serviceRequest.status = 'active' &quot;status&quot;;\n    obs -&gt; serviceRequest.intent = 'order' &quot;intent&quot;;\n    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 {\n      // modifica meta+identifier\n      participantRole -&gt; practitioner.meta as meta then {\n        participantRole -&gt; meta.tag = create('Coding') as coding then {\n          participantRole -&gt; coding.system = 'http://algoritmodiscoring' &quot;system&quot;;\n          participantRole -&gt; coding.code = 'ClinicalDocument/body/Accertamenti/participant' &quot;code&quot;;\n        } &quot;coding&quot;;\n      } &quot;meta&quot;;\n      participantRole.id as id -&gt; practitioner.identifier as identifier then {\n        id.root as r -&gt; identifier.system = translate(r, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri') &quot;root1&quot;;\n        id.extension as ext -&gt; identifier.value = ext;\n        id.assigningAuthorityName as s -&gt;  identifier.assigner as a,  a.display = s;\n        id.root as r then {\n          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;;\n        } &quot;r&quot;;\n      } &quot;identifier&quot;;\n      participantRole.id as id where (root = '2.16.840.1.113883.2.9.4.3.2') then {\n        id.extension as ext -&gt; request.url = append('Practitioner?identifier=', ext) &quot;UUID&quot;;\n      } &quot;2&quot;;\n      // fine modifica\n      participantRole.playingEntity as pe then {\n        pe.name -&gt; practitioner.name;\n      } &quot;pe&quot;;\n    };\n  };\n  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 {\n    comp.observation as obs then {\n      obs.code -&gt; observation.code;\n      obs.statusCode as statusc where (code = 'completed') -&gt; observation.status = 'final';\n      obs.statusCode as statusc where (code = 'active') -&gt; observation.status = 'registered';\n      obs.statusCode as statusc where (code = 'aborted') -&gt; observation.status = 'cancelled';\n      obs.statusCode as statusc where (code = 'suspended') -&gt; observation.status = 'partial';\n      obs where obs.statusCode.exists().not() then {\n        obs -&gt; observation.status = 'final' &quot;status&quot;;\n      } &quot;statuscode&quot;;\n      obs -&gt;  observation.subject = create('Reference') as reference,  reference.reference = ('https://example/Patient/' + %patient.id) &quot;reference&quot;;\n      obs -&gt;  observation.encounter = create('Reference') as reference,  reference.reference = ('https://example/Encounter/' + %encounter.id) &quot;reference&quot;;\n      obs.effectiveTime as effectiveTime -&gt; ob.effective = create('dateTime') as value then TSDateTime(effectiveTime, value) &quot;value2&quot;;\n      obs where effectiveTime.low.exists() or effectiveTime.high.exists() then {\n        obs.effectiveTime as eff -&gt; ob.effective = create('Period') as period then IVLTSPeriod(eff, period);\n      } &quot;where&quot;;\n      obs.value as val -&gt; observation.value = (val.dataString);\n    } &quot;obs&quot;;\n  } &quot;observation&quot;;\n}\n\n// -----------------------------------------------------------------------------------------------------------\n// Sezione ParametriVitali--------------------------------------------------------------------------------------\ngroup ClinicalDocumentSectionParametriVitali(source cda : ClinicalDocument, source src : Section, target patient : Patient, target tgt, target bundle : Bundle, target enc : Encounter) {\n  src.title as t -&gt; tgt.title = (t.dataString);\n  src.code -&gt; tgt.code;\n  src where src.entry.exists() then {\n    src.text as cdaText -&gt; tgt.text as fhirText then {\n      cdaText -&gt; fhirText.status = 'generated' &quot;narrativeStatus&quot;;\n      cdaText as t -&gt; fhirText.div = t &quot;narrativeText&quot;;\n    } &quot;cdaText&quot;;\n  } &quot;entry-exists&quot;;\n  // Sezione Narrativa----------------------------------------------------------------------------------------------------------------------------------------------------\n  src where src.entry.exists().not() then {\n    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 {\n      src -&gt;  Observation.subject = create('Reference') as reference,  reference.reference = ('https://example/Patient/' + %patient.id) &quot;reference&quot;;\n      src -&gt;  Observation.encounter = create('Reference') as reference,  reference.reference = ('https://example/Encounter/' + %enc.id) &quot;reference&quot;;\n      src.code -&gt; Observation.code;\n      src where observation.statusCode.exists().not() then {\n        src -&gt; Observation.status = 'final' &quot;status&quot;;\n      } &quot;statuscode&quot;;\n      cdaText -&gt; Observation.note as note then {\n        cdaText as t -&gt; note.text = t &quot;reference&quot;;\n      } &quot;reference&quot;;\n    } &quot;cdaText&quot;;\n  } &quot;where&quot;;\n  // Sezione Strutturata --------------------------------------------------------------------------------------------------------------------------------------------------------\n  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 {\n    entry1.organizer as org then {\n      org -&gt;  observation.subject = create('Reference') as reference,  reference.reference = ('https://example/Patient/' + %patient.id) &quot;reference&quot;;\n      org -&gt;  observation.encounter = create('Reference') as reference,  reference.reference = ('https://example/Encounter/' + %enc.id) &quot;reference&quot;;\n      org.statusCode as statusc where (code = 'completed') -&gt; observation.status = 'final';\n      org.statusCode as statusc where (code = 'active') -&gt; observation.status = 'registered';\n      org.statusCode as statusc where (code = 'aborted') -&gt; observation.status = 'cancelled';\n      org.statusCode as statusc where (code = 'suspended') -&gt; observation.status = 'partial';\n      org where obs.statusCode.exists().not() then {\n        org -&gt; observation.status = 'final' &quot;status&quot;;\n      } &quot;statuscode&quot;;\n      org.code -&gt; observation.code;\n      org where org.code.exists().not() then {\n        src.code -&gt; observation.code;\n      } &quot;code&quot;;\n      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 {\n        component.observation as obs then {\n          obs -&gt;  observation1.subject = create('Reference') as reference,  reference.reference = ('https://example/Patient/' + %patient.id) &quot;reference&quot;;\n          obs -&gt;  observation1.encounter = create('Reference') as reference,  reference.reference = ('https://example/Encounter/' + %enc.id) &quot;reference&quot;;\n          obs.code -&gt; observation1.code;\n          obs.statusCode -&gt; observation1.status;\n          obs.statusCode as statusc where (code = 'completed') -&gt; observation1.status = 'final';\n          obs.statusCode as statusc where (code = 'active') -&gt; observation1.status = 'registered';\n          obs.statusCode as statusc where (code = 'aborted') -&gt; observation1.status = 'cancelled';\n          obs.statusCode as statusc where (code = 'suspended') -&gt; observation1.status = 'partial';\n          obs where obs.statusCode.exists().not() then {\n            obs -&gt; observation1.status = 'final' &quot;status&quot;;\n          } &quot;statuscode&quot;;\n          obs -&gt; observation1.value = create('Quantity') as quant then {\n            obs.value as v -&gt; quant.value = (v.value);\n            obs.value as v -&gt; quant.unit = (v.unit);\n          } &quot;quant&quot;;\n          obs.value : CE as val then {\n            val -&gt; ob.value = create('CodeableConcept') as ce then {\n              val.originalText as originalText then {\n                originalText.reference as reference -&gt; ce.text = reference;\n              } &quot;originltext&quot;;\n              val -&gt; ce.coding as coding then {\n                val.code as code -&gt; coding.code = cast(code, 'string');\n                val.codeSystem as system -&gt; coding.system = translate(system, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri');\n                val.displayName as display -&gt; coding.display = cast(display, 'string');\n                val.codeSystemVersion as version -&gt; coding.version = cast(version, 'string');\n              } &quot;code&quot;;\n              val.translation as translation -&gt; ce.coding as coding then {\n                translation.code as code -&gt; coding.code = cast(code, 'string');\n                translation.codeSystem as system -&gt; coding.system = translate(system, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri');\n                translation.displayName as display -&gt; coding.display = cast(display, 'string');\n                translation.codeSystemVersion as version -&gt; coding.version = cast(version, 'string');\n                translation.qualifier as qualifier then {\n                  qualifier.value as value -&gt; ce.coding as coding then {\n                    value.code as code -&gt; coding.code = cast(code, 'string');\n                    value.codeSystem as system -&gt; coding.system = translate(system, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri');\n                    value.displayName as display -&gt; coding.display = cast(display, 'string');\n                    value.codeSystemVersion as version -&gt; coding.version = cast(version, 'string');\n                  };\n                };\n              };\n            } &quot;coding&quot;;\n          } &quot;val&quot;;\n          obs.value : CD as val then {\n            val -&gt; ob.value = create('CodeableConcept') as ce then {\n              val.originalText as originalText then {\n                originalText.reference as reference -&gt; ce.text = reference;\n              } &quot;originltext&quot;;\n              val -&gt; ce.coding as coding then {\n                val.code as code -&gt; coding.code = cast(code, 'string');\n                val.codeSystem as system -&gt; coding.system = translate(system, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri');\n                val.displayName as display -&gt; coding.display = cast(display, 'string');\n                val.codeSystemVersion as version -&gt; coding.version = cast(version, 'string');\n              } &quot;code&quot;;\n              val.translation as translation -&gt; ce.coding as coding then {\n                translation.code as code -&gt; coding.code = cast(code, 'string');\n                translation.codeSystem as system -&gt; coding.system = translate(system, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri');\n                translation.displayName as display -&gt; coding.display = cast(display, 'string');\n                translation.codeSystemVersion as version -&gt; coding.version = cast(version, 'string');\n                translation.qualifier as qualifier then {\n                  qualifier.value as value -&gt; ce.coding as coding then {\n                    value.code as code -&gt; coding.code = cast(code, 'string');\n                    value.codeSystem as system -&gt; coding.system = translate(system, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri');\n                    value.displayName as display -&gt; coding.display = cast(display, 'string');\n                    value.codeSystemVersion as version -&gt; coding.version = cast(version, 'string');\n                  };\n                };\n              };\n            } &quot;coding&quot;;\n          } &quot;val&quot;;\n          obs.value : ST as value -&gt;  ob.value = create('string'),  ob.value = (value.dataString);\n          obs.value : INT as int -&gt; ob.value = (int.value);\n          obs.value : BL as boolean -&gt; ob.value = (boolean.value) &quot;boolean&quot;;\n          obs.interpretationCode -&gt; observation1.interpretation;\n          obs.methodCode -&gt; observation1.method;\n          obs.targetSiteCode -&gt; observation1.bodySite;\n          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 {\n            performer.time as t -&gt; observation1.issued = create('dateTime') as date then TSDateTime(t, date);\n            performer.assignedEntity as assEntity then {\n              // inizio modifica meta+ identifier\n              assEntity -&gt; practitioner.meta as meta then {\n                assEntity -&gt; meta.tag = create('Coding') as coding then {\n                  assEntity -&gt; coding.system = 'http://algoritmodiscoring' &quot;system&quot;;\n                  assEntity -&gt; coding.code = 'ClinicalDocument/body/ParametriVitali/performer' &quot;code&quot;;\n                } &quot;coding&quot;;\n              } &quot;meta&quot;;\n              assEntity.id as id -&gt; practitioner.identifier as identifier then {\n                id.root as r -&gt; identifier.system = translate(r, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri') &quot;root1&quot;;\n                id.extension as ext -&gt; identifier.value = ext;\n                id.assigningAuthorityName as s -&gt;  identifier.assigner as a,  a.display = s;\n                id.root as r then {\n                  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;;\n                } &quot;r&quot;;\n              } &quot;identifier&quot;;\n              assEntity.id as id where (root = '2.16.840.1.113883.2.9.4.3.2') then {\n                id.extension as ext -&gt; request.url = append('Practitioner?identifier=', ext) &quot;UUID&quot;;\n              } &quot;2&quot;;\n              // fine modifica\n              assEntity.assignedPerson as assPerson then {\n                assPerson.name -&gt; practitioner.name;\n              } &quot;assPerson&quot;;\n            } &quot;assEntity&quot;;\n          };\n          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 {\n            parti -&gt;  serviceRequest.subject = create('Reference') as reference,  reference.reference = ('https://example/Patient/' + %patient.id) &quot;reference&quot;;\n            parti -&gt;  serviceRequest.encounter = create('Reference') as reference,  reference.reference = ('https://example/Encounter/' + %enc.id) &quot;reference&quot;;\n            parti -&gt; serviceRequest.status = 'active' &quot;status&quot;;\n            parti -&gt; serviceRequest.intent = 'order' &quot;intent&quot;;\n            parti.time as t -&gt; serviceRequest.authoredOn = create('dateTime') as value then TSDateTime(t, value) &quot;value2&quot;;\n            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 {\n              // inizio modifica meta + identifier\n              partRole -&gt; practitioner.meta as meta then {\n                partRole -&gt; meta.tag = create('Coding') as coding then {\n                  partRole -&gt; coding.system = 'http://algoritmodiscoring' &quot;system&quot;;\n                  partRole -&gt; coding.code = 'ClinicalDocument/body/ParametriVitali/participant' &quot;code&quot;;\n                } &quot;coding&quot;;\n              } &quot;meta&quot;;\n              partRole.id as id -&gt; practitioner.identifier as identifier then {\n                id.root as r -&gt; identifier.system = translate(r, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri') &quot;root1&quot;;\n                id.extension as ext -&gt; identifier.value = ext;\n                id.assigningAuthorityName as s -&gt;  identifier.assigner as a,  a.display = s;\n                id.root as r then {\n                  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;;\n                } &quot;r&quot;;\n              } &quot;identifier&quot;;\n              partRole.id as id where (root = '2.16.840.1.113883.2.9.4.3.2') then {\n                id.extension as ext -&gt; request.url = append('Practitioner?identifier=', ext) &quot;UUID&quot;;\n              } &quot;2&quot;;\n              // fine modifica\n              partRole.playingEntity as playingEntity then {\n                playingEntity.name -&gt; practitioner.name;\n              } &quot;name&quot;;\n            } &quot;partRole&quot;;\n          } &quot;parti&quot;;\n        } &quot;obs&quot;;\n      };\n    } &quot;obs&quot;;\n  } &quot;Observation&quot;;\n}\n\n// -----------------------------------------------------------------------------------------------------------------\n// Sezione terapia Farma in Pronto----------------------------------------------------------------------------------\ngroup ClinicalDocumentSectionTerapiaFarmacoInPronto(source cda : ClinicalDocument, source src : Section, target patient : Patient, target tgt, target bundle : Bundle, target enc : Encounter) {\n  src.title as t -&gt; tgt.title = (t.dataString);\n  src.code -&gt; tgt.code;\n  src where src.entry.exists() then {\n    src.text as cdaText -&gt; tgt.text as fhirText then {\n      cdaText -&gt; fhirText.status = 'generated' &quot;narrativeStatus&quot;;\n      cdaText as t -&gt; fhirText.div = t &quot;narrativeText&quot;;\n    } &quot;cdaText&quot;;\n  } &quot;entry-exists&quot;;\n  // Sezione Narrativa------------------------------------------------------------------------------------------------------------------------------------------------\n  src where src.entry.exists().not() then {\n    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 {\n      src -&gt;  MedicationAdministration.subject = create('Reference') as reference,  reference.reference = ('https://example/Patient/' + %patient.id) &quot;reference&quot;;\n      src -&gt;  MedicationAdministration.context = create('Reference') as reference,  reference.reference = ('https://example/Encounter/' + %enc.id) &quot;reference&quot;;\n      src -&gt; MedicationAdministration.effective = create('Period') as period then {\n        src -&gt; period.start = (start.now()) &quot;low&quot;;\n        src -&gt; period.end = (end.now()) &quot;high&quot;;\n      } &quot;Period&quot;;\n      src where sub.statusCode.exists().not() then {\n        src -&gt; MedicationAdministration.status = 'completed' &quot;status&quot;;\n      } &quot;statuscode&quot;;\n      cdaText -&gt; MedicationAdministration.note as note then {\n        cdaText as t -&gt; note.text = t &quot;reference&quot;;\n        cdaText -&gt; MedicationAdministration.medication = create('CodeableConcept') as medication then {\n          cdaText as txt -&gt; medication.text = txt &quot;text&quot;;\n        } &quot;medication&quot;;\n      } &quot;reference&quot;;\n    } &quot;cdaText&quot;;\n  } &quot;where&quot;;\n  // Sezione Strutturata-------------------------------------------------------------------------------------------------------------------------------------------------\n  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 {\n    entry1 -&gt;  medAdm.subject = create('Reference') as reference,  reference.reference = ('https://example/Patient/' + %patient.id) &quot;reference&quot;;\n    entry1 -&gt;  medAdm.context = create('Reference') as reference,  reference.reference = ('https://example/Encounter/' + %enc.id) &quot;reference&quot;;\n    entry1.substanceAdministration as sub then {\n      sub.text as tx then {\n        tx.reference as reff -&gt; note.text = (reff.value);\n      } &quot;txx&quot;;\n      sub.statusCode -&gt; medAdm.status;\n      // sub.effectiveTime: IVL_TS as eff -&gt; medAdm.effective =create('Period') as period then IVLTSPeriod(eff,period); CHECK THIS\n      sub.effectiveTime as eff -&gt; medAdm.effective = create('Period') as period then IVLTSPeriod(eff, period);\n      sub.effectiveTime : PIVL_TS as eff -&gt; medAdm.dosage as dosage then {\n        eff -&gt; dosage.rate = create('Ratio') as ratio then {\n          eff -&gt; ratio.numerator = create('Quantity') as num then {\n            eff.period as per -&gt; num.value = (per.value);\n            eff.period as per -&gt; num.unit = (per.unit);\n          } &quot;num&quot;;\n          eff -&gt; ratio.denominator = create('Quantity') as num then {\n            eff.period as per -&gt; num.value = '1';\n            eff.period as per -&gt; num.unit = (per.unit);\n          } &quot;den&quot;;\n        } &quot;ratio&quot;;\n      } &quot;eff2&quot;;\n      sub -&gt; medAdm.dosage as dosage then {\n        sub.routeCode -&gt; dosage.route;\n      } &quot;route&quot;;\n      sub -&gt; medAdm.dosage as dosage then {\n        sub.approachSiteCode -&gt; dosage.site;\n      } &quot;route&quot;;\n      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 {\n        sub.entryRelationship as rel then {\n          rel.supply as supl -&gt; medRq.dispenseRequest = create('BackboneElement') as disp then {\n            supl -&gt; disp.quantity = create('SimpleQuantity') as q then {\n              supl.quantity as qua -&gt; q.value = (qua.value) &quot;fds&quot;;\n            } &quot;SimpleQuantity&quot;;\n          } &quot;obs&quot;;\n        } &quot;rel&quot;;\n        sub -&gt;  medRq.subject = create('Reference') as reference,  reference.reference = ('https://example/Patient/' + %patient.id) &quot;reference&quot;;\n        sub -&gt;  medRq.encounter = create('Reference') as reference,  reference.reference = ('https://example/Encounter/' + %enc.id) &quot;reference&quot;;\n        sub -&gt; medRq.status = 'active' &quot;status&quot;;\n        sub -&gt; medRq.intent = 'order' &quot;intent&quot;;\n        sub -&gt; medRq.medication = create('CodeableConcept') as cod then {\n          sub -&gt; cod.text = 'medication' &quot;Medi&quot;;\n        } &quot;code&quot;;\n        sub.doseQuantity as quantity then {\n          quantity -&gt; medRq.dosageInstruction = create('Dosage') as dosage then {\n            quantity -&gt; dosage.doseAndRate as dosRange then {\n              quantity -&gt; dosRange.dose = create('Range') as range then {\n                quantity -&gt; range.low = create('SimpleQuantity') as quant then {\n                  quantity.low as l -&gt; quant.value = (l.value) &quot;v1&quot;;\n                  quantity.low as l -&gt; quant.unit = (l.unit) &quot;v1&quot;;\n                } &quot;low&quot;;\n                quantity -&gt; range.high = create('SimpleQuantity') as quant then {\n                  quantity.high as h -&gt; quant.value = (h.value) &quot;v1&quot;;\n                  quantity.high as h -&gt; quant.unit = (h.unit) &quot;v1&quot;;\n                } &quot;high&quot;;\n              } &quot;range&quot;;\n            } &quot;dos&quot;;\n          } &quot;dosage&quot;;\n        } &quot;dose-quantity&quot;;\n        sub.rateQuantity as rate then {\n          rate -&gt; medRq.dosageInstruction = create('Dosage') as dosage then {\n            rate -&gt; dosage.doseAndRate as dosRange then {\n              rate -&gt; dosRange.dose = create('Range') as range then {\n                rate -&gt; range.low = create('SimpleQuantity') as quant then {\n                  rate.low as l -&gt; quant.value = (l.value) &quot;v1&quot;;\n                  rate.low as l -&gt; quant.unit = (l.unit) &quot;v1&quot;;\n                } &quot;low&quot;;\n                rate -&gt; range.high = create('SimpleQuantity') as quant then {\n                  rate.high as h -&gt; quant.value = (h.value) &quot;v1&quot;;\n                  rate.high as h -&gt; quant.unit = (h.unit) &quot;v1&quot;;\n                } &quot;high&quot;;\n              } &quot;range&quot;;\n            } &quot;dos&quot;;\n          } &quot;dosage&quot;;\n        } &quot;Rate-quantity&quot;;\n        sub.participant as part then {\n          part.time as t -&gt; medRq.authoredOn = create('dateTime') as date then TSDateTime(t, date);\n          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 {\n            // inizio meta+identifier\n            partRole -&gt; practitioner.meta as meta then {\n              partRole -&gt; meta.tag = create('Coding') as coding then {\n                partRole -&gt; coding.system = 'http://algoritmodiscoring' &quot;system&quot;;\n                partRole -&gt; coding.code = 'ClinicalDocument/body/TerapiaFarmacologicaPS/participant' &quot;code&quot;;\n              } &quot;coding&quot;;\n            } &quot;meta&quot;;\n            partRole.id as id -&gt; practitioner.identifier as identifier then {\n              id.root as r -&gt; identifier.system = translate(r, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri') &quot;root1&quot;;\n              id.extension as ext -&gt; identifier.value = ext;\n              id.assigningAuthorityName as s -&gt;  identifier.assigner as a,  a.display = s;\n              id.root as r then {\n                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;;\n              } &quot;r&quot;;\n            } &quot;identifier&quot;;\n            partRole.id as id where (root = '2.16.840.1.113883.2.9.4.3.2') then {\n              id.extension as ext -&gt; request.url = append('Practitioner?identifier=', ext) &quot;UUID&quot;;\n            } &quot;2&quot;;\n            // fine modifiche\n            partRole.id -&gt; practitioner.identifier;\n            partRole.playingEntity as play then {\n              play.name -&gt; practitioner.name;\n            } &quot;play&quot;;\n          } &quot;Part&quot;;\n        } &quot;part&quot;;\n      } &quot;medicationRequest&quot;;\n      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 {\n        sub.administrationUnitCode as adduni then {\n          sub.administrationUnitCode -&gt; med.form;\n          sub.consumable as consum then {\n            consum.manufacturedProduct as manuProd then {\n              manuProd.manufacturedMaterial as manuMt then {\n                manuMt.code -&gt; med.code;\n              } &quot;manuMat&quot;;\n            } &quot;manuMat&quot;;\n          } &quot;consum&quot;;\n        } &quot;unicode&quot;;\n        sub.entryRelationship as entryR then {\n          entryR.observation as observation then {\n            observation.code where displayName = 'Grammatura' -&gt; med.ingredient as ingredient then {\n              sub.consumable as consumable then {\n                consumable.manufacturedProduct as manufacturedProduct then {\n                  manufacturedProduct.manufacturedMaterial as manufacturedMaterial then {\n                    manufacturedMaterial.code as code -&gt; ingredient.item = create('CodeableConcept') as value then CECodeableConcept(code, value) &quot;CE&quot;;\n                  } &quot;material&quot;;\n                } &quot;product&quot;;\n              };\n              observation.value as value -&gt; ingredient.strength as strength then {\n                value -&gt; strength.numerator as numerator then {\n                  value -&gt; numerator.value = (value.value) &quot;valueN&quot;;\n                } &quot;numerator&quot;;\n                value -&gt; strength.denominator as denominator then {\n                  value -&gt; denominator.value = 1 &quot;valueD&quot;;\n                } &quot;denominator&quot;;\n              } &quot;strenght&quot;;\n            } &quot;ingredient&quot;;\n            observation.code where displayName = 'Quantità nella Confezione' then {\n              observation.value as value -&gt; med.amount as amount then {\n                value -&gt; amount.numerator as numerator then {\n                  value -&gt; numerator.value = (value.value) &quot;valueN&quot;;\n                } &quot;numerator&quot;;\n                value -&gt; amount.denominator as denominator then {\n                  value -&gt; denominator.value = 1 &quot;valueD&quot;;\n                } &quot;denominator&quot;;\n              } &quot;amount&quot;;\n            } &quot;quantita&quot;;\n          } &quot;obs&quot;;\n        } &quot;entry-R&quot;;\n      } &quot;med&quot;;\n      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 {\n        perf -&gt; medAdm.note as note then {\n          perf -&gt; note.text = 'performertime' &quot;notaa&quot;;\n          perf.time as t -&gt; note.time = create('dateTime') as value then TSDateTime(t, value) &quot;notetime&quot;;\n        } &quot;preftime&quot;;\n        perf.assignedEntity as ent then {\n          // inizio modifica meta+identifier\n          ent -&gt; practitioner.meta as meta then {\n            ent -&gt; meta.tag = create('Coding') as coding then {\n              ent -&gt; coding.system = 'http://algoritmodiscoring' &quot;system&quot;;\n              ent -&gt; coding.code = 'ClinicalDocument/body/TerapiaFarmacologicaPS/performer' &quot;code&quot;;\n            } &quot;coding&quot;;\n          } &quot;meta&quot;;\n          ent.id as id -&gt; practitioner.identifier as identifier then {\n            id.root as r -&gt; identifier.system = translate(r, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri') &quot;root1&quot;;\n            id.extension as ext -&gt; identifier.value = ext;\n            id.assigningAuthorityName as s -&gt;  identifier.assigner as a,  a.display = s;\n            id.root as r then {\n              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;;\n            } &quot;r&quot;;\n          } &quot;identifier&quot;;\n          ent.id as id where (root = '2.16.840.1.113883.2.9.4.3.2') then {\n            id.extension as ext -&gt; request.url = append('Practitioner?identifier=', ext) &quot;UUID&quot;;\n          } &quot;2&quot;;\n          // fine modifica\n          ent.assignedPerson as assPerson then {\n            assPerson.name -&gt; practitioner.name;\n          } &quot;assperson&quot;;\n        } &quot;ent&quot;;\n      } &quot;perform&quot;;\n    } &quot;MedAdm&quot;;\n  };\n}\n\n// ------------------------------------------------------------------------------------------------------------------\n// -\ngroup ClinicalDocumentSectionPianoCuraDimissione(source cda : ClinicalDocument, source src : Section, target patient : Patient, target tgt, target bundle : Bundle, target enc : Encounter) {\n  src.title as t -&gt; tgt.title = (t.dataString);\n  src.code -&gt; tgt.code;\n  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 {\n    src -&gt;  careplan.subject = create('Reference') as reference,  reference.reference = ('https://example/Patient/' + %patient.id) &quot;reference&quot;;\n    src -&gt;  careplan.encounter = create('Reference') as reference,  reference.reference = ('https://example/Encounter/' + %enc.id) &quot;reference&quot;;\n    src -&gt; careplan.status = 'active' &quot;status&quot;;\n    src -&gt; careplan.intent = 'order' &quot;intent&quot;;\n    src.text as cdaText -&gt; careplan.note as carenote then {\n      cdaText as t -&gt; carenote.text = t &quot;notetxt&quot;;\n      entry1.author as author then {\n        author.time as t -&gt; carenote.time = create('dateTime') as value then TSDateTime(t, value) &quot;notetime&quot;;\n        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 {\n          // inizio modifica meta+identifier\n          assauthor -&gt; practitioner.meta as meta then {\n            assauthor -&gt; meta.tag = create('Coding') as coding then {\n              assauthor -&gt; coding.system = 'http://algoritmodiscoring' &quot;system&quot;;\n              assauthor -&gt; coding.code = 'ClinicalDocument/body/PianoCuraDimissione/author' &quot;code&quot;;\n            } &quot;coding&quot;;\n          } &quot;meta&quot;;\n          assauthor.id as id -&gt; practitioner.identifier as identifier then {\n            id.root as r -&gt; identifier.system = translate(r, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri') &quot;root1&quot;;\n            id.extension as ext -&gt; identifier.value = ext;\n            id.assigningAuthorityName as s -&gt;  identifier.assigner as a,  a.display = s;\n            id.root as r then {\n              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;;\n            } &quot;r&quot;;\n          } &quot;identifier&quot;;\n          assauthor.id as id where (root = '2.16.840.1.113883.2.9.4.3.2') then {\n            id.extension as ext -&gt; request.url = append('Practitioner?identifier=', ext) &quot;UUID&quot;;\n          } &quot;2&quot;;\n          // fine modifica\n          assauthor.assignedPerson as pers then {\n            pers.name -&gt; practitioner.name;\n          } &quot;namepers&quot;;\n        } &quot;authpract&quot;;\n      } &quot;CFauthor&quot;;\n    } &quot;author&quot;;\n    entry1.entry as entry2 then {\n      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 {\n        entryact -&gt;  servicerequest.subject = create('Reference') as reference,  reference.reference = ('https://example/Patient/' + %patient.id) &quot;reference&quot;;\n        entryact -&gt;  servicerequest.encounter = create('Reference') as reference,  reference.reference = ('https://example/Encounter/' + %enc.id) &quot;reference&quot;;\n        entryact -&gt; servicerequest.status = 'active' &quot;status&quot;;\n        entryact -&gt; servicerequest.intent = 'order' &quot;intent&quot;;\n        entryact -&gt; servicerequest.identifier = create('BackboneElement') as identif then {\n          entryact.reference as actref then {\n            actref.externalAct as extact then {\n              extact -&gt; servicerequest.identifier = create('BackboneElement') as identif3 then {\n                extact.id as id then {\n                  id.root as r -&gt; identif3.system = translate(r, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri') &quot;root1&quot;;\n                  id.extension as ext -&gt; identif3.value = ext then {\n                    id.assigningAuthorityName as s -&gt;  identif3.assigner as a,  a.display = s;\n                  } &quot;ext&quot;;\n                } &quot;idnetn&quot;;\n              } &quot;extact&quot;;\n            } &quot;actref&quot;;\n          } &quot;jarilemes&quot;;\n          entryact.code -&gt; servicerequest.code;\n          entryact.statusCode -&gt; servicerequest.status;\n          entryact.author as actauthor then {\n            actauthor.time as t -&gt; servicerequest.authoredOn = create('dateTime') as date then TSDateTime(t, date);\n            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 {\n              // inizio modifica identifier\n              assauthor -&gt; practitioner.meta as meta then {\n                assauthor -&gt; meta.tag = create('Coding') as coding then {\n                  assauthor -&gt; coding.system = 'http://algoritmodiscoring' &quot;system&quot;;\n                  assauthor -&gt; coding.code = 'ClinicalDocument/body/PianoCuraDimissione/author' &quot;code&quot;;\n                } &quot;coding&quot;;\n              } &quot;meta&quot;;\n              assauthor.id as id -&gt; practitioner.identifier as identifier then {\n                id.root as r -&gt; identifier.system = translate(r, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri') &quot;root1&quot;;\n                id.extension as ext -&gt; identifier.value = ext;\n                id.assigningAuthorityName as s -&gt;  identifier.assigner as a,  a.display = s;\n                id.root as r then {\n                  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;;\n                } &quot;r&quot;;\n              } &quot;identifier&quot;;\n              assauthor.id as id where (root = '2.16.840.1.113883.2.9.4.3.2') then {\n                id.extension as ext -&gt; request.url = append('Practitioner?identifier=', ext) &quot;UUID&quot;;\n              } &quot;2&quot;;\n              // fine modifica\n              assauthor.assignedPerson as pers then {\n                pers.name -&gt; practitioner.name;\n              } &quot;namepers&quot;;\n            } &quot;author&quot;;\n          } &quot;servReq&quot;;\n        } &quot;entry2&quot;;\n      } &quot;carnote&quot;;\n    } &quot;entry1&quot;;\n  } &quot;entryident3&quot;;\n}\n\n// -------Dimissione------------------------------------------------------------------------------------------------------\ngroup ClinicalDocumentSectionDimissione(source cda : ClinicalDocument, source src : Section, target patient : Patient, target tgt, target bundle : Bundle, target enc : Encounter) {\n  src.title as t -&gt; tgt.title = (t.dataString);\n  src.code -&gt; tgt.code;\n  src.text as cdaText -&gt; tgt.text as fhirText then {\n    cdaText -&gt; fhirText.status = 'generated' &quot;narrativeStatus&quot;;\n    cdaText as t -&gt; fhirText.div = t &quot;narrativeText&quot;;\n  } &quot;cdaText&quot;;\n  src.entry as entry1 then {\n    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 {\n      act -&gt; encountert.status = 'finished' &quot;status&quot;;\n      act -&gt; encountert.class = create('Coding') as cl then {\n        act -&gt; cl.code = 'AMB' &quot;code&quot;;\n        act -&gt; cl.display = 'ambulatory' &quot;code&quot;;\n      } &quot;class&quot;;\n      act -&gt;  encountert.partOf = create('Reference') as reference,  reference.reference = ('https://example/Encounter/' + enc.id) &quot;refenc&quot;;\n      act -&gt;  encountert.subject = create('Reference') as reference,  reference.reference = ('https://example/Patient/' + patient.id) &quot;refpatient&quot;;\n      act.code -&gt; encountert.type;\n      act where effectiveTime.low.exists() or effectiveTime.high.exists() then {\n        act.effectiveTime as eff -&gt; encountert.period = create('Period') as period then IVLTSPeriod(eff, period);\n      } &quot;where&quot;;\n      // effectiveTime = time-stamp\n      act where effectiveTime.low.exists().not() or effectiveTime.high.exists().not() then {\n        act.effectiveTime as effectivetime1 -&gt; encountert.period = create('Period') as period then {\n          effectivetime1 -&gt; period.start = create('dateTime') as start then TSDateTime(effectivetime1, start) &quot;val&quot;;\n        } &quot;efft&quot;;\n      } &quot;where&quot;;\n      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 {\n        // performer.time as ti -&gt; note.time = (ti.value);\n        performer.assignedEntity as assEnty then {\n          assEnty -&gt; practitioner.meta as meta then {\n            assEnty -&gt; meta.tag = create('Coding') as coding then {\n              assEnty -&gt; coding.system = 'http://algoritmodiscoring' &quot;system&quot;;\n              assEnty -&gt; coding.code = 'ClinicalDocument/body/Dimissione/performer' &quot;code&quot;;\n            } &quot;coding&quot;;\n          } &quot;meta&quot;;\n          assEnty.id as id -&gt; practitioner.identifier as identifier then {\n            id.root as r -&gt; identifier.system = translate(r, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri') &quot;root1&quot;;\n            id.extension as ext -&gt; identifier.value = ext;\n            id.assigningAuthorityName as s -&gt;  identifier.assigner as a,  a.display = s;\n            id.root as r then {\n              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 {\n                performer -&gt; perf.period = create('Period') as period then {\n                  performer.time as time -&gt; period.start = create('dateTime') as start then TSDateTime(time, start);\n                } &quot;period&quot;;\n                performer -&gt;  perf.individual = create('Reference') as reference,  reference.reference = ('https://example/Practitioner/' + %practitioner.id) &quot;aut&quot;;\n              } &quot;perf&quot;;\n            } &quot;r&quot;;\n          } &quot;identifier&quot;;\n          assEnty.id as id where (root = '2.16.840.1.113883.2.9.4.3.2') then {\n            id.extension as ext -&gt; request.url = append('Practitioner?identifier=', ext) &quot;UUID&quot;;\n          } &quot;2&quot;;\n          assEnty.assignedPerson as assPers then {\n            assPers.name -&gt; practitioner.name;\n          } &quot;assPer&quot;;\n        } &quot;ass&quot;;\n      } &quot;erformer&quot;;\n      // Encounter Post dimissione---------------------------------------------------------------------------------------------------------------------------------------\n      act.entryRelationship as entriRel then {\n        entriRel.encounter as enc1 then {\n          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 {\n            enc1 -&gt; encountert1.status = 'finished' &quot;status&quot;;\n            enc1 -&gt; encountert1.class = create('Coding') as cl then {\n              enc1 -&gt; cl.code = 'AMB' &quot;code&quot;;\n              enc1 -&gt; cl.display = 'ambulatory' &quot;code&quot;;\n            } &quot;class&quot;;\n            enc1 -&gt;  encountert1.subject = create('Reference') as reference,  reference.reference = ('https://example/Patient/' + patient.id) &quot;refpatient&quot;;\n            enc1.id -&gt; encountert1.identifier;\n            // enc1.code -&gt; encountert1.type;\n            enc1 -&gt; encountert1.type = create('CodeableConcept') as ti then {\n              enc1 -&gt; ti.coding = create('Coding') as cod then {\n                enc1.code as c -&gt; cod.code = (c.code);\n                enc1.code as c then {\n                  c.codeSystem as s -&gt; cod.system = translate(s, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri') &quot;system&quot;;\n                } &quot;syst&quot;;\n                enc1.code as c -&gt; cod.display = (c.displayName) &quot;dispaly&quot;;\n              } &quot;coding&quot;;\n              enc1.text as tx then {\n                tx.reference as ref -&gt; ti.text = (ref.value) &quot;val&quot;;\n              };\n            } &quot;code&quot;;\n            enc1 where effectiveTime.low.exists() or effectiveTime.high.exists() then {\n              enc1.effectiveTime as eff -&gt; encountert1.period = create('Period') as period then IVLTSPeriod(eff, period);\n            } &quot;where&quot;;\n            // effectiveTime = time-stamp\n            enc1 where effectiveTime.low.exists().not() or effectiveTime.high.exists().not() then {\n              enc1.effectiveTime as effectivetime1 -&gt; encountert1.period = create('Period') as period then {\n                effectivetime1 -&gt; period.start = create('dateTime') as start then TSDateTime(effectivetime1, start) &quot;val&quot;;\n              } &quot;efft&quot;;\n            } &quot;where&quot;;\n            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 {\n              part -&gt; location.meta as meta then {\n                part -&gt; meta.tag = create('Coding') as coding then {\n                  part -&gt; coding.system = 'http://algoritmodiscoring' &quot;system&quot;;\n                  part -&gt; coding.code = 'ClinicalDocument/body/Dimissione/participant' &quot;code&quot;;\n                } &quot;coding&quot;;\n              } &quot;meta&quot;;\n              part.time as tim -&gt; encountert1.location as locat then {\n                tim -&gt; locat.period = create('Period') as period then IVLTSPeriod(tim, period) &quot;time&quot;;\n                part.time as tim -&gt; locat.period = create('Period') as period then {\n                  tim -&gt; period.start = create('dateTime') as start then TSDateTime(tim, start) &quot;val&quot;;\n                };\n                part.participantRole as partRole then {\n                  partRole.id as id -&gt; location.identifier as identifier then {\n                    id.root as r -&gt; identifier.system = translate(r, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri') &quot;root1&quot;;\n                    id.extension as ext -&gt; identifier.value = ext then {\n                      partRole -&gt; request.url = append('Location?identifier=', ext) &quot;UUID&quot;;\n                    } &quot;ext&quot;;\n                    id.assigningAuthorityName as s -&gt;  identifier.assigner as a,  a.display = s;\n                    id.root as r then {\n                      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;;\n                    } &quot;r&quot;;\n                  } &quot;identifier&quot;;\n                  // partRole.id -&gt; location.identifier;\n                  partRole.code -&gt; location.type;\n                } &quot;partRole&quot;;\n              } &quot;location1&quot;;\n            } &quot;Location&quot;;\n            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 {\n              entryrel2.observation as obs then {\n                obs -&gt;  observation.subject = create('Reference') as reference,  reference.reference = ('https://example/Patient/' + %patient.id) &quot;reference&quot;;\n                obs -&gt;  observation.encounter = create('Reference') as reference,  reference.reference = ('https://example/Encounter/' + %encountert1.id) &quot;reference&quot;;\n                obs.code -&gt; observation.code;\n                obs.statusCode as statusc where (code = 'completed') -&gt; observation.status = 'final';\n                obs.statusCode as statusc where (code = 'active') -&gt; observation.status = 'registered';\n                obs.statusCode as statusc where (code = 'aborted') -&gt; observation.status = 'cancelled';\n                obs.statusCode as statusc where (code = 'suspended') -&gt; observation.status = 'partial';\n                obs -&gt; observation.status = 'final' &quot;notpresent&quot;;\n                obs.effectiveTime as effectiveTime -&gt; observation.effective = create('dateTime') as value then TSDateTime(effectiveTime, value) &quot;value2&quot;;\n                obs where effectiveTime.low.exists() or effectiveTime.high.exists() then {\n                  obs.effectiveTime as eff -&gt; observation.effective = create('Period') as period then IVLTSPeriod(eff, period);\n                } &quot;where&quot;;\n                obs.value : INT as int -&gt; observation.value = (int.value);\n                obs.value : BL as boolean -&gt; observation.value = (boolean.value) &quot;boolean&quot;;\n                obs.value : CE as val then {\n                  val -&gt; observation.value = create('CodeableConcept') as ce then {\n                    val.originalText as originalText then {\n                      originalText.reference as reference -&gt; ce.text = reference;\n                    } &quot;originltext&quot;;\n                    val -&gt; ce.coding as coding then {\n                      val.code as code -&gt; coding.code = cast(code, 'string');\n                      val.codeSystem as system -&gt; coding.system = translate(system, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri');\n                      val.displayName as display -&gt; coding.display = cast(display, 'string');\n                      val.codeSystemVersion as version -&gt; coding.version = cast(version, 'string');\n                    } &quot;code&quot;;\n                    val.translation as translation -&gt; ce.coding as coding then {\n                      translation.code as code -&gt; coding.code = cast(code, 'string');\n                      translation.codeSystem as system -&gt; coding.system = translate(system, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri');\n                      translation.displayName as display -&gt; coding.display = cast(display, 'string');\n                      translation.codeSystemVersion as version -&gt; coding.version = cast(version, 'string');\n                      translation.qualifier as qualifier then {\n                        qualifier.value as value -&gt; ce.coding as coding then {\n                          value.code as code -&gt; coding.code = cast(code, 'string');\n                          value.codeSystem as system -&gt; coding.system = translate(system, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri');\n                          value.displayName as display -&gt; coding.display = cast(display, 'string');\n                          value.codeSystemVersion as version -&gt; coding.version = cast(version, 'string');\n                        };\n                      };\n                    };\n                  } &quot;coding&quot;;\n                } &quot;val&quot;;\n                obs.value : CD as val then {\n                  val -&gt; observation.value = create('CodeableConcept') as ce then {\n                    val.originalText as originalText then {\n                      originalText.reference as reference -&gt; ce.text = reference;\n                    } &quot;originltext&quot;;\n                    val -&gt; ce.coding as coding then {\n                      val.code as code -&gt; coding.code = cast(code, 'string');\n                      val.codeSystem as system -&gt; coding.system = translate(system, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri');\n                      val.displayName as display -&gt; coding.display = cast(display, 'string');\n                      val.codeSystemVersion as version -&gt; coding.version = cast(version, 'string');\n                    } &quot;code&quot;;\n                    val.translation as translation -&gt; ce.coding as coding then {\n                      translation.code as code -&gt; coding.code = cast(code, 'string');\n                      translation.codeSystem as system -&gt; coding.system = translate(system, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri');\n                      translation.displayName as display -&gt; coding.display = cast(display, 'string');\n                      translation.codeSystemVersion as version -&gt; coding.version = cast(version, 'string');\n                      translation.qualifier as qualifier then {\n                        qualifier.value as value -&gt; ce.coding as coding then {\n                          value.code as code -&gt; coding.code = cast(code, 'string');\n                          value.codeSystem as system -&gt; coding.system = translate(system, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri');\n                          value.displayName as display -&gt; coding.display = cast(display, 'string');\n                          value.codeSystemVersion as version -&gt; coding.version = cast(version, 'string');\n                        };\n                      };\n                    };\n                  } &quot;coding&quot;;\n                } &quot;val&quot;;\n                obs.value : PQ as val then {\n                  val -&gt; observation.value = create('Quantity') as quantity then {\n                    val.value as value -&gt; quantity.value = value;\n                    val.unit as unit -&gt; quantity.unit = unit;\n                  } &quot;quantity&quot;;\n                } &quot;valueQuantity&quot;;\n                obs.value : ST as value -&gt;  observation.value = create('string'),  observation.value = (value.dataString);\n              } &quot;obs&quot;;\n            } &quot;entryrel2&quot;;\n          } &quot;enc1&quot;;\n        } &quot;enc&quot;;\n      } &quot;entriRel&quot;;\n      // Trasferimento post dimissione-------------------------------------------------------------------------------------------------------------------------------------\n      act.entryRelationship as entriRel2 then {\n        entriRel2.act as a then {\n          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 {\n            a -&gt; encountert2.status = 'finished' &quot;status&quot;;\n            a -&gt; encountert2.class = create('Coding') as cl then {\n              a -&gt; cl.code = 'AMB' &quot;code&quot;;\n              a -&gt; cl.display = 'ambulatory' &quot;code&quot;;\n            } &quot;class&quot;;\n            a -&gt;  encountert2.subject = create('Reference') as reference,  reference.reference = ('https://example/Patient/' + patient.id) &quot;refpatient&quot;;\n            a where effectiveTime.low.exists() or effectiveTime.high.exists() then {\n              a.effectiveTime as eff -&gt; encountert2.period = create('Period') as period then IVLTSPeriod(eff, period);\n            } &quot;where&quot;;\n            // effectiveTime = time-stamp\n            a where effectiveTime.low.exists().not() or effectiveTime.high.exists().not() then {\n              a.effectiveTime as effectivetime1 -&gt; encountert2.period = create('Period') as period then {\n                effectivetime1 -&gt; period.start = create('dateTime') as start then TSDateTime(effectivetime1, start) &quot;val&quot;;\n              } &quot;efft&quot;;\n            } &quot;where&quot;;\n            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 {\n              a.text as tx then {\n                tx.reference as ref -&gt; location.description = (ref.value) &quot;dfs&quot;;\n              };\n              a.participant as part then {\n                part -&gt; location.meta as meta then {\n                  part -&gt; meta.tag = create('Coding') as coding then {\n                    part -&gt; coding.system = 'http://algoritmodiscoring' &quot;system&quot;;\n                    part -&gt; coding.code = 'ClinicalDocument/body/Dimissione/act' &quot;code&quot;;\n                  } &quot;coding&quot;;\n                } &quot;meta&quot;;\n                part.time as tim -&gt; encountert2.location as locat then {\n                  tim -&gt; locat.period = create('Period') as period then IVLTSPeriod(tim, period) &quot;time&quot;;\n                  part.time as tim -&gt; locat.period = create('Period') as period then {\n                    tim -&gt; period.start = create('dateTime') as start then TSDateTime(tim, start) &quot;val&quot;;\n                  };\n                  part.participantRole as partRole then {\n                    partRole.id as id -&gt; location.identifier as identifier then {\n                      id.root as r -&gt; identifier.system = translate(r, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri') &quot;root1&quot;;\n                      id.extension as ext -&gt; identifier.value = ext then {\n                        partRole -&gt; request.url = append('Location?identifier=', ext) &quot;UUID&quot;;\n                      } &quot;ext&quot;;\n                      id.assigningAuthorityName as s -&gt;  identifier.assigner as a,  a.display = s;\n                      id.root as r then {\n                        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;;\n                      } &quot;r&quot;;\n                    } &quot;identifier&quot;;\n                    // partRole.id -&gt; location.identifier;\n                    partRole.code -&gt; location.type;\n                  } &quot;partRole&quot;;\n                } &quot;loc2&quot;;\n              } &quot;Location&quot;;\n            } &quot;loc&quot;;\n            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 {\n              entryrel2.observation as obs then {\n                obs -&gt;  observation.subject = create('Reference') as reference,  reference.reference = ('https://example/Patient/' + %patient.id) &quot;reference&quot;;\n                obs -&gt;  observation.encounter = create('Reference') as reference,  reference.reference = ('https://example/Encounter/' + %encountert2.id) &quot;reference&quot;;\n                obs.code -&gt; observation.code;\n                obs.statusCode as statusc where (code = 'completed') -&gt; observation.status = 'final';\n                obs.statusCode as statusc where (code = 'active') -&gt; observation.status = 'registered';\n                obs.statusCode as statusc where (code = 'aborted') -&gt; observation.status = 'cancelled';\n                obs.statusCode as statusc where (code = 'suspended') -&gt; observation.status = 'partial';\n                obs -&gt; observation.status = 'final' &quot;notpresent&quot;;\n                obs.effectiveTime as effectiveTime -&gt; observation.effective = create('dateTime') as value then TSDateTime(effectiveTime, value) &quot;value2&quot;;\n                obs where effectiveTime.low.exists() or effectiveTime.high.exists() then {\n                  obs.effectiveTime as eff -&gt; observation.effective = create('Period') as period then IVLTSPeriod(eff, period);\n                } &quot;where&quot;;\n                obs.value : INT as int -&gt; observation.value = (int.value);\n                obs.value : BL as boolean -&gt; observation.value = (boolean.value) &quot;boolean&quot;;\n                obs.value : CE as val then {\n                  val -&gt; observation.value = create('CodeableConcept') as ce then {\n                    val.originalText as originalText then {\n                      originalText.reference as reference -&gt; ce.text = reference;\n                    } &quot;originltext&quot;;\n                    val -&gt; ce.coding as coding then {\n                      val.code as code -&gt; coding.code = cast(code, 'string');\n                      val.codeSystem as system -&gt; coding.system = translate(system, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri');\n                      val.displayName as display -&gt; coding.display = cast(display, 'string');\n                      val.codeSystemVersion as version -&gt; coding.version = cast(version, 'string');\n                    } &quot;code&quot;;\n                    val.translation as translation -&gt; ce.coding as coding then {\n                      translation.code as code -&gt; coding.code = cast(code, 'string');\n                      translation.codeSystem as system -&gt; coding.system = translate(system, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri');\n                      translation.displayName as display -&gt; coding.display = cast(display, 'string');\n                      translation.codeSystemVersion as version -&gt; coding.version = cast(version, 'string');\n                      translation.qualifier as qualifier then {\n                        qualifier.value as value -&gt; ce.coding as coding then {\n                          value.code as code -&gt; coding.code = cast(code, 'string');\n                          value.codeSystem as system -&gt; coding.system = translate(system, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri');\n                          value.displayName as display -&gt; coding.display = cast(display, 'string');\n                          value.codeSystemVersion as version -&gt; coding.version = cast(version, 'string');\n                        };\n                      };\n                    };\n                  } &quot;coding&quot;;\n                } &quot;val&quot;;\n                obs.value : CD as val then {\n                  val -&gt; observation.value = create('CodeableConcept') as ce then {\n                    val.originalText as originalText then {\n                      originalText.reference as reference -&gt; ce.text = reference;\n                    } &quot;originltext&quot;;\n                    val -&gt; ce.coding as coding then {\n                      val.code as code -&gt; coding.code = cast(code, 'string');\n                      val.codeSystem as system -&gt; coding.system = translate(system, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri');\n                      val.displayName as display -&gt; coding.display = cast(display, 'string');\n                      val.codeSystemVersion as version -&gt; coding.version = cast(version, 'string');\n                    } &quot;code&quot;;\n                    val.translation as translation -&gt; ce.coding as coding then {\n                      translation.code as code -&gt; coding.code = cast(code, 'string');\n                      translation.codeSystem as system -&gt; coding.system = translate(system, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri');\n                      translation.displayName as display -&gt; coding.display = cast(display, 'string');\n                      translation.codeSystemVersion as version -&gt; coding.version = cast(version, 'string');\n                      translation.qualifier as qualifier then {\n                        qualifier.value as value -&gt; ce.coding as coding then {\n                          value.code as code -&gt; coding.code = cast(code, 'string');\n                          value.codeSystem as system -&gt; coding.system = translate(system, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri');\n                          value.displayName as display -&gt; coding.display = cast(display, 'string');\n                          value.codeSystemVersion as version -&gt; coding.version = cast(version, 'string');\n                        };\n                      };\n                    };\n                  } &quot;coding&quot;;\n                } &quot;val&quot;;\n                obs.value : PQ as val then {\n                  val -&gt; observation.value = create('Quantity') as quantity then {\n                    val.value as value -&gt; quantity.value = value;\n                    val.unit as unit -&gt; quantity.unit = unit;\n                  } &quot;quantity&quot;;\n                } &quot;valueQuantity&quot;;\n                obs.value : ST as value -&gt;  observation.value = create('string'),  observation.value = (value.dataString);\n              } &quot;obs&quot;;\n            } &quot;entryrel2&quot;;\n          } &quot;act&quot;;\n        } &quot;a&quot;;\n      } &quot;entri-act&quot;;\n      // --------------Diagnosi alla dimissione-------------------------------------------------------------\n      act.entryRelationship as entryrel2 then {\n        entryrel2.observation as obs then {\n          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 {\n            obs -&gt;  observation.subject = create('Reference') as reference,  reference.reference = ('https://example/Patient/' + %patient.id) &quot;reference&quot;;\n            obs -&gt;  observation.encounter = create('Reference') as reference,  reference.reference = ('https://example/Encounter/' + %encountert.id) &quot;reference&quot;;\n            obs.code -&gt; observation.code;\n            obs.statusCode as statusc where (code = 'completed') -&gt; observation.status = 'final';\n            obs.statusCode as statusc where (code = 'active') -&gt; observation.status = 'registered';\n            obs.statusCode as statusc where (code = 'aborted') -&gt; observation.status = 'cancelled';\n            obs.statusCode as statusc where (code = 'suspended') -&gt; observation.status = 'partial';\n            // obs where obs.statusCode.exists().not() then {\n            obs -&gt; observation.status = 'final' &quot;status&quot;;\n            // }&quot;statuscode&quot;;\n            obs.effectiveTime as effectiveTime -&gt; observation.effective = create('dateTime') as value then TSDateTime(effectiveTime, value) &quot;value2&quot;;\n            obs where effectiveTime.low.exists() or effectiveTime.high.exists() then {\n              obs.effectiveTime as eff -&gt; observation.effective = create('Period') as period then IVLTSPeriod(eff, period);\n            } &quot;where&quot;;\n            obs.value as val then {\n              val -&gt; observation.value = create('CodeableConcept') as ce then {\n                val.originalText as originalText then {\n                  originalText.reference as reference -&gt; ce.text = reference;\n                } &quot;originltext&quot;;\n                val -&gt; ce.coding as coding then {\n                  val.code as code -&gt; coding.code = cast(code, 'string');\n                  val.codeSystem as system -&gt; coding.system = translate(system, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri');\n                  val.displayName as display -&gt; coding.display = cast(display, 'string');\n                  val.codeSystemVersion as version -&gt; coding.version = cast(version, 'string');\n                } &quot;code&quot;;\n                val.translation as translation -&gt; ce.coding as coding then {\n                  translation.code as code -&gt; coding.code = cast(code, 'string');\n                  translation.codeSystem as system -&gt; coding.system = translate(system, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri');\n                  translation.displayName as display -&gt; coding.display = cast(display, 'string');\n                  translation.codeSystemVersion as version -&gt; coding.version = cast(version, 'string');\n                  translation.qualifier as qualifier then {\n                    qualifier.value as value -&gt; ce.coding as coding then {\n                      value.code as code -&gt; coding.code = cast(code, 'string');\n                      value.codeSystem as system -&gt; coding.system = translate(system, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri');\n                      value.displayName as display -&gt; coding.display = cast(display, 'string');\n                      value.codeSystemVersion as version -&gt; coding.version = cast(version, 'string');\n                    };\n                  };\n                };\n              } &quot;coding&quot;;\n            } &quot;val&quot;;\n            obs.value : INT as int -&gt; ob.value = (int.value);\n            obs.value : BL as boolean -&gt; ob.value = (boolean.value) &quot;boolean&quot;;\n            obs.value : PQ as val then {\n              val -&gt; ob.value = create('Quantity') as quantity then {\n                val.value as value -&gt; quantity.value = value;\n                val.unit as unit -&gt; quantity.unit = unit;\n              } &quot;quantity&quot;;\n            } &quot;valueQuantity&quot;;\n            obs.value : ST as value -&gt;  ob.value = create('string'),  ob.value = (value.dataString);\n          } &quot;222&quot;;\n        } &quot;obs&quot;;\n      } &quot;entryrel2&quot;;\n      // --------Esito----------------------------\n      act.entryRelationship as entriRel3 then {\n        entriRel3.observation as obs2 then {\n          obs2.code as code then {\n            code.code where (code.code = '11302-7') then {\n              obs2 -&gt; encountert.hospitalization as hospital then {\n                obs2.value -&gt; hospital.dischargeDisposition;\n              } &quot;hospital&quot;;\n            } &quot;entry-obs1&quot;;\n          } &quot;act&quot;;\n        } &quot;x&quot;;\n      } &quot;3&quot;;\n    };\n  } &quot;entry1&quot;;\n  src.entry as entry1 then {\n    entry1.observation as obs then {\n      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 {\n        obs.value as val where ('xsi:type' = 'BL') -&gt; observation.value = (val.value);\n        obs then Observation(obs, patient, enc, observation, bundle) &quot;act&quot;;\n      } &quot;obstarg&quot;;\n    } &quot;obs&quot;;\n  };\n}\n\n// -----------------------------------------------------------------------------------------------------------------------\n// ------------------------------TerapiaFarmacologicaDimissione-----------------------------------------------------------------------------------------\ngroup ClinicalDocumentSectionTerapiaFarmacologicaDimissione(source cda : ClinicalDocument, source src : Section, target patient : Patient, target tgt, target bundle : Bundle, target enc : Encounter) {\n  src.title as t -&gt; tgt.title = (t.dataString);\n  src.code -&gt; tgt.code;\n  // Sezione Narrativa------------------------------------------------------------------------------------------------------------------------------------------------\n  src where src.entry.exists().not() then {\n    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 {\n      cdaText -&gt; note.text = cdaText &quot;reference&quot;;\n      cdaText -&gt;  medRq.subject = create('Reference') as reference,  reference.reference = ('https://example/Patient/' + %patient.id) &quot;reference&quot;;\n      cdaText -&gt;  medRq.encounter = create('Reference') as reference,  reference.reference = ('https://example/Encounter/' + %enc.id) &quot;reference&quot;;\n      cdaText -&gt; medRq.status = 'active' &quot;status&quot;;\n      cdaText -&gt; medRq.intent = 'order' &quot;intent&quot;;\n      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 {\n        auth.time as t -&gt; note.time = create('dateTime') as value then TSDateTime(t, value);\n        auth.assignedAuthor as assAuth then {\n          // assAuth.time -&gt; note.time;\n          assAuth -&gt; practitioner.meta as meta then {\n            assAuth -&gt; meta.tag = create('Coding') as coding then {\n              assAuth -&gt; coding.system = 'http://algoritmodiscoring' &quot;system&quot;;\n              assAuth -&gt; coding.code = 'ClinicalDocument/body/TerapiaFarmacologicaDimissione/author' &quot;code&quot;;\n            } &quot;coding&quot;;\n          } &quot;meta&quot;;\n          assAuth.id as id -&gt; practitioner.identifier as identifier then {\n            id.root as r -&gt; identifier.system = translate(r, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri') &quot;root1&quot;;\n            id.extension as ext -&gt; identifier.value = ext;\n            id.assigningAuthorityName as s -&gt;  identifier.assigner as a,  a.display = s;\n            id.root as r then {\n              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;;\n            } &quot;r&quot;;\n          } &quot;identifier&quot;;\n          assAuth.id as id where (root = '2.16.840.1.113883.2.9.4.3.2') then {\n            id.extension as ext -&gt; request.url = append('Practitioner?identifier=', ext) &quot;UUID&quot;;\n          } &quot;2&quot;;\n          assAuth.assignedPerson as asspers then {\n            asspers.name -&gt; practitioner.name;\n          } &quot;assPers&quot;;\n        } &quot;assAuth&quot;;\n      } &quot;auth&quot;;\n      src -&gt; medRq.medication = create('CodeableConcept') as medication then {\n        src.text as txt -&gt; medication.text = txt;\n      } &quot;medicationesiste&quot;;\n    } &quot;note&quot;;\n  } &quot;text&quot;;\n  // Sezione Strutturata------------------------------------------------------------------------------------------------------------------------------------------\n  src where src.entry.exists() then {\n    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 {\n      src.text as t -&gt; note.text = t &quot;reference&quot;;\n      src -&gt;  medRq.subject = create('Reference') as reference,  reference.reference = ('https://example/Patient/' + %patient.id) &quot;reference&quot;;\n      src -&gt;  medRq.encounter = create('Reference') as reference,  reference.reference = ('https://example/Encounter/' + %enc.id) &quot;reference&quot;;\n      src -&gt; medRq.status = 'active' &quot;status&quot;;\n      src -&gt; medRq.intent = 'order' &quot;intent&quot;;\n      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 {\n        auth.time as t -&gt; note.time = create('dateTime') as value then TSDateTime(t, value);\n        auth.assignedAuthor as assAuth then {\n          // assAuth.time -&gt; note.time;\n          assAuth -&gt; practitioner.meta as meta then {\n            assAuth -&gt; meta.tag = create('Coding') as coding then {\n              assAuth -&gt; coding.system = 'http://algoritmodiscoring' &quot;system&quot;;\n              assAuth -&gt; coding.code = 'ClinicalDocument/body/TerapiaFarmacologicaDimissione/author' &quot;code&quot;;\n            } &quot;coding&quot;;\n          } &quot;meta&quot;;\n          assAuth.id as id -&gt; practitioner.identifier as identifier then {\n            id.root as r -&gt; identifier.system = translate(r, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri') &quot;root1&quot;;\n            id.extension as ext -&gt; identifier.value = ext;\n            id.assigningAuthorityName as s -&gt;  identifier.assigner as a,  a.display = s;\n            id.root as r then {\n              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;;\n            } &quot;r&quot;;\n          } &quot;identifier&quot;;\n          assAuth.id as id where (root = '2.16.840.1.113883.2.9.4.3.2') then {\n            id.extension as ext -&gt; request.url = append('Practitioner?identifier=', ext) &quot;UUID&quot;;\n          } &quot;2&quot;;\n          assAuth.assignedPerson as asspers then {\n            asspers.name -&gt; practitioner.name;\n          } &quot;assPers&quot;;\n        } &quot;assAuth&quot;;\n      } &quot;auth&quot;;\n      src.entry as entry1 then {\n        entry1.substanceAdministration as sub then {\n          sub.statusCode -&gt; medRq.status;\n          sub -&gt; medRq.dosageInstruction = create('Dosage') as dosage then {\n            sub -&gt; dosage.timing = create('Timing') as tim then {\n              sub.effectiveTime as eff -&gt; tim.repeat as repeat then {\n                eff -&gt; repeat.bounds = create('Period') as period then IVLTSPeriod(eff, period) &quot;boundsperiod&quot;;\n              } &quot;repeat&quot;;\n            } &quot;timing&quot;;\n          } &quot;dosage&quot;;\n          sub.effectiveTime : PIVL_TS as eff -&gt; medRq.dosageInstruction = create('Dosage') as dosage then {\n            eff -&gt; dosage.timing = create('Timing') as timing then periodTiming(eff, timing) &quot;cod&quot;;\n          } &quot;eff&quot;;\n          sub -&gt; medRq.dosageInstruction = create('Dosage') as dosage then {\n            sub.routeCode -&gt; dosage.route;\n          } &quot;dosage&quot;;\n          sub -&gt; medRq.dosageInstruction = create('Dosage') as dosage then {\n            sub.approachSiteCode -&gt; dosage.site;\n          } &quot;dosage&quot;;\n          sub.doseQuantity as doseQuant then {\n            doseQuant -&gt; medRq.dosageInstruction = create('Dosage') as dosageInstruction then {\n              doseQuant.originalText as ot then {\n                ot.reference -&gt; dosageInstruction.text;\n              } &quot;ot&quot;;\n              doseQuant -&gt; dosageInstruction.doseAndRate as dosageRate then {\n                doseQuant -&gt; dosageRate.dose = create('Range') as d then {\n                  doseQuant -&gt; d.low = create('SimpleQuantity') as l then {\n                    doseQuant.low as lo -&gt; l.value = (lo.value);\n                    doseQuant.low as lo -&gt; l.unit = (lo.unit);\n                  } &quot;low&quot;;\n                  doseQuant -&gt; d.high = create('SimpleQuantity') as h then {\n                    doseQuant.high as hi -&gt; h.value = (hi.value);\n                    doseQuant.high as hi -&gt; h.unit = (hi.unit);\n                  } &quot;low&quot;;\n                } &quot;d&quot;;\n              } &quot;dosageRate&quot;;\n              sub.rateQuantity as rateQuantity -&gt; medRq.dosageInstruction = create('Dosage') as dosageInstruction1 then {\n                rateQuantity.originalText as ot then {\n                  ot.reference -&gt; dosageInstruction1.text;\n                } &quot;ot&quot;;\n                rateQuantity -&gt; dosageInstruction1.doseAndRate as dosageRate then {\n                  rateQuantity -&gt; dosageRate.rate = create('Range') as d then {\n                    rateQuantity -&gt; d.low = create('SimpleQuantity') as l then {\n                      rateQuantity.low as lo -&gt; l.value = (lo.value);\n                      rateQuantity.low as lo -&gt; l.unit = (lo.unit);\n                    } &quot;low&quot;;\n                    rateQuantity -&gt; d.high = create('SimpleQuantity') as h then {\n                      rateQuantity.high as hi -&gt; h.value = (hi.value);\n                      rateQuantity.high as hi -&gt; h.unit = (hi.unit);\n                    } &quot;low&quot;;\n                  } &quot;d&quot;;\n                } &quot;qualcosa&quot;;\n              } &quot;dosageRate&quot;;\n            } &quot;Dosage&quot;;\n          } &quot;doseQuant&quot;;\n          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 {\n            sub.administrationUnitCode -&gt; medication.form;\n            sub.consumable as cons then {\n              cons.manufacturedProduct as manuprod then {\n                manuprod.manufacturedMaterial as manufact then {\n                  manufact.code -&gt; medication.code;\n                } &quot;manuFact&quot;;\n              } &quot;manumat&quot;;\n            } &quot;cons&quot;;\n            sub.entryRelationship as entryR then {\n              entryR.observation as observation then {\n                observation.code where displayName = 'Grammatura' -&gt; medication.ingredient as ingredient then {\n                  sub.consumable as consumable then {\n                    consumable.manufacturedProduct as manufacturedProduct then {\n                      manufacturedProduct.manufacturedMaterial as manufacturedMaterial then {\n                        manufacturedMaterial.code as code -&gt; ingredient.item = create('CodeableConcept') as value then CECodeableConcept(code, value) &quot;CE&quot;;\n                      } &quot;material&quot;;\n                    } &quot;product&quot;;\n                  };\n                  observation.value as value -&gt; ingredient.strength as strength then {\n                    value -&gt; strength.numerator as numerator then {\n                      value -&gt; numerator.value = (value.value) &quot;valueN&quot;;\n                    } &quot;numerator&quot;;\n                    value -&gt; strength.denominator as denominator then {\n                      value -&gt; denominator.value = 1 &quot;valueD&quot;;\n                    } &quot;denominator&quot;;\n                  } &quot;strenght&quot;;\n                } &quot;ingredient&quot;;\n                observation.code where displayName = 'Quantità nella Confezione' then {\n                  observation.value as value -&gt; medication.amount as amount then {\n                    value -&gt; amount.numerator as numerator then {\n                      value -&gt; numerator.value = (value.value) &quot;valueN&quot;;\n                    } &quot;numerator&quot;;\n                    value -&gt; amount.denominator as denominator then {\n                      value -&gt; denominator.value = 1 &quot;valueD&quot;;\n                    } &quot;denominator&quot;;\n                  } &quot;amount&quot;;\n                } &quot;quantita&quot;;\n              } &quot;obs&quot;;\n            } &quot;entryR&quot;;\n            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 {\n              part.time as t -&gt; medRq.authoredOn = create('dateTime') as date then TSDateTime(t, date) &quot;authoredOn&quot;;\n              part.participantRole as partRole then {\n                partRole -&gt; participant.meta as meta then {\n                  partRole -&gt; meta.tag = create('Coding') as coding then {\n                    partRole -&gt; coding.system = 'http://algoritmodiscoring' &quot;system&quot;;\n                    partRole -&gt; coding.code = 'ClinicalDocument/body/TerapiaFarmacologicaDimissione/participant' &quot;code&quot;;\n                  } &quot;coding&quot;;\n                } &quot;meta&quot;;\n                partRole.id as id -&gt; participant.identifier as identifier then {\n                  id.root as r -&gt; identifier.system = translate(r, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri') &quot;root1&quot;;\n                  id.extension as ext -&gt; identifier.value = ext;\n                  id.assigningAuthorityName as s -&gt;  identifier.assigner as a,  a.display = s;\n                  id.root as r then {\n                    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;;\n                  } &quot;r&quot;;\n                } &quot;identifier&quot;;\n                partRole.id as id where (root = '2.16.840.1.113883.2.9.4.3.2') then {\n                  id.extension as ext -&gt; request.url = append('Practitioner?identifier=', ext) &quot;UUID&quot;;\n                } &quot;2&quot;;\n                partRole.playingEntity as playent then {\n                  playent.name -&gt; participant.name;\n                } &quot;playent&quot;;\n              } &quot;partRole&quot;;\n            };\n            sub.reference as ref then {\n              ref.externalAct as external then {\n                external.id -&gt; medRq.identifier;\n              } &quot;external&quot;;\n            } &quot;ref&quot;;\n            sub.entryRelationship as entryRelationship then {\n              entryRelationship.supply as sup -&gt; medRq.dispenseRequest as dispreq then {\n                sup -&gt; dispreq.quantity = create('SimpleQuantity') as quantity then {\n                  sup.quantity as q -&gt; quantity.value = (q.value);\n                } &quot;quantity&quot;;\n              } &quot;sub&quot;;\n            } &quot;med&quot;;\n          } &quot;admnistrationUnicode&quot;;\n        } &quot;sub&quot;;\n      };\n    } &quot;medication&quot;;\n  } &quot;sezioneesiste&quot;;\n}\n\n// -----------------------------------------------------------------------------------------------------------------------\n// ______1._____________Sections________________________\ngroup ModalitadiTrasposto(source cda : ClinicalDocument, source src : Section, target patient : Patient, target tgt, target bundle : Bundle, target enc : Encounter) {\n  src.title as t -&gt; tgt.title = (t.dataString);\n  src.code -&gt; tgt.code;\n  src.text as cdaText -&gt; tgt.text as fhirText then {\n    cdaText -&gt; fhirText.status = 'generated' &quot;narrativeStatus&quot;;\n    cdaText as t -&gt; fhirText.div = t &quot;narrativeText&quot;;\n  } &quot;cdaText&quot;;\n  src.entry as entry1 then {\n    src.entry as entry1 -&gt;  tgt.entry = create('Reference') as reference,  reference.reference = ('https://example/Encounter/' + %enc.id) then {\n      entry1.act as act1 then Act(act1, patient, enc, bundle);\n    } &quot;entry1&quot;;\n  };\n}\n\ngroup MotivoDellaVisita(source cda : ClinicalDocument, source src : Section, target patient : Patient, target tgt, target bundle : Bundle, target enc : Encounter) {\n  src.title as t -&gt; tgt.title = (t.dataString);\n  src.code -&gt; tgt.code;\n  src.text as cdaText -&gt; tgt.text as fhirText then {\n    cdaText -&gt; fhirText.status = 'generated' &quot;narrativeStatus&quot;;\n    cdaText as t -&gt; fhirText.div = t &quot;narrativeText&quot;;\n  } &quot;cdaText&quot;;\n  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 {\n    entry.observation as obs then Observation(obs, patient, enc, observation, bundle);\n  };\n}\n\ngroup Triage(source cda : ClinicalDocument, source src : Section, target patient : Patient, target tgt, target bundle : Bundle, target enc : Encounter) {\n  src.title as t -&gt; tgt.title = (t.dataString);\n  src.code -&gt; tgt.code;\n  src.text as cdaText -&gt; tgt.text as fhirText then {\n    cdaText -&gt; fhirText.status = 'generated' &quot;narrativeStatus&quot;;\n    cdaText as t -&gt; fhirText.div = t &quot;narrativeText&quot;;\n  } &quot;cdaText&quot;;\n  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 {\n    entry.observation as obs then Observation(obs, patient, enc, observation, bundle);\n  };\n}\n\ngroup InquadramentoClinicoIniziale(source cda : ClinicalDocument, source src : Section, target patient : Patient, target tgt, target bundle : Bundle, target enc : Encounter) {\n  src.title as t -&gt; tgt.title = (t.dataString);\n  src.code -&gt; tgt.code;\n  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 {\n    src.code -&gt; observation.code;\n    src where observation.statusCode.exists().not() then {\n      src -&gt; observation.status = 'final' &quot;status&quot;;\n    } &quot;statuscode&quot;;\n    src -&gt;  observation.subject = create('Reference') as reference,  reference.reference = ('https://example/Patient/' + %patient.id) &quot;reference&quot;;\n    src -&gt;  observation.encounter = create('Reference') as reference,  reference.reference = ('https://example/Encounter/' + %enc.id) &quot;reference&quot;;\n    cdaText -&gt; observation.note as note then {\n      src.author as author then {\n        author -&gt;  bundle.entry as e2,  e2.request = create('BackboneElement') as request,  request.method = 'PUT',  e2.resource = create('Practitioner') as practitioner then {\n          author.assignedAuthor as assignedAuthor then {\n            assignedAuthor -&gt; practitioner.meta as meta then {\n              assignedAuthor -&gt; meta.tag = create('Coding') as coding then {\n                assignedAuthor -&gt; coding.system = 'http://algoritmodiscoring' &quot;system&quot;;\n                assignedAuthor -&gt; coding.code = 'ClinicalDocument/body/InquadramentoClinicoIniziale/author' &quot;code&quot;;\n              } &quot;coding&quot;;\n            } &quot;meta&quot;;\n            assignedAuthor.id as id -&gt; practitioner.identifier as identifier then {\n              id.root as r -&gt; identifier.system = translate(r, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri') &quot;root1&quot;;\n              id.extension as ext -&gt; identifier.value = ext;\n              id.assigningAuthorityName as s -&gt;  identifier.assigner as a,  a.display = s;\n              id.root as r then {\n                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;;\n              } &quot;r&quot;;\n            } &quot;identifier&quot;;\n            assignedAuthor.id as id where (root = '2.16.840.1.113883.2.9.4.3.2') then {\n              id.extension as ext -&gt; request.url = append('Practitioner?identifier=', ext) &quot;UUID&quot;;\n            } &quot;2&quot;;\n            assignedAuthor.assignedPerson as person then {\n              person.name -&gt; practitioner.name;\n            } &quot;name&quot;;\n          };\n        } &quot;practitioner&quot;;\n        author.time as t -&gt; note.time = create('dateTime') as value then TSDateTime(t, value);\n      } &quot;Author&quot;;\n      cdaText as t -&gt; note.text = t &quot;reference&quot;;\n    } &quot;reference&quot;;\n  } &quot;cdaText&quot;;\n  // START sottosections\n  src.component as component then {\n    component.section as sottosection then {\n      sottosection -&gt; tgt.section as section then {\n        // 1. Anamnesi Narrativa-------------------------------------------------------------------------------------------------------------------------------------------\n        sottosection.code where (code = '11329-0') -&gt; section.code;\n        sottosection.code as code1 where (code = '11329-0') then {\n          src where sottosection.entry.exists().not() then {\n            sottosection.title as t -&gt; section.title = (t.dataString);\n            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 {\n              cdaText -&gt;  observation.subject = create('Reference') as reference,  reference.reference = ('https://example/Patient/' + %patient.id) &quot;reference&quot;;\n              cdaText -&gt;  observation.encounter = create('Reference') as reference,  reference.reference = ('https://example/Encounter/' + %enc.id) &quot;reference&quot;;\n              sottosection.code -&gt; observation.code;\n              src where observation.statusCode.exists().not() then {\n                src -&gt; observation.status = 'final' &quot;status&quot;;\n              } &quot;statuscode&quot;;\n              cdaText -&gt; observation.note as note then {\n                cdaText as t -&gt; note.text = t &quot;reference&quot;;\n                sottosection.author as authors then {\n                  authors.time as time -&gt; note.time = create('dateTime') as value then TSDateTime(time, value) &quot;timeAuthor&quot;;\n                  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 {\n                    assignedAuthor -&gt; practitioner.meta as meta then {\n                      assignedAuthor -&gt; meta.tag = create('Coding') as coding then {\n                        assignedAuthor -&gt; coding.system = 'http://algoritmodiscoring' &quot;system&quot;;\n                        assignedAuthor -&gt; coding.code = 'ClinicalDocument/body/EsameObiettivo/author' &quot;code&quot;;\n                      } &quot;coding&quot;;\n                    } &quot;meta&quot;;\n                    assignedAuthor.id as id -&gt; practitioner.identifier as identifier then {\n                      id.root as r -&gt; identifier.system = translate(r, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri') &quot;root1&quot;;\n                      id.extension as ext -&gt; identifier.value = ext;\n                      id.assigningAuthorityName as s -&gt;  identifier.assigner as a,  a.display = s;\n                      id.root as r then {\n                        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;;\n                      } &quot;r&quot;;\n                    } &quot;identifier&quot;;\n                    assignedAuthor.id as id where (root = '2.16.840.1.113883.2.9.4.3.2') then {\n                      id.extension as ext -&gt; request.url = append('Practitioner?identifier=', ext) &quot;UUID&quot;;\n                    } &quot;2&quot;;\n                    assignedAuthor.assignedPerson as person then {\n                      person.name -&gt; practitioner.name;\n                    };\n                  } &quot;assighedAuthor&quot;;\n                };\n              } &quot;reference&quot;;\n            } &quot;cdaText&quot;;\n          } &quot;where&quot;;\n          // Anamnesi Strutturata-----------------------------------------------------------------------------------------------------------------------------------------\n          sottosection.entry as entry1 then {\n            entry1.observation as obs then {\n              obs.code where (code = '75326-9') then {\n                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 {\n                  obs.code -&gt; condition.category;\n                  obs -&gt;  condition.subject = create('Reference') as reference,  reference.reference = ('https://example/Patient/' + %patient.id) &quot;reference&quot;;\n                  obs -&gt;  condition.encounter = create('Reference') as reference,  reference.reference = ('https://example/Encounter/' + %enc.id) &quot;reference&quot;;\n                  obs.statusCode as status where (code = 'completed') -&gt; condition.verificationStatus as status2 then {\n                    status -&gt; status2.coding as status3 then {\n                      status -&gt; status3.code = 'confirmed' &quot;finald&quot;;\n                      status -&gt; status3.system = 'http://terminology.hl7.org/CodeSystem/condition-ver-status' &quot;system&quot;;\n                    } &quot;st3&quot;;\n                  } &quot;status&quot;;\n                  // blocco Narrativo\n                  sottosection.text as cdaText1 -&gt; condition.note as note then {\n                    cdaText1 as t -&gt; note.text = t &quot;reference&quot;;\n                    sottosection.author as authors then {\n                      authors.time as time -&gt; note.time = create('dateTime') as value then TSDateTime(time, value) &quot;timeAuthor&quot;;\n                      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 {\n                        assignedAuthor -&gt; practitioner.meta as meta then {\n                          assignedAuthor -&gt; meta.tag = create('Coding') as coding then {\n                            assignedAuthor -&gt; coding.system = 'http://algoritmodiscoring' &quot;system&quot;;\n                            assignedAuthor -&gt; coding.code = 'ClinicalDocument/body/Anamnesi/author' &quot;code&quot;;\n                          } &quot;coding&quot;;\n                        } &quot;meta&quot;;\n                        assignedAuthor.id as id -&gt; practitioner.identifier as identifier then {\n                          id.root as r -&gt; identifier.system = translate(r, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri') &quot;root1&quot;;\n                          id.extension as ext -&gt; identifier.value = ext;\n                          id.assigningAuthorityName as s -&gt;  identifier.assigner as a,  a.display = s;\n                          id.root as r then {\n                            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);\n                          } &quot;r&quot;;\n                        } &quot;identifier&quot;;\n                        assignedAuthor.id as id where (root = '2.16.840.1.113883.2.9.4.3.2') then {\n                          id.extension as ext -&gt; request.url = append('Practitioner?identifier=', ext) &quot;UUID&quot;;\n                        } &quot;2&quot;;\n                        assignedAuthor.assignedPerson as person then {\n                          person.name -&gt; practitioner.name;\n                        };\n                      } &quot;assighedAuthor&quot;;\n                    };\n                  } &quot;cdaText1&quot;;\n                  obs.effectiveTime as effective1 then {\n                    effective1 where effective1.low.exists() or effective1.high.exists() then {\n                      effective1 -&gt; condition.onset = create('Period') as periodonset then IVLTSPeriod(effective1, periodonset) &quot;onsetperiod&quot;;\n                    } &quot;ef&quot;;\n                  } &quot;effectivetime1&quot;;\n                  obs.effectiveTime as effectiveTime -&gt; condition.onset = create('dateTime') as value then TSDateTime(effectiveTime, value) &quot;onsetDateTime&quot;;\n                  obs.value : INT as int -&gt; ob.value = (int.value);\n                  obs.value : BL as boolean -&gt; ob.value = (boolean.value) &quot;boolean&quot;;\n                  obs.value : ST as value -&gt;  ob.value = create('string'),  ob.value = (value.dataString);\n                  obs.value : CE as val then {\n                    val -&gt; ob.value = create('CodeableConcept') as ce then {\n                      val.originalText as originalText then {\n                        originalText.reference as reference -&gt; ce.text = reference;\n                      } &quot;originltext&quot;;\n                      val -&gt; ce.coding as coding then {\n                        val.code as code -&gt; coding.code = cast(code, 'string');\n                        val.codeSystem as system -&gt; coding.system = translate(system, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri');\n                        val.displayName as display -&gt; coding.display = cast(display, 'string');\n                        val.codeSystemVersion as version -&gt; coding.version = cast(version, 'string');\n                      } &quot;code&quot;;\n                      val.translation as translation -&gt; ce.coding as coding then {\n                        translation.code as code -&gt; coding.code = cast(code, 'string');\n                        translation.codeSystem as system -&gt; coding.system = translate(system, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri');\n                        translation.displayName as display -&gt; coding.display = cast(display, 'string');\n                        translation.codeSystemVersion as version -&gt; coding.version = cast(version, 'string');\n                        translation.qualifier as qualifier then {\n                          qualifier.value as value -&gt; ce.coding as coding then {\n                            value.code as code -&gt; coding.code = cast(code, 'string');\n                            value.codeSystem as system -&gt; coding.system = translate(system, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri');\n                            value.displayName as display -&gt; coding.display = cast(display, 'string');\n                            value.codeSystemVersion as version -&gt; coding.version = cast(version, 'string');\n                          };\n                        };\n                      };\n                    } &quot;coding&quot;;\n                  } &quot;val&quot;;\n                  obs.value : CD as val then {\n                    val -&gt; condition.code = create('CodeableConcept') as ce then {\n                      val.originalText -&gt; ce.text;\n                      val -&gt; ce.coding as coding then {\n                        val.code as code -&gt; coding.code = cast(code, 'string');\n                        val.codeSystem as system -&gt; coding.system = translate(system, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri');\n                        val.displayName as display -&gt; coding.display = cast(display, 'string');\n                      } &quot;coding&quot;;\n                    } &quot;Ce&quot;;\n                  } &quot;Value&quot;;\n                  obs.entryRelationship as entriRel then {\n                    entriRel -&gt; condition.evidence = create('BackboneElement') as evidence then {\n                      entriRel.observation as observation2 then {\n                        observation2.code as code then {\n                          code.code where (code.code = '89261-2') then {\n                            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 {\n                              entriRel -&gt;  evidence.detail = create('Reference') as reference,  reference.reference = ('https://example/Observation/' + %observation.id) &quot;ref&quot;;\n                              observation2.code -&gt; observation.code;\n                              observation2 where observation.statusCode.exists().not() then {\n                                observation2 -&gt; observation.status = 'final' &quot;status&quot;;\n                              } &quot;statuscode&quot;;\n                              observation2.text as text -&gt; observation.note = create('Annotation') as note then {\n                                text.reference as ref -&gt; note.text = (ref.value) &quot;val&quot;;\n                              } &quot;Annontation&quot;;\n                              obs -&gt;  observation.subject = create('Reference') as reference,  reference.reference = ('https://example/Patient/' + %patient.id) &quot;reference&quot;;\n                              obs -&gt;  observation.encounter = create('Reference') as reference,  reference.reference = ('https://example/Encounter/' + %enc.id) &quot;reference&quot;;\n                              observation2.statusCode as statusc where (code = 'completed') -&gt; ob.status = 'final';\n                              observation2.statusCode as statusc where (code = 'active') -&gt; ob.status = 'registered';\n                              observation2.statusCode as statusc where (code = 'aborted') -&gt; ob.status = 'cancelled';\n                              observation2.statusCode as statusc where (code = 'suspended') -&gt; ob.status = 'partial';\n                              observation2.value : INT as int -&gt; observation.value = (int.value);\n                              observation2.value : BL as boolean -&gt; observation.value = (boolean.value) &quot;boolean&quot;;\n                              observation2.value : ST as value -&gt;  observation.value = create('string'),  observation.value = (value.dataString);\n                              observation2.effectiveTime as effectiveTime -&gt; observation.effective = create('dateTime') as value then TSDateTime(effectiveTime, value) &quot;value2&quot;;\n                              observation2 where effectiveTime.low.exists() or effectiveTime.high.exists() then {\n                                observation2.effectiveTime as eff -&gt; observation.effective = create('Period') as period then IVLTSPeriod(eff, period);\n                              } &quot;where&quot;;\n                              observation2.value : PQ as val then {\n                                val -&gt; observation.value = create('Quantity') as quantity then {\n                                  val.value as value -&gt; quantity.value = value;\n                                  val.unit as unit -&gt; quantity.unit = unit;\n                                } &quot;quantity&quot;;\n                              } &quot;valueQuantity&quot;;\n                              observation2.value : CE as val then {\n                                val -&gt; observation.value = create('CodeableConcept') as ce then {\n                                  val.originalText -&gt; ce.text;\n                                  val -&gt; ce.coding as coding then {\n                                    val.code as code -&gt; coding.code = cast(code, 'string');\n                                    val.codeSystem as system -&gt; coding.system = translate(system, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri');\n                                    val.displayName as display -&gt; coding.display = cast(display, 'string');\n                                  } &quot;coding&quot;;\n                                } &quot;Ce&quot;;\n                              } &quot;Value&quot;;\n                            } &quot;obser&quot;;\n                          } &quot;whereDecorsoClinico&quot;;\n                        };\n                      } &quot;Observation2&quot;;\n                    } &quot;evidence&quot;;\n                  } &quot;EntryRelationship1&quot;;\n                  obs.entryRelationship as entriRel then {\n                    entriRel.observation as observation2 then {\n                      observation2.code as code then {\n                        code.code where (code.code = '33999-4') then {\n                          observation2 -&gt; condition.clinicalStatus = create('CodeableConcept') as status then {\n                            observation2.text as text then {\n                              text.reference as refstat -&gt; status.text = (refstat.value) &quot;statref&quot;;\n                            } &quot;textstat&quot;;\n                            observation2 -&gt; status.coding = create('Coding') as coding then {\n                              observation2.value as value then {\n                                value.code where (value.code = 'LA16666-2') -&gt; coding.code = 'active' &quot;active&quot;;\n                                value.code where (value.code = 'LA18632-2') -&gt; coding.code = 'inactive' &quot;inactive&quot;;\n                                value.codeSystem as system -&gt; coding.system = 'http://terminology.hl7.org/CodeSystem/condition-clinical' &quot;system&quot;;\n                                value.displayName as display -&gt; coding.display = cast(display, 'string');\n                              } &quot;value1&quot;;\n                            } &quot;coding&quot;;\n                          } &quot;code&quot;;\n                        } &quot;whereDecorsoClinico&quot;;\n                      } &quot;codestatus&quot;;\n                    } &quot;observationstatus&quot;;\n                  } &quot;entryrelationshipstatus&quot;;\n                } &quot;condition&quot;;\n              } &quot;89261-2&quot;;\n            } &quot;entryobservation1&quot;;\n            // Anamnesi Familiare---------------------------------------------------------------------------------------------------------------------------------------------\n            entry1.organizer as organizer then {\n              organizer.code where (code = '10157-6') then {\n                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 {\n                  organizer.effectiveTime as effective then {\n                    effective.value as eff -&gt; FamilyMemberHistory.date = create('dateTime') as value then TSDateTime(eff, value) &quot;date&quot;;\n                  } &quot;effective&quot;;\n                  organizer -&gt;  FamilyMemberHistory.patient = create('Reference') as reference,  reference.reference = ('https://example/Patient/' + %patient.id) &quot;reference&quot;;\n                  organizer.subject as subject then {\n                    subject.relatedSubject as relatedSubject then {\n                      relatedSubject.code -&gt; FamilyMemberHistory.relationship &quot;relationship&quot;;\n                      relatedSubject.subject as subject -&gt; FamilyMemberHistory.sex as sex then {\n                        subject.administrativeGenderCode as administrativeGenderCode -&gt; sex.coding as coding then {\n                          administrativeGenderCode.code as code -&gt; coding.code = translate(code, '#AdministrativeGender', 'code') &quot;gender&quot;;\n                          administrativeGenderCode -&gt; coding.system = 'http://hl7.org/fhir/administrative-gender' &quot;system&quot;;\n                        } &quot;coding&quot;;\n                      } &quot;subject1&quot;;\n                    };\n                  };\n                  // blocco Narrativo\n                  sottosection.text as cdaText1 -&gt; FamilyMemberHistory.note as note then {\n                    cdaText1 as t -&gt; note.text = t &quot;reference&quot;;\n                    sottosection.author as authors then {\n                      authors.time as time -&gt; note.time = create('dateTime') as value then TSDateTime(time, value) &quot;timeAuthor&quot;;\n                      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 {\n                        assignedAuthor -&gt; practitioner.meta as meta then {\n                          assignedAuthor -&gt; meta.tag = create('Coding') as coding then {\n                            assignedAuthor -&gt; coding.system = 'http://algoritmodiscoring' &quot;system&quot;;\n                            assignedAuthor -&gt; coding.code = 'ClinicalDocument/body/Anamnesi/author' &quot;code&quot;;\n                          } &quot;coding&quot;;\n                        } &quot;meta&quot;;\n                        assignedAuthor.id as id -&gt; practitioner.identifier as identifier then {\n                          id.root as r -&gt; identifier.system = translate(r, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri') &quot;root1&quot;;\n                          id.extension as ext -&gt; identifier.value = ext;\n                          id.assigningAuthorityName as s -&gt;  identifier.assigner as a,  a.display = s;\n                          id.root as r then {\n                            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);\n                          } &quot;r&quot;;\n                        } &quot;identifier&quot;;\n                        assignedAuthor.id as id where (root = '2.16.840.1.113883.2.9.4.3.2') then {\n                          id.extension as ext -&gt; request.url = append('Practitioner?identifier=', ext) &quot;UUID&quot;;\n                        } &quot;2&quot;;\n                        assignedAuthor.assignedPerson as person then {\n                          person.name -&gt; practitioner.name;\n                        };\n                      } &quot;assighedAuthor&quot;;\n                    };\n                  } &quot;cdaText1&quot;;\n                  organizer.component as component -&gt; FamilyMemberHistory.condition as condition then {\n                    component.observation as observation then {\n                      observation.code -&gt; condition.code;\n                      observation.text as text -&gt; FamilyMemberHistory.note as note then {\n                        text.reference as reference -&gt; note.text = (reference.value) &quot;value&quot;;\n                      } &quot;reference&quot;;\n                      observation.statusCode -&gt; FamilyMemberHistory.status;\n                      observation.value -&gt; condition.outcome &quot;codeable&quot;;\n                      observation.entryRelationship as entryRelationship then {\n                        entryRelationship.observation as obsservation1 then {\n                          obsservation1.code as code then {\n                            code.code where (code.code = '35267-4') then {\n                              obsservation1.value as value -&gt; condition.onset = create('Age') as Age then {\n                                value.value as valueAge -&gt; Age.value = valueAge &quot;age&quot;;\n                                value.unit as unit -&gt; Age.code = unit;\n                                value.unit as unit -&gt; Age.unit = unit;\n                                value -&gt; Age.system = 'http://unitsofmeasure.org' &quot;system&quot;;\n                              };\n                            } &quot;insorgenza&quot;;\n                          };\n                          obsservation1.code as code then {\n                            code.code where (code.code = '39016-1') then {\n                              obsservation1.value as value -&gt; FamilyMemberHistory.deceased = create('Age') as Age then {\n                                value.value as valueAge -&gt; Age.value = valueAge &quot;age&quot;;\n                                value.unit as unit -&gt; Age.code = unit;\n                                value.unit as unit -&gt; Age.unit = unit;\n                                value -&gt; Age.system = 'http://unitsofmeasure.org' &quot;system&quot;;\n                              };\n                            } &quot;deceased&quot;;\n                          };\n                        } &quot;obser&quot;;\n                      } &quot;EntryRel&quot;;\n                      observation where observation.effectiveTime.exists() then {\n                        observation.effectiveTime as effectiveTime -&gt; FamilyMemberHistory.condition = create('BackboneElement') as condition then {\n                          effectiveTime -&gt; condition.onset = create('Period') as period then {\n                            effectiveTime -&gt; period.start = create('dateTime') as start then TSDateTime(effectiveTime, start) &quot;val&quot;;\n                          } &quot;efft&quot;;\n                          observation.code -&gt; condition.code;\n                          observation.value -&gt; condition.outcome &quot;codeable&quot;;\n                        } &quot;effttemp&quot;;\n                      } &quot;cont&quot;;\n                    } &quot;observationCondition&quot;;\n                  };\n                } &quot;organizer&quot;;\n              } &quot;10157-6&quot;;\n            } &quot;observation1&quot;;\n          } &quot;subsection1&quot;;\n        } &quot;11329-0&quot;;\n        // 2. Esame Obiettivo Narrativa-----------------------------------------------------------------------------------------------------------------------------------\n        sottosection.code where (code = '29545-1') -&gt; section.code;\n        sottosection.code as code1 where (code = '29545-1') then {\n          sottosection.title as t -&gt; section.title = (t.dataString);\n          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 {\n            cdaText -&gt;  observation.subject = create('Reference') as reference,  reference.reference = ('https://example/Patient/' + %patient.id) &quot;reference&quot;;\n            cdaText -&gt;  observation.encounter = create('Reference') as reference,  reference.reference = ('https://example/Encounter/' + %enc.id) &quot;reference&quot;;\n            sottosection.code -&gt; observation.code;\n            sottosection where observation.statusCode.exists().not() then {\n              sottosection -&gt; observation.status = 'final' &quot;status&quot;;\n            } &quot;statuscode&quot;;\n            cdaText -&gt; observation.note as note then {\n              cdaText as t -&gt; note.text = t &quot;reference&quot;;\n              sottosection.author as authors then {\n                authors.time as time -&gt; note.time = create('dateTime') as value then TSDateTime(time, value) &quot;timeAuthor&quot;;\n                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 {\n                  assignedAuthor -&gt; practitioner.meta as meta then {\n                    assignedAuthor -&gt; meta.tag = create('Coding') as coding then {\n                      assignedAuthor -&gt; coding.system = 'http://algoritmodiscoring' &quot;system&quot;;\n                      assignedAuthor -&gt; coding.code = 'ClinicalDocument/body/EsameObiettivo/author' &quot;code&quot;;\n                    } &quot;coding&quot;;\n                  } &quot;meta&quot;;\n                  assignedAuthor.id as id -&gt; practitioner.identifier as identifier then {\n                    id.root as r -&gt; identifier.system = translate(r, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri') &quot;root1&quot;;\n                    id.extension as ext -&gt; identifier.value = ext;\n                    id.assigningAuthorityName as s -&gt;  identifier.assigner as a,  a.display = s;\n                    id.root as r then {\n                      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;;\n                    } &quot;r&quot;;\n                  } &quot;identifier&quot;;\n                  assignedAuthor.id as id where (root = '2.16.840.1.113883.2.9.4.3.2') then {\n                    id.extension as ext -&gt; request.url = append('Practitioner?identifier=', ext) &quot;UUID&quot;;\n                  } &quot;2&quot;;\n                  assignedAuthor.assignedPerson as person then {\n                    person.name -&gt; practitioner.name;\n                  };\n                } &quot;assighedAuthor&quot;;\n              };\n            } &quot;reference&quot;;\n          } &quot;cdaText&quot;;\n        } &quot;condizioneesameObiettivo&quot;;\n        // 3. Terapia Farmacologica all'ingresso Narrativa --------------------------------------------------------------------------------------------------------------\n        sottosection.code where (code = '42346-7') -&gt; section.code;\n        sottosection.code as code1 where (code = '42346-7') then {\n          sottosection.title as t -&gt; section.title = (t.dataString);\n          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 {\n            cdaText -&gt;  medicStatement.subject = create('Reference') as reference,  reference.reference = ('https://example/Patient/' + %patient.id) &quot;reference&quot;;\n            sottosection where medicStatement.statusCode.exists().not() then {\n              sottosection -&gt; medicStatement.status = 'completed' &quot;status&quot;;\n            } &quot;statuscode&quot;;\n            cdaText -&gt; medicStatement.medication = create('CodeableConcept') as medication then {\n              cdaText as txt -&gt; medication.text = txt &quot;text&quot;;\n            } &quot;medication&quot;;\n            cdaText -&gt; medicStatement.note as note then {\n              cdaText as t -&gt; note.text = t &quot;reference&quot;;\n              sottosection.author as authors then {\n                authors.time as time -&gt; note.time = create('dateTime') as value then TSDateTime(time, value) &quot;timeAuthor&quot;;\n                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 {\n                  assignedAuthor -&gt; practitioner.meta as meta then {\n                    assignedAuthor -&gt; meta.tag = create('Coding') as coding then {\n                      assignedAuthor -&gt; coding.system = 'http://algoritmodiscoring' &quot;system&quot;;\n                      assignedAuthor -&gt; coding.code = 'ClinicalDocument/body/TerapiaFarmacologicaIngresso/author' &quot;code&quot;;\n                    } &quot;coding&quot;;\n                  } &quot;meta&quot;;\n                  assignedAuthor.id as id -&gt; practitioner.identifier as identifier then {\n                    id.root as r -&gt; identifier.system = translate(r, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri') &quot;root1&quot;;\n                    id.extension as ext -&gt; identifier.value = ext;\n                    id.assigningAuthorityName as s -&gt;  identifier.assigner as a,  a.display = s;\n                    id.root as r then {\n                      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);\n                    } &quot;r&quot;;\n                  } &quot;identifier&quot;;\n                  assignedAuthor.id as id where (root = '2.16.840.1.113883.2.9.4.3.2') then {\n                    id.extension as ext -&gt; request.url = append('Practitioner?identifier=', ext) &quot;UUID&quot;;\n                  } &quot;2&quot;;\n                  assignedAuthor.assignedPerson as person then {\n                    person.name -&gt; practitioner.name;\n                  };\n                } &quot;assighedAuthor&quot;;\n              };\n            } &quot;reference&quot;;\n          } &quot;cdaText&quot;;\n        } &quot;condizioneterapiaingresso&quot;;\n        // 4. Allergie\n        sottosection.code where (code = '48765-2') -&gt; section.code;\n        sottosection.code as code1 where (code = '48765-2') then {\n          sottosection.title as t -&gt; section.title = (t.dataString);\n          // Allergia Narrativa-------------------------------------------------------------------------------------------------------------------------------------------\n          src where sottosection.entry.exists().not() then {\n            sottosection.title as t -&gt; section.title = (t.dataString);\n            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 {\n              cdaText -&gt;  AllergyIntolerance.patient = create('Reference') as reference,  reference.reference = ('https://example/Patient/' + %patient.id) &quot;reference&quot;;\n              cdaText -&gt;  AllergyIntolerance.encounter = create('Reference') as reference,  reference.reference = ('https://example/Encounter/' + %enc.id) &quot;reference&quot;;\n              cdaText -&gt; AllergyIntolerance.clinicalStatus = create('CodeableConcept') as status then {\n                cdaText -&gt; status.coding = create('Coding') as coding then {\n                  cdaText -&gt; coding.code = 'active' &quot;active&quot;;\n                  cdaText -&gt; coding.system = 'http://terminology.hl7.org/CodeSystem/allergyintolerance-clinical' &quot;system&quot;;\n                  cdaText -&gt; coding.display = 'active' &quot;active&quot;;\n                } &quot;coding&quot;;\n              } &quot;clinicalStatus&quot;;\n              cdaText -&gt; AllergyIntolerance.note as note then {\n                cdaText as t -&gt; note.text = t &quot;reference&quot;;\n                sottosection.author as authors then {\n                  authors.time as time -&gt; note.time = create('dateTime') as value then TSDateTime(time, value) &quot;timeAuthor&quot;;\n                  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 {\n                    assignedAuthor -&gt; practitioner.meta as meta then {\n                      assignedAuthor -&gt; meta.tag = create('Coding') as coding then {\n                        assignedAuthor -&gt; coding.system = 'http://algoritmodiscoring' &quot;system&quot;;\n                        assignedAuthor -&gt; coding.code = 'ClinicalDocument/body/EsameObiettivo/author' &quot;code&quot;;\n                      } &quot;coding&quot;;\n                    } &quot;meta&quot;;\n                    assignedAuthor.id as id -&gt; practitioner.identifier as identifier then {\n                      id.root as r -&gt; identifier.system = translate(r, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri') &quot;root1&quot;;\n                      id.extension as ext -&gt; identifier.value = ext;\n                      id.assigningAuthorityName as s -&gt;  identifier.assigner as a,  a.display = s;\n                      id.root as r then {\n                        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;;\n                      } &quot;r&quot;;\n                    } &quot;identifier&quot;;\n                    assignedAuthor.id as id where (root = '2.16.840.1.113883.2.9.4.3.2') then {\n                      id.extension as ext -&gt; request.url = append('Practitioner?identifier=', ext) &quot;UUID&quot;;\n                    } &quot;2&quot;;\n                    assignedAuthor.assignedPerson as person then {\n                      person.name -&gt; practitioner.name;\n                    };\n                  } &quot;assighedAuthor&quot;;\n                };\n              } &quot;reference&quot;;\n            } &quot;cdaText&quot;;\n          } &quot;where&quot;;\n          // Allergia Strutturata----------------------------------------------------------------------------------------------------------------------------------------\n          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 {\n            src -&gt;  allergy.patient = create('Reference') as reference,  reference.reference = ('https://example/Patient/' + %patient.id) &quot;reference&quot;;\n            src -&gt;  allergy.encounter = create('Reference') as reference,  reference.reference = ('https://example/Encounter/' + %enc.id) &quot;reference&quot;;\n            entry1.act as actallint then {\n              actallint.effectiveTime as effectiveTime -&gt; allergy.onset = create('dateTime') as value then TSDateTime(effectiveTime, value) &quot;onsetDateTime&quot;;\n              actallint where effectiveTime.low.exists() or effectiveTime.high.exists() then {\n                actallint.effectiveTime as eff -&gt; allergy.onset = create('Period') as period then IVLTSPeriod(eff, period) &quot;onsetPeriod&quot;;\n              } &quot;where&quot;;\n              // mapping note\n              sottosection.text as cdaText1 -&gt; allergy.note as note then {\n                cdaText1 as t -&gt; note.text = t &quot;reference&quot;;\n                sottosection.author as authors then {\n                  authors.time as time -&gt; note.time = create('dateTime') as value then TSDateTime(time, value) &quot;timeAuthor&quot;;\n                  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 {\n                    assignedAuthor -&gt; practitioner.meta as meta then {\n                      assignedAuthor -&gt; meta.tag = create('Coding') as coding then {\n                        assignedAuthor -&gt; coding.system = 'http://algoritmodiscoring' &quot;system&quot;;\n                        assignedAuthor -&gt; coding.code = 'ClinicalDocument/body/Allergie/author' &quot;code&quot;;\n                      } &quot;coding&quot;;\n                    } &quot;meta&quot;;\n                    assignedAuthor.id as id -&gt; practitioner.identifier as identifier then {\n                      id.root as r -&gt; identifier.system = translate(r, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri') &quot;root1&quot;;\n                      id.extension as ext -&gt; identifier.value = ext;\n                      id.assigningAuthorityName as s -&gt;  identifier.assigner as a,  a.display = s;\n                      id.root as r then {\n                        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);\n                      } &quot;r&quot;;\n                    } &quot;identifier&quot;;\n                    assignedAuthor.id as id where (root = '2.16.840.1.113883.2.9.4.3.2') then {\n                      id.extension as ext -&gt; request.url = append('Practitioner?identifier=', ext) &quot;UUID&quot;;\n                    } &quot;2&quot;;\n                    assignedAuthor.assignedPerson as person then {\n                      person.name -&gt; practitioner.name;\n                    };\n                  } &quot;assighedAuthor&quot;;\n                };\n              } &quot;cdaText1&quot;;\n              actallint.entryRelationship as entryact then {\n                entryact.observation as entryobs then {\n                  entryobs.value as code then {\n                    code.code as code1 -&gt; allergy.type = translate(code1, '#AllergyTypeMap', 'code') &quot;type&quot;;\n                    code.code as code2 -&gt; allergy.category = translate(code2, '#AllergyCategoryMap', 'code') &quot;category&quot;;\n                  } &quot;code&quot;;\n                  entryobs.participant as partic then {\n                    partic.participantRole as pratRole then {\n                      pratRole.playingEntity as pratent then {\n                        pratent -&gt; allergy.reaction = create('BackboneElement') as reaction then {\n                          pratent.code -&gt; reaction.substance &quot;subs&quot;;\n                          entryobs.entryRelationship as entryobs1 where (typeCode = 'MFST') then {\n                            entryobs1.observation as entobs then {\n                              entobs.effectiveTime as eff then {\n                                eff.low as l -&gt; reaction.onset = create('dateTime') as value then TSDateTime(l, value);\n                              } &quot;eff&quot;;\n                              entobs.value -&gt; reaction.manifestation &quot;manifest&quot;;\n                            } &quot;entryobservation&quot;;\n                          };\n                        } &quot;reaction&quot;;\n                      };\n                    };\n                  };\n                  entryobs.entryRelationship as entryobs2 then {\n                    entryobs2.observation as entobs then {\n                      entobs.code as code where (code = 'SEV') then {\n                        entobs.value as value then {\n                          value.code where (value.code = 'M') -&gt; allergy.criticality = 'unable-to-assess' &quot;active&quot;;\n                          value.code where (value.code = 'L') -&gt; allergy.criticality = 'low' &quot;active&quot;;\n                          value.code where (value.code = 'H') -&gt; allergy.criticality = 'high' &quot;active&quot;;\n                        };\n                      } &quot;severity&quot;;\n                    } &quot;entryobservation2&quot;;\n                  } &quot;entryrelationship2&quot;;\n                  entryobs.entryRelationship as entryobs3 then {\n                    entryobs3.observation as entobs then {\n                      entobs.code as code where (code = '33999-4') then {\n                        // entobs.value-&gt;allergy.clinicalStatus &quot;cstatus&quot;;\n                        entobs -&gt; allergy.clinicalStatus = create('CodeableConcept') as status then {\n                          entobs -&gt; status.coding = create('Coding') as coding then {\n                            entobs.value as value then {\n                              value.code where (value.code = 'LA16666-2') -&gt; coding.code = 'active' &quot;active&quot;;\n                              value.code where (value.code = 'LA18632-2') -&gt; coding.code = 'inactive' &quot;active&quot;;\n                              value.codeSystem as system -&gt; coding.system = 'http://terminology.hl7.org/CodeSystem/allergyintolerance-clinical' &quot;system&quot;;\n                              // value-&gt;coding.version='ConditionClinicalStatusCodes 4.0.1'&quot;version&quot;;\n                              value.displayName as display -&gt; coding.display = cast(display, 'string');\n                            } &quot;value1&quot;;\n                          } &quot;coding&quot;;\n                        } &quot;clinicalStatus&quot;;\n                      } &quot;33999-4&quot;;\n                    } &quot;entryobservation3&quot;;\n                  } &quot;entryrelationship3&quot;;\n                  entryobs.entryRelationship as entryobs4 then {\n                    entryobs4.act as entact then {\n                      entact.text as actext then {\n                        actext.reference as reftxt -&gt; allergy.note = create('BackboneElement') as note then {\n                          reftxt as ref -&gt; note.text = (ref.value) &quot;notxt&quot;;\n                        } &quot;notetxt&quot;;\n                      } &quot;txtact&quot;;\n                    } &quot;entryact1&quot;;\n                  } &quot;entryrelationshi4&quot;;\n                } &quot;entryobservation&quot;;\n              } &quot;entryrelationshipact&quot;;\n            } &quot;entryact2&quot;;\n          } &quot;allergy&quot;;\n        } &quot;condizioneallergie&quot;;\n        // 5. Problemi aperti\n        sottosection.code where (code = '11450-4') -&gt; section.code;\n        sottosection.code as code1 where (code = '11450-4') then {\n          sottosection.title as t -&gt; section.title = (t.dataString);\n          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 {\n            cdaText -&gt;  condition.subject = create('Reference') as reference,  reference.reference = ('https://example/Patient/' + %patient.id) &quot;reference&quot;;\n            cdaText -&gt;  condition.encounter = create('Reference') as reference,  reference.reference = ('https://example/Encounter/' + %enc.id) &quot;reference&quot;;\n            sottosection.code -&gt; condition.code;\n            cdaText -&gt; condition.note as note then {\n              cdaText as t -&gt; note.text = t &quot;reference&quot;;\n              sottosection.author as authors then {\n                authors.time as time -&gt; note.time = create('dateTime') as value then TSDateTime(time, value) &quot;timeAuthor&quot;;\n                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 {\n                  assignedAuthor -&gt; practitioner.meta as meta then {\n                    assignedAuthor -&gt; meta.tag = create('Coding') as coding then {\n                      assignedAuthor -&gt; coding.system = 'http://algoritmodiscoring' &quot;system&quot;;\n                      assignedAuthor -&gt; coding.code = 'ClinicalDocument/body/ProblemiAperti/author' &quot;code&quot;;\n                    } &quot;coding&quot;;\n                  } &quot;meta&quot;;\n                  assignedAuthor.id as id -&gt; practitioner.identifier as identifier then {\n                    id.root as r -&gt; identifier.system = translate(r, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri') &quot;root1&quot;;\n                    id.extension as ext -&gt; identifier.value = ext;\n                    id.assigningAuthorityName as s -&gt;  identifier.assigner as a,  a.display = s;\n                    id.root as r then {\n                      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;;\n                    } &quot;r&quot;;\n                  } &quot;identifier&quot;;\n                  assignedAuthor.id as id where (root = '2.16.840.1.113883.2.9.4.3.2') then {\n                    id.extension as ext -&gt; request.url = append('Practitioner?identifier=', ext) &quot;UUID&quot;;\n                  } &quot;2&quot;;\n                  assignedAuthor.assignedPerson as person then {\n                    person.name -&gt; practitioner.name;\n                  };\n                } &quot;assighedAuthor&quot;;\n              };\n            } &quot;reference&quot;;\n          } &quot;cdaText&quot;;\n        } &quot;condizioneproblemiaperti&quot;;\n      } &quot;Sectionfhir&quot;;\n    } &quot;Sottosection&quot;;\n  };\n}\n\n// ______2._____________ClinicalStatements________________________\ngroup Act(source cda : Act, target pat : Patient, target enc : Encounter, target bundle : Bundle) {\n  cda.code as code -&gt; enc.extension as extension2 then modeOfArrival(code, extension2);\n  cda.participant as participant then {\n    participant -&gt; enc.participant as FhirParticipant then {\n      participant as p -&gt; FhirParticipant.type as type then {\n        p -&gt; type.coding as coding then {\n          p -&gt; coding.code = (p.typeCode) &quot;codice&quot;;\n          p -&gt; coding.system = 'http://terminology.hl7.org/CodeSystem/v3-ParticipationType' &quot;system&quot;;\n        } &quot;codeType&quot;;\n      } &quot;type&quot;;\n    } &quot;fhirParticipant&quot;;\n    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 {\n      participantRole.code -&gt; practitionerRole.code;\n    } &quot;participantrole&quot;;\n  };\n}\n\n// ______3._____________Extensions_DtType________________________\ngroup modeOfArrival(source src : CE, target ext : Extension) {\n  src -&gt; ext.url = 'http://hl7.org/fhir/StructureDefinition/encounter-modeOfArrival' &quot;url&quot;;\n  src -&gt; ext.value = create('Coding') as code1 then coding(src, code1) &quot;coding&quot;;\n}\n\ngroup coding(source src : CE, target tgt : Coding) {\n  src.code as code -&gt; tgt.code = cast(code, 'string');\n  src.codeSystem as system -&gt; tgt.system = translate(system, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri');\n  src.displayName as display -&gt; tgt.display = cast(display, 'string');\n  src.codeSystemVersion as version -&gt; tgt.version = cast(version, 'string');\n}\n\ngroup periodTiming(source effectiveTime : PIVL_TS, target timing : Timing) {\n  effectiveTime -&gt; timing.repeat as r then {\n    effectiveTime.period as p -&gt; r.period = (p.value);\n    effectiveTime.period as p -&gt; r.periodUnit = (p.unit);\n  } &quot;repeat&quot;;\n}\n\n</pre>\n      </div>"
  },
  "url" : "http://hl7.it/fhir/cda2fhir/StructureMap/cda2fhirEdReport",
  "version" : "0.1.0",
  "name" : "cda2fhirEdReport",
  "status" : "draft",
  "date" : "2024-04-11T15:38:19+02:00",
  "publisher" : "HL7 Italy",
  "contact" : [
    {
      "name" : "HL7 Italy",
      "telecom" : [
        {
          "system" : "url",
          "value" : "http://hl7.it"
        }
      ]
    }
  ],
  "jurisdiction" : [
    {
      "coding" : [
        {
          "system" : "urn:iso:std:iso:3166",
          "code" : "IT",
          "display" : "Italy"
        }
      ]
    }
  ],
  "structure" : [
    {
      "url" : "http://hl7.org/fhir/cda/StructureDefinition/ClinicalDocument",
      "mode" : "source",
      "alias" : "ClinicalDocument"
    },
    {
      "url" : "http://hl7.org/fhir/cda/StructureDefinition/AssignedAuthor",
      "mode" : "queried",
      "alias" : "AssignedAuthor"
    },
    {
      "url" : "http://hl7.org/fhir/cda/StructureDefinition/AssignedEntity",
      "mode" : "queried",
      "alias" : "AssignedEntity"
    },
    {
      "url" : "http://hl7.org/fhir/cda/StructureDefinition/AssociatedEntity",
      "mode" : "queried",
      "alias" : "AssociatedEntity"
    },
    {
      "url" : "http://hl7.org/fhir/cda/StructureDefinition/CustodianOrganization",
      "mode" : "queried",
      "alias" : "CustodianOrganization"
    },
    {
      "url" : "http://hl7.org/fhir/cda/StructureDefinition/OrganizationPartOf",
      "mode" : "queried",
      "alias" : "OrganizationPartOf"
    },
    {
      "url" : "http://hl7.org/fhir/cda/StructureDefinition/Organization",
      "mode" : "queried",
      "alias" : "rapresentedOrganization"
    },
    {
      "url" : "http://hl7.org/fhir/cda/StructureDefinition/Section",
      "mode" : "queried",
      "alias" : "Section"
    },
    {
      "url" : "http://hl7.org/fhir/cda/StructureDefinition/PatientRole",
      "mode" : "queried",
      "alias" : "PatientRole"
    },
    {
      "url" : "http://hl7.org/fhir/cda/StructureDefinition/AD",
      "mode" : "source",
      "alias" : "AD"
    },
    {
      "url" : "http://hl7.org/fhir/StructureDefinition/Bundle",
      "mode" : "target",
      "alias" : "Bundle"
    },
    {
      "url" : "http://hl7.org/fhir/StructureDefinition/Composition",
      "mode" : "produced",
      "alias" : "Composition"
    },
    {
      "url" : "http://hl7.org/fhir/StructureDefinition/Patient",
      "mode" : "produced",
      "alias" : "Patient"
    },
    {
      "url" : "http://hl7.org/fhir/StructureDefinition/Encounter",
      "mode" : "produced",
      "alias" : "Encounter"
    },
    {
      "url" : "http://hl7.org/fhir/StructureDefinition/Person",
      "mode" : "produced",
      "alias" : "Patient"
    },
    {
      "url" : "http://hl7.org/fhir/StructureDefinition/Practitioner",
      "mode" : "produced",
      "alias" : "Practitioner"
    },
    {
      "url" : "http://hl7.org/fhir/StructureDefinition/Organization",
      "mode" : "produced",
      "alias" : "Organization"
    },
    {
      "url" : "http://hl7.org/fhir/cda/StructureDefinition/Act",
      "mode" : "produced",
      "alias" : "Act"
    },
    {
      "url" : "http://hl7.org/fhir/cda/StructureDefinition/IVL-PQ",
      "mode" : "source",
      "alias" : "IVL_PQ"
    },
    {
      "url" : "http://hl7.org/fhir/cda/StructureDefinition/IVL-TS",
      "mode" : "source"
    },
    {
      "url" : "http://hl7.org/fhir/cda/StructureDefinition/PQ",
      "mode" : "source",
      "alias" : "PQ"
    },
    {
      "url" : "http://hl7.org/fhir/StructureDefinition/SimpleQuantity",
      "mode" : "target",
      "alias" : "SimpleQuantity"
    }
  ],
  "import" : [
    🔗 "http://hl7.it/fhir/cda2fhir/StructureMap/cda2fhirDataTypes"🔗 ,
    "http://hl7.it/fhir/cda2fhir/StructureMap/cda2fhirHeader"
  ],
  "group" : [
    {
      "name" : "CdaToBundle",
      "typeMode" : "none",
      "documentation" : "--------------------------------------------------------------------------------------------",
      "input" : [
        {
          "name" : "cda",
          "type" : "ClinicalDocument",
          "mode" : "source"
        },
        {
          "name" : "bundle",
          "type" : "Bundle",
          "mode" : "target"
        }
      ],
      "rule" : [
        {
          "name" : "ClinicalDocumentToBody",
          "source" : [
            {
              "context" : "cda"
            }
          ],
          "target" : [
            {
              "context" : "bundle",
              "contextType" : "variable",
              "element" : "entry",
              "variable" : "e"
            },
            {
              "context" : "e",
              "contextType" : "variable",
              "element" : "request",
              "variable" : "request",
              "transform" : "create",
              "parameter" : [
                {
                  "valueString" : "BackboneElement"
                }
              ]
            },
            {
              "context" : "request",
              "contextType" : "variable",
              "element" : "method",
              "transform" : "copy",
              "parameter" : [
                {
                  "valueString" : "POST"
                }
              ]
            },
            {
              "context" : "e",
              "contextType" : "variable",
              "element" : "resource",
              "variable" : "composition",
              "transform" : "create",
              "parameter" : [
                {
                  "valueString" : "Composition"
                }
              ]
            },
            {
              "context" : "composition",
              "contextType" : "variable",
              "element" : "id",
              "variable" : "uuid1",
              "transform" : "uuid"
            },
            {
              "context" : "e",
              "contextType" : "variable",
              "element" : "fullUrl",
              "transform" : "append",
              "parameter" : [
                {
                  "valueString" : "https://example/Composition/"
                },
                {
                  "valueId" : "uuid1"
                }
              ]
            },
            {
              "context" : "request",
              "contextType" : "variable",
              "element" : "url",
              "transform" : "copy",
              "parameter" : [
                {
                  "valueString" : "Composition"
                }
              ]
            },
            {
              "context" : "bundle",
              "contextType" : "variable",
              "element" : "entry",
              "variable" : "e2"
            },
            {
              "context" : "e2",
              "contextType" : "variable",
              "element" : "request",
              "variable" : "requestPAT",
              "transform" : "create",
              "parameter" : [
                {
                  "valueString" : "BackboneElement"
                }
              ]
            },
            {
              "context" : "requestPAT",
              "contextType" : "variable",
              "element" : "method",
              "transform" : "copy",
              "parameter" : [
                {
                  "valueString" : "PUT"
                }
              ]
            },
            {
              "context" : "e2",
              "contextType" : "variable",
              "element" : "resource",
              "variable" : "patient",
              "transform" : "create",
              "parameter" : [
                {
                  "valueString" : "Patient"
                }
              ]
            },
            {
              "context" : "patient",
              "contextType" : "variable",
              "element" : "id",
              "variable" : "uuid2",
              "transform" : "uuid"
            },
            {
              "context" : "e2",
              "contextType" : "variable",
              "element" : "fullUrl",
              "transform" : "append",
              "parameter" : [
                {
                  "valueString" : "https://example/Patient/"
                },
                {
                  "valueId" : "uuid2"
                }
              ]
            },
            {
              "context" : "bundle",
              "contextType" : "variable",
              "element" : "entry",
              "variable" : "e3"
            },
            {
              "context" : "e3",
              "contextType" : "variable",
              "element" : "request",
              "variable" : "request",
              "transform" : "create",
              "parameter" : [
                {
                  "valueString" : "BackboneElement"
                }
              ]
            },
            {
              "context" : "request",
              "contextType" : "variable",
              "element" : "method",
              "transform" : "copy",
              "parameter" : [
                {
                  "valueString" : "POST"
                }
              ]
            },
            {
              "context" : "e3",
              "contextType" : "variable",
              "element" : "resource",
              "variable" : "encounter",
              "transform" : "create",
              "parameter" : [
                {
                  "valueString" : "Encounter"
                }
              ]
            },
            {
              "context" : "encounter",
              "contextType" : "variable",
              "element" : "id",
              "variable" : "uuid3",
              "transform" : "uuid"
            },
            {
              "context" : "e3",
              "contextType" : "variable",
              "element" : "fullUrl",
              "transform" : "append",
              "parameter" : [
                {
                  "valueString" : "https://example/Encounter/"
                },
                {
                  "valueId" : "uuid3"
                }
              ]
            },
            {
              "context" : "request",
              "contextType" : "variable",
              "element" : "url",
              "transform" : "copy",
              "parameter" : [
                {
                  "valueString" : "Encounter"
                }
              ]
            },
            {
              "context" : "bundle",
              "contextType" : "variable",
              "element" : "entry",
              "variable" : "e6"
            },
            {
              "context" : "e6",
              "contextType" : "variable",
              "element" : "request",
              "variable" : "request",
              "transform" : "create",
              "parameter" : [
                {
                  "valueString" : "BackboneElement"
                }
              ]
            },
            {
              "context" : "request",
              "contextType" : "variable",
              "element" : "method",
              "transform" : "copy",
              "parameter" : [
                {
                  "valueString" : "POST"
                }
              ]
            },
            {
              "context" : "e6",
              "contextType" : "variable",
              "element" : "resource",
              "variable" : "DocumentReference",
              "transform" : "create",
              "parameter" : [
                {
                  "valueString" : "DocumentReference"
                }
              ]
            },
            {
              "context" : "DocumentReference",
              "contextType" : "variable",
              "element" : "id",
              "variable" : "uuid6",
              "transform" : "uuid"
            },
            {
              "context" : "e6",
              "contextType" : "variable",
              "element" : "fullUrl",
              "transform" : "append",
              "parameter" : [
                {
                  "valueString" : "https://example/DocumentReference/"
                },
                {
                  "valueId" : "uuid6"
                }
              ]
            },
            {
              "context" : "request",
              "contextType" : "variable",
              "element" : "url",
              "transform" : "copy",
              "parameter" : [
                {
                  "valueString" : "DocumentReference"
                }
              ]
            }
          ],
          "rule" : [
            {
              "name" : "cdatobundle",
              "source" : [
                {
                  "context" : "cda"
                }
              ],
              "dependent" : [
                {
                  "name" : "ClinicalDocumentToBundle",
                  "variable" : [
                    "cda",
                    "patient",
                    "composition",
                    "encounter",
                    "bundle",
                    "DocumentReference"
                  ]
                }
              ]
            },
            {
              "name" : "recPat",
              "source" : [
                {
                  "context" : "cda",
                  "element" : "recordTarget",
                  "variable" : "recordTarget"
                }
              ],
              "rule" : [
                {
                  "name" : "record",
                  "source" : [
                    {
                      "context" : "recordTarget",
                      "element" : "patientRole",
                      "variable" : "patient"
                    }
                  ],
                  "rule" : [
                    {
                      "name" : "idfr",
                      "source" : [
                        {
                          "context" : "patient",
                          "element" : "id",
                          "variable" : "id"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "patient",
                          "contextType" : "variable",
                          "element" : "identifier",
                          "variable" : "identifier"
                        }
                      ],
                      "rule" : [
                        {
                          "name" : "root1",
                          "source" : [
                            {
                              "context" : "id",
                              "element" : "root",
                              "variable" : "r"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "identifier",
                              "contextType" : "variable",
                              "element" : "system",
                              "transform" : "translate",
                              "parameter" : [
                                {
                                  "valueId" : "r"
                                },
                                {
                                  "valueString" : "http://hl7.org/fhir/ConceptMap/special-oid2uri"
                                },
                                {
                                  "valueString" : "uri"
                                }
                              ]
                            }
                          ]
                        },
                        {
                          "name" : "value",
                          "source" : [
                            {
                              "context" : "id",
                              "element" : "extension",
                              "variable" : "ext1"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "identifier",
                              "contextType" : "variable",
                              "element" : "value",
                              "transform" : "copy",
                              "parameter" : [
                                {
                                  "valueId" : "ext1"
                                }
                              ]
                            }
                          ]
                        },
                        {
                          "name" : "assigningAuthorityName",
                          "source" : [
                            {
                              "context" : "id",
                              "element" : "assigningAuthorityName",
                              "variable" : "s"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "identifier",
                              "contextType" : "variable",
                              "element" : "assigner",
                              "variable" : "a"
                            },
                            {
                              "context" : "a",
                              "contextType" : "variable",
                              "element" : "display",
                              "transform" : "copy",
                              "parameter" : [
                                {
                                  "valueId" : "s"
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "name" : "ext",
                      "source" : [
                        {
                          "context" : "patient",
                          "element" : "id",
                          "variable" : "id",
                          "condition" : "(root = '2.16.840.1.113883.2.9.4.3.2') or (root = '2.16.840.1.113883.2.9.4.3.7') or (root = '2.16.840.1.113883.2.9.4.3.3') or (root = '2.16.840.1.113883.2.9.4.3.17') or (root = '2.16.840.1.113883.2.9.4.3.18') or (root = '2.16.840.1.113883.2.9.2.10.4.1.1') or (root = '2.16.840.1.113883.2.9.2.20.4.1.1') or (root = '2.16.840.1.113883.2.9.2.30.4.1.1') or (root = '2.16.840.1.113883.2.9.2.41.4.1.1') or (root = '2.16.840.1.113883.2.9.2.42.4.1.1') or (root = '2.16.840.1.113883.2.9.2.50.4.1.1') or (root = '2.16.840.1.113883.2.9.2.60.4.1.1') or (root = '2.16.840.1.113883.2.9.2.70.4.1.1') or (root = '2.16.840.1.113883.2.9.2.80.4.1.1') or (root = '2.16.840.1.113883.2.9.2.90.4.1.1') or (root = '2.16.840.1.113883.2.9.2.100.4.1.1') or (root = '2.16.840.1.113883.2.9.2.110.4.1.1') or (root = '2.16.840.1.113883.2.9.2.120.4.1.1') or (root = '2.16.840.1.113883.2.9.2.130.4.1.1') or (root = '2.16.840.1.113883.2.9.2.140.4.1.1') or (root = '2.16.840.1.113883.2.9.2.150.4.1.1') or (root = '2.16.840.1.113883.2.9.2.160.4.1.1') or (root = '2.16.840.1.113883.2.9.2.170.4.1.1') or (root = '2.16.840.1.113883.2.9.2.180.4.1.1') or (root = '2.16.840.1.113883.2.9.2.190.4.1.1') or (root = '2.16.840.1.113883.2.9.2.200.4.1.1') or (root = '2.16.840.1.113883.2.9.2.10.4.1') or (root = '2.16.840.1.113883.2.9.2.20.4.1') or (root = '2.16.840.1.113883.2.9.2.30.4.1') or (root = '2.16.840.1.113883.2.9.2.41.4.1') or (root = '2.16.840.1.113883.2.9.2.42.4.1') or (root = '2.16.840.1.113883.2.9.2.50.4.1') or (root = '2.16.840.1.113883.2.9.2.60.4.1') or (root = '2.16.840.1.113883.2.9.2.70.4.1') or (root = '2.16.840.1.113883.2.9.2.80.4.1') or (root = '2.16.840.1.113883.2.9.2.90.4.1') or (root = '2.16.840.1.113883.2.9.2.100.4.1') or (root = '2.16.840.1.113883.2.9.2.110.4.1') or (root = '2.16.840.1.113883.2.9.2.120.4.1') or (root = '2.16.840.1.113883.2.9.2.130.4.1') or (root = '2.16.840.1.113883.2.9.2.140.4.1') or (root = '2.16.840.1.113883.2.9.2.150.4.1') or (root = '2.16.840.1.113883.2.9.2.160.4.1') or (root = '2.16.840.1.113883.2.9.2.170.4.1') or (root = '2.16.840.1.113883.2.9.2.180.4.1') or (root = '2.16.840.1.113883.2.9.2.190.4.1') or (root = '2.16.840.1.113883.2.9.2.200.4.1') or (root = '2.16.840.1.113883.2.9.4.3.15')"
                        }
                      ],
                      "rule" : [
                        {
                          "name" : "UUID",
                          "source" : [
                            {
                              "context" : "id",
                              "element" : "extension",
                              "variable" : "ext"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "requestPAT",
                              "contextType" : "variable",
                              "element" : "url",
                              "transform" : "append",
                              "parameter" : [
                                {
                                  "valueString" : "Patient?identifier="
                                },
                                {
                                  "valueId" : "ext"
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ]
        }
      ]
    },
    {
      "name" : "ClinicalDocumentToBundle",
      "typeMode" : "none",
      "input" : [
        {
          "name" : "cda",
          "type" : "ClinicalDocument",
          "mode" : "source"
        },
        {
          "name" : "patient",
          "type" : "Patient",
          "mode" : "target"
        },
        {
          "name" : "composition",
          "type" : "Composition",
          "mode" : "target"
        },
        {
          "name" : "encounter",
          "type" : "Encounter",
          "mode" : "target"
        },
        {
          "name" : "bundle",
          "type" : "Bundle",
          "mode" : "target"
        },
        {
          "name" : "documentreference",
          "type" : "DocumentReference",
          "mode" : "target"
        }
      ],
      "rule" : [
        {
          "name" : "id",
          "source" : [
            {
              "context" : "cda"
            }
          ],
          "target" : [
            {
              "context" : "bundle",
              "contextType" : "variable",
              "element" : "id",
              "transform" : "uuid"
            }
          ]
        },
        {
          "name" : "identifier",
          "source" : [
            {
              "context" : "cda",
              "element" : "id",
              "variable" : "vvv"
            }
          ],
          "target" : [
            {
              "context" : "bundle",
              "contextType" : "variable",
              "element" : "identifier",
              "variable" : "vvv",
              "transform" : "create"
            }
          ]
        },
        {
          "name" : "type",
          "source" : [
            {
              "context" : "cda"
            }
          ],
          "target" : [
            {
              "context" : "bundle",
              "contextType" : "variable",
              "element" : "type",
              "transform" : "copy",
              "parameter" : [
                {
                  "valueString" : "transaction"
                }
              ]
            }
          ]
        },
        {
          "name" : "date",
          "source" : [
            {
              "context" : "cda"
            }
          ],
          "target" : [
            {
              "context" : "bundle",
              "contextType" : "variable",
              "element" : "timestamp",
              "transform" : "evaluate",
              "parameter" : [
                {
                  "valueString" : "timestamp.now()"
                }
              ]
            }
          ]
        },
        {
          "name" : "composition",
          "source" : [
            {
              "context" : "cda"
            }
          ],
          "dependent" : [
            {
              "name" : "ClinicalDocumentComposition",
              "variable" : [
                "cda",
                "composition",
                "patient",
                "encounter",
                "bundle",
                "documentreference"
              ]
            }
          ]
        },
        {
          "name" : "component",
          "source" : [
            {
              "context" : "cda",
              "element" : "component",
              "variable" : "component"
            }
          ],
          "rule" : [
            {
              "name" : "body",
              "source" : [
                {
                  "context" : "component",
                  "element" : "structuredBody",
                  "variable" : "body"
                }
              ],
              "rule" : [
                {
                  "name" : "component",
                  "source" : [
                    {
                      "context" : "body",
                      "element" : "component",
                      "variable" : "component"
                    }
                  ],
                  "rule" : [
                    {
                      "name" : "section",
                      "source" : [
                        {
                          "context" : "component",
                          "element" : "section",
                          "variable" : "srcSection"
                        }
                      ],
                      "rule" : [
                        {
                          "name" : "Modalitaditrasporto",
                          "source" : [
                            {
                              "context" : "srcSection",
                              "element" : "code",
                              "condition" : "(code = '11459-5')"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "composition",
                              "contextType" : "variable",
                              "element" : "section",
                              "variable" : "tgtSection"
                            }
                          ],
                          "dependent" : [
                            {
                              "name" : "ModalitadiTrasposto",
                              "variable" : [
                                "cda",
                                "srcSection",
                                "patient",
                                "tgtSection",
                                "bundle",
                                "encounter"
                              ]
                            }
                          ]
                        },
                        {
                          "name" : "Inquadramentoclinico",
                          "source" : [
                            {
                              "context" : "srcSection",
                              "element" : "code",
                              "condition" : "(code = '78337-3')"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "composition",
                              "contextType" : "variable",
                              "element" : "section",
                              "variable" : "tgtSection"
                            }
                          ],
                          "dependent" : [
                            {
                              "name" : "InquadramentoClinicoIniziale",
                              "variable" : [
                                "cda",
                                "srcSection",
                                "patient",
                                "tgtSection",
                                "bundle",
                                "encounter"
                              ]
                            }
                          ]
                        },
                        {
                          "name" : "Inquadramentoclinico",
                          "source" : [
                            {
                              "context" : "srcSection",
                              "element" : "code",
                              "condition" : "(code = '46239-0')"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "composition",
                              "contextType" : "variable",
                              "element" : "section",
                              "variable" : "tgtSection"
                            }
                          ],
                          "dependent" : [
                            {
                              "name" : "MotivoDellaVisita",
                              "variable" : [
                                "cda",
                                "srcSection",
                                "patient",
                                "tgtSection",
                                "bundle",
                                "encounter"
                              ]
                            }
                          ]
                        },
                        {
                          "name" : "Triage",
                          "source" : [
                            {
                              "context" : "srcSection",
                              "element" : "code",
                              "condition" : "(code = '54094-8')"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "composition",
                              "contextType" : "variable",
                              "element" : "section",
                              "variable" : "tgtSection"
                            }
                          ],
                          "dependent" : [
                            {
                              "name" : "Triage",
                              "variable" : [
                                "cda",
                                "srcSection",
                                "patient",
                                "tgtSection",
                                "bundle",
                                "encounter"
                              ]
                            }
                          ]
                        },
                        {
                          "name" : "motivoricovero",
                          "source" : [
                            {
                              "context" : "srcSection",
                              "element" : "code",
                              "condition" : "(code = '46240-8')"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "composition",
                              "contextType" : "variable",
                              "element" : "section",
                              "variable" : "tgtSection"
                            }
                          ],
                          "dependent" : [
                            {
                              "name" : "ClinicalDocumentSectionEncounter",
                              "variable" : [
                                "cda",
                                "srcSection",
                                "patient",
                                "tgtSection",
                                "bundle",
                                "encounter"
                              ]
                            }
                          ]
                        },
                        {
                          "name" : "DecorsoOspedaliero",
                          "source" : [
                            {
                              "context" : "srcSection",
                              "element" : "code",
                              "condition" : "(code = '8648-8')"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "composition",
                              "contextType" : "variable",
                              "element" : "section",
                              "variable" : "tgtSection"
                            }
                          ],
                          "dependent" : [
                            {
                              "name" : "ClinicalDocumentSectionDecorsoOspedaliero",
                              "variable" : [
                                "cda",
                                "srcSection",
                                "patient",
                                "tgtSection",
                                "bundle",
                                "encounter"
                              ]
                            }
                          ]
                        },
                        {
                          "name" : "Complicazioni",
                          "source" : [
                            {
                              "context" : "srcSection",
                              "element" : "code",
                              "condition" : "(code = '55109-3')"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "composition",
                              "contextType" : "variable",
                              "element" : "section",
                              "variable" : "tgtSection"
                            }
                          ],
                          "dependent" : [
                            {
                              "name" : "ClinicalDocumentSectionComplicanze",
                              "variable" : [
                                "cda",
                                "srcSection",
                                "patient",
                                "tgtSection",
                                "bundle",
                                "encounter"
                              ]
                            }
                          ]
                        },
                        {
                          "name" : "Hospitaldischargestudiessummary",
                          "source" : [
                            {
                              "context" : "srcSection",
                              "element" : "code",
                              "condition" : "(code = '62387-6')"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "composition",
                              "contextType" : "variable",
                              "element" : "section",
                              "variable" : "tgtSection"
                            }
                          ],
                          "dependent" : [
                            {
                              "name" : "ClinicalDocumentSectionConsulenza",
                              "variable" : [
                                "cda",
                                "srcSection",
                                "patient",
                                "tgtSection",
                                "bundle",
                                "encounter"
                              ]
                            }
                          ]
                        },
                        {
                          "name" : "Accertamenti",
                          "source" : [
                            {
                              "context" : "srcSection",
                              "element" : "code",
                              "condition" : "(code = '30954-2')"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "composition",
                              "contextType" : "variable",
                              "element" : "section",
                              "variable" : "tgtSection"
                            }
                          ],
                          "dependent" : [
                            {
                              "name" : "ClinicalDocumentSectionAccertamenti",
                              "variable" : [
                                "cda",
                                "srcSection",
                                "patient",
                                "tgtSection",
                                "bundle",
                                "encounter"
                              ]
                            }
                          ]
                        },
                        {
                          "name" : "Accertamenti",
                          "source" : [
                            {
                              "context" : "srcSection",
                              "element" : "code",
                              "condition" : "(code = '8716-3')"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "composition",
                              "contextType" : "variable",
                              "element" : "section",
                              "variable" : "tgtSection"
                            }
                          ],
                          "dependent" : [
                            {
                              "name" : "ClinicalDocumentSectionParametriVitali",
                              "variable" : [
                                "cda",
                                "srcSection",
                                "patient",
                                "tgtSection",
                                "bundle",
                                "encounter"
                              ]
                            }
                          ]
                        },
                        {
                          "name" : "Accertamenti",
                          "source" : [
                            {
                              "context" : "srcSection",
                              "element" : "code",
                              "condition" : "(code = '29549-3')"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "composition",
                              "contextType" : "variable",
                              "element" : "section",
                              "variable" : "tgtSection"
                            }
                          ],
                          "dependent" : [
                            {
                              "name" : "ClinicalDocumentSectionTerapiaFarmacoInPronto",
                              "variable" : [
                                "cda",
                                "srcSection",
                                "patient",
                                "tgtSection",
                                "bundle",
                                "encounter"
                              ]
                            }
                          ]
                        },
                        {
                          "name" : "Pianodicuraalladimissione",
                          "source" : [
                            {
                              "context" : "srcSection",
                              "element" : "code",
                              "condition" : "(code = '18776-5')"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "composition",
                              "contextType" : "variable",
                              "element" : "section",
                              "variable" : "tgtSection"
                            }
                          ],
                          "dependent" : [
                            {
                              "name" : "ClinicalDocumentSectionPianoCuraDimissione",
                              "variable" : [
                                "cda",
                                "srcSection",
                                "patient",
                                "tgtSection",
                                "bundle",
                                "encounter"
                              ]
                            }
                          ]
                        },
                        {
                          "name" : "Dimissione",
                          "source" : [
                            {
                              "context" : "srcSection",
                              "element" : "code",
                              "condition" : "(code = '28574-2')"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "composition",
                              "contextType" : "variable",
                              "element" : "section",
                              "variable" : "tgtSection"
                            }
                          ],
                          "dependent" : [
                            {
                              "name" : "ClinicalDocumentSectionDimissione",
                              "variable" : [
                                "cda",
                                "srcSection",
                                "patient",
                                "tgtSection",
                                "bundle",
                                "encounter"
                              ]
                            }
                          ]
                        },
                        {
                          "name" : "TerapiaFarmacologicaDimissione",
                          "source" : [
                            {
                              "context" : "srcSection",
                              "element" : "code",
                              "condition" : "(code = '75311-1')"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "composition",
                              "contextType" : "variable",
                              "element" : "section",
                              "variable" : "tgtSection"
                            }
                          ],
                          "dependent" : [
                            {
                              "name" : "ClinicalDocumentSectionTerapiaFarmacologicaDimissione",
                              "variable" : [
                                "cda",
                                "srcSection",
                                "patient",
                                "tgtSection",
                                "bundle",
                                "encounter"
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ]
        }
      ]
    },
    {
      "name" : "ClinicalDocumentSectionComplicanze",
      "typeMode" : "none",
      "documentation" : "Sezione complicanze--------------------------------------------------------------------------",
      "input" : [
        {
          "name" : "cda",
          "type" : "ClinicalDocument",
          "mode" : "source"
        },
        {
          "name" : "src",
          "type" : "Section",
          "mode" : "source"
        },
        {
          "name" : "patient",
          "type" : "Patient",
          "mode" : "target"
        },
        {
          "name" : "tgt",
          "mode" : "target"
        },
        {
          "name" : "bundle",
          "type" : "Bundle",
          "mode" : "target"
        },
        {
          "name" : "enc",
          "type" : "Encounter",
          "mode" : "target"
        }
      ],
      "rule" : [
        {
          "name" : "title",
          "source" : [
            {
              "context" : "src",
              "element" : "title",
              "variable" : "t"
            }
          ],
          "target" : [
            {
              "context" : "tgt",
              "contextType" : "variable",
              "element" : "title",
              "transform" : "evaluate",
              "parameter" : [
                {
                  "valueString" : "t.dataString"
                }
              ]
            }
          ]
        },
        {
          "name" : "code",
          "source" : [
            {
              "context" : "src",
              "element" : "code",
              "variable" : "vvv"
            }
          ],
          "target" : [
            {
              "context" : "tgt",
              "contextType" : "variable",
              "element" : "code",
              "variable" : "vvv",
              "transform" : "create"
            }
          ]
        },
        {
          "name" : "entryexists",
          "source" : [
            {
              "context" : "src",
              "condition" : "src.entry.exists()"
            }
          ],
          "rule" : [
            {
              "name" : "cdaText",
              "source" : [
                {
                  "context" : "src",
                  "element" : "text",
                  "variable" : "cdaText"
                }
              ],
              "target" : [
                {
                  "context" : "tgt",
                  "contextType" : "variable",
                  "element" : "text",
                  "variable" : "fhirText"
                }
              ],
              "rule" : [
                {
                  "name" : "narrativeStatus",
                  "source" : [
                    {
                      "context" : "cdaText"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "fhirText",
                      "contextType" : "variable",
                      "element" : "status",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "generated"
                        }
                      ]
                    }
                  ]
                },
                {
                  "name" : "narrativeText",
                  "source" : [
                    {
                      "context" : "cdaText",
                      "variable" : "t"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "fhirText",
                      "contextType" : "variable",
                      "element" : "div",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueId" : "t"
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ]
        },
        {
          "name" : "entry",
          "source" : [
            {
              "context" : "src",
              "element" : "entry",
              "variable" : "entry1"
            }
          ],
          "target" : [
            {
              "context" : "bundle",
              "contextType" : "variable",
              "element" : "entry",
              "variable" : "e1"
            },
            {
              "context" : "e1",
              "contextType" : "variable",
              "element" : "request",
              "variable" : "request",
              "transform" : "create",
              "parameter" : [
                {
                  "valueString" : "BackboneElement"
                }
              ]
            },
            {
              "context" : "request",
              "contextType" : "variable",
              "element" : "method",
              "transform" : "copy",
              "parameter" : [
                {
                  "valueString" : "POST"
                }
              ]
            },
            {
              "context" : "e1",
              "contextType" : "variable",
              "element" : "resource",
              "variable" : "observation",
              "transform" : "create",
              "parameter" : [
                {
                  "valueString" : "Observation"
                }
              ]
            },
            {
              "context" : "observation",
              "contextType" : "variable",
              "element" : "id",
              "variable" : "uuid1",
              "transform" : "uuid"
            },
            {
              "context" : "e1",
              "contextType" : "variable",
              "element" : "fullUrl",
              "transform" : "append",
              "parameter" : [
                {
                  "valueString" : "https://example/Observation/"
                },
                {
                  "valueId" : "uuid1"
                }
              ]
            },
            {
              "context" : "request",
              "contextType" : "variable",
              "element" : "url",
              "transform" : "copy",
              "parameter" : [
                {
                  "valueString" : "Observation"
                }
              ]
            },
            {
              "context" : "tgt",
              "contextType" : "variable",
              "element" : "entry",
              "variable" : "reference",
              "transform" : "create",
              "parameter" : [
                {
                  "valueString" : "Reference"
                }
              ]
            },
            {
              "context" : "reference",
              "contextType" : "variable",
              "element" : "reference",
              "transform" : "evaluate",
              "parameter" : [
                {
                  "valueString" : "'https://example/Observation/' + %observation.id"
                }
              ]
            }
          ],
          "rule" : [
            {
              "name" : "act",
              "source" : [
                {
                  "context" : "entry1",
                  "element" : "observation",
                  "variable" : "obs"
                }
              ],
              "dependent" : [
                {
                  "name" : "Observation",
                  "variable" : [
                    "obs",
                    "patient",
                    "enc",
                    "observation",
                    "bundle"
                  ]
                }
              ]
            }
          ],
          "documentation" : "Sezione Strutturata-----------------------------------------------------------------------------------------------------------------------------------------------"
        },
        {
          "name" : "where",
          "source" : [
            {
              "context" : "src",
              "condition" : "src.entry.exists().not()"
            }
          ],
          "rule" : [
            {
              "name" : "cdaText",
              "source" : [
                {
                  "context" : "src",
                  "element" : "text",
                  "variable" : "cdaText"
                }
              ],
              "target" : [
                {
                  "context" : "bundle",
                  "contextType" : "variable",
                  "element" : "entry",
                  "variable" : "e8"
                },
                {
                  "context" : "e8",
                  "contextType" : "variable",
                  "element" : "request",
                  "variable" : "request",
                  "transform" : "create",
                  "parameter" : [
                    {
                      "valueString" : "BackboneElement"
                    }
                  ]
                },
                {
                  "context" : "request",
                  "contextType" : "variable",
                  "element" : "method",
                  "transform" : "copy",
                  "parameter" : [
                    {
                      "valueString" : "POST"
                    }
                  ]
                },
                {
                  "context" : "e8",
                  "contextType" : "variable",
                  "element" : "resource",
                  "variable" : "Observation",
                  "transform" : "create",
                  "parameter" : [
                    {
                      "valueString" : "Observation"
                    }
                  ]
                },
                {
                  "context" : "Observation",
                  "contextType" : "variable",
                  "element" : "id",
                  "variable" : "uuid8",
                  "transform" : "uuid"
                },
                {
                  "context" : "e8",
                  "contextType" : "variable",
                  "element" : "fullUrl",
                  "transform" : "append",
                  "parameter" : [
                    {
                      "valueString" : "https://example/Observation/"
                    },
                    {
                      "valueId" : "uuid8"
                    }
                  ]
                },
                {
                  "context" : "request",
                  "contextType" : "variable",
                  "element" : "url",
                  "transform" : "copy",
                  "parameter" : [
                    {
                      "valueString" : "Observation"
                    }
                  ]
                },
                {
                  "context" : "tgt",
                  "contextType" : "variable",
                  "element" : "entry",
                  "variable" : "reference",
                  "transform" : "create",
                  "parameter" : [
                    {
                      "valueString" : "Reference"
                    }
                  ]
                },
                {
                  "context" : "reference",
                  "contextType" : "variable",
                  "element" : "reference",
                  "transform" : "evaluate",
                  "parameter" : [
                    {
                      "valueString" : "'https://example/Observation/' + %Observation.id"
                    }
                  ]
                }
              ],
              "rule" : [
                {
                  "name" : "reference",
                  "source" : [
                    {
                      "context" : "src"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "Observation",
                      "contextType" : "variable",
                      "element" : "subject",
                      "variable" : "reference",
                      "transform" : "create",
                      "parameter" : [
                        {
                          "valueString" : "Reference"
                        }
                      ]
                    },
                    {
                      "context" : "reference",
                      "contextType" : "variable",
                      "element" : "reference",
                      "transform" : "evaluate",
                      "parameter" : [
                        {
                          "valueString" : "'https://example/Patient/' + %patient.id"
                        }
                      ]
                    }
                  ]
                },
                {
                  "name" : "reference",
                  "source" : [
                    {
                      "context" : "src"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "Observation",
                      "contextType" : "variable",
                      "element" : "encounter",
                      "variable" : "reference",
                      "transform" : "create",
                      "parameter" : [
                        {
                          "valueString" : "Reference"
                        }
                      ]
                    },
                    {
                      "context" : "reference",
                      "contextType" : "variable",
                      "element" : "reference",
                      "transform" : "evaluate",
                      "parameter" : [
                        {
                          "valueString" : "'https://example/Encounter/' + %enc.id"
                        }
                      ]
                    }
                  ]
                },
                {
                  "name" : "code",
                  "source" : [
                    {
                      "context" : "src",
                      "element" : "code",
                      "variable" : "vvv"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "Observation",
                      "contextType" : "variable",
                      "element" : "code",
                      "variable" : "vvv",
                      "transform" : "create"
                    }
                  ]
                },
                {
                  "name" : "statuscode",
                  "source" : [
                    {
                      "context" : "src",
                      "condition" : "observation.statusCode.exists().not()"
                    }
                  ],
                  "rule" : [
                    {
                      "name" : "status",
                      "source" : [
                        {
                          "context" : "src"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "Observation",
                          "contextType" : "variable",
                          "element" : "status",
                          "transform" : "copy",
                          "parameter" : [
                            {
                              "valueString" : "final"
                            }
                          ]
                        }
                      ]
                    }
                  ]
                },
                {
                  "name" : "reference",
                  "source" : [
                    {
                      "context" : "cdaText"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "Observation",
                      "contextType" : "variable",
                      "element" : "note",
                      "variable" : "note"
                    }
                  ],
                  "rule" : [
                    {
                      "name" : "reference",
                      "source" : [
                        {
                          "context" : "cdaText",
                          "variable" : "t"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "note",
                          "contextType" : "variable",
                          "element" : "text",
                          "transform" : "copy",
                          "parameter" : [
                            {
                              "valueId" : "t"
                            }
                          ]
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ],
          "documentation" : "Sezione Narrativa---------------------------------------------------------------------------------------------------------------------------------------------"
        }
      ]
    },
    {
      "name" : "Observation",
      "typeMode" : "none",
      "input" : [
        {
          "name" : "obs",
          "type" : "Observation",
          "mode" : "source"
        },
        {
          "name" : "patient",
          "type" : "Patient",
          "mode" : "target"
        },
        {
          "name" : "encounter",
          "type" : "Encounter",
          "mode" : "target"
        },
        {
          "name" : "ob",
          "type" : "Observation",
          "mode" : "target"
        },
        {
          "name" : "bundle",
          "type" : "Bundle",
          "mode" : "target"
        }
      ],
      "rule" : [
        {
          "name" : "reference",
          "source" : [
            {
              "context" : "obs"
            }
          ],
          "target" : [
            {
              "context" : "ob",
              "contextType" : "variable",
              "element" : "subject",
              "variable" : "reference",
              "transform" : "create",
              "parameter" : [
                {
                  "valueString" : "Reference"
                }
              ]
            },
            {
              "context" : "reference",
              "contextType" : "variable",
              "element" : "reference",
              "transform" : "evaluate",
              "parameter" : [
                {
                  "valueString" : "'https://example/Patient/' + %patient.id"
                }
              ]
            }
          ]
        },
        {
          "name" : "reference",
          "source" : [
            {
              "context" : "obs"
            }
          ],
          "target" : [
            {
              "context" : "ob",
              "contextType" : "variable",
              "element" : "encounter",
              "variable" : "reference",
              "transform" : "create",
              "parameter" : [
                {
                  "valueString" : "Reference"
                }
              ]
            },
            {
              "context" : "reference",
              "contextType" : "variable",
              "element" : "reference",
              "transform" : "evaluate",
              "parameter" : [
                {
                  "valueString" : "'https://example/Encounter/' + %encounter.id"
                }
              ]
            }
          ]
        },
        {
          "name" : "code",
          "source" : [
            {
              "context" : "obs",
              "element" : "code",
              "variable" : "vvv"
            }
          ],
          "target" : [
            {
              "context" : "ob",
              "contextType" : "variable",
              "element" : "code",
              "variable" : "vvv",
              "transform" : "create"
            }
          ]
        },
        {
          "name" : "statusCode",
          "source" : [
            {
              "context" : "obs",
              "element" : "statusCode",
              "variable" : "statusc",
              "condition" : "(code = 'completed')"
            }
          ],
          "target" : [
            {
              "context" : "ob",
              "contextType" : "variable",
              "element" : "status",
              "transform" : "copy",
              "parameter" : [
                {
                  "valueString" : "final"
                }
              ]
            }
          ]
        },
        {
          "name" : "statusCode",
          "source" : [
            {
              "context" : "obs",
              "element" : "statusCode",
              "variable" : "statusc",
              "condition" : "(code = 'active')"
            }
          ],
          "target" : [
            {
              "context" : "ob",
              "contextType" : "variable",
              "element" : "status",
              "transform" : "copy",
              "parameter" : [
                {
                  "valueString" : "registered"
                }
              ]
            }
          ]
        },
        {
          "name" : "statusCode",
          "source" : [
            {
              "context" : "obs",
              "element" : "statusCode",
              "variable" : "statusc",
              "condition" : "(code = 'aborted')"
            }
          ],
          "target" : [
            {
              "context" : "ob",
              "contextType" : "variable",
              "element" : "status",
              "transform" : "copy",
              "parameter" : [
                {
                  "valueString" : "cancelled"
                }
              ]
            }
          ]
        },
        {
          "name" : "statusCode",
          "source" : [
            {
              "context" : "obs",
              "element" : "statusCode",
              "variable" : "statusc",
              "condition" : "(code = 'suspended')"
            }
          ],
          "target" : [
            {
              "context" : "ob",
              "contextType" : "variable",
              "element" : "status",
              "transform" : "copy",
              "parameter" : [
                {
                  "valueString" : "partial"
                }
              ]
            }
          ]
        },
        {
          "name" : "statuscode",
          "source" : [
            {
              "context" : "obs",
              "condition" : "obs.statusCode.exists().not()"
            }
          ],
          "rule" : [
            {
              "name" : "status",
              "source" : [
                {
                  "context" : "obs"
                }
              ],
              "target" : [
                {
                  "context" : "ob",
                  "contextType" : "variable",
                  "element" : "status",
                  "transform" : "copy",
                  "parameter" : [
                    {
                      "valueString" : "final"
                    }
                  ]
                }
              ]
            }
          ]
        },
        {
          "name" : "value2",
          "source" : [
            {
              "context" : "obs",
              "element" : "effectiveTime",
              "variable" : "effectiveTime"
            }
          ],
          "target" : [
            {
              "context" : "ob",
              "contextType" : "variable",
              "element" : "effective",
              "variable" : "value",
              "transform" : "create",
              "parameter" : [
                {
                  "valueString" : "dateTime"
                }
              ]
            }
          ],
          "dependent" : [
            {
              "name" : "TSDateTime",
              "variable" : [
                "effectiveTime",
                "value"
              ]
            }
          ]
        },
        {
          "name" : "where",
          "source" : [
            {
              "context" : "obs",
              "condition" : "effectiveTime.low.exists() or effectiveTime.high.exists()"
            }
          ],
          "rule" : [
            {
              "name" : "effectiveTime",
              "source" : [
                {
                  "context" : "obs",
                  "element" : "effectiveTime",
                  "variable" : "eff"
                }
              ],
              "target" : [
                {
                  "context" : "ob",
                  "contextType" : "variable",
                  "element" : "effective",
                  "variable" : "period",
                  "transform" : "create",
                  "parameter" : [
                    {
                      "valueString" : "Period"
                    }
                  ]
                }
              ],
              "dependent" : [
                {
                  "name" : "IVLTSPeriod",
                  "variable" : [
                    "eff",
                    "period"
                  ]
                }
              ]
            }
          ]
        },
        {
          "name" : "value",
          "source" : [
            {
              "context" : "obs",
              "type" : "INT",
              "element" : "value",
              "variable" : "int"
            }
          ],
          "target" : [
            {
              "context" : "ob",
              "contextType" : "variable",
              "element" : "value",
              "transform" : "evaluate",
              "parameter" : [
                {
                  "valueString" : "int.value"
                }
              ]
            }
          ]
        },
        {
          "name" : "val",
          "source" : [
            {
              "context" : "obs",
              "type" : "CD",
              "element" : "value",
              "variable" : "val"
            }
          ],
          "rule" : [
            {
              "name" : "coding",
              "source" : [
                {
                  "context" : "val"
                }
              ],
              "target" : [
                {
                  "context" : "ob",
                  "contextType" : "variable",
                  "element" : "value",
                  "variable" : "ce",
                  "transform" : "create",
                  "parameter" : [
                    {
                      "valueString" : "CodeableConcept"
                    }
                  ]
                }
              ],
              "rule" : [
                {
                  "name" : "originalText",
                  "source" : [
                    {
                      "context" : "val",
                      "element" : "originalText",
                      "variable" : "vvv"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "ce",
                      "contextType" : "variable",
                      "element" : "text",
                      "variable" : "vvv",
                      "transform" : "create"
                    }
                  ]
                },
                {
                  "name" : "code",
                  "source" : [
                    {
                      "context" : "val"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "ce",
                      "contextType" : "variable",
                      "element" : "coding",
                      "variable" : "coding"
                    }
                  ],
                  "rule" : [
                    {
                      "name" : "code",
                      "source" : [
                        {
                          "context" : "val",
                          "element" : "code",
                          "variable" : "code"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "coding",
                          "contextType" : "variable",
                          "element" : "code",
                          "transform" : "cast",
                          "parameter" : [
                            {
                              "valueId" : "code"
                            },
                            {
                              "valueString" : "string"
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "name" : "codeSystem",
                      "source" : [
                        {
                          "context" : "val",
                          "element" : "codeSystem",
                          "variable" : "system"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "coding",
                          "contextType" : "variable",
                          "element" : "system",
                          "transform" : "translate",
                          "parameter" : [
                            {
                              "valueId" : "system"
                            },
                            {
                              "valueString" : "http://hl7.org/fhir/ConceptMap/special-oid2uri"
                            },
                            {
                              "valueString" : "uri"
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "name" : "displayName",
                      "source" : [
                        {
                          "context" : "val",
                          "element" : "displayName",
                          "variable" : "display"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "coding",
                          "contextType" : "variable",
                          "element" : "display",
                          "transform" : "cast",
                          "parameter" : [
                            {
                              "valueId" : "display"
                            },
                            {
                              "valueString" : "string"
                            }
                          ]
                        }
                      ]
                    }
                  ]
                },
                {
                  "name" : "translation",
                  "source" : [
                    {
                      "context" : "val",
                      "element" : "translation",
                      "variable" : "translation"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "ce",
                      "contextType" : "variable",
                      "element" : "coding",
                      "variable" : "coding"
                    }
                  ],
                  "rule" : [
                    {
                      "name" : "code",
                      "source" : [
                        {
                          "context" : "translation",
                          "element" : "code",
                          "variable" : "code"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "coding",
                          "contextType" : "variable",
                          "element" : "code",
                          "transform" : "cast",
                          "parameter" : [
                            {
                              "valueId" : "code"
                            },
                            {
                              "valueString" : "string"
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "name" : "codeSystem",
                      "source" : [
                        {
                          "context" : "translation",
                          "element" : "codeSystem",
                          "variable" : "system"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "coding",
                          "contextType" : "variable",
                          "element" : "system",
                          "transform" : "translate",
                          "parameter" : [
                            {
                              "valueId" : "system"
                            },
                            {
                              "valueString" : "http://hl7.org/fhir/ConceptMap/special-oid2uri"
                            },
                            {
                              "valueString" : "uri"
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "name" : "displayName",
                      "source" : [
                        {
                          "context" : "translation",
                          "element" : "displayName",
                          "variable" : "display"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "coding",
                          "contextType" : "variable",
                          "element" : "display",
                          "transform" : "cast",
                          "parameter" : [
                            {
                              "valueId" : "display"
                            },
                            {
                              "valueString" : "string"
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "name" : "translation1",
                      "source" : [
                        {
                          "context" : "translation",
                          "element" : "qualifier",
                          "variable" : "qualifier"
                        }
                      ],
                      "rule" : [
                        {
                          "name" : "value",
                          "source" : [
                            {
                              "context" : "qualifier",
                              "element" : "value",
                              "variable" : "value"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "ce",
                              "contextType" : "variable",
                              "element" : "coding",
                              "variable" : "coding"
                            }
                          ],
                          "rule" : [
                            {
                              "name" : "code",
                              "source" : [
                                {
                                  "context" : "value",
                                  "element" : "code",
                                  "variable" : "code"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "coding",
                                  "contextType" : "variable",
                                  "element" : "code",
                                  "transform" : "cast",
                                  "parameter" : [
                                    {
                                      "valueId" : "code"
                                    },
                                    {
                                      "valueString" : "string"
                                    }
                                  ]
                                }
                              ]
                            },
                            {
                              "name" : "codeSystem",
                              "source" : [
                                {
                                  "context" : "value",
                                  "element" : "codeSystem",
                                  "variable" : "system"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "coding",
                                  "contextType" : "variable",
                                  "element" : "system",
                                  "transform" : "translate",
                                  "parameter" : [
                                    {
                                      "valueId" : "system"
                                    },
                                    {
                                      "valueString" : "http://hl7.org/fhir/ConceptMap/special-oid2uri"
                                    },
                                    {
                                      "valueString" : "uri"
                                    }
                                  ]
                                }
                              ]
                            },
                            {
                              "name" : "displayName",
                              "source" : [
                                {
                                  "context" : "value",
                                  "element" : "displayName",
                                  "variable" : "display"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "coding",
                                  "contextType" : "variable",
                                  "element" : "display",
                                  "transform" : "cast",
                                  "parameter" : [
                                    {
                                      "valueId" : "display"
                                    },
                                    {
                                      "valueString" : "string"
                                    }
                                  ]
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ]
        },
        {
          "name" : "val",
          "source" : [
            {
              "context" : "obs",
              "type" : "CE",
              "element" : "value",
              "variable" : "val"
            }
          ],
          "rule" : [
            {
              "name" : "coding",
              "source" : [
                {
                  "context" : "val"
                }
              ],
              "target" : [
                {
                  "context" : "ob",
                  "contextType" : "variable",
                  "element" : "value",
                  "variable" : "ce",
                  "transform" : "create",
                  "parameter" : [
                    {
                      "valueString" : "CodeableConcept"
                    }
                  ]
                }
              ],
              "rule" : [
                {
                  "name" : "originalText",
                  "source" : [
                    {
                      "context" : "val",
                      "element" : "originalText",
                      "variable" : "vvv"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "ce",
                      "contextType" : "variable",
                      "element" : "text",
                      "variable" : "vvv",
                      "transform" : "create"
                    }
                  ]
                },
                {
                  "name" : "code",
                  "source" : [
                    {
                      "context" : "val"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "ce",
                      "contextType" : "variable",
                      "element" : "coding",
                      "variable" : "coding"
                    }
                  ],
                  "rule" : [
                    {
                      "name" : "code",
                      "source" : [
                        {
                          "context" : "val",
                          "element" : "code",
                          "variable" : "code"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "coding",
                          "contextType" : "variable",
                          "element" : "code",
                          "transform" : "cast",
                          "parameter" : [
                            {
                              "valueId" : "code"
                            },
                            {
                              "valueString" : "string"
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "name" : "codeSystem",
                      "source" : [
                        {
                          "context" : "val",
                          "element" : "codeSystem",
                          "variable" : "system"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "coding",
                          "contextType" : "variable",
                          "element" : "system",
                          "transform" : "translate",
                          "parameter" : [
                            {
                              "valueId" : "system"
                            },
                            {
                              "valueString" : "http://hl7.org/fhir/ConceptMap/special-oid2uri"
                            },
                            {
                              "valueString" : "uri"
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "name" : "displayName",
                      "source" : [
                        {
                          "context" : "val",
                          "element" : "displayName",
                          "variable" : "display"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "coding",
                          "contextType" : "variable",
                          "element" : "display",
                          "transform" : "cast",
                          "parameter" : [
                            {
                              "valueId" : "display"
                            },
                            {
                              "valueString" : "string"
                            }
                          ]
                        }
                      ]
                    }
                  ]
                },
                {
                  "name" : "translation",
                  "source" : [
                    {
                      "context" : "val",
                      "element" : "translation",
                      "variable" : "translation"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "ce",
                      "contextType" : "variable",
                      "element" : "coding",
                      "variable" : "coding"
                    }
                  ],
                  "rule" : [
                    {
                      "name" : "code",
                      "source" : [
                        {
                          "context" : "translation",
                          "element" : "code",
                          "variable" : "code"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "coding",
                          "contextType" : "variable",
                          "element" : "code",
                          "transform" : "cast",
                          "parameter" : [
                            {
                              "valueId" : "code"
                            },
                            {
                              "valueString" : "string"
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "name" : "codeSystem",
                      "source" : [
                        {
                          "context" : "translation",
                          "element" : "codeSystem",
                          "variable" : "system"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "coding",
                          "contextType" : "variable",
                          "element" : "system",
                          "transform" : "translate",
                          "parameter" : [
                            {
                              "valueId" : "system"
                            },
                            {
                              "valueString" : "http://hl7.org/fhir/ConceptMap/special-oid2uri"
                            },
                            {
                              "valueString" : "uri"
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "name" : "displayName",
                      "source" : [
                        {
                          "context" : "translation",
                          "element" : "displayName",
                          "variable" : "display"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "coding",
                          "contextType" : "variable",
                          "element" : "display",
                          "transform" : "cast",
                          "parameter" : [
                            {
                              "valueId" : "display"
                            },
                            {
                              "valueString" : "string"
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "name" : "translation1",
                      "source" : [
                        {
                          "context" : "translation",
                          "element" : "qualifier",
                          "variable" : "qualifier"
                        }
                      ],
                      "rule" : [
                        {
                          "name" : "value",
                          "source" : [
                            {
                              "context" : "qualifier",
                              "element" : "value",
                              "variable" : "value"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "ce",
                              "contextType" : "variable",
                              "element" : "coding",
                              "variable" : "coding"
                            }
                          ],
                          "rule" : [
                            {
                              "name" : "code",
                              "source" : [
                                {
                                  "context" : "value",
                                  "element" : "code",
                                  "variable" : "code"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "coding",
                                  "contextType" : "variable",
                                  "element" : "code",
                                  "transform" : "cast",
                                  "parameter" : [
                                    {
                                      "valueId" : "code"
                                    },
                                    {
                                      "valueString" : "string"
                                    }
                                  ]
                                }
                              ]
                            },
                            {
                              "name" : "codeSystem",
                              "source" : [
                                {
                                  "context" : "value",
                                  "element" : "codeSystem",
                                  "variable" : "system"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "coding",
                                  "contextType" : "variable",
                                  "element" : "system",
                                  "transform" : "translate",
                                  "parameter" : [
                                    {
                                      "valueId" : "system"
                                    },
                                    {
                                      "valueString" : "http://hl7.org/fhir/ConceptMap/special-oid2uri"
                                    },
                                    {
                                      "valueString" : "uri"
                                    }
                                  ]
                                }
                              ]
                            },
                            {
                              "name" : "displayName",
                              "source" : [
                                {
                                  "context" : "value",
                                  "element" : "displayName",
                                  "variable" : "display"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "coding",
                                  "contextType" : "variable",
                                  "element" : "display",
                                  "transform" : "cast",
                                  "parameter" : [
                                    {
                                      "valueId" : "display"
                                    },
                                    {
                                      "valueString" : "string"
                                    }
                                  ]
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ]
        },
        {
          "name" : "valueQuantity",
          "source" : [
            {
              "context" : "obs",
              "type" : "PQ",
              "element" : "value",
              "variable" : "val"
            }
          ],
          "rule" : [
            {
              "name" : "quantity",
              "source" : [
                {
                  "context" : "val"
                }
              ],
              "target" : [
                {
                  "context" : "ob",
                  "contextType" : "variable",
                  "element" : "value",
                  "variable" : "quantity",
                  "transform" : "create",
                  "parameter" : [
                    {
                      "valueString" : "Quantity"
                    }
                  ]
                }
              ],
              "rule" : [
                {
                  "name" : "value",
                  "source" : [
                    {
                      "context" : "val",
                      "element" : "value",
                      "variable" : "value"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "quantity",
                      "contextType" : "variable",
                      "element" : "value",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueId" : "value"
                        }
                      ]
                    }
                  ]
                },
                {
                  "name" : "unit",
                  "source" : [
                    {
                      "context" : "val",
                      "element" : "unit",
                      "variable" : "unit"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "quantity",
                      "contextType" : "variable",
                      "element" : "unit",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueId" : "unit"
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ]
        },
        {
          "name" : "value",
          "source" : [
            {
              "context" : "obs",
              "type" : "BL",
              "element" : "value",
              "variable" : "value"
            }
          ],
          "target" : [
            {
              "context" : "ob",
              "contextType" : "variable",
              "element" : "value",
              "transform" : "create",
              "parameter" : [
                {
                  "valueString" : "boolean"
                }
              ]
            },
            {
              "context" : "ob",
              "contextType" : "variable",
              "element" : "value",
              "transform" : "evaluate",
              "parameter" : [
                {
                  "valueString" : "value.value"
                }
              ]
            }
          ]
        },
        {
          "name" : "value",
          "source" : [
            {
              "context" : "obs",
              "type" : "ST",
              "element" : "value",
              "variable" : "value"
            }
          ],
          "target" : [
            {
              "context" : "ob",
              "contextType" : "variable",
              "element" : "value",
              "transform" : "create",
              "parameter" : [
                {
                  "valueString" : "string"
                }
              ]
            },
            {
              "context" : "ob",
              "contextType" : "variable",
              "element" : "value",
              "transform" : "evaluate",
              "parameter" : [
                {
                  "valueString" : "value.dataString"
                }
              ]
            }
          ]
        },
        {
          "name" : "interpretationCode",
          "source" : [
            {
              "context" : "obs",
              "element" : "interpretationCode",
              "variable" : "vvv"
            }
          ],
          "target" : [
            {
              "context" : "ob",
              "contextType" : "variable",
              "element" : "interpretation",
              "variable" : "vvv",
              "transform" : "create"
            }
          ]
        },
        {
          "name" : "methodCode",
          "source" : [
            {
              "context" : "obs",
              "element" : "methodCode",
              "variable" : "vvv"
            }
          ],
          "target" : [
            {
              "context" : "ob",
              "contextType" : "variable",
              "element" : "method",
              "variable" : "vvv",
              "transform" : "create"
            }
          ]
        },
        {
          "name" : "performer",
          "source" : [
            {
              "context" : "obs",
              "element" : "performer",
              "variable" : "performer"
            }
          ],
          "target" : [
            {
              "context" : "bundle",
              "contextType" : "variable",
              "element" : "entry",
              "variable" : "e1"
            },
            {
              "context" : "e1",
              "contextType" : "variable",
              "element" : "request",
              "variable" : "request",
              "transform" : "create",
              "parameter" : [
                {
                  "valueString" : "BackboneElement"
                }
              ]
            },
            {
              "context" : "request",
              "contextType" : "variable",
              "element" : "method",
              "transform" : "copy",
              "parameter" : [
                {
                  "valueString" : "PUT"
                }
              ]
            },
            {
              "context" : "e1",
              "contextType" : "variable",
              "element" : "resource",
              "variable" : "practitioner",
              "transform" : "create",
              "parameter" : [
                {
                  "valueString" : "Practitioner"
                }
              ]
            }
          ],
          "rule" : [
            {
              "name" : "assignedEntity",
              "source" : [
                {
                  "context" : "performer",
                  "element" : "assignedEntity",
                  "variable" : "entity"
                }
              ],
              "rule" : [
                {
                  "name" : "meta",
                  "source" : [
                    {
                      "context" : "entity"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "practitioner",
                      "contextType" : "variable",
                      "element" : "meta",
                      "variable" : "meta"
                    }
                  ],
                  "rule" : [
                    {
                      "name" : "coding",
                      "source" : [
                        {
                          "context" : "entity"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "meta",
                          "contextType" : "variable",
                          "element" : "tag",
                          "variable" : "coding",
                          "transform" : "create",
                          "parameter" : [
                            {
                              "valueString" : "Coding"
                            }
                          ]
                        }
                      ],
                      "rule" : [
                        {
                          "name" : "system",
                          "source" : [
                            {
                              "context" : "entity"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "coding",
                              "contextType" : "variable",
                              "element" : "system",
                              "transform" : "copy",
                              "parameter" : [
                                {
                                  "valueString" : "http://algoritmodiscoring"
                                }
                              ]
                            }
                          ]
                        },
                        {
                          "name" : "code",
                          "source" : [
                            {
                              "context" : "entity"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "coding",
                              "contextType" : "variable",
                              "element" : "code",
                              "transform" : "copy",
                              "parameter" : [
                                {
                                  "valueString" : "ClinicalDocument/body/observation/performer"
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  ]
                },
                {
                  "name" : "identifier",
                  "source" : [
                    {
                      "context" : "entity",
                      "element" : "id",
                      "variable" : "id"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "practitioner",
                      "contextType" : "variable",
                      "element" : "identifier",
                      "variable" : "identifier"
                    }
                  ],
                  "rule" : [
                    {
                      "name" : "root1",
                      "source" : [
                        {
                          "context" : "id",
                          "element" : "root",
                          "variable" : "r"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "identifier",
                          "contextType" : "variable",
                          "element" : "system",
                          "transform" : "translate",
                          "parameter" : [
                            {
                              "valueId" : "r"
                            },
                            {
                              "valueString" : "http://hl7.org/fhir/ConceptMap/special-oid2uri"
                            },
                            {
                              "valueString" : "uri"
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "name" : "ext",
                      "source" : [
                        {
                          "context" : "id",
                          "element" : "extension",
                          "variable" : "ext"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "identifier",
                          "contextType" : "variable",
                          "element" : "value",
                          "transform" : "copy",
                          "parameter" : [
                            {
                              "valueId" : "ext"
                            }
                          ]
                        }
                      ],
                      "rule" : [
                        {
                          "name" : "UUID",
                          "source" : [
                            {
                              "context" : "entity"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "request",
                              "contextType" : "variable",
                              "element" : "url",
                              "transform" : "append",
                              "parameter" : [
                                {
                                  "valueString" : "Practitioner?identifier="
                                },
                                {
                                  "valueId" : "ext"
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "name" : "assigningAuthorityName",
                      "source" : [
                        {
                          "context" : "id",
                          "element" : "assigningAuthorityName",
                          "variable" : "s"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "identifier",
                          "contextType" : "variable",
                          "element" : "assigner",
                          "variable" : "a"
                        },
                        {
                          "context" : "a",
                          "contextType" : "variable",
                          "element" : "display",
                          "transform" : "copy",
                          "parameter" : [
                            {
                              "valueId" : "s"
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "name" : "r",
                      "source" : [
                        {
                          "context" : "id",
                          "element" : "root",
                          "variable" : "r"
                        }
                      ],
                      "rule" : [
                        {
                          "name" : "performer",
                          "source" : [
                            {
                              "context" : "id",
                              "element" : "extension",
                              "variable" : "ext"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "practitioner",
                              "contextType" : "variable",
                              "element" : "id",
                              "variable" : "uuid1",
                              "transform" : "evaluate",
                              "parameter" : [
                                {
                                  "valueString" : "r + '-' + ext"
                                }
                              ]
                            },
                            {
                              "context" : "e1",
                              "contextType" : "variable",
                              "element" : "fullUrl",
                              "transform" : "append",
                              "parameter" : [
                                {
                                  "valueString" : "https://example/Practitioner/"
                                },
                                {
                                  "valueId" : "uuid1"
                                }
                              ]
                            },
                            {
                              "context" : "ob",
                              "contextType" : "variable",
                              "element" : "performer",
                              "variable" : "reference",
                              "transform" : "create",
                              "parameter" : [
                                {
                                  "valueString" : "Reference"
                                }
                              ]
                            },
                            {
                              "context" : "reference",
                              "contextType" : "variable",
                              "element" : "reference",
                              "transform" : "evaluate",
                              "parameter" : [
                                {
                                  "valueString" : "'https://example/Practitioner/' + %practitioner.id"
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  ]
                },
                {
                  "name" : "name",
                  "source" : [
                    {
                      "context" : "entity",
                      "element" : "assignedPerson",
                      "variable" : "person"
                    }
                  ],
                  "rule" : [
                    {
                      "name" : "name",
                      "source" : [
                        {
                          "context" : "person",
                          "element" : "name",
                          "variable" : "vvv"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "practitioner",
                          "contextType" : "variable",
                          "element" : "name",
                          "variable" : "vvv",
                          "transform" : "create"
                        }
                      ]
                    },
                    {
                      "name" : "birth",
                      "source" : [
                        {
                          "context" : "person",
                          "element" : "birthTime",
                          "variable" : "birthTime"
                        }
                      ],
                      "rule" : [
                        {
                          "name" : "value",
                          "source" : [
                            {
                              "context" : "birthTime",
                              "element" : "value",
                              "variable" : "date"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "practitioner",
                              "contextType" : "variable",
                              "element" : "birthDate",
                              "transform" : "truncate",
                              "parameter" : [
                                {
                                  "valueId" : "date"
                                },
                                {
                                  "valueInteger" : 10
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ]
        },
        {
          "name" : "refRange",
          "source" : [
            {
              "context" : "obs",
              "element" : "referenceRange",
              "variable" : "refRange"
            }
          ],
          "target" : [
            {
              "context" : "ob",
              "contextType" : "variable",
              "element" : "referenceRange",
              "variable" : "ref",
              "transform" : "create",
              "parameter" : [
                {
                  "valueString" : "BackboneElement"
                }
              ]
            }
          ],
          "rule" : [
            {
              "name" : "obsRange",
              "source" : [
                {
                  "context" : "refRange",
                  "element" : "observationRange",
                  "variable" : "obsRange"
                }
              ],
              "target" : [
                {
                  "context" : "ref",
                  "contextType" : "variable",
                  "element" : "low",
                  "variable" : "Low",
                  "transform" : "create",
                  "parameter" : [
                    {
                      "valueString" : "SimpleQuantity"
                    }
                  ]
                }
              ],
              "rule" : [
                {
                  "name" : "IVL-PQ",
                  "source" : [
                    {
                      "context" : "obsRange",
                      "type" : "IVL_PQ",
                      "element" : "value",
                      "variable" : "v"
                    }
                  ],
                  "rule" : [
                    {
                      "name" : "decValue",
                      "source" : [
                        {
                          "context" : "v",
                          "element" : "low",
                          "variable" : "l1"
                        }
                      ],
                      "rule" : [
                        {
                          "name" : "value",
                          "source" : [
                            {
                              "context" : "l1",
                              "element" : "value",
                              "variable" : "decValue"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "Low",
                              "contextType" : "variable",
                              "element" : "value",
                              "transform" : "copy",
                              "parameter" : [
                                {
                                  "valueId" : "decValue"
                                }
                              ]
                            }
                          ]
                        },
                        {
                          "name" : "unit",
                          "source" : [
                            {
                              "context" : "l1",
                              "element" : "unit",
                              "variable" : "Unit"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "Low",
                              "contextType" : "variable",
                              "element" : "unit",
                              "transform" : "copy",
                              "parameter" : [
                                {
                                  "valueId" : "Unit"
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ]
        }
      ]
    },
    {
      "name" : "ClinicalDocumentSectionDecorsoOspedaliero",
      "typeMode" : "none",
      "documentation" : "------------------------------------------------------------------------------------------------------\r\nSezione Decorso Ospedaliero----------------------------------------------------------------------------",
      "input" : [
        {
          "name" : "cda",
          "type" : "ClinicalDocument",
          "mode" : "source"
        },
        {
          "name" : "src",
          "type" : "Section",
          "mode" : "source"
        },
        {
          "name" : "patient",
          "type" : "Patient",
          "mode" : "target"
        },
        {
          "name" : "tgt",
          "mode" : "target"
        },
        {
          "name" : "bundle",
          "type" : "Bundle",
          "mode" : "target"
        },
        {
          "name" : "enc",
          "type" : "Encounter",
          "mode" : "target"
        }
      ],
      "rule" : [
        {
          "name" : "title",
          "source" : [
            {
              "context" : "src",
              "element" : "title",
              "variable" : "t"
            }
          ],
          "target" : [
            {
              "context" : "tgt",
              "contextType" : "variable",
              "element" : "title",
              "transform" : "evaluate",
              "parameter" : [
                {
                  "valueString" : "t.dataString"
                }
              ]
            }
          ]
        },
        {
          "name" : "code",
          "source" : [
            {
              "context" : "src",
              "element" : "code",
              "variable" : "vvv"
            }
          ],
          "target" : [
            {
              "context" : "tgt",
              "contextType" : "variable",
              "element" : "code",
              "variable" : "vvv",
              "transform" : "create"
            }
          ]
        },
        {
          "name" : "OB-note",
          "source" : [
            {
              "context" : "src"
            }
          ],
          "target" : [
            {
              "context" : "bundle",
              "contextType" : "variable",
              "element" : "entry",
              "variable" : "e1"
            },
            {
              "context" : "e1",
              "contextType" : "variable",
              "element" : "request",
              "variable" : "request",
              "transform" : "create",
              "parameter" : [
                {
                  "valueString" : "BackboneElement"
                }
              ]
            },
            {
              "context" : "request",
              "contextType" : "variable",
              "element" : "method",
              "transform" : "copy",
              "parameter" : [
                {
                  "valueString" : "POST"
                }
              ]
            },
            {
              "context" : "e1",
              "contextType" : "variable",
              "element" : "resource",
              "variable" : "observation",
              "transform" : "create",
              "parameter" : [
                {
                  "valueString" : "Observation"
                }
              ]
            },
            {
              "context" : "observation",
              "contextType" : "variable",
              "element" : "id",
              "variable" : "uuid1",
              "transform" : "uuid"
            },
            {
              "context" : "e1",
              "contextType" : "variable",
              "element" : "fullUrl",
              "transform" : "append",
              "parameter" : [
                {
                  "valueString" : "https://example/Observation/"
                },
                {
                  "valueId" : "uuid1"
                }
              ]
            },
            {
              "context" : "request",
              "contextType" : "variable",
              "element" : "url",
              "transform" : "copy",
              "parameter" : [
                {
                  "valueString" : "Observation"
                }
              ]
            },
            {
              "context" : "tgt",
              "contextType" : "variable",
              "element" : "entry",
              "variable" : "reference",
              "transform" : "create",
              "parameter" : [
                {
                  "valueString" : "Reference"
                }
              ]
            },
            {
              "context" : "reference",
              "contextType" : "variable",
              "element" : "reference",
              "transform" : "evaluate",
              "parameter" : [
                {
                  "valueString" : "'https://example/Observation/' + %observation.id"
                }
              ]
            },
            {
              "context" : "observation",
              "contextType" : "variable",
              "element" : "note",
              "variable" : "note"
            }
          ],
          "rule" : [
            {
              "name" : "code",
              "source" : [
                {
                  "context" : "src",
                  "element" : "code",
                  "variable" : "vvv"
                }
              ],
              "target" : [
                {
                  "context" : "observation",
                  "contextType" : "variable",
                  "element" : "code",
                  "variable" : "vvv",
                  "transform" : "create"
                }
              ]
            },
            {
              "name" : "statuscode",
              "source" : [
                {
                  "context" : "src",
                  "condition" : "observation.statusCode.exists().not()"
                }
              ],
              "rule" : [
                {
                  "name" : "status",
                  "source" : [
                    {
                      "context" : "src"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "observation",
                      "contextType" : "variable",
                      "element" : "status",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "final"
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "name" : "reference",
              "source" : [
                {
                  "context" : "src"
                }
              ],
              "target" : [
                {
                  "context" : "observation",
                  "contextType" : "variable",
                  "element" : "subject",
                  "variable" : "reference",
                  "transform" : "create",
                  "parameter" : [
                    {
                      "valueString" : "Reference"
                    }
                  ]
                },
                {
                  "context" : "reference",
                  "contextType" : "variable",
                  "element" : "reference",
                  "transform" : "evaluate",
                  "parameter" : [
                    {
                      "valueString" : "'https://example/Patient/' + %patient.id"
                    }
                  ]
                }
              ]
            },
            {
              "name" : "reference",
              "source" : [
                {
                  "context" : "src"
                }
              ],
              "target" : [
                {
                  "context" : "observation",
                  "contextType" : "variable",
                  "element" : "encounter",
                  "variable" : "reference",
                  "transform" : "create",
                  "parameter" : [
                    {
                      "valueString" : "Reference"
                    }
                  ]
                },
                {
                  "context" : "reference",
                  "contextType" : "variable",
                  "element" : "reference",
                  "transform" : "evaluate",
                  "parameter" : [
                    {
                      "valueString" : "'https://example/Encounter/' + %enc.id"
                    }
                  ]
                }
              ]
            },
            {
              "name" : "reference",
              "source" : [
                {
                  "context" : "src",
                  "element" : "text",
                  "variable" : "t"
                }
              ],
              "target" : [
                {
                  "context" : "note",
                  "contextType" : "variable",
                  "element" : "text",
                  "transform" : "copy",
                  "parameter" : [
                    {
                      "valueId" : "t"
                    }
                  ]
                }
              ]
            },
            {
              "name" : "Auth",
              "source" : [
                {
                  "context" : "src",
                  "element" : "author",
                  "variable" : "auth"
                }
              ],
              "target" : [
                {
                  "context" : "bundle",
                  "contextType" : "variable",
                  "element" : "entry",
                  "variable" : "e1"
                },
                {
                  "context" : "e1",
                  "contextType" : "variable",
                  "element" : "request",
                  "variable" : "request",
                  "transform" : "create",
                  "parameter" : [
                    {
                      "valueString" : "BackboneElement"
                    }
                  ]
                },
                {
                  "context" : "request",
                  "contextType" : "variable",
                  "element" : "method",
                  "transform" : "copy",
                  "parameter" : [
                    {
                      "valueString" : "PUT"
                    }
                  ]
                },
                {
                  "context" : "e1",
                  "contextType" : "variable",
                  "element" : "resource",
                  "variable" : "practitioner",
                  "transform" : "create",
                  "parameter" : [
                    {
                      "valueString" : "Practitioner"
                    }
                  ]
                },
                {
                  "context" : "practitioner",
                  "contextType" : "variable",
                  "element" : "id",
                  "variable" : "uuid1",
                  "transform" : "uuid"
                },
                {
                  "context" : "e1",
                  "contextType" : "variable",
                  "element" : "fullUrl",
                  "transform" : "append",
                  "parameter" : [
                    {
                      "valueString" : "https://example/Practitioner/"
                    },
                    {
                      "valueId" : "uuid1"
                    }
                  ]
                },
                {
                  "context" : "request",
                  "contextType" : "variable",
                  "element" : "url",
                  "transform" : "append",
                  "parameter" : [
                    {
                      "valueString" : "Practitioner/"
                    },
                    {
                      "valueId" : "uuid1"
                    }
                  ]
                }
              ],
              "rule" : [
                {
                  "name" : "time",
                  "source" : [
                    {
                      "context" : "auth",
                      "element" : "time",
                      "variable" : "ti"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "note",
                      "contextType" : "variable",
                      "element" : "time",
                      "variable" : "value",
                      "transform" : "create",
                      "parameter" : [
                        {
                          "valueString" : "dateTime"
                        }
                      ]
                    }
                  ],
                  "dependent" : [
                    {
                      "name" : "TSDateTime",
                      "variable" : [
                        "ti",
                        "value"
                      ]
                    }
                  ]
                },
                {
                  "name" : "assAuth",
                  "source" : [
                    {
                      "context" : "auth",
                      "element" : "assignedAuthor",
                      "variable" : "assAuth"
                    }
                  ],
                  "rule" : [
                    {
                      "name" : "meta",
                      "source" : [
                        {
                          "context" : "assAuth"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "practitioner",
                          "contextType" : "variable",
                          "element" : "meta",
                          "variable" : "meta"
                        }
                      ],
                      "rule" : [
                        {
                          "name" : "coding",
                          "source" : [
                            {
                              "context" : "assAuth"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "meta",
                              "contextType" : "variable",
                              "element" : "tag",
                              "variable" : "coding",
                              "transform" : "create",
                              "parameter" : [
                                {
                                  "valueString" : "Coding"
                                }
                              ]
                            }
                          ],
                          "rule" : [
                            {
                              "name" : "system",
                              "source" : [
                                {
                                  "context" : "assAuth"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "coding",
                                  "contextType" : "variable",
                                  "element" : "system",
                                  "transform" : "copy",
                                  "parameter" : [
                                    {
                                      "valueString" : "http://algoritmodiscoring"
                                    }
                                  ]
                                }
                              ]
                            },
                            {
                              "name" : "code",
                              "source" : [
                                {
                                  "context" : "assAuth"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "coding",
                                  "contextType" : "variable",
                                  "element" : "code",
                                  "transform" : "copy",
                                  "parameter" : [
                                    {
                                      "valueString" : "ClinicalDocument/body/DecorsoOspedaliero/author"
                                    }
                                  ]
                                }
                              ]
                            }
                          ]
                        }
                      ],
                      "documentation" : "meta+identifier"
                    },
                    {
                      "name" : "identifier",
                      "source" : [
                        {
                          "context" : "assAuth",
                          "element" : "id",
                          "variable" : "id"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "practitioner",
                          "contextType" : "variable",
                          "element" : "identifier",
                          "variable" : "identifier"
                        }
                      ],
                      "rule" : [
                        {
                          "name" : "root1",
                          "source" : [
                            {
                              "context" : "id",
                              "element" : "root",
                              "variable" : "r"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "identifier",
                              "contextType" : "variable",
                              "element" : "system",
                              "transform" : "translate",
                              "parameter" : [
                                {
                                  "valueId" : "r"
                                },
                                {
                                  "valueString" : "http://hl7.org/fhir/ConceptMap/special-oid2uri"
                                },
                                {
                                  "valueString" : "uri"
                                }
                              ]
                            }
                          ]
                        },
                        {
                          "name" : "extension",
                          "source" : [
                            {
                              "context" : "id",
                              "element" : "extension",
                              "variable" : "ext"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "identifier",
                              "contextType" : "variable",
                              "element" : "value",
                              "transform" : "copy",
                              "parameter" : [
                                {
                                  "valueId" : "ext"
                                }
                              ]
                            }
                          ]
                        },
                        {
                          "name" : "assigningAuthorityName",
                          "source" : [
                            {
                              "context" : "id",
                              "element" : "assigningAuthorityName",
                              "variable" : "s"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "identifier",
                              "contextType" : "variable",
                              "element" : "assigner",
                              "variable" : "a"
                            },
                            {
                              "context" : "a",
                              "contextType" : "variable",
                              "element" : "display",
                              "transform" : "copy",
                              "parameter" : [
                                {
                                  "valueId" : "s"
                                }
                              ]
                            }
                          ]
                        },
                        {
                          "name" : "r",
                          "source" : [
                            {
                              "context" : "id",
                              "element" : "root",
                              "variable" : "r"
                            }
                          ],
                          "rule" : [
                            {
                              "name" : "aut",
                              "source" : [
                                {
                                  "context" : "id",
                                  "element" : "extension",
                                  "variable" : "ext"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "practitioner",
                                  "contextType" : "variable",
                                  "element" : "id",
                                  "variable" : "uuid2",
                                  "transform" : "evaluate",
                                  "parameter" : [
                                    {
                                      "valueString" : "r + '-' + ext"
                                    }
                                  ]
                                },
                                {
                                  "context" : "e1",
                                  "contextType" : "variable",
                                  "element" : "fullUrl",
                                  "transform" : "append",
                                  "parameter" : [
                                    {
                                      "valueString" : "https://example/Practitioner/"
                                    },
                                    {
                                      "valueId" : "uuid2"
                                    }
                                  ]
                                },
                                {
                                  "context" : "request",
                                  "contextType" : "variable",
                                  "element" : "url",
                                  "transform" : "append",
                                  "parameter" : [
                                    {
                                      "valueString" : "Practitioner/"
                                    },
                                    {
                                      "valueId" : "uuid2"
                                    }
                                  ]
                                },
                                {
                                  "context" : "note",
                                  "contextType" : "variable",
                                  "element" : "author",
                                  "variable" : "reference",
                                  "transform" : "create",
                                  "parameter" : [
                                    {
                                      "valueString" : "Reference"
                                    }
                                  ]
                                },
                                {
                                  "context" : "reference",
                                  "contextType" : "variable",
                                  "element" : "reference",
                                  "transform" : "evaluate",
                                  "parameter" : [
                                    {
                                      "valueString" : "'https://example/Practitioner/' + %practitioner.id"
                                    }
                                  ]
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "name" : "2.16.840.1.113883.2.9.4.3.2",
                      "source" : [
                        {
                          "context" : "assAuth",
                          "element" : "id",
                          "variable" : "id",
                          "condition" : "(root = '2.16.840.1.113883.2.9.4.3.2')"
                        }
                      ],
                      "rule" : [
                        {
                          "name" : "UUID",
                          "source" : [
                            {
                              "context" : "id",
                              "element" : "extension",
                              "variable" : "ext"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "request",
                              "contextType" : "variable",
                              "element" : "url",
                              "transform" : "append",
                              "parameter" : [
                                {
                                  "valueString" : "Practitioner?identifier="
                                },
                                {
                                  "valueId" : "ext"
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "name" : "assPers",
                      "source" : [
                        {
                          "context" : "assAuth",
                          "element" : "assignedPerson",
                          "variable" : "assPers"
                        }
                      ],
                      "rule" : [
                        {
                          "name" : "name",
                          "source" : [
                            {
                              "context" : "assPers",
                              "element" : "name",
                              "variable" : "vvv"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "practitioner",
                              "contextType" : "variable",
                              "element" : "name",
                              "variable" : "vvv",
                              "transform" : "create"
                            }
                          ]
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ]
        }
      ]
    },
    {
      "name" : "ClinicalDocumentSectionEncounter",
      "typeMode" : "none",
      "documentation" : "--------------------------------------------------------------------------------------------------------\r\nSezione Encounter---------------------------------------------------------------------------------------",
      "input" : [
        {
          "name" : "cda",
          "type" : "ClinicalDocument",
          "mode" : "source"
        },
        {
          "name" : "src",
          "type" : "Section",
          "mode" : "source"
        },
        {
          "name" : "patient",
          "type" : "Patient",
          "mode" : "target"
        },
        {
          "name" : "tgt",
          "mode" : "target"
        },
        {
          "name" : "bundle",
          "type" : "Bundle",
          "mode" : "target"
        },
        {
          "name" : "enc1",
          "type" : "Encounter",
          "mode" : "target"
        }
      ],
      "rule" : [
        {
          "name" : "title",
          "source" : [
            {
              "context" : "src",
              "element" : "title",
              "variable" : "t"
            }
          ],
          "target" : [
            {
              "context" : "tgt",
              "contextType" : "variable",
              "element" : "title",
              "transform" : "evaluate",
              "parameter" : [
                {
                  "valueString" : "t.dataString"
                }
              ]
            }
          ]
        },
        {
          "name" : "code",
          "source" : [
            {
              "context" : "src",
              "element" : "code",
              "variable" : "vvv"
            }
          ],
          "target" : [
            {
              "context" : "tgt",
              "contextType" : "variable",
              "element" : "code",
              "variable" : "vvv",
              "transform" : "create"
            }
          ]
        },
        {
          "name" : "cdaText",
          "source" : [
            {
              "context" : "src",
              "element" : "text",
              "variable" : "cdaText"
            }
          ],
          "target" : [
            {
              "context" : "tgt",
              "contextType" : "variable",
              "element" : "text",
              "variable" : "fhirText"
            }
          ],
          "rule" : [
            {
              "name" : "narrativeStatus",
              "source" : [
                {
                  "context" : "cdaText"
                }
              ],
              "target" : [
                {
                  "context" : "fhirText",
                  "contextType" : "variable",
                  "element" : "status",
                  "transform" : "copy",
                  "parameter" : [
                    {
                      "valueString" : "generated"
                    }
                  ]
                }
              ]
            },
            {
              "name" : "narrativeText",
              "source" : [
                {
                  "context" : "cdaText",
                  "variable" : "t"
                }
              ],
              "target" : [
                {
                  "context" : "fhirText",
                  "contextType" : "variable",
                  "element" : "div",
                  "transform" : "copy",
                  "parameter" : [
                    {
                      "valueId" : "t"
                    }
                  ]
                }
              ]
            }
          ]
        },
        {
          "name" : "entry",
          "source" : [
            {
              "context" : "src",
              "element" : "entry",
              "variable" : "entry1"
            }
          ],
          "target" : [
            {
              "context" : "bundle",
              "contextType" : "variable",
              "element" : "entry",
              "variable" : "e1"
            },
            {
              "context" : "e1",
              "contextType" : "variable",
              "element" : "request",
              "variable" : "request",
              "transform" : "create",
              "parameter" : [
                {
                  "valueString" : "BackboneElement"
                }
              ]
            },
            {
              "context" : "request",
              "contextType" : "variable",
              "element" : "method",
              "transform" : "copy",
              "parameter" : [
                {
                  "valueString" : "POST"
                }
              ]
            },
            {
              "context" : "e1",
              "contextType" : "variable",
              "element" : "resource",
              "variable" : "encounter",
              "transform" : "create",
              "parameter" : [
                {
                  "valueString" : "Encounter"
                }
              ]
            },
            {
              "context" : "encounter",
              "contextType" : "variable",
              "element" : "id",
              "variable" : "uuid1",
              "transform" : "uuid"
            },
            {
              "context" : "e1",
              "contextType" : "variable",
              "element" : "fullUrl",
              "transform" : "append",
              "parameter" : [
                {
                  "valueString" : "https://example/Encounter/"
                },
                {
                  "valueId" : "uuid1"
                }
              ]
            },
            {
              "context" : "request",
              "contextType" : "variable",
              "element" : "url",
              "transform" : "copy",
              "parameter" : [
                {
                  "valueString" : "Encounter"
                }
              ]
            },
            {
              "context" : "tgt",
              "contextType" : "variable",
              "element" : "entry",
              "variable" : "reference",
              "transform" : "create",
              "parameter" : [
                {
                  "valueString" : "Reference"
                }
              ]
            },
            {
              "context" : "reference",
              "contextType" : "variable",
              "element" : "reference",
              "transform" : "evaluate",
              "parameter" : [
                {
                  "valueString" : "'https://example/Encounter/' + %encounter.id"
                }
              ]
            }
          ],
          "rule" : [
            {
              "name" : "refer",
              "source" : [
                {
                  "context" : "entry1"
                }
              ],
              "target" : [
                {
                  "context" : "encounter",
                  "contextType" : "variable",
                  "element" : "partOf",
                  "variable" : "reference",
                  "transform" : "create",
                  "parameter" : [
                    {
                      "valueString" : "Reference"
                    }
                  ]
                },
                {
                  "context" : "reference",
                  "contextType" : "variable",
                  "element" : "reference",
                  "transform" : "evaluate",
                  "parameter" : [
                    {
                      "valueString" : "'https://example/Encounter/' + %enc1.id"
                    }
                  ]
                }
              ]
            },
            {
              "name" : "refer",
              "source" : [
                {
                  "context" : "entry1"
                }
              ],
              "target" : [
                {
                  "context" : "encounter",
                  "contextType" : "variable",
                  "element" : "subject",
                  "variable" : "reference",
                  "transform" : "create",
                  "parameter" : [
                    {
                      "valueString" : "Reference"
                    }
                  ]
                },
                {
                  "context" : "reference",
                  "contextType" : "variable",
                  "element" : "reference",
                  "transform" : "evaluate",
                  "parameter" : [
                    {
                      "valueString" : "'https://example/Patient/' + %patient.id"
                    }
                  ]
                }
              ]
            },
            {
              "name" : "status",
              "source" : [
                {
                  "context" : "entry1"
                }
              ],
              "target" : [
                {
                  "context" : "encounter",
                  "contextType" : "variable",
                  "element" : "status",
                  "transform" : "copy",
                  "parameter" : [
                    {
                      "valueString" : "finished"
                    }
                  ]
                }
              ]
            },
            {
              "name" : "class",
              "source" : [
                {
                  "context" : "entry1"
                }
              ],
              "target" : [
                {
                  "context" : "encounter",
                  "contextType" : "variable",
                  "element" : "class",
                  "variable" : "cl",
                  "transform" : "create",
                  "parameter" : [
                    {
                      "valueString" : "Coding"
                    }
                  ]
                }
              ],
              "rule" : [
                {
                  "name" : "code",
                  "source" : [
                    {
                      "context" : "entry1"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "cl",
                      "contextType" : "variable",
                      "element" : "code",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "AMB"
                        }
                      ]
                    }
                  ]
                },
                {
                  "name" : "code",
                  "source" : [
                    {
                      "context" : "entry1"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "cl",
                      "contextType" : "variable",
                      "element" : "display",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "ambulatory"
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "name" : "encounter",
              "source" : [
                {
                  "context" : "entry1",
                  "element" : "encounter",
                  "variable" : "enc"
                }
              ],
              "rule" : [
                {
                  "name" : "code",
                  "source" : [
                    {
                      "context" : "enc",
                      "element" : "code",
                      "variable" : "vvv"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "encounter",
                      "contextType" : "variable",
                      "element" : "type",
                      "variable" : "vvv",
                      "transform" : "create"
                    }
                  ]
                },
                {
                  "name" : "where",
                  "source" : [
                    {
                      "context" : "enc",
                      "condition" : "effectiveTime.low.exists() or effectiveTime.high.exists()"
                    }
                  ],
                  "rule" : [
                    {
                      "name" : "effectiveTime",
                      "source" : [
                        {
                          "context" : "enc",
                          "element" : "effectiveTime",
                          "variable" : "eff"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "encounter",
                          "contextType" : "variable",
                          "element" : "period",
                          "variable" : "period",
                          "transform" : "create",
                          "parameter" : [
                            {
                              "valueString" : "Period"
                            }
                          ]
                        }
                      ],
                      "dependent" : [
                        {
                          "name" : "IVLTSPeriod",
                          "variable" : [
                            "eff",
                            "period"
                          ]
                        }
                      ]
                    }
                  ],
                  "documentation" : "effectiveTime=period"
                },
                {
                  "name" : "where",
                  "source" : [
                    {
                      "context" : "enc",
                      "condition" : "effectiveTime.low.exists().not() or effectiveTime.high.exists().not()"
                    }
                  ],
                  "rule" : [
                    {
                      "name" : "efft",
                      "source" : [
                        {
                          "context" : "enc",
                          "element" : "effectiveTime",
                          "variable" : "effectivetime1"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "encounter",
                          "contextType" : "variable",
                          "element" : "period",
                          "variable" : "period",
                          "transform" : "create",
                          "parameter" : [
                            {
                              "valueString" : "Period"
                            }
                          ]
                        }
                      ],
                      "rule" : [
                        {
                          "name" : "val",
                          "source" : [
                            {
                              "context" : "effectivetime1"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "period",
                              "contextType" : "variable",
                              "element" : "start",
                              "variable" : "start",
                              "transform" : "create",
                              "parameter" : [
                                {
                                  "valueString" : "dateTime"
                                }
                              ]
                            }
                          ],
                          "dependent" : [
                            {
                              "name" : "TSDateTime",
                              "variable" : [
                                "effectivetime1",
                                "start"
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  ],
                  "documentation" : "effectiveTime = time-stamp"
                },
                {
                  "name" : "participant-ADM",
                  "source" : [
                    {
                      "context" : "enc",
                      "element" : "participant",
                      "variable" : "part",
                      "condition" : "(typeCode != 'LOC')"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "encounter",
                      "contextType" : "variable",
                      "element" : "participant",
                      "variable" : "patarg",
                      "transform" : "create",
                      "parameter" : [
                        {
                          "valueString" : "BackboneElement"
                        }
                      ]
                    }
                  ],
                  "rule" : [
                    {
                      "name" : "type",
                      "source" : [
                        {
                          "context" : "part"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "patarg",
                          "contextType" : "variable",
                          "element" : "type",
                          "variable" : "type"
                        }
                      ],
                      "rule" : [
                        {
                          "name" : "codeType",
                          "source" : [
                            {
                              "context" : "part"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "type",
                              "contextType" : "variable",
                              "element" : "coding",
                              "variable" : "coding"
                            }
                          ],
                          "rule" : [
                            {
                              "name" : "codice",
                              "source" : [
                                {
                                  "context" : "part"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "coding",
                                  "contextType" : "variable",
                                  "element" : "code",
                                  "transform" : "evaluate",
                                  "parameter" : [
                                    {
                                      "valueString" : "part.typeCode"
                                    }
                                  ]
                                }
                              ]
                            },
                            {
                              "name" : "system",
                              "source" : [
                                {
                                  "context" : "part"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "coding",
                                  "contextType" : "variable",
                                  "element" : "system",
                                  "transform" : "copy",
                                  "parameter" : [
                                    {
                                      "valueString" : "http://terminology.hl7.org/CodeSystem/v3-ParticipationType"
                                    }
                                  ]
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "name" : "time",
                      "source" : [
                        {
                          "context" : "part",
                          "element" : "time",
                          "variable" : "time1"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "patarg",
                          "contextType" : "variable",
                          "element" : "period",
                          "variable" : "period",
                          "transform" : "create",
                          "parameter" : [
                            {
                              "valueString" : "Period"
                            }
                          ]
                        }
                      ],
                      "rule" : [
                        {
                          "name" : "val",
                          "source" : [
                            {
                              "context" : "time1"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "period",
                              "contextType" : "variable",
                              "element" : "start",
                              "variable" : "start",
                              "transform" : "create",
                              "parameter" : [
                                {
                                  "valueString" : "dateTime"
                                }
                              ]
                            }
                          ],
                          "dependent" : [
                            {
                              "name" : "TSDateTime",
                              "variable" : [
                                "time1",
                                "start"
                              ]
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "name" : "time",
                      "source" : [
                        {
                          "context" : "part",
                          "element" : "time",
                          "variable" : "ti"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "patarg",
                          "contextType" : "variable",
                          "element" : "period",
                          "variable" : "period",
                          "transform" : "create",
                          "parameter" : [
                            {
                              "valueString" : "Period"
                            }
                          ]
                        }
                      ],
                      "dependent" : [
                        {
                          "name" : "IVLTSPeriod",
                          "variable" : [
                            "ti",
                            "period"
                          ]
                        }
                      ]
                    },
                    {
                      "name" : "partRole",
                      "source" : [
                        {
                          "context" : "part",
                          "element" : "participantRole",
                          "variable" : "partRole"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "bundle",
                          "contextType" : "variable",
                          "element" : "entry",
                          "variable" : "e1"
                        },
                        {
                          "context" : "e1",
                          "contextType" : "variable",
                          "element" : "request",
                          "variable" : "request",
                          "transform" : "create",
                          "parameter" : [
                            {
                              "valueString" : "BackboneElement"
                            }
                          ]
                        },
                        {
                          "context" : "request",
                          "contextType" : "variable",
                          "element" : "method",
                          "transform" : "copy",
                          "parameter" : [
                            {
                              "valueString" : "PUT"
                            }
                          ]
                        },
                        {
                          "context" : "e1",
                          "contextType" : "variable",
                          "element" : "resource",
                          "variable" : "practitioner",
                          "transform" : "create",
                          "parameter" : [
                            {
                              "valueString" : "Practitioner"
                            }
                          ]
                        },
                        {
                          "context" : "practitioner",
                          "contextType" : "variable",
                          "element" : "id",
                          "variable" : "uuid1",
                          "transform" : "uuid"
                        },
                        {
                          "context" : "e1",
                          "contextType" : "variable",
                          "element" : "fullUrl",
                          "transform" : "append",
                          "parameter" : [
                            {
                              "valueString" : "https://example/Practitioner/"
                            },
                            {
                              "valueId" : "uuid1"
                            }
                          ]
                        },
                        {
                          "context" : "request",
                          "contextType" : "variable",
                          "element" : "url",
                          "transform" : "append",
                          "parameter" : [
                            {
                              "valueString" : "Practitioner/"
                            },
                            {
                              "valueId" : "uuid1"
                            }
                          ]
                        }
                      ],
                      "rule" : [
                        {
                          "name" : "meta",
                          "source" : [
                            {
                              "context" : "partRole"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "practitioner",
                              "contextType" : "variable",
                              "element" : "meta",
                              "variable" : "meta"
                            }
                          ],
                          "rule" : [
                            {
                              "name" : "coding",
                              "source" : [
                                {
                                  "context" : "partRole"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "meta",
                                  "contextType" : "variable",
                                  "element" : "tag",
                                  "variable" : "coding",
                                  "transform" : "create",
                                  "parameter" : [
                                    {
                                      "valueString" : "Coding"
                                    }
                                  ]
                                }
                              ],
                              "rule" : [
                                {
                                  "name" : "system",
                                  "source" : [
                                    {
                                      "context" : "partRole"
                                    }
                                  ],
                                  "target" : [
                                    {
                                      "context" : "coding",
                                      "contextType" : "variable",
                                      "element" : "system",
                                      "transform" : "copy",
                                      "parameter" : [
                                        {
                                          "valueString" : "http://algoritmodiscoring"
                                        }
                                      ]
                                    }
                                  ]
                                },
                                {
                                  "name" : "code",
                                  "source" : [
                                    {
                                      "context" : "partRole"
                                    }
                                  ],
                                  "target" : [
                                    {
                                      "context" : "coding",
                                      "contextType" : "variable",
                                      "element" : "code",
                                      "transform" : "copy",
                                      "parameter" : [
                                        {
                                          "valueString" : "ClinicalDocument/body/Encounter/participant"
                                        }
                                      ]
                                    }
                                  ]
                                }
                              ]
                            }
                          ],
                          "documentation" : "modifica meta+identifier"
                        },
                        {
                          "name" : "identifier",
                          "source" : [
                            {
                              "context" : "partRole",
                              "element" : "id",
                              "variable" : "id"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "practitioner",
                              "contextType" : "variable",
                              "element" : "identifier",
                              "variable" : "identifier"
                            }
                          ],
                          "rule" : [
                            {
                              "name" : "root1",
                              "source" : [
                                {
                                  "context" : "id",
                                  "element" : "root",
                                  "variable" : "r"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "identifier",
                                  "contextType" : "variable",
                                  "element" : "system",
                                  "transform" : "translate",
                                  "parameter" : [
                                    {
                                      "valueId" : "r"
                                    },
                                    {
                                      "valueString" : "http://hl7.org/fhir/ConceptMap/special-oid2uri"
                                    },
                                    {
                                      "valueString" : "uri"
                                    }
                                  ]
                                }
                              ]
                            },
                            {
                              "name" : "extension",
                              "source" : [
                                {
                                  "context" : "id",
                                  "element" : "extension",
                                  "variable" : "ext"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "identifier",
                                  "contextType" : "variable",
                                  "element" : "value",
                                  "transform" : "copy",
                                  "parameter" : [
                                    {
                                      "valueId" : "ext"
                                    }
                                  ]
                                }
                              ]
                            },
                            {
                              "name" : "assigningAuthorityName",
                              "source" : [
                                {
                                  "context" : "id",
                                  "element" : "assigningAuthorityName",
                                  "variable" : "s"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "identifier",
                                  "contextType" : "variable",
                                  "element" : "assigner",
                                  "variable" : "a"
                                },
                                {
                                  "context" : "a",
                                  "contextType" : "variable",
                                  "element" : "display",
                                  "transform" : "copy",
                                  "parameter" : [
                                    {
                                      "valueId" : "s"
                                    }
                                  ]
                                }
                              ]
                            },
                            {
                              "name" : "r",
                              "source" : [
                                {
                                  "context" : "id",
                                  "element" : "root",
                                  "variable" : "r"
                                }
                              ],
                              "rule" : [
                                {
                                  "name" : "aut",
                                  "source" : [
                                    {
                                      "context" : "id",
                                      "element" : "extension",
                                      "variable" : "ext"
                                    }
                                  ],
                                  "target" : [
                                    {
                                      "context" : "practitioner",
                                      "contextType" : "variable",
                                      "element" : "id",
                                      "variable" : "uuid2",
                                      "transform" : "evaluate",
                                      "parameter" : [
                                        {
                                          "valueString" : "r + '-' + ext"
                                        }
                                      ]
                                    },
                                    {
                                      "context" : "e1",
                                      "contextType" : "variable",
                                      "element" : "fullUrl",
                                      "transform" : "append",
                                      "parameter" : [
                                        {
                                          "valueString" : "https://example/Practitioner/"
                                        },
                                        {
                                          "valueId" : "uuid2"
                                        }
                                      ]
                                    },
                                    {
                                      "context" : "request",
                                      "contextType" : "variable",
                                      "element" : "url",
                                      "transform" : "append",
                                      "parameter" : [
                                        {
                                          "valueString" : "Practitioner/"
                                        },
                                        {
                                          "valueId" : "uuid2"
                                        }
                                      ]
                                    },
                                    {
                                      "context" : "patarg",
                                      "contextType" : "variable",
                                      "element" : "individual",
                                      "variable" : "reference",
                                      "transform" : "create",
                                      "parameter" : [
                                        {
                                          "valueString" : "Reference"
                                        }
                                      ]
                                    },
                                    {
                                      "context" : "reference",
                                      "contextType" : "variable",
                                      "element" : "reference",
                                      "transform" : "evaluate",
                                      "parameter" : [
                                        {
                                          "valueString" : "'https://example/Practitioner/' + %practitioner.id"
                                        }
                                      ]
                                    }
                                  ]
                                }
                              ]
                            }
                          ]
                        },
                        {
                          "name" : "2.16.840.1.113883.2.9.4.3.2",
                          "source" : [
                            {
                              "context" : "partRole",
                              "element" : "id",
                              "variable" : "id",
                              "condition" : "(root = '2.16.840.1.113883.2.9.4.3.2')"
                            }
                          ],
                          "rule" : [
                            {
                              "name" : "UUID",
                              "source" : [
                                {
                                  "context" : "id",
                                  "element" : "extension",
                                  "variable" : "ext"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "request",
                                  "contextType" : "variable",
                                  "element" : "url",
                                  "transform" : "append",
                                  "parameter" : [
                                    {
                                      "valueString" : "Practitioner?identifier="
                                    },
                                    {
                                      "valueId" : "ext"
                                    }
                                  ]
                                }
                              ]
                            }
                          ]
                        },
                        {
                          "name" : "playEnt",
                          "source" : [
                            {
                              "context" : "partRole",
                              "element" : "playingEntity",
                              "variable" : "playEnt"
                            }
                          ],
                          "rule" : [
                            {
                              "name" : "name",
                              "source" : [
                                {
                                  "context" : "playEnt",
                                  "element" : "name",
                                  "variable" : "vvv"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "practitioner",
                                  "contextType" : "variable",
                                  "element" : "name",
                                  "variable" : "vvv",
                                  "transform" : "create"
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  ],
                  "documentation" : "enc.effectiveTime as eff -> encounter.period = create('Period') as period then{"
                },
                {
                  "name" : "participant2",
                  "source" : [
                    {
                      "context" : "enc",
                      "element" : "participant",
                      "variable" : "part",
                      "condition" : "(typeCode = 'LOC')"
                    }
                  ],
                  "rule" : [
                    {
                      "name" : "location",
                      "source" : [
                        {
                          "context" : "part",
                          "element" : "time",
                          "variable" : "tim"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "encounter",
                          "contextType" : "variable",
                          "element" : "location",
                          "variable" : "locat"
                        }
                      ],
                      "rule" : [
                        {
                          "name" : "time",
                          "source" : [
                            {
                              "context" : "tim"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "locat",
                              "contextType" : "variable",
                              "element" : "period",
                              "variable" : "period",
                              "transform" : "create",
                              "parameter" : [
                                {
                                  "valueString" : "Period"
                                }
                              ]
                            }
                          ],
                          "dependent" : [
                            {
                              "name" : "IVLTSPeriod",
                              "variable" : [
                                "tim",
                                "period"
                              ]
                            }
                          ]
                        },
                        {
                          "name" : "time",
                          "source" : [
                            {
                              "context" : "part",
                              "element" : "time",
                              "variable" : "tim"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "locat",
                              "contextType" : "variable",
                              "element" : "period",
                              "variable" : "period",
                              "transform" : "create",
                              "parameter" : [
                                {
                                  "valueString" : "Period"
                                }
                              ]
                            }
                          ],
                          "rule" : [
                            {
                              "name" : "val",
                              "source" : [
                                {
                                  "context" : "tim"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "period",
                                  "contextType" : "variable",
                                  "element" : "start",
                                  "variable" : "start",
                                  "transform" : "create",
                                  "parameter" : [
                                    {
                                      "valueString" : "dateTime"
                                    }
                                  ]
                                }
                              ],
                              "dependent" : [
                                {
                                  "name" : "TSDateTime",
                                  "variable" : [
                                    "tim",
                                    "start"
                                  ]
                                }
                              ]
                            }
                          ]
                        },
                        {
                          "name" : "partRole",
                          "source" : [
                            {
                              "context" : "part",
                              "element" : "participantRole",
                              "variable" : "partRole"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "bundle",
                              "contextType" : "variable",
                              "element" : "entry",
                              "variable" : "e1"
                            },
                            {
                              "context" : "e1",
                              "contextType" : "variable",
                              "element" : "request",
                              "variable" : "request",
                              "transform" : "create",
                              "parameter" : [
                                {
                                  "valueString" : "BackboneElement"
                                }
                              ]
                            },
                            {
                              "context" : "request",
                              "contextType" : "variable",
                              "element" : "method",
                              "transform" : "copy",
                              "parameter" : [
                                {
                                  "valueString" : "PUT"
                                }
                              ]
                            },
                            {
                              "context" : "e1",
                              "contextType" : "variable",
                              "element" : "resource",
                              "variable" : "location",
                              "transform" : "create",
                              "parameter" : [
                                {
                                  "valueString" : "Location"
                                }
                              ]
                            },
                            {
                              "context" : "location",
                              "contextType" : "variable",
                              "element" : "id",
                              "variable" : "uuid1",
                              "transform" : "uuid"
                            },
                            {
                              "context" : "e1",
                              "contextType" : "variable",
                              "element" : "fullUrl",
                              "transform" : "append",
                              "parameter" : [
                                {
                                  "valueString" : "https://example/Location/"
                                },
                                {
                                  "valueId" : "uuid1"
                                }
                              ]
                            }
                          ],
                          "rule" : [
                            {
                              "name" : "meta",
                              "source" : [
                                {
                                  "context" : "part"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "location",
                                  "contextType" : "variable",
                                  "element" : "meta",
                                  "variable" : "meta"
                                }
                              ],
                              "rule" : [
                                {
                                  "name" : "coding",
                                  "source" : [
                                    {
                                      "context" : "part"
                                    }
                                  ],
                                  "target" : [
                                    {
                                      "context" : "meta",
                                      "contextType" : "variable",
                                      "element" : "tag",
                                      "variable" : "coding",
                                      "transform" : "create",
                                      "parameter" : [
                                        {
                                          "valueString" : "Coding"
                                        }
                                      ]
                                    }
                                  ],
                                  "rule" : [
                                    {
                                      "name" : "system",
                                      "source" : [
                                        {
                                          "context" : "part"
                                        }
                                      ],
                                      "target" : [
                                        {
                                          "context" : "coding",
                                          "contextType" : "variable",
                                          "element" : "system",
                                          "transform" : "copy",
                                          "parameter" : [
                                            {
                                              "valueString" : "http://algoritmodiscoring"
                                            }
                                          ]
                                        }
                                      ]
                                    },
                                    {
                                      "name" : "code",
                                      "source" : [
                                        {
                                          "context" : "part"
                                        }
                                      ],
                                      "target" : [
                                        {
                                          "context" : "coding",
                                          "contextType" : "variable",
                                          "element" : "code",
                                          "transform" : "copy",
                                          "parameter" : [
                                            {
                                              "valueString" : "ClinicalDocument/body/Encounter/participant"
                                            }
                                          ]
                                        }
                                      ]
                                    }
                                  ]
                                }
                              ]
                            },
                            {
                              "name" : "identifier",
                              "source" : [
                                {
                                  "context" : "partRole",
                                  "element" : "id",
                                  "variable" : "id"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "location",
                                  "contextType" : "variable",
                                  "element" : "identifier",
                                  "variable" : "identifier"
                                }
                              ],
                              "rule" : [
                                {
                                  "name" : "root1",
                                  "source" : [
                                    {
                                      "context" : "id",
                                      "element" : "root",
                                      "variable" : "r"
                                    }
                                  ],
                                  "target" : [
                                    {
                                      "context" : "identifier",
                                      "contextType" : "variable",
                                      "element" : "system",
                                      "transform" : "translate",
                                      "parameter" : [
                                        {
                                          "valueId" : "r"
                                        },
                                        {
                                          "valueString" : "http://hl7.org/fhir/ConceptMap/special-oid2uri"
                                        },
                                        {
                                          "valueString" : "uri"
                                        }
                                      ]
                                    }
                                  ]
                                },
                                {
                                  "name" : "ext",
                                  "source" : [
                                    {
                                      "context" : "id",
                                      "element" : "extension",
                                      "variable" : "ext"
                                    }
                                  ],
                                  "target" : [
                                    {
                                      "context" : "identifier",
                                      "contextType" : "variable",
                                      "element" : "value",
                                      "transform" : "copy",
                                      "parameter" : [
                                        {
                                          "valueId" : "ext"
                                        }
                                      ]
                                    }
                                  ],
                                  "rule" : [
                                    {
                                      "name" : "UUID",
                                      "source" : [
                                        {
                                          "context" : "partRole"
                                        }
                                      ],
                                      "target" : [
                                        {
                                          "context" : "request",
                                          "contextType" : "variable",
                                          "element" : "url",
                                          "transform" : "append",
                                          "parameter" : [
                                            {
                                              "valueString" : "Location?identifier="
                                            },
                                            {
                                              "valueId" : "ext"
                                            }
                                          ]
                                        }
                                      ]
                                    }
                                  ]
                                },
                                {
                                  "name" : "assigningAuthorityName",
                                  "source" : [
                                    {
                                      "context" : "id",
                                      "element" : "assigningAuthorityName",
                                      "variable" : "s"
                                    }
                                  ],
                                  "target" : [
                                    {
                                      "context" : "identifier",
                                      "contextType" : "variable",
                                      "element" : "assigner",
                                      "variable" : "a"
                                    },
                                    {
                                      "context" : "a",
                                      "contextType" : "variable",
                                      "element" : "display",
                                      "transform" : "copy",
                                      "parameter" : [
                                        {
                                          "valueId" : "s"
                                        }
                                      ]
                                    }
                                  ]
                                },
                                {
                                  "name" : "r",
                                  "source" : [
                                    {
                                      "context" : "id",
                                      "element" : "root",
                                      "variable" : "r"
                                    }
                                  ],
                                  "rule" : [
                                    {
                                      "name" : "idasi",
                                      "source" : [
                                        {
                                          "context" : "id",
                                          "element" : "extension",
                                          "variable" : "ext"
                                        }
                                      ],
                                      "target" : [
                                        {
                                          "context" : "location",
                                          "contextType" : "variable",
                                          "element" : "id",
                                          "variable" : "uuid",
                                          "transform" : "evaluate",
                                          "parameter" : [
                                            {
                                              "valueString" : "r + '-' + ext"
                                            }
                                          ]
                                        },
                                        {
                                          "context" : "e1",
                                          "contextType" : "variable",
                                          "element" : "fullUrl",
                                          "transform" : "append",
                                          "parameter" : [
                                            {
                                              "valueString" : "https://example/Location/"
                                            },
                                            {
                                              "valueId" : "uuid"
                                            }
                                          ]
                                        },
                                        {
                                          "context" : "locat",
                                          "contextType" : "variable",
                                          "element" : "location",
                                          "variable" : "reference",
                                          "transform" : "create",
                                          "parameter" : [
                                            {
                                              "valueString" : "Reference"
                                            }
                                          ]
                                        },
                                        {
                                          "context" : "reference",
                                          "contextType" : "variable",
                                          "element" : "reference",
                                          "transform" : "evaluate",
                                          "parameter" : [
                                            {
                                              "valueString" : "'https://example/Location/' + %location.id"
                                            }
                                          ]
                                        }
                                      ]
                                    }
                                  ]
                                }
                              ]
                            },
                            {
                              "name" : "code",
                              "source" : [
                                {
                                  "context" : "partRole",
                                  "element" : "code",
                                  "variable" : "vvv"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "location",
                                  "contextType" : "variable",
                                  "element" : "type",
                                  "variable" : "vvv",
                                  "transform" : "create"
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  ]
                },
                {
                  "name" : "entryRel-SUBJ",
                  "source" : [
                    {
                      "context" : "enc",
                      "element" : "entryRelationship",
                      "variable" : "entr"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "bundle",
                      "contextType" : "variable",
                      "element" : "entry",
                      "variable" : "e1"
                    },
                    {
                      "context" : "e1",
                      "contextType" : "variable",
                      "element" : "request",
                      "variable" : "request",
                      "transform" : "create",
                      "parameter" : [
                        {
                          "valueString" : "BackboneElement"
                        }
                      ]
                    },
                    {
                      "context" : "request",
                      "contextType" : "variable",
                      "element" : "method",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "POST"
                        }
                      ]
                    },
                    {
                      "context" : "e1",
                      "contextType" : "variable",
                      "element" : "resource",
                      "variable" : "observation",
                      "transform" : "create",
                      "parameter" : [
                        {
                          "valueString" : "Observation"
                        }
                      ]
                    },
                    {
                      "context" : "observation",
                      "contextType" : "variable",
                      "element" : "id",
                      "variable" : "uuid1",
                      "transform" : "uuid"
                    },
                    {
                      "context" : "e1",
                      "contextType" : "variable",
                      "element" : "fullUrl",
                      "transform" : "append",
                      "parameter" : [
                        {
                          "valueString" : "https://example/Observation/"
                        },
                        {
                          "valueId" : "uuid1"
                        }
                      ]
                    },
                    {
                      "context" : "request",
                      "contextType" : "variable",
                      "element" : "url",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "Observation"
                        }
                      ]
                    },
                    {
                      "context" : "encounter",
                      "contextType" : "variable",
                      "element" : "reasonReference",
                      "variable" : "reference",
                      "transform" : "create",
                      "parameter" : [
                        {
                          "valueString" : "Reference"
                        }
                      ]
                    },
                    {
                      "context" : "reference",
                      "contextType" : "variable",
                      "element" : "reference",
                      "transform" : "evaluate",
                      "parameter" : [
                        {
                          "valueString" : "'https://example/Observation/' + %observation.id"
                        }
                      ]
                    }
                  ],
                  "rule" : [
                    {
                      "name" : "act",
                      "source" : [
                        {
                          "context" : "entr",
                          "element" : "act",
                          "variable" : "act"
                        }
                      ],
                      "rule" : [
                        {
                          "name" : "code",
                          "source" : [
                            {
                              "context" : "act",
                              "element" : "code",
                              "variable" : "vvv"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "observation",
                              "contextType" : "variable",
                              "element" : "code",
                              "variable" : "vvv",
                              "transform" : "create"
                            }
                          ]
                        },
                        {
                          "name" : "reference",
                          "source" : [
                            {
                              "context" : "act"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "observation",
                              "contextType" : "variable",
                              "element" : "subject",
                              "variable" : "reference",
                              "transform" : "create",
                              "parameter" : [
                                {
                                  "valueString" : "Reference"
                                }
                              ]
                            },
                            {
                              "context" : "reference",
                              "contextType" : "variable",
                              "element" : "reference",
                              "transform" : "evaluate",
                              "parameter" : [
                                {
                                  "valueString" : "'https://example/Patient/' + %patient.id"
                                }
                              ]
                            }
                          ]
                        },
                        {
                          "name" : "reference",
                          "source" : [
                            {
                              "context" : "act"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "observation",
                              "contextType" : "variable",
                              "element" : "encounter",
                              "variable" : "reference",
                              "transform" : "create",
                              "parameter" : [
                                {
                                  "valueString" : "Reference"
                                }
                              ]
                            },
                            {
                              "context" : "reference",
                              "contextType" : "variable",
                              "element" : "reference",
                              "transform" : "evaluate",
                              "parameter" : [
                                {
                                  "valueString" : "'https://example/Encounter/' + %enc1.id"
                                }
                              ]
                            }
                          ]
                        },
                        {
                          "name" : "statuscode",
                          "source" : [
                            {
                              "context" : "act",
                              "condition" : "act.statusCode.exists().not()"
                            }
                          ],
                          "rule" : [
                            {
                              "name" : "status",
                              "source" : [
                                {
                                  "context" : "act"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "observation",
                                  "contextType" : "variable",
                                  "element" : "status",
                                  "transform" : "copy",
                                  "parameter" : [
                                    {
                                      "valueString" : "final"
                                    }
                                  ]
                                }
                              ]
                            }
                          ]
                        },
                        {
                          "name" : "note",
                          "source" : [
                            {
                              "context" : "act"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "observation",
                              "contextType" : "variable",
                              "element" : "note",
                              "variable" : "note",
                              "transform" : "create",
                              "parameter" : [
                                {
                                  "valueString" : "Annotation"
                                }
                              ]
                            }
                          ],
                          "rule" : [
                            {
                              "name" : "text",
                              "source" : [
                                {
                                  "context" : "act",
                                  "element" : "text",
                                  "variable" : "text"
                                }
                              ],
                              "rule" : [
                                {
                                  "name" : "reference",
                                  "source" : [
                                    {
                                      "context" : "text",
                                      "element" : "reference",
                                      "variable" : "reff"
                                    }
                                  ],
                                  "target" : [
                                    {
                                      "context" : "note",
                                      "contextType" : "variable",
                                      "element" : "text",
                                      "transform" : "evaluate",
                                      "parameter" : [
                                        {
                                          "valueString" : "reff.value"
                                        }
                                      ]
                                    }
                                  ]
                                }
                              ]
                            },
                            {
                              "name" : "String",
                              "source" : [
                                {
                                  "context" : "act",
                                  "element" : "text",
                                  "variable" : "tx"
                                }
                              ],
                              "rule" : [
                                {
                                  "name" : "val",
                                  "source" : [
                                    {
                                      "context" : "tx",
                                      "element" : "reference",
                                      "variable" : "ref"
                                    }
                                  ],
                                  "target" : [
                                    {
                                      "context" : "note",
                                      "contextType" : "variable",
                                      "element" : "text",
                                      "transform" : "evaluate",
                                      "parameter" : [
                                        {
                                          "valueString" : "ref.value"
                                        }
                                      ]
                                    }
                                  ]
                                }
                              ]
                            },
                            {
                              "name" : "practitioner",
                              "source" : [
                                {
                                  "context" : "act",
                                  "element" : "author",
                                  "variable" : "auth"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "bundle",
                                  "contextType" : "variable",
                                  "element" : "entry",
                                  "variable" : "e1"
                                },
                                {
                                  "context" : "e1",
                                  "contextType" : "variable",
                                  "element" : "request",
                                  "variable" : "request",
                                  "transform" : "create",
                                  "parameter" : [
                                    {
                                      "valueString" : "BackboneElement"
                                    }
                                  ]
                                },
                                {
                                  "context" : "request",
                                  "contextType" : "variable",
                                  "element" : "method",
                                  "transform" : "copy",
                                  "parameter" : [
                                    {
                                      "valueString" : "PUT"
                                    }
                                  ]
                                },
                                {
                                  "context" : "e1",
                                  "contextType" : "variable",
                                  "element" : "resource",
                                  "variable" : "practitioner",
                                  "transform" : "create",
                                  "parameter" : [
                                    {
                                      "valueString" : "Practitioner"
                                    }
                                  ]
                                },
                                {
                                  "context" : "practitioner",
                                  "contextType" : "variable",
                                  "element" : "id",
                                  "variable" : "uuid1",
                                  "transform" : "uuid"
                                },
                                {
                                  "context" : "e1",
                                  "contextType" : "variable",
                                  "element" : "fullUrl",
                                  "transform" : "append",
                                  "parameter" : [
                                    {
                                      "valueString" : "https://example/Practitioner/"
                                    },
                                    {
                                      "valueId" : "uuid1"
                                    }
                                  ]
                                },
                                {
                                  "context" : "request",
                                  "contextType" : "variable",
                                  "element" : "url",
                                  "transform" : "append",
                                  "parameter" : [
                                    {
                                      "valueString" : "Practitioner/"
                                    },
                                    {
                                      "valueId" : "uuid1"
                                    }
                                  ]
                                }
                              ],
                              "rule" : [
                                {
                                  "name" : "notetime",
                                  "source" : [
                                    {
                                      "context" : "auth",
                                      "element" : "time",
                                      "variable" : "ti"
                                    }
                                  ],
                                  "target" : [
                                    {
                                      "context" : "note",
                                      "contextType" : "variable",
                                      "element" : "time",
                                      "variable" : "value",
                                      "transform" : "create",
                                      "parameter" : [
                                        {
                                          "valueString" : "dateTime"
                                        }
                                      ]
                                    }
                                  ],
                                  "dependent" : [
                                    {
                                      "name" : "TSDateTime",
                                      "variable" : [
                                        "ti",
                                        "value"
                                      ]
                                    }
                                  ]
                                },
                                {
                                  "name" : "assAush",
                                  "source" : [
                                    {
                                      "context" : "auth",
                                      "element" : "assignedAuthor",
                                      "variable" : "assAuth"
                                    }
                                  ],
                                  "rule" : [
                                    {
                                      "name" : "meta",
                                      "source" : [
                                        {
                                          "context" : "assAuth"
                                        }
                                      ],
                                      "target" : [
                                        {
                                          "context" : "practitioner",
                                          "contextType" : "variable",
                                          "element" : "meta",
                                          "variable" : "meta"
                                        }
                                      ],
                                      "rule" : [
                                        {
                                          "name" : "coding",
                                          "source" : [
                                            {
                                              "context" : "assAuth"
                                            }
                                          ],
                                          "target" : [
                                            {
                                              "context" : "meta",
                                              "contextType" : "variable",
                                              "element" : "tag",
                                              "variable" : "coding",
                                              "transform" : "create",
                                              "parameter" : [
                                                {
                                                  "valueString" : "Coding"
                                                }
                                              ]
                                            }
                                          ],
                                          "rule" : [
                                            {
                                              "name" : "system",
                                              "source" : [
                                                {
                                                  "context" : "assAuth"
                                                }
                                              ],
                                              "target" : [
                                                {
                                                  "context" : "coding",
                                                  "contextType" : "variable",
                                                  "element" : "system",
                                                  "transform" : "copy",
                                                  "parameter" : [
                                                    {
                                                      "valueString" : "http://algoritmodiscoring"
                                                    }
                                                  ]
                                                }
                                              ]
                                            },
                                            {
                                              "name" : "code",
                                              "source" : [
                                                {
                                                  "context" : "assAuth"
                                                }
                                              ],
                                              "target" : [
                                                {
                                                  "context" : "coding",
                                                  "contextType" : "variable",
                                                  "element" : "code",
                                                  "transform" : "copy",
                                                  "parameter" : [
                                                    {
                                                      "valueString" : "ClinicalDocument/body/Encounter/author"
                                                    }
                                                  ]
                                                }
                                              ]
                                            }
                                          ]
                                        }
                                      ]
                                    },
                                    {
                                      "name" : "identifier",
                                      "source" : [
                                        {
                                          "context" : "assAuth",
                                          "element" : "id",
                                          "variable" : "id"
                                        }
                                      ],
                                      "target" : [
                                        {
                                          "context" : "practitioner",
                                          "contextType" : "variable",
                                          "element" : "identifier",
                                          "variable" : "identifier"
                                        }
                                      ],
                                      "rule" : [
                                        {
                                          "name" : "root1",
                                          "source" : [
                                            {
                                              "context" : "id",
                                              "element" : "root",
                                              "variable" : "r"
                                            }
                                          ],
                                          "target" : [
                                            {
                                              "context" : "identifier",
                                              "contextType" : "variable",
                                              "element" : "system",
                                              "transform" : "translate",
                                              "parameter" : [
                                                {
                                                  "valueId" : "r"
                                                },
                                                {
                                                  "valueString" : "http://hl7.org/fhir/ConceptMap/special-oid2uri"
                                                },
                                                {
                                                  "valueString" : "uri"
                                                }
                                              ]
                                            }
                                          ]
                                        },
                                        {
                                          "name" : "extension",
                                          "source" : [
                                            {
                                              "context" : "id",
                                              "element" : "extension",
                                              "variable" : "ext"
                                            }
                                          ],
                                          "target" : [
                                            {
                                              "context" : "identifier",
                                              "contextType" : "variable",
                                              "element" : "value",
                                              "transform" : "copy",
                                              "parameter" : [
                                                {
                                                  "valueId" : "ext"
                                                }
                                              ]
                                            }
                                          ]
                                        },
                                        {
                                          "name" : "assigningAuthorityName",
                                          "source" : [
                                            {
                                              "context" : "id",
                                              "element" : "assigningAuthorityName",
                                              "variable" : "s"
                                            }
                                          ],
                                          "target" : [
                                            {
                                              "context" : "identifier",
                                              "contextType" : "variable",
                                              "element" : "assigner",
                                              "variable" : "a"
                                            },
                                            {
                                              "context" : "a",
                                              "contextType" : "variable",
                                              "element" : "display",
                                              "transform" : "copy",
                                              "parameter" : [
                                                {
                                                  "valueId" : "s"
                                                }
                                              ]
                                            }
                                          ]
                                        },
                                        {
                                          "name" : "r",
                                          "source" : [
                                            {
                                              "context" : "id",
                                              "element" : "root",
                                              "variable" : "r"
                                            }
                                          ],
                                          "rule" : [
                                            {
                                              "name" : "aut",
                                              "source" : [
                                                {
                                                  "context" : "id",
                                                  "element" : "extension",
                                                  "variable" : "ext"
                                                }
                                              ],
                                              "target" : [
                                                {
                                                  "context" : "practitioner",
                                                  "contextType" : "variable",
                                                  "element" : "id",
                                                  "variable" : "uuid2",
                                                  "transform" : "evaluate",
                                                  "parameter" : [
                                                    {
                                                      "valueString" : "r + '-' + ext"
                                                    }
                                                  ]
                                                },
                                                {
                                                  "context" : "e1",
                                                  "contextType" : "variable",
                                                  "element" : "fullUrl",
                                                  "transform" : "append",
                                                  "parameter" : [
                                                    {
                                                      "valueString" : "https://example/Practitioner/"
                                                    },
                                                    {
                                                      "valueId" : "uuid2"
                                                    }
                                                  ]
                                                },
                                                {
                                                  "context" : "request",
                                                  "contextType" : "variable",
                                                  "element" : "url",
                                                  "transform" : "append",
                                                  "parameter" : [
                                                    {
                                                      "valueString" : "Practitioner/"
                                                    },
                                                    {
                                                      "valueId" : "uuid2"
                                                    }
                                                  ]
                                                },
                                                {
                                                  "context" : "note",
                                                  "contextType" : "variable",
                                                  "element" : "author",
                                                  "variable" : "reference",
                                                  "transform" : "create",
                                                  "parameter" : [
                                                    {
                                                      "valueString" : "Reference"
                                                    }
                                                  ]
                                                },
                                                {
                                                  "context" : "reference",
                                                  "contextType" : "variable",
                                                  "element" : "reference",
                                                  "transform" : "evaluate",
                                                  "parameter" : [
                                                    {
                                                      "valueString" : "'https://example/Practitioner/' + %practitioner.id"
                                                    }
                                                  ]
                                                }
                                              ]
                                            }
                                          ]
                                        }
                                      ]
                                    },
                                    {
                                      "name" : "2.16.840.1.113883.2.9.4.3.2",
                                      "source" : [
                                        {
                                          "context" : "assAuth",
                                          "element" : "id",
                                          "variable" : "id",
                                          "condition" : "(root = '2.16.840.1.113883.2.9.4.3.2')"
                                        }
                                      ],
                                      "rule" : [
                                        {
                                          "name" : "UUID",
                                          "source" : [
                                            {
                                              "context" : "id",
                                              "element" : "extension",
                                              "variable" : "ext"
                                            }
                                          ],
                                          "target" : [
                                            {
                                              "context" : "request",
                                              "contextType" : "variable",
                                              "element" : "url",
                                              "transform" : "append",
                                              "parameter" : [
                                                {
                                                  "valueString" : "Practitioner?identifier="
                                                },
                                                {
                                                  "valueId" : "ext"
                                                }
                                              ]
                                            }
                                          ]
                                        }
                                      ]
                                    },
                                    {
                                      "name" : "time",
                                      "source" : [
                                        {
                                          "context" : "assAuth",
                                          "element" : "time",
                                          "variable" : "t"
                                        }
                                      ],
                                      "target" : [
                                        {
                                          "context" : "note",
                                          "contextType" : "variable",
                                          "element" : "text",
                                          "variable" : "value",
                                          "transform" : "create",
                                          "parameter" : [
                                            {
                                              "valueString" : "dateTime"
                                            }
                                          ]
                                        }
                                      ],
                                      "dependent" : [
                                        {
                                          "name" : "TSDateTime",
                                          "variable" : [
                                            "t",
                                            "value"
                                          ]
                                        }
                                      ],
                                      "documentation" : "fine modifica"
                                    },
                                    {
                                      "name" : "name",
                                      "source" : [
                                        {
                                          "context" : "assAuth",
                                          "element" : "assignedPerson",
                                          "variable" : "assPers"
                                        }
                                      ],
                                      "rule" : [
                                        {
                                          "name" : "name",
                                          "source" : [
                                            {
                                              "context" : "assPers",
                                              "element" : "name",
                                              "variable" : "vvv"
                                            }
                                          ],
                                          "target" : [
                                            {
                                              "context" : "practitioner",
                                              "contextType" : "variable",
                                              "element" : "name",
                                              "variable" : "vvv",
                                              "transform" : "create"
                                            }
                                          ]
                                        }
                                      ]
                                    }
                                  ]
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ]
        }
      ]
    },
    {
      "name" : "ClinicalDocumentSectionConsulenza",
      "typeMode" : "none",
      "documentation" : "--------------------------------------------------------------------------------------------------------\r\nSezione Consulenza--------------------------------------------------------------------------------------",
      "input" : [
        {
          "name" : "cda",
          "type" : "ClinicalDocument",
          "mode" : "source"
        },
        {
          "name" : "src",
          "type" : "Section",
          "mode" : "source"
        },
        {
          "name" : "patient",
          "type" : "Patient",
          "mode" : "target"
        },
        {
          "name" : "tgt",
          "mode" : "target"
        },
        {
          "name" : "bundle",
          "type" : "Bundle",
          "mode" : "target"
        },
        {
          "name" : "enc",
          "type" : "Encounter",
          "mode" : "target"
        }
      ],
      "rule" : [
        {
          "name" : "title",
          "source" : [
            {
              "context" : "src",
              "element" : "title",
              "variable" : "t"
            }
          ],
          "target" : [
            {
              "context" : "tgt",
              "contextType" : "variable",
              "element" : "title",
              "transform" : "evaluate",
              "parameter" : [
                {
                  "valueString" : "t.dataString"
                }
              ]
            }
          ]
        },
        {
          "name" : "code",
          "source" : [
            {
              "context" : "src",
              "element" : "code",
              "variable" : "vvv"
            }
          ],
          "target" : [
            {
              "context" : "tgt",
              "contextType" : "variable",
              "element" : "code",
              "variable" : "vvv",
              "transform" : "create"
            }
          ]
        },
        {
          "name" : "entry-exists",
          "source" : [
            {
              "context" : "src",
              "condition" : "src.entry.exists()"
            }
          ],
          "rule" : [
            {
              "name" : "cdaText",
              "source" : [
                {
                  "context" : "src",
                  "element" : "text",
                  "variable" : "cdaText"
                }
              ],
              "target" : [
                {
                  "context" : "tgt",
                  "contextType" : "variable",
                  "element" : "text",
                  "variable" : "fhirText"
                }
              ],
              "rule" : [
                {
                  "name" : "narrativeStatus",
                  "source" : [
                    {
                      "context" : "cdaText"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "fhirText",
                      "contextType" : "variable",
                      "element" : "status",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "generated"
                        }
                      ]
                    }
                  ]
                },
                {
                  "name" : "narrativeText",
                  "source" : [
                    {
                      "context" : "cdaText",
                      "variable" : "t"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "fhirText",
                      "contextType" : "variable",
                      "element" : "div",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueId" : "t"
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ]
        },
        {
          "name" : "where",
          "source" : [
            {
              "context" : "src",
              "condition" : "src.entry.exists().not()"
            }
          ],
          "rule" : [
            {
              "name" : "cdaText",
              "source" : [
                {
                  "context" : "src",
                  "element" : "text",
                  "variable" : "cdaText"
                }
              ],
              "target" : [
                {
                  "context" : "bundle",
                  "contextType" : "variable",
                  "element" : "entry",
                  "variable" : "e8"
                },
                {
                  "context" : "e8",
                  "contextType" : "variable",
                  "element" : "request",
                  "variable" : "request",
                  "transform" : "create",
                  "parameter" : [
                    {
                      "valueString" : "BackboneElement"
                    }
                  ]
                },
                {
                  "context" : "request",
                  "contextType" : "variable",
                  "element" : "method",
                  "transform" : "copy",
                  "parameter" : [
                    {
                      "valueString" : "POST"
                    }
                  ]
                },
                {
                  "context" : "e8",
                  "contextType" : "variable",
                  "element" : "resource",
                  "variable" : "ServiceRequest",
                  "transform" : "create",
                  "parameter" : [
                    {
                      "valueString" : "ServiceRequest"
                    }
                  ]
                },
                {
                  "context" : "ServiceRequest",
                  "contextType" : "variable",
                  "element" : "id",
                  "variable" : "uuid8",
                  "transform" : "uuid"
                },
                {
                  "context" : "e8",
                  "contextType" : "variable",
                  "element" : "fullUrl",
                  "transform" : "append",
                  "parameter" : [
                    {
                      "valueString" : "https://example/ServiceRequest/"
                    },
                    {
                      "valueId" : "uuid8"
                    }
                  ]
                },
                {
                  "context" : "request",
                  "contextType" : "variable",
                  "element" : "url",
                  "transform" : "copy",
                  "parameter" : [
                    {
                      "valueString" : "ServiceRequest"
                    }
                  ]
                },
                {
                  "context" : "tgt",
                  "contextType" : "variable",
                  "element" : "entry",
                  "variable" : "reference",
                  "transform" : "create",
                  "parameter" : [
                    {
                      "valueString" : "Reference"
                    }
                  ]
                },
                {
                  "context" : "reference",
                  "contextType" : "variable",
                  "element" : "reference",
                  "transform" : "evaluate",
                  "parameter" : [
                    {
                      "valueString" : "'https://example/ServiceRequest/' + %ServiceRequest.id"
                    }
                  ]
                }
              ],
              "rule" : [
                {
                  "name" : "reference",
                  "source" : [
                    {
                      "context" : "src"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "ServiceRequest",
                      "contextType" : "variable",
                      "element" : "subject",
                      "variable" : "reference",
                      "transform" : "create",
                      "parameter" : [
                        {
                          "valueString" : "Reference"
                        }
                      ]
                    },
                    {
                      "context" : "reference",
                      "contextType" : "variable",
                      "element" : "reference",
                      "transform" : "evaluate",
                      "parameter" : [
                        {
                          "valueString" : "'https://example/Patient/' + %patient.id"
                        }
                      ]
                    }
                  ]
                },
                {
                  "name" : "reference",
                  "source" : [
                    {
                      "context" : "src"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "ServiceRequest",
                      "contextType" : "variable",
                      "element" : "encounter",
                      "variable" : "reference",
                      "transform" : "create",
                      "parameter" : [
                        {
                          "valueString" : "Reference"
                        }
                      ]
                    },
                    {
                      "context" : "reference",
                      "contextType" : "variable",
                      "element" : "reference",
                      "transform" : "evaluate",
                      "parameter" : [
                        {
                          "valueString" : "'https://example/Encounter/' + %enc.id"
                        }
                      ]
                    }
                  ]
                },
                {
                  "name" : "status",
                  "source" : [
                    {
                      "context" : "src"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "ServiceRequest",
                      "contextType" : "variable",
                      "element" : "status",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "active"
                        }
                      ]
                    }
                  ]
                },
                {
                  "name" : "intent",
                  "source" : [
                    {
                      "context" : "src"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "ServiceRequest",
                      "contextType" : "variable",
                      "element" : "intent",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "order"
                        }
                      ]
                    }
                  ]
                },
                {
                  "name" : "reference",
                  "source" : [
                    {
                      "context" : "cdaText"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "ServiceRequest",
                      "contextType" : "variable",
                      "element" : "note",
                      "variable" : "note"
                    }
                  ],
                  "rule" : [
                    {
                      "name" : "reference",
                      "source" : [
                        {
                          "context" : "cdaText",
                          "variable" : "t"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "note",
                          "contextType" : "variable",
                          "element" : "text",
                          "transform" : "copy",
                          "parameter" : [
                            {
                              "valueId" : "t"
                            }
                          ]
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ],
          "documentation" : "Sezione Narrativa--------------------------------------------------------------------------------------------------------------------------------------------------"
        },
        {
          "name" : "entry",
          "source" : [
            {
              "context" : "src",
              "element" : "entry",
              "variable" : "entry1"
            }
          ],
          "target" : [
            {
              "context" : "bundle",
              "contextType" : "variable",
              "element" : "entry",
              "variable" : "e1"
            },
            {
              "context" : "e1",
              "contextType" : "variable",
              "element" : "request",
              "variable" : "request",
              "transform" : "create",
              "parameter" : [
                {
                  "valueString" : "BackboneElement"
                }
              ]
            },
            {
              "context" : "request",
              "contextType" : "variable",
              "element" : "method",
              "transform" : "copy",
              "parameter" : [
                {
                  "valueString" : "POST"
                }
              ]
            },
            {
              "context" : "e1",
              "contextType" : "variable",
              "element" : "resource",
              "variable" : "serviceRequest",
              "transform" : "create",
              "parameter" : [
                {
                  "valueString" : "ServiceRequest"
                }
              ]
            },
            {
              "context" : "serviceRequest",
              "contextType" : "variable",
              "element" : "id",
              "variable" : "uuid1",
              "transform" : "uuid"
            },
            {
              "context" : "e1",
              "contextType" : "variable",
              "element" : "fullUrl",
              "transform" : "append",
              "parameter" : [
                {
                  "valueString" : "https://example/ServiceRequest/"
                },
                {
                  "valueId" : "uuid1"
                }
              ]
            },
            {
              "context" : "request",
              "contextType" : "variable",
              "element" : "url",
              "transform" : "copy",
              "parameter" : [
                {
                  "valueString" : "ServiceRequest"
                }
              ]
            },
            {
              "context" : "tgt",
              "contextType" : "variable",
              "element" : "entry",
              "variable" : "reference",
              "transform" : "create",
              "parameter" : [
                {
                  "valueString" : "Reference"
                }
              ]
            },
            {
              "context" : "reference",
              "contextType" : "variable",
              "element" : "reference",
              "transform" : "evaluate",
              "parameter" : [
                {
                  "valueString" : "'https://example/ServiceRequest/' + %serviceRequest.id"
                }
              ]
            },
            {
              "context" : "serviceRequest",
              "contextType" : "variable",
              "element" : "note",
              "variable" : "note"
            }
          ],
          "rule" : [
            {
              "name" : "reference",
              "source" : [
                {
                  "context" : "entry1"
                }
              ],
              "target" : [
                {
                  "context" : "serviceRequest",
                  "contextType" : "variable",
                  "element" : "subject",
                  "variable" : "reference",
                  "transform" : "create",
                  "parameter" : [
                    {
                      "valueString" : "Reference"
                    }
                  ]
                },
                {
                  "context" : "reference",
                  "contextType" : "variable",
                  "element" : "reference",
                  "transform" : "evaluate",
                  "parameter" : [
                    {
                      "valueString" : "'https://example/Patient/' + %patient.id"
                    }
                  ]
                }
              ]
            },
            {
              "name" : "reference",
              "source" : [
                {
                  "context" : "entry1"
                }
              ],
              "target" : [
                {
                  "context" : "serviceRequest",
                  "contextType" : "variable",
                  "element" : "encounter",
                  "variable" : "reference",
                  "transform" : "create",
                  "parameter" : [
                    {
                      "valueString" : "Reference"
                    }
                  ]
                },
                {
                  "context" : "reference",
                  "contextType" : "variable",
                  "element" : "reference",
                  "transform" : "evaluate",
                  "parameter" : [
                    {
                      "valueString" : "'https://example/Encounter/' + %enc.id"
                    }
                  ]
                }
              ]
            },
            {
              "name" : "status",
              "source" : [
                {
                  "context" : "entry1"
                }
              ],
              "target" : [
                {
                  "context" : "serviceRequest",
                  "contextType" : "variable",
                  "element" : "status",
                  "transform" : "copy",
                  "parameter" : [
                    {
                      "valueString" : "active"
                    }
                  ]
                }
              ]
            },
            {
              "name" : "intent",
              "source" : [
                {
                  "context" : "entry1"
                }
              ],
              "target" : [
                {
                  "context" : "serviceRequest",
                  "contextType" : "variable",
                  "element" : "intent",
                  "transform" : "copy",
                  "parameter" : [
                    {
                      "valueString" : "order"
                    }
                  ]
                }
              ]
            },
            {
              "name" : "ACT",
              "source" : [
                {
                  "context" : "entry1",
                  "element" : "act",
                  "variable" : "act"
                }
              ],
              "rule" : [
                {
                  "name" : "code",
                  "source" : [
                    {
                      "context" : "act",
                      "element" : "code",
                      "variable" : "vvv"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "serviceRequest",
                      "contextType" : "variable",
                      "element" : "code",
                      "variable" : "vvv",
                      "transform" : "create"
                    }
                  ]
                },
                {
                  "name" : "text",
                  "source" : [
                    {
                      "context" : "act",
                      "element" : "text",
                      "variable" : "t"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "note",
                      "contextType" : "variable",
                      "element" : "text",
                      "transform" : "evaluate",
                      "parameter" : [
                        {
                          "valueString" : "t.dataString"
                        }
                      ]
                    }
                  ]
                },
                {
                  "name" : "statusCode",
                  "source" : [
                    {
                      "context" : "act",
                      "element" : "statusCode",
                      "variable" : "code"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "serviceRequest",
                      "contextType" : "variable",
                      "element" : "status",
                      "transform" : "evaluate",
                      "parameter" : [
                        {
                          "valueString" : "code.code"
                        }
                      ]
                    }
                  ]
                },
                {
                  "name" : "performer",
                  "source" : [
                    {
                      "context" : "act",
                      "element" : "performer",
                      "variable" : "perf"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "bundle",
                      "contextType" : "variable",
                      "element" : "entry",
                      "variable" : "e1"
                    },
                    {
                      "context" : "e1",
                      "contextType" : "variable",
                      "element" : "request",
                      "variable" : "request",
                      "transform" : "create",
                      "parameter" : [
                        {
                          "valueString" : "BackboneElement"
                        }
                      ]
                    },
                    {
                      "context" : "request",
                      "contextType" : "variable",
                      "element" : "method",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "PUT"
                        }
                      ]
                    },
                    {
                      "context" : "e1",
                      "contextType" : "variable",
                      "element" : "resource",
                      "variable" : "practitioner",
                      "transform" : "create",
                      "parameter" : [
                        {
                          "valueString" : "Practitioner"
                        }
                      ]
                    },
                    {
                      "context" : "practitioner",
                      "contextType" : "variable",
                      "element" : "id",
                      "variable" : "uuid1",
                      "transform" : "uuid"
                    },
                    {
                      "context" : "e1",
                      "contextType" : "variable",
                      "element" : "fullUrl",
                      "transform" : "append",
                      "parameter" : [
                        {
                          "valueString" : "https://example/Practitioner/"
                        },
                        {
                          "valueId" : "uuid1"
                        }
                      ]
                    },
                    {
                      "context" : "request",
                      "contextType" : "variable",
                      "element" : "url",
                      "transform" : "append",
                      "parameter" : [
                        {
                          "valueString" : "Practitioner/"
                        },
                        {
                          "valueId" : "uuid1"
                        }
                      ]
                    }
                  ],
                  "rule" : [
                    {
                      "name" : "time",
                      "source" : [
                        {
                          "context" : "perf",
                          "element" : "time",
                          "variable" : "time"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "serviceRequest",
                          "contextType" : "variable",
                          "element" : "occurrence",
                          "variable" : "t",
                          "transform" : "create",
                          "parameter" : [
                            {
                              "valueString" : "dateTime"
                            }
                          ]
                        }
                      ],
                      "dependent" : [
                        {
                          "name" : "TSDateTime",
                          "variable" : [
                            "time",
                            "t"
                          ]
                        }
                      ]
                    },
                    {
                      "name" : "assEnt",
                      "source" : [
                        {
                          "context" : "perf",
                          "element" : "assignedEntity",
                          "variable" : "assEnt"
                        }
                      ],
                      "rule" : [
                        {
                          "name" : "meta",
                          "source" : [
                            {
                              "context" : "assEnt"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "practitioner",
                              "contextType" : "variable",
                              "element" : "meta",
                              "variable" : "meta"
                            }
                          ],
                          "rule" : [
                            {
                              "name" : "coding",
                              "source" : [
                                {
                                  "context" : "assEnt"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "meta",
                                  "contextType" : "variable",
                                  "element" : "tag",
                                  "variable" : "coding",
                                  "transform" : "create",
                                  "parameter" : [
                                    {
                                      "valueString" : "Coding"
                                    }
                                  ]
                                }
                              ],
                              "rule" : [
                                {
                                  "name" : "system",
                                  "source" : [
                                    {
                                      "context" : "assEnt"
                                    }
                                  ],
                                  "target" : [
                                    {
                                      "context" : "coding",
                                      "contextType" : "variable",
                                      "element" : "system",
                                      "transform" : "copy",
                                      "parameter" : [
                                        {
                                          "valueString" : "http://algoritmodiscoring"
                                        }
                                      ]
                                    }
                                  ]
                                },
                                {
                                  "name" : "code",
                                  "source" : [
                                    {
                                      "context" : "assEnt"
                                    }
                                  ],
                                  "target" : [
                                    {
                                      "context" : "coding",
                                      "contextType" : "variable",
                                      "element" : "code",
                                      "transform" : "copy",
                                      "parameter" : [
                                        {
                                          "valueString" : "ClinicalDocument/body/Consulenze/performer"
                                        }
                                      ]
                                    }
                                  ]
                                }
                              ]
                            }
                          ]
                        },
                        {
                          "name" : "identifier",
                          "source" : [
                            {
                              "context" : "assEnt",
                              "element" : "id",
                              "variable" : "id"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "practitioner",
                              "contextType" : "variable",
                              "element" : "identifier",
                              "variable" : "identifier"
                            }
                          ],
                          "rule" : [
                            {
                              "name" : "root1",
                              "source" : [
                                {
                                  "context" : "id",
                                  "element" : "root",
                                  "variable" : "r"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "identifier",
                                  "contextType" : "variable",
                                  "element" : "system",
                                  "transform" : "translate",
                                  "parameter" : [
                                    {
                                      "valueId" : "r"
                                    },
                                    {
                                      "valueString" : "http://hl7.org/fhir/ConceptMap/special-oid2uri"
                                    },
                                    {
                                      "valueString" : "uri"
                                    }
                                  ]
                                }
                              ]
                            },
                            {
                              "name" : "extension",
                              "source" : [
                                {
                                  "context" : "id",
                                  "element" : "extension",
                                  "variable" : "ext"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "identifier",
                                  "contextType" : "variable",
                                  "element" : "value",
                                  "transform" : "copy",
                                  "parameter" : [
                                    {
                                      "valueId" : "ext"
                                    }
                                  ]
                                }
                              ]
                            },
                            {
                              "name" : "assigningAuthorityName",
                              "source" : [
                                {
                                  "context" : "id",
                                  "element" : "assigningAuthorityName",
                                  "variable" : "s"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "identifier",
                                  "contextType" : "variable",
                                  "element" : "assigner",
                                  "variable" : "a"
                                },
                                {
                                  "context" : "a",
                                  "contextType" : "variable",
                                  "element" : "display",
                                  "transform" : "copy",
                                  "parameter" : [
                                    {
                                      "valueId" : "s"
                                    }
                                  ]
                                }
                              ]
                            },
                            {
                              "name" : "r",
                              "source" : [
                                {
                                  "context" : "id",
                                  "element" : "root",
                                  "variable" : "r"
                                }
                              ],
                              "rule" : [
                                {
                                  "name" : "aut",
                                  "source" : [
                                    {
                                      "context" : "id",
                                      "element" : "extension",
                                      "variable" : "ext"
                                    }
                                  ],
                                  "target" : [
                                    {
                                      "context" : "practitioner",
                                      "contextType" : "variable",
                                      "element" : "id",
                                      "variable" : "uuid2",
                                      "transform" : "evaluate",
                                      "parameter" : [
                                        {
                                          "valueString" : "r + '-' + ext"
                                        }
                                      ]
                                    },
                                    {
                                      "context" : "e1",
                                      "contextType" : "variable",
                                      "element" : "fullUrl",
                                      "transform" : "append",
                                      "parameter" : [
                                        {
                                          "valueString" : "https://example/Practitioner/"
                                        },
                                        {
                                          "valueId" : "uuid2"
                                        }
                                      ]
                                    },
                                    {
                                      "context" : "request",
                                      "contextType" : "variable",
                                      "element" : "url",
                                      "transform" : "append",
                                      "parameter" : [
                                        {
                                          "valueString" : "Practitioner/"
                                        },
                                        {
                                          "valueId" : "uuid2"
                                        }
                                      ]
                                    },
                                    {
                                      "context" : "serviceRequest",
                                      "contextType" : "variable",
                                      "element" : "performer",
                                      "variable" : "reference",
                                      "transform" : "create",
                                      "parameter" : [
                                        {
                                          "valueString" : "Reference"
                                        }
                                      ]
                                    },
                                    {
                                      "context" : "reference",
                                      "contextType" : "variable",
                                      "element" : "reference",
                                      "transform" : "evaluate",
                                      "parameter" : [
                                        {
                                          "valueString" : "'https://example/Practitioner/' + %practitioner.id"
                                        }
                                      ]
                                    }
                                  ]
                                }
                              ]
                            }
                          ]
                        },
                        {
                          "name" : "2.16.840.1.113883.2.9.4.3.2",
                          "source" : [
                            {
                              "context" : "assEnt",
                              "element" : "id",
                              "variable" : "id",
                              "condition" : "(root = '2.16.840.1.113883.2.9.4.3.2')"
                            }
                          ],
                          "rule" : [
                            {
                              "name" : "UUID",
                              "source" : [
                                {
                                  "context" : "id",
                                  "element" : "extension",
                                  "variable" : "ext"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "request",
                                  "contextType" : "variable",
                                  "element" : "url",
                                  "transform" : "append",
                                  "parameter" : [
                                    {
                                      "valueString" : "Practitioner?identifier="
                                    },
                                    {
                                      "valueId" : "ext"
                                    }
                                  ]
                                }
                              ]
                            }
                          ]
                        },
                        {
                          "name" : "assPer",
                          "source" : [
                            {
                              "context" : "assEnt",
                              "element" : "assignedPerson",
                              "variable" : "assPer"
                            }
                          ],
                          "rule" : [
                            {
                              "name" : "name",
                              "source" : [
                                {
                                  "context" : "assPer",
                                  "element" : "name",
                                  "variable" : "vvv"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "practitioner",
                                  "contextType" : "variable",
                                  "element" : "name",
                                  "variable" : "vvv",
                                  "transform" : "create"
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  ]
                },
                {
                  "name" : "participant",
                  "source" : [
                    {
                      "context" : "act",
                      "element" : "participant",
                      "variable" : "parti"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "bundle",
                      "contextType" : "variable",
                      "element" : "entry",
                      "variable" : "e1"
                    },
                    {
                      "context" : "e1",
                      "contextType" : "variable",
                      "element" : "request",
                      "variable" : "request",
                      "transform" : "create",
                      "parameter" : [
                        {
                          "valueString" : "BackboneElement"
                        }
                      ]
                    },
                    {
                      "context" : "request",
                      "contextType" : "variable",
                      "element" : "method",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "PUT"
                        }
                      ]
                    },
                    {
                      "context" : "e1",
                      "contextType" : "variable",
                      "element" : "resource",
                      "variable" : "practitioner",
                      "transform" : "create",
                      "parameter" : [
                        {
                          "valueString" : "Practitioner"
                        }
                      ]
                    },
                    {
                      "context" : "practitioner",
                      "contextType" : "variable",
                      "element" : "id",
                      "variable" : "uuid1",
                      "transform" : "uuid"
                    },
                    {
                      "context" : "e1",
                      "contextType" : "variable",
                      "element" : "fullUrl",
                      "transform" : "append",
                      "parameter" : [
                        {
                          "valueString" : "https://example/Practitioner/"
                        },
                        {
                          "valueId" : "uuid1"
                        }
                      ]
                    },
                    {
                      "context" : "request",
                      "contextType" : "variable",
                      "element" : "url",
                      "transform" : "append",
                      "parameter" : [
                        {
                          "valueString" : "Practitioner/"
                        },
                        {
                          "valueId" : "uuid1"
                        }
                      ]
                    }
                  ],
                  "rule" : [
                    {
                      "name" : "time",
                      "source" : [
                        {
                          "context" : "parti",
                          "element" : "time",
                          "variable" : "time"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "serviceRequest",
                          "contextType" : "variable",
                          "element" : "authoredOn",
                          "variable" : "t",
                          "transform" : "create",
                          "parameter" : [
                            {
                              "valueString" : "dateTime"
                            }
                          ]
                        }
                      ],
                      "dependent" : [
                        {
                          "name" : "TSDateTime",
                          "variable" : [
                            "time",
                            "t"
                          ]
                        }
                      ]
                    },
                    {
                      "name" : "partRole",
                      "source" : [
                        {
                          "context" : "parti",
                          "element" : "participantRole",
                          "variable" : "partRole"
                        }
                      ],
                      "rule" : [
                        {
                          "name" : "meta",
                          "source" : [
                            {
                              "context" : "partRole"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "practitioner",
                              "contextType" : "variable",
                              "element" : "meta",
                              "variable" : "meta"
                            }
                          ],
                          "rule" : [
                            {
                              "name" : "coding",
                              "source" : [
                                {
                                  "context" : "partRole"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "meta",
                                  "contextType" : "variable",
                                  "element" : "tag",
                                  "variable" : "coding",
                                  "transform" : "create",
                                  "parameter" : [
                                    {
                                      "valueString" : "Coding"
                                    }
                                  ]
                                }
                              ],
                              "rule" : [
                                {
                                  "name" : "system",
                                  "source" : [
                                    {
                                      "context" : "partRole"
                                    }
                                  ],
                                  "target" : [
                                    {
                                      "context" : "coding",
                                      "contextType" : "variable",
                                      "element" : "system",
                                      "transform" : "copy",
                                      "parameter" : [
                                        {
                                          "valueString" : "http://algoritmodiscoring"
                                        }
                                      ]
                                    }
                                  ]
                                },
                                {
                                  "name" : "code",
                                  "source" : [
                                    {
                                      "context" : "partRole"
                                    }
                                  ],
                                  "target" : [
                                    {
                                      "context" : "coding",
                                      "contextType" : "variable",
                                      "element" : "code",
                                      "transform" : "copy",
                                      "parameter" : [
                                        {
                                          "valueString" : "ClinicalDocument/body/Consulenze/participant"
                                        }
                                      ]
                                    }
                                  ]
                                }
                              ]
                            }
                          ]
                        },
                        {
                          "name" : "identifier",
                          "source" : [
                            {
                              "context" : "partRole",
                              "element" : "id",
                              "variable" : "id"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "practitioner",
                              "contextType" : "variable",
                              "element" : "identifier",
                              "variable" : "identifier"
                            }
                          ],
                          "rule" : [
                            {
                              "name" : "root1",
                              "source" : [
                                {
                                  "context" : "id",
                                  "element" : "root",
                                  "variable" : "r"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "identifier",
                                  "contextType" : "variable",
                                  "element" : "system",
                                  "transform" : "translate",
                                  "parameter" : [
                                    {
                                      "valueId" : "r"
                                    },
                                    {
                                      "valueString" : "http://hl7.org/fhir/ConceptMap/special-oid2uri"
                                    },
                                    {
                                      "valueString" : "uri"
                                    }
                                  ]
                                }
                              ]
                            },
                            {
                              "name" : "extension",
                              "source" : [
                                {
                                  "context" : "id",
                                  "element" : "extension",
                                  "variable" : "ext"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "identifier",
                                  "contextType" : "variable",
                                  "element" : "value",
                                  "transform" : "copy",
                                  "parameter" : [
                                    {
                                      "valueId" : "ext"
                                    }
                                  ]
                                }
                              ]
                            },
                            {
                              "name" : "assigningAuthorityName",
                              "source" : [
                                {
                                  "context" : "id",
                                  "element" : "assigningAuthorityName",
                                  "variable" : "s"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "identifier",
                                  "contextType" : "variable",
                                  "element" : "assigner",
                                  "variable" : "a"
                                },
                                {
                                  "context" : "a",
                                  "contextType" : "variable",
                                  "element" : "display",
                                  "transform" : "copy",
                                  "parameter" : [
                                    {
                                      "valueId" : "s"
                                    }
                                  ]
                                }
                              ]
                            },
                            {
                              "name" : "r",
                              "source" : [
                                {
                                  "context" : "id",
                                  "element" : "root",
                                  "variable" : "r"
                                }
                              ],
                              "rule" : [
                                {
                                  "name" : "aut",
                                  "source" : [
                                    {
                                      "context" : "id",
                                      "element" : "extension",
                                      "variable" : "ext"
                                    }
                                  ],
                                  "target" : [
                                    {
                                      "context" : "practitioner",
                                      "contextType" : "variable",
                                      "element" : "id",
                                      "variable" : "uuid2",
                                      "transform" : "evaluate",
                                      "parameter" : [
                                        {
                                          "valueString" : "r + '-' + ext"
                                        }
                                      ]
                                    },
                                    {
                                      "context" : "e1",
                                      "contextType" : "variable",
                                      "element" : "fullUrl",
                                      "transform" : "append",
                                      "parameter" : [
                                        {
                                          "valueString" : "https://example/Practitioner/"
                                        },
                                        {
                                          "valueId" : "uuid2"
                                        }
                                      ]
                                    },
                                    {
                                      "context" : "request",
                                      "contextType" : "variable",
                                      "element" : "url",
                                      "transform" : "append",
                                      "parameter" : [
                                        {
                                          "valueString" : "Practitioner/"
                                        },
                                        {
                                          "valueId" : "uuid2"
                                        }
                                      ]
                                    },
                                    {
                                      "context" : "serviceRequest",
                                      "contextType" : "variable",
                                      "element" : "requester",
                                      "variable" : "reference",
                                      "transform" : "create",
                                      "parameter" : [
                                        {
                                          "valueString" : "Reference"
                                        }
                                      ]
                                    },
                                    {
                                      "context" : "reference",
                                      "contextType" : "variable",
                                      "element" : "reference",
                                      "transform" : "evaluate",
                                      "parameter" : [
                                        {
                                          "valueString" : "'https://example/Practitioner/' + %practitioner.id"
                                        }
                                      ]
                                    }
                                  ]
                                }
                              ]
                            }
                          ]
                        },
                        {
                          "name" : "2.16.840.1.113883.2.9.4.3.2",
                          "source" : [
                            {
                              "context" : "partRole",
                              "element" : "id",
                              "variable" : "id",
                              "condition" : "(root = '2.16.840.1.113883.2.9.4.3.2')"
                            }
                          ],
                          "rule" : [
                            {
                              "name" : "UUID",
                              "source" : [
                                {
                                  "context" : "id",
                                  "element" : "extension",
                                  "variable" : "ext"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "request",
                                  "contextType" : "variable",
                                  "element" : "url",
                                  "transform" : "append",
                                  "parameter" : [
                                    {
                                      "valueString" : "Practitioner?identifier="
                                    },
                                    {
                                      "valueId" : "ext"
                                    }
                                  ]
                                }
                              ]
                            }
                          ]
                        },
                        {
                          "name" : "entity",
                          "source" : [
                            {
                              "context" : "partRole",
                              "element" : "playingEntity",
                              "variable" : "entity"
                            }
                          ],
                          "rule" : [
                            {
                              "name" : "name",
                              "source" : [
                                {
                                  "context" : "entity",
                                  "element" : "name",
                                  "variable" : "vvv"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "practitioner",
                                  "contextType" : "variable",
                                  "element" : "name",
                                  "variable" : "vvv",
                                  "transform" : "create"
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ],
          "documentation" : "Sezione Strutturata--------------------------------------------------------------------------------------------------------------------------------------------"
        }
      ]
    },
    {
      "name" : "ClinicalDocumentSectionAccertamenti",
      "typeMode" : "none",
      "documentation" : "---------------------------------------------------------------------------------------------------------\r\nSezione Accertamenti--------------------------------------------------------------------------------------",
      "input" : [
        {
          "name" : "cda",
          "type" : "ClinicalDocument",
          "mode" : "source"
        },
        {
          "name" : "src",
          "type" : "Section",
          "mode" : "source"
        },
        {
          "name" : "patient",
          "type" : "Patient",
          "mode" : "target"
        },
        {
          "name" : "tgt",
          "mode" : "target"
        },
        {
          "name" : "bundle",
          "type" : "Bundle",
          "mode" : "target"
        },
        {
          "name" : "enc",
          "type" : "Encounter",
          "mode" : "target"
        }
      ],
      "rule" : [
        {
          "name" : "title",
          "source" : [
            {
              "context" : "src",
              "element" : "title",
              "variable" : "t"
            }
          ],
          "target" : [
            {
              "context" : "tgt",
              "contextType" : "variable",
              "element" : "title",
              "transform" : "evaluate",
              "parameter" : [
                {
                  "valueString" : "t.dataString"
                }
              ]
            }
          ]
        },
        {
          "name" : "code",
          "source" : [
            {
              "context" : "src",
              "element" : "code",
              "variable" : "vvv"
            }
          ],
          "target" : [
            {
              "context" : "tgt",
              "contextType" : "variable",
              "element" : "code",
              "variable" : "vvv",
              "transform" : "create"
            }
          ]
        },
        {
          "name" : "entryExists",
          "source" : [
            {
              "context" : "src",
              "condition" : "src.entry.exists()"
            }
          ],
          "rule" : [
            {
              "name" : "cdaText",
              "source" : [
                {
                  "context" : "src",
                  "element" : "text",
                  "variable" : "cdaText"
                }
              ],
              "target" : [
                {
                  "context" : "tgt",
                  "contextType" : "variable",
                  "element" : "text",
                  "variable" : "fhirText"
                }
              ],
              "rule" : [
                {
                  "name" : "narrativeStatus",
                  "source" : [
                    {
                      "context" : "cdaText"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "fhirText",
                      "contextType" : "variable",
                      "element" : "status",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "generated"
                        }
                      ]
                    }
                  ]
                },
                {
                  "name" : "narrativeText",
                  "source" : [
                    {
                      "context" : "cdaText",
                      "variable" : "t"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "fhirText",
                      "contextType" : "variable",
                      "element" : "div",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueId" : "t"
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ]
        },
        {
          "name" : "entry",
          "source" : [
            {
              "context" : "src",
              "element" : "entry",
              "variable" : "entry1"
            }
          ],
          "target" : [
            {
              "context" : "bundle",
              "contextType" : "variable",
              "element" : "entry",
              "variable" : "e1"
            },
            {
              "context" : "e1",
              "contextType" : "variable",
              "element" : "request",
              "variable" : "request",
              "transform" : "create",
              "parameter" : [
                {
                  "valueString" : "BackboneElement"
                }
              ]
            },
            {
              "context" : "request",
              "contextType" : "variable",
              "element" : "method",
              "transform" : "copy",
              "parameter" : [
                {
                  "valueString" : "POST"
                }
              ]
            },
            {
              "context" : "e1",
              "contextType" : "variable",
              "element" : "resource",
              "variable" : "observation",
              "transform" : "create",
              "parameter" : [
                {
                  "valueString" : "Observation"
                }
              ]
            },
            {
              "context" : "observation",
              "contextType" : "variable",
              "element" : "id",
              "variable" : "uuid1",
              "transform" : "uuid"
            },
            {
              "context" : "e1",
              "contextType" : "variable",
              "element" : "fullUrl",
              "transform" : "append",
              "parameter" : [
                {
                  "valueString" : "https://example/Observation/"
                },
                {
                  "valueId" : "uuid1"
                }
              ]
            },
            {
              "context" : "request",
              "contextType" : "variable",
              "element" : "url",
              "transform" : "copy",
              "parameter" : [
                {
                  "valueString" : "Observation"
                }
              ]
            },
            {
              "context" : "tgt",
              "contextType" : "variable",
              "element" : "entry",
              "variable" : "reference",
              "transform" : "create",
              "parameter" : [
                {
                  "valueString" : "Reference"
                }
              ]
            },
            {
              "context" : "reference",
              "contextType" : "variable",
              "element" : "reference",
              "transform" : "evaluate",
              "parameter" : [
                {
                  "valueString" : "'https://example/Observation/' + %observation.id"
                }
              ]
            }
          ],
          "rule" : [
            {
              "name" : "obs",
              "source" : [
                {
                  "context" : "entry1",
                  "element" : "organizer",
                  "variable" : "obs"
                }
              ],
              "rule" : [
                {
                  "name" : "code",
                  "source" : [
                    {
                      "context" : "src",
                      "element" : "code",
                      "variable" : "vvv"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "observation",
                      "contextType" : "variable",
                      "element" : "code",
                      "variable" : "vvv",
                      "transform" : "create"
                    }
                  ]
                },
                {
                  "name" : "act",
                  "source" : [
                    {
                      "context" : "obs"
                    }
                  ],
                  "dependent" : [
                    {
                      "name" : "ObservationAccertamenti",
                      "variable" : [
                        "obs",
                        "patient",
                        "enc",
                        "observation",
                        "bundle"
                      ]
                    }
                  ]
                }
              ]
            }
          ],
          "documentation" : "Sezione Strutturata---------------------------------------------------------------------------------------------------------------------------------------------"
        },
        {
          "name" : "where",
          "source" : [
            {
              "context" : "src",
              "condition" : "src.entry.exists().not()"
            }
          ],
          "rule" : [
            {
              "name" : "cdaText",
              "source" : [
                {
                  "context" : "src",
                  "element" : "text",
                  "variable" : "cdaText"
                }
              ],
              "target" : [
                {
                  "context" : "bundle",
                  "contextType" : "variable",
                  "element" : "entry",
                  "variable" : "e8"
                },
                {
                  "context" : "e8",
                  "contextType" : "variable",
                  "element" : "request",
                  "variable" : "request",
                  "transform" : "create",
                  "parameter" : [
                    {
                      "valueString" : "BackboneElement"
                    }
                  ]
                },
                {
                  "context" : "request",
                  "contextType" : "variable",
                  "element" : "method",
                  "transform" : "copy",
                  "parameter" : [
                    {
                      "valueString" : "POST"
                    }
                  ]
                },
                {
                  "context" : "e8",
                  "contextType" : "variable",
                  "element" : "resource",
                  "variable" : "Observation",
                  "transform" : "create",
                  "parameter" : [
                    {
                      "valueString" : "Observation"
                    }
                  ]
                },
                {
                  "context" : "Observation",
                  "contextType" : "variable",
                  "element" : "id",
                  "variable" : "uuid8",
                  "transform" : "uuid"
                },
                {
                  "context" : "e8",
                  "contextType" : "variable",
                  "element" : "fullUrl",
                  "transform" : "append",
                  "parameter" : [
                    {
                      "valueString" : "https://example/Observation/"
                    },
                    {
                      "valueId" : "uuid8"
                    }
                  ]
                },
                {
                  "context" : "request",
                  "contextType" : "variable",
                  "element" : "url",
                  "transform" : "copy",
                  "parameter" : [
                    {
                      "valueString" : "Observation"
                    }
                  ]
                },
                {
                  "context" : "tgt",
                  "contextType" : "variable",
                  "element" : "entry",
                  "variable" : "reference",
                  "transform" : "create",
                  "parameter" : [
                    {
                      "valueString" : "Reference"
                    }
                  ]
                },
                {
                  "context" : "reference",
                  "contextType" : "variable",
                  "element" : "reference",
                  "transform" : "evaluate",
                  "parameter" : [
                    {
                      "valueString" : "'https://example/Observation/' + %Observation.id"
                    }
                  ]
                }
              ],
              "rule" : [
                {
                  "name" : "reference",
                  "source" : [
                    {
                      "context" : "src"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "Observation",
                      "contextType" : "variable",
                      "element" : "subject",
                      "variable" : "reference",
                      "transform" : "create",
                      "parameter" : [
                        {
                          "valueString" : "Reference"
                        }
                      ]
                    },
                    {
                      "context" : "reference",
                      "contextType" : "variable",
                      "element" : "reference",
                      "transform" : "evaluate",
                      "parameter" : [
                        {
                          "valueString" : "'https://example/Patient/' + %patient.id"
                        }
                      ]
                    }
                  ]
                },
                {
                  "name" : "reference",
                  "source" : [
                    {
                      "context" : "src"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "Observation",
                      "contextType" : "variable",
                      "element" : "encounter",
                      "variable" : "reference",
                      "transform" : "create",
                      "parameter" : [
                        {
                          "valueString" : "Reference"
                        }
                      ]
                    },
                    {
                      "context" : "reference",
                      "contextType" : "variable",
                      "element" : "reference",
                      "transform" : "evaluate",
                      "parameter" : [
                        {
                          "valueString" : "'https://example/Encounter/' + %enc.id"
                        }
                      ]
                    }
                  ]
                },
                {
                  "name" : "code",
                  "source" : [
                    {
                      "context" : "src",
                      "element" : "code",
                      "variable" : "vvv"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "Observation",
                      "contextType" : "variable",
                      "element" : "code",
                      "variable" : "vvv",
                      "transform" : "create"
                    }
                  ]
                },
                {
                  "name" : "statuscode",
                  "source" : [
                    {
                      "context" : "src",
                      "condition" : "observation.statusCode.exists().not()"
                    }
                  ],
                  "rule" : [
                    {
                      "name" : "status",
                      "source" : [
                        {
                          "context" : "src"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "Observation",
                          "contextType" : "variable",
                          "element" : "status",
                          "transform" : "copy",
                          "parameter" : [
                            {
                              "valueString" : "final"
                            }
                          ]
                        }
                      ]
                    }
                  ]
                },
                {
                  "name" : "reference",
                  "source" : [
                    {
                      "context" : "cdaText"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "Observation",
                      "contextType" : "variable",
                      "element" : "note",
                      "variable" : "note"
                    }
                  ],
                  "rule" : [
                    {
                      "name" : "reference",
                      "source" : [
                        {
                          "context" : "cdaText",
                          "variable" : "t"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "note",
                          "contextType" : "variable",
                          "element" : "text",
                          "transform" : "copy",
                          "parameter" : [
                            {
                              "valueId" : "t"
                            }
                          ]
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ],
          "documentation" : "Sezione Narrativa--------------------------------------------------------------------------------------------------------------------------------------------"
        }
      ]
    },
    {
      "name" : "ObservationAccertamenti",
      "typeMode" : "none",
      "input" : [
        {
          "name" : "obs",
          "type" : "Observation",
          "mode" : "source"
        },
        {
          "name" : "patient",
          "type" : "Patient",
          "mode" : "target"
        },
        {
          "name" : "encounter",
          "type" : "Encounter",
          "mode" : "target"
        },
        {
          "name" : "ob",
          "type" : "Observation",
          "mode" : "target"
        },
        {
          "name" : "bundle",
          "type" : "Bundle",
          "mode" : "target"
        }
      ],
      "rule" : [
        {
          "name" : "code",
          "source" : [
            {
              "context" : "obs",
              "element" : "code",
              "variable" : "vvv"
            }
          ],
          "target" : [
            {
              "context" : "ob",
              "contextType" : "variable",
              "element" : "code",
              "variable" : "vvv",
              "transform" : "create"
            }
          ]
        },
        {
          "name" : "statusCode",
          "source" : [
            {
              "context" : "obs",
              "element" : "statusCode",
              "variable" : "statusc",
              "condition" : "(code = 'completed')"
            }
          ],
          "target" : [
            {
              "context" : "ob",
              "contextType" : "variable",
              "element" : "status",
              "transform" : "copy",
              "parameter" : [
                {
                  "valueString" : "final"
                }
              ]
            }
          ]
        },
        {
          "name" : "statusCode",
          "source" : [
            {
              "context" : "obs",
              "element" : "statusCode",
              "variable" : "statusc",
              "condition" : "(code = 'active')"
            }
          ],
          "target" : [
            {
              "context" : "ob",
              "contextType" : "variable",
              "element" : "status",
              "transform" : "copy",
              "parameter" : [
                {
                  "valueString" : "registered"
                }
              ]
            }
          ]
        },
        {
          "name" : "statusCode",
          "source" : [
            {
              "context" : "obs",
              "element" : "statusCode",
              "variable" : "statusc",
              "condition" : "(code = 'aborted')"
            }
          ],
          "target" : [
            {
              "context" : "ob",
              "contextType" : "variable",
              "element" : "status",
              "transform" : "copy",
              "parameter" : [
                {
                  "valueString" : "cancelled"
                }
              ]
            }
          ]
        },
        {
          "name" : "statusCode",
          "source" : [
            {
              "context" : "obs",
              "element" : "statusCode",
              "variable" : "statusc",
              "condition" : "(code = 'suspended')"
            }
          ],
          "target" : [
            {
              "context" : "ob",
              "contextType" : "variable",
              "element" : "status",
              "transform" : "copy",
              "parameter" : [
                {
                  "valueString" : "partial"
                }
              ]
            }
          ]
        },
        {
          "name" : "statuscode",
          "source" : [
            {
              "context" : "obs",
              "condition" : "obs.statusCode.exists().not()"
            }
          ],
          "rule" : [
            {
              "name" : "status",
              "source" : [
                {
                  "context" : "obs"
                }
              ],
              "target" : [
                {
                  "context" : "ob",
                  "contextType" : "variable",
                  "element" : "status",
                  "transform" : "copy",
                  "parameter" : [
                    {
                      "valueString" : "final"
                    }
                  ]
                }
              ]
            }
          ]
        },
        {
          "name" : "value2",
          "source" : [
            {
              "context" : "obs",
              "element" : "effectiveTime",
              "variable" : "effectiveTime"
            }
          ],
          "target" : [
            {
              "context" : "ob",
              "contextType" : "variable",
              "element" : "effective",
              "variable" : "value",
              "transform" : "create",
              "parameter" : [
                {
                  "valueString" : "dateTime"
                }
              ]
            }
          ],
          "dependent" : [
            {
              "name" : "TSDateTime",
              "variable" : [
                "effectiveTime",
                "value"
              ]
            }
          ]
        },
        {
          "name" : "where",
          "source" : [
            {
              "context" : "obs",
              "condition" : "effectiveTime.low.exists() or effectiveTime.high.exists()"
            }
          ],
          "rule" : [
            {
              "name" : "effectiveTime",
              "source" : [
                {
                  "context" : "obs",
                  "element" : "effectiveTime",
                  "variable" : "eff"
                }
              ],
              "target" : [
                {
                  "context" : "ob",
                  "contextType" : "variable",
                  "element" : "effective",
                  "variable" : "period",
                  "transform" : "create",
                  "parameter" : [
                    {
                      "valueString" : "Period"
                    }
                  ]
                }
              ],
              "dependent" : [
                {
                  "name" : "IVLTSPeriod",
                  "variable" : [
                    "eff",
                    "period"
                  ]
                }
              ]
            }
          ]
        },
        {
          "name" : "val",
          "source" : [
            {
              "context" : "obs",
              "type" : "CD",
              "element" : "value",
              "variable" : "val"
            }
          ],
          "rule" : [
            {
              "name" : "coding",
              "source" : [
                {
                  "context" : "val"
                }
              ],
              "target" : [
                {
                  "context" : "ob",
                  "contextType" : "variable",
                  "element" : "value",
                  "variable" : "ce",
                  "transform" : "create",
                  "parameter" : [
                    {
                      "valueString" : "CodeableConcept"
                    }
                  ]
                }
              ],
              "rule" : [
                {
                  "name" : "originalText",
                  "source" : [
                    {
                      "context" : "val",
                      "element" : "originalText",
                      "variable" : "vvv"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "ce",
                      "contextType" : "variable",
                      "element" : "text",
                      "variable" : "vvv",
                      "transform" : "create"
                    }
                  ]
                },
                {
                  "name" : "code",
                  "source" : [
                    {
                      "context" : "val"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "ce",
                      "contextType" : "variable",
                      "element" : "coding",
                      "variable" : "coding"
                    }
                  ],
                  "rule" : [
                    {
                      "name" : "code",
                      "source" : [
                        {
                          "context" : "val",
                          "element" : "code",
                          "variable" : "code"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "coding",
                          "contextType" : "variable",
                          "element" : "code",
                          "transform" : "cast",
                          "parameter" : [
                            {
                              "valueId" : "code"
                            },
                            {
                              "valueString" : "string"
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "name" : "codeSystem",
                      "source" : [
                        {
                          "context" : "val",
                          "element" : "codeSystem",
                          "variable" : "system"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "coding",
                          "contextType" : "variable",
                          "element" : "system",
                          "transform" : "translate",
                          "parameter" : [
                            {
                              "valueId" : "system"
                            },
                            {
                              "valueString" : "http://hl7.org/fhir/ConceptMap/special-oid2uri"
                            },
                            {
                              "valueString" : "uri"
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "name" : "displayName",
                      "source" : [
                        {
                          "context" : "val",
                          "element" : "displayName",
                          "variable" : "display"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "coding",
                          "contextType" : "variable",
                          "element" : "display",
                          "transform" : "cast",
                          "parameter" : [
                            {
                              "valueId" : "display"
                            },
                            {
                              "valueString" : "string"
                            }
                          ]
                        }
                      ]
                    }
                  ]
                },
                {
                  "name" : "translation",
                  "source" : [
                    {
                      "context" : "val",
                      "element" : "translation",
                      "variable" : "translation"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "ce",
                      "contextType" : "variable",
                      "element" : "coding",
                      "variable" : "coding"
                    }
                  ],
                  "rule" : [
                    {
                      "name" : "code",
                      "source" : [
                        {
                          "context" : "translation",
                          "element" : "code",
                          "variable" : "code"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "coding",
                          "contextType" : "variable",
                          "element" : "code",
                          "transform" : "cast",
                          "parameter" : [
                            {
                              "valueId" : "code"
                            },
                            {
                              "valueString" : "string"
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "name" : "codeSystem",
                      "source" : [
                        {
                          "context" : "translation",
                          "element" : "codeSystem",
                          "variable" : "system"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "coding",
                          "contextType" : "variable",
                          "element" : "system",
                          "transform" : "translate",
                          "parameter" : [
                            {
                              "valueId" : "system"
                            },
                            {
                              "valueString" : "http://hl7.org/fhir/ConceptMap/special-oid2uri"
                            },
                            {
                              "valueString" : "uri"
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "name" : "displayName",
                      "source" : [
                        {
                          "context" : "translation",
                          "element" : "displayName",
                          "variable" : "display"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "coding",
                          "contextType" : "variable",
                          "element" : "display",
                          "transform" : "cast",
                          "parameter" : [
                            {
                              "valueId" : "display"
                            },
                            {
                              "valueString" : "string"
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "name" : "qual",
                      "source" : [
                        {
                          "context" : "translation",
                          "element" : "qualifier",
                          "variable" : "qualifier"
                        }
                      ],
                      "rule" : [
                        {
                          "name" : "value",
                          "source" : [
                            {
                              "context" : "qualifier",
                              "element" : "value",
                              "variable" : "value"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "ce",
                              "contextType" : "variable",
                              "element" : "coding",
                              "variable" : "coding"
                            }
                          ],
                          "rule" : [
                            {
                              "name" : "code",
                              "source" : [
                                {
                                  "context" : "value",
                                  "element" : "code",
                                  "variable" : "code"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "coding",
                                  "contextType" : "variable",
                                  "element" : "code",
                                  "transform" : "cast",
                                  "parameter" : [
                                    {
                                      "valueId" : "code"
                                    },
                                    {
                                      "valueString" : "string"
                                    }
                                  ]
                                }
                              ]
                            },
                            {
                              "name" : "codeSystem",
                              "source" : [
                                {
                                  "context" : "value",
                                  "element" : "codeSystem",
                                  "variable" : "system"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "coding",
                                  "contextType" : "variable",
                                  "element" : "system",
                                  "transform" : "translate",
                                  "parameter" : [
                                    {
                                      "valueId" : "system"
                                    },
                                    {
                                      "valueString" : "http://hl7.org/fhir/ConceptMap/special-oid2uri"
                                    },
                                    {
                                      "valueString" : "uri"
                                    }
                                  ]
                                }
                              ]
                            },
                            {
                              "name" : "displayName",
                              "source" : [
                                {
                                  "context" : "value",
                                  "element" : "displayName",
                                  "variable" : "display"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "coding",
                                  "contextType" : "variable",
                                  "element" : "display",
                                  "transform" : "cast",
                                  "parameter" : [
                                    {
                                      "valueId" : "display"
                                    },
                                    {
                                      "valueString" : "string"
                                    }
                                  ]
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ]
        },
        {
          "name" : "val",
          "source" : [
            {
              "context" : "obs",
              "type" : "CE",
              "element" : "value",
              "variable" : "val"
            }
          ],
          "rule" : [
            {
              "name" : "coding",
              "source" : [
                {
                  "context" : "val"
                }
              ],
              "target" : [
                {
                  "context" : "ob",
                  "contextType" : "variable",
                  "element" : "value",
                  "variable" : "ce",
                  "transform" : "create",
                  "parameter" : [
                    {
                      "valueString" : "CodeableConcept"
                    }
                  ]
                }
              ],
              "rule" : [
                {
                  "name" : "originalText",
                  "source" : [
                    {
                      "context" : "val",
                      "element" : "originalText",
                      "variable" : "vvv"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "ce",
                      "contextType" : "variable",
                      "element" : "text",
                      "variable" : "vvv",
                      "transform" : "create"
                    }
                  ]
                },
                {
                  "name" : "code",
                  "source" : [
                    {
                      "context" : "val"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "ce",
                      "contextType" : "variable",
                      "element" : "coding",
                      "variable" : "coding"
                    }
                  ],
                  "rule" : [
                    {
                      "name" : "code",
                      "source" : [
                        {
                          "context" : "val",
                          "element" : "code",
                          "variable" : "code"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "coding",
                          "contextType" : "variable",
                          "element" : "code",
                          "transform" : "cast",
                          "parameter" : [
                            {
                              "valueId" : "code"
                            },
                            {
                              "valueString" : "string"
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "name" : "codeSystem",
                      "source" : [
                        {
                          "context" : "val",
                          "element" : "codeSystem",
                          "variable" : "system"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "coding",
                          "contextType" : "variable",
                          "element" : "system",
                          "transform" : "translate",
                          "parameter" : [
                            {
                              "valueId" : "system"
                            },
                            {
                              "valueString" : "http://hl7.org/fhir/ConceptMap/special-oid2uri"
                            },
                            {
                              "valueString" : "uri"
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "name" : "displayName",
                      "source" : [
                        {
                          "context" : "val",
                          "element" : "displayName",
                          "variable" : "display"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "coding",
                          "contextType" : "variable",
                          "element" : "display",
                          "transform" : "cast",
                          "parameter" : [
                            {
                              "valueId" : "display"
                            },
                            {
                              "valueString" : "string"
                            }
                          ]
                        }
                      ]
                    }
                  ]
                },
                {
                  "name" : "translation",
                  "source" : [
                    {
                      "context" : "val",
                      "element" : "translation",
                      "variable" : "translation"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "ce",
                      "contextType" : "variable",
                      "element" : "coding",
                      "variable" : "coding"
                    }
                  ],
                  "rule" : [
                    {
                      "name" : "code",
                      "source" : [
                        {
                          "context" : "translation",
                          "element" : "code",
                          "variable" : "code"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "coding",
                          "contextType" : "variable",
                          "element" : "code",
                          "transform" : "cast",
                          "parameter" : [
                            {
                              "valueId" : "code"
                            },
                            {
                              "valueString" : "string"
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "name" : "codeSystem",
                      "source" : [
                        {
                          "context" : "translation",
                          "element" : "codeSystem",
                          "variable" : "system"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "coding",
                          "contextType" : "variable",
                          "element" : "system",
                          "transform" : "translate",
                          "parameter" : [
                            {
                              "valueId" : "system"
                            },
                            {
                              "valueString" : "http://hl7.org/fhir/ConceptMap/special-oid2uri"
                            },
                            {
                              "valueString" : "uri"
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "name" : "displayName",
                      "source" : [
                        {
                          "context" : "translation",
                          "element" : "displayName",
                          "variable" : "display"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "coding",
                          "contextType" : "variable",
                          "element" : "display",
                          "transform" : "cast",
                          "parameter" : [
                            {
                              "valueId" : "display"
                            },
                            {
                              "valueString" : "string"
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "name" : "qual",
                      "source" : [
                        {
                          "context" : "translation",
                          "element" : "qualifier",
                          "variable" : "qualifier"
                        }
                      ],
                      "rule" : [
                        {
                          "name" : "value",
                          "source" : [
                            {
                              "context" : "qualifier",
                              "element" : "value",
                              "variable" : "value"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "ce",
                              "contextType" : "variable",
                              "element" : "coding",
                              "variable" : "coding"
                            }
                          ],
                          "rule" : [
                            {
                              "name" : "code",
                              "source" : [
                                {
                                  "context" : "value",
                                  "element" : "code",
                                  "variable" : "code"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "coding",
                                  "contextType" : "variable",
                                  "element" : "code",
                                  "transform" : "cast",
                                  "parameter" : [
                                    {
                                      "valueId" : "code"
                                    },
                                    {
                                      "valueString" : "string"
                                    }
                                  ]
                                }
                              ]
                            },
                            {
                              "name" : "codeSystem",
                              "source" : [
                                {
                                  "context" : "value",
                                  "element" : "codeSystem",
                                  "variable" : "system"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "coding",
                                  "contextType" : "variable",
                                  "element" : "system",
                                  "transform" : "translate",
                                  "parameter" : [
                                    {
                                      "valueId" : "system"
                                    },
                                    {
                                      "valueString" : "http://hl7.org/fhir/ConceptMap/special-oid2uri"
                                    },
                                    {
                                      "valueString" : "uri"
                                    }
                                  ]
                                }
                              ]
                            },
                            {
                              "name" : "displayName",
                              "source" : [
                                {
                                  "context" : "value",
                                  "element" : "displayName",
                                  "variable" : "display"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "coding",
                                  "contextType" : "variable",
                                  "element" : "display",
                                  "transform" : "cast",
                                  "parameter" : [
                                    {
                                      "valueId" : "display"
                                    },
                                    {
                                      "valueString" : "string"
                                    }
                                  ]
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ]
        },
        {
          "name" : "valueQuantity",
          "source" : [
            {
              "context" : "obs",
              "type" : "PQ",
              "element" : "value",
              "variable" : "val"
            }
          ],
          "rule" : [
            {
              "name" : "quantity",
              "source" : [
                {
                  "context" : "val"
                }
              ],
              "target" : [
                {
                  "context" : "ob",
                  "contextType" : "variable",
                  "element" : "value",
                  "variable" : "quantity",
                  "transform" : "create",
                  "parameter" : [
                    {
                      "valueString" : "Quantity"
                    }
                  ]
                }
              ],
              "rule" : [
                {
                  "name" : "value",
                  "source" : [
                    {
                      "context" : "val",
                      "element" : "value",
                      "variable" : "value"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "quantity",
                      "contextType" : "variable",
                      "element" : "value",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueId" : "value"
                        }
                      ]
                    }
                  ]
                },
                {
                  "name" : "unit",
                  "source" : [
                    {
                      "context" : "val",
                      "element" : "unit",
                      "variable" : "unit"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "quantity",
                      "contextType" : "variable",
                      "element" : "unit",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueId" : "unit"
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ]
        },
        {
          "name" : "value",
          "source" : [
            {
              "context" : "obs",
              "type" : "ST",
              "element" : "value",
              "variable" : "value"
            }
          ],
          "target" : [
            {
              "context" : "ob",
              "contextType" : "variable",
              "element" : "value",
              "transform" : "create",
              "parameter" : [
                {
                  "valueString" : "string"
                }
              ]
            },
            {
              "context" : "ob",
              "contextType" : "variable",
              "element" : "value",
              "transform" : "evaluate",
              "parameter" : [
                {
                  "valueString" : "value.dataString"
                }
              ]
            }
          ]
        },
        {
          "name" : "value",
          "source" : [
            {
              "context" : "obs",
              "type" : "INT",
              "element" : "value",
              "variable" : "int"
            }
          ],
          "target" : [
            {
              "context" : "ob",
              "contextType" : "variable",
              "element" : "value",
              "transform" : "evaluate",
              "parameter" : [
                {
                  "valueString" : "int.value"
                }
              ]
            }
          ]
        },
        {
          "name" : "boolean",
          "source" : [
            {
              "context" : "obs",
              "type" : "BL",
              "element" : "value",
              "variable" : "boolean"
            }
          ],
          "target" : [
            {
              "context" : "ob",
              "contextType" : "variable",
              "element" : "value",
              "transform" : "evaluate",
              "parameter" : [
                {
                  "valueString" : "boolean.value"
                }
              ]
            }
          ]
        },
        {
          "name" : "reference",
          "source" : [
            {
              "context" : "obs"
            }
          ],
          "target" : [
            {
              "context" : "ob",
              "contextType" : "variable",
              "element" : "subject",
              "variable" : "reference",
              "transform" : "create",
              "parameter" : [
                {
                  "valueString" : "Reference"
                }
              ]
            },
            {
              "context" : "reference",
              "contextType" : "variable",
              "element" : "reference",
              "transform" : "evaluate",
              "parameter" : [
                {
                  "valueString" : "'https://example/Patient/' + %patient.id"
                }
              ]
            }
          ]
        },
        {
          "name" : "reference",
          "source" : [
            {
              "context" : "obs"
            }
          ],
          "target" : [
            {
              "context" : "ob",
              "contextType" : "variable",
              "element" : "encounter",
              "variable" : "reference",
              "transform" : "create",
              "parameter" : [
                {
                  "valueString" : "Reference"
                }
              ]
            },
            {
              "context" : "reference",
              "contextType" : "variable",
              "element" : "reference",
              "transform" : "evaluate",
              "parameter" : [
                {
                  "valueString" : "'https://example/Encounter/' + %encounter.id"
                }
              ]
            }
          ]
        },
        {
          "name" : "interpretationCode",
          "source" : [
            {
              "context" : "obs",
              "element" : "interpretationCode",
              "variable" : "vvv"
            }
          ],
          "target" : [
            {
              "context" : "ob",
              "contextType" : "variable",
              "element" : "interpretation",
              "variable" : "vvv",
              "transform" : "create"
            }
          ]
        },
        {
          "name" : "methodCode",
          "source" : [
            {
              "context" : "obs",
              "element" : "methodCode",
              "variable" : "vvv"
            }
          ],
          "target" : [
            {
              "context" : "ob",
              "contextType" : "variable",
              "element" : "method",
              "variable" : "vvv",
              "transform" : "create"
            }
          ]
        },
        {
          "name" : "refRange",
          "source" : [
            {
              "context" : "obs",
              "element" : "referenceRange",
              "variable" : "refRange"
            }
          ],
          "target" : [
            {
              "context" : "ob",
              "contextType" : "variable",
              "element" : "referenceRange",
              "variable" : "ref",
              "transform" : "create",
              "parameter" : [
                {
                  "valueString" : "BackboneElement"
                }
              ]
            }
          ],
          "rule" : [
            {
              "name" : "obsRange",
              "source" : [
                {
                  "context" : "refRange",
                  "element" : "observationRange",
                  "variable" : "obsRange"
                }
              ],
              "target" : [
                {
                  "context" : "ref",
                  "contextType" : "variable",
                  "element" : "low",
                  "variable" : "Low",
                  "transform" : "create",
                  "parameter" : [
                    {
                      "valueString" : "SimpleQuantity"
                    }
                  ]
                }
              ],
              "rule" : [
                {
                  "name" : "IVL-PQ",
                  "source" : [
                    {
                      "context" : "obsRange",
                      "type" : "IVL_PQ",
                      "element" : "value",
                      "variable" : "v"
                    }
                  ],
                  "rule" : [
                    {
                      "name" : "decValue",
                      "source" : [
                        {
                          "context" : "v",
                          "element" : "low",
                          "variable" : "l1"
                        }
                      ],
                      "rule" : [
                        {
                          "name" : "value",
                          "source" : [
                            {
                              "context" : "l1",
                              "element" : "value",
                              "variable" : "decValue"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "Low",
                              "contextType" : "variable",
                              "element" : "value",
                              "transform" : "copy",
                              "parameter" : [
                                {
                                  "valueId" : "decValue"
                                }
                              ]
                            }
                          ]
                        },
                        {
                          "name" : "unit",
                          "source" : [
                            {
                              "context" : "l1",
                              "element" : "unit",
                              "variable" : "Unit"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "Low",
                              "contextType" : "variable",
                              "element" : "unit",
                              "transform" : "copy",
                              "parameter" : [
                                {
                                  "valueId" : "Unit"
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ]
        },
        {
          "name" : "perf",
          "source" : [
            {
              "context" : "obs",
              "element" : "performer",
              "variable" : "performer"
            }
          ],
          "target" : [
            {
              "context" : "bundle",
              "contextType" : "variable",
              "element" : "entry",
              "variable" : "e1"
            },
            {
              "context" : "e1",
              "contextType" : "variable",
              "element" : "request",
              "variable" : "request",
              "transform" : "create",
              "parameter" : [
                {
                  "valueString" : "BackboneElement"
                }
              ]
            },
            {
              "context" : "request",
              "contextType" : "variable",
              "element" : "method",
              "transform" : "copy",
              "parameter" : [
                {
                  "valueString" : "PUT"
                }
              ]
            },
            {
              "context" : "e1",
              "contextType" : "variable",
              "element" : "resource",
              "variable" : "practitioner",
              "transform" : "create",
              "parameter" : [
                {
                  "valueString" : "Practitioner"
                }
              ]
            },
            {
              "context" : "practitioner",
              "contextType" : "variable",
              "element" : "id",
              "variable" : "uuid1",
              "transform" : "uuid"
            },
            {
              "context" : "e1",
              "contextType" : "variable",
              "element" : "fullUrl",
              "transform" : "append",
              "parameter" : [
                {
                  "valueString" : "https://example/Practitioner/"
                },
                {
                  "valueId" : "uuid1"
                }
              ]
            },
            {
              "context" : "request",
              "contextType" : "variable",
              "element" : "url",
              "transform" : "append",
              "parameter" : [
                {
                  "valueString" : "Practitioner/"
                },
                {
                  "valueId" : "uuid1"
                }
              ]
            }
          ],
          "rule" : [
            {
              "name" : "assEntity",
              "source" : [
                {
                  "context" : "performer",
                  "element" : "assignedEntity",
                  "variable" : "assEntity"
                }
              ],
              "rule" : [
                {
                  "name" : "meta",
                  "source" : [
                    {
                      "context" : "assEntity"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "practitioner",
                      "contextType" : "variable",
                      "element" : "meta",
                      "variable" : "meta"
                    }
                  ],
                  "rule" : [
                    {
                      "name" : "coding",
                      "source" : [
                        {
                          "context" : "assEntity"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "meta",
                          "contextType" : "variable",
                          "element" : "tag",
                          "variable" : "coding",
                          "transform" : "create",
                          "parameter" : [
                            {
                              "valueString" : "Coding"
                            }
                          ]
                        }
                      ],
                      "rule" : [
                        {
                          "name" : "system",
                          "source" : [
                            {
                              "context" : "assEntity"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "coding",
                              "contextType" : "variable",
                              "element" : "system",
                              "transform" : "copy",
                              "parameter" : [
                                {
                                  "valueString" : "http://algoritmodiscoring"
                                }
                              ]
                            }
                          ]
                        },
                        {
                          "name" : "code",
                          "source" : [
                            {
                              "context" : "assEntity"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "coding",
                              "contextType" : "variable",
                              "element" : "code",
                              "transform" : "copy",
                              "parameter" : [
                                {
                                  "valueString" : "ClinicalDocument/body/Accertamenti/performer"
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  ],
                  "documentation" : "inizio modifica identifier+meta"
                },
                {
                  "name" : "identifier",
                  "source" : [
                    {
                      "context" : "assEntity",
                      "element" : "id",
                      "variable" : "id"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "practitioner",
                      "contextType" : "variable",
                      "element" : "identifier",
                      "variable" : "identifier"
                    }
                  ],
                  "rule" : [
                    {
                      "name" : "root1",
                      "source" : [
                        {
                          "context" : "id",
                          "element" : "root",
                          "variable" : "r"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "identifier",
                          "contextType" : "variable",
                          "element" : "system",
                          "transform" : "translate",
                          "parameter" : [
                            {
                              "valueId" : "r"
                            },
                            {
                              "valueString" : "http://hl7.org/fhir/ConceptMap/special-oid2uri"
                            },
                            {
                              "valueString" : "uri"
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "name" : "extension",
                      "source" : [
                        {
                          "context" : "id",
                          "element" : "extension",
                          "variable" : "ext"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "identifier",
                          "contextType" : "variable",
                          "element" : "value",
                          "transform" : "copy",
                          "parameter" : [
                            {
                              "valueId" : "ext"
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "name" : "assigningAuthorityName",
                      "source" : [
                        {
                          "context" : "id",
                          "element" : "assigningAuthorityName",
                          "variable" : "s"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "identifier",
                          "contextType" : "variable",
                          "element" : "assigner",
                          "variable" : "a"
                        },
                        {
                          "context" : "a",
                          "contextType" : "variable",
                          "element" : "display",
                          "transform" : "copy",
                          "parameter" : [
                            {
                              "valueId" : "s"
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "name" : "r",
                      "source" : [
                        {
                          "context" : "id",
                          "element" : "root",
                          "variable" : "r"
                        }
                      ],
                      "rule" : [
                        {
                          "name" : "aut",
                          "source" : [
                            {
                              "context" : "id",
                              "element" : "extension",
                              "variable" : "ext"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "practitioner",
                              "contextType" : "variable",
                              "element" : "id",
                              "variable" : "uuid2",
                              "transform" : "evaluate",
                              "parameter" : [
                                {
                                  "valueString" : "r + '-' + ext"
                                }
                              ]
                            },
                            {
                              "context" : "e1",
                              "contextType" : "variable",
                              "element" : "fullUrl",
                              "transform" : "append",
                              "parameter" : [
                                {
                                  "valueString" : "https://example/Practitioner/"
                                },
                                {
                                  "valueId" : "uuid2"
                                }
                              ]
                            },
                            {
                              "context" : "request",
                              "contextType" : "variable",
                              "element" : "url",
                              "transform" : "append",
                              "parameter" : [
                                {
                                  "valueString" : "Practitioner/"
                                },
                                {
                                  "valueId" : "uuid2"
                                }
                              ]
                            },
                            {
                              "context" : "ob",
                              "contextType" : "variable",
                              "element" : "performer",
                              "variable" : "reference",
                              "transform" : "create",
                              "parameter" : [
                                {
                                  "valueString" : "Reference"
                                }
                              ]
                            },
                            {
                              "context" : "reference",
                              "contextType" : "variable",
                              "element" : "reference",
                              "transform" : "evaluate",
                              "parameter" : [
                                {
                                  "valueString" : "'https://example/Practitioner/' + %practitioner.id"
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  ]
                },
                {
                  "name" : "2.16.840.1.113883.2.9.4.3.2",
                  "source" : [
                    {
                      "context" : "assEntity",
                      "element" : "id",
                      "variable" : "id",
                      "condition" : "(root = '2.16.840.1.113883.2.9.4.3.2')"
                    }
                  ],
                  "rule" : [
                    {
                      "name" : "UUID",
                      "source" : [
                        {
                          "context" : "id",
                          "element" : "extension",
                          "variable" : "ext"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "request",
                          "contextType" : "variable",
                          "element" : "url",
                          "transform" : "append",
                          "parameter" : [
                            {
                              "valueString" : "Practitioner?identifier="
                            },
                            {
                              "valueId" : "ext"
                            }
                          ]
                        }
                      ]
                    }
                  ]
                },
                {
                  "name" : "assi",
                  "source" : [
                    {
                      "context" : "assEntity",
                      "element" : "assignedPerson",
                      "variable" : "assi"
                    }
                  ],
                  "rule" : [
                    {
                      "name" : "name",
                      "source" : [
                        {
                          "context" : "assi",
                          "element" : "name",
                          "variable" : "vvv"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "practitioner",
                          "contextType" : "variable",
                          "element" : "name",
                          "variable" : "vvv",
                          "transform" : "create"
                        }
                      ]
                    }
                  ],
                  "documentation" : "fine modifica"
                }
              ]
            }
          ]
        },
        {
          "name" : "participant",
          "source" : [
            {
              "context" : "obs",
              "element" : "participant",
              "variable" : "participant"
            }
          ],
          "target" : [
            {
              "context" : "bundle",
              "contextType" : "variable",
              "element" : "entry",
              "variable" : "e1"
            },
            {
              "context" : "e1",
              "contextType" : "variable",
              "element" : "request",
              "variable" : "request",
              "transform" : "create",
              "parameter" : [
                {
                  "valueString" : "BackboneElement"
                }
              ]
            },
            {
              "context" : "request",
              "contextType" : "variable",
              "element" : "method",
              "transform" : "copy",
              "parameter" : [
                {
                  "valueString" : "POST"
                }
              ]
            },
            {
              "context" : "e1",
              "contextType" : "variable",
              "element" : "resource",
              "variable" : "serviceRequest",
              "transform" : "create",
              "parameter" : [
                {
                  "valueString" : "ServiceRequest"
                }
              ]
            },
            {
              "context" : "serviceRequest",
              "contextType" : "variable",
              "element" : "id",
              "variable" : "uuid1",
              "transform" : "uuid"
            },
            {
              "context" : "e1",
              "contextType" : "variable",
              "element" : "fullUrl",
              "transform" : "append",
              "parameter" : [
                {
                  "valueString" : "https://example/ServiceRequest/"
                },
                {
                  "valueId" : "uuid1"
                }
              ]
            },
            {
              "context" : "request",
              "contextType" : "variable",
              "element" : "url",
              "transform" : "copy",
              "parameter" : [
                {
                  "valueString" : "ServiceRequest"
                }
              ]
            },
            {
              "context" : "ob",
              "contextType" : "variable",
              "element" : "basedOn",
              "variable" : "reference",
              "transform" : "create",
              "parameter" : [
                {
                  "valueString" : "Reference"
                }
              ]
            },
            {
              "context" : "reference",
              "contextType" : "variable",
              "element" : "reference",
              "transform" : "evaluate",
              "parameter" : [
                {
                  "valueString" : "'https://example/ServiceRequest/' + %serviceRequest.id"
                }
              ]
            }
          ],
          "rule" : [
            {
              "name" : "value2",
              "source" : [
                {
                  "context" : "participant",
                  "element" : "time",
                  "variable" : "t"
                }
              ],
              "target" : [
                {
                  "context" : "serviceRequest",
                  "contextType" : "variable",
                  "element" : "authoredOn",
                  "variable" : "value",
                  "transform" : "create",
                  "parameter" : [
                    {
                      "valueString" : "dateTime"
                    }
                  ]
                }
              ],
              "dependent" : [
                {
                  "name" : "TSDateTime",
                  "variable" : [
                    "t",
                    "value"
                  ]
                }
              ],
              "documentation" : "participant.time as t -> serviceRequest.authoredOn = (t.value);"
            },
            {
              "name" : "reference",
              "source" : [
                {
                  "context" : "obs"
                }
              ],
              "target" : [
                {
                  "context" : "serviceRequest",
                  "contextType" : "variable",
                  "element" : "subject",
                  "variable" : "reference",
                  "transform" : "create",
                  "parameter" : [
                    {
                      "valueString" : "Reference"
                    }
                  ]
                },
                {
                  "context" : "reference",
                  "contextType" : "variable",
                  "element" : "reference",
                  "transform" : "evaluate",
                  "parameter" : [
                    {
                      "valueString" : "'https://example/Patient/' + %patient.id"
                    }
                  ]
                }
              ]
            },
            {
              "name" : "reference",
              "source" : [
                {
                  "context" : "obs"
                }
              ],
              "target" : [
                {
                  "context" : "serviceRequest",
                  "contextType" : "variable",
                  "element" : "encounter",
                  "variable" : "reference",
                  "transform" : "create",
                  "parameter" : [
                    {
                      "valueString" : "Reference"
                    }
                  ]
                },
                {
                  "context" : "reference",
                  "contextType" : "variable",
                  "element" : "reference",
                  "transform" : "evaluate",
                  "parameter" : [
                    {
                      "valueString" : "'https://example/Encounter/' + %encounter.id"
                    }
                  ]
                }
              ]
            },
            {
              "name" : "status",
              "source" : [
                {
                  "context" : "obs"
                }
              ],
              "target" : [
                {
                  "context" : "serviceRequest",
                  "contextType" : "variable",
                  "element" : "status",
                  "transform" : "copy",
                  "parameter" : [
                    {
                      "valueString" : "active"
                    }
                  ]
                }
              ]
            },
            {
              "name" : "intent",
              "source" : [
                {
                  "context" : "obs"
                }
              ],
              "target" : [
                {
                  "context" : "serviceRequest",
                  "contextType" : "variable",
                  "element" : "intent",
                  "transform" : "copy",
                  "parameter" : [
                    {
                      "valueString" : "order"
                    }
                  ]
                }
              ]
            },
            {
              "name" : "participantRole",
              "source" : [
                {
                  "context" : "participant",
                  "element" : "participantRole",
                  "variable" : "participantRole"
                }
              ],
              "target" : [
                {
                  "context" : "bundle",
                  "contextType" : "variable",
                  "element" : "entry",
                  "variable" : "e1"
                },
                {
                  "context" : "e1",
                  "contextType" : "variable",
                  "element" : "request",
                  "variable" : "request",
                  "transform" : "create",
                  "parameter" : [
                    {
                      "valueString" : "BackboneElement"
                    }
                  ]
                },
                {
                  "context" : "request",
                  "contextType" : "variable",
                  "element" : "method",
                  "transform" : "copy",
                  "parameter" : [
                    {
                      "valueString" : "PUT"
                    }
                  ]
                },
                {
                  "context" : "e1",
                  "contextType" : "variable",
                  "element" : "resource",
                  "variable" : "practitioner",
                  "transform" : "create",
                  "parameter" : [
                    {
                      "valueString" : "Practitioner"
                    }
                  ]
                },
                {
                  "context" : "practitioner",
                  "contextType" : "variable",
                  "element" : "id",
                  "variable" : "uuid1",
                  "transform" : "uuid"
                },
                {
                  "context" : "e1",
                  "contextType" : "variable",
                  "element" : "fullUrl",
                  "transform" : "append",
                  "parameter" : [
                    {
                      "valueString" : "https://example/Practitioner/"
                    },
                    {
                      "valueId" : "uuid1"
                    }
                  ]
                },
                {
                  "context" : "request",
                  "contextType" : "variable",
                  "element" : "url",
                  "transform" : "append",
                  "parameter" : [
                    {
                      "valueString" : "Practitioner/"
                    },
                    {
                      "valueId" : "uuid1"
                    }
                  ]
                }
              ],
              "rule" : [
                {
                  "name" : "meta",
                  "source" : [
                    {
                      "context" : "participantRole"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "practitioner",
                      "contextType" : "variable",
                      "element" : "meta",
                      "variable" : "meta"
                    }
                  ],
                  "rule" : [
                    {
                      "name" : "coding",
                      "source" : [
                        {
                          "context" : "participantRole"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "meta",
                          "contextType" : "variable",
                          "element" : "tag",
                          "variable" : "coding",
                          "transform" : "create",
                          "parameter" : [
                            {
                              "valueString" : "Coding"
                            }
                          ]
                        }
                      ],
                      "rule" : [
                        {
                          "name" : "system",
                          "source" : [
                            {
                              "context" : "participantRole"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "coding",
                              "contextType" : "variable",
                              "element" : "system",
                              "transform" : "copy",
                              "parameter" : [
                                {
                                  "valueString" : "http://algoritmodiscoring"
                                }
                              ]
                            }
                          ]
                        },
                        {
                          "name" : "code",
                          "source" : [
                            {
                              "context" : "participantRole"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "coding",
                              "contextType" : "variable",
                              "element" : "code",
                              "transform" : "copy",
                              "parameter" : [
                                {
                                  "valueString" : "ClinicalDocument/body/Accertamenti/participant"
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  ],
                  "documentation" : "modifica meta+identifier"
                },
                {
                  "name" : "identifier",
                  "source" : [
                    {
                      "context" : "participantRole",
                      "element" : "id",
                      "variable" : "id"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "practitioner",
                      "contextType" : "variable",
                      "element" : "identifier",
                      "variable" : "identifier"
                    }
                  ],
                  "rule" : [
                    {
                      "name" : "root1",
                      "source" : [
                        {
                          "context" : "id",
                          "element" : "root",
                          "variable" : "r"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "identifier",
                          "contextType" : "variable",
                          "element" : "system",
                          "transform" : "translate",
                          "parameter" : [
                            {
                              "valueId" : "r"
                            },
                            {
                              "valueString" : "http://hl7.org/fhir/ConceptMap/special-oid2uri"
                            },
                            {
                              "valueString" : "uri"
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "name" : "extension",
                      "source" : [
                        {
                          "context" : "id",
                          "element" : "extension",
                          "variable" : "ext"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "identifier",
                          "contextType" : "variable",
                          "element" : "value",
                          "transform" : "copy",
                          "parameter" : [
                            {
                              "valueId" : "ext"
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "name" : "assigningAuthorityName",
                      "source" : [
                        {
                          "context" : "id",
                          "element" : "assigningAuthorityName",
                          "variable" : "s"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "identifier",
                          "contextType" : "variable",
                          "element" : "assigner",
                          "variable" : "a"
                        },
                        {
                          "context" : "a",
                          "contextType" : "variable",
                          "element" : "display",
                          "transform" : "copy",
                          "parameter" : [
                            {
                              "valueId" : "s"
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "name" : "r",
                      "source" : [
                        {
                          "context" : "id",
                          "element" : "root",
                          "variable" : "r"
                        }
                      ],
                      "rule" : [
                        {
                          "name" : "aut",
                          "source" : [
                            {
                              "context" : "id",
                              "element" : "extension",
                              "variable" : "ext"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "practitioner",
                              "contextType" : "variable",
                              "element" : "id",
                              "variable" : "uuid2",
                              "transform" : "evaluate",
                              "parameter" : [
                                {
                                  "valueString" : "r + '-' + ext"
                                }
                              ]
                            },
                            {
                              "context" : "e1",
                              "contextType" : "variable",
                              "element" : "fullUrl",
                              "transform" : "append",
                              "parameter" : [
                                {
                                  "valueString" : "https://example/Practitioner/"
                                },
                                {
                                  "valueId" : "uuid2"
                                }
                              ]
                            },
                            {
                              "context" : "request",
                              "contextType" : "variable",
                              "element" : "url",
                              "transform" : "append",
                              "parameter" : [
                                {
                                  "valueString" : "Practitioner/"
                                },
                                {
                                  "valueId" : "uuid2"
                                }
                              ]
                            },
                            {
                              "context" : "serviceRequest",
                              "contextType" : "variable",
                              "element" : "requester",
                              "variable" : "reference",
                              "transform" : "create",
                              "parameter" : [
                                {
                                  "valueString" : "Reference"
                                }
                              ]
                            },
                            {
                              "context" : "reference",
                              "contextType" : "variable",
                              "element" : "reference",
                              "transform" : "evaluate",
                              "parameter" : [
                                {
                                  "valueString" : "'https://example/Practitioner/' + %practitioner.id"
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  ]
                },
                {
                  "name" : "2.16.840.1.113883.2.9.4.3.2",
                  "source" : [
                    {
                      "context" : "participantRole",
                      "element" : "id",
                      "variable" : "id",
                      "condition" : "(root = '2.16.840.1.113883.2.9.4.3.2')"
                    }
                  ],
                  "rule" : [
                    {
                      "name" : "UUID",
                      "source" : [
                        {
                          "context" : "id",
                          "element" : "extension",
                          "variable" : "ext"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "request",
                          "contextType" : "variable",
                          "element" : "url",
                          "transform" : "append",
                          "parameter" : [
                            {
                              "valueString" : "Practitioner?identifier="
                            },
                            {
                              "valueId" : "ext"
                            }
                          ]
                        }
                      ]
                    }
                  ]
                },
                {
                  "name" : "pe",
                  "source" : [
                    {
                      "context" : "participantRole",
                      "element" : "playingEntity",
                      "variable" : "pe"
                    }
                  ],
                  "rule" : [
                    {
                      "name" : "name",
                      "source" : [
                        {
                          "context" : "pe",
                          "element" : "name",
                          "variable" : "vvv"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "practitioner",
                          "contextType" : "variable",
                          "element" : "name",
                          "variable" : "vvv",
                          "transform" : "create"
                        }
                      ]
                    }
                  ],
                  "documentation" : "fine modifica"
                }
              ]
            }
          ]
        },
        {
          "name" : "observation",
          "source" : [
            {
              "context" : "obs",
              "element" : "component",
              "variable" : "comp"
            }
          ],
          "target" : [
            {
              "context" : "bundle",
              "contextType" : "variable",
              "element" : "entry",
              "variable" : "e1"
            },
            {
              "context" : "e1",
              "contextType" : "variable",
              "element" : "request",
              "variable" : "request",
              "transform" : "create",
              "parameter" : [
                {
                  "valueString" : "BackboneElement"
                }
              ]
            },
            {
              "context" : "request",
              "contextType" : "variable",
              "element" : "method",
              "transform" : "copy",
              "parameter" : [
                {
                  "valueString" : "POST"
                }
              ]
            },
            {
              "context" : "e1",
              "contextType" : "variable",
              "element" : "resource",
              "variable" : "observation",
              "transform" : "create",
              "parameter" : [
                {
                  "valueString" : "Observation"
                }
              ]
            },
            {
              "context" : "observation",
              "contextType" : "variable",
              "element" : "id",
              "variable" : "uuid1",
              "transform" : "uuid"
            },
            {
              "context" : "e1",
              "contextType" : "variable",
              "element" : "fullUrl",
              "transform" : "append",
              "parameter" : [
                {
                  "valueString" : "https://example/Observation/"
                },
                {
                  "valueId" : "uuid1"
                }
              ]
            },
            {
              "context" : "request",
              "contextType" : "variable",
              "element" : "url",
              "transform" : "copy",
              "parameter" : [
                {
                  "valueString" : "Observation"
                }
              ]
            },
            {
              "context" : "ob",
              "contextType" : "variable",
              "element" : "hasMember",
              "variable" : "reference",
              "transform" : "create",
              "parameter" : [
                {
                  "valueString" : "Reference"
                }
              ]
            },
            {
              "context" : "reference",
              "contextType" : "variable",
              "element" : "reference",
              "transform" : "evaluate",
              "parameter" : [
                {
                  "valueString" : "'https://example/Observation/' + %observation.id"
                }
              ]
            }
          ],
          "rule" : [
            {
              "name" : "obs",
              "source" : [
                {
                  "context" : "comp",
                  "element" : "observation",
                  "variable" : "obs"
                }
              ],
              "rule" : [
                {
                  "name" : "code",
                  "source" : [
                    {
                      "context" : "obs",
                      "element" : "code",
                      "variable" : "vvv"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "observation",
                      "contextType" : "variable",
                      "element" : "code",
                      "variable" : "vvv",
                      "transform" : "create"
                    }
                  ]
                },
                {
                  "name" : "statusCode",
                  "source" : [
                    {
                      "context" : "obs",
                      "element" : "statusCode",
                      "variable" : "statusc",
                      "condition" : "(code = 'completed')"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "observation",
                      "contextType" : "variable",
                      "element" : "status",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "final"
                        }
                      ]
                    }
                  ]
                },
                {
                  "name" : "statusCode",
                  "source" : [
                    {
                      "context" : "obs",
                      "element" : "statusCode",
                      "variable" : "statusc",
                      "condition" : "(code = 'active')"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "observation",
                      "contextType" : "variable",
                      "element" : "status",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "registered"
                        }
                      ]
                    }
                  ]
                },
                {
                  "name" : "statusCode",
                  "source" : [
                    {
                      "context" : "obs",
                      "element" : "statusCode",
                      "variable" : "statusc",
                      "condition" : "(code = 'aborted')"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "observation",
                      "contextType" : "variable",
                      "element" : "status",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "cancelled"
                        }
                      ]
                    }
                  ]
                },
                {
                  "name" : "statusCode",
                  "source" : [
                    {
                      "context" : "obs",
                      "element" : "statusCode",
                      "variable" : "statusc",
                      "condition" : "(code = 'suspended')"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "observation",
                      "contextType" : "variable",
                      "element" : "status",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "partial"
                        }
                      ]
                    }
                  ]
                },
                {
                  "name" : "statuscode",
                  "source" : [
                    {
                      "context" : "obs",
                      "condition" : "obs.statusCode.exists().not()"
                    }
                  ],
                  "rule" : [
                    {
                      "name" : "status",
                      "source" : [
                        {
                          "context" : "obs"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "observation",
                          "contextType" : "variable",
                          "element" : "status",
                          "transform" : "copy",
                          "parameter" : [
                            {
                              "valueString" : "final"
                            }
                          ]
                        }
                      ]
                    }
                  ]
                },
                {
                  "name" : "reference",
                  "source" : [
                    {
                      "context" : "obs"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "observation",
                      "contextType" : "variable",
                      "element" : "subject",
                      "variable" : "reference",
                      "transform" : "create",
                      "parameter" : [
                        {
                          "valueString" : "Reference"
                        }
                      ]
                    },
                    {
                      "context" : "reference",
                      "contextType" : "variable",
                      "element" : "reference",
                      "transform" : "evaluate",
                      "parameter" : [
                        {
                          "valueString" : "'https://example/Patient/' + %patient.id"
                        }
                      ]
                    }
                  ]
                },
                {
                  "name" : "reference",
                  "source" : [
                    {
                      "context" : "obs"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "observation",
                      "contextType" : "variable",
                      "element" : "encounter",
                      "variable" : "reference",
                      "transform" : "create",
                      "parameter" : [
                        {
                          "valueString" : "Reference"
                        }
                      ]
                    },
                    {
                      "context" : "reference",
                      "contextType" : "variable",
                      "element" : "reference",
                      "transform" : "evaluate",
                      "parameter" : [
                        {
                          "valueString" : "'https://example/Encounter/' + %encounter.id"
                        }
                      ]
                    }
                  ]
                },
                {
                  "name" : "value2",
                  "source" : [
                    {
                      "context" : "obs",
                      "element" : "effectiveTime",
                      "variable" : "effectiveTime"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "ob",
                      "contextType" : "variable",
                      "element" : "effective",
                      "variable" : "value",
                      "transform" : "create",
                      "parameter" : [
                        {
                          "valueString" : "dateTime"
                        }
                      ]
                    }
                  ],
                  "dependent" : [
                    {
                      "name" : "TSDateTime",
                      "variable" : [
                        "effectiveTime",
                        "value"
                      ]
                    }
                  ]
                },
                {
                  "name" : "where",
                  "source" : [
                    {
                      "context" : "obs",
                      "condition" : "effectiveTime.low.exists() or effectiveTime.high.exists()"
                    }
                  ],
                  "rule" : [
                    {
                      "name" : "effectiveTime",
                      "source" : [
                        {
                          "context" : "obs",
                          "element" : "effectiveTime",
                          "variable" : "eff"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "ob",
                          "contextType" : "variable",
                          "element" : "effective",
                          "variable" : "period",
                          "transform" : "create",
                          "parameter" : [
                            {
                              "valueString" : "Period"
                            }
                          ]
                        }
                      ],
                      "dependent" : [
                        {
                          "name" : "IVLTSPeriod",
                          "variable" : [
                            "eff",
                            "period"
                          ]
                        }
                      ]
                    }
                  ]
                },
                {
                  "name" : "value",
                  "source" : [
                    {
                      "context" : "obs",
                      "element" : "value",
                      "variable" : "val"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "observation",
                      "contextType" : "variable",
                      "element" : "value",
                      "transform" : "evaluate",
                      "parameter" : [
                        {
                          "valueString" : "val.dataString"
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ]
        }
      ]
    },
    {
      "name" : "ClinicalDocumentSectionParametriVitali",
      "typeMode" : "none",
      "documentation" : "-----------------------------------------------------------------------------------------------------------\r\nSezione ParametriVitali--------------------------------------------------------------------------------------",
      "input" : [
        {
          "name" : "cda",
          "type" : "ClinicalDocument",
          "mode" : "source"
        },
        {
          "name" : "src",
          "type" : "Section",
          "mode" : "source"
        },
        {
          "name" : "patient",
          "type" : "Patient",
          "mode" : "target"
        },
        {
          "name" : "tgt",
          "mode" : "target"
        },
        {
          "name" : "bundle",
          "type" : "Bundle",
          "mode" : "target"
        },
        {
          "name" : "enc",
          "type" : "Encounter",
          "mode" : "target"
        }
      ],
      "rule" : [
        {
          "name" : "title",
          "source" : [
            {
              "context" : "src",
              "element" : "title",
              "variable" : "t"
            }
          ],
          "target" : [
            {
              "context" : "tgt",
              "contextType" : "variable",
              "element" : "title",
              "transform" : "evaluate",
              "parameter" : [
                {
                  "valueString" : "t.dataString"
                }
              ]
            }
          ]
        },
        {
          "name" : "code",
          "source" : [
            {
              "context" : "src",
              "element" : "code",
              "variable" : "vvv"
            }
          ],
          "target" : [
            {
              "context" : "tgt",
              "contextType" : "variable",
              "element" : "code",
              "variable" : "vvv",
              "transform" : "create"
            }
          ]
        },
        {
          "name" : "entry-exists",
          "source" : [
            {
              "context" : "src",
              "condition" : "src.entry.exists()"
            }
          ],
          "rule" : [
            {
              "name" : "cdaText",
              "source" : [
                {
                  "context" : "src",
                  "element" : "text",
                  "variable" : "cdaText"
                }
              ],
              "target" : [
                {
                  "context" : "tgt",
                  "contextType" : "variable",
                  "element" : "text",
                  "variable" : "fhirText"
                }
              ],
              "rule" : [
                {
                  "name" : "narrativeStatus",
                  "source" : [
                    {
                      "context" : "cdaText"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "fhirText",
                      "contextType" : "variable",
                      "element" : "status",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "generated"
                        }
                      ]
                    }
                  ]
                },
                {
                  "name" : "narrativeText",
                  "source" : [
                    {
                      "context" : "cdaText",
                      "variable" : "t"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "fhirText",
                      "contextType" : "variable",
                      "element" : "div",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueId" : "t"
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ]
        },
        {
          "name" : "where",
          "source" : [
            {
              "context" : "src",
              "condition" : "src.entry.exists().not()"
            }
          ],
          "rule" : [
            {
              "name" : "cdaText",
              "source" : [
                {
                  "context" : "src",
                  "element" : "text",
                  "variable" : "cdaText"
                }
              ],
              "target" : [
                {
                  "context" : "bundle",
                  "contextType" : "variable",
                  "element" : "entry",
                  "variable" : "e8"
                },
                {
                  "context" : "e8",
                  "contextType" : "variable",
                  "element" : "request",
                  "variable" : "request",
                  "transform" : "create",
                  "parameter" : [
                    {
                      "valueString" : "BackboneElement"
                    }
                  ]
                },
                {
                  "context" : "request",
                  "contextType" : "variable",
                  "element" : "method",
                  "transform" : "copy",
                  "parameter" : [
                    {
                      "valueString" : "POST"
                    }
                  ]
                },
                {
                  "context" : "e8",
                  "contextType" : "variable",
                  "element" : "resource",
                  "variable" : "Observation",
                  "transform" : "create",
                  "parameter" : [
                    {
                      "valueString" : "Observation"
                    }
                  ]
                },
                {
                  "context" : "Observation",
                  "contextType" : "variable",
                  "element" : "id",
                  "variable" : "uuid8",
                  "transform" : "uuid"
                },
                {
                  "context" : "e8",
                  "contextType" : "variable",
                  "element" : "fullUrl",
                  "transform" : "append",
                  "parameter" : [
                    {
                      "valueString" : "https://example/Observation/"
                    },
                    {
                      "valueId" : "uuid8"
                    }
                  ]
                },
                {
                  "context" : "request",
                  "contextType" : "variable",
                  "element" : "url",
                  "transform" : "copy",
                  "parameter" : [
                    {
                      "valueString" : "Observation"
                    }
                  ]
                },
                {
                  "context" : "tgt",
                  "contextType" : "variable",
                  "element" : "entry",
                  "variable" : "reference",
                  "transform" : "create",
                  "parameter" : [
                    {
                      "valueString" : "Reference"
                    }
                  ]
                },
                {
                  "context" : "reference",
                  "contextType" : "variable",
                  "element" : "reference",
                  "transform" : "evaluate",
                  "parameter" : [
                    {
                      "valueString" : "'https://example/Observation/' + %Observation.id"
                    }
                  ]
                }
              ],
              "rule" : [
                {
                  "name" : "reference",
                  "source" : [
                    {
                      "context" : "src"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "Observation",
                      "contextType" : "variable",
                      "element" : "subject",
                      "variable" : "reference",
                      "transform" : "create",
                      "parameter" : [
                        {
                          "valueString" : "Reference"
                        }
                      ]
                    },
                    {
                      "context" : "reference",
                      "contextType" : "variable",
                      "element" : "reference",
                      "transform" : "evaluate",
                      "parameter" : [
                        {
                          "valueString" : "'https://example/Patient/' + %patient.id"
                        }
                      ]
                    }
                  ]
                },
                {
                  "name" : "reference",
                  "source" : [
                    {
                      "context" : "src"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "Observation",
                      "contextType" : "variable",
                      "element" : "encounter",
                      "variable" : "reference",
                      "transform" : "create",
                      "parameter" : [
                        {
                          "valueString" : "Reference"
                        }
                      ]
                    },
                    {
                      "context" : "reference",
                      "contextType" : "variable",
                      "element" : "reference",
                      "transform" : "evaluate",
                      "parameter" : [
                        {
                          "valueString" : "'https://example/Encounter/' + %enc.id"
                        }
                      ]
                    }
                  ]
                },
                {
                  "name" : "code",
                  "source" : [
                    {
                      "context" : "src",
                      "element" : "code",
                      "variable" : "vvv"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "Observation",
                      "contextType" : "variable",
                      "element" : "code",
                      "variable" : "vvv",
                      "transform" : "create"
                    }
                  ]
                },
                {
                  "name" : "statuscode",
                  "source" : [
                    {
                      "context" : "src",
                      "condition" : "observation.statusCode.exists().not()"
                    }
                  ],
                  "rule" : [
                    {
                      "name" : "status",
                      "source" : [
                        {
                          "context" : "src"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "Observation",
                          "contextType" : "variable",
                          "element" : "status",
                          "transform" : "copy",
                          "parameter" : [
                            {
                              "valueString" : "final"
                            }
                          ]
                        }
                      ]
                    }
                  ]
                },
                {
                  "name" : "reference",
                  "source" : [
                    {
                      "context" : "cdaText"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "Observation",
                      "contextType" : "variable",
                      "element" : "note",
                      "variable" : "note"
                    }
                  ],
                  "rule" : [
                    {
                      "name" : "reference",
                      "source" : [
                        {
                          "context" : "cdaText",
                          "variable" : "t"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "note",
                          "contextType" : "variable",
                          "element" : "text",
                          "transform" : "copy",
                          "parameter" : [
                            {
                              "valueId" : "t"
                            }
                          ]
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ],
          "documentation" : "Sezione Narrativa----------------------------------------------------------------------------------------------------------------------------------------------------"
        },
        {
          "name" : "Observation",
          "source" : [
            {
              "context" : "src",
              "element" : "entry",
              "variable" : "entry1"
            }
          ],
          "target" : [
            {
              "context" : "bundle",
              "contextType" : "variable",
              "element" : "entry",
              "variable" : "e1"
            },
            {
              "context" : "e1",
              "contextType" : "variable",
              "element" : "request",
              "variable" : "request",
              "transform" : "create",
              "parameter" : [
                {
                  "valueString" : "BackboneElement"
                }
              ]
            },
            {
              "context" : "request",
              "contextType" : "variable",
              "element" : "method",
              "transform" : "copy",
              "parameter" : [
                {
                  "valueString" : "POST"
                }
              ]
            },
            {
              "context" : "e1",
              "contextType" : "variable",
              "element" : "resource",
              "variable" : "observation",
              "transform" : "create",
              "parameter" : [
                {
                  "valueString" : "Observation"
                }
              ]
            },
            {
              "context" : "observation",
              "contextType" : "variable",
              "element" : "id",
              "variable" : "uuid1",
              "transform" : "uuid"
            },
            {
              "context" : "e1",
              "contextType" : "variable",
              "element" : "fullUrl",
              "transform" : "append",
              "parameter" : [
                {
                  "valueString" : "https://example/Observation/"
                },
                {
                  "valueId" : "uuid1"
                }
              ]
            },
            {
              "context" : "request",
              "contextType" : "variable",
              "element" : "url",
              "transform" : "copy",
              "parameter" : [
                {
                  "valueString" : "Observation"
                }
              ]
            },
            {
              "context" : "tgt",
              "contextType" : "variable",
              "element" : "entry",
              "variable" : "reference",
              "transform" : "create",
              "parameter" : [
                {
                  "valueString" : "Reference"
                }
              ]
            },
            {
              "context" : "reference",
              "contextType" : "variable",
              "element" : "reference",
              "transform" : "evaluate",
              "parameter" : [
                {
                  "valueString" : "'https://example/Observation/' + %observation.id"
                }
              ]
            }
          ],
          "rule" : [
            {
              "name" : "obs",
              "source" : [
                {
                  "context" : "entry1",
                  "element" : "organizer",
                  "variable" : "org"
                }
              ],
              "rule" : [
                {
                  "name" : "reference",
                  "source" : [
                    {
                      "context" : "org"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "observation",
                      "contextType" : "variable",
                      "element" : "subject",
                      "variable" : "reference",
                      "transform" : "create",
                      "parameter" : [
                        {
                          "valueString" : "Reference"
                        }
                      ]
                    },
                    {
                      "context" : "reference",
                      "contextType" : "variable",
                      "element" : "reference",
                      "transform" : "evaluate",
                      "parameter" : [
                        {
                          "valueString" : "'https://example/Patient/' + %patient.id"
                        }
                      ]
                    }
                  ]
                },
                {
                  "name" : "reference",
                  "source" : [
                    {
                      "context" : "org"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "observation",
                      "contextType" : "variable",
                      "element" : "encounter",
                      "variable" : "reference",
                      "transform" : "create",
                      "parameter" : [
                        {
                          "valueString" : "Reference"
                        }
                      ]
                    },
                    {
                      "context" : "reference",
                      "contextType" : "variable",
                      "element" : "reference",
                      "transform" : "evaluate",
                      "parameter" : [
                        {
                          "valueString" : "'https://example/Encounter/' + %enc.id"
                        }
                      ]
                    }
                  ]
                },
                {
                  "name" : "statusCode",
                  "source" : [
                    {
                      "context" : "org",
                      "element" : "statusCode",
                      "variable" : "statusc",
                      "condition" : "(code = 'completed')"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "observation",
                      "contextType" : "variable",
                      "element" : "status",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "final"
                        }
                      ]
                    }
                  ]
                },
                {
                  "name" : "statusCode",
                  "source" : [
                    {
                      "context" : "org",
                      "element" : "statusCode",
                      "variable" : "statusc",
                      "condition" : "(code = 'active')"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "observation",
                      "contextType" : "variable",
                      "element" : "status",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "registered"
                        }
                      ]
                    }
                  ]
                },
                {
                  "name" : "statusCode",
                  "source" : [
                    {
                      "context" : "org",
                      "element" : "statusCode",
                      "variable" : "statusc",
                      "condition" : "(code = 'aborted')"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "observation",
                      "contextType" : "variable",
                      "element" : "status",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "cancelled"
                        }
                      ]
                    }
                  ]
                },
                {
                  "name" : "statusCode",
                  "source" : [
                    {
                      "context" : "org",
                      "element" : "statusCode",
                      "variable" : "statusc",
                      "condition" : "(code = 'suspended')"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "observation",
                      "contextType" : "variable",
                      "element" : "status",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "partial"
                        }
                      ]
                    }
                  ]
                },
                {
                  "name" : "statuscode",
                  "source" : [
                    {
                      "context" : "org",
                      "condition" : "obs.statusCode.exists().not()"
                    }
                  ],
                  "rule" : [
                    {
                      "name" : "status",
                      "source" : [
                        {
                          "context" : "org"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "observation",
                          "contextType" : "variable",
                          "element" : "status",
                          "transform" : "copy",
                          "parameter" : [
                            {
                              "valueString" : "final"
                            }
                          ]
                        }
                      ]
                    }
                  ]
                },
                {
                  "name" : "code",
                  "source" : [
                    {
                      "context" : "org",
                      "element" : "code",
                      "variable" : "vvv"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "observation",
                      "contextType" : "variable",
                      "element" : "code",
                      "variable" : "vvv",
                      "transform" : "create"
                    }
                  ]
                },
                {
                  "name" : "code",
                  "source" : [
                    {
                      "context" : "org",
                      "condition" : "org.code.exists().not()"
                    }
                  ],
                  "rule" : [
                    {
                      "name" : "code",
                      "source" : [
                        {
                          "context" : "src",
                          "element" : "code",
                          "variable" : "vvv"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "observation",
                          "contextType" : "variable",
                          "element" : "code",
                          "variable" : "vvv",
                          "transform" : "create"
                        }
                      ]
                    }
                  ]
                },
                {
                  "name" : "component",
                  "source" : [
                    {
                      "context" : "org",
                      "element" : "component",
                      "variable" : "component"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "bundle",
                      "contextType" : "variable",
                      "element" : "entry",
                      "variable" : "e1"
                    },
                    {
                      "context" : "e1",
                      "contextType" : "variable",
                      "element" : "request",
                      "variable" : "request",
                      "transform" : "create",
                      "parameter" : [
                        {
                          "valueString" : "BackboneElement"
                        }
                      ]
                    },
                    {
                      "context" : "request",
                      "contextType" : "variable",
                      "element" : "method",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "POST"
                        }
                      ]
                    },
                    {
                      "context" : "e1",
                      "contextType" : "variable",
                      "element" : "resource",
                      "variable" : "observation1",
                      "transform" : "create",
                      "parameter" : [
                        {
                          "valueString" : "Observation"
                        }
                      ]
                    },
                    {
                      "context" : "observation1",
                      "contextType" : "variable",
                      "element" : "id",
                      "variable" : "uuid1",
                      "transform" : "uuid"
                    },
                    {
                      "context" : "e1",
                      "contextType" : "variable",
                      "element" : "fullUrl",
                      "transform" : "append",
                      "parameter" : [
                        {
                          "valueString" : "https://example/Observation/"
                        },
                        {
                          "valueId" : "uuid1"
                        }
                      ]
                    },
                    {
                      "context" : "request",
                      "contextType" : "variable",
                      "element" : "url",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "Observation"
                        }
                      ]
                    },
                    {
                      "context" : "observation",
                      "contextType" : "variable",
                      "element" : "hasMember",
                      "variable" : "reference",
                      "transform" : "create",
                      "parameter" : [
                        {
                          "valueString" : "Reference"
                        }
                      ]
                    },
                    {
                      "context" : "reference",
                      "contextType" : "variable",
                      "element" : "reference",
                      "transform" : "evaluate",
                      "parameter" : [
                        {
                          "valueString" : "'https://example/Observation/' + %observation1.id"
                        }
                      ]
                    }
                  ],
                  "rule" : [
                    {
                      "name" : "obs",
                      "source" : [
                        {
                          "context" : "component",
                          "element" : "observation",
                          "variable" : "obs"
                        }
                      ],
                      "rule" : [
                        {
                          "name" : "reference",
                          "source" : [
                            {
                              "context" : "obs"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "observation1",
                              "contextType" : "variable",
                              "element" : "subject",
                              "variable" : "reference",
                              "transform" : "create",
                              "parameter" : [
                                {
                                  "valueString" : "Reference"
                                }
                              ]
                            },
                            {
                              "context" : "reference",
                              "contextType" : "variable",
                              "element" : "reference",
                              "transform" : "evaluate",
                              "parameter" : [
                                {
                                  "valueString" : "'https://example/Patient/' + %patient.id"
                                }
                              ]
                            }
                          ]
                        },
                        {
                          "name" : "reference",
                          "source" : [
                            {
                              "context" : "obs"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "observation1",
                              "contextType" : "variable",
                              "element" : "encounter",
                              "variable" : "reference",
                              "transform" : "create",
                              "parameter" : [
                                {
                                  "valueString" : "Reference"
                                }
                              ]
                            },
                            {
                              "context" : "reference",
                              "contextType" : "variable",
                              "element" : "reference",
                              "transform" : "evaluate",
                              "parameter" : [
                                {
                                  "valueString" : "'https://example/Encounter/' + %enc.id"
                                }
                              ]
                            }
                          ]
                        },
                        {
                          "name" : "code",
                          "source" : [
                            {
                              "context" : "obs",
                              "element" : "code",
                              "variable" : "vvv"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "observation1",
                              "contextType" : "variable",
                              "element" : "code",
                              "variable" : "vvv",
                              "transform" : "create"
                            }
                          ]
                        },
                        {
                          "name" : "statusCode",
                          "source" : [
                            {
                              "context" : "obs",
                              "element" : "statusCode",
                              "variable" : "vvv"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "observation1",
                              "contextType" : "variable",
                              "element" : "status",
                              "variable" : "vvv",
                              "transform" : "create"
                            }
                          ]
                        },
                        {
                          "name" : "statusCode",
                          "source" : [
                            {
                              "context" : "obs",
                              "element" : "statusCode",
                              "variable" : "statusc",
                              "condition" : "(code = 'completed')"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "observation1",
                              "contextType" : "variable",
                              "element" : "status",
                              "transform" : "copy",
                              "parameter" : [
                                {
                                  "valueString" : "final"
                                }
                              ]
                            }
                          ]
                        },
                        {
                          "name" : "statusCode",
                          "source" : [
                            {
                              "context" : "obs",
                              "element" : "statusCode",
                              "variable" : "statusc",
                              "condition" : "(code = 'active')"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "observation1",
                              "contextType" : "variable",
                              "element" : "status",
                              "transform" : "copy",
                              "parameter" : [
                                {
                                  "valueString" : "registered"
                                }
                              ]
                            }
                          ]
                        },
                        {
                          "name" : "statusCode",
                          "source" : [
                            {
                              "context" : "obs",
                              "element" : "statusCode",
                              "variable" : "statusc",
                              "condition" : "(code = 'aborted')"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "observation1",
                              "contextType" : "variable",
                              "element" : "status",
                              "transform" : "copy",
                              "parameter" : [
                                {
                                  "valueString" : "cancelled"
                                }
                              ]
                            }
                          ]
                        },
                        {
                          "name" : "statusCode",
                          "source" : [
                            {
                              "context" : "obs",
                              "element" : "statusCode",
                              "variable" : "statusc",
                              "condition" : "(code = 'suspended')"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "observation1",
                              "contextType" : "variable",
                              "element" : "status",
                              "transform" : "copy",
                              "parameter" : [
                                {
                                  "valueString" : "partial"
                                }
                              ]
                            }
                          ]
                        },
                        {
                          "name" : "statuscode",
                          "source" : [
                            {
                              "context" : "obs",
                              "condition" : "obs.statusCode.exists().not()"
                            }
                          ],
                          "rule" : [
                            {
                              "name" : "status",
                              "source" : [
                                {
                                  "context" : "obs"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "observation1",
                                  "contextType" : "variable",
                                  "element" : "status",
                                  "transform" : "copy",
                                  "parameter" : [
                                    {
                                      "valueString" : "final"
                                    }
                                  ]
                                }
                              ]
                            }
                          ]
                        },
                        {
                          "name" : "quant",
                          "source" : [
                            {
                              "context" : "obs"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "observation1",
                              "contextType" : "variable",
                              "element" : "value",
                              "variable" : "quant",
                              "transform" : "create",
                              "parameter" : [
                                {
                                  "valueString" : "Quantity"
                                }
                              ]
                            }
                          ],
                          "rule" : [
                            {
                              "name" : "value",
                              "source" : [
                                {
                                  "context" : "obs",
                                  "element" : "value",
                                  "variable" : "v"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "quant",
                                  "contextType" : "variable",
                                  "element" : "value",
                                  "transform" : "evaluate",
                                  "parameter" : [
                                    {
                                      "valueString" : "v.value"
                                    }
                                  ]
                                }
                              ]
                            },
                            {
                              "name" : "value",
                              "source" : [
                                {
                                  "context" : "obs",
                                  "element" : "value",
                                  "variable" : "v"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "quant",
                                  "contextType" : "variable",
                                  "element" : "unit",
                                  "transform" : "evaluate",
                                  "parameter" : [
                                    {
                                      "valueString" : "v.unit"
                                    }
                                  ]
                                }
                              ]
                            }
                          ]
                        },
                        {
                          "name" : "val",
                          "source" : [
                            {
                              "context" : "obs",
                              "type" : "CE",
                              "element" : "value",
                              "variable" : "val"
                            }
                          ],
                          "rule" : [
                            {
                              "name" : "coding",
                              "source" : [
                                {
                                  "context" : "val"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "ob",
                                  "contextType" : "variable",
                                  "element" : "value",
                                  "variable" : "ce",
                                  "transform" : "create",
                                  "parameter" : [
                                    {
                                      "valueString" : "CodeableConcept"
                                    }
                                  ]
                                }
                              ],
                              "rule" : [
                                {
                                  "name" : "originltext",
                                  "source" : [
                                    {
                                      "context" : "val",
                                      "element" : "originalText",
                                      "variable" : "originalText"
                                    }
                                  ],
                                  "rule" : [
                                    {
                                      "name" : "reference",
                                      "source" : [
                                        {
                                          "context" : "originalText",
                                          "element" : "reference",
                                          "variable" : "reference"
                                        }
                                      ],
                                      "target" : [
                                        {
                                          "context" : "ce",
                                          "contextType" : "variable",
                                          "element" : "text",
                                          "transform" : "copy",
                                          "parameter" : [
                                            {
                                              "valueId" : "reference"
                                            }
                                          ]
                                        }
                                      ]
                                    }
                                  ]
                                },
                                {
                                  "name" : "code",
                                  "source" : [
                                    {
                                      "context" : "val"
                                    }
                                  ],
                                  "target" : [
                                    {
                                      "context" : "ce",
                                      "contextType" : "variable",
                                      "element" : "coding",
                                      "variable" : "coding"
                                    }
                                  ],
                                  "rule" : [
                                    {
                                      "name" : "code",
                                      "source" : [
                                        {
                                          "context" : "val",
                                          "element" : "code",
                                          "variable" : "code"
                                        }
                                      ],
                                      "target" : [
                                        {
                                          "context" : "coding",
                                          "contextType" : "variable",
                                          "element" : "code",
                                          "transform" : "cast",
                                          "parameter" : [
                                            {
                                              "valueId" : "code"
                                            },
                                            {
                                              "valueString" : "string"
                                            }
                                          ]
                                        }
                                      ]
                                    },
                                    {
                                      "name" : "codeSystem",
                                      "source" : [
                                        {
                                          "context" : "val",
                                          "element" : "codeSystem",
                                          "variable" : "system"
                                        }
                                      ],
                                      "target" : [
                                        {
                                          "context" : "coding",
                                          "contextType" : "variable",
                                          "element" : "system",
                                          "transform" : "translate",
                                          "parameter" : [
                                            {
                                              "valueId" : "system"
                                            },
                                            {
                                              "valueString" : "http://hl7.org/fhir/ConceptMap/special-oid2uri"
                                            },
                                            {
                                              "valueString" : "uri"
                                            }
                                          ]
                                        }
                                      ]
                                    },
                                    {
                                      "name" : "displayName",
                                      "source" : [
                                        {
                                          "context" : "val",
                                          "element" : "displayName",
                                          "variable" : "display"
                                        }
                                      ],
                                      "target" : [
                                        {
                                          "context" : "coding",
                                          "contextType" : "variable",
                                          "element" : "display",
                                          "transform" : "cast",
                                          "parameter" : [
                                            {
                                              "valueId" : "display"
                                            },
                                            {
                                              "valueString" : "string"
                                            }
                                          ]
                                        }
                                      ]
                                    },
                                    {
                                      "name" : "codeSystemVersion",
                                      "source" : [
                                        {
                                          "context" : "val",
                                          "element" : "codeSystemVersion",
                                          "variable" : "version"
                                        }
                                      ],
                                      "target" : [
                                        {
                                          "context" : "coding",
                                          "contextType" : "variable",
                                          "element" : "version",
                                          "transform" : "cast",
                                          "parameter" : [
                                            {
                                              "valueId" : "version"
                                            },
                                            {
                                              "valueString" : "string"
                                            }
                                          ]
                                        }
                                      ]
                                    }
                                  ]
                                },
                                {
                                  "name" : "translation",
                                  "source" : [
                                    {
                                      "context" : "val",
                                      "element" : "translation",
                                      "variable" : "translation"
                                    }
                                  ],
                                  "target" : [
                                    {
                                      "context" : "ce",
                                      "contextType" : "variable",
                                      "element" : "coding",
                                      "variable" : "coding"
                                    }
                                  ],
                                  "rule" : [
                                    {
                                      "name" : "code",
                                      "source" : [
                                        {
                                          "context" : "translation",
                                          "element" : "code",
                                          "variable" : "code"
                                        }
                                      ],
                                      "target" : [
                                        {
                                          "context" : "coding",
                                          "contextType" : "variable",
                                          "element" : "code",
                                          "transform" : "cast",
                                          "parameter" : [
                                            {
                                              "valueId" : "code"
                                            },
                                            {
                                              "valueString" : "string"
                                            }
                                          ]
                                        }
                                      ]
                                    },
                                    {
                                      "name" : "codeSystem",
                                      "source" : [
                                        {
                                          "context" : "translation",
                                          "element" : "codeSystem",
                                          "variable" : "system"
                                        }
                                      ],
                                      "target" : [
                                        {
                                          "context" : "coding",
                                          "contextType" : "variable",
                                          "element" : "system",
                                          "transform" : "translate",
                                          "parameter" : [
                                            {
                                              "valueId" : "system"
                                            },
                                            {
                                              "valueString" : "http://hl7.org/fhir/ConceptMap/special-oid2uri"
                                            },
                                            {
                                              "valueString" : "uri"
                                            }
                                          ]
                                        }
                                      ]
                                    },
                                    {
                                      "name" : "displayName",
                                      "source" : [
                                        {
                                          "context" : "translation",
                                          "element" : "displayName",
                                          "variable" : "display"
                                        }
                                      ],
                                      "target" : [
                                        {
                                          "context" : "coding",
                                          "contextType" : "variable",
                                          "element" : "display",
                                          "transform" : "cast",
                                          "parameter" : [
                                            {
                                              "valueId" : "display"
                                            },
                                            {
                                              "valueString" : "string"
                                            }
                                          ]
                                        }
                                      ]
                                    },
                                    {
                                      "name" : "codeSystemVersion",
                                      "source" : [
                                        {
                                          "context" : "translation",
                                          "element" : "codeSystemVersion",
                                          "variable" : "version"
                                        }
                                      ],
                                      "target" : [
                                        {
                                          "context" : "coding",
                                          "contextType" : "variable",
                                          "element" : "version",
                                          "transform" : "cast",
                                          "parameter" : [
                                            {
                                              "valueId" : "version"
                                            },
                                            {
                                              "valueString" : "string"
                                            }
                                          ]
                                        }
                                      ]
                                    },
                                    {
                                      "name" : "qualifier",
                                      "source" : [
                                        {
                                          "context" : "translation",
                                          "element" : "qualifier",
                                          "variable" : "qualifier"
                                        }
                                      ],
                                      "rule" : [
                                        {
                                          "name" : "value",
                                          "source" : [
                                            {
                                              "context" : "qualifier",
                                              "element" : "value",
                                              "variable" : "value"
                                            }
                                          ],
                                          "target" : [
                                            {
                                              "context" : "ce",
                                              "contextType" : "variable",
                                              "element" : "coding",
                                              "variable" : "coding"
                                            }
                                          ],
                                          "rule" : [
                                            {
                                              "name" : "code",
                                              "source" : [
                                                {
                                                  "context" : "value",
                                                  "element" : "code",
                                                  "variable" : "code"
                                                }
                                              ],
                                              "target" : [
                                                {
                                                  "context" : "coding",
                                                  "contextType" : "variable",
                                                  "element" : "code",
                                                  "transform" : "cast",
                                                  "parameter" : [
                                                    {
                                                      "valueId" : "code"
                                                    },
                                                    {
                                                      "valueString" : "string"
                                                    }
                                                  ]
                                                }
                                              ]
                                            },
                                            {
                                              "name" : "codeSystem",
                                              "source" : [
                                                {
                                                  "context" : "value",
                                                  "element" : "codeSystem",
                                                  "variable" : "system"
                                                }
                                              ],
                                              "target" : [
                                                {
                                                  "context" : "coding",
                                                  "contextType" : "variable",
                                                  "element" : "system",
                                                  "transform" : "translate",
                                                  "parameter" : [
                                                    {
                                                      "valueId" : "system"
                                                    },
                                                    {
                                                      "valueString" : "http://hl7.org/fhir/ConceptMap/special-oid2uri"
                                                    },
                                                    {
                                                      "valueString" : "uri"
                                                    }
                                                  ]
                                                }
                                              ]
                                            },
                                            {
                                              "name" : "displayName",
                                              "source" : [
                                                {
                                                  "context" : "value",
                                                  "element" : "displayName",
                                                  "variable" : "display"
                                                }
                                              ],
                                              "target" : [
                                                {
                                                  "context" : "coding",
                                                  "contextType" : "variable",
                                                  "element" : "display",
                                                  "transform" : "cast",
                                                  "parameter" : [
                                                    {
                                                      "valueId" : "display"
                                                    },
                                                    {
                                                      "valueString" : "string"
                                                    }
                                                  ]
                                                }
                                              ]
                                            },
                                            {
                                              "name" : "codeSystemVersion",
                                              "source" : [
                                                {
                                                  "context" : "value",
                                                  "element" : "codeSystemVersion",
                                                  "variable" : "version"
                                                }
                                              ],
                                              "target" : [
                                                {
                                                  "context" : "coding",
                                                  "contextType" : "variable",
                                                  "element" : "version",
                                                  "transform" : "cast",
                                                  "parameter" : [
                                                    {
                                                      "valueId" : "version"
                                                    },
                                                    {
                                                      "valueString" : "string"
                                                    }
                                                  ]
                                                }
                                              ]
                                            }
                                          ]
                                        }
                                      ]
                                    }
                                  ]
                                }
                              ]
                            }
                          ]
                        },
                        {
                          "name" : "val",
                          "source" : [
                            {
                              "context" : "obs",
                              "type" : "CD",
                              "element" : "value",
                              "variable" : "val"
                            }
                          ],
                          "rule" : [
                            {
                              "name" : "coding",
                              "source" : [
                                {
                                  "context" : "val"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "ob",
                                  "contextType" : "variable",
                                  "element" : "value",
                                  "variable" : "ce",
                                  "transform" : "create",
                                  "parameter" : [
                                    {
                                      "valueString" : "CodeableConcept"
                                    }
                                  ]
                                }
                              ],
                              "rule" : [
                                {
                                  "name" : "originltext",
                                  "source" : [
                                    {
                                      "context" : "val",
                                      "element" : "originalText",
                                      "variable" : "originalText"
                                    }
                                  ],
                                  "rule" : [
                                    {
                                      "name" : "reference",
                                      "source" : [
                                        {
                                          "context" : "originalText",
                                          "element" : "reference",
                                          "variable" : "reference"
                                        }
                                      ],
                                      "target" : [
                                        {
                                          "context" : "ce",
                                          "contextType" : "variable",
                                          "element" : "text",
                                          "transform" : "copy",
                                          "parameter" : [
                                            {
                                              "valueId" : "reference"
                                            }
                                          ]
                                        }
                                      ]
                                    }
                                  ]
                                },
                                {
                                  "name" : "code",
                                  "source" : [
                                    {
                                      "context" : "val"
                                    }
                                  ],
                                  "target" : [
                                    {
                                      "context" : "ce",
                                      "contextType" : "variable",
                                      "element" : "coding",
                                      "variable" : "coding"
                                    }
                                  ],
                                  "rule" : [
                                    {
                                      "name" : "code",
                                      "source" : [
                                        {
                                          "context" : "val",
                                          "element" : "code",
                                          "variable" : "code"
                                        }
                                      ],
                                      "target" : [
                                        {
                                          "context" : "coding",
                                          "contextType" : "variable",
                                          "element" : "code",
                                          "transform" : "cast",
                                          "parameter" : [
                                            {
                                              "valueId" : "code"
                                            },
                                            {
                                              "valueString" : "string"
                                            }
                                          ]
                                        }
                                      ]
                                    },
                                    {
                                      "name" : "codeSystem",
                                      "source" : [
                                        {
                                          "context" : "val",
                                          "element" : "codeSystem",
                                          "variable" : "system"
                                        }
                                      ],
                                      "target" : [
                                        {
                                          "context" : "coding",
                                          "contextType" : "variable",
                                          "element" : "system",
                                          "transform" : "translate",
                                          "parameter" : [
                                            {
                                              "valueId" : "system"
                                            },
                                            {
                                              "valueString" : "http://hl7.org/fhir/ConceptMap/special-oid2uri"
                                            },
                                            {
                                              "valueString" : "uri"
                                            }
                                          ]
                                        }
                                      ]
                                    },
                                    {
                                      "name" : "displayName",
                                      "source" : [
                                        {
                                          "context" : "val",
                                          "element" : "displayName",
                                          "variable" : "display"
                                        }
                                      ],
                                      "target" : [
                                        {
                                          "context" : "coding",
                                          "contextType" : "variable",
                                          "element" : "display",
                                          "transform" : "cast",
                                          "parameter" : [
                                            {
                                              "valueId" : "display"
                                            },
                                            {
                                              "valueString" : "string"
                                            }
                                          ]
                                        }
                                      ]
                                    },
                                    {
                                      "name" : "codeSystemVersion",
                                      "source" : [
                                        {
                                          "context" : "val",
                                          "element" : "codeSystemVersion",
                                          "variable" : "version"
                                        }
                                      ],
                                      "target" : [
                                        {
                                          "context" : "coding",
                                          "contextType" : "variable",
                                          "element" : "version",
                                          "transform" : "cast",
                                          "parameter" : [
                                            {
                                              "valueId" : "version"
                                            },
                                            {
                                              "valueString" : "string"
                                            }
                                          ]
                                        }
                                      ]
                                    }
                                  ]
                                },
                                {
                                  "name" : "translation",
                                  "source" : [
                                    {
                                      "context" : "val",
                                      "element" : "translation",
                                      "variable" : "translation"
                                    }
                                  ],
                                  "target" : [
                                    {
                                      "context" : "ce",
                                      "contextType" : "variable",
                                      "element" : "coding",
                                      "variable" : "coding"
                                    }
                                  ],
                                  "rule" : [
                                    {
                                      "name" : "code",
                                      "source" : [
                                        {
                                          "context" : "translation",
                                          "element" : "code",
                                          "variable" : "code"
                                        }
                                      ],
                                      "target" : [
                                        {
                                          "context" : "coding",
                                          "contextType" : "variable",
                                          "element" : "code",
                                          "transform" : "cast",
                                          "parameter" : [
                                            {
                                              "valueId" : "code"
                                            },
                                            {
                                              "valueString" : "string"
                                            }
                                          ]
                                        }
                                      ]
                                    },
                                    {
                                      "name" : "codeSystem",
                                      "source" : [
                                        {
                                          "context" : "translation",
                                          "element" : "codeSystem",
                                          "variable" : "system"
                                        }
                                      ],
                                      "target" : [
                                        {
                                          "context" : "coding",
                                          "contextType" : "variable",
                                          "element" : "system",
                                          "transform" : "translate",
                                          "parameter" : [
                                            {
                                              "valueId" : "system"
                                            },
                                            {
                                              "valueString" : "http://hl7.org/fhir/ConceptMap/special-oid2uri"
                                            },
                                            {
                                              "valueString" : "uri"
                                            }
                                          ]
                                        }
                                      ]
                                    },
                                    {
                                      "name" : "displayName",
                                      "source" : [
                                        {
                                          "context" : "translation",
                                          "element" : "displayName",
                                          "variable" : "display"
                                        }
                                      ],
                                      "target" : [
                                        {
                                          "context" : "coding",
                                          "contextType" : "variable",
                                          "element" : "display",
                                          "transform" : "cast",
                                          "parameter" : [
                                            {
                                              "valueId" : "display"
                                            },
                                            {
                                              "valueString" : "string"
                                            }
                                          ]
                                        }
                                      ]
                                    },
                                    {
                                      "name" : "codeSystemVersion",
                                      "source" : [
                                        {
                                          "context" : "translation",
                                          "element" : "codeSystemVersion",
                                          "variable" : "version"
                                        }
                                      ],
                                      "target" : [
                                        {
                                          "context" : "coding",
                                          "contextType" : "variable",
                                          "element" : "version",
                                          "transform" : "cast",
                                          "parameter" : [
                                            {
                                              "valueId" : "version"
                                            },
                                            {
                                              "valueString" : "string"
                                            }
                                          ]
                                        }
                                      ]
                                    },
                                    {
                                      "name" : "qualifier",
                                      "source" : [
                                        {
                                          "context" : "translation",
                                          "element" : "qualifier",
                                          "variable" : "qualifier"
                                        }
                                      ],
                                      "rule" : [
                                        {
                                          "name" : "value",
                                          "source" : [
                                            {
                                              "context" : "qualifier",
                                              "element" : "value",
                                              "variable" : "value"
                                            }
                                          ],
                                          "target" : [
                                            {
                                              "context" : "ce",
                                              "contextType" : "variable",
                                              "element" : "coding",
                                              "variable" : "coding"
                                            }
                                          ],
                                          "rule" : [
                                            {
                                              "name" : "code",
                                              "source" : [
                                                {
                                                  "context" : "value",
                                                  "element" : "code",
                                                  "variable" : "code"
                                                }
                                              ],
                                              "target" : [
                                                {
                                                  "context" : "coding",
                                                  "contextType" : "variable",
                                                  "element" : "code",
                                                  "transform" : "cast",
                                                  "parameter" : [
                                                    {
                                                      "valueId" : "code"
                                                    },
                                                    {
                                                      "valueString" : "string"
                                                    }
                                                  ]
                                                }
                                              ]
                                            },
                                            {
                                              "name" : "codeSystem",
                                              "source" : [
                                                {
                                                  "context" : "value",
                                                  "element" : "codeSystem",
                                                  "variable" : "system"
                                                }
                                              ],
                                              "target" : [
                                                {
                                                  "context" : "coding",
                                                  "contextType" : "variable",
                                                  "element" : "system",
                                                  "transform" : "translate",
                                                  "parameter" : [
                                                    {
                                                      "valueId" : "system"
                                                    },
                                                    {
                                                      "valueString" : "http://hl7.org/fhir/ConceptMap/special-oid2uri"
                                                    },
                                                    {
                                                      "valueString" : "uri"
                                                    }
                                                  ]
                                                }
                                              ]
                                            },
                                            {
                                              "name" : "displayName",
                                              "source" : [
                                                {
                                                  "context" : "value",
                                                  "element" : "displayName",
                                                  "variable" : "display"
                                                }
                                              ],
                                              "target" : [
                                                {
                                                  "context" : "coding",
                                                  "contextType" : "variable",
                                                  "element" : "display",
                                                  "transform" : "cast",
                                                  "parameter" : [
                                                    {
                                                      "valueId" : "display"
                                                    },
                                                    {
                                                      "valueString" : "string"
                                                    }
                                                  ]
                                                }
                                              ]
                                            },
                                            {
                                              "name" : "codeSystemVersion",
                                              "source" : [
                                                {
                                                  "context" : "value",
                                                  "element" : "codeSystemVersion",
                                                  "variable" : "version"
                                                }
                                              ],
                                              "target" : [
                                                {
                                                  "context" : "coding",
                                                  "contextType" : "variable",
                                                  "element" : "version",
                                                  "transform" : "cast",
                                                  "parameter" : [
                                                    {
                                                      "valueId" : "version"
                                                    },
                                                    {
                                                      "valueString" : "string"
                                                    }
                                                  ]
                                                }
                                              ]
                                            }
                                          ]
                                        }
                                      ]
                                    }
                                  ]
                                }
                              ]
                            }
                          ]
                        },
                        {
                          "name" : "value",
                          "source" : [
                            {
                              "context" : "obs",
                              "type" : "ST",
                              "element" : "value",
                              "variable" : "value"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "ob",
                              "contextType" : "variable",
                              "element" : "value",
                              "transform" : "create",
                              "parameter" : [
                                {
                                  "valueString" : "string"
                                }
                              ]
                            },
                            {
                              "context" : "ob",
                              "contextType" : "variable",
                              "element" : "value",
                              "transform" : "evaluate",
                              "parameter" : [
                                {
                                  "valueString" : "value.dataString"
                                }
                              ]
                            }
                          ]
                        },
                        {
                          "name" : "value",
                          "source" : [
                            {
                              "context" : "obs",
                              "type" : "INT",
                              "element" : "value",
                              "variable" : "int"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "ob",
                              "contextType" : "variable",
                              "element" : "value",
                              "transform" : "evaluate",
                              "parameter" : [
                                {
                                  "valueString" : "int.value"
                                }
                              ]
                            }
                          ]
                        },
                        {
                          "name" : "boolean",
                          "source" : [
                            {
                              "context" : "obs",
                              "type" : "BL",
                              "element" : "value",
                              "variable" : "boolean"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "ob",
                              "contextType" : "variable",
                              "element" : "value",
                              "transform" : "evaluate",
                              "parameter" : [
                                {
                                  "valueString" : "boolean.value"
                                }
                              ]
                            }
                          ]
                        },
                        {
                          "name" : "interpretationCode",
                          "source" : [
                            {
                              "context" : "obs",
                              "element" : "interpretationCode",
                              "variable" : "vvv"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "observation1",
                              "contextType" : "variable",
                              "element" : "interpretation",
                              "variable" : "vvv",
                              "transform" : "create"
                            }
                          ]
                        },
                        {
                          "name" : "methodCode",
                          "source" : [
                            {
                              "context" : "obs",
                              "element" : "methodCode",
                              "variable" : "vvv"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "observation1",
                              "contextType" : "variable",
                              "element" : "method",
                              "variable" : "vvv",
                              "transform" : "create"
                            }
                          ]
                        },
                        {
                          "name" : "targetSiteCode",
                          "source" : [
                            {
                              "context" : "obs",
                              "element" : "targetSiteCode",
                              "variable" : "vvv"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "observation1",
                              "contextType" : "variable",
                              "element" : "bodySite",
                              "variable" : "vvv",
                              "transform" : "create"
                            }
                          ]
                        },
                        {
                          "name" : "performer",
                          "source" : [
                            {
                              "context" : "obs",
                              "element" : "performer",
                              "variable" : "performer"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "bundle",
                              "contextType" : "variable",
                              "element" : "entry",
                              "variable" : "e1"
                            },
                            {
                              "context" : "e1",
                              "contextType" : "variable",
                              "element" : "request",
                              "variable" : "request",
                              "transform" : "create",
                              "parameter" : [
                                {
                                  "valueString" : "BackboneElement"
                                }
                              ]
                            },
                            {
                              "context" : "request",
                              "contextType" : "variable",
                              "element" : "method",
                              "transform" : "copy",
                              "parameter" : [
                                {
                                  "valueString" : "PUT"
                                }
                              ]
                            },
                            {
                              "context" : "e1",
                              "contextType" : "variable",
                              "element" : "resource",
                              "variable" : "practitioner",
                              "transform" : "create",
                              "parameter" : [
                                {
                                  "valueString" : "Practitioner"
                                }
                              ]
                            },
                            {
                              "context" : "practitioner",
                              "contextType" : "variable",
                              "element" : "id",
                              "variable" : "uuid1",
                              "transform" : "uuid"
                            },
                            {
                              "context" : "e1",
                              "contextType" : "variable",
                              "element" : "fullUrl",
                              "transform" : "append",
                              "parameter" : [
                                {
                                  "valueString" : "https://example/Practitioner/"
                                },
                                {
                                  "valueId" : "uuid1"
                                }
                              ]
                            },
                            {
                              "context" : "request",
                              "contextType" : "variable",
                              "element" : "url",
                              "transform" : "append",
                              "parameter" : [
                                {
                                  "valueString" : "Practitioner/"
                                },
                                {
                                  "valueId" : "uuid1"
                                }
                              ]
                            }
                          ],
                          "rule" : [
                            {
                              "name" : "time",
                              "source" : [
                                {
                                  "context" : "performer",
                                  "element" : "time",
                                  "variable" : "t"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "observation1",
                                  "contextType" : "variable",
                                  "element" : "issued",
                                  "variable" : "date",
                                  "transform" : "create",
                                  "parameter" : [
                                    {
                                      "valueString" : "dateTime"
                                    }
                                  ]
                                }
                              ],
                              "dependent" : [
                                {
                                  "name" : "TSDateTime",
                                  "variable" : [
                                    "t",
                                    "date"
                                  ]
                                }
                              ]
                            },
                            {
                              "name" : "assEntity",
                              "source" : [
                                {
                                  "context" : "performer",
                                  "element" : "assignedEntity",
                                  "variable" : "assEntity"
                                }
                              ],
                              "rule" : [
                                {
                                  "name" : "meta",
                                  "source" : [
                                    {
                                      "context" : "assEntity"
                                    }
                                  ],
                                  "target" : [
                                    {
                                      "context" : "practitioner",
                                      "contextType" : "variable",
                                      "element" : "meta",
                                      "variable" : "meta"
                                    }
                                  ],
                                  "rule" : [
                                    {
                                      "name" : "coding",
                                      "source" : [
                                        {
                                          "context" : "assEntity"
                                        }
                                      ],
                                      "target" : [
                                        {
                                          "context" : "meta",
                                          "contextType" : "variable",
                                          "element" : "tag",
                                          "variable" : "coding",
                                          "transform" : "create",
                                          "parameter" : [
                                            {
                                              "valueString" : "Coding"
                                            }
                                          ]
                                        }
                                      ],
                                      "rule" : [
                                        {
                                          "name" : "system",
                                          "source" : [
                                            {
                                              "context" : "assEntity"
                                            }
                                          ],
                                          "target" : [
                                            {
                                              "context" : "coding",
                                              "contextType" : "variable",
                                              "element" : "system",
                                              "transform" : "copy",
                                              "parameter" : [
                                                {
                                                  "valueString" : "http://algoritmodiscoring"
                                                }
                                              ]
                                            }
                                          ]
                                        },
                                        {
                                          "name" : "code",
                                          "source" : [
                                            {
                                              "context" : "assEntity"
                                            }
                                          ],
                                          "target" : [
                                            {
                                              "context" : "coding",
                                              "contextType" : "variable",
                                              "element" : "code",
                                              "transform" : "copy",
                                              "parameter" : [
                                                {
                                                  "valueString" : "ClinicalDocument/body/ParametriVitali/performer"
                                                }
                                              ]
                                            }
                                          ]
                                        }
                                      ]
                                    }
                                  ],
                                  "documentation" : "inizio modifica meta+ identifier"
                                },
                                {
                                  "name" : "identifier",
                                  "source" : [
                                    {
                                      "context" : "assEntity",
                                      "element" : "id",
                                      "variable" : "id"
                                    }
                                  ],
                                  "target" : [
                                    {
                                      "context" : "practitioner",
                                      "contextType" : "variable",
                                      "element" : "identifier",
                                      "variable" : "identifier"
                                    }
                                  ],
                                  "rule" : [
                                    {
                                      "name" : "root1",
                                      "source" : [
                                        {
                                          "context" : "id",
                                          "element" : "root",
                                          "variable" : "r"
                                        }
                                      ],
                                      "target" : [
                                        {
                                          "context" : "identifier",
                                          "contextType" : "variable",
                                          "element" : "system",
                                          "transform" : "translate",
                                          "parameter" : [
                                            {
                                              "valueId" : "r"
                                            },
                                            {
                                              "valueString" : "http://hl7.org/fhir/ConceptMap/special-oid2uri"
                                            },
                                            {
                                              "valueString" : "uri"
                                            }
                                          ]
                                        }
                                      ]
                                    },
                                    {
                                      "name" : "extension",
                                      "source" : [
                                        {
                                          "context" : "id",
                                          "element" : "extension",
                                          "variable" : "ext"
                                        }
                                      ],
                                      "target" : [
                                        {
                                          "context" : "identifier",
                                          "contextType" : "variable",
                                          "element" : "value",
                                          "transform" : "copy",
                                          "parameter" : [
                                            {
                                              "valueId" : "ext"
                                            }
                                          ]
                                        }
                                      ]
                                    },
                                    {
                                      "name" : "assigningAuthorityName",
                                      "source" : [
                                        {
                                          "context" : "id",
                                          "element" : "assigningAuthorityName",
                                          "variable" : "s"
                                        }
                                      ],
                                      "target" : [
                                        {
                                          "context" : "identifier",
                                          "contextType" : "variable",
                                          "element" : "assigner",
                                          "variable" : "a"
                                        },
                                        {
                                          "context" : "a",
                                          "contextType" : "variable",
                                          "element" : "display",
                                          "transform" : "copy",
                                          "parameter" : [
                                            {
                                              "valueId" : "s"
                                            }
                                          ]
                                        }
                                      ]
                                    },
                                    {
                                      "name" : "r",
                                      "source" : [
                                        {
                                          "context" : "id",
                                          "element" : "root",
                                          "variable" : "r"
                                        }
                                      ],
                                      "rule" : [
                                        {
                                          "name" : "aut",
                                          "source" : [
                                            {
                                              "context" : "id",
                                              "element" : "extension",
                                              "variable" : "ext"
                                            }
                                          ],
                                          "target" : [
                                            {
                                              "context" : "practitioner",
                                              "contextType" : "variable",
                                              "element" : "id",
                                              "variable" : "uuid2",
                                              "transform" : "evaluate",
                                              "parameter" : [
                                                {
                                                  "valueString" : "r + '-' + ext"
                                                }
                                              ]
                                            },
                                            {
                                              "context" : "e1",
                                              "contextType" : "variable",
                                              "element" : "fullUrl",
                                              "transform" : "append",
                                              "parameter" : [
                                                {
                                                  "valueString" : "https://example/Practitioner/"
                                                },
                                                {
                                                  "valueId" : "uuid2"
                                                }
                                              ]
                                            },
                                            {
                                              "context" : "request",
                                              "contextType" : "variable",
                                              "element" : "url",
                                              "transform" : "append",
                                              "parameter" : [
                                                {
                                                  "valueString" : "Practitioner/"
                                                },
                                                {
                                                  "valueId" : "uuid2"
                                                }
                                              ]
                                            },
                                            {
                                              "context" : "observation1",
                                              "contextType" : "variable",
                                              "element" : "performer",
                                              "variable" : "reference",
                                              "transform" : "create",
                                              "parameter" : [
                                                {
                                                  "valueString" : "Reference"
                                                }
                                              ]
                                            },
                                            {
                                              "context" : "reference",
                                              "contextType" : "variable",
                                              "element" : "reference",
                                              "transform" : "evaluate",
                                              "parameter" : [
                                                {
                                                  "valueString" : "'https://example/Practitioner/' + %practitioner.id"
                                                }
                                              ]
                                            }
                                          ]
                                        }
                                      ]
                                    }
                                  ]
                                },
                                {
                                  "name" : "2.16.840.1.113883.2.9.4.3.2",
                                  "source" : [
                                    {
                                      "context" : "assEntity",
                                      "element" : "id",
                                      "variable" : "id",
                                      "condition" : "(root = '2.16.840.1.113883.2.9.4.3.2')"
                                    }
                                  ],
                                  "rule" : [
                                    {
                                      "name" : "UUID",
                                      "source" : [
                                        {
                                          "context" : "id",
                                          "element" : "extension",
                                          "variable" : "ext"
                                        }
                                      ],
                                      "target" : [
                                        {
                                          "context" : "request",
                                          "contextType" : "variable",
                                          "element" : "url",
                                          "transform" : "append",
                                          "parameter" : [
                                            {
                                              "valueString" : "Practitioner?identifier="
                                            },
                                            {
                                              "valueId" : "ext"
                                            }
                                          ]
                                        }
                                      ]
                                    }
                                  ]
                                },
                                {
                                  "name" : "assPerson",
                                  "source" : [
                                    {
                                      "context" : "assEntity",
                                      "element" : "assignedPerson",
                                      "variable" : "assPerson"
                                    }
                                  ],
                                  "rule" : [
                                    {
                                      "name" : "name",
                                      "source" : [
                                        {
                                          "context" : "assPerson",
                                          "element" : "name",
                                          "variable" : "vvv"
                                        }
                                      ],
                                      "target" : [
                                        {
                                          "context" : "practitioner",
                                          "contextType" : "variable",
                                          "element" : "name",
                                          "variable" : "vvv",
                                          "transform" : "create"
                                        }
                                      ]
                                    }
                                  ],
                                  "documentation" : "fine modifica"
                                }
                              ]
                            }
                          ]
                        },
                        {
                          "name" : "parti",
                          "source" : [
                            {
                              "context" : "obs",
                              "element" : "participant",
                              "variable" : "parti"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "bundle",
                              "contextType" : "variable",
                              "element" : "entry",
                              "variable" : "e1"
                            },
                            {
                              "context" : "e1",
                              "contextType" : "variable",
                              "element" : "request",
                              "variable" : "request",
                              "transform" : "create",
                              "parameter" : [
                                {
                                  "valueString" : "BackboneElement"
                                }
                              ]
                            },
                            {
                              "context" : "request",
                              "contextType" : "variable",
                              "element" : "method",
                              "transform" : "copy",
                              "parameter" : [
                                {
                                  "valueString" : "POST"
                                }
                              ]
                            },
                            {
                              "context" : "e1",
                              "contextType" : "variable",
                              "element" : "resource",
                              "variable" : "serviceRequest",
                              "transform" : "create",
                              "parameter" : [
                                {
                                  "valueString" : "ServiceRequest"
                                }
                              ]
                            },
                            {
                              "context" : "serviceRequest",
                              "contextType" : "variable",
                              "element" : "id",
                              "variable" : "uuid1",
                              "transform" : "uuid"
                            },
                            {
                              "context" : "e1",
                              "contextType" : "variable",
                              "element" : "fullUrl",
                              "transform" : "append",
                              "parameter" : [
                                {
                                  "valueString" : "https://example/ServiceRequest/"
                                },
                                {
                                  "valueId" : "uuid1"
                                }
                              ]
                            },
                            {
                              "context" : "request",
                              "contextType" : "variable",
                              "element" : "url",
                              "transform" : "copy",
                              "parameter" : [
                                {
                                  "valueString" : "ServiceRequest"
                                }
                              ]
                            },
                            {
                              "context" : "observation1",
                              "contextType" : "variable",
                              "element" : "basedOn",
                              "variable" : "reference",
                              "transform" : "create",
                              "parameter" : [
                                {
                                  "valueString" : "Reference"
                                }
                              ]
                            },
                            {
                              "context" : "reference",
                              "contextType" : "variable",
                              "element" : "reference",
                              "transform" : "evaluate",
                              "parameter" : [
                                {
                                  "valueString" : "'https://example/ServiceRequest/' + %serviceRequest.id"
                                }
                              ]
                            }
                          ],
                          "rule" : [
                            {
                              "name" : "reference",
                              "source" : [
                                {
                                  "context" : "parti"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "serviceRequest",
                                  "contextType" : "variable",
                                  "element" : "subject",
                                  "variable" : "reference",
                                  "transform" : "create",
                                  "parameter" : [
                                    {
                                      "valueString" : "Reference"
                                    }
                                  ]
                                },
                                {
                                  "context" : "reference",
                                  "contextType" : "variable",
                                  "element" : "reference",
                                  "transform" : "evaluate",
                                  "parameter" : [
                                    {
                                      "valueString" : "'https://example/Patient/' + %patient.id"
                                    }
                                  ]
                                }
                              ]
                            },
                            {
                              "name" : "reference",
                              "source" : [
                                {
                                  "context" : "parti"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "serviceRequest",
                                  "contextType" : "variable",
                                  "element" : "encounter",
                                  "variable" : "reference",
                                  "transform" : "create",
                                  "parameter" : [
                                    {
                                      "valueString" : "Reference"
                                    }
                                  ]
                                },
                                {
                                  "context" : "reference",
                                  "contextType" : "variable",
                                  "element" : "reference",
                                  "transform" : "evaluate",
                                  "parameter" : [
                                    {
                                      "valueString" : "'https://example/Encounter/' + %enc.id"
                                    }
                                  ]
                                }
                              ]
                            },
                            {
                              "name" : "status",
                              "source" : [
                                {
                                  "context" : "parti"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "serviceRequest",
                                  "contextType" : "variable",
                                  "element" : "status",
                                  "transform" : "copy",
                                  "parameter" : [
                                    {
                                      "valueString" : "active"
                                    }
                                  ]
                                }
                              ]
                            },
                            {
                              "name" : "intent",
                              "source" : [
                                {
                                  "context" : "parti"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "serviceRequest",
                                  "contextType" : "variable",
                                  "element" : "intent",
                                  "transform" : "copy",
                                  "parameter" : [
                                    {
                                      "valueString" : "order"
                                    }
                                  ]
                                }
                              ]
                            },
                            {
                              "name" : "value2",
                              "source" : [
                                {
                                  "context" : "parti",
                                  "element" : "time",
                                  "variable" : "t"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "serviceRequest",
                                  "contextType" : "variable",
                                  "element" : "authoredOn",
                                  "variable" : "value",
                                  "transform" : "create",
                                  "parameter" : [
                                    {
                                      "valueString" : "dateTime"
                                    }
                                  ]
                                }
                              ],
                              "dependent" : [
                                {
                                  "name" : "TSDateTime",
                                  "variable" : [
                                    "t",
                                    "value"
                                  ]
                                }
                              ]
                            },
                            {
                              "name" : "partRole",
                              "source" : [
                                {
                                  "context" : "parti",
                                  "element" : "participantRole",
                                  "variable" : "partRole"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "bundle",
                                  "contextType" : "variable",
                                  "element" : "entry",
                                  "variable" : "e1"
                                },
                                {
                                  "context" : "e1",
                                  "contextType" : "variable",
                                  "element" : "request",
                                  "variable" : "request",
                                  "transform" : "create",
                                  "parameter" : [
                                    {
                                      "valueString" : "BackboneElement"
                                    }
                                  ]
                                },
                                {
                                  "context" : "request",
                                  "contextType" : "variable",
                                  "element" : "method",
                                  "transform" : "copy",
                                  "parameter" : [
                                    {
                                      "valueString" : "PUT"
                                    }
                                  ]
                                },
                                {
                                  "context" : "e1",
                                  "contextType" : "variable",
                                  "element" : "resource",
                                  "variable" : "practitioner",
                                  "transform" : "create",
                                  "parameter" : [
                                    {
                                      "valueString" : "Practitioner"
                                    }
                                  ]
                                },
                                {
                                  "context" : "practitioner",
                                  "contextType" : "variable",
                                  "element" : "id",
                                  "variable" : "uuid1",
                                  "transform" : "uuid"
                                },
                                {
                                  "context" : "e1",
                                  "contextType" : "variable",
                                  "element" : "fullUrl",
                                  "transform" : "append",
                                  "parameter" : [
                                    {
                                      "valueString" : "https://example/Practitioner/"
                                    },
                                    {
                                      "valueId" : "uuid1"
                                    }
                                  ]
                                },
                                {
                                  "context" : "request",
                                  "contextType" : "variable",
                                  "element" : "url",
                                  "transform" : "append",
                                  "parameter" : [
                                    {
                                      "valueString" : "Practitioner/"
                                    },
                                    {
                                      "valueId" : "uuid1"
                                    }
                                  ]
                                }
                              ],
                              "rule" : [
                                {
                                  "name" : "meta",
                                  "source" : [
                                    {
                                      "context" : "partRole"
                                    }
                                  ],
                                  "target" : [
                                    {
                                      "context" : "practitioner",
                                      "contextType" : "variable",
                                      "element" : "meta",
                                      "variable" : "meta"
                                    }
                                  ],
                                  "rule" : [
                                    {
                                      "name" : "coding",
                                      "source" : [
                                        {
                                          "context" : "partRole"
                                        }
                                      ],
                                      "target" : [
                                        {
                                          "context" : "meta",
                                          "contextType" : "variable",
                                          "element" : "tag",
                                          "variable" : "coding",
                                          "transform" : "create",
                                          "parameter" : [
                                            {
                                              "valueString" : "Coding"
                                            }
                                          ]
                                        }
                                      ],
                                      "rule" : [
                                        {
                                          "name" : "system",
                                          "source" : [
                                            {
                                              "context" : "partRole"
                                            }
                                          ],
                                          "target" : [
                                            {
                                              "context" : "coding",
                                              "contextType" : "variable",
                                              "element" : "system",
                                              "transform" : "copy",
                                              "parameter" : [
                                                {
                                                  "valueString" : "http://algoritmodiscoring"
                                                }
                                              ]
                                            }
                                          ]
                                        },
                                        {
                                          "name" : "code",
                                          "source" : [
                                            {
                                              "context" : "partRole"
                                            }
                                          ],
                                          "target" : [
                                            {
                                              "context" : "coding",
                                              "contextType" : "variable",
                                              "element" : "code",
                                              "transform" : "copy",
                                              "parameter" : [
                                                {
                                                  "valueString" : "ClinicalDocument/body/ParametriVitali/participant"
                                                }
                                              ]
                                            }
                                          ]
                                        }
                                      ]
                                    }
                                  ],
                                  "documentation" : "inizio modifica meta + identifier"
                                },
                                {
                                  "name" : "identifier",
                                  "source" : [
                                    {
                                      "context" : "partRole",
                                      "element" : "id",
                                      "variable" : "id"
                                    }
                                  ],
                                  "target" : [
                                    {
                                      "context" : "practitioner",
                                      "contextType" : "variable",
                                      "element" : "identifier",
                                      "variable" : "identifier"
                                    }
                                  ],
                                  "rule" : [
                                    {
                                      "name" : "root1",
                                      "source" : [
                                        {
                                          "context" : "id",
                                          "element" : "root",
                                          "variable" : "r"
                                        }
                                      ],
                                      "target" : [
                                        {
                                          "context" : "identifier",
                                          "contextType" : "variable",
                                          "element" : "system",
                                          "transform" : "translate",
                                          "parameter" : [
                                            {
                                              "valueId" : "r"
                                            },
                                            {
                                              "valueString" : "http://hl7.org/fhir/ConceptMap/special-oid2uri"
                                            },
                                            {
                                              "valueString" : "uri"
                                            }
                                          ]
                                        }
                                      ]
                                    },
                                    {
                                      "name" : "extension",
                                      "source" : [
                                        {
                                          "context" : "id",
                                          "element" : "extension",
                                          "variable" : "ext"
                                        }
                                      ],
                                      "target" : [
                                        {
                                          "context" : "identifier",
                                          "contextType" : "variable",
                                          "element" : "value",
                                          "transform" : "copy",
                                          "parameter" : [
                                            {
                                              "valueId" : "ext"
                                            }
                                          ]
                                        }
                                      ]
                                    },
                                    {
                                      "name" : "assigningAuthorityName",
                                      "source" : [
                                        {
                                          "context" : "id",
                                          "element" : "assigningAuthorityName",
                                          "variable" : "s"
                                        }
                                      ],
                                      "target" : [
                                        {
                                          "context" : "identifier",
                                          "contextType" : "variable",
                                          "element" : "assigner",
                                          "variable" : "a"
                                        },
                                        {
                                          "context" : "a",
                                          "contextType" : "variable",
                                          "element" : "display",
                                          "transform" : "copy",
                                          "parameter" : [
                                            {
                                              "valueId" : "s"
                                            }
                                          ]
                                        }
                                      ]
                                    },
                                    {
                                      "name" : "r",
                                      "source" : [
                                        {
                                          "context" : "id",
                                          "element" : "root",
                                          "variable" : "r"
                                        }
                                      ],
                                      "rule" : [
                                        {
                                          "name" : "aut",
                                          "source" : [
                                            {
                                              "context" : "id",
                                              "element" : "extension",
                                              "variable" : "ext"
                                            }
                                          ],
                                          "target" : [
                                            {
                                              "context" : "practitioner",
                                              "contextType" : "variable",
                                              "element" : "id",
                                              "variable" : "uuid2",
                                              "transform" : "evaluate",
                                              "parameter" : [
                                                {
                                                  "valueString" : "r + '-' + ext"
                                                }
                                              ]
                                            },
                                            {
                                              "context" : "e1",
                                              "contextType" : "variable",
                                              "element" : "fullUrl",
                                              "transform" : "append",
                                              "parameter" : [
                                                {
                                                  "valueString" : "https://example/Practitioner/"
                                                },
                                                {
                                                  "valueId" : "uuid2"
                                                }
                                              ]
                                            },
                                            {
                                              "context" : "request",
                                              "contextType" : "variable",
                                              "element" : "url",
                                              "transform" : "append",
                                              "parameter" : [
                                                {
                                                  "valueString" : "Practitioner/"
                                                },
                                                {
                                                  "valueId" : "uuid2"
                                                }
                                              ]
                                            },
                                            {
                                              "context" : "serviceRequest",
                                              "contextType" : "variable",
                                              "element" : "requester",
                                              "variable" : "reference",
                                              "transform" : "create",
                                              "parameter" : [
                                                {
                                                  "valueString" : "Reference"
                                                }
                                              ]
                                            },
                                            {
                                              "context" : "reference",
                                              "contextType" : "variable",
                                              "element" : "reference",
                                              "transform" : "evaluate",
                                              "parameter" : [
                                                {
                                                  "valueString" : "'https://example/Practitioner/' + %practitioner.id"
                                                }
                                              ]
                                            }
                                          ]
                                        }
                                      ]
                                    }
                                  ]
                                },
                                {
                                  "name" : "2.16.840.1.113883.2.9.4.3.2",
                                  "source" : [
                                    {
                                      "context" : "partRole",
                                      "element" : "id",
                                      "variable" : "id",
                                      "condition" : "(root = '2.16.840.1.113883.2.9.4.3.2')"
                                    }
                                  ],
                                  "rule" : [
                                    {
                                      "name" : "UUID",
                                      "source" : [
                                        {
                                          "context" : "id",
                                          "element" : "extension",
                                          "variable" : "ext"
                                        }
                                      ],
                                      "target" : [
                                        {
                                          "context" : "request",
                                          "contextType" : "variable",
                                          "element" : "url",
                                          "transform" : "append",
                                          "parameter" : [
                                            {
                                              "valueString" : "Practitioner?identifier="
                                            },
                                            {
                                              "valueId" : "ext"
                                            }
                                          ]
                                        }
                                      ]
                                    }
                                  ]
                                },
                                {
                                  "name" : "name",
                                  "source" : [
                                    {
                                      "context" : "partRole",
                                      "element" : "playingEntity",
                                      "variable" : "playingEntity"
                                    }
                                  ],
                                  "rule" : [
                                    {
                                      "name" : "name",
                                      "source" : [
                                        {
                                          "context" : "playingEntity",
                                          "element" : "name",
                                          "variable" : "vvv"
                                        }
                                      ],
                                      "target" : [
                                        {
                                          "context" : "practitioner",
                                          "contextType" : "variable",
                                          "element" : "name",
                                          "variable" : "vvv",
                                          "transform" : "create"
                                        }
                                      ]
                                    }
                                  ],
                                  "documentation" : "fine modifica"
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ],
          "documentation" : "Sezione Strutturata --------------------------------------------------------------------------------------------------------------------------------------------------------"
        }
      ]
    },
    {
      "name" : "ClinicalDocumentSectionTerapiaFarmacoInPronto",
      "typeMode" : "none",
      "documentation" : "-----------------------------------------------------------------------------------------------------------------\r\nSezione terapia Farma in Pronto----------------------------------------------------------------------------------",
      "input" : [
        {
          "name" : "cda",
          "type" : "ClinicalDocument",
          "mode" : "source"
        },
        {
          "name" : "src",
          "type" : "Section",
          "mode" : "source"
        },
        {
          "name" : "patient",
          "type" : "Patient",
          "mode" : "target"
        },
        {
          "name" : "tgt",
          "mode" : "target"
        },
        {
          "name" : "bundle",
          "type" : "Bundle",
          "mode" : "target"
        },
        {
          "name" : "enc",
          "type" : "Encounter",
          "mode" : "target"
        }
      ],
      "rule" : [
        {
          "name" : "title",
          "source" : [
            {
              "context" : "src",
              "element" : "title",
              "variable" : "t"
            }
          ],
          "target" : [
            {
              "context" : "tgt",
              "contextType" : "variable",
              "element" : "title",
              "transform" : "evaluate",
              "parameter" : [
                {
                  "valueString" : "t.dataString"
                }
              ]
            }
          ]
        },
        {
          "name" : "code",
          "source" : [
            {
              "context" : "src",
              "element" : "code",
              "variable" : "vvv"
            }
          ],
          "target" : [
            {
              "context" : "tgt",
              "contextType" : "variable",
              "element" : "code",
              "variable" : "vvv",
              "transform" : "create"
            }
          ]
        },
        {
          "name" : "entry-exists",
          "source" : [
            {
              "context" : "src",
              "condition" : "src.entry.exists()"
            }
          ],
          "rule" : [
            {
              "name" : "cdaText",
              "source" : [
                {
                  "context" : "src",
                  "element" : "text",
                  "variable" : "cdaText"
                }
              ],
              "target" : [
                {
                  "context" : "tgt",
                  "contextType" : "variable",
                  "element" : "text",
                  "variable" : "fhirText"
                }
              ],
              "rule" : [
                {
                  "name" : "narrativeStatus",
                  "source" : [
                    {
                      "context" : "cdaText"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "fhirText",
                      "contextType" : "variable",
                      "element" : "status",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "generated"
                        }
                      ]
                    }
                  ]
                },
                {
                  "name" : "narrativeText",
                  "source" : [
                    {
                      "context" : "cdaText",
                      "variable" : "t"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "fhirText",
                      "contextType" : "variable",
                      "element" : "div",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueId" : "t"
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ]
        },
        {
          "name" : "where",
          "source" : [
            {
              "context" : "src",
              "condition" : "src.entry.exists().not()"
            }
          ],
          "rule" : [
            {
              "name" : "cdaText",
              "source" : [
                {
                  "context" : "src",
                  "element" : "text",
                  "variable" : "cdaText"
                }
              ],
              "target" : [
                {
                  "context" : "bundle",
                  "contextType" : "variable",
                  "element" : "entry",
                  "variable" : "e8"
                },
                {
                  "context" : "e8",
                  "contextType" : "variable",
                  "element" : "request",
                  "variable" : "request",
                  "transform" : "create",
                  "parameter" : [
                    {
                      "valueString" : "BackboneElement"
                    }
                  ]
                },
                {
                  "context" : "request",
                  "contextType" : "variable",
                  "element" : "method",
                  "transform" : "copy",
                  "parameter" : [
                    {
                      "valueString" : "POST"
                    }
                  ]
                },
                {
                  "context" : "e8",
                  "contextType" : "variable",
                  "element" : "resource",
                  "variable" : "MedicationAdministration",
                  "transform" : "create",
                  "parameter" : [
                    {
                      "valueString" : "MedicationAdministration"
                    }
                  ]
                },
                {
                  "context" : "MedicationAdministration",
                  "contextType" : "variable",
                  "element" : "id",
                  "variable" : "uuid8",
                  "transform" : "uuid"
                },
                {
                  "context" : "e8",
                  "contextType" : "variable",
                  "element" : "fullUrl",
                  "transform" : "append",
                  "parameter" : [
                    {
                      "valueString" : "https://example/MedicationAdministration/"
                    },
                    {
                      "valueId" : "uuid8"
                    }
                  ]
                },
                {
                  "context" : "request",
                  "contextType" : "variable",
                  "element" : "url",
                  "transform" : "copy",
                  "parameter" : [
                    {
                      "valueString" : "MedicationAdministration"
                    }
                  ]
                },
                {
                  "context" : "tgt",
                  "contextType" : "variable",
                  "element" : "entry",
                  "variable" : "reference",
                  "transform" : "create",
                  "parameter" : [
                    {
                      "valueString" : "Reference"
                    }
                  ]
                },
                {
                  "context" : "reference",
                  "contextType" : "variable",
                  "element" : "reference",
                  "transform" : "evaluate",
                  "parameter" : [
                    {
                      "valueString" : "'https://example/MedicationAdministration/' + %MedicationAdministration.id"
                    }
                  ]
                }
              ],
              "rule" : [
                {
                  "name" : "reference",
                  "source" : [
                    {
                      "context" : "src"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "MedicationAdministration",
                      "contextType" : "variable",
                      "element" : "subject",
                      "variable" : "reference",
                      "transform" : "create",
                      "parameter" : [
                        {
                          "valueString" : "Reference"
                        }
                      ]
                    },
                    {
                      "context" : "reference",
                      "contextType" : "variable",
                      "element" : "reference",
                      "transform" : "evaluate",
                      "parameter" : [
                        {
                          "valueString" : "'https://example/Patient/' + %patient.id"
                        }
                      ]
                    }
                  ]
                },
                {
                  "name" : "reference",
                  "source" : [
                    {
                      "context" : "src"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "MedicationAdministration",
                      "contextType" : "variable",
                      "element" : "context",
                      "variable" : "reference",
                      "transform" : "create",
                      "parameter" : [
                        {
                          "valueString" : "Reference"
                        }
                      ]
                    },
                    {
                      "context" : "reference",
                      "contextType" : "variable",
                      "element" : "reference",
                      "transform" : "evaluate",
                      "parameter" : [
                        {
                          "valueString" : "'https://example/Encounter/' + %enc.id"
                        }
                      ]
                    }
                  ]
                },
                {
                  "name" : "Period",
                  "source" : [
                    {
                      "context" : "src"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "MedicationAdministration",
                      "contextType" : "variable",
                      "element" : "effective",
                      "variable" : "period",
                      "transform" : "create",
                      "parameter" : [
                        {
                          "valueString" : "Period"
                        }
                      ]
                    }
                  ],
                  "rule" : [
                    {
                      "name" : "low",
                      "source" : [
                        {
                          "context" : "src"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "period",
                          "contextType" : "variable",
                          "element" : "start",
                          "transform" : "evaluate",
                          "parameter" : [
                            {
                              "valueString" : "start.now()"
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "name" : "high",
                      "source" : [
                        {
                          "context" : "src"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "period",
                          "contextType" : "variable",
                          "element" : "end",
                          "transform" : "evaluate",
                          "parameter" : [
                            {
                              "valueString" : "end.now()"
                            }
                          ]
                        }
                      ]
                    }
                  ]
                },
                {
                  "name" : "statuscode",
                  "source" : [
                    {
                      "context" : "src",
                      "condition" : "sub.statusCode.exists().not()"
                    }
                  ],
                  "rule" : [
                    {
                      "name" : "status",
                      "source" : [
                        {
                          "context" : "src"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "MedicationAdministration",
                          "contextType" : "variable",
                          "element" : "status",
                          "transform" : "copy",
                          "parameter" : [
                            {
                              "valueString" : "completed"
                            }
                          ]
                        }
                      ]
                    }
                  ]
                },
                {
                  "name" : "reference",
                  "source" : [
                    {
                      "context" : "cdaText"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "MedicationAdministration",
                      "contextType" : "variable",
                      "element" : "note",
                      "variable" : "note"
                    }
                  ],
                  "rule" : [
                    {
                      "name" : "reference",
                      "source" : [
                        {
                          "context" : "cdaText",
                          "variable" : "t"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "note",
                          "contextType" : "variable",
                          "element" : "text",
                          "transform" : "copy",
                          "parameter" : [
                            {
                              "valueId" : "t"
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "name" : "medication",
                      "source" : [
                        {
                          "context" : "cdaText"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "MedicationAdministration",
                          "contextType" : "variable",
                          "element" : "medication",
                          "variable" : "medication",
                          "transform" : "create",
                          "parameter" : [
                            {
                              "valueString" : "CodeableConcept"
                            }
                          ]
                        }
                      ],
                      "rule" : [
                        {
                          "name" : "text",
                          "source" : [
                            {
                              "context" : "cdaText",
                              "variable" : "txt"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "medication",
                              "contextType" : "variable",
                              "element" : "text",
                              "transform" : "copy",
                              "parameter" : [
                                {
                                  "valueId" : "txt"
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ],
          "documentation" : "Sezione Narrativa------------------------------------------------------------------------------------------------------------------------------------------------"
        },
        {
          "name" : "entry",
          "source" : [
            {
              "context" : "src",
              "element" : "entry",
              "variable" : "entry1"
            }
          ],
          "target" : [
            {
              "context" : "bundle",
              "contextType" : "variable",
              "element" : "entry",
              "variable" : "e1"
            },
            {
              "context" : "e1",
              "contextType" : "variable",
              "element" : "request",
              "variable" : "request",
              "transform" : "create",
              "parameter" : [
                {
                  "valueString" : "BackboneElement"
                }
              ]
            },
            {
              "context" : "request",
              "contextType" : "variable",
              "element" : "method",
              "transform" : "copy",
              "parameter" : [
                {
                  "valueString" : "POST"
                }
              ]
            },
            {
              "context" : "e1",
              "contextType" : "variable",
              "element" : "resource",
              "variable" : "medAdm",
              "transform" : "create",
              "parameter" : [
                {
                  "valueString" : "MedicationAdministration"
                }
              ]
            },
            {
              "context" : "medAdm",
              "contextType" : "variable",
              "element" : "id",
              "variable" : "uuid1",
              "transform" : "uuid"
            },
            {
              "context" : "e1",
              "contextType" : "variable",
              "element" : "fullUrl",
              "transform" : "append",
              "parameter" : [
                {
                  "valueString" : "https://example/MedicationAdministration/"
                },
                {
                  "valueId" : "uuid1"
                }
              ]
            },
            {
              "context" : "request",
              "contextType" : "variable",
              "element" : "url",
              "transform" : "copy",
              "parameter" : [
                {
                  "valueString" : "MedicationAdministration"
                }
              ]
            },
            {
              "context" : "tgt",
              "contextType" : "variable",
              "element" : "entry",
              "variable" : "reference",
              "transform" : "create",
              "parameter" : [
                {
                  "valueString" : "Reference"
                }
              ]
            },
            {
              "context" : "reference",
              "contextType" : "variable",
              "element" : "reference",
              "transform" : "evaluate",
              "parameter" : [
                {
                  "valueString" : "'https://example/MedicationAdministration/' + %medAdm.id"
                }
              ]
            },
            {
              "context" : "medAdm",
              "contextType" : "variable",
              "element" : "note",
              "variable" : "note"
            }
          ],
          "rule" : [
            {
              "name" : "reference",
              "source" : [
                {
                  "context" : "entry1"
                }
              ],
              "target" : [
                {
                  "context" : "medAdm",
                  "contextType" : "variable",
                  "element" : "subject",
                  "variable" : "reference",
                  "transform" : "create",
                  "parameter" : [
                    {
                      "valueString" : "Reference"
                    }
                  ]
                },
                {
                  "context" : "reference",
                  "contextType" : "variable",
                  "element" : "reference",
                  "transform" : "evaluate",
                  "parameter" : [
                    {
                      "valueString" : "'https://example/Patient/' + %patient.id"
                    }
                  ]
                }
              ]
            },
            {
              "name" : "reference",
              "source" : [
                {
                  "context" : "entry1"
                }
              ],
              "target" : [
                {
                  "context" : "medAdm",
                  "contextType" : "variable",
                  "element" : "context",
                  "variable" : "reference",
                  "transform" : "create",
                  "parameter" : [
                    {
                      "valueString" : "Reference"
                    }
                  ]
                },
                {
                  "context" : "reference",
                  "contextType" : "variable",
                  "element" : "reference",
                  "transform" : "evaluate",
                  "parameter" : [
                    {
                      "valueString" : "'https://example/Encounter/' + %enc.id"
                    }
                  ]
                }
              ]
            },
            {
              "name" : "MedAdm",
              "source" : [
                {
                  "context" : "entry1",
                  "element" : "substanceAdministration",
                  "variable" : "sub"
                }
              ],
              "rule" : [
                {
                  "name" : "txx",
                  "source" : [
                    {
                      "context" : "sub",
                      "element" : "text",
                      "variable" : "tx"
                    }
                  ],
                  "rule" : [
                    {
                      "name" : "reference",
                      "source" : [
                        {
                          "context" : "tx",
                          "element" : "reference",
                          "variable" : "reff"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "note",
                          "contextType" : "variable",
                          "element" : "text",
                          "transform" : "evaluate",
                          "parameter" : [
                            {
                              "valueString" : "reff.value"
                            }
                          ]
                        }
                      ]
                    }
                  ]
                },
                {
                  "name" : "statusCode",
                  "source" : [
                    {
                      "context" : "sub",
                      "element" : "statusCode",
                      "variable" : "vvv"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "medAdm",
                      "contextType" : "variable",
                      "element" : "status",
                      "variable" : "vvv",
                      "transform" : "create"
                    }
                  ]
                },
                {
                  "name" : "effectiveTime",
                  "source" : [
                    {
                      "context" : "sub",
                      "element" : "effectiveTime",
                      "variable" : "eff"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "medAdm",
                      "contextType" : "variable",
                      "element" : "effective",
                      "variable" : "period",
                      "transform" : "create",
                      "parameter" : [
                        {
                          "valueString" : "Period"
                        }
                      ]
                    }
                  ],
                  "dependent" : [
                    {
                      "name" : "IVLTSPeriod",
                      "variable" : [
                        "eff",
                        "period"
                      ]
                    }
                  ],
                  "documentation" : "sub.effectiveTime: IVL_TS as eff -> medAdm.effective =create('Period') as period then IVLTSPeriod(eff,period); CHECK THIS"
                },
                {
                  "name" : "eff2",
                  "source" : [
                    {
                      "context" : "sub",
                      "type" : "PIVL_TS",
                      "element" : "effectiveTime",
                      "variable" : "eff"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "medAdm",
                      "contextType" : "variable",
                      "element" : "dosage",
                      "variable" : "dosage"
                    }
                  ],
                  "rule" : [
                    {
                      "name" : "ratio",
                      "source" : [
                        {
                          "context" : "eff"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "dosage",
                          "contextType" : "variable",
                          "element" : "rate",
                          "variable" : "ratio",
                          "transform" : "create",
                          "parameter" : [
                            {
                              "valueString" : "Ratio"
                            }
                          ]
                        }
                      ],
                      "rule" : [
                        {
                          "name" : "num",
                          "source" : [
                            {
                              "context" : "eff"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "ratio",
                              "contextType" : "variable",
                              "element" : "numerator",
                              "variable" : "num",
                              "transform" : "create",
                              "parameter" : [
                                {
                                  "valueString" : "Quantity"
                                }
                              ]
                            }
                          ],
                          "rule" : [
                            {
                              "name" : "period",
                              "source" : [
                                {
                                  "context" : "eff",
                                  "element" : "period",
                                  "variable" : "per"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "num",
                                  "contextType" : "variable",
                                  "element" : "value",
                                  "transform" : "evaluate",
                                  "parameter" : [
                                    {
                                      "valueString" : "per.value"
                                    }
                                  ]
                                }
                              ]
                            },
                            {
                              "name" : "period",
                              "source" : [
                                {
                                  "context" : "eff",
                                  "element" : "period",
                                  "variable" : "per"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "num",
                                  "contextType" : "variable",
                                  "element" : "unit",
                                  "transform" : "evaluate",
                                  "parameter" : [
                                    {
                                      "valueString" : "per.unit"
                                    }
                                  ]
                                }
                              ]
                            }
                          ]
                        },
                        {
                          "name" : "den",
                          "source" : [
                            {
                              "context" : "eff"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "ratio",
                              "contextType" : "variable",
                              "element" : "denominator",
                              "variable" : "num",
                              "transform" : "create",
                              "parameter" : [
                                {
                                  "valueString" : "Quantity"
                                }
                              ]
                            }
                          ],
                          "rule" : [
                            {
                              "name" : "period",
                              "source" : [
                                {
                                  "context" : "eff",
                                  "element" : "period",
                                  "variable" : "per"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "num",
                                  "contextType" : "variable",
                                  "element" : "value",
                                  "transform" : "copy",
                                  "parameter" : [
                                    {
                                      "valueString" : "1"
                                    }
                                  ]
                                }
                              ]
                            },
                            {
                              "name" : "period",
                              "source" : [
                                {
                                  "context" : "eff",
                                  "element" : "period",
                                  "variable" : "per"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "num",
                                  "contextType" : "variable",
                                  "element" : "unit",
                                  "transform" : "evaluate",
                                  "parameter" : [
                                    {
                                      "valueString" : "per.unit"
                                    }
                                  ]
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  ]
                },
                {
                  "name" : "route",
                  "source" : [
                    {
                      "context" : "sub"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "medAdm",
                      "contextType" : "variable",
                      "element" : "dosage",
                      "variable" : "dosage"
                    }
                  ],
                  "rule" : [
                    {
                      "name" : "routeCode",
                      "source" : [
                        {
                          "context" : "sub",
                          "element" : "routeCode",
                          "variable" : "vvv"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "dosage",
                          "contextType" : "variable",
                          "element" : "route",
                          "variable" : "vvv",
                          "transform" : "create"
                        }
                      ]
                    }
                  ]
                },
                {
                  "name" : "route",
                  "source" : [
                    {
                      "context" : "sub"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "medAdm",
                      "contextType" : "variable",
                      "element" : "dosage",
                      "variable" : "dosage"
                    }
                  ],
                  "rule" : [
                    {
                      "name" : "approachSiteCode",
                      "source" : [
                        {
                          "context" : "sub",
                          "element" : "approachSiteCode",
                          "variable" : "vvv"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "dosage",
                          "contextType" : "variable",
                          "element" : "site",
                          "variable" : "vvv",
                          "transform" : "create"
                        }
                      ]
                    }
                  ]
                },
                {
                  "name" : "medicationRequest",
                  "source" : [
                    {
                      "context" : "sub"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "bundle",
                      "contextType" : "variable",
                      "element" : "entry",
                      "variable" : "e1"
                    },
                    {
                      "context" : "e1",
                      "contextType" : "variable",
                      "element" : "request",
                      "variable" : "request",
                      "transform" : "create",
                      "parameter" : [
                        {
                          "valueString" : "BackboneElement"
                        }
                      ]
                    },
                    {
                      "context" : "request",
                      "contextType" : "variable",
                      "element" : "method",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "POST"
                        }
                      ]
                    },
                    {
                      "context" : "e1",
                      "contextType" : "variable",
                      "element" : "resource",
                      "variable" : "medRq",
                      "transform" : "create",
                      "parameter" : [
                        {
                          "valueString" : "MedicationRequest"
                        }
                      ]
                    },
                    {
                      "context" : "medRq",
                      "contextType" : "variable",
                      "element" : "id",
                      "variable" : "uuid1",
                      "transform" : "uuid"
                    },
                    {
                      "context" : "e1",
                      "contextType" : "variable",
                      "element" : "fullUrl",
                      "transform" : "append",
                      "parameter" : [
                        {
                          "valueString" : "https://example/MedicationRequest/"
                        },
                        {
                          "valueId" : "uuid1"
                        }
                      ]
                    },
                    {
                      "context" : "request",
                      "contextType" : "variable",
                      "element" : "url",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "MedicationRequest"
                        }
                      ]
                    },
                    {
                      "context" : "medAdm",
                      "contextType" : "variable",
                      "element" : "request",
                      "variable" : "reference",
                      "transform" : "create",
                      "parameter" : [
                        {
                          "valueString" : "Reference"
                        }
                      ]
                    },
                    {
                      "context" : "reference",
                      "contextType" : "variable",
                      "element" : "reference",
                      "transform" : "evaluate",
                      "parameter" : [
                        {
                          "valueString" : "'https://example/MedicationRequest/' + %medRq.id"
                        }
                      ]
                    }
                  ],
                  "rule" : [
                    {
                      "name" : "rel",
                      "source" : [
                        {
                          "context" : "sub",
                          "element" : "entryRelationship",
                          "variable" : "rel"
                        }
                      ],
                      "rule" : [
                        {
                          "name" : "obs",
                          "source" : [
                            {
                              "context" : "rel",
                              "element" : "supply",
                              "variable" : "supl"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "medRq",
                              "contextType" : "variable",
                              "element" : "dispenseRequest",
                              "variable" : "disp",
                              "transform" : "create",
                              "parameter" : [
                                {
                                  "valueString" : "BackboneElement"
                                }
                              ]
                            }
                          ],
                          "rule" : [
                            {
                              "name" : "SimpleQuantity",
                              "source" : [
                                {
                                  "context" : "supl"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "disp",
                                  "contextType" : "variable",
                                  "element" : "quantity",
                                  "variable" : "q",
                                  "transform" : "create",
                                  "parameter" : [
                                    {
                                      "valueString" : "SimpleQuantity"
                                    }
                                  ]
                                }
                              ],
                              "rule" : [
                                {
                                  "name" : "fds",
                                  "source" : [
                                    {
                                      "context" : "supl",
                                      "element" : "quantity",
                                      "variable" : "qua"
                                    }
                                  ],
                                  "target" : [
                                    {
                                      "context" : "q",
                                      "contextType" : "variable",
                                      "element" : "value",
                                      "transform" : "evaluate",
                                      "parameter" : [
                                        {
                                          "valueString" : "qua.value"
                                        }
                                      ]
                                    }
                                  ]
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "name" : "reference",
                      "source" : [
                        {
                          "context" : "sub"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "medRq",
                          "contextType" : "variable",
                          "element" : "subject",
                          "variable" : "reference",
                          "transform" : "create",
                          "parameter" : [
                            {
                              "valueString" : "Reference"
                            }
                          ]
                        },
                        {
                          "context" : "reference",
                          "contextType" : "variable",
                          "element" : "reference",
                          "transform" : "evaluate",
                          "parameter" : [
                            {
                              "valueString" : "'https://example/Patient/' + %patient.id"
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "name" : "reference",
                      "source" : [
                        {
                          "context" : "sub"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "medRq",
                          "contextType" : "variable",
                          "element" : "encounter",
                          "variable" : "reference",
                          "transform" : "create",
                          "parameter" : [
                            {
                              "valueString" : "Reference"
                            }
                          ]
                        },
                        {
                          "context" : "reference",
                          "contextType" : "variable",
                          "element" : "reference",
                          "transform" : "evaluate",
                          "parameter" : [
                            {
                              "valueString" : "'https://example/Encounter/' + %enc.id"
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "name" : "status",
                      "source" : [
                        {
                          "context" : "sub"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "medRq",
                          "contextType" : "variable",
                          "element" : "status",
                          "transform" : "copy",
                          "parameter" : [
                            {
                              "valueString" : "active"
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "name" : "intent",
                      "source" : [
                        {
                          "context" : "sub"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "medRq",
                          "contextType" : "variable",
                          "element" : "intent",
                          "transform" : "copy",
                          "parameter" : [
                            {
                              "valueString" : "order"
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "name" : "code",
                      "source" : [
                        {
                          "context" : "sub"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "medRq",
                          "contextType" : "variable",
                          "element" : "medication",
                          "variable" : "cod",
                          "transform" : "create",
                          "parameter" : [
                            {
                              "valueString" : "CodeableConcept"
                            }
                          ]
                        }
                      ],
                      "rule" : [
                        {
                          "name" : "Medi",
                          "source" : [
                            {
                              "context" : "sub"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "cod",
                              "contextType" : "variable",
                              "element" : "text",
                              "transform" : "copy",
                              "parameter" : [
                                {
                                  "valueString" : "medication"
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "name" : "dose-quantity",
                      "source" : [
                        {
                          "context" : "sub",
                          "element" : "doseQuantity",
                          "variable" : "quantity"
                        }
                      ],
                      "rule" : [
                        {
                          "name" : "dosage",
                          "source" : [
                            {
                              "context" : "quantity"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "medRq",
                              "contextType" : "variable",
                              "element" : "dosageInstruction",
                              "variable" : "dosage",
                              "transform" : "create",
                              "parameter" : [
                                {
                                  "valueString" : "Dosage"
                                }
                              ]
                            }
                          ],
                          "rule" : [
                            {
                              "name" : "dos",
                              "source" : [
                                {
                                  "context" : "quantity"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "dosage",
                                  "contextType" : "variable",
                                  "element" : "doseAndRate",
                                  "variable" : "dosRange"
                                }
                              ],
                              "rule" : [
                                {
                                  "name" : "range",
                                  "source" : [
                                    {
                                      "context" : "quantity"
                                    }
                                  ],
                                  "target" : [
                                    {
                                      "context" : "dosRange",
                                      "contextType" : "variable",
                                      "element" : "dose",
                                      "variable" : "range",
                                      "transform" : "create",
                                      "parameter" : [
                                        {
                                          "valueString" : "Range"
                                        }
                                      ]
                                    }
                                  ],
                                  "rule" : [
                                    {
                                      "name" : "low",
                                      "source" : [
                                        {
                                          "context" : "quantity"
                                        }
                                      ],
                                      "target" : [
                                        {
                                          "context" : "range",
                                          "contextType" : "variable",
                                          "element" : "low",
                                          "variable" : "quant",
                                          "transform" : "create",
                                          "parameter" : [
                                            {
                                              "valueString" : "SimpleQuantity"
                                            }
                                          ]
                                        }
                                      ],
                                      "rule" : [
                                        {
                                          "name" : "v1",
                                          "source" : [
                                            {
                                              "context" : "quantity",
                                              "element" : "low",
                                              "variable" : "l"
                                            }
                                          ],
                                          "target" : [
                                            {
                                              "context" : "quant",
                                              "contextType" : "variable",
                                              "element" : "value",
                                              "transform" : "evaluate",
                                              "parameter" : [
                                                {
                                                  "valueString" : "l.value"
                                                }
                                              ]
                                            }
                                          ]
                                        },
                                        {
                                          "name" : "v1",
                                          "source" : [
                                            {
                                              "context" : "quantity",
                                              "element" : "low",
                                              "variable" : "l"
                                            }
                                          ],
                                          "target" : [
                                            {
                                              "context" : "quant",
                                              "contextType" : "variable",
                                              "element" : "unit",
                                              "transform" : "evaluate",
                                              "parameter" : [
                                                {
                                                  "valueString" : "l.unit"
                                                }
                                              ]
                                            }
                                          ]
                                        }
                                      ]
                                    },
                                    {
                                      "name" : "high",
                                      "source" : [
                                        {
                                          "context" : "quantity"
                                        }
                                      ],
                                      "target" : [
                                        {
                                          "context" : "range",
                                          "contextType" : "variable",
                                          "element" : "high",
                                          "variable" : "quant",
                                          "transform" : "create",
                                          "parameter" : [
                                            {
                                              "valueString" : "SimpleQuantity"
                                            }
                                          ]
                                        }
                                      ],
                                      "rule" : [
                                        {
                                          "name" : "v1",
                                          "source" : [
                                            {
                                              "context" : "quantity",
                                              "element" : "high",
                                              "variable" : "h"
                                            }
                                          ],
                                          "target" : [
                                            {
                                              "context" : "quant",
                                              "contextType" : "variable",
                                              "element" : "value",
                                              "transform" : "evaluate",
                                              "parameter" : [
                                                {
                                                  "valueString" : "h.value"
                                                }
                                              ]
                                            }
                                          ]
                                        },
                                        {
                                          "name" : "v1",
                                          "source" : [
                                            {
                                              "context" : "quantity",
                                              "element" : "high",
                                              "variable" : "h"
                                            }
                                          ],
                                          "target" : [
                                            {
                                              "context" : "quant",
                                              "contextType" : "variable",
                                              "element" : "unit",
                                              "transform" : "evaluate",
                                              "parameter" : [
                                                {
                                                  "valueString" : "h.unit"
                                                }
                                              ]
                                            }
                                          ]
                                        }
                                      ]
                                    }
                                  ]
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "name" : "Rate-quantity",
                      "source" : [
                        {
                          "context" : "sub",
                          "element" : "rateQuantity",
                          "variable" : "rate"
                        }
                      ],
                      "rule" : [
                        {
                          "name" : "dosage",
                          "source" : [
                            {
                              "context" : "rate"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "medRq",
                              "contextType" : "variable",
                              "element" : "dosageInstruction",
                              "variable" : "dosage",
                              "transform" : "create",
                              "parameter" : [
                                {
                                  "valueString" : "Dosage"
                                }
                              ]
                            }
                          ],
                          "rule" : [
                            {
                              "name" : "dos",
                              "source" : [
                                {
                                  "context" : "rate"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "dosage",
                                  "contextType" : "variable",
                                  "element" : "doseAndRate",
                                  "variable" : "dosRange"
                                }
                              ],
                              "rule" : [
                                {
                                  "name" : "range",
                                  "source" : [
                                    {
                                      "context" : "rate"
                                    }
                                  ],
                                  "target" : [
                                    {
                                      "context" : "dosRange",
                                      "contextType" : "variable",
                                      "element" : "dose",
                                      "variable" : "range",
                                      "transform" : "create",
                                      "parameter" : [
                                        {
                                          "valueString" : "Range"
                                        }
                                      ]
                                    }
                                  ],
                                  "rule" : [
                                    {
                                      "name" : "low",
                                      "source" : [
                                        {
                                          "context" : "rate"
                                        }
                                      ],
                                      "target" : [
                                        {
                                          "context" : "range",
                                          "contextType" : "variable",
                                          "element" : "low",
                                          "variable" : "quant",
                                          "transform" : "create",
                                          "parameter" : [
                                            {
                                              "valueString" : "SimpleQuantity"
                                            }
                                          ]
                                        }
                                      ],
                                      "rule" : [
                                        {
                                          "name" : "v1",
                                          "source" : [
                                            {
                                              "context" : "rate",
                                              "element" : "low",
                                              "variable" : "l"
                                            }
                                          ],
                                          "target" : [
                                            {
                                              "context" : "quant",
                                              "contextType" : "variable",
                                              "element" : "value",
                                              "transform" : "evaluate",
                                              "parameter" : [
                                                {
                                                  "valueString" : "l.value"
                                                }
                                              ]
                                            }
                                          ]
                                        },
                                        {
                                          "name" : "v1",
                                          "source" : [
                                            {
                                              "context" : "rate",
                                              "element" : "low",
                                              "variable" : "l"
                                            }
                                          ],
                                          "target" : [
                                            {
                                              "context" : "quant",
                                              "contextType" : "variable",
                                              "element" : "unit",
                                              "transform" : "evaluate",
                                              "parameter" : [
                                                {
                                                  "valueString" : "l.unit"
                                                }
                                              ]
                                            }
                                          ]
                                        }
                                      ]
                                    },
                                    {
                                      "name" : "high",
                                      "source" : [
                                        {
                                          "context" : "rate"
                                        }
                                      ],
                                      "target" : [
                                        {
                                          "context" : "range",
                                          "contextType" : "variable",
                                          "element" : "high",
                                          "variable" : "quant",
                                          "transform" : "create",
                                          "parameter" : [
                                            {
                                              "valueString" : "SimpleQuantity"
                                            }
                                          ]
                                        }
                                      ],
                                      "rule" : [
                                        {
                                          "name" : "v1",
                                          "source" : [
                                            {
                                              "context" : "rate",
                                              "element" : "high",
                                              "variable" : "h"
                                            }
                                          ],
                                          "target" : [
                                            {
                                              "context" : "quant",
                                              "contextType" : "variable",
                                              "element" : "value",
                                              "transform" : "evaluate",
                                              "parameter" : [
                                                {
                                                  "valueString" : "h.value"
                                                }
                                              ]
                                            }
                                          ]
                                        },
                                        {
                                          "name" : "v1",
                                          "source" : [
                                            {
                                              "context" : "rate",
                                              "element" : "high",
                                              "variable" : "h"
                                            }
                                          ],
                                          "target" : [
                                            {
                                              "context" : "quant",
                                              "contextType" : "variable",
                                              "element" : "unit",
                                              "transform" : "evaluate",
                                              "parameter" : [
                                                {
                                                  "valueString" : "h.unit"
                                                }
                                              ]
                                            }
                                          ]
                                        }
                                      ]
                                    }
                                  ]
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "name" : "part",
                      "source" : [
                        {
                          "context" : "sub",
                          "element" : "participant",
                          "variable" : "part"
                        }
                      ],
                      "rule" : [
                        {
                          "name" : "time",
                          "source" : [
                            {
                              "context" : "part",
                              "element" : "time",
                              "variable" : "t"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "medRq",
                              "contextType" : "variable",
                              "element" : "authoredOn",
                              "variable" : "date",
                              "transform" : "create",
                              "parameter" : [
                                {
                                  "valueString" : "dateTime"
                                }
                              ]
                            }
                          ],
                          "dependent" : [
                            {
                              "name" : "TSDateTime",
                              "variable" : [
                                "t",
                                "date"
                              ]
                            }
                          ]
                        },
                        {
                          "name" : "Part",
                          "source" : [
                            {
                              "context" : "part",
                              "element" : "participantRole",
                              "variable" : "partRole"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "bundle",
                              "contextType" : "variable",
                              "element" : "entry",
                              "variable" : "e1"
                            },
                            {
                              "context" : "e1",
                              "contextType" : "variable",
                              "element" : "request",
                              "variable" : "request",
                              "transform" : "create",
                              "parameter" : [
                                {
                                  "valueString" : "BackboneElement"
                                }
                              ]
                            },
                            {
                              "context" : "request",
                              "contextType" : "variable",
                              "element" : "method",
                              "transform" : "copy",
                              "parameter" : [
                                {
                                  "valueString" : "PUT"
                                }
                              ]
                            },
                            {
                              "context" : "e1",
                              "contextType" : "variable",
                              "element" : "resource",
                              "variable" : "practitioner",
                              "transform" : "create",
                              "parameter" : [
                                {
                                  "valueString" : "Practitioner"
                                }
                              ]
                            },
                            {
                              "context" : "practitioner",
                              "contextType" : "variable",
                              "element" : "id",
                              "variable" : "uuid1",
                              "transform" : "uuid"
                            },
                            {
                              "context" : "e1",
                              "contextType" : "variable",
                              "element" : "fullUrl",
                              "transform" : "append",
                              "parameter" : [
                                {
                                  "valueString" : "https://example/Practitioner/"
                                },
                                {
                                  "valueId" : "uuid1"
                                }
                              ]
                            },
                            {
                              "context" : "request",
                              "contextType" : "variable",
                              "element" : "url",
                              "transform" : "append",
                              "parameter" : [
                                {
                                  "valueString" : "Practitioner/"
                                },
                                {
                                  "valueId" : "uuid1"
                                }
                              ]
                            }
                          ],
                          "rule" : [
                            {
                              "name" : "meta",
                              "source" : [
                                {
                                  "context" : "partRole"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "practitioner",
                                  "contextType" : "variable",
                                  "element" : "meta",
                                  "variable" : "meta"
                                }
                              ],
                              "rule" : [
                                {
                                  "name" : "coding",
                                  "source" : [
                                    {
                                      "context" : "partRole"
                                    }
                                  ],
                                  "target" : [
                                    {
                                      "context" : "meta",
                                      "contextType" : "variable",
                                      "element" : "tag",
                                      "variable" : "coding",
                                      "transform" : "create",
                                      "parameter" : [
                                        {
                                          "valueString" : "Coding"
                                        }
                                      ]
                                    }
                                  ],
                                  "rule" : [
                                    {
                                      "name" : "system",
                                      "source" : [
                                        {
                                          "context" : "partRole"
                                        }
                                      ],
                                      "target" : [
                                        {
                                          "context" : "coding",
                                          "contextType" : "variable",
                                          "element" : "system",
                                          "transform" : "copy",
                                          "parameter" : [
                                            {
                                              "valueString" : "http://algoritmodiscoring"
                                            }
                                          ]
                                        }
                                      ]
                                    },
                                    {
                                      "name" : "code",
                                      "source" : [
                                        {
                                          "context" : "partRole"
                                        }
                                      ],
                                      "target" : [
                                        {
                                          "context" : "coding",
                                          "contextType" : "variable",
                                          "element" : "code",
                                          "transform" : "copy",
                                          "parameter" : [
                                            {
                                              "valueString" : "ClinicalDocument/body/TerapiaFarmacologicaPS/participant"
                                            }
                                          ]
                                        }
                                      ]
                                    }
                                  ]
                                }
                              ],
                              "documentation" : "inizio meta+identifier"
                            },
                            {
                              "name" : "identifier",
                              "source" : [
                                {
                                  "context" : "partRole",
                                  "element" : "id",
                                  "variable" : "id"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "practitioner",
                                  "contextType" : "variable",
                                  "element" : "identifier",
                                  "variable" : "identifier"
                                }
                              ],
                              "rule" : [
                                {
                                  "name" : "root1",
                                  "source" : [
                                    {
                                      "context" : "id",
                                      "element" : "root",
                                      "variable" : "r"
                                    }
                                  ],
                                  "target" : [
                                    {
                                      "context" : "identifier",
                                      "contextType" : "variable",
                                      "element" : "system",
                                      "transform" : "translate",
                                      "parameter" : [
                                        {
                                          "valueId" : "r"
                                        },
                                        {
                                          "valueString" : "http://hl7.org/fhir/ConceptMap/special-oid2uri"
                                        },
                                        {
                                          "valueString" : "uri"
                                        }
                                      ]
                                    }
                                  ]
                                },
                                {
                                  "name" : "extension",
                                  "source" : [
                                    {
                                      "context" : "id",
                                      "element" : "extension",
                                      "variable" : "ext"
                                    }
                                  ],
                                  "target" : [
                                    {
                                      "context" : "identifier",
                                      "contextType" : "variable",
                                      "element" : "value",
                                      "transform" : "copy",
                                      "parameter" : [
                                        {
                                          "valueId" : "ext"
                                        }
                                      ]
                                    }
                                  ]
                                },
                                {
                                  "name" : "assigningAuthorityName",
                                  "source" : [
                                    {
                                      "context" : "id",
                                      "element" : "assigningAuthorityName",
                                      "variable" : "s"
                                    }
                                  ],
                                  "target" : [
                                    {
                                      "context" : "identifier",
                                      "contextType" : "variable",
                                      "element" : "assigner",
                                      "variable" : "a"
                                    },
                                    {
                                      "context" : "a",
                                      "contextType" : "variable",
                                      "element" : "display",
                                      "transform" : "copy",
                                      "parameter" : [
                                        {
                                          "valueId" : "s"
                                        }
                                      ]
                                    }
                                  ]
                                },
                                {
                                  "name" : "r",
                                  "source" : [
                                    {
                                      "context" : "id",
                                      "element" : "root",
                                      "variable" : "r"
                                    }
                                  ],
                                  "rule" : [
                                    {
                                      "name" : "aut",
                                      "source" : [
                                        {
                                          "context" : "id",
                                          "element" : "extension",
                                          "variable" : "ext"
                                        }
                                      ],
                                      "target" : [
                                        {
                                          "context" : "practitioner",
                                          "contextType" : "variable",
                                          "element" : "id",
                                          "variable" : "uuid2",
                                          "transform" : "evaluate",
                                          "parameter" : [
                                            {
                                              "valueString" : "r + '-' + ext"
                                            }
                                          ]
                                        },
                                        {
                                          "context" : "e1",
                                          "contextType" : "variable",
                                          "element" : "fullUrl",
                                          "transform" : "append",
                                          "parameter" : [
                                            {
                                              "valueString" : "https://example/Practitioner/"
                                            },
                                            {
                                              "valueId" : "uuid2"
                                            }
                                          ]
                                        },
                                        {
                                          "context" : "request",
                                          "contextType" : "variable",
                                          "element" : "url",
                                          "transform" : "append",
                                          "parameter" : [
                                            {
                                              "valueString" : "Practitioner/"
                                            },
                                            {
                                              "valueId" : "uuid2"
                                            }
                                          ]
                                        },
                                        {
                                          "context" : "medRq",
                                          "contextType" : "variable",
                                          "element" : "requester",
                                          "variable" : "reference",
                                          "transform" : "create",
                                          "parameter" : [
                                            {
                                              "valueString" : "Reference"
                                            }
                                          ]
                                        },
                                        {
                                          "context" : "reference",
                                          "contextType" : "variable",
                                          "element" : "reference",
                                          "transform" : "evaluate",
                                          "parameter" : [
                                            {
                                              "valueString" : "'https://example/Practitioner/' + %practitioner.id"
                                            }
                                          ]
                                        }
                                      ]
                                    }
                                  ]
                                }
                              ]
                            },
                            {
                              "name" : "2.16.840.1.113883.2.9.4.3.2",
                              "source" : [
                                {
                                  "context" : "partRole",
                                  "element" : "id",
                                  "variable" : "id",
                                  "condition" : "(root = '2.16.840.1.113883.2.9.4.3.2')"
                                }
                              ],
                              "rule" : [
                                {
                                  "name" : "UUID",
                                  "source" : [
                                    {
                                      "context" : "id",
                                      "element" : "extension",
                                      "variable" : "ext"
                                    }
                                  ],
                                  "target" : [
                                    {
                                      "context" : "request",
                                      "contextType" : "variable",
                                      "element" : "url",
                                      "transform" : "append",
                                      "parameter" : [
                                        {
                                          "valueString" : "Practitioner?identifier="
                                        },
                                        {
                                          "valueId" : "ext"
                                        }
                                      ]
                                    }
                                  ]
                                }
                              ]
                            },
                            {
                              "name" : "id",
                              "source" : [
                                {
                                  "context" : "partRole",
                                  "element" : "id",
                                  "variable" : "vvv"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "practitioner",
                                  "contextType" : "variable",
                                  "element" : "identifier",
                                  "variable" : "vvv",
                                  "transform" : "create"
                                }
                              ],
                              "documentation" : "fine modifiche"
                            },
                            {
                              "name" : "play",
                              "source" : [
                                {
                                  "context" : "partRole",
                                  "element" : "playingEntity",
                                  "variable" : "play"
                                }
                              ],
                              "rule" : [
                                {
                                  "name" : "name",
                                  "source" : [
                                    {
                                      "context" : "play",
                                      "element" : "name",
                                      "variable" : "vvv"
                                    }
                                  ],
                                  "target" : [
                                    {
                                      "context" : "practitioner",
                                      "contextType" : "variable",
                                      "element" : "name",
                                      "variable" : "vvv",
                                      "transform" : "create"
                                    }
                                  ]
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  ]
                },
                {
                  "name" : "med",
                  "source" : [
                    {
                      "context" : "sub"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "bundle",
                      "contextType" : "variable",
                      "element" : "entry",
                      "variable" : "e1"
                    },
                    {
                      "context" : "e1",
                      "contextType" : "variable",
                      "element" : "request",
                      "variable" : "request",
                      "transform" : "create",
                      "parameter" : [
                        {
                          "valueString" : "BackboneElement"
                        }
                      ]
                    },
                    {
                      "context" : "request",
                      "contextType" : "variable",
                      "element" : "method",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "POST"
                        }
                      ]
                    },
                    {
                      "context" : "e1",
                      "contextType" : "variable",
                      "element" : "resource",
                      "variable" : "med",
                      "transform" : "create",
                      "parameter" : [
                        {
                          "valueString" : "Medication"
                        }
                      ]
                    },
                    {
                      "context" : "med",
                      "contextType" : "variable",
                      "element" : "id",
                      "variable" : "uuid1",
                      "transform" : "uuid"
                    },
                    {
                      "context" : "e1",
                      "contextType" : "variable",
                      "element" : "fullUrl",
                      "transform" : "append",
                      "parameter" : [
                        {
                          "valueString" : "https://example/Medication/"
                        },
                        {
                          "valueId" : "uuid1"
                        }
                      ]
                    },
                    {
                      "context" : "request",
                      "contextType" : "variable",
                      "element" : "url",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "Medication"
                        }
                      ]
                    },
                    {
                      "context" : "medAdm",
                      "contextType" : "variable",
                      "element" : "medication",
                      "variable" : "reference",
                      "transform" : "create",
                      "parameter" : [
                        {
                          "valueString" : "Reference"
                        }
                      ]
                    },
                    {
                      "context" : "reference",
                      "contextType" : "variable",
                      "element" : "reference",
                      "transform" : "evaluate",
                      "parameter" : [
                        {
                          "valueString" : "'https://example/Medication/' + %med.id"
                        }
                      ]
                    }
                  ],
                  "rule" : [
                    {
                      "name" : "unicode",
                      "source" : [
                        {
                          "context" : "sub",
                          "element" : "administrationUnitCode",
                          "variable" : "adduni"
                        }
                      ],
                      "rule" : [
                        {
                          "name" : "administrationUnitCode",
                          "source" : [
                            {
                              "context" : "sub",
                              "element" : "administrationUnitCode",
                              "variable" : "vvv"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "med",
                              "contextType" : "variable",
                              "element" : "form",
                              "variable" : "vvv",
                              "transform" : "create"
                            }
                          ]
                        },
                        {
                          "name" : "consum",
                          "source" : [
                            {
                              "context" : "sub",
                              "element" : "consumable",
                              "variable" : "consum"
                            }
                          ],
                          "rule" : [
                            {
                              "name" : "manuMat",
                              "source" : [
                                {
                                  "context" : "consum",
                                  "element" : "manufacturedProduct",
                                  "variable" : "manuProd"
                                }
                              ],
                              "rule" : [
                                {
                                  "name" : "manuMat",
                                  "source" : [
                                    {
                                      "context" : "manuProd",
                                      "element" : "manufacturedMaterial",
                                      "variable" : "manuMt"
                                    }
                                  ],
                                  "rule" : [
                                    {
                                      "name" : "code",
                                      "source" : [
                                        {
                                          "context" : "manuMt",
                                          "element" : "code",
                                          "variable" : "vvv"
                                        }
                                      ],
                                      "target" : [
                                        {
                                          "context" : "med",
                                          "contextType" : "variable",
                                          "element" : "code",
                                          "variable" : "vvv",
                                          "transform" : "create"
                                        }
                                      ]
                                    }
                                  ]
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "name" : "entry-R",
                      "source" : [
                        {
                          "context" : "sub",
                          "element" : "entryRelationship",
                          "variable" : "entryR"
                        }
                      ],
                      "rule" : [
                        {
                          "name" : "obs",
                          "source" : [
                            {
                              "context" : "entryR",
                              "element" : "observation",
                              "variable" : "observation"
                            }
                          ],
                          "rule" : [
                            {
                              "name" : "ingredient",
                              "source" : [
                                {
                                  "context" : "observation",
                                  "element" : "code",
                                  "condition" : "displayName = 'Grammatura'"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "med",
                                  "contextType" : "variable",
                                  "element" : "ingredient",
                                  "variable" : "ingredient"
                                }
                              ],
                              "rule" : [
                                {
                                  "name" : "consumable",
                                  "source" : [
                                    {
                                      "context" : "sub",
                                      "element" : "consumable",
                                      "variable" : "consumable"
                                    }
                                  ],
                                  "rule" : [
                                    {
                                      "name" : "product",
                                      "source" : [
                                        {
                                          "context" : "consumable",
                                          "element" : "manufacturedProduct",
                                          "variable" : "manufacturedProduct"
                                        }
                                      ],
                                      "rule" : [
                                        {
                                          "name" : "material",
                                          "source" : [
                                            {
                                              "context" : "manufacturedProduct",
                                              "element" : "manufacturedMaterial",
                                              "variable" : "manufacturedMaterial"
                                            }
                                          ],
                                          "rule" : [
                                            {
                                              "name" : "CE",
                                              "source" : [
                                                {
                                                  "context" : "manufacturedMaterial",
                                                  "element" : "code",
                                                  "variable" : "code"
                                                }
                                              ],
                                              "target" : [
                                                {
                                                  "context" : "ingredient",
                                                  "contextType" : "variable",
                                                  "element" : "item",
                                                  "variable" : "value",
                                                  "transform" : "create",
                                                  "parameter" : [
                                                    {
                                                      "valueString" : "CodeableConcept"
                                                    }
                                                  ]
                                                }
                                              ],
                                              "dependent" : [
                                                {
                                                  "name" : "CECodeableConcept",
                                                  "variable" : [
                                                    "code",
                                                    "value"
                                                  ]
                                                }
                                              ]
                                            }
                                          ]
                                        }
                                      ]
                                    }
                                  ]
                                },
                                {
                                  "name" : "strenght",
                                  "source" : [
                                    {
                                      "context" : "observation",
                                      "element" : "value",
                                      "variable" : "value"
                                    }
                                  ],
                                  "target" : [
                                    {
                                      "context" : "ingredient",
                                      "contextType" : "variable",
                                      "element" : "strength",
                                      "variable" : "strength"
                                    }
                                  ],
                                  "rule" : [
                                    {
                                      "name" : "numerator",
                                      "source" : [
                                        {
                                          "context" : "value"
                                        }
                                      ],
                                      "target" : [
                                        {
                                          "context" : "strength",
                                          "contextType" : "variable",
                                          "element" : "numerator",
                                          "variable" : "numerator"
                                        }
                                      ],
                                      "rule" : [
                                        {
                                          "name" : "valueN",
                                          "source" : [
                                            {
                                              "context" : "value"
                                            }
                                          ],
                                          "target" : [
                                            {
                                              "context" : "numerator",
                                              "contextType" : "variable",
                                              "element" : "value",
                                              "transform" : "evaluate",
                                              "parameter" : [
                                                {
                                                  "valueString" : "value.value"
                                                }
                                              ]
                                            }
                                          ]
                                        }
                                      ]
                                    },
                                    {
                                      "name" : "denominator",
                                      "source" : [
                                        {
                                          "context" : "value"
                                        }
                                      ],
                                      "target" : [
                                        {
                                          "context" : "strength",
                                          "contextType" : "variable",
                                          "element" : "denominator",
                                          "variable" : "denominator"
                                        }
                                      ],
                                      "rule" : [
                                        {
                                          "name" : "valueD",
                                          "source" : [
                                            {
                                              "context" : "value"
                                            }
                                          ],
                                          "target" : [
                                            {
                                              "context" : "denominator",
                                              "contextType" : "variable",
                                              "element" : "value",
                                              "transform" : "copy",
                                              "parameter" : [
                                                {
                                                  "valueInteger" : 1
                                                }
                                              ]
                                            }
                                          ]
                                        }
                                      ]
                                    }
                                  ]
                                }
                              ]
                            },
                            {
                              "name" : "quantita",
                              "source" : [
                                {
                                  "context" : "observation",
                                  "element" : "code",
                                  "condition" : "displayName = 'Quantità nella Confezione'"
                                }
                              ],
                              "rule" : [
                                {
                                  "name" : "amount",
                                  "source" : [
                                    {
                                      "context" : "observation",
                                      "element" : "value",
                                      "variable" : "value"
                                    }
                                  ],
                                  "target" : [
                                    {
                                      "context" : "med",
                                      "contextType" : "variable",
                                      "element" : "amount",
                                      "variable" : "amount"
                                    }
                                  ],
                                  "rule" : [
                                    {
                                      "name" : "numerator",
                                      "source" : [
                                        {
                                          "context" : "value"
                                        }
                                      ],
                                      "target" : [
                                        {
                                          "context" : "amount",
                                          "contextType" : "variable",
                                          "element" : "numerator",
                                          "variable" : "numerator"
                                        }
                                      ],
                                      "rule" : [
                                        {
                                          "name" : "valueN",
                                          "source" : [
                                            {
                                              "context" : "value"
                                            }
                                          ],
                                          "target" : [
                                            {
                                              "context" : "numerator",
                                              "contextType" : "variable",
                                              "element" : "value",
                                              "transform" : "evaluate",
                                              "parameter" : [
                                                {
                                                  "valueString" : "value.value"
                                                }
                                              ]
                                            }
                                          ]
                                        }
                                      ]
                                    },
                                    {
                                      "name" : "denominator",
                                      "source" : [
                                        {
                                          "context" : "value"
                                        }
                                      ],
                                      "target" : [
                                        {
                                          "context" : "amount",
                                          "contextType" : "variable",
                                          "element" : "denominator",
                                          "variable" : "denominator"
                                        }
                                      ],
                                      "rule" : [
                                        {
                                          "name" : "valueD",
                                          "source" : [
                                            {
                                              "context" : "value"
                                            }
                                          ],
                                          "target" : [
                                            {
                                              "context" : "denominator",
                                              "contextType" : "variable",
                                              "element" : "value",
                                              "transform" : "copy",
                                              "parameter" : [
                                                {
                                                  "valueInteger" : 1
                                                }
                                              ]
                                            }
                                          ]
                                        }
                                      ]
                                    }
                                  ]
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  ]
                },
                {
                  "name" : "perform",
                  "source" : [
                    {
                      "context" : "sub",
                      "element" : "performer",
                      "variable" : "perf"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "bundle",
                      "contextType" : "variable",
                      "element" : "entry",
                      "variable" : "e1"
                    },
                    {
                      "context" : "e1",
                      "contextType" : "variable",
                      "element" : "request",
                      "variable" : "request",
                      "transform" : "create",
                      "parameter" : [
                        {
                          "valueString" : "BackboneElement"
                        }
                      ]
                    },
                    {
                      "context" : "request",
                      "contextType" : "variable",
                      "element" : "method",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "PUT"
                        }
                      ]
                    },
                    {
                      "context" : "e1",
                      "contextType" : "variable",
                      "element" : "resource",
                      "variable" : "practitioner",
                      "transform" : "create",
                      "parameter" : [
                        {
                          "valueString" : "Practitioner"
                        }
                      ]
                    },
                    {
                      "context" : "practitioner",
                      "contextType" : "variable",
                      "element" : "id",
                      "variable" : "uuid1",
                      "transform" : "uuid"
                    },
                    {
                      "context" : "e1",
                      "contextType" : "variable",
                      "element" : "fullUrl",
                      "transform" : "append",
                      "parameter" : [
                        {
                          "valueString" : "https://example/Practitioner/"
                        },
                        {
                          "valueId" : "uuid1"
                        }
                      ]
                    },
                    {
                      "context" : "request",
                      "contextType" : "variable",
                      "element" : "url",
                      "transform" : "append",
                      "parameter" : [
                        {
                          "valueString" : "Practitioner/"
                        },
                        {
                          "valueId" : "uuid1"
                        }
                      ]
                    }
                  ],
                  "rule" : [
                    {
                      "name" : "preftime",
                      "source" : [
                        {
                          "context" : "perf"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "medAdm",
                          "contextType" : "variable",
                          "element" : "note",
                          "variable" : "note"
                        }
                      ],
                      "rule" : [
                        {
                          "name" : "notaa",
                          "source" : [
                            {
                              "context" : "perf"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "note",
                              "contextType" : "variable",
                              "element" : "text",
                              "transform" : "copy",
                              "parameter" : [
                                {
                                  "valueString" : "performertime"
                                }
                              ]
                            }
                          ]
                        },
                        {
                          "name" : "notetime",
                          "source" : [
                            {
                              "context" : "perf",
                              "element" : "time",
                              "variable" : "t"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "note",
                              "contextType" : "variable",
                              "element" : "time",
                              "variable" : "value",
                              "transform" : "create",
                              "parameter" : [
                                {
                                  "valueString" : "dateTime"
                                }
                              ]
                            }
                          ],
                          "dependent" : [
                            {
                              "name" : "TSDateTime",
                              "variable" : [
                                "t",
                                "value"
                              ]
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "name" : "ent",
                      "source" : [
                        {
                          "context" : "perf",
                          "element" : "assignedEntity",
                          "variable" : "ent"
                        }
                      ],
                      "rule" : [
                        {
                          "name" : "meta",
                          "source" : [
                            {
                              "context" : "ent"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "practitioner",
                              "contextType" : "variable",
                              "element" : "meta",
                              "variable" : "meta"
                            }
                          ],
                          "rule" : [
                            {
                              "name" : "coding",
                              "source" : [
                                {
                                  "context" : "ent"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "meta",
                                  "contextType" : "variable",
                                  "element" : "tag",
                                  "variable" : "coding",
                                  "transform" : "create",
                                  "parameter" : [
                                    {
                                      "valueString" : "Coding"
                                    }
                                  ]
                                }
                              ],
                              "rule" : [
                                {
                                  "name" : "system",
                                  "source" : [
                                    {
                                      "context" : "ent"
                                    }
                                  ],
                                  "target" : [
                                    {
                                      "context" : "coding",
                                      "contextType" : "variable",
                                      "element" : "system",
                                      "transform" : "copy",
                                      "parameter" : [
                                        {
                                          "valueString" : "http://algoritmodiscoring"
                                        }
                                      ]
                                    }
                                  ]
                                },
                                {
                                  "name" : "code",
                                  "source" : [
                                    {
                                      "context" : "ent"
                                    }
                                  ],
                                  "target" : [
                                    {
                                      "context" : "coding",
                                      "contextType" : "variable",
                                      "element" : "code",
                                      "transform" : "copy",
                                      "parameter" : [
                                        {
                                          "valueString" : "ClinicalDocument/body/TerapiaFarmacologicaPS/performer"
                                        }
                                      ]
                                    }
                                  ]
                                }
                              ]
                            }
                          ],
                          "documentation" : "inizio modifica meta+identifier"
                        },
                        {
                          "name" : "identifier",
                          "source" : [
                            {
                              "context" : "ent",
                              "element" : "id",
                              "variable" : "id"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "practitioner",
                              "contextType" : "variable",
                              "element" : "identifier",
                              "variable" : "identifier"
                            }
                          ],
                          "rule" : [
                            {
                              "name" : "root1",
                              "source" : [
                                {
                                  "context" : "id",
                                  "element" : "root",
                                  "variable" : "r"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "identifier",
                                  "contextType" : "variable",
                                  "element" : "system",
                                  "transform" : "translate",
                                  "parameter" : [
                                    {
                                      "valueId" : "r"
                                    },
                                    {
                                      "valueString" : "http://hl7.org/fhir/ConceptMap/special-oid2uri"
                                    },
                                    {
                                      "valueString" : "uri"
                                    }
                                  ]
                                }
                              ]
                            },
                            {
                              "name" : "extension",
                              "source" : [
                                {
                                  "context" : "id",
                                  "element" : "extension",
                                  "variable" : "ext"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "identifier",
                                  "contextType" : "variable",
                                  "element" : "value",
                                  "transform" : "copy",
                                  "parameter" : [
                                    {
                                      "valueId" : "ext"
                                    }
                                  ]
                                }
                              ]
                            },
                            {
                              "name" : "assigningAuthorityName",
                              "source" : [
                                {
                                  "context" : "id",
                                  "element" : "assigningAuthorityName",
                                  "variable" : "s"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "identifier",
                                  "contextType" : "variable",
                                  "element" : "assigner",
                                  "variable" : "a"
                                },
                                {
                                  "context" : "a",
                                  "contextType" : "variable",
                                  "element" : "display",
                                  "transform" : "copy",
                                  "parameter" : [
                                    {
                                      "valueId" : "s"
                                    }
                                  ]
                                }
                              ]
                            },
                            {
                              "name" : "r",
                              "source" : [
                                {
                                  "context" : "id",
                                  "element" : "root",
                                  "variable" : "r"
                                }
                              ],
                              "rule" : [
                                {
                                  "name" : "aut",
                                  "source" : [
                                    {
                                      "context" : "id",
                                      "element" : "extension",
                                      "variable" : "ext"
                                    }
                                  ],
                                  "target" : [
                                    {
                                      "context" : "practitioner",
                                      "contextType" : "variable",
                                      "element" : "id",
                                      "variable" : "uuid2",
                                      "transform" : "evaluate",
                                      "parameter" : [
                                        {
                                          "valueString" : "r + '-' + ext"
                                        }
                                      ]
                                    },
                                    {
                                      "context" : "e1",
                                      "contextType" : "variable",
                                      "element" : "fullUrl",
                                      "transform" : "append",
                                      "parameter" : [
                                        {
                                          "valueString" : "https://example/Practitioner/"
                                        },
                                        {
                                          "valueId" : "uuid2"
                                        }
                                      ]
                                    },
                                    {
                                      "context" : "request",
                                      "contextType" : "variable",
                                      "element" : "url",
                                      "transform" : "append",
                                      "parameter" : [
                                        {
                                          "valueString" : "Practitioner/"
                                        },
                                        {
                                          "valueId" : "uuid2"
                                        }
                                      ]
                                    },
                                    {
                                      "context" : "medAdm",
                                      "contextType" : "variable",
                                      "element" : "performer",
                                      "variable" : "p"
                                    },
                                    {
                                      "context" : "p",
                                      "contextType" : "variable",
                                      "element" : "actor",
                                      "variable" : "reference",
                                      "transform" : "create",
                                      "parameter" : [
                                        {
                                          "valueString" : "Reference"
                                        }
                                      ]
                                    },
                                    {
                                      "context" : "reference",
                                      "contextType" : "variable",
                                      "element" : "reference",
                                      "transform" : "evaluate",
                                      "parameter" : [
                                        {
                                          "valueString" : "'https://example/Practitioner/' + %practitioner.id"
                                        }
                                      ]
                                    }
                                  ]
                                }
                              ]
                            }
                          ]
                        },
                        {
                          "name" : "2.16.840.1.113883.2.9.4.3.2",
                          "source" : [
                            {
                              "context" : "ent",
                              "element" : "id",
                              "variable" : "id",
                              "condition" : "(root = '2.16.840.1.113883.2.9.4.3.2')"
                            }
                          ],
                          "rule" : [
                            {
                              "name" : "UUID",
                              "source" : [
                                {
                                  "context" : "id",
                                  "element" : "extension",
                                  "variable" : "ext"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "request",
                                  "contextType" : "variable",
                                  "element" : "url",
                                  "transform" : "append",
                                  "parameter" : [
                                    {
                                      "valueString" : "Practitioner?identifier="
                                    },
                                    {
                                      "valueId" : "ext"
                                    }
                                  ]
                                }
                              ]
                            }
                          ]
                        },
                        {
                          "name" : "assperson",
                          "source" : [
                            {
                              "context" : "ent",
                              "element" : "assignedPerson",
                              "variable" : "assPerson"
                            }
                          ],
                          "rule" : [
                            {
                              "name" : "name",
                              "source" : [
                                {
                                  "context" : "assPerson",
                                  "element" : "name",
                                  "variable" : "vvv"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "practitioner",
                                  "contextType" : "variable",
                                  "element" : "name",
                                  "variable" : "vvv",
                                  "transform" : "create"
                                }
                              ]
                            }
                          ],
                          "documentation" : "fine modifica"
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ],
          "documentation" : "Sezione Strutturata-------------------------------------------------------------------------------------------------------------------------------------------------"
        }
      ]
    },
    {
      "name" : "ClinicalDocumentSectionPianoCuraDimissione",
      "typeMode" : "none",
      "documentation" : "------------------------------------------------------------------------------------------------------------------\r\n-",
      "input" : [
        {
          "name" : "cda",
          "type" : "ClinicalDocument",
          "mode" : "source"
        },
        {
          "name" : "src",
          "type" : "Section",
          "mode" : "source"
        },
        {
          "name" : "patient",
          "type" : "Patient",
          "mode" : "target"
        },
        {
          "name" : "tgt",
          "mode" : "target"
        },
        {
          "name" : "bundle",
          "type" : "Bundle",
          "mode" : "target"
        },
        {
          "name" : "enc",
          "type" : "Encounter",
          "mode" : "target"
        }
      ],
      "rule" : [
        {
          "name" : "title",
          "source" : [
            {
              "context" : "src",
              "element" : "title",
              "variable" : "t"
            }
          ],
          "target" : [
            {
              "context" : "tgt",
              "contextType" : "variable",
              "element" : "title",
              "transform" : "evaluate",
              "parameter" : [
                {
                  "valueString" : "t.dataString"
                }
              ]
            }
          ]
        },
        {
          "name" : "code",
          "source" : [
            {
              "context" : "src",
              "element" : "code",
              "variable" : "vvv"
            }
          ],
          "target" : [
            {
              "context" : "tgt",
              "contextType" : "variable",
              "element" : "code",
              "variable" : "vvv",
              "transform" : "create"
            }
          ]
        },
        {
          "name" : "entryident3",
          "source" : [
            {
              "context" : "src",
              "variable" : "entry1"
            }
          ],
          "target" : [
            {
              "context" : "bundle",
              "contextType" : "variable",
              "element" : "entry",
              "variable" : "e1"
            },
            {
              "context" : "e1",
              "contextType" : "variable",
              "element" : "request",
              "variable" : "request",
              "transform" : "create",
              "parameter" : [
                {
                  "valueString" : "BackboneElement"
                }
              ]
            },
            {
              "context" : "request",
              "contextType" : "variable",
              "element" : "method",
              "transform" : "copy",
              "parameter" : [
                {
                  "valueString" : "POST"
                }
              ]
            },
            {
              "context" : "e1",
              "contextType" : "variable",
              "element" : "resource",
              "variable" : "careplan",
              "transform" : "create",
              "parameter" : [
                {
                  "valueString" : "CarePlan"
                }
              ]
            },
            {
              "context" : "careplan",
              "contextType" : "variable",
              "element" : "id",
              "variable" : "uuid1",
              "transform" : "uuid"
            },
            {
              "context" : "e1",
              "contextType" : "variable",
              "element" : "fullUrl",
              "transform" : "append",
              "parameter" : [
                {
                  "valueString" : "https://example/CarePlan/"
                },
                {
                  "valueId" : "uuid1"
                }
              ]
            },
            {
              "context" : "request",
              "contextType" : "variable",
              "element" : "url",
              "transform" : "copy",
              "parameter" : [
                {
                  "valueString" : "CarePlan"
                }
              ]
            },
            {
              "context" : "tgt",
              "contextType" : "variable",
              "element" : "entry",
              "variable" : "reference",
              "transform" : "create",
              "parameter" : [
                {
                  "valueString" : "Reference"
                }
              ]
            },
            {
              "context" : "reference",
              "contextType" : "variable",
              "element" : "reference",
              "transform" : "evaluate",
              "parameter" : [
                {
                  "valueString" : "'https://example/CarePlan/' + %careplan.id"
                }
              ]
            }
          ],
          "rule" : [
            {
              "name" : "reference",
              "source" : [
                {
                  "context" : "src"
                }
              ],
              "target" : [
                {
                  "context" : "careplan",
                  "contextType" : "variable",
                  "element" : "subject",
                  "variable" : "reference",
                  "transform" : "create",
                  "parameter" : [
                    {
                      "valueString" : "Reference"
                    }
                  ]
                },
                {
                  "context" : "reference",
                  "contextType" : "variable",
                  "element" : "reference",
                  "transform" : "evaluate",
                  "parameter" : [
                    {
                      "valueString" : "'https://example/Patient/' + %patient.id"
                    }
                  ]
                }
              ]
            },
            {
              "name" : "reference",
              "source" : [
                {
                  "context" : "src"
                }
              ],
              "target" : [
                {
                  "context" : "careplan",
                  "contextType" : "variable",
                  "element" : "encounter",
                  "variable" : "reference",
                  "transform" : "create",
                  "parameter" : [
                    {
                      "valueString" : "Reference"
                    }
                  ]
                },
                {
                  "context" : "reference",
                  "contextType" : "variable",
                  "element" : "reference",
                  "transform" : "evaluate",
                  "parameter" : [
                    {
                      "valueString" : "'https://example/Encounter/' + %enc.id"
                    }
                  ]
                }
              ]
            },
            {
              "name" : "status",
              "source" : [
                {
                  "context" : "src"
                }
              ],
              "target" : [
                {
                  "context" : "careplan",
                  "contextType" : "variable",
                  "element" : "status",
                  "transform" : "copy",
                  "parameter" : [
                    {
                      "valueString" : "active"
                    }
                  ]
                }
              ]
            },
            {
              "name" : "intent",
              "source" : [
                {
                  "context" : "src"
                }
              ],
              "target" : [
                {
                  "context" : "careplan",
                  "contextType" : "variable",
                  "element" : "intent",
                  "transform" : "copy",
                  "parameter" : [
                    {
                      "valueString" : "order"
                    }
                  ]
                }
              ]
            },
            {
              "name" : "author",
              "source" : [
                {
                  "context" : "src",
                  "element" : "text",
                  "variable" : "cdaText"
                }
              ],
              "target" : [
                {
                  "context" : "careplan",
                  "contextType" : "variable",
                  "element" : "note",
                  "variable" : "carenote"
                }
              ],
              "rule" : [
                {
                  "name" : "notetxt",
                  "source" : [
                    {
                      "context" : "cdaText",
                      "variable" : "t"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "carenote",
                      "contextType" : "variable",
                      "element" : "text",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueId" : "t"
                        }
                      ]
                    }
                  ]
                },
                {
                  "name" : "CFauthor",
                  "source" : [
                    {
                      "context" : "entry1",
                      "element" : "author",
                      "variable" : "author"
                    }
                  ],
                  "rule" : [
                    {
                      "name" : "notetime",
                      "source" : [
                        {
                          "context" : "author",
                          "element" : "time",
                          "variable" : "t"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "carenote",
                          "contextType" : "variable",
                          "element" : "time",
                          "variable" : "value",
                          "transform" : "create",
                          "parameter" : [
                            {
                              "valueString" : "dateTime"
                            }
                          ]
                        }
                      ],
                      "dependent" : [
                        {
                          "name" : "TSDateTime",
                          "variable" : [
                            "t",
                            "value"
                          ]
                        }
                      ]
                    },
                    {
                      "name" : "authpract",
                      "source" : [
                        {
                          "context" : "author",
                          "element" : "assignedAuthor",
                          "variable" : "assauthor"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "bundle",
                          "contextType" : "variable",
                          "element" : "entry",
                          "variable" : "e1"
                        },
                        {
                          "context" : "e1",
                          "contextType" : "variable",
                          "element" : "request",
                          "variable" : "request",
                          "transform" : "create",
                          "parameter" : [
                            {
                              "valueString" : "BackboneElement"
                            }
                          ]
                        },
                        {
                          "context" : "request",
                          "contextType" : "variable",
                          "element" : "method",
                          "transform" : "copy",
                          "parameter" : [
                            {
                              "valueString" : "PUT"
                            }
                          ]
                        },
                        {
                          "context" : "e1",
                          "contextType" : "variable",
                          "element" : "resource",
                          "variable" : "practitioner",
                          "transform" : "create",
                          "parameter" : [
                            {
                              "valueString" : "Practitioner"
                            }
                          ]
                        },
                        {
                          "context" : "practitioner",
                          "contextType" : "variable",
                          "element" : "id",
                          "variable" : "uuid1",
                          "transform" : "uuid"
                        },
                        {
                          "context" : "e1",
                          "contextType" : "variable",
                          "element" : "fullUrl",
                          "transform" : "append",
                          "parameter" : [
                            {
                              "valueString" : "https://example/Practitioner/"
                            },
                            {
                              "valueId" : "uuid1"
                            }
                          ]
                        },
                        {
                          "context" : "request",
                          "contextType" : "variable",
                          "element" : "url",
                          "transform" : "append",
                          "parameter" : [
                            {
                              "valueString" : "Practitioner/"
                            },
                            {
                              "valueId" : "uuid1"
                            }
                          ]
                        }
                      ],
                      "rule" : [
                        {
                          "name" : "meta",
                          "source" : [
                            {
                              "context" : "assauthor"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "practitioner",
                              "contextType" : "variable",
                              "element" : "meta",
                              "variable" : "meta"
                            }
                          ],
                          "rule" : [
                            {
                              "name" : "coding",
                              "source" : [
                                {
                                  "context" : "assauthor"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "meta",
                                  "contextType" : "variable",
                                  "element" : "tag",
                                  "variable" : "coding",
                                  "transform" : "create",
                                  "parameter" : [
                                    {
                                      "valueString" : "Coding"
                                    }
                                  ]
                                }
                              ],
                              "rule" : [
                                {
                                  "name" : "system",
                                  "source" : [
                                    {
                                      "context" : "assauthor"
                                    }
                                  ],
                                  "target" : [
                                    {
                                      "context" : "coding",
                                      "contextType" : "variable",
                                      "element" : "system",
                                      "transform" : "copy",
                                      "parameter" : [
                                        {
                                          "valueString" : "http://algoritmodiscoring"
                                        }
                                      ]
                                    }
                                  ]
                                },
                                {
                                  "name" : "code",
                                  "source" : [
                                    {
                                      "context" : "assauthor"
                                    }
                                  ],
                                  "target" : [
                                    {
                                      "context" : "coding",
                                      "contextType" : "variable",
                                      "element" : "code",
                                      "transform" : "copy",
                                      "parameter" : [
                                        {
                                          "valueString" : "ClinicalDocument/body/PianoCuraDimissione/author"
                                        }
                                      ]
                                    }
                                  ]
                                }
                              ]
                            }
                          ],
                          "documentation" : "inizio modifica meta+identifier"
                        },
                        {
                          "name" : "identifier",
                          "source" : [
                            {
                              "context" : "assauthor",
                              "element" : "id",
                              "variable" : "id"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "practitioner",
                              "contextType" : "variable",
                              "element" : "identifier",
                              "variable" : "identifier"
                            }
                          ],
                          "rule" : [
                            {
                              "name" : "root1",
                              "source" : [
                                {
                                  "context" : "id",
                                  "element" : "root",
                                  "variable" : "r"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "identifier",
                                  "contextType" : "variable",
                                  "element" : "system",
                                  "transform" : "translate",
                                  "parameter" : [
                                    {
                                      "valueId" : "r"
                                    },
                                    {
                                      "valueString" : "http://hl7.org/fhir/ConceptMap/special-oid2uri"
                                    },
                                    {
                                      "valueString" : "uri"
                                    }
                                  ]
                                }
                              ]
                            },
                            {
                              "name" : "extension",
                              "source" : [
                                {
                                  "context" : "id",
                                  "element" : "extension",
                                  "variable" : "ext"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "identifier",
                                  "contextType" : "variable",
                                  "element" : "value",
                                  "transform" : "copy",
                                  "parameter" : [
                                    {
                                      "valueId" : "ext"
                                    }
                                  ]
                                }
                              ]
                            },
                            {
                              "name" : "assigningAuthorityName",
                              "source" : [
                                {
                                  "context" : "id",
                                  "element" : "assigningAuthorityName",
                                  "variable" : "s"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "identifier",
                                  "contextType" : "variable",
                                  "element" : "assigner",
                                  "variable" : "a"
                                },
                                {
                                  "context" : "a",
                                  "contextType" : "variable",
                                  "element" : "display",
                                  "transform" : "copy",
                                  "parameter" : [
                                    {
                                      "valueId" : "s"
                                    }
                                  ]
                                }
                              ]
                            },
                            {
                              "name" : "r",
                              "source" : [
                                {
                                  "context" : "id",
                                  "element" : "root",
                                  "variable" : "r"
                                }
                              ],
                              "rule" : [
                                {
                                  "name" : "aut",
                                  "source" : [
                                    {
                                      "context" : "id",
                                      "element" : "extension",
                                      "variable" : "ext"
                                    }
                                  ],
                                  "target" : [
                                    {
                                      "context" : "practitioner",
                                      "contextType" : "variable",
                                      "element" : "id",
                                      "variable" : "uuid2",
                                      "transform" : "evaluate",
                                      "parameter" : [
                                        {
                                          "valueString" : "r + '-' + ext"
                                        }
                                      ]
                                    },
                                    {
                                      "context" : "e1",
                                      "contextType" : "variable",
                                      "element" : "fullUrl",
                                      "transform" : "append",
                                      "parameter" : [
                                        {
                                          "valueString" : "https://example/Practitioner/"
                                        },
                                        {
                                          "valueId" : "uuid2"
                                        }
                                      ]
                                    },
                                    {
                                      "context" : "request",
                                      "contextType" : "variable",
                                      "element" : "url",
                                      "transform" : "append",
                                      "parameter" : [
                                        {
                                          "valueString" : "Practitioner/"
                                        },
                                        {
                                          "valueId" : "uuid2"
                                        }
                                      ]
                                    },
                                    {
                                      "context" : "carenote",
                                      "contextType" : "variable",
                                      "element" : "author",
                                      "variable" : "reference",
                                      "transform" : "create",
                                      "parameter" : [
                                        {
                                          "valueString" : "Reference"
                                        }
                                      ]
                                    },
                                    {
                                      "context" : "reference",
                                      "contextType" : "variable",
                                      "element" : "reference",
                                      "transform" : "evaluate",
                                      "parameter" : [
                                        {
                                          "valueString" : "'https://example/Practitioner/' + %practitioner.id"
                                        }
                                      ]
                                    }
                                  ]
                                }
                              ]
                            }
                          ]
                        },
                        {
                          "name" : "2.16.840.1.113883.2.9.4.3.2",
                          "source" : [
                            {
                              "context" : "assauthor",
                              "element" : "id",
                              "variable" : "id",
                              "condition" : "(root = '2.16.840.1.113883.2.9.4.3.2')"
                            }
                          ],
                          "rule" : [
                            {
                              "name" : "UUID",
                              "source" : [
                                {
                                  "context" : "id",
                                  "element" : "extension",
                                  "variable" : "ext"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "request",
                                  "contextType" : "variable",
                                  "element" : "url",
                                  "transform" : "append",
                                  "parameter" : [
                                    {
                                      "valueString" : "Practitioner?identifier="
                                    },
                                    {
                                      "valueId" : "ext"
                                    }
                                  ]
                                }
                              ]
                            }
                          ]
                        },
                        {
                          "name" : "namepers",
                          "source" : [
                            {
                              "context" : "assauthor",
                              "element" : "assignedPerson",
                              "variable" : "pers"
                            }
                          ],
                          "rule" : [
                            {
                              "name" : "name",
                              "source" : [
                                {
                                  "context" : "pers",
                                  "element" : "name",
                                  "variable" : "vvv"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "practitioner",
                                  "contextType" : "variable",
                                  "element" : "name",
                                  "variable" : "vvv",
                                  "transform" : "create"
                                }
                              ]
                            }
                          ],
                          "documentation" : "fine modifica"
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "name" : "entry1",
              "source" : [
                {
                  "context" : "entry1",
                  "element" : "entry",
                  "variable" : "entry2"
                }
              ],
              "rule" : [
                {
                  "name" : "carnote",
                  "source" : [
                    {
                      "context" : "entry2",
                      "element" : "act",
                      "variable" : "entryact"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "bundle",
                      "contextType" : "variable",
                      "element" : "entry",
                      "variable" : "e1"
                    },
                    {
                      "context" : "e1",
                      "contextType" : "variable",
                      "element" : "request",
                      "variable" : "request",
                      "transform" : "create",
                      "parameter" : [
                        {
                          "valueString" : "BackboneElement"
                        }
                      ]
                    },
                    {
                      "context" : "request",
                      "contextType" : "variable",
                      "element" : "method",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "POST"
                        }
                      ]
                    },
                    {
                      "context" : "e1",
                      "contextType" : "variable",
                      "element" : "resource",
                      "variable" : "servicerequest",
                      "transform" : "create",
                      "parameter" : [
                        {
                          "valueString" : "ServiceRequest"
                        }
                      ]
                    },
                    {
                      "context" : "servicerequest",
                      "contextType" : "variable",
                      "element" : "id",
                      "variable" : "uuid1",
                      "transform" : "uuid"
                    },
                    {
                      "context" : "e1",
                      "contextType" : "variable",
                      "element" : "fullUrl",
                      "transform" : "append",
                      "parameter" : [
                        {
                          "valueString" : "https://example/ServiceRequest/"
                        },
                        {
                          "valueId" : "uuid1"
                        }
                      ]
                    },
                    {
                      "context" : "request",
                      "contextType" : "variable",
                      "element" : "url",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "ServiceRequest"
                        }
                      ]
                    },
                    {
                      "context" : "careplan",
                      "contextType" : "variable",
                      "element" : "activity",
                      "variable" : "activ",
                      "transform" : "create",
                      "parameter" : [
                        {
                          "valueString" : "BackboneElement"
                        }
                      ]
                    },
                    {
                      "context" : "activ",
                      "contextType" : "variable",
                      "element" : "reference",
                      "variable" : "reference",
                      "transform" : "create",
                      "parameter" : [
                        {
                          "valueString" : "Reference"
                        }
                      ]
                    },
                    {
                      "context" : "reference",
                      "contextType" : "variable",
                      "element" : "reference",
                      "transform" : "evaluate",
                      "parameter" : [
                        {
                          "valueString" : "'https://example/ServiceRequest/' + %servicerequest.id"
                        }
                      ]
                    }
                  ],
                  "rule" : [
                    {
                      "name" : "reference",
                      "source" : [
                        {
                          "context" : "entryact"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "servicerequest",
                          "contextType" : "variable",
                          "element" : "subject",
                          "variable" : "reference",
                          "transform" : "create",
                          "parameter" : [
                            {
                              "valueString" : "Reference"
                            }
                          ]
                        },
                        {
                          "context" : "reference",
                          "contextType" : "variable",
                          "element" : "reference",
                          "transform" : "evaluate",
                          "parameter" : [
                            {
                              "valueString" : "'https://example/Patient/' + %patient.id"
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "name" : "reference",
                      "source" : [
                        {
                          "context" : "entryact"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "servicerequest",
                          "contextType" : "variable",
                          "element" : "encounter",
                          "variable" : "reference",
                          "transform" : "create",
                          "parameter" : [
                            {
                              "valueString" : "Reference"
                            }
                          ]
                        },
                        {
                          "context" : "reference",
                          "contextType" : "variable",
                          "element" : "reference",
                          "transform" : "evaluate",
                          "parameter" : [
                            {
                              "valueString" : "'https://example/Encounter/' + %enc.id"
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "name" : "status",
                      "source" : [
                        {
                          "context" : "entryact"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "servicerequest",
                          "contextType" : "variable",
                          "element" : "status",
                          "transform" : "copy",
                          "parameter" : [
                            {
                              "valueString" : "active"
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "name" : "intent",
                      "source" : [
                        {
                          "context" : "entryact"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "servicerequest",
                          "contextType" : "variable",
                          "element" : "intent",
                          "transform" : "copy",
                          "parameter" : [
                            {
                              "valueString" : "order"
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "name" : "entry2",
                      "source" : [
                        {
                          "context" : "entryact"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "servicerequest",
                          "contextType" : "variable",
                          "element" : "identifier",
                          "variable" : "identif",
                          "transform" : "create",
                          "parameter" : [
                            {
                              "valueString" : "BackboneElement"
                            }
                          ]
                        }
                      ],
                      "rule" : [
                        {
                          "name" : "jarilemes",
                          "source" : [
                            {
                              "context" : "entryact",
                              "element" : "reference",
                              "variable" : "actref"
                            }
                          ],
                          "rule" : [
                            {
                              "name" : "actref",
                              "source" : [
                                {
                                  "context" : "actref",
                                  "element" : "externalAct",
                                  "variable" : "extact"
                                }
                              ],
                              "rule" : [
                                {
                                  "name" : "extact",
                                  "source" : [
                                    {
                                      "context" : "extact"
                                    }
                                  ],
                                  "target" : [
                                    {
                                      "context" : "servicerequest",
                                      "contextType" : "variable",
                                      "element" : "identifier",
                                      "variable" : "identif3",
                                      "transform" : "create",
                                      "parameter" : [
                                        {
                                          "valueString" : "BackboneElement"
                                        }
                                      ]
                                    }
                                  ],
                                  "rule" : [
                                    {
                                      "name" : "idnetn",
                                      "source" : [
                                        {
                                          "context" : "extact",
                                          "element" : "id",
                                          "variable" : "id"
                                        }
                                      ],
                                      "rule" : [
                                        {
                                          "name" : "root1",
                                          "source" : [
                                            {
                                              "context" : "id",
                                              "element" : "root",
                                              "variable" : "r"
                                            }
                                          ],
                                          "target" : [
                                            {
                                              "context" : "identif3",
                                              "contextType" : "variable",
                                              "element" : "system",
                                              "transform" : "translate",
                                              "parameter" : [
                                                {
                                                  "valueId" : "r"
                                                },
                                                {
                                                  "valueString" : "http://hl7.org/fhir/ConceptMap/special-oid2uri"
                                                },
                                                {
                                                  "valueString" : "uri"
                                                }
                                              ]
                                            }
                                          ]
                                        },
                                        {
                                          "name" : "ext",
                                          "source" : [
                                            {
                                              "context" : "id",
                                              "element" : "extension",
                                              "variable" : "ext"
                                            }
                                          ],
                                          "target" : [
                                            {
                                              "context" : "identif3",
                                              "contextType" : "variable",
                                              "element" : "value",
                                              "transform" : "copy",
                                              "parameter" : [
                                                {
                                                  "valueId" : "ext"
                                                }
                                              ]
                                            }
                                          ],
                                          "rule" : [
                                            {
                                              "name" : "assigningAuthorityName",
                                              "source" : [
                                                {
                                                  "context" : "id",
                                                  "element" : "assigningAuthorityName",
                                                  "variable" : "s"
                                                }
                                              ],
                                              "target" : [
                                                {
                                                  "context" : "identif3",
                                                  "contextType" : "variable",
                                                  "element" : "assigner",
                                                  "variable" : "a"
                                                },
                                                {
                                                  "context" : "a",
                                                  "contextType" : "variable",
                                                  "element" : "display",
                                                  "transform" : "copy",
                                                  "parameter" : [
                                                    {
                                                      "valueId" : "s"
                                                    }
                                                  ]
                                                }
                                              ]
                                            }
                                          ]
                                        }
                                      ]
                                    }
                                  ]
                                }
                              ]
                            }
                          ]
                        },
                        {
                          "name" : "code",
                          "source" : [
                            {
                              "context" : "entryact",
                              "element" : "code",
                              "variable" : "vvv"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "servicerequest",
                              "contextType" : "variable",
                              "element" : "code",
                              "variable" : "vvv",
                              "transform" : "create"
                            }
                          ]
                        },
                        {
                          "name" : "statusCode",
                          "source" : [
                            {
                              "context" : "entryact",
                              "element" : "statusCode",
                              "variable" : "vvv"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "servicerequest",
                              "contextType" : "variable",
                              "element" : "status",
                              "variable" : "vvv",
                              "transform" : "create"
                            }
                          ]
                        },
                        {
                          "name" : "servReq",
                          "source" : [
                            {
                              "context" : "entryact",
                              "element" : "author",
                              "variable" : "actauthor"
                            }
                          ],
                          "rule" : [
                            {
                              "name" : "time",
                              "source" : [
                                {
                                  "context" : "actauthor",
                                  "element" : "time",
                                  "variable" : "t"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "servicerequest",
                                  "contextType" : "variable",
                                  "element" : "authoredOn",
                                  "variable" : "date",
                                  "transform" : "create",
                                  "parameter" : [
                                    {
                                      "valueString" : "dateTime"
                                    }
                                  ]
                                }
                              ],
                              "dependent" : [
                                {
                                  "name" : "TSDateTime",
                                  "variable" : [
                                    "t",
                                    "date"
                                  ]
                                }
                              ]
                            },
                            {
                              "name" : "author",
                              "source" : [
                                {
                                  "context" : "actauthor",
                                  "element" : "assignedAuthor",
                                  "variable" : "assauthor"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "bundle",
                                  "contextType" : "variable",
                                  "element" : "entry",
                                  "variable" : "e1"
                                },
                                {
                                  "context" : "e1",
                                  "contextType" : "variable",
                                  "element" : "request",
                                  "variable" : "request",
                                  "transform" : "create",
                                  "parameter" : [
                                    {
                                      "valueString" : "BackboneElement"
                                    }
                                  ]
                                },
                                {
                                  "context" : "request",
                                  "contextType" : "variable",
                                  "element" : "method",
                                  "transform" : "copy",
                                  "parameter" : [
                                    {
                                      "valueString" : "PUT"
                                    }
                                  ]
                                },
                                {
                                  "context" : "e1",
                                  "contextType" : "variable",
                                  "element" : "resource",
                                  "variable" : "practitioner",
                                  "transform" : "create",
                                  "parameter" : [
                                    {
                                      "valueString" : "Practitioner"
                                    }
                                  ]
                                },
                                {
                                  "context" : "practitioner",
                                  "contextType" : "variable",
                                  "element" : "id",
                                  "variable" : "uuid1",
                                  "transform" : "uuid"
                                },
                                {
                                  "context" : "e1",
                                  "contextType" : "variable",
                                  "element" : "fullUrl",
                                  "transform" : "append",
                                  "parameter" : [
                                    {
                                      "valueString" : "https://example/Practitioner/"
                                    },
                                    {
                                      "valueId" : "uuid1"
                                    }
                                  ]
                                },
                                {
                                  "context" : "request",
                                  "contextType" : "variable",
                                  "element" : "url",
                                  "transform" : "append",
                                  "parameter" : [
                                    {
                                      "valueString" : "Practitioner/"
                                    },
                                    {
                                      "valueId" : "uuid1"
                                    }
                                  ]
                                }
                              ],
                              "rule" : [
                                {
                                  "name" : "meta",
                                  "source" : [
                                    {
                                      "context" : "assauthor"
                                    }
                                  ],
                                  "target" : [
                                    {
                                      "context" : "practitioner",
                                      "contextType" : "variable",
                                      "element" : "meta",
                                      "variable" : "meta"
                                    }
                                  ],
                                  "rule" : [
                                    {
                                      "name" : "coding",
                                      "source" : [
                                        {
                                          "context" : "assauthor"
                                        }
                                      ],
                                      "target" : [
                                        {
                                          "context" : "meta",
                                          "contextType" : "variable",
                                          "element" : "tag",
                                          "variable" : "coding",
                                          "transform" : "create",
                                          "parameter" : [
                                            {
                                              "valueString" : "Coding"
                                            }
                                          ]
                                        }
                                      ],
                                      "rule" : [
                                        {
                                          "name" : "system",
                                          "source" : [
                                            {
                                              "context" : "assauthor"
                                            }
                                          ],
                                          "target" : [
                                            {
                                              "context" : "coding",
                                              "contextType" : "variable",
                                              "element" : "system",
                                              "transform" : "copy",
                                              "parameter" : [
                                                {
                                                  "valueString" : "http://algoritmodiscoring"
                                                }
                                              ]
                                            }
                                          ]
                                        },
                                        {
                                          "name" : "code",
                                          "source" : [
                                            {
                                              "context" : "assauthor"
                                            }
                                          ],
                                          "target" : [
                                            {
                                              "context" : "coding",
                                              "contextType" : "variable",
                                              "element" : "code",
                                              "transform" : "copy",
                                              "parameter" : [
                                                {
                                                  "valueString" : "ClinicalDocument/body/PianoCuraDimissione/author"
                                                }
                                              ]
                                            }
                                          ]
                                        }
                                      ]
                                    }
                                  ],
                                  "documentation" : "inizio modifica identifier"
                                },
                                {
                                  "name" : "identifier",
                                  "source" : [
                                    {
                                      "context" : "assauthor",
                                      "element" : "id",
                                      "variable" : "id"
                                    }
                                  ],
                                  "target" : [
                                    {
                                      "context" : "practitioner",
                                      "contextType" : "variable",
                                      "element" : "identifier",
                                      "variable" : "identifier"
                                    }
                                  ],
                                  "rule" : [
                                    {
                                      "name" : "root1",
                                      "source" : [
                                        {
                                          "context" : "id",
                                          "element" : "root",
                                          "variable" : "r"
                                        }
                                      ],
                                      "target" : [
                                        {
                                          "context" : "identifier",
                                          "contextType" : "variable",
                                          "element" : "system",
                                          "transform" : "translate",
                                          "parameter" : [
                                            {
                                              "valueId" : "r"
                                            },
                                            {
                                              "valueString" : "http://hl7.org/fhir/ConceptMap/special-oid2uri"
                                            },
                                            {
                                              "valueString" : "uri"
                                            }
                                          ]
                                        }
                                      ]
                                    },
                                    {
                                      "name" : "extension",
                                      "source" : [
                                        {
                                          "context" : "id",
                                          "element" : "extension",
                                          "variable" : "ext"
                                        }
                                      ],
                                      "target" : [
                                        {
                                          "context" : "identifier",
                                          "contextType" : "variable",
                                          "element" : "value",
                                          "transform" : "copy",
                                          "parameter" : [
                                            {
                                              "valueId" : "ext"
                                            }
                                          ]
                                        }
                                      ]
                                    },
                                    {
                                      "name" : "assigningAuthorityName",
                                      "source" : [
                                        {
                                          "context" : "id",
                                          "element" : "assigningAuthorityName",
                                          "variable" : "s"
                                        }
                                      ],
                                      "target" : [
                                        {
                                          "context" : "identifier",
                                          "contextType" : "variable",
                                          "element" : "assigner",
                                          "variable" : "a"
                                        },
                                        {
                                          "context" : "a",
                                          "contextType" : "variable",
                                          "element" : "display",
                                          "transform" : "copy",
                                          "parameter" : [
                                            {
                                              "valueId" : "s"
                                            }
                                          ]
                                        }
                                      ]
                                    },
                                    {
                                      "name" : "r",
                                      "source" : [
                                        {
                                          "context" : "id",
                                          "element" : "root",
                                          "variable" : "r"
                                        }
                                      ],
                                      "rule" : [
                                        {
                                          "name" : "aut",
                                          "source" : [
                                            {
                                              "context" : "id",
                                              "element" : "extension",
                                              "variable" : "ext"
                                            }
                                          ],
                                          "target" : [
                                            {
                                              "context" : "practitioner",
                                              "contextType" : "variable",
                                              "element" : "id",
                                              "variable" : "uuid2",
                                              "transform" : "evaluate",
                                              "parameter" : [
                                                {
                                                  "valueString" : "r + '-' + ext"
                                                }
                                              ]
                                            },
                                            {
                                              "context" : "e1",
                                              "contextType" : "variable",
                                              "element" : "fullUrl",
                                              "transform" : "append",
                                              "parameter" : [
                                                {
                                                  "valueString" : "https://example/Practitioner/"
                                                },
                                                {
                                                  "valueId" : "uuid2"
                                                }
                                              ]
                                            },
                                            {
                                              "context" : "request",
                                              "contextType" : "variable",
                                              "element" : "url",
                                              "transform" : "append",
                                              "parameter" : [
                                                {
                                                  "valueString" : "Practitioner/"
                                                },
                                                {
                                                  "valueId" : "uuid2"
                                                }
                                              ]
                                            },
                                            {
                                              "context" : "servicerequest",
                                              "contextType" : "variable",
                                              "element" : "requester",
                                              "variable" : "reference",
                                              "transform" : "create",
                                              "parameter" : [
                                                {
                                                  "valueString" : "Reference"
                                                }
                                              ]
                                            },
                                            {
                                              "context" : "reference",
                                              "contextType" : "variable",
                                              "element" : "reference",
                                              "transform" : "evaluate",
                                              "parameter" : [
                                                {
                                                  "valueString" : "'https://example/Practitioner/' + %practitioner.id"
                                                }
                                              ]
                                            }
                                          ]
                                        }
                                      ]
                                    }
                                  ]
                                },
                                {
                                  "name" : "2.16.840.1.113883.2.9.4.3.2",
                                  "source" : [
                                    {
                                      "context" : "assauthor",
                                      "element" : "id",
                                      "variable" : "id",
                                      "condition" : "(root = '2.16.840.1.113883.2.9.4.3.2')"
                                    }
                                  ],
                                  "rule" : [
                                    {
                                      "name" : "UUID",
                                      "source" : [
                                        {
                                          "context" : "id",
                                          "element" : "extension",
                                          "variable" : "ext"
                                        }
                                      ],
                                      "target" : [
                                        {
                                          "context" : "request",
                                          "contextType" : "variable",
                                          "element" : "url",
                                          "transform" : "append",
                                          "parameter" : [
                                            {
                                              "valueString" : "Practitioner?identifier="
                                            },
                                            {
                                              "valueId" : "ext"
                                            }
                                          ]
                                        }
                                      ]
                                    }
                                  ]
                                },
                                {
                                  "name" : "namepers",
                                  "source" : [
                                    {
                                      "context" : "assauthor",
                                      "element" : "assignedPerson",
                                      "variable" : "pers"
                                    }
                                  ],
                                  "rule" : [
                                    {
                                      "name" : "name",
                                      "source" : [
                                        {
                                          "context" : "pers",
                                          "element" : "name",
                                          "variable" : "vvv"
                                        }
                                      ],
                                      "target" : [
                                        {
                                          "context" : "practitioner",
                                          "contextType" : "variable",
                                          "element" : "name",
                                          "variable" : "vvv",
                                          "transform" : "create"
                                        }
                                      ]
                                    }
                                  ],
                                  "documentation" : "fine modifica"
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ]
        }
      ]
    },
    {
      "name" : "ClinicalDocumentSectionDimissione",
      "typeMode" : "none",
      "documentation" : "-------Dimissione------------------------------------------------------------------------------------------------------",
      "input" : [
        {
          "name" : "cda",
          "type" : "ClinicalDocument",
          "mode" : "source"
        },
        {
          "name" : "src",
          "type" : "Section",
          "mode" : "source"
        },
        {
          "name" : "patient",
          "type" : "Patient",
          "mode" : "target"
        },
        {
          "name" : "tgt",
          "mode" : "target"
        },
        {
          "name" : "bundle",
          "type" : "Bundle",
          "mode" : "target"
        },
        {
          "name" : "enc",
          "type" : "Encounter",
          "mode" : "target"
        }
      ],
      "rule" : [
        {
          "name" : "title",
          "source" : [
            {
              "context" : "src",
              "element" : "title",
              "variable" : "t"
            }
          ],
          "target" : [
            {
              "context" : "tgt",
              "contextType" : "variable",
              "element" : "title",
              "transform" : "evaluate",
              "parameter" : [
                {
                  "valueString" : "t.dataString"
                }
              ]
            }
          ]
        },
        {
          "name" : "code",
          "source" : [
            {
              "context" : "src",
              "element" : "code",
              "variable" : "vvv"
            }
          ],
          "target" : [
            {
              "context" : "tgt",
              "contextType" : "variable",
              "element" : "code",
              "variable" : "vvv",
              "transform" : "create"
            }
          ]
        },
        {
          "name" : "cdaText",
          "source" : [
            {
              "context" : "src",
              "element" : "text",
              "variable" : "cdaText"
            }
          ],
          "target" : [
            {
              "context" : "tgt",
              "contextType" : "variable",
              "element" : "text",
              "variable" : "fhirText"
            }
          ],
          "rule" : [
            {
              "name" : "narrativeStatus",
              "source" : [
                {
                  "context" : "cdaText"
                }
              ],
              "target" : [
                {
                  "context" : "fhirText",
                  "contextType" : "variable",
                  "element" : "status",
                  "transform" : "copy",
                  "parameter" : [
                    {
                      "valueString" : "generated"
                    }
                  ]
                }
              ]
            },
            {
              "name" : "narrativeText",
              "source" : [
                {
                  "context" : "cdaText",
                  "variable" : "t"
                }
              ],
              "target" : [
                {
                  "context" : "fhirText",
                  "contextType" : "variable",
                  "element" : "div",
                  "transform" : "copy",
                  "parameter" : [
                    {
                      "valueId" : "t"
                    }
                  ]
                }
              ]
            }
          ]
        },
        {
          "name" : "entry1",
          "source" : [
            {
              "context" : "src",
              "element" : "entry",
              "variable" : "entry1"
            }
          ],
          "rule" : [
            {
              "name" : "act",
              "source" : [
                {
                  "context" : "entry1",
                  "element" : "act",
                  "variable" : "act"
                }
              ],
              "target" : [
                {
                  "context" : "bundle",
                  "contextType" : "variable",
                  "element" : "entry",
                  "variable" : "e1"
                },
                {
                  "context" : "e1",
                  "contextType" : "variable",
                  "element" : "request",
                  "variable" : "request",
                  "transform" : "create",
                  "parameter" : [
                    {
                      "valueString" : "BackboneElement"
                    }
                  ]
                },
                {
                  "context" : "request",
                  "contextType" : "variable",
                  "element" : "method",
                  "transform" : "copy",
                  "parameter" : [
                    {
                      "valueString" : "POST"
                    }
                  ]
                },
                {
                  "context" : "e1",
                  "contextType" : "variable",
                  "element" : "resource",
                  "variable" : "encountert",
                  "transform" : "create",
                  "parameter" : [
                    {
                      "valueString" : "Encounter"
                    }
                  ]
                },
                {
                  "context" : "encountert",
                  "contextType" : "variable",
                  "element" : "id",
                  "variable" : "uuid1",
                  "transform" : "uuid"
                },
                {
                  "context" : "e1",
                  "contextType" : "variable",
                  "element" : "fullUrl",
                  "transform" : "append",
                  "parameter" : [
                    {
                      "valueString" : "https://example/Encounter/"
                    },
                    {
                      "valueId" : "uuid1"
                    }
                  ]
                },
                {
                  "context" : "request",
                  "contextType" : "variable",
                  "element" : "url",
                  "transform" : "copy",
                  "parameter" : [
                    {
                      "valueString" : "Encounter"
                    }
                  ]
                },
                {
                  "context" : "tgt",
                  "contextType" : "variable",
                  "element" : "entry",
                  "variable" : "reference",
                  "transform" : "create",
                  "parameter" : [
                    {
                      "valueString" : "Reference"
                    }
                  ]
                },
                {
                  "context" : "reference",
                  "contextType" : "variable",
                  "element" : "reference",
                  "transform" : "evaluate",
                  "parameter" : [
                    {
                      "valueString" : "'https://example/Encounter/' + %encountert.id"
                    }
                  ]
                }
              ],
              "rule" : [
                {
                  "name" : "status",
                  "source" : [
                    {
                      "context" : "act"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "encountert",
                      "contextType" : "variable",
                      "element" : "status",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "finished"
                        }
                      ]
                    }
                  ]
                },
                {
                  "name" : "class",
                  "source" : [
                    {
                      "context" : "act"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "encountert",
                      "contextType" : "variable",
                      "element" : "class",
                      "variable" : "cl",
                      "transform" : "create",
                      "parameter" : [
                        {
                          "valueString" : "Coding"
                        }
                      ]
                    }
                  ],
                  "rule" : [
                    {
                      "name" : "code",
                      "source" : [
                        {
                          "context" : "act"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "cl",
                          "contextType" : "variable",
                          "element" : "code",
                          "transform" : "copy",
                          "parameter" : [
                            {
                              "valueString" : "AMB"
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "name" : "code",
                      "source" : [
                        {
                          "context" : "act"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "cl",
                          "contextType" : "variable",
                          "element" : "display",
                          "transform" : "copy",
                          "parameter" : [
                            {
                              "valueString" : "ambulatory"
                            }
                          ]
                        }
                      ]
                    }
                  ]
                },
                {
                  "name" : "refenc",
                  "source" : [
                    {
                      "context" : "act"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "encountert",
                      "contextType" : "variable",
                      "element" : "partOf",
                      "variable" : "reference",
                      "transform" : "create",
                      "parameter" : [
                        {
                          "valueString" : "Reference"
                        }
                      ]
                    },
                    {
                      "context" : "reference",
                      "contextType" : "variable",
                      "element" : "reference",
                      "transform" : "evaluate",
                      "parameter" : [
                        {
                          "valueString" : "'https://example/Encounter/' + enc.id"
                        }
                      ]
                    }
                  ]
                },
                {
                  "name" : "refpatient",
                  "source" : [
                    {
                      "context" : "act"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "encountert",
                      "contextType" : "variable",
                      "element" : "subject",
                      "variable" : "reference",
                      "transform" : "create",
                      "parameter" : [
                        {
                          "valueString" : "Reference"
                        }
                      ]
                    },
                    {
                      "context" : "reference",
                      "contextType" : "variable",
                      "element" : "reference",
                      "transform" : "evaluate",
                      "parameter" : [
                        {
                          "valueString" : "'https://example/Patient/' + patient.id"
                        }
                      ]
                    }
                  ]
                },
                {
                  "name" : "code",
                  "source" : [
                    {
                      "context" : "act",
                      "element" : "code",
                      "variable" : "vvv"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "encountert",
                      "contextType" : "variable",
                      "element" : "type",
                      "variable" : "vvv",
                      "transform" : "create"
                    }
                  ]
                },
                {
                  "name" : "where",
                  "source" : [
                    {
                      "context" : "act",
                      "condition" : "effectiveTime.low.exists() or effectiveTime.high.exists()"
                    }
                  ],
                  "rule" : [
                    {
                      "name" : "effectiveTime",
                      "source" : [
                        {
                          "context" : "act",
                          "element" : "effectiveTime",
                          "variable" : "eff"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "encountert",
                          "contextType" : "variable",
                          "element" : "period",
                          "variable" : "period",
                          "transform" : "create",
                          "parameter" : [
                            {
                              "valueString" : "Period"
                            }
                          ]
                        }
                      ],
                      "dependent" : [
                        {
                          "name" : "IVLTSPeriod",
                          "variable" : [
                            "eff",
                            "period"
                          ]
                        }
                      ]
                    }
                  ]
                },
                {
                  "name" : "where",
                  "source" : [
                    {
                      "context" : "act",
                      "condition" : "effectiveTime.low.exists().not() or effectiveTime.high.exists().not()"
                    }
                  ],
                  "rule" : [
                    {
                      "name" : "efft",
                      "source" : [
                        {
                          "context" : "act",
                          "element" : "effectiveTime",
                          "variable" : "effectivetime1"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "encountert",
                          "contextType" : "variable",
                          "element" : "period",
                          "variable" : "period",
                          "transform" : "create",
                          "parameter" : [
                            {
                              "valueString" : "Period"
                            }
                          ]
                        }
                      ],
                      "rule" : [
                        {
                          "name" : "val",
                          "source" : [
                            {
                              "context" : "effectivetime1"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "period",
                              "contextType" : "variable",
                              "element" : "start",
                              "variable" : "start",
                              "transform" : "create",
                              "parameter" : [
                                {
                                  "valueString" : "dateTime"
                                }
                              ]
                            }
                          ],
                          "dependent" : [
                            {
                              "name" : "TSDateTime",
                              "variable" : [
                                "effectivetime1",
                                "start"
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  ],
                  "documentation" : "effectiveTime = time-stamp"
                },
                {
                  "name" : "erformer",
                  "source" : [
                    {
                      "context" : "act",
                      "element" : "performer",
                      "variable" : "performer"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "bundle",
                      "contextType" : "variable",
                      "element" : "entry",
                      "variable" : "e1"
                    },
                    {
                      "context" : "e1",
                      "contextType" : "variable",
                      "element" : "request",
                      "variable" : "request",
                      "transform" : "create",
                      "parameter" : [
                        {
                          "valueString" : "BackboneElement"
                        }
                      ]
                    },
                    {
                      "context" : "request",
                      "contextType" : "variable",
                      "element" : "method",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "PUT"
                        }
                      ]
                    },
                    {
                      "context" : "e1",
                      "contextType" : "variable",
                      "element" : "resource",
                      "variable" : "practitioner",
                      "transform" : "create",
                      "parameter" : [
                        {
                          "valueString" : "Practitioner"
                        }
                      ]
                    },
                    {
                      "context" : "practitioner",
                      "contextType" : "variable",
                      "element" : "id",
                      "variable" : "uuid1",
                      "transform" : "uuid"
                    },
                    {
                      "context" : "e1",
                      "contextType" : "variable",
                      "element" : "fullUrl",
                      "transform" : "append",
                      "parameter" : [
                        {
                          "valueString" : "https://example/Practitioner/"
                        },
                        {
                          "valueId" : "uuid1"
                        }
                      ]
                    },
                    {
                      "context" : "request",
                      "contextType" : "variable",
                      "element" : "url",
                      "transform" : "append",
                      "parameter" : [
                        {
                          "valueString" : "Practitioner/"
                        },
                        {
                          "valueId" : "uuid1"
                        }
                      ]
                    }
                  ],
                  "rule" : [
                    {
                      "name" : "ass",
                      "source" : [
                        {
                          "context" : "performer",
                          "element" : "assignedEntity",
                          "variable" : "assEnty"
                        }
                      ],
                      "rule" : [
                        {
                          "name" : "meta",
                          "source" : [
                            {
                              "context" : "assEnty"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "practitioner",
                              "contextType" : "variable",
                              "element" : "meta",
                              "variable" : "meta"
                            }
                          ],
                          "rule" : [
                            {
                              "name" : "coding",
                              "source" : [
                                {
                                  "context" : "assEnty"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "meta",
                                  "contextType" : "variable",
                                  "element" : "tag",
                                  "variable" : "coding",
                                  "transform" : "create",
                                  "parameter" : [
                                    {
                                      "valueString" : "Coding"
                                    }
                                  ]
                                }
                              ],
                              "rule" : [
                                {
                                  "name" : "system",
                                  "source" : [
                                    {
                                      "context" : "assEnty"
                                    }
                                  ],
                                  "target" : [
                                    {
                                      "context" : "coding",
                                      "contextType" : "variable",
                                      "element" : "system",
                                      "transform" : "copy",
                                      "parameter" : [
                                        {
                                          "valueString" : "http://algoritmodiscoring"
                                        }
                                      ]
                                    }
                                  ]
                                },
                                {
                                  "name" : "code",
                                  "source" : [
                                    {
                                      "context" : "assEnty"
                                    }
                                  ],
                                  "target" : [
                                    {
                                      "context" : "coding",
                                      "contextType" : "variable",
                                      "element" : "code",
                                      "transform" : "copy",
                                      "parameter" : [
                                        {
                                          "valueString" : "ClinicalDocument/body/Dimissione/performer"
                                        }
                                      ]
                                    }
                                  ]
                                }
                              ]
                            }
                          ]
                        },
                        {
                          "name" : "identifier",
                          "source" : [
                            {
                              "context" : "assEnty",
                              "element" : "id",
                              "variable" : "id"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "practitioner",
                              "contextType" : "variable",
                              "element" : "identifier",
                              "variable" : "identifier"
                            }
                          ],
                          "rule" : [
                            {
                              "name" : "root1",
                              "source" : [
                                {
                                  "context" : "id",
                                  "element" : "root",
                                  "variable" : "r"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "identifier",
                                  "contextType" : "variable",
                                  "element" : "system",
                                  "transform" : "translate",
                                  "parameter" : [
                                    {
                                      "valueId" : "r"
                                    },
                                    {
                                      "valueString" : "http://hl7.org/fhir/ConceptMap/special-oid2uri"
                                    },
                                    {
                                      "valueString" : "uri"
                                    }
                                  ]
                                }
                              ]
                            },
                            {
                              "name" : "extension",
                              "source" : [
                                {
                                  "context" : "id",
                                  "element" : "extension",
                                  "variable" : "ext"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "identifier",
                                  "contextType" : "variable",
                                  "element" : "value",
                                  "transform" : "copy",
                                  "parameter" : [
                                    {
                                      "valueId" : "ext"
                                    }
                                  ]
                                }
                              ]
                            },
                            {
                              "name" : "assigningAuthorityName",
                              "source" : [
                                {
                                  "context" : "id",
                                  "element" : "assigningAuthorityName",
                                  "variable" : "s"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "identifier",
                                  "contextType" : "variable",
                                  "element" : "assigner",
                                  "variable" : "a"
                                },
                                {
                                  "context" : "a",
                                  "contextType" : "variable",
                                  "element" : "display",
                                  "transform" : "copy",
                                  "parameter" : [
                                    {
                                      "valueId" : "s"
                                    }
                                  ]
                                }
                              ]
                            },
                            {
                              "name" : "r",
                              "source" : [
                                {
                                  "context" : "id",
                                  "element" : "root",
                                  "variable" : "r"
                                }
                              ],
                              "rule" : [
                                {
                                  "name" : "perf",
                                  "source" : [
                                    {
                                      "context" : "id",
                                      "element" : "extension",
                                      "variable" : "ext"
                                    }
                                  ],
                                  "target" : [
                                    {
                                      "context" : "practitioner",
                                      "contextType" : "variable",
                                      "element" : "id",
                                      "variable" : "uuid2",
                                      "transform" : "evaluate",
                                      "parameter" : [
                                        {
                                          "valueString" : "r + '-' + ext"
                                        }
                                      ]
                                    },
                                    {
                                      "context" : "e1",
                                      "contextType" : "variable",
                                      "element" : "fullUrl",
                                      "transform" : "append",
                                      "parameter" : [
                                        {
                                          "valueString" : "https://example/Practitioner/"
                                        },
                                        {
                                          "valueId" : "uuid2"
                                        }
                                      ]
                                    },
                                    {
                                      "context" : "request",
                                      "contextType" : "variable",
                                      "element" : "url",
                                      "transform" : "append",
                                      "parameter" : [
                                        {
                                          "valueString" : "Practitioner/"
                                        },
                                        {
                                          "valueId" : "uuid2"
                                        }
                                      ]
                                    },
                                    {
                                      "context" : "encountert",
                                      "contextType" : "variable",
                                      "element" : "participant",
                                      "variable" : "perf"
                                    }
                                  ],
                                  "rule" : [
                                    {
                                      "name" : "period",
                                      "source" : [
                                        {
                                          "context" : "performer"
                                        }
                                      ],
                                      "target" : [
                                        {
                                          "context" : "perf",
                                          "contextType" : "variable",
                                          "element" : "period",
                                          "variable" : "period",
                                          "transform" : "create",
                                          "parameter" : [
                                            {
                                              "valueString" : "Period"
                                            }
                                          ]
                                        }
                                      ],
                                      "rule" : [
                                        {
                                          "name" : "time",
                                          "source" : [
                                            {
                                              "context" : "performer",
                                              "element" : "time",
                                              "variable" : "time"
                                            }
                                          ],
                                          "target" : [
                                            {
                                              "context" : "period",
                                              "contextType" : "variable",
                                              "element" : "start",
                                              "variable" : "start",
                                              "transform" : "create",
                                              "parameter" : [
                                                {
                                                  "valueString" : "dateTime"
                                                }
                                              ]
                                            }
                                          ],
                                          "dependent" : [
                                            {
                                              "name" : "TSDateTime",
                                              "variable" : [
                                                "time",
                                                "start"
                                              ]
                                            }
                                          ]
                                        }
                                      ]
                                    },
                                    {
                                      "name" : "aut",
                                      "source" : [
                                        {
                                          "context" : "performer"
                                        }
                                      ],
                                      "target" : [
                                        {
                                          "context" : "perf",
                                          "contextType" : "variable",
                                          "element" : "individual",
                                          "variable" : "reference",
                                          "transform" : "create",
                                          "parameter" : [
                                            {
                                              "valueString" : "Reference"
                                            }
                                          ]
                                        },
                                        {
                                          "context" : "reference",
                                          "contextType" : "variable",
                                          "element" : "reference",
                                          "transform" : "evaluate",
                                          "parameter" : [
                                            {
                                              "valueString" : "'https://example/Practitioner/' + %practitioner.id"
                                            }
                                          ]
                                        }
                                      ]
                                    }
                                  ]
                                }
                              ]
                            }
                          ]
                        },
                        {
                          "name" : "2.16.840.1.113883.2.9.4.3.2",
                          "source" : [
                            {
                              "context" : "assEnty",
                              "element" : "id",
                              "variable" : "id",
                              "condition" : "(root = '2.16.840.1.113883.2.9.4.3.2')"
                            }
                          ],
                          "rule" : [
                            {
                              "name" : "UUID",
                              "source" : [
                                {
                                  "context" : "id",
                                  "element" : "extension",
                                  "variable" : "ext"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "request",
                                  "contextType" : "variable",
                                  "element" : "url",
                                  "transform" : "append",
                                  "parameter" : [
                                    {
                                      "valueString" : "Practitioner?identifier="
                                    },
                                    {
                                      "valueId" : "ext"
                                    }
                                  ]
                                }
                              ]
                            }
                          ]
                        },
                        {
                          "name" : "assPer",
                          "source" : [
                            {
                              "context" : "assEnty",
                              "element" : "assignedPerson",
                              "variable" : "assPers"
                            }
                          ],
                          "rule" : [
                            {
                              "name" : "name",
                              "source" : [
                                {
                                  "context" : "assPers",
                                  "element" : "name",
                                  "variable" : "vvv"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "practitioner",
                                  "contextType" : "variable",
                                  "element" : "name",
                                  "variable" : "vvv",
                                  "transform" : "create"
                                }
                              ]
                            }
                          ]
                        }
                      ],
                      "documentation" : "performer.time as ti -> note.time = (ti.value);"
                    }
                  ]
                },
                {
                  "name" : "entriRel",
                  "source" : [
                    {
                      "context" : "act",
                      "element" : "entryRelationship",
                      "variable" : "entriRel"
                    }
                  ],
                  "rule" : [
                    {
                      "name" : "enc",
                      "source" : [
                        {
                          "context" : "entriRel",
                          "element" : "encounter",
                          "variable" : "enc1"
                        }
                      ],
                      "rule" : [
                        {
                          "name" : "enc1",
                          "source" : [
                            {
                              "context" : "enc1"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "bundle",
                              "contextType" : "variable",
                              "element" : "entry",
                              "variable" : "e1"
                            },
                            {
                              "context" : "e1",
                              "contextType" : "variable",
                              "element" : "request",
                              "variable" : "request",
                              "transform" : "create",
                              "parameter" : [
                                {
                                  "valueString" : "BackboneElement"
                                }
                              ]
                            },
                            {
                              "context" : "request",
                              "contextType" : "variable",
                              "element" : "method",
                              "transform" : "copy",
                              "parameter" : [
                                {
                                  "valueString" : "POST"
                                }
                              ]
                            },
                            {
                              "context" : "e1",
                              "contextType" : "variable",
                              "element" : "resource",
                              "variable" : "encountert1",
                              "transform" : "create",
                              "parameter" : [
                                {
                                  "valueString" : "Encounter"
                                }
                              ]
                            },
                            {
                              "context" : "encountert1",
                              "contextType" : "variable",
                              "element" : "id",
                              "variable" : "uuid1",
                              "transform" : "uuid"
                            },
                            {
                              "context" : "e1",
                              "contextType" : "variable",
                              "element" : "fullUrl",
                              "transform" : "append",
                              "parameter" : [
                                {
                                  "valueString" : "https://example/Encounter/"
                                },
                                {
                                  "valueId" : "uuid1"
                                }
                              ]
                            },
                            {
                              "context" : "request",
                              "contextType" : "variable",
                              "element" : "url",
                              "transform" : "copy",
                              "parameter" : [
                                {
                                  "valueString" : "Encounter"
                                }
                              ]
                            },
                            {
                              "context" : "tgt",
                              "contextType" : "variable",
                              "element" : "entry",
                              "variable" : "reference",
                              "transform" : "create",
                              "parameter" : [
                                {
                                  "valueString" : "Reference"
                                }
                              ]
                            },
                            {
                              "context" : "reference",
                              "contextType" : "variable",
                              "element" : "reference",
                              "transform" : "evaluate",
                              "parameter" : [
                                {
                                  "valueString" : "'https://example/Encounter/' + %encountert1.id"
                                }
                              ]
                            },
                            {
                              "context" : "encountert1",
                              "contextType" : "variable",
                              "element" : "partOf",
                              "variable" : "reference",
                              "transform" : "create",
                              "parameter" : [
                                {
                                  "valueString" : "Reference"
                                }
                              ]
                            },
                            {
                              "context" : "reference",
                              "contextType" : "variable",
                              "element" : "reference",
                              "transform" : "evaluate",
                              "parameter" : [
                                {
                                  "valueString" : "'https://example/Encounter/' + encountert.id"
                                }
                              ]
                            }
                          ],
                          "rule" : [
                            {
                              "name" : "status",
                              "source" : [
                                {
                                  "context" : "enc1"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "encountert1",
                                  "contextType" : "variable",
                                  "element" : "status",
                                  "transform" : "copy",
                                  "parameter" : [
                                    {
                                      "valueString" : "finished"
                                    }
                                  ]
                                }
                              ]
                            },
                            {
                              "name" : "class",
                              "source" : [
                                {
                                  "context" : "enc1"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "encountert1",
                                  "contextType" : "variable",
                                  "element" : "class",
                                  "variable" : "cl",
                                  "transform" : "create",
                                  "parameter" : [
                                    {
                                      "valueString" : "Coding"
                                    }
                                  ]
                                }
                              ],
                              "rule" : [
                                {
                                  "name" : "code",
                                  "source" : [
                                    {
                                      "context" : "enc1"
                                    }
                                  ],
                                  "target" : [
                                    {
                                      "context" : "cl",
                                      "contextType" : "variable",
                                      "element" : "code",
                                      "transform" : "copy",
                                      "parameter" : [
                                        {
                                          "valueString" : "AMB"
                                        }
                                      ]
                                    }
                                  ]
                                },
                                {
                                  "name" : "code",
                                  "source" : [
                                    {
                                      "context" : "enc1"
                                    }
                                  ],
                                  "target" : [
                                    {
                                      "context" : "cl",
                                      "contextType" : "variable",
                                      "element" : "display",
                                      "transform" : "copy",
                                      "parameter" : [
                                        {
                                          "valueString" : "ambulatory"
                                        }
                                      ]
                                    }
                                  ]
                                }
                              ]
                            },
                            {
                              "name" : "refpatient",
                              "source" : [
                                {
                                  "context" : "enc1"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "encountert1",
                                  "contextType" : "variable",
                                  "element" : "subject",
                                  "variable" : "reference",
                                  "transform" : "create",
                                  "parameter" : [
                                    {
                                      "valueString" : "Reference"
                                    }
                                  ]
                                },
                                {
                                  "context" : "reference",
                                  "contextType" : "variable",
                                  "element" : "reference",
                                  "transform" : "evaluate",
                                  "parameter" : [
                                    {
                                      "valueString" : "'https://example/Patient/' + patient.id"
                                    }
                                  ]
                                }
                              ]
                            },
                            {
                              "name" : "id",
                              "source" : [
                                {
                                  "context" : "enc1",
                                  "element" : "id",
                                  "variable" : "vvv"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "encountert1",
                                  "contextType" : "variable",
                                  "element" : "identifier",
                                  "variable" : "vvv",
                                  "transform" : "create"
                                }
                              ]
                            },
                            {
                              "name" : "code",
                              "source" : [
                                {
                                  "context" : "enc1"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "encountert1",
                                  "contextType" : "variable",
                                  "element" : "type",
                                  "variable" : "ti",
                                  "transform" : "create",
                                  "parameter" : [
                                    {
                                      "valueString" : "CodeableConcept"
                                    }
                                  ]
                                }
                              ],
                              "rule" : [
                                {
                                  "name" : "coding",
                                  "source" : [
                                    {
                                      "context" : "enc1"
                                    }
                                  ],
                                  "target" : [
                                    {
                                      "context" : "ti",
                                      "contextType" : "variable",
                                      "element" : "coding",
                                      "variable" : "cod",
                                      "transform" : "create",
                                      "parameter" : [
                                        {
                                          "valueString" : "Coding"
                                        }
                                      ]
                                    }
                                  ],
                                  "rule" : [
                                    {
                                      "name" : "code",
                                      "source" : [
                                        {
                                          "context" : "enc1",
                                          "element" : "code",
                                          "variable" : "c"
                                        }
                                      ],
                                      "target" : [
                                        {
                                          "context" : "cod",
                                          "contextType" : "variable",
                                          "element" : "code",
                                          "transform" : "evaluate",
                                          "parameter" : [
                                            {
                                              "valueString" : "c.code"
                                            }
                                          ]
                                        }
                                      ]
                                    },
                                    {
                                      "name" : "syst",
                                      "source" : [
                                        {
                                          "context" : "enc1",
                                          "element" : "code",
                                          "variable" : "c"
                                        }
                                      ],
                                      "rule" : [
                                        {
                                          "name" : "system",
                                          "source" : [
                                            {
                                              "context" : "c",
                                              "element" : "codeSystem",
                                              "variable" : "s"
                                            }
                                          ],
                                          "target" : [
                                            {
                                              "context" : "cod",
                                              "contextType" : "variable",
                                              "element" : "system",
                                              "transform" : "translate",
                                              "parameter" : [
                                                {
                                                  "valueId" : "s"
                                                },
                                                {
                                                  "valueString" : "http://hl7.org/fhir/ConceptMap/special-oid2uri"
                                                },
                                                {
                                                  "valueString" : "uri"
                                                }
                                              ]
                                            }
                                          ]
                                        }
                                      ]
                                    },
                                    {
                                      "name" : "dispaly",
                                      "source" : [
                                        {
                                          "context" : "enc1",
                                          "element" : "code",
                                          "variable" : "c"
                                        }
                                      ],
                                      "target" : [
                                        {
                                          "context" : "cod",
                                          "contextType" : "variable",
                                          "element" : "display",
                                          "transform" : "evaluate",
                                          "parameter" : [
                                            {
                                              "valueString" : "c.displayName"
                                            }
                                          ]
                                        }
                                      ]
                                    }
                                  ]
                                },
                                {
                                  "name" : "text",
                                  "source" : [
                                    {
                                      "context" : "enc1",
                                      "element" : "text",
                                      "variable" : "tx"
                                    }
                                  ],
                                  "rule" : [
                                    {
                                      "name" : "val",
                                      "source" : [
                                        {
                                          "context" : "tx",
                                          "element" : "reference",
                                          "variable" : "ref"
                                        }
                                      ],
                                      "target" : [
                                        {
                                          "context" : "ti",
                                          "contextType" : "variable",
                                          "element" : "text",
                                          "transform" : "evaluate",
                                          "parameter" : [
                                            {
                                              "valueString" : "ref.value"
                                            }
                                          ]
                                        }
                                      ]
                                    }
                                  ]
                                }
                              ],
                              "documentation" : "enc1.code -> encountert1.type;"
                            },
                            {
                              "name" : "where",
                              "source" : [
                                {
                                  "context" : "enc1",
                                  "condition" : "effectiveTime.low.exists() or effectiveTime.high.exists()"
                                }
                              ],
                              "rule" : [
                                {
                                  "name" : "effectiveTime",
                                  "source" : [
                                    {
                                      "context" : "enc1",
                                      "element" : "effectiveTime",
                                      "variable" : "eff"
                                    }
                                  ],
                                  "target" : [
                                    {
                                      "context" : "encountert1",
                                      "contextType" : "variable",
                                      "element" : "period",
                                      "variable" : "period",
                                      "transform" : "create",
                                      "parameter" : [
                                        {
                                          "valueString" : "Period"
                                        }
                                      ]
                                    }
                                  ],
                                  "dependent" : [
                                    {
                                      "name" : "IVLTSPeriod",
                                      "variable" : [
                                        "eff",
                                        "period"
                                      ]
                                    }
                                  ]
                                }
                              ]
                            },
                            {
                              "name" : "where",
                              "source" : [
                                {
                                  "context" : "enc1",
                                  "condition" : "effectiveTime.low.exists().not() or effectiveTime.high.exists().not()"
                                }
                              ],
                              "rule" : [
                                {
                                  "name" : "efft",
                                  "source" : [
                                    {
                                      "context" : "enc1",
                                      "element" : "effectiveTime",
                                      "variable" : "effectivetime1"
                                    }
                                  ],
                                  "target" : [
                                    {
                                      "context" : "encountert1",
                                      "contextType" : "variable",
                                      "element" : "period",
                                      "variable" : "period",
                                      "transform" : "create",
                                      "parameter" : [
                                        {
                                          "valueString" : "Period"
                                        }
                                      ]
                                    }
                                  ],
                                  "rule" : [
                                    {
                                      "name" : "val",
                                      "source" : [
                                        {
                                          "context" : "effectivetime1"
                                        }
                                      ],
                                      "target" : [
                                        {
                                          "context" : "period",
                                          "contextType" : "variable",
                                          "element" : "start",
                                          "variable" : "start",
                                          "transform" : "create",
                                          "parameter" : [
                                            {
                                              "valueString" : "dateTime"
                                            }
                                          ]
                                        }
                                      ],
                                      "dependent" : [
                                        {
                                          "name" : "TSDateTime",
                                          "variable" : [
                                            "effectivetime1",
                                            "start"
                                          ]
                                        }
                                      ]
                                    }
                                  ]
                                }
                              ],
                              "documentation" : "effectiveTime = time-stamp"
                            },
                            {
                              "name" : "Location",
                              "source" : [
                                {
                                  "context" : "enc1",
                                  "element" : "participant",
                                  "variable" : "part",
                                  "condition" : "(typeCode = 'LOC')"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "bundle",
                                  "contextType" : "variable",
                                  "element" : "entry",
                                  "variable" : "e1"
                                },
                                {
                                  "context" : "e1",
                                  "contextType" : "variable",
                                  "element" : "request",
                                  "variable" : "request",
                                  "transform" : "create",
                                  "parameter" : [
                                    {
                                      "valueString" : "BackboneElement"
                                    }
                                  ]
                                },
                                {
                                  "context" : "request",
                                  "contextType" : "variable",
                                  "element" : "method",
                                  "transform" : "copy",
                                  "parameter" : [
                                    {
                                      "valueString" : "PUT"
                                    }
                                  ]
                                },
                                {
                                  "context" : "e1",
                                  "contextType" : "variable",
                                  "element" : "resource",
                                  "variable" : "location",
                                  "transform" : "create",
                                  "parameter" : [
                                    {
                                      "valueString" : "Location"
                                    }
                                  ]
                                },
                                {
                                  "context" : "location",
                                  "contextType" : "variable",
                                  "element" : "id",
                                  "variable" : "uuid1",
                                  "transform" : "uuid"
                                },
                                {
                                  "context" : "e1",
                                  "contextType" : "variable",
                                  "element" : "fullUrl",
                                  "transform" : "append",
                                  "parameter" : [
                                    {
                                      "valueString" : "https://example/Location/"
                                    },
                                    {
                                      "valueId" : "uuid1"
                                    }
                                  ]
                                },
                                {
                                  "context" : "request",
                                  "contextType" : "variable",
                                  "element" : "url",
                                  "transform" : "append",
                                  "parameter" : [
                                    {
                                      "valueString" : "Location/"
                                    },
                                    {
                                      "valueId" : "uuid1"
                                    }
                                  ]
                                }
                              ],
                              "rule" : [
                                {
                                  "name" : "meta",
                                  "source" : [
                                    {
                                      "context" : "part"
                                    }
                                  ],
                                  "target" : [
                                    {
                                      "context" : "location",
                                      "contextType" : "variable",
                                      "element" : "meta",
                                      "variable" : "meta"
                                    }
                                  ],
                                  "rule" : [
                                    {
                                      "name" : "coding",
                                      "source" : [
                                        {
                                          "context" : "part"
                                        }
                                      ],
                                      "target" : [
                                        {
                                          "context" : "meta",
                                          "contextType" : "variable",
                                          "element" : "tag",
                                          "variable" : "coding",
                                          "transform" : "create",
                                          "parameter" : [
                                            {
                                              "valueString" : "Coding"
                                            }
                                          ]
                                        }
                                      ],
                                      "rule" : [
                                        {
                                          "name" : "system",
                                          "source" : [
                                            {
                                              "context" : "part"
                                            }
                                          ],
                                          "target" : [
                                            {
                                              "context" : "coding",
                                              "contextType" : "variable",
                                              "element" : "system",
                                              "transform" : "copy",
                                              "parameter" : [
                                                {
                                                  "valueString" : "http://algoritmodiscoring"
                                                }
                                              ]
                                            }
                                          ]
                                        },
                                        {
                                          "name" : "code",
                                          "source" : [
                                            {
                                              "context" : "part"
                                            }
                                          ],
                                          "target" : [
                                            {
                                              "context" : "coding",
                                              "contextType" : "variable",
                                              "element" : "code",
                                              "transform" : "copy",
                                              "parameter" : [
                                                {
                                                  "valueString" : "ClinicalDocument/body/Dimissione/participant"
                                                }
                                              ]
                                            }
                                          ]
                                        }
                                      ]
                                    }
                                  ]
                                },
                                {
                                  "name" : "location1",
                                  "source" : [
                                    {
                                      "context" : "part",
                                      "element" : "time",
                                      "variable" : "tim"
                                    }
                                  ],
                                  "target" : [
                                    {
                                      "context" : "encountert1",
                                      "contextType" : "variable",
                                      "element" : "location",
                                      "variable" : "locat"
                                    }
                                  ],
                                  "rule" : [
                                    {
                                      "name" : "time",
                                      "source" : [
                                        {
                                          "context" : "tim"
                                        }
                                      ],
                                      "target" : [
                                        {
                                          "context" : "locat",
                                          "contextType" : "variable",
                                          "element" : "period",
                                          "variable" : "period",
                                          "transform" : "create",
                                          "parameter" : [
                                            {
                                              "valueString" : "Period"
                                            }
                                          ]
                                        }
                                      ],
                                      "dependent" : [
                                        {
                                          "name" : "IVLTSPeriod",
                                          "variable" : [
                                            "tim",
                                            "period"
                                          ]
                                        }
                                      ]
                                    },
                                    {
                                      "name" : "time",
                                      "source" : [
                                        {
                                          "context" : "part",
                                          "element" : "time",
                                          "variable" : "tim"
                                        }
                                      ],
                                      "target" : [
                                        {
                                          "context" : "locat",
                                          "contextType" : "variable",
                                          "element" : "period",
                                          "variable" : "period",
                                          "transform" : "create",
                                          "parameter" : [
                                            {
                                              "valueString" : "Period"
                                            }
                                          ]
                                        }
                                      ],
                                      "rule" : [
                                        {
                                          "name" : "val",
                                          "source" : [
                                            {
                                              "context" : "tim"
                                            }
                                          ],
                                          "target" : [
                                            {
                                              "context" : "period",
                                              "contextType" : "variable",
                                              "element" : "start",
                                              "variable" : "start",
                                              "transform" : "create",
                                              "parameter" : [
                                                {
                                                  "valueString" : "dateTime"
                                                }
                                              ]
                                            }
                                          ],
                                          "dependent" : [
                                            {
                                              "name" : "TSDateTime",
                                              "variable" : [
                                                "tim",
                                                "start"
                                              ]
                                            }
                                          ]
                                        }
                                      ]
                                    },
                                    {
                                      "name" : "partRole",
                                      "source" : [
                                        {
                                          "context" : "part",
                                          "element" : "participantRole",
                                          "variable" : "partRole"
                                        }
                                      ],
                                      "rule" : [
                                        {
                                          "name" : "identifier",
                                          "source" : [
                                            {
                                              "context" : "partRole",
                                              "element" : "id",
                                              "variable" : "id"
                                            }
                                          ],
                                          "target" : [
                                            {
                                              "context" : "location",
                                              "contextType" : "variable",
                                              "element" : "identifier",
                                              "variable" : "identifier"
                                            }
                                          ],
                                          "rule" : [
                                            {
                                              "name" : "root1",
                                              "source" : [
                                                {
                                                  "context" : "id",
                                                  "element" : "root",
                                                  "variable" : "r"
                                                }
                                              ],
                                              "target" : [
                                                {
                                                  "context" : "identifier",
                                                  "contextType" : "variable",
                                                  "element" : "system",
                                                  "transform" : "translate",
                                                  "parameter" : [
                                                    {
                                                      "valueId" : "r"
                                                    },
                                                    {
                                                      "valueString" : "http://hl7.org/fhir/ConceptMap/special-oid2uri"
                                                    },
                                                    {
                                                      "valueString" : "uri"
                                                    }
                                                  ]
                                                }
                                              ]
                                            },
                                            {
                                              "name" : "ext",
                                              "source" : [
                                                {
                                                  "context" : "id",
                                                  "element" : "extension",
                                                  "variable" : "ext"
                                                }
                                              ],
                                              "target" : [
                                                {
                                                  "context" : "identifier",
                                                  "contextType" : "variable",
                                                  "element" : "value",
                                                  "transform" : "copy",
                                                  "parameter" : [
                                                    {
                                                      "valueId" : "ext"
                                                    }
                                                  ]
                                                }
                                              ],
                                              "rule" : [
                                                {
                                                  "name" : "UUID",
                                                  "source" : [
                                                    {
                                                      "context" : "partRole"
                                                    }
                                                  ],
                                                  "target" : [
                                                    {
                                                      "context" : "request",
                                                      "contextType" : "variable",
                                                      "element" : "url",
                                                      "transform" : "append",
                                                      "parameter" : [
                                                        {
                                                          "valueString" : "Location?identifier="
                                                        },
                                                        {
                                                          "valueId" : "ext"
                                                        }
                                                      ]
                                                    }
                                                  ]
                                                }
                                              ]
                                            },
                                            {
                                              "name" : "assigningAuthorityName",
                                              "source" : [
                                                {
                                                  "context" : "id",
                                                  "element" : "assigningAuthorityName",
                                                  "variable" : "s"
                                                }
                                              ],
                                              "target" : [
                                                {
                                                  "context" : "identifier",
                                                  "contextType" : "variable",
                                                  "element" : "assigner",
                                                  "variable" : "a"
                                                },
                                                {
                                                  "context" : "a",
                                                  "contextType" : "variable",
                                                  "element" : "display",
                                                  "transform" : "copy",
                                                  "parameter" : [
                                                    {
                                                      "valueId" : "s"
                                                    }
                                                  ]
                                                }
                                              ]
                                            },
                                            {
                                              "name" : "r",
                                              "source" : [
                                                {
                                                  "context" : "id",
                                                  "element" : "root",
                                                  "variable" : "r"
                                                }
                                              ],
                                              "rule" : [
                                                {
                                                  "name" : "idasi",
                                                  "source" : [
                                                    {
                                                      "context" : "id",
                                                      "element" : "extension",
                                                      "variable" : "ext"
                                                    }
                                                  ],
                                                  "target" : [
                                                    {
                                                      "context" : "location",
                                                      "contextType" : "variable",
                                                      "element" : "id",
                                                      "variable" : "uuid",
                                                      "transform" : "evaluate",
                                                      "parameter" : [
                                                        {
                                                          "valueString" : "r + '-' + ext"
                                                        }
                                                      ]
                                                    },
                                                    {
                                                      "context" : "e1",
                                                      "contextType" : "variable",
                                                      "element" : "fullUrl",
                                                      "transform" : "append",
                                                      "parameter" : [
                                                        {
                                                          "valueString" : "https://example/Location/"
                                                        },
                                                        {
                                                          "valueId" : "uuid"
                                                        }
                                                      ]
                                                    },
                                                    {
                                                      "context" : "locat",
                                                      "contextType" : "variable",
                                                      "element" : "location",
                                                      "variable" : "reference",
                                                      "transform" : "create",
                                                      "parameter" : [
                                                        {
                                                          "valueString" : "Reference"
                                                        }
                                                      ]
                                                    },
                                                    {
                                                      "context" : "reference",
                                                      "contextType" : "variable",
                                                      "element" : "reference",
                                                      "transform" : "evaluate",
                                                      "parameter" : [
                                                        {
                                                          "valueString" : "'https://example/Location/' + %location.id"
                                                        }
                                                      ]
                                                    }
                                                  ]
                                                }
                                              ]
                                            }
                                          ]
                                        },
                                        {
                                          "name" : "code",
                                          "source" : [
                                            {
                                              "context" : "partRole",
                                              "element" : "code",
                                              "variable" : "vvv"
                                            }
                                          ],
                                          "target" : [
                                            {
                                              "context" : "location",
                                              "contextType" : "variable",
                                              "element" : "type",
                                              "variable" : "vvv",
                                              "transform" : "create"
                                            }
                                          ],
                                          "documentation" : "partRole.id -> location.identifier;"
                                        }
                                      ]
                                    }
                                  ]
                                }
                              ]
                            },
                            {
                              "name" : "entryrel2",
                              "source" : [
                                {
                                  "context" : "enc1",
                                  "element" : "entryRelationship",
                                  "variable" : "entryrel2"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "bundle",
                                  "contextType" : "variable",
                                  "element" : "entry",
                                  "variable" : "e1"
                                },
                                {
                                  "context" : "e1",
                                  "contextType" : "variable",
                                  "element" : "request",
                                  "variable" : "request",
                                  "transform" : "create",
                                  "parameter" : [
                                    {
                                      "valueString" : "BackboneElement"
                                    }
                                  ]
                                },
                                {
                                  "context" : "request",
                                  "contextType" : "variable",
                                  "element" : "method",
                                  "transform" : "copy",
                                  "parameter" : [
                                    {
                                      "valueString" : "POST"
                                    }
                                  ]
                                },
                                {
                                  "context" : "e1",
                                  "contextType" : "variable",
                                  "element" : "resource",
                                  "variable" : "observation",
                                  "transform" : "create",
                                  "parameter" : [
                                    {
                                      "valueString" : "Observation"
                                    }
                                  ]
                                },
                                {
                                  "context" : "observation",
                                  "contextType" : "variable",
                                  "element" : "id",
                                  "variable" : "uuid1",
                                  "transform" : "uuid"
                                },
                                {
                                  "context" : "e1",
                                  "contextType" : "variable",
                                  "element" : "fullUrl",
                                  "transform" : "append",
                                  "parameter" : [
                                    {
                                      "valueString" : "https://example/Observation/"
                                    },
                                    {
                                      "valueId" : "uuid1"
                                    }
                                  ]
                                },
                                {
                                  "context" : "request",
                                  "contextType" : "variable",
                                  "element" : "url",
                                  "transform" : "copy",
                                  "parameter" : [
                                    {
                                      "valueString" : "Observation"
                                    }
                                  ]
                                },
                                {
                                  "context" : "encountert1",
                                  "contextType" : "variable",
                                  "element" : "reasonReference",
                                  "variable" : "reference",
                                  "transform" : "create",
                                  "parameter" : [
                                    {
                                      "valueString" : "BackboneElement"
                                    }
                                  ]
                                },
                                {
                                  "context" : "reference",
                                  "contextType" : "variable",
                                  "element" : "reference",
                                  "transform" : "evaluate",
                                  "parameter" : [
                                    {
                                      "valueString" : "'https://example/Observation/' + %observation.id"
                                    }
                                  ]
                                }
                              ],
                              "rule" : [
                                {
                                  "name" : "obs",
                                  "source" : [
                                    {
                                      "context" : "entryrel2",
                                      "element" : "observation",
                                      "variable" : "obs"
                                    }
                                  ],
                                  "rule" : [
                                    {
                                      "name" : "reference",
                                      "source" : [
                                        {
                                          "context" : "obs"
                                        }
                                      ],
                                      "target" : [
                                        {
                                          "context" : "observation",
                                          "contextType" : "variable",
                                          "element" : "subject",
                                          "variable" : "reference",
                                          "transform" : "create",
                                          "parameter" : [
                                            {
                                              "valueString" : "Reference"
                                            }
                                          ]
                                        },
                                        {
                                          "context" : "reference",
                                          "contextType" : "variable",
                                          "element" : "reference",
                                          "transform" : "evaluate",
                                          "parameter" : [
                                            {
                                              "valueString" : "'https://example/Patient/' + %patient.id"
                                            }
                                          ]
                                        }
                                      ]
                                    },
                                    {
                                      "name" : "reference",
                                      "source" : [
                                        {
                                          "context" : "obs"
                                        }
                                      ],
                                      "target" : [
                                        {
                                          "context" : "observation",
                                          "contextType" : "variable",
                                          "element" : "encounter",
                                          "variable" : "reference",
                                          "transform" : "create",
                                          "parameter" : [
                                            {
                                              "valueString" : "Reference"
                                            }
                                          ]
                                        },
                                        {
                                          "context" : "reference",
                                          "contextType" : "variable",
                                          "element" : "reference",
                                          "transform" : "evaluate",
                                          "parameter" : [
                                            {
                                              "valueString" : "'https://example/Encounter/' + %encountert1.id"
                                            }
                                          ]
                                        }
                                      ]
                                    },
                                    {
                                      "name" : "code",
                                      "source" : [
                                        {
                                          "context" : "obs",
                                          "element" : "code",
                                          "variable" : "vvv"
                                        }
                                      ],
                                      "target" : [
                                        {
                                          "context" : "observation",
                                          "contextType" : "variable",
                                          "element" : "code",
                                          "variable" : "vvv",
                                          "transform" : "create"
                                        }
                                      ]
                                    },
                                    {
                                      "name" : "statusCode",
                                      "source" : [
                                        {
                                          "context" : "obs",
                                          "element" : "statusCode",
                                          "variable" : "statusc",
                                          "condition" : "(code = 'completed')"
                                        }
                                      ],
                                      "target" : [
                                        {
                                          "context" : "observation",
                                          "contextType" : "variable",
                                          "element" : "status",
                                          "transform" : "copy",
                                          "parameter" : [
                                            {
                                              "valueString" : "final"
                                            }
                                          ]
                                        }
                                      ]
                                    },
                                    {
                                      "name" : "statusCode",
                                      "source" : [
                                        {
                                          "context" : "obs",
                                          "element" : "statusCode",
                                          "variable" : "statusc",
                                          "condition" : "(code = 'active')"
                                        }
                                      ],
                                      "target" : [
                                        {
                                          "context" : "observation",
                                          "contextType" : "variable",
                                          "element" : "status",
                                          "transform" : "copy",
                                          "parameter" : [
                                            {
                                              "valueString" : "registered"
                                            }
                                          ]
                                        }
                                      ]
                                    },
                                    {
                                      "name" : "statusCode",
                                      "source" : [
                                        {
                                          "context" : "obs",
                                          "element" : "statusCode",
                                          "variable" : "statusc",
                                          "condition" : "(code = 'aborted')"
                                        }
                                      ],
                                      "target" : [
                                        {
                                          "context" : "observation",
                                          "contextType" : "variable",
                                          "element" : "status",
                                          "transform" : "copy",
                                          "parameter" : [
                                            {
                                              "valueString" : "cancelled"
                                            }
                                          ]
                                        }
                                      ]
                                    },
                                    {
                                      "name" : "statusCode",
                                      "source" : [
                                        {
                                          "context" : "obs",
                                          "element" : "statusCode",
                                          "variable" : "statusc",
                                          "condition" : "(code = 'suspended')"
                                        }
                                      ],
                                      "target" : [
                                        {
                                          "context" : "observation",
                                          "contextType" : "variable",
                                          "element" : "status",
                                          "transform" : "copy",
                                          "parameter" : [
                                            {
                                              "valueString" : "partial"
                                            }
                                          ]
                                        }
                                      ]
                                    },
                                    {
                                      "name" : "notpresent",
                                      "source" : [
                                        {
                                          "context" : "obs"
                                        }
                                      ],
                                      "target" : [
                                        {
                                          "context" : "observation",
                                          "contextType" : "variable",
                                          "element" : "status",
                                          "transform" : "copy",
                                          "parameter" : [
                                            {
                                              "valueString" : "final"
                                            }
                                          ]
                                        }
                                      ]
                                    },
                                    {
                                      "name" : "value2",
                                      "source" : [
                                        {
                                          "context" : "obs",
                                          "element" : "effectiveTime",
                                          "variable" : "effectiveTime"
                                        }
                                      ],
                                      "target" : [
                                        {
                                          "context" : "observation",
                                          "contextType" : "variable",
                                          "element" : "effective",
                                          "variable" : "value",
                                          "transform" : "create",
                                          "parameter" : [
                                            {
                                              "valueString" : "dateTime"
                                            }
                                          ]
                                        }
                                      ],
                                      "dependent" : [
                                        {
                                          "name" : "TSDateTime",
                                          "variable" : [
                                            "effectiveTime",
                                            "value"
                                          ]
                                        }
                                      ]
                                    },
                                    {
                                      "name" : "where",
                                      "source" : [
                                        {
                                          "context" : "obs",
                                          "condition" : "effectiveTime.low.exists() or effectiveTime.high.exists()"
                                        }
                                      ],
                                      "rule" : [
                                        {
                                          "name" : "effectiveTime",
                                          "source" : [
                                            {
                                              "context" : "obs",
                                              "element" : "effectiveTime",
                                              "variable" : "eff"
                                            }
                                          ],
                                          "target" : [
                                            {
                                              "context" : "observation",
                                              "contextType" : "variable",
                                              "element" : "effective",
                                              "variable" : "period",
                                              "transform" : "create",
                                              "parameter" : [
                                                {
                                                  "valueString" : "Period"
                                                }
                                              ]
                                            }
                                          ],
                                          "dependent" : [
                                            {
                                              "name" : "IVLTSPeriod",
                                              "variable" : [
                                                "eff",
                                                "period"
                                              ]
                                            }
                                          ]
                                        }
                                      ]
                                    },
                                    {
                                      "name" : "value",
                                      "source" : [
                                        {
                                          "context" : "obs",
                                          "type" : "INT",
                                          "element" : "value",
                                          "variable" : "int"
                                        }
                                      ],
                                      "target" : [
                                        {
                                          "context" : "observation",
                                          "contextType" : "variable",
                                          "element" : "value",
                                          "transform" : "evaluate",
                                          "parameter" : [
                                            {
                                              "valueString" : "int.value"
                                            }
                                          ]
                                        }
                                      ]
                                    },
                                    {
                                      "name" : "boolean",
                                      "source" : [
                                        {
                                          "context" : "obs",
                                          "type" : "BL",
                                          "element" : "value",
                                          "variable" : "boolean"
                                        }
                                      ],
                                      "target" : [
                                        {
                                          "context" : "observation",
                                          "contextType" : "variable",
                                          "element" : "value",
                                          "transform" : "evaluate",
                                          "parameter" : [
                                            {
                                              "valueString" : "boolean.value"
                                            }
                                          ]
                                        }
                                      ]
                                    },
                                    {
                                      "name" : "val",
                                      "source" : [
                                        {
                                          "context" : "obs",
                                          "type" : "CE",
                                          "element" : "value",
                                          "variable" : "val"
                                        }
                                      ],
                                      "rule" : [
                                        {
                                          "name" : "coding",
                                          "source" : [
                                            {
                                              "context" : "val"
                                            }
                                          ],
                                          "target" : [
                                            {
                                              "context" : "observation",
                                              "contextType" : "variable",
                                              "element" : "value",
                                              "variable" : "ce",
                                              "transform" : "create",
                                              "parameter" : [
                                                {
                                                  "valueString" : "CodeableConcept"
                                                }
                                              ]
                                            }
                                          ],
                                          "rule" : [
                                            {
                                              "name" : "originltext",
                                              "source" : [
                                                {
                                                  "context" : "val",
                                                  "element" : "originalText",
                                                  "variable" : "originalText"
                                                }
                                              ],
                                              "rule" : [
                                                {
                                                  "name" : "reference",
                                                  "source" : [
                                                    {
                                                      "context" : "originalText",
                                                      "element" : "reference",
                                                      "variable" : "reference"
                                                    }
                                                  ],
                                                  "target" : [
                                                    {
                                                      "context" : "ce",
                                                      "contextType" : "variable",
                                                      "element" : "text",
                                                      "transform" : "copy",
                                                      "parameter" : [
                                                        {
                                                          "valueId" : "reference"
                                                        }
                                                      ]
                                                    }
                                                  ]
                                                }
                                              ]
                                            },
                                            {
                                              "name" : "code",
                                              "source" : [
                                                {
                                                  "context" : "val"
                                                }
                                              ],
                                              "target" : [
                                                {
                                                  "context" : "ce",
                                                  "contextType" : "variable",
                                                  "element" : "coding",
                                                  "variable" : "coding"
                                                }
                                              ],
                                              "rule" : [
                                                {
                                                  "name" : "code",
                                                  "source" : [
                                                    {
                                                      "context" : "val",
                                                      "element" : "code",
                                                      "variable" : "code"
                                                    }
                                                  ],
                                                  "target" : [
                                                    {
                                                      "context" : "coding",
                                                      "contextType" : "variable",
                                                      "element" : "code",
                                                      "transform" : "cast",
                                                      "parameter" : [
                                                        {
                                                          "valueId" : "code"
                                                        },
                                                        {
                                                          "valueString" : "string"
                                                        }
                                                      ]
                                                    }
                                                  ]
                                                },
                                                {
                                                  "name" : "codeSystem",
                                                  "source" : [
                                                    {
                                                      "context" : "val",
                                                      "element" : "codeSystem",
                                                      "variable" : "system"
                                                    }
                                                  ],
                                                  "target" : [
                                                    {
                                                      "context" : "coding",
                                                      "contextType" : "variable",
                                                      "element" : "system",
                                                      "transform" : "translate",
                                                      "parameter" : [
                                                        {
                                                          "valueId" : "system"
                                                        },
                                                        {
                                                          "valueString" : "http://hl7.org/fhir/ConceptMap/special-oid2uri"
                                                        },
                                                        {
                                                          "valueString" : "uri"
                                                        }
                                                      ]
                                                    }
                                                  ]
                                                },
                                                {
                                                  "name" : "displayName",
                                                  "source" : [
                                                    {
                                                      "context" : "val",
                                                      "element" : "displayName",
                                                      "variable" : "display"
                                                    }
                                                  ],
                                                  "target" : [
                                                    {
                                                      "context" : "coding",
                                                      "contextType" : "variable",
                                                      "element" : "display",
                                                      "transform" : "cast",
                                                      "parameter" : [
                                                        {
                                                          "valueId" : "display"
                                                        },
                                                        {
                                                          "valueString" : "string"
                                                        }
                                                      ]
                                                    }
                                                  ]
                                                },
                                                {
                                                  "name" : "codeSystemVersion",
                                                  "source" : [
                                                    {
                                                      "context" : "val",
                                                      "element" : "codeSystemVersion",
                                                      "variable" : "version"
                                                    }
                                                  ],
                                                  "target" : [
                                                    {
                                                      "context" : "coding",
                                                      "contextType" : "variable",
                                                      "element" : "version",
                                                      "transform" : "cast",
                                                      "parameter" : [
                                                        {
                                                          "valueId" : "version"
                                                        },
                                                        {
                                                          "valueString" : "string"
                                                        }
                                                      ]
                                                    }
                                                  ]
                                                }
                                              ]
                                            },
                                            {
                                              "name" : "translation",
                                              "source" : [
                                                {
                                                  "context" : "val",
                                                  "element" : "translation",
                                                  "variable" : "translation"
                                                }
                                              ],
                                              "target" : [
                                                {
                                                  "context" : "ce",
                                                  "contextType" : "variable",
                                                  "element" : "coding",
                                                  "variable" : "coding"
                                                }
                                              ],
                                              "rule" : [
                                                {
                                                  "name" : "code",
                                                  "source" : [
                                                    {
                                                      "context" : "translation",
                                                      "element" : "code",
                                                      "variable" : "code"
                                                    }
                                                  ],
                                                  "target" : [
                                                    {
                                                      "context" : "coding",
                                                      "contextType" : "variable",
                                                      "element" : "code",
                                                      "transform" : "cast",
                                                      "parameter" : [
                                                        {
                                                          "valueId" : "code"
                                                        },
                                                        {
                                                          "valueString" : "string"
                                                        }
                                                      ]
                                                    }
                                                  ]
                                                },
                                                {
                                                  "name" : "codeSystem",
                                                  "source" : [
                                                    {
                                                      "context" : "translation",
                                                      "element" : "codeSystem",
                                                      "variable" : "system"
                                                    }
                                                  ],
                                                  "target" : [
                                                    {
                                                      "context" : "coding",
                                                      "contextType" : "variable",
                                                      "element" : "system",
                                                      "transform" : "translate",
                                                      "parameter" : [
                                                        {
                                                          "valueId" : "system"
                                                        },
                                                        {
                                                          "valueString" : "http://hl7.org/fhir/ConceptMap/special-oid2uri"
                                                        },
                                                        {
                                                          "valueString" : "uri"
                                                        }
                                                      ]
                                                    }
                                                  ]
                                                },
                                                {
                                                  "name" : "displayName",
                                                  "source" : [
                                                    {
                                                      "context" : "translation",
                                                      "element" : "displayName",
                                                      "variable" : "display"
                                                    }
                                                  ],
                                                  "target" : [
                                                    {
                                                      "context" : "coding",
                                                      "contextType" : "variable",
                                                      "element" : "display",
                                                      "transform" : "cast",
                                                      "parameter" : [
                                                        {
                                                          "valueId" : "display"
                                                        },
                                                        {
                                                          "valueString" : "string"
                                                        }
                                                      ]
                                                    }
                                                  ]
                                                },
                                                {
                                                  "name" : "codeSystemVersion",
                                                  "source" : [
                                                    {
                                                      "context" : "translation",
                                                      "element" : "codeSystemVersion",
                                                      "variable" : "version"
                                                    }
                                                  ],
                                                  "target" : [
                                                    {
                                                      "context" : "coding",
                                                      "contextType" : "variable",
                                                      "element" : "version",
                                                      "transform" : "cast",
                                                      "parameter" : [
                                                        {
                                                          "valueId" : "version"
                                                        },
                                                        {
                                                          "valueString" : "string"
                                                        }
                                                      ]
                                                    }
                                                  ]
                                                },
                                                {
                                                  "name" : "qualifier",
                                                  "source" : [
                                                    {
                                                      "context" : "translation",
                                                      "element" : "qualifier",
                                                      "variable" : "qualifier"
                                                    }
                                                  ],
                                                  "rule" : [
                                                    {
                                                      "name" : "value",
                                                      "source" : [
                                                        {
                                                          "context" : "qualifier",
                                                          "element" : "value",
                                                          "variable" : "value"
                                                        }
                                                      ],
                                                      "target" : [
                                                        {
                                                          "context" : "ce",
                                                          "contextType" : "variable",
                                                          "element" : "coding",
                                                          "variable" : "coding"
                                                        }
                                                      ],
                                                      "rule" : [
                                                        {
                                                          "name" : "code",
                                                          "source" : [
                                                            {
                                                              "context" : "value",
                                                              "element" : "code",
                                                              "variable" : "code"
                                                            }
                                                          ],
                                                          "target" : [
                                                            {
                                                              "context" : "coding",
                                                              "contextType" : "variable",
                                                              "element" : "code",
                                                              "transform" : "cast",
                                                              "parameter" : [
                                                                {
                                                                  "valueId" : "code"
                                                                },
                                                                {
                                                                  "valueString" : "string"
                                                                }
                                                              ]
                                                            }
                                                          ]
                                                        },
                                                        {
                                                          "name" : "codeSystem",
                                                          "source" : [
                                                            {
                                                              "context" : "value",
                                                              "element" : "codeSystem",
                                                              "variable" : "system"
                                                            }
                                                          ],
                                                          "target" : [
                                                            {
                                                              "context" : "coding",
                                                              "contextType" : "variable",
                                                              "element" : "system",
                                                              "transform" : "translate",
                                                              "parameter" : [
                                                                {
                                                                  "valueId" : "system"
                                                                },
                                                                {
                                                                  "valueString" : "http://hl7.org/fhir/ConceptMap/special-oid2uri"
                                                                },
                                                                {
                                                                  "valueString" : "uri"
                                                                }
                                                              ]
                                                            }
                                                          ]
                                                        },
                                                        {
                                                          "name" : "displayName",
                                                          "source" : [
                                                            {
                                                              "context" : "value",
                                                              "element" : "displayName",
                                                              "variable" : "display"
                                                            }
                                                          ],
                                                          "target" : [
                                                            {
                                                              "context" : "coding",
                                                              "contextType" : "variable",
                                                              "element" : "display",
                                                              "transform" : "cast",
                                                              "parameter" : [
                                                                {
                                                                  "valueId" : "display"
                                                                },
                                                                {
                                                                  "valueString" : "string"
                                                                }
                                                              ]
                                                            }
                                                          ]
                                                        },
                                                        {
                                                          "name" : "codeSystemVersion",
                                                          "source" : [
                                                            {
                                                              "context" : "value",
                                                              "element" : "codeSystemVersion",
                                                              "variable" : "version"
                                                            }
                                                          ],
                                                          "target" : [
                                                            {
                                                              "context" : "coding",
                                                              "contextType" : "variable",
                                                              "element" : "version",
                                                              "transform" : "cast",
                                                              "parameter" : [
                                                                {
                                                                  "valueId" : "version"
                                                                },
                                                                {
                                                                  "valueString" : "string"
                                                                }
                                                              ]
                                                            }
                                                          ]
                                                        }
                                                      ]
                                                    }
                                                  ]
                                                }
                                              ]
                                            }
                                          ]
                                        }
                                      ]
                                    },
                                    {
                                      "name" : "val",
                                      "source" : [
                                        {
                                          "context" : "obs",
                                          "type" : "CD",
                                          "element" : "value",
                                          "variable" : "val"
                                        }
                                      ],
                                      "rule" : [
                                        {
                                          "name" : "coding",
                                          "source" : [
                                            {
                                              "context" : "val"
                                            }
                                          ],
                                          "target" : [
                                            {
                                              "context" : "observation",
                                              "contextType" : "variable",
                                              "element" : "value",
                                              "variable" : "ce",
                                              "transform" : "create",
                                              "parameter" : [
                                                {
                                                  "valueString" : "CodeableConcept"
                                                }
                                              ]
                                            }
                                          ],
                                          "rule" : [
                                            {
                                              "name" : "originltext",
                                              "source" : [
                                                {
                                                  "context" : "val",
                                                  "element" : "originalText",
                                                  "variable" : "originalText"
                                                }
                                              ],
                                              "rule" : [
                                                {
                                                  "name" : "reference",
                                                  "source" : [
                                                    {
                                                      "context" : "originalText",
                                                      "element" : "reference",
                                                      "variable" : "reference"
                                                    }
                                                  ],
                                                  "target" : [
                                                    {
                                                      "context" : "ce",
                                                      "contextType" : "variable",
                                                      "element" : "text",
                                                      "transform" : "copy",
                                                      "parameter" : [
                                                        {
                                                          "valueId" : "reference"
                                                        }
                                                      ]
                                                    }
                                                  ]
                                                }
                                              ]
                                            },
                                            {
                                              "name" : "code",
                                              "source" : [
                                                {
                                                  "context" : "val"
                                                }
                                              ],
                                              "target" : [
                                                {
                                                  "context" : "ce",
                                                  "contextType" : "variable",
                                                  "element" : "coding",
                                                  "variable" : "coding"
                                                }
                                              ],
                                              "rule" : [
                                                {
                                                  "name" : "code",
                                                  "source" : [
                                                    {
                                                      "context" : "val",
                                                      "element" : "code",
                                                      "variable" : "code"
                                                    }
                                                  ],
                                                  "target" : [
                                                    {
                                                      "context" : "coding",
                                                      "contextType" : "variable",
                                                      "element" : "code",
                                                      "transform" : "cast",
                                                      "parameter" : [
                                                        {
                                                          "valueId" : "code"
                                                        },
                                                        {
                                                          "valueString" : "string"
                                                        }
                                                      ]
                                                    }
                                                  ]
                                                },
                                                {
                                                  "name" : "codeSystem",
                                                  "source" : [
                                                    {
                                                      "context" : "val",
                                                      "element" : "codeSystem",
                                                      "variable" : "system"
                                                    }
                                                  ],
                                                  "target" : [
                                                    {
                                                      "context" : "coding",
                                                      "contextType" : "variable",
                                                      "element" : "system",
                                                      "transform" : "translate",
                                                      "parameter" : [
                                                        {
                                                          "valueId" : "system"
                                                        },
                                                        {
                                                          "valueString" : "http://hl7.org/fhir/ConceptMap/special-oid2uri"
                                                        },
                                                        {
                                                          "valueString" : "uri"
                                                        }
                                                      ]
                                                    }
                                                  ]
                                                },
                                                {
                                                  "name" : "displayName",
                                                  "source" : [
                                                    {
                                                      "context" : "val",
                                                      "element" : "displayName",
                                                      "variable" : "display"
                                                    }
                                                  ],
                                                  "target" : [
                                                    {
                                                      "context" : "coding",
                                                      "contextType" : "variable",
                                                      "element" : "display",
                                                      "transform" : "cast",
                                                      "parameter" : [
                                                        {
                                                          "valueId" : "display"
                                                        },
                                                        {
                                                          "valueString" : "string"
                                                        }
                                                      ]
                                                    }
                                                  ]
                                                },
                                                {
                                                  "name" : "codeSystemVersion",
                                                  "source" : [
                                                    {
                                                      "context" : "val",
                                                      "element" : "codeSystemVersion",
                                                      "variable" : "version"
                                                    }
                                                  ],
                                                  "target" : [
                                                    {
                                                      "context" : "coding",
                                                      "contextType" : "variable",
                                                      "element" : "version",
                                                      "transform" : "cast",
                                                      "parameter" : [
                                                        {
                                                          "valueId" : "version"
                                                        },
                                                        {
                                                          "valueString" : "string"
                                                        }
                                                      ]
                                                    }
                                                  ]
                                                }
                                              ]
                                            },
                                            {
                                              "name" : "translation",
                                              "source" : [
                                                {
                                                  "context" : "val",
                                                  "element" : "translation",
                                                  "variable" : "translation"
                                                }
                                              ],
                                              "target" : [
                                                {
                                                  "context" : "ce",
                                                  "contextType" : "variable",
                                                  "element" : "coding",
                                                  "variable" : "coding"
                                                }
                                              ],
                                              "rule" : [
                                                {
                                                  "name" : "code",
                                                  "source" : [
                                                    {
                                                      "context" : "translation",
                                                      "element" : "code",
                                                      "variable" : "code"
                                                    }
                                                  ],
                                                  "target" : [
                                                    {
                                                      "context" : "coding",
                                                      "contextType" : "variable",
                                                      "element" : "code",
                                                      "transform" : "cast",
                                                      "parameter" : [
                                                        {
                                                          "valueId" : "code"
                                                        },
                                                        {
                                                          "valueString" : "string"
                                                        }
                                                      ]
                                                    }
                                                  ]
                                                },
                                                {
                                                  "name" : "codeSystem",
                                                  "source" : [
                                                    {
                                                      "context" : "translation",
                                                      "element" : "codeSystem",
                                                      "variable" : "system"
                                                    }
                                                  ],
                                                  "target" : [
                                                    {
                                                      "context" : "coding",
                                                      "contextType" : "variable",
                                                      "element" : "system",
                                                      "transform" : "translate",
                                                      "parameter" : [
                                                        {
                                                          "valueId" : "system"
                                                        },
                                                        {
                                                          "valueString" : "http://hl7.org/fhir/ConceptMap/special-oid2uri"
                                                        },
                                                        {
                                                          "valueString" : "uri"
                                                        }
                                                      ]
                                                    }
                                                  ]
                                                },
                                                {
                                                  "name" : "displayName",
                                                  "source" : [
                                                    {
                                                      "context" : "translation",
                                                      "element" : "displayName",
                                                      "variable" : "display"
                                                    }
                                                  ],
                                                  "target" : [
                                                    {
                                                      "context" : "coding",
                                                      "contextType" : "variable",
                                                      "element" : "display",
                                                      "transform" : "cast",
                                                      "parameter" : [
                                                        {
                                                          "valueId" : "display"
                                                        },
                                                        {
                                                          "valueString" : "string"
                                                        }
                                                      ]
                                                    }
                                                  ]
                                                },
                                                {
                                                  "name" : "codeSystemVersion",
                                                  "source" : [
                                                    {
                                                      "context" : "translation",
                                                      "element" : "codeSystemVersion",
                                                      "variable" : "version"
                                                    }
                                                  ],
                                                  "target" : [
                                                    {
                                                      "context" : "coding",
                                                      "contextType" : "variable",
                                                      "element" : "version",
                                                      "transform" : "cast",
                                                      "parameter" : [
                                                        {
                                                          "valueId" : "version"
                                                        },
                                                        {
                                                          "valueString" : "string"
                                                        }
                                                      ]
                                                    }
                                                  ]
                                                },
                                                {
                                                  "name" : "qualifier",
                                                  "source" : [
                                                    {
                                                      "context" : "translation",
                                                      "element" : "qualifier",
                                                      "variable" : "qualifier"
                                                    }
                                                  ],
                                                  "rule" : [
                                                    {
                                                      "name" : "value",
                                                      "source" : [
                                                        {
                                                          "context" : "qualifier",
                                                          "element" : "value",
                                                          "variable" : "value"
                                                        }
                                                      ],
                                                      "target" : [
                                                        {
                                                          "context" : "ce",
                                                          "contextType" : "variable",
                                                          "element" : "coding",
                                                          "variable" : "coding"
                                                        }
                                                      ],
                                                      "rule" : [
                                                        {
                                                          "name" : "code",
                                                          "source" : [
                                                            {
                                                              "context" : "value",
                                                              "element" : "code",
                                                              "variable" : "code"
                                                            }
                                                          ],
                                                          "target" : [
                                                            {
                                                              "context" : "coding",
                                                              "contextType" : "variable",
                                                              "element" : "code",
                                                              "transform" : "cast",
                                                              "parameter" : [
                                                                {
                                                                  "valueId" : "code"
                                                                },
                                                                {
                                                                  "valueString" : "string"
                                                                }
                                                              ]
                                                            }
                                                          ]
                                                        },
                                                        {
                                                          "name" : "codeSystem",
                                                          "source" : [
                                                            {
                                                              "context" : "value",
                                                              "element" : "codeSystem",
                                                              "variable" : "system"
                                                            }
                                                          ],
                                                          "target" : [
                                                            {
                                                              "context" : "coding",
                                                              "contextType" : "variable",
                                                              "element" : "system",
                                                              "transform" : "translate",
                                                              "parameter" : [
                                                                {
                                                                  "valueId" : "system"
                                                                },
                                                                {
                                                                  "valueString" : "http://hl7.org/fhir/ConceptMap/special-oid2uri"
                                                                },
                                                                {
                                                                  "valueString" : "uri"
                                                                }
                                                              ]
                                                            }
                                                          ]
                                                        },
                                                        {
                                                          "name" : "displayName",
                                                          "source" : [
                                                            {
                                                              "context" : "value",
                                                              "element" : "displayName",
                                                              "variable" : "display"
                                                            }
                                                          ],
                                                          "target" : [
                                                            {
                                                              "context" : "coding",
                                                              "contextType" : "variable",
                                                              "element" : "display",
                                                              "transform" : "cast",
                                                              "parameter" : [
                                                                {
                                                                  "valueId" : "display"
                                                                },
                                                                {
                                                                  "valueString" : "string"
                                                                }
                                                              ]
                                                            }
                                                          ]
                                                        },
                                                        {
                                                          "name" : "codeSystemVersion",
                                                          "source" : [
                                                            {
                                                              "context" : "value",
                                                              "element" : "codeSystemVersion",
                                                              "variable" : "version"
                                                            }
                                                          ],
                                                          "target" : [
                                                            {
                                                              "context" : "coding",
                                                              "contextType" : "variable",
                                                              "element" : "version",
                                                              "transform" : "cast",
                                                              "parameter" : [
                                                                {
                                                                  "valueId" : "version"
                                                                },
                                                                {
                                                                  "valueString" : "string"
                                                                }
                                                              ]
                                                            }
                                                          ]
                                                        }
                                                      ]
                                                    }
                                                  ]
                                                }
                                              ]
                                            }
                                          ]
                                        }
                                      ]
                                    },
                                    {
                                      "name" : "valueQuantity",
                                      "source" : [
                                        {
                                          "context" : "obs",
                                          "type" : "PQ",
                                          "element" : "value",
                                          "variable" : "val"
                                        }
                                      ],
                                      "rule" : [
                                        {
                                          "name" : "quantity",
                                          "source" : [
                                            {
                                              "context" : "val"
                                            }
                                          ],
                                          "target" : [
                                            {
                                              "context" : "observation",
                                              "contextType" : "variable",
                                              "element" : "value",
                                              "variable" : "quantity",
                                              "transform" : "create",
                                              "parameter" : [
                                                {
                                                  "valueString" : "Quantity"
                                                }
                                              ]
                                            }
                                          ],
                                          "rule" : [
                                            {
                                              "name" : "value",
                                              "source" : [
                                                {
                                                  "context" : "val",
                                                  "element" : "value",
                                                  "variable" : "value"
                                                }
                                              ],
                                              "target" : [
                                                {
                                                  "context" : "quantity",
                                                  "contextType" : "variable",
                                                  "element" : "value",
                                                  "transform" : "copy",
                                                  "parameter" : [
                                                    {
                                                      "valueId" : "value"
                                                    }
                                                  ]
                                                }
                                              ]
                                            },
                                            {
                                              "name" : "unit",
                                              "source" : [
                                                {
                                                  "context" : "val",
                                                  "element" : "unit",
                                                  "variable" : "unit"
                                                }
                                              ],
                                              "target" : [
                                                {
                                                  "context" : "quantity",
                                                  "contextType" : "variable",
                                                  "element" : "unit",
                                                  "transform" : "copy",
                                                  "parameter" : [
                                                    {
                                                      "valueId" : "unit"
                                                    }
                                                  ]
                                                }
                                              ]
                                            }
                                          ]
                                        }
                                      ]
                                    },
                                    {
                                      "name" : "value",
                                      "source" : [
                                        {
                                          "context" : "obs",
                                          "type" : "ST",
                                          "element" : "value",
                                          "variable" : "value"
                                        }
                                      ],
                                      "target" : [
                                        {
                                          "context" : "observation",
                                          "contextType" : "variable",
                                          "element" : "value",
                                          "transform" : "create",
                                          "parameter" : [
                                            {
                                              "valueString" : "string"
                                            }
                                          ]
                                        },
                                        {
                                          "context" : "observation",
                                          "contextType" : "variable",
                                          "element" : "value",
                                          "transform" : "evaluate",
                                          "parameter" : [
                                            {
                                              "valueString" : "value.dataString"
                                            }
                                          ]
                                        }
                                      ]
                                    }
                                  ]
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  ],
                  "documentation" : "Encounter Post dimissione---------------------------------------------------------------------------------------------------------------------------------------"
                },
                {
                  "name" : "entri-act",
                  "source" : [
                    {
                      "context" : "act",
                      "element" : "entryRelationship",
                      "variable" : "entriRel2"
                    }
                  ],
                  "rule" : [
                    {
                      "name" : "a",
                      "source" : [
                        {
                          "context" : "entriRel2",
                          "element" : "act",
                          "variable" : "a"
                        }
                      ],
                      "rule" : [
                        {
                          "name" : "act",
                          "source" : [
                            {
                              "context" : "a"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "bundle",
                              "contextType" : "variable",
                              "element" : "entry",
                              "variable" : "e1"
                            },
                            {
                              "context" : "e1",
                              "contextType" : "variable",
                              "element" : "request",
                              "variable" : "request",
                              "transform" : "create",
                              "parameter" : [
                                {
                                  "valueString" : "BackboneElement"
                                }
                              ]
                            },
                            {
                              "context" : "request",
                              "contextType" : "variable",
                              "element" : "method",
                              "transform" : "copy",
                              "parameter" : [
                                {
                                  "valueString" : "POST"
                                }
                              ]
                            },
                            {
                              "context" : "e1",
                              "contextType" : "variable",
                              "element" : "resource",
                              "variable" : "encountert2",
                              "transform" : "create",
                              "parameter" : [
                                {
                                  "valueString" : "Encounter"
                                }
                              ]
                            },
                            {
                              "context" : "encountert2",
                              "contextType" : "variable",
                              "element" : "id",
                              "variable" : "uuid1",
                              "transform" : "uuid"
                            },
                            {
                              "context" : "e1",
                              "contextType" : "variable",
                              "element" : "fullUrl",
                              "transform" : "append",
                              "parameter" : [
                                {
                                  "valueString" : "https://example/Encounter/"
                                },
                                {
                                  "valueId" : "uuid1"
                                }
                              ]
                            },
                            {
                              "context" : "request",
                              "contextType" : "variable",
                              "element" : "url",
                              "transform" : "copy",
                              "parameter" : [
                                {
                                  "valueString" : "Encounter"
                                }
                              ]
                            },
                            {
                              "context" : "tgt",
                              "contextType" : "variable",
                              "element" : "entry",
                              "variable" : "reference",
                              "transform" : "create",
                              "parameter" : [
                                {
                                  "valueString" : "Reference"
                                }
                              ]
                            },
                            {
                              "context" : "reference",
                              "contextType" : "variable",
                              "element" : "reference",
                              "transform" : "evaluate",
                              "parameter" : [
                                {
                                  "valueString" : "'https://example/Encounter/' + encountert2.id"
                                }
                              ]
                            },
                            {
                              "context" : "encountert2",
                              "contextType" : "variable",
                              "element" : "partOf",
                              "variable" : "reference",
                              "transform" : "create",
                              "parameter" : [
                                {
                                  "valueString" : "Reference"
                                }
                              ]
                            },
                            {
                              "context" : "reference",
                              "contextType" : "variable",
                              "element" : "reference",
                              "transform" : "evaluate",
                              "parameter" : [
                                {
                                  "valueString" : "'https://example/Encounter/' + encountert.id"
                                }
                              ]
                            }
                          ],
                          "rule" : [
                            {
                              "name" : "status",
                              "source" : [
                                {
                                  "context" : "a"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "encountert2",
                                  "contextType" : "variable",
                                  "element" : "status",
                                  "transform" : "copy",
                                  "parameter" : [
                                    {
                                      "valueString" : "finished"
                                    }
                                  ]
                                }
                              ]
                            },
                            {
                              "name" : "class",
                              "source" : [
                                {
                                  "context" : "a"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "encountert2",
                                  "contextType" : "variable",
                                  "element" : "class",
                                  "variable" : "cl",
                                  "transform" : "create",
                                  "parameter" : [
                                    {
                                      "valueString" : "Coding"
                                    }
                                  ]
                                }
                              ],
                              "rule" : [
                                {
                                  "name" : "code",
                                  "source" : [
                                    {
                                      "context" : "a"
                                    }
                                  ],
                                  "target" : [
                                    {
                                      "context" : "cl",
                                      "contextType" : "variable",
                                      "element" : "code",
                                      "transform" : "copy",
                                      "parameter" : [
                                        {
                                          "valueString" : "AMB"
                                        }
                                      ]
                                    }
                                  ]
                                },
                                {
                                  "name" : "code",
                                  "source" : [
                                    {
                                      "context" : "a"
                                    }
                                  ],
                                  "target" : [
                                    {
                                      "context" : "cl",
                                      "contextType" : "variable",
                                      "element" : "display",
                                      "transform" : "copy",
                                      "parameter" : [
                                        {
                                          "valueString" : "ambulatory"
                                        }
                                      ]
                                    }
                                  ]
                                }
                              ]
                            },
                            {
                              "name" : "refpatient",
                              "source" : [
                                {
                                  "context" : "a"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "encountert2",
                                  "contextType" : "variable",
                                  "element" : "subject",
                                  "variable" : "reference",
                                  "transform" : "create",
                                  "parameter" : [
                                    {
                                      "valueString" : "Reference"
                                    }
                                  ]
                                },
                                {
                                  "context" : "reference",
                                  "contextType" : "variable",
                                  "element" : "reference",
                                  "transform" : "evaluate",
                                  "parameter" : [
                                    {
                                      "valueString" : "'https://example/Patient/' + patient.id"
                                    }
                                  ]
                                }
                              ]
                            },
                            {
                              "name" : "where",
                              "source" : [
                                {
                                  "context" : "a",
                                  "condition" : "effectiveTime.low.exists() or effectiveTime.high.exists()"
                                }
                              ],
                              "rule" : [
                                {
                                  "name" : "effectiveTime",
                                  "source" : [
                                    {
                                      "context" : "a",
                                      "element" : "effectiveTime",
                                      "variable" : "eff"
                                    }
                                  ],
                                  "target" : [
                                    {
                                      "context" : "encountert2",
                                      "contextType" : "variable",
                                      "element" : "period",
                                      "variable" : "period",
                                      "transform" : "create",
                                      "parameter" : [
                                        {
                                          "valueString" : "Period"
                                        }
                                      ]
                                    }
                                  ],
                                  "dependent" : [
                                    {
                                      "name" : "IVLTSPeriod",
                                      "variable" : [
                                        "eff",
                                        "period"
                                      ]
                                    }
                                  ]
                                }
                              ]
                            },
                            {
                              "name" : "where",
                              "source" : [
                                {
                                  "context" : "a",
                                  "condition" : "effectiveTime.low.exists().not() or effectiveTime.high.exists().not()"
                                }
                              ],
                              "rule" : [
                                {
                                  "name" : "efft",
                                  "source" : [
                                    {
                                      "context" : "a",
                                      "element" : "effectiveTime",
                                      "variable" : "effectivetime1"
                                    }
                                  ],
                                  "target" : [
                                    {
                                      "context" : "encountert2",
                                      "contextType" : "variable",
                                      "element" : "period",
                                      "variable" : "period",
                                      "transform" : "create",
                                      "parameter" : [
                                        {
                                          "valueString" : "Period"
                                        }
                                      ]
                                    }
                                  ],
                                  "rule" : [
                                    {
                                      "name" : "val",
                                      "source" : [
                                        {
                                          "context" : "effectivetime1"
                                        }
                                      ],
                                      "target" : [
                                        {
                                          "context" : "period",
                                          "contextType" : "variable",
                                          "element" : "start",
                                          "variable" : "start",
                                          "transform" : "create",
                                          "parameter" : [
                                            {
                                              "valueString" : "dateTime"
                                            }
                                          ]
                                        }
                                      ],
                                      "dependent" : [
                                        {
                                          "name" : "TSDateTime",
                                          "variable" : [
                                            "effectivetime1",
                                            "start"
                                          ]
                                        }
                                      ]
                                    }
                                  ]
                                }
                              ],
                              "documentation" : "effectiveTime = time-stamp"
                            },
                            {
                              "name" : "loc",
                              "source" : [
                                {
                                  "context" : "a"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "bundle",
                                  "contextType" : "variable",
                                  "element" : "entry",
                                  "variable" : "e1"
                                },
                                {
                                  "context" : "e1",
                                  "contextType" : "variable",
                                  "element" : "request",
                                  "variable" : "request",
                                  "transform" : "create",
                                  "parameter" : [
                                    {
                                      "valueString" : "BackboneElement"
                                    }
                                  ]
                                },
                                {
                                  "context" : "request",
                                  "contextType" : "variable",
                                  "element" : "method",
                                  "transform" : "copy",
                                  "parameter" : [
                                    {
                                      "valueString" : "PUT"
                                    }
                                  ]
                                },
                                {
                                  "context" : "e1",
                                  "contextType" : "variable",
                                  "element" : "resource",
                                  "variable" : "location",
                                  "transform" : "create",
                                  "parameter" : [
                                    {
                                      "valueString" : "Location"
                                    }
                                  ]
                                },
                                {
                                  "context" : "location",
                                  "contextType" : "variable",
                                  "element" : "id",
                                  "variable" : "uuid1",
                                  "transform" : "uuid"
                                },
                                {
                                  "context" : "e1",
                                  "contextType" : "variable",
                                  "element" : "fullUrl",
                                  "transform" : "append",
                                  "parameter" : [
                                    {
                                      "valueString" : "https://example/Location/"
                                    },
                                    {
                                      "valueId" : "uuid1"
                                    }
                                  ]
                                },
                                {
                                  "context" : "request",
                                  "contextType" : "variable",
                                  "element" : "url",
                                  "transform" : "append",
                                  "parameter" : [
                                    {
                                      "valueString" : "Location/"
                                    },
                                    {
                                      "valueId" : "uuid1"
                                    }
                                  ]
                                }
                              ],
                              "rule" : [
                                {
                                  "name" : "text",
                                  "source" : [
                                    {
                                      "context" : "a",
                                      "element" : "text",
                                      "variable" : "tx"
                                    }
                                  ],
                                  "rule" : [
                                    {
                                      "name" : "dfs",
                                      "source" : [
                                        {
                                          "context" : "tx",
                                          "element" : "reference",
                                          "variable" : "ref"
                                        }
                                      ],
                                      "target" : [
                                        {
                                          "context" : "location",
                                          "contextType" : "variable",
                                          "element" : "description",
                                          "transform" : "evaluate",
                                          "parameter" : [
                                            {
                                              "valueString" : "ref.value"
                                            }
                                          ]
                                        }
                                      ]
                                    }
                                  ]
                                },
                                {
                                  "name" : "Location",
                                  "source" : [
                                    {
                                      "context" : "a",
                                      "element" : "participant",
                                      "variable" : "part"
                                    }
                                  ],
                                  "rule" : [
                                    {
                                      "name" : "meta",
                                      "source" : [
                                        {
                                          "context" : "part"
                                        }
                                      ],
                                      "target" : [
                                        {
                                          "context" : "location",
                                          "contextType" : "variable",
                                          "element" : "meta",
                                          "variable" : "meta"
                                        }
                                      ],
                                      "rule" : [
                                        {
                                          "name" : "coding",
                                          "source" : [
                                            {
                                              "context" : "part"
                                            }
                                          ],
                                          "target" : [
                                            {
                                              "context" : "meta",
                                              "contextType" : "variable",
                                              "element" : "tag",
                                              "variable" : "coding",
                                              "transform" : "create",
                                              "parameter" : [
                                                {
                                                  "valueString" : "Coding"
                                                }
                                              ]
                                            }
                                          ],
                                          "rule" : [
                                            {
                                              "name" : "system",
                                              "source" : [
                                                {
                                                  "context" : "part"
                                                }
                                              ],
                                              "target" : [
                                                {
                                                  "context" : "coding",
                                                  "contextType" : "variable",
                                                  "element" : "system",
                                                  "transform" : "copy",
                                                  "parameter" : [
                                                    {
                                                      "valueString" : "http://algoritmodiscoring"
                                                    }
                                                  ]
                                                }
                                              ]
                                            },
                                            {
                                              "name" : "code",
                                              "source" : [
                                                {
                                                  "context" : "part"
                                                }
                                              ],
                                              "target" : [
                                                {
                                                  "context" : "coding",
                                                  "contextType" : "variable",
                                                  "element" : "code",
                                                  "transform" : "copy",
                                                  "parameter" : [
                                                    {
                                                      "valueString" : "ClinicalDocument/body/Dimissione/act"
                                                    }
                                                  ]
                                                }
                                              ]
                                            }
                                          ]
                                        }
                                      ]
                                    },
                                    {
                                      "name" : "loc2",
                                      "source" : [
                                        {
                                          "context" : "part",
                                          "element" : "time",
                                          "variable" : "tim"
                                        }
                                      ],
                                      "target" : [
                                        {
                                          "context" : "encountert2",
                                          "contextType" : "variable",
                                          "element" : "location",
                                          "variable" : "locat"
                                        }
                                      ],
                                      "rule" : [
                                        {
                                          "name" : "time",
                                          "source" : [
                                            {
                                              "context" : "tim"
                                            }
                                          ],
                                          "target" : [
                                            {
                                              "context" : "locat",
                                              "contextType" : "variable",
                                              "element" : "period",
                                              "variable" : "period",
                                              "transform" : "create",
                                              "parameter" : [
                                                {
                                                  "valueString" : "Period"
                                                }
                                              ]
                                            }
                                          ],
                                          "dependent" : [
                                            {
                                              "name" : "IVLTSPeriod",
                                              "variable" : [
                                                "tim",
                                                "period"
                                              ]
                                            }
                                          ]
                                        },
                                        {
                                          "name" : "time",
                                          "source" : [
                                            {
                                              "context" : "part",
                                              "element" : "time",
                                              "variable" : "tim"
                                            }
                                          ],
                                          "target" : [
                                            {
                                              "context" : "locat",
                                              "contextType" : "variable",
                                              "element" : "period",
                                              "variable" : "period",
                                              "transform" : "create",
                                              "parameter" : [
                                                {
                                                  "valueString" : "Period"
                                                }
                                              ]
                                            }
                                          ],
                                          "rule" : [
                                            {
                                              "name" : "val",
                                              "source" : [
                                                {
                                                  "context" : "tim"
                                                }
                                              ],
                                              "target" : [
                                                {
                                                  "context" : "period",
                                                  "contextType" : "variable",
                                                  "element" : "start",
                                                  "variable" : "start",
                                                  "transform" : "create",
                                                  "parameter" : [
                                                    {
                                                      "valueString" : "dateTime"
                                                    }
                                                  ]
                                                }
                                              ],
                                              "dependent" : [
                                                {
                                                  "name" : "TSDateTime",
                                                  "variable" : [
                                                    "tim",
                                                    "start"
                                                  ]
                                                }
                                              ]
                                            }
                                          ]
                                        },
                                        {
                                          "name" : "partRole",
                                          "source" : [
                                            {
                                              "context" : "part",
                                              "element" : "participantRole",
                                              "variable" : "partRole"
                                            }
                                          ],
                                          "rule" : [
                                            {
                                              "name" : "identifier",
                                              "source" : [
                                                {
                                                  "context" : "partRole",
                                                  "element" : "id",
                                                  "variable" : "id"
                                                }
                                              ],
                                              "target" : [
                                                {
                                                  "context" : "location",
                                                  "contextType" : "variable",
                                                  "element" : "identifier",
                                                  "variable" : "identifier"
                                                }
                                              ],
                                              "rule" : [
                                                {
                                                  "name" : "root1",
                                                  "source" : [
                                                    {
                                                      "context" : "id",
                                                      "element" : "root",
                                                      "variable" : "r"
                                                    }
                                                  ],
                                                  "target" : [
                                                    {
                                                      "context" : "identifier",
                                                      "contextType" : "variable",
                                                      "element" : "system",
                                                      "transform" : "translate",
                                                      "parameter" : [
                                                        {
                                                          "valueId" : "r"
                                                        },
                                                        {
                                                          "valueString" : "http://hl7.org/fhir/ConceptMap/special-oid2uri"
                                                        },
                                                        {
                                                          "valueString" : "uri"
                                                        }
                                                      ]
                                                    }
                                                  ]
                                                },
                                                {
                                                  "name" : "ext",
                                                  "source" : [
                                                    {
                                                      "context" : "id",
                                                      "element" : "extension",
                                                      "variable" : "ext"
                                                    }
                                                  ],
                                                  "target" : [
                                                    {
                                                      "context" : "identifier",
                                                      "contextType" : "variable",
                                                      "element" : "value",
                                                      "transform" : "copy",
                                                      "parameter" : [
                                                        {
                                                          "valueId" : "ext"
                                                        }
                                                      ]
                                                    }
                                                  ],
                                                  "rule" : [
                                                    {
                                                      "name" : "UUID",
                                                      "source" : [
                                                        {
                                                          "context" : "partRole"
                                                        }
                                                      ],
                                                      "target" : [
                                                        {
                                                          "context" : "request",
                                                          "contextType" : "variable",
                                                          "element" : "url",
                                                          "transform" : "append",
                                                          "parameter" : [
                                                            {
                                                              "valueString" : "Location?identifier="
                                                            },
                                                            {
                                                              "valueId" : "ext"
                                                            }
                                                          ]
                                                        }
                                                      ]
                                                    }
                                                  ]
                                                },
                                                {
                                                  "name" : "assigningAuthorityName",
                                                  "source" : [
                                                    {
                                                      "context" : "id",
                                                      "element" : "assigningAuthorityName",
                                                      "variable" : "s"
                                                    }
                                                  ],
                                                  "target" : [
                                                    {
                                                      "context" : "identifier",
                                                      "contextType" : "variable",
                                                      "element" : "assigner",
                                                      "variable" : "a"
                                                    },
                                                    {
                                                      "context" : "a",
                                                      "contextType" : "variable",
                                                      "element" : "display",
                                                      "transform" : "copy",
                                                      "parameter" : [
                                                        {
                                                          "valueId" : "s"
                                                        }
                                                      ]
                                                    }
                                                  ]
                                                },
                                                {
                                                  "name" : "r",
                                                  "source" : [
                                                    {
                                                      "context" : "id",
                                                      "element" : "root",
                                                      "variable" : "r"
                                                    }
                                                  ],
                                                  "rule" : [
                                                    {
                                                      "name" : "idasi",
                                                      "source" : [
                                                        {
                                                          "context" : "id",
                                                          "element" : "extension",
                                                          "variable" : "ext"
                                                        }
                                                      ],
                                                      "target" : [
                                                        {
                                                          "context" : "location",
                                                          "contextType" : "variable",
                                                          "element" : "id",
                                                          "variable" : "uuid",
                                                          "transform" : "evaluate",
                                                          "parameter" : [
                                                            {
                                                              "valueString" : "r + '-' + ext"
                                                            }
                                                          ]
                                                        },
                                                        {
                                                          "context" : "e1",
                                                          "contextType" : "variable",
                                                          "element" : "fullUrl",
                                                          "transform" : "append",
                                                          "parameter" : [
                                                            {
                                                              "valueString" : "https://example/Location/"
                                                            },
                                                            {
                                                              "valueId" : "uuid"
                                                            }
                                                          ]
                                                        },
                                                        {
                                                          "context" : "locat",
                                                          "contextType" : "variable",
                                                          "element" : "location",
                                                          "variable" : "reference",
                                                          "transform" : "create",
                                                          "parameter" : [
                                                            {
                                                              "valueString" : "Reference"
                                                            }
                                                          ]
                                                        },
                                                        {
                                                          "context" : "reference",
                                                          "contextType" : "variable",
                                                          "element" : "reference",
                                                          "transform" : "evaluate",
                                                          "parameter" : [
                                                            {
                                                              "valueString" : "'https://example/Location/' + %location.id"
                                                            }
                                                          ]
                                                        }
                                                      ]
                                                    }
                                                  ]
                                                }
                                              ]
                                            },
                                            {
                                              "name" : "code",
                                              "source" : [
                                                {
                                                  "context" : "partRole",
                                                  "element" : "code",
                                                  "variable" : "vvv"
                                                }
                                              ],
                                              "target" : [
                                                {
                                                  "context" : "location",
                                                  "contextType" : "variable",
                                                  "element" : "type",
                                                  "variable" : "vvv",
                                                  "transform" : "create"
                                                }
                                              ],
                                              "documentation" : "partRole.id -> location.identifier;"
                                            }
                                          ]
                                        }
                                      ]
                                    }
                                  ]
                                }
                              ]
                            },
                            {
                              "name" : "entryrel2",
                              "source" : [
                                {
                                  "context" : "a",
                                  "element" : "entryRelationship",
                                  "variable" : "entryrel2"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "bundle",
                                  "contextType" : "variable",
                                  "element" : "entry",
                                  "variable" : "e1"
                                },
                                {
                                  "context" : "e1",
                                  "contextType" : "variable",
                                  "element" : "request",
                                  "variable" : "request",
                                  "transform" : "create",
                                  "parameter" : [
                                    {
                                      "valueString" : "BackboneElement"
                                    }
                                  ]
                                },
                                {
                                  "context" : "request",
                                  "contextType" : "variable",
                                  "element" : "method",
                                  "transform" : "copy",
                                  "parameter" : [
                                    {
                                      "valueString" : "POST"
                                    }
                                  ]
                                },
                                {
                                  "context" : "e1",
                                  "contextType" : "variable",
                                  "element" : "resource",
                                  "variable" : "observation",
                                  "transform" : "create",
                                  "parameter" : [
                                    {
                                      "valueString" : "Observation"
                                    }
                                  ]
                                },
                                {
                                  "context" : "observation",
                                  "contextType" : "variable",
                                  "element" : "id",
                                  "variable" : "uuid1",
                                  "transform" : "uuid"
                                },
                                {
                                  "context" : "e1",
                                  "contextType" : "variable",
                                  "element" : "fullUrl",
                                  "transform" : "append",
                                  "parameter" : [
                                    {
                                      "valueString" : "https://example/Observation/"
                                    },
                                    {
                                      "valueId" : "uuid1"
                                    }
                                  ]
                                },
                                {
                                  "context" : "request",
                                  "contextType" : "variable",
                                  "element" : "url",
                                  "transform" : "copy",
                                  "parameter" : [
                                    {
                                      "valueString" : "Observation"
                                    }
                                  ]
                                },
                                {
                                  "context" : "encountert2",
                                  "contextType" : "variable",
                                  "element" : "reasonReference",
                                  "variable" : "reference",
                                  "transform" : "create",
                                  "parameter" : [
                                    {
                                      "valueString" : "BackboneElement"
                                    }
                                  ]
                                },
                                {
                                  "context" : "reference",
                                  "contextType" : "variable",
                                  "element" : "reference",
                                  "transform" : "evaluate",
                                  "parameter" : [
                                    {
                                      "valueString" : "'https://example/Observation/' + %observation.id"
                                    }
                                  ]
                                }
                              ],
                              "rule" : [
                                {
                                  "name" : "obs",
                                  "source" : [
                                    {
                                      "context" : "entryrel2",
                                      "element" : "observation",
                                      "variable" : "obs"
                                    }
                                  ],
                                  "rule" : [
                                    {
                                      "name" : "reference",
                                      "source" : [
                                        {
                                          "context" : "obs"
                                        }
                                      ],
                                      "target" : [
                                        {
                                          "context" : "observation",
                                          "contextType" : "variable",
                                          "element" : "subject",
                                          "variable" : "reference",
                                          "transform" : "create",
                                          "parameter" : [
                                            {
                                              "valueString" : "Reference"
                                            }
                                          ]
                                        },
                                        {
                                          "context" : "reference",
                                          "contextType" : "variable",
                                          "element" : "reference",
                                          "transform" : "evaluate",
                                          "parameter" : [
                                            {
                                              "valueString" : "'https://example/Patient/' + %patient.id"
                                            }
                                          ]
                                        }
                                      ]
                                    },
                                    {
                                      "name" : "reference",
                                      "source" : [
                                        {
                                          "context" : "obs"
                                        }
                                      ],
                                      "target" : [
                                        {
                                          "context" : "observation",
                                          "contextType" : "variable",
                                          "element" : "encounter",
                                          "variable" : "reference",
                                          "transform" : "create",
                                          "parameter" : [
                                            {
                                              "valueString" : "Reference"
                                            }
                                          ]
                                        },
                                        {
                                          "context" : "reference",
                                          "contextType" : "variable",
                                          "element" : "reference",
                                          "transform" : "evaluate",
                                          "parameter" : [
                                            {
                                              "valueString" : "'https://example/Encounter/' + %encountert2.id"
                                            }
                                          ]
                                        }
                                      ]
                                    },
                                    {
                                      "name" : "code",
                                      "source" : [
                                        {
                                          "context" : "obs",
                                          "element" : "code",
                                          "variable" : "vvv"
                                        }
                                      ],
                                      "target" : [
                                        {
                                          "context" : "observation",
                                          "contextType" : "variable",
                                          "element" : "code",
                                          "variable" : "vvv",
                                          "transform" : "create"
                                        }
                                      ]
                                    },
                                    {
                                      "name" : "statusCode",
                                      "source" : [
                                        {
                                          "context" : "obs",
                                          "element" : "statusCode",
                                          "variable" : "statusc",
                                          "condition" : "(code = 'completed')"
                                        }
                                      ],
                                      "target" : [
                                        {
                                          "context" : "observation",
                                          "contextType" : "variable",
                                          "element" : "status",
                                          "transform" : "copy",
                                          "parameter" : [
                                            {
                                              "valueString" : "final"
                                            }
                                          ]
                                        }
                                      ]
                                    },
                                    {
                                      "name" : "statusCode",
                                      "source" : [
                                        {
                                          "context" : "obs",
                                          "element" : "statusCode",
                                          "variable" : "statusc",
                                          "condition" : "(code = 'active')"
                                        }
                                      ],
                                      "target" : [
                                        {
                                          "context" : "observation",
                                          "contextType" : "variable",
                                          "element" : "status",
                                          "transform" : "copy",
                                          "parameter" : [
                                            {
                                              "valueString" : "registered"
                                            }
                                          ]
                                        }
                                      ]
                                    },
                                    {
                                      "name" : "statusCode",
                                      "source" : [
                                        {
                                          "context" : "obs",
                                          "element" : "statusCode",
                                          "variable" : "statusc",
                                          "condition" : "(code = 'aborted')"
                                        }
                                      ],
                                      "target" : [
                                        {
                                          "context" : "observation",
                                          "contextType" : "variable",
                                          "element" : "status",
                                          "transform" : "copy",
                                          "parameter" : [
                                            {
                                              "valueString" : "cancelled"
                                            }
                                          ]
                                        }
                                      ]
                                    },
                                    {
                                      "name" : "statusCode",
                                      "source" : [
                                        {
                                          "context" : "obs",
                                          "element" : "statusCode",
                                          "variable" : "statusc",
                                          "condition" : "(code = 'suspended')"
                                        }
                                      ],
                                      "target" : [
                                        {
                                          "context" : "observation",
                                          "contextType" : "variable",
                                          "element" : "status",
                                          "transform" : "copy",
                                          "parameter" : [
                                            {
                                              "valueString" : "partial"
                                            }
                                          ]
                                        }
                                      ]
                                    },
                                    {
                                      "name" : "notpresent",
                                      "source" : [
                                        {
                                          "context" : "obs"
                                        }
                                      ],
                                      "target" : [
                                        {
                                          "context" : "observation",
                                          "contextType" : "variable",
                                          "element" : "status",
                                          "transform" : "copy",
                                          "parameter" : [
                                            {
                                              "valueString" : "final"
                                            }
                                          ]
                                        }
                                      ]
                                    },
                                    {
                                      "name" : "value2",
                                      "source" : [
                                        {
                                          "context" : "obs",
                                          "element" : "effectiveTime",
                                          "variable" : "effectiveTime"
                                        }
                                      ],
                                      "target" : [
                                        {
                                          "context" : "observation",
                                          "contextType" : "variable",
                                          "element" : "effective",
                                          "variable" : "value",
                                          "transform" : "create",
                                          "parameter" : [
                                            {
                                              "valueString" : "dateTime"
                                            }
                                          ]
                                        }
                                      ],
                                      "dependent" : [
                                        {
                                          "name" : "TSDateTime",
                                          "variable" : [
                                            "effectiveTime",
                                            "value"
                                          ]
                                        }
                                      ]
                                    },
                                    {
                                      "name" : "where",
                                      "source" : [
                                        {
                                          "context" : "obs",
                                          "condition" : "effectiveTime.low.exists() or effectiveTime.high.exists()"
                                        }
                                      ],
                                      "rule" : [
                                        {
                                          "name" : "effectiveTime",
                                          "source" : [
                                            {
                                              "context" : "obs",
                                              "element" : "effectiveTime",
                                              "variable" : "eff"
                                            }
                                          ],
                                          "target" : [
                                            {
                                              "context" : "observation",
                                              "contextType" : "variable",
                                              "element" : "effective",
                                              "variable" : "period",
                                              "transform" : "create",
                                              "parameter" : [
                                                {
                                                  "valueString" : "Period"
                                                }
                                              ]
                                            }
                                          ],
                                          "dependent" : [
                                            {
                                              "name" : "IVLTSPeriod",
                                              "variable" : [
                                                "eff",
                                                "period"
                                              ]
                                            }
                                          ]
                                        }
                                      ]
                                    },
                                    {
                                      "name" : "value",
                                      "source" : [
                                        {
                                          "context" : "obs",
                                          "type" : "INT",
                                          "element" : "value",
                                          "variable" : "int"
                                        }
                                      ],
                                      "target" : [
                                        {
                                          "context" : "observation",
                                          "contextType" : "variable",
                                          "element" : "value",
                                          "transform" : "evaluate",
                                          "parameter" : [
                                            {
                                              "valueString" : "int.value"
                                            }
                                          ]
                                        }
                                      ]
                                    },
                                    {
                                      "name" : "boolean",
                                      "source" : [
                                        {
                                          "context" : "obs",
                                          "type" : "BL",
                                          "element" : "value",
                                          "variable" : "boolean"
                                        }
                                      ],
                                      "target" : [
                                        {
                                          "context" : "observation",
                                          "contextType" : "variable",
                                          "element" : "value",
                                          "transform" : "evaluate",
                                          "parameter" : [
                                            {
                                              "valueString" : "boolean.value"
                                            }
                                          ]
                                        }
                                      ]
                                    },
                                    {
                                      "name" : "val",
                                      "source" : [
                                        {
                                          "context" : "obs",
                                          "type" : "CE",
                                          "element" : "value",
                                          "variable" : "val"
                                        }
                                      ],
                                      "rule" : [
                                        {
                                          "name" : "coding",
                                          "source" : [
                                            {
                                              "context" : "val"
                                            }
                                          ],
                                          "target" : [
                                            {
                                              "context" : "observation",
                                              "contextType" : "variable",
                                              "element" : "value",
                                              "variable" : "ce",
                                              "transform" : "create",
                                              "parameter" : [
                                                {
                                                  "valueString" : "CodeableConcept"
                                                }
                                              ]
                                            }
                                          ],
                                          "rule" : [
                                            {
                                              "name" : "originltext",
                                              "source" : [
                                                {
                                                  "context" : "val",
                                                  "element" : "originalText",
                                                  "variable" : "originalText"
                                                }
                                              ],
                                              "rule" : [
                                                {
                                                  "name" : "reference",
                                                  "source" : [
                                                    {
                                                      "context" : "originalText",
                                                      "element" : "reference",
                                                      "variable" : "reference"
                                                    }
                                                  ],
                                                  "target" : [
                                                    {
                                                      "context" : "ce",
                                                      "contextType" : "variable",
                                                      "element" : "text",
                                                      "transform" : "copy",
                                                      "parameter" : [
                                                        {
                                                          "valueId" : "reference"
                                                        }
                                                      ]
                                                    }
                                                  ]
                                                }
                                              ]
                                            },
                                            {
                                              "name" : "code",
                                              "source" : [
                                                {
                                                  "context" : "val"
                                                }
                                              ],
                                              "target" : [
                                                {
                                                  "context" : "ce",
                                                  "contextType" : "variable",
                                                  "element" : "coding",
                                                  "variable" : "coding"
                                                }
                                              ],
                                              "rule" : [
                                                {
                                                  "name" : "code",
                                                  "source" : [
                                                    {
                                                      "context" : "val",
                                                      "element" : "code",
                                                      "variable" : "code"
                                                    }
                                                  ],
                                                  "target" : [
                                                    {
                                                      "context" : "coding",
                                                      "contextType" : "variable",
                                                      "element" : "code",
                                                      "transform" : "cast",
                                                      "parameter" : [
                                                        {
                                                          "valueId" : "code"
                                                        },
                                                        {
                                                          "valueString" : "string"
                                                        }
                                                      ]
                                                    }
                                                  ]
                                                },
                                                {
                                                  "name" : "codeSystem",
                                                  "source" : [
                                                    {
                                                      "context" : "val",
                                                      "element" : "codeSystem",
                                                      "variable" : "system"
                                                    }
                                                  ],
                                                  "target" : [
                                                    {
                                                      "context" : "coding",
                                                      "contextType" : "variable",
                                                      "element" : "system",
                                                      "transform" : "translate",
                                                      "parameter" : [
                                                        {
                                                          "valueId" : "system"
                                                        },
                                                        {
                                                          "valueString" : "http://hl7.org/fhir/ConceptMap/special-oid2uri"
                                                        },
                                                        {
                                                          "valueString" : "uri"
                                                        }
                                                      ]
                                                    }
                                                  ]
                                                },
                                                {
                                                  "name" : "displayName",
                                                  "source" : [
                                                    {
                                                      "context" : "val",
                                                      "element" : "displayName",
                                                      "variable" : "display"
                                                    }
                                                  ],
                                                  "target" : [
                                                    {
                                                      "context" : "coding",
                                                      "contextType" : "variable",
                                                      "element" : "display",
                                                      "transform" : "cast",
                                                      "parameter" : [
                                                        {
                                                          "valueId" : "display"
                                                        },
                                                        {
                                                          "valueString" : "string"
                                                        }
                                                      ]
                                                    }
                                                  ]
                                                },
                                                {
                                                  "name" : "codeSystemVersion",
                                                  "source" : [
                                                    {
                                                      "context" : "val",
                                                      "element" : "codeSystemVersion",
                                                      "variable" : "version"
                                                    }
                                                  ],
                                                  "target" : [
                                                    {
                                                      "context" : "coding",
                                                      "contextType" : "variable",
                                                      "element" : "version",
                                                      "transform" : "cast",
                                                      "parameter" : [
                                                        {
                                                          "valueId" : "version"
                                                        },
                                                        {
                                                          "valueString" : "string"
                                                        }
                                                      ]
                                                    }
                                                  ]
                                                }
                                              ]
                                            },
                                            {
                                              "name" : "translation",
                                              "source" : [
                                                {
                                                  "context" : "val",
                                                  "element" : "translation",
                                                  "variable" : "translation"
                                                }
                                              ],
                                              "target" : [
                                                {
                                                  "context" : "ce",
                                                  "contextType" : "variable",
                                                  "element" : "coding",
                                                  "variable" : "coding"
                                                }
                                              ],
                                              "rule" : [
                                                {
                                                  "name" : "code",
                                                  "source" : [
                                                    {
                                                      "context" : "translation",
                                                      "element" : "code",
                                                      "variable" : "code"
                                                    }
                                                  ],
                                                  "target" : [
                                                    {
                                                      "context" : "coding",
                                                      "contextType" : "variable",
                                                      "element" : "code",
                                                      "transform" : "cast",
                                                      "parameter" : [
                                                        {
                                                          "valueId" : "code"
                                                        },
                                                        {
                                                          "valueString" : "string"
                                                        }
                                                      ]
                                                    }
                                                  ]
                                                },
                                                {
                                                  "name" : "codeSystem",
                                                  "source" : [
                                                    {
                                                      "context" : "translation",
                                                      "element" : "codeSystem",
                                                      "variable" : "system"
                                                    }
                                                  ],
                                                  "target" : [
                                                    {
                                                      "context" : "coding",
                                                      "contextType" : "variable",
                                                      "element" : "system",
                                                      "transform" : "translate",
                                                      "parameter" : [
                                                        {
                                                          "valueId" : "system"
                                                        },
                                                        {
                                                          "valueString" : "http://hl7.org/fhir/ConceptMap/special-oid2uri"
                                                        },
                                                        {
                                                          "valueString" : "uri"
                                                        }
                                                      ]
                                                    }
                                                  ]
                                                },
                                                {
                                                  "name" : "displayName",
                                                  "source" : [
                                                    {
                                                      "context" : "translation",
                                                      "element" : "displayName",
                                                      "variable" : "display"
                                                    }
                                                  ],
                                                  "target" : [
                                                    {
                                                      "context" : "coding",
                                                      "contextType" : "variable",
                                                      "element" : "display",
                                                      "transform" : "cast",
                                                      "parameter" : [
                                                        {
                                                          "valueId" : "display"
                                                        },
                                                        {
                                                          "valueString" : "string"
                                                        }
                                                      ]
                                                    }
                                                  ]
                                                },
                                                {
                                                  "name" : "codeSystemVersion",
                                                  "source" : [
                                                    {
                                                      "context" : "translation",
                                                      "element" : "codeSystemVersion",
                                                      "variable" : "version"
                                                    }
                                                  ],
                                                  "target" : [
                                                    {
                                                      "context" : "coding",
                                                      "contextType" : "variable",
                                                      "element" : "version",
                                                      "transform" : "cast",
                                                      "parameter" : [
                                                        {
                                                          "valueId" : "version"
                                                        },
                                                        {
                                                          "valueString" : "string"
                                                        }
                                                      ]
                                                    }
                                                  ]
                                                },
                                                {
                                                  "name" : "qualifier",
                                                  "source" : [
                                                    {
                                                      "context" : "translation",
                                                      "element" : "qualifier",
                                                      "variable" : "qualifier"
                                                    }
                                                  ],
                                                  "rule" : [
                                                    {
                                                      "name" : "value",
                                                      "source" : [
                                                        {
                                                          "context" : "qualifier",
                                                          "element" : "value",
                                                          "variable" : "value"
                                                        }
                                                      ],
                                                      "target" : [
                                                        {
                                                          "context" : "ce",
                                                          "contextType" : "variable",
                                                          "element" : "coding",
                                                          "variable" : "coding"
                                                        }
                                                      ],
                                                      "rule" : [
                                                        {
                                                          "name" : "code",
                                                          "source" : [
                                                            {
                                                              "context" : "value",
                                                              "element" : "code",
                                                              "variable" : "code"
                                                            }
                                                          ],
                                                          "target" : [
                                                            {
                                                              "context" : "coding",
                                                              "contextType" : "variable",
                                                              "element" : "code",
                                                              "transform" : "cast",
                                                              "parameter" : [
                                                                {
                                                                  "valueId" : "code"
                                                                },
                                                                {
                                                                  "valueString" : "string"
                                                                }
                                                              ]
                                                            }
                                                          ]
                                                        },
                                                        {
                                                          "name" : "codeSystem",
                                                          "source" : [
                                                            {
                                                              "context" : "value",
                                                              "element" : "codeSystem",
                                                              "variable" : "system"
                                                            }
                                                          ],
                                                          "target" : [
                                                            {
                                                              "context" : "coding",
                                                              "contextType" : "variable",
                                                              "element" : "system",
                                                              "transform" : "translate",
                                                              "parameter" : [
                                                                {
                                                                  "valueId" : "system"
                                                                },
                                                                {
                                                                  "valueString" : "http://hl7.org/fhir/ConceptMap/special-oid2uri"
                                                                },
                                                                {
                                                                  "valueString" : "uri"
                                                                }
                                                              ]
                                                            }
                                                          ]
                                                        },
                                                        {
                                                          "name" : "displayName",
                                                          "source" : [
                                                            {
                                                              "context" : "value",
                                                              "element" : "displayName",
                                                              "variable" : "display"
                                                            }
                                                          ],
                                                          "target" : [
                                                            {
                                                              "context" : "coding",
                                                              "contextType" : "variable",
                                                              "element" : "display",
                                                              "transform" : "cast",
                                                              "parameter" : [
                                                                {
                                                                  "valueId" : "display"
                                                                },
                                                                {
                                                                  "valueString" : "string"
                                                                }
                                                              ]
                                                            }
                                                          ]
                                                        },
                                                        {
                                                          "name" : "codeSystemVersion",
                                                          "source" : [
                                                            {
                                                              "context" : "value",
                                                              "element" : "codeSystemVersion",
                                                              "variable" : "version"
                                                            }
                                                          ],
                                                          "target" : [
                                                            {
                                                              "context" : "coding",
                                                              "contextType" : "variable",
                                                              "element" : "version",
                                                              "transform" : "cast",
                                                              "parameter" : [
                                                                {
                                                                  "valueId" : "version"
                                                                },
                                                                {
                                                                  "valueString" : "string"
                                                                }
                                                              ]
                                                            }
                                                          ]
                                                        }
                                                      ]
                                                    }
                                                  ]
                                                }
                                              ]
                                            }
                                          ]
                                        }
                                      ]
                                    },
                                    {
                                      "name" : "val",
                                      "source" : [
                                        {
                                          "context" : "obs",
                                          "type" : "CD",
                                          "element" : "value",
                                          "variable" : "val"
                                        }
                                      ],
                                      "rule" : [
                                        {
                                          "name" : "coding",
                                          "source" : [
                                            {
                                              "context" : "val"
                                            }
                                          ],
                                          "target" : [
                                            {
                                              "context" : "observation",
                                              "contextType" : "variable",
                                              "element" : "value",
                                              "variable" : "ce",
                                              "transform" : "create",
                                              "parameter" : [
                                                {
                                                  "valueString" : "CodeableConcept"
                                                }
                                              ]
                                            }
                                          ],
                                          "rule" : [
                                            {
                                              "name" : "originltext",
                                              "source" : [
                                                {
                                                  "context" : "val",
                                                  "element" : "originalText",
                                                  "variable" : "originalText"
                                                }
                                              ],
                                              "rule" : [
                                                {
                                                  "name" : "reference",
                                                  "source" : [
                                                    {
                                                      "context" : "originalText",
                                                      "element" : "reference",
                                                      "variable" : "reference"
                                                    }
                                                  ],
                                                  "target" : [
                                                    {
                                                      "context" : "ce",
                                                      "contextType" : "variable",
                                                      "element" : "text",
                                                      "transform" : "copy",
                                                      "parameter" : [
                                                        {
                                                          "valueId" : "reference"
                                                        }
                                                      ]
                                                    }
                                                  ]
                                                }
                                              ]
                                            },
                                            {
                                              "name" : "code",
                                              "source" : [
                                                {
                                                  "context" : "val"
                                                }
                                              ],
                                              "target" : [
                                                {
                                                  "context" : "ce",
                                                  "contextType" : "variable",
                                                  "element" : "coding",
                                                  "variable" : "coding"
                                                }
                                              ],
                                              "rule" : [
                                                {
                                                  "name" : "code",
                                                  "source" : [
                                                    {
                                                      "context" : "val",
                                                      "element" : "code",
                                                      "variable" : "code"
                                                    }
                                                  ],
                                                  "target" : [
                                                    {
                                                      "context" : "coding",
                                                      "contextType" : "variable",
                                                      "element" : "code",
                                                      "transform" : "cast",
                                                      "parameter" : [
                                                        {
                                                          "valueId" : "code"
                                                        },
                                                        {
                                                          "valueString" : "string"
                                                        }
                                                      ]
                                                    }
                                                  ]
                                                },
                                                {
                                                  "name" : "codeSystem",
                                                  "source" : [
                                                    {
                                                      "context" : "val",
                                                      "element" : "codeSystem",
                                                      "variable" : "system"
                                                    }
                                                  ],
                                                  "target" : [
                                                    {
                                                      "context" : "coding",
                                                      "contextType" : "variable",
                                                      "element" : "system",
                                                      "transform" : "translate",
                                                      "parameter" : [
                                                        {
                                                          "valueId" : "system"
                                                        },
                                                        {
                                                          "valueString" : "http://hl7.org/fhir/ConceptMap/special-oid2uri"
                                                        },
                                                        {
                                                          "valueString" : "uri"
                                                        }
                                                      ]
                                                    }
                                                  ]
                                                },
                                                {
                                                  "name" : "displayName",
                                                  "source" : [
                                                    {
                                                      "context" : "val",
                                                      "element" : "displayName",
                                                      "variable" : "display"
                                                    }
                                                  ],
                                                  "target" : [
                                                    {
                                                      "context" : "coding",
                                                      "contextType" : "variable",
                                                      "element" : "display",
                                                      "transform" : "cast",
                                                      "parameter" : [
                                                        {
                                                          "valueId" : "display"
                                                        },
                                                        {
                                                          "valueString" : "string"
                                                        }
                                                      ]
                                                    }
                                                  ]
                                                },
                                                {
                                                  "name" : "codeSystemVersion",
                                                  "source" : [
                                                    {
                                                      "context" : "val",
                                                      "element" : "codeSystemVersion",
                                                      "variable" : "version"
                                                    }
                                                  ],
                                                  "target" : [
                                                    {
                                                      "context" : "coding",
                                                      "contextType" : "variable",
                                                      "element" : "version",
                                                      "transform" : "cast",
                                                      "parameter" : [
                                                        {
                                                          "valueId" : "version"
                                                        },
                                                        {
                                                          "valueString" : "string"
                                                        }
                                                      ]
                                                    }
                                                  ]
                                                }
                                              ]
                                            },
                                            {
                                              "name" : "translation",
                                              "source" : [
                                                {
                                                  "context" : "val",
                                                  "element" : "translation",
                                                  "variable" : "translation"
                                                }
                                              ],
                                              "target" : [
                                                {
                                                  "context" : "ce",
                                                  "contextType" : "variable",
                                                  "element" : "coding",
                                                  "variable" : "coding"
                                                }
                                              ],
                                              "rule" : [
                                                {
                                                  "name" : "code",
                                                  "source" : [
                                                    {
                                                      "context" : "translation",
                                                      "element" : "code",
                                                      "variable" : "code"
                                                    }
                                                  ],
                                                  "target" : [
                                                    {
                                                      "context" : "coding",
                                                      "contextType" : "variable",
                                                      "element" : "code",
                                                      "transform" : "cast",
                                                      "parameter" : [
                                                        {
                                                          "valueId" : "code"
                                                        },
                                                        {
                                                          "valueString" : "string"
                                                        }
                                                      ]
                                                    }
                                                  ]
                                                },
                                                {
                                                  "name" : "codeSystem",
                                                  "source" : [
                                                    {
                                                      "context" : "translation",
                                                      "element" : "codeSystem",
                                                      "variable" : "system"
                                                    }
                                                  ],
                                                  "target" : [
                                                    {
                                                      "context" : "coding",
                                                      "contextType" : "variable",
                                                      "element" : "system",
                                                      "transform" : "translate",
                                                      "parameter" : [
                                                        {
                                                          "valueId" : "system"
                                                        },
                                                        {
                                                          "valueString" : "http://hl7.org/fhir/ConceptMap/special-oid2uri"
                                                        },
                                                        {
                                                          "valueString" : "uri"
                                                        }
                                                      ]
                                                    }
                                                  ]
                                                },
                                                {
                                                  "name" : "displayName",
                                                  "source" : [
                                                    {
                                                      "context" : "translation",
                                                      "element" : "displayName",
                                                      "variable" : "display"
                                                    }
                                                  ],
                                                  "target" : [
                                                    {
                                                      "context" : "coding",
                                                      "contextType" : "variable",
                                                      "element" : "display",
                                                      "transform" : "cast",
                                                      "parameter" : [
                                                        {
                                                          "valueId" : "display"
                                                        },
                                                        {
                                                          "valueString" : "string"
                                                        }
                                                      ]
                                                    }
                                                  ]
                                                },
                                                {
                                                  "name" : "codeSystemVersion",
                                                  "source" : [
                                                    {
                                                      "context" : "translation",
                                                      "element" : "codeSystemVersion",
                                                      "variable" : "version"
                                                    }
                                                  ],
                                                  "target" : [
                                                    {
                                                      "context" : "coding",
                                                      "contextType" : "variable",
                                                      "element" : "version",
                                                      "transform" : "cast",
                                                      "parameter" : [
                                                        {
                                                          "valueId" : "version"
                                                        },
                                                        {
                                                          "valueString" : "string"
                                                        }
                                                      ]
                                                    }
                                                  ]
                                                },
                                                {
                                                  "name" : "qualifier",
                                                  "source" : [
                                                    {
                                                      "context" : "translation",
                                                      "element" : "qualifier",
                                                      "variable" : "qualifier"
                                                    }
                                                  ],
                                                  "rule" : [
                                                    {
                                                      "name" : "value",
                                                      "source" : [
                                                        {
                                                          "context" : "qualifier",
                                                          "element" : "value",
                                                          "variable" : "value"
                                                        }
                                                      ],
                                                      "target" : [
                                                        {
                                                          "context" : "ce",
                                                          "contextType" : "variable",
                                                          "element" : "coding",
                                                          "variable" : "coding"
                                                        }
                                                      ],
                                                      "rule" : [
                                                        {
                                                          "name" : "code",
                                                          "source" : [
                                                            {
                                                              "context" : "value",
                                                              "element" : "code",
                                                              "variable" : "code"
                                                            }
                                                          ],
                                                          "target" : [
                                                            {
                                                              "context" : "coding",
                                                              "contextType" : "variable",
                                                              "element" : "code",
                                                              "transform" : "cast",
                                                              "parameter" : [
                                                                {
                                                                  "valueId" : "code"
                                                                },
                                                                {
                                                                  "valueString" : "string"
                                                                }
                                                              ]
                                                            }
                                                          ]
                                                        },
                                                        {
                                                          "name" : "codeSystem",
                                                          "source" : [
                                                            {
                                                              "context" : "value",
                                                              "element" : "codeSystem",
                                                              "variable" : "system"
                                                            }
                                                          ],
                                                          "target" : [
                                                            {
                                                              "context" : "coding",
                                                              "contextType" : "variable",
                                                              "element" : "system",
                                                              "transform" : "translate",
                                                              "parameter" : [
                                                                {
                                                                  "valueId" : "system"
                                                                },
                                                                {
                                                                  "valueString" : "http://hl7.org/fhir/ConceptMap/special-oid2uri"
                                                                },
                                                                {
                                                                  "valueString" : "uri"
                                                                }
                                                              ]
                                                            }
                                                          ]
                                                        },
                                                        {
                                                          "name" : "displayName",
                                                          "source" : [
                                                            {
                                                              "context" : "value",
                                                              "element" : "displayName",
                                                              "variable" : "display"
                                                            }
                                                          ],
                                                          "target" : [
                                                            {
                                                              "context" : "coding",
                                                              "contextType" : "variable",
                                                              "element" : "display",
                                                              "transform" : "cast",
                                                              "parameter" : [
                                                                {
                                                                  "valueId" : "display"
                                                                },
                                                                {
                                                                  "valueString" : "string"
                                                                }
                                                              ]
                                                            }
                                                          ]
                                                        },
                                                        {
                                                          "name" : "codeSystemVersion",
                                                          "source" : [
                                                            {
                                                              "context" : "value",
                                                              "element" : "codeSystemVersion",
                                                              "variable" : "version"
                                                            }
                                                          ],
                                                          "target" : [
                                                            {
                                                              "context" : "coding",
                                                              "contextType" : "variable",
                                                              "element" : "version",
                                                              "transform" : "cast",
                                                              "parameter" : [
                                                                {
                                                                  "valueId" : "version"
                                                                },
                                                                {
                                                                  "valueString" : "string"
                                                                }
                                                              ]
                                                            }
                                                          ]
                                                        }
                                                      ]
                                                    }
                                                  ]
                                                }
                                              ]
                                            }
                                          ]
                                        }
                                      ]
                                    },
                                    {
                                      "name" : "valueQuantity",
                                      "source" : [
                                        {
                                          "context" : "obs",
                                          "type" : "PQ",
                                          "element" : "value",
                                          "variable" : "val"
                                        }
                                      ],
                                      "rule" : [
                                        {
                                          "name" : "quantity",
                                          "source" : [
                                            {
                                              "context" : "val"
                                            }
                                          ],
                                          "target" : [
                                            {
                                              "context" : "observation",
                                              "contextType" : "variable",
                                              "element" : "value",
                                              "variable" : "quantity",
                                              "transform" : "create",
                                              "parameter" : [
                                                {
                                                  "valueString" : "Quantity"
                                                }
                                              ]
                                            }
                                          ],
                                          "rule" : [
                                            {
                                              "name" : "value",
                                              "source" : [
                                                {
                                                  "context" : "val",
                                                  "element" : "value",
                                                  "variable" : "value"
                                                }
                                              ],
                                              "target" : [
                                                {
                                                  "context" : "quantity",
                                                  "contextType" : "variable",
                                                  "element" : "value",
                                                  "transform" : "copy",
                                                  "parameter" : [
                                                    {
                                                      "valueId" : "value"
                                                    }
                                                  ]
                                                }
                                              ]
                                            },
                                            {
                                              "name" : "unit",
                                              "source" : [
                                                {
                                                  "context" : "val",
                                                  "element" : "unit",
                                                  "variable" : "unit"
                                                }
                                              ],
                                              "target" : [
                                                {
                                                  "context" : "quantity",
                                                  "contextType" : "variable",
                                                  "element" : "unit",
                                                  "transform" : "copy",
                                                  "parameter" : [
                                                    {
                                                      "valueId" : "unit"
                                                    }
                                                  ]
                                                }
                                              ]
                                            }
                                          ]
                                        }
                                      ]
                                    },
                                    {
                                      "name" : "value",
                                      "source" : [
                                        {
                                          "context" : "obs",
                                          "type" : "ST",
                                          "element" : "value",
                                          "variable" : "value"
                                        }
                                      ],
                                      "target" : [
                                        {
                                          "context" : "observation",
                                          "contextType" : "variable",
                                          "element" : "value",
                                          "transform" : "create",
                                          "parameter" : [
                                            {
                                              "valueString" : "string"
                                            }
                                          ]
                                        },
                                        {
                                          "context" : "observation",
                                          "contextType" : "variable",
                                          "element" : "value",
                                          "transform" : "evaluate",
                                          "parameter" : [
                                            {
                                              "valueString" : "value.dataString"
                                            }
                                          ]
                                        }
                                      ]
                                    }
                                  ]
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  ],
                  "documentation" : "Trasferimento post dimissione-------------------------------------------------------------------------------------------------------------------------------------"
                },
                {
                  "name" : "entryrel2",
                  "source" : [
                    {
                      "context" : "act",
                      "element" : "entryRelationship",
                      "variable" : "entryrel2"
                    }
                  ],
                  "rule" : [
                    {
                      "name" : "obs",
                      "source" : [
                        {
                          "context" : "entryrel2",
                          "element" : "observation",
                          "variable" : "obs"
                        }
                      ],
                      "rule" : [
                        {
                          "name" : "222",
                          "source" : [
                            {
                              "context" : "obs",
                              "element" : "code",
                              "variable" : "code",
                              "condition" : "(code = '29308-4')"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "bundle",
                              "contextType" : "variable",
                              "element" : "entry",
                              "variable" : "e1"
                            },
                            {
                              "context" : "e1",
                              "contextType" : "variable",
                              "element" : "request",
                              "variable" : "request",
                              "transform" : "create",
                              "parameter" : [
                                {
                                  "valueString" : "BackboneElement"
                                }
                              ]
                            },
                            {
                              "context" : "request",
                              "contextType" : "variable",
                              "element" : "method",
                              "transform" : "copy",
                              "parameter" : [
                                {
                                  "valueString" : "POST"
                                }
                              ]
                            },
                            {
                              "context" : "e1",
                              "contextType" : "variable",
                              "element" : "resource",
                              "variable" : "observation",
                              "transform" : "create",
                              "parameter" : [
                                {
                                  "valueString" : "Observation"
                                }
                              ]
                            },
                            {
                              "context" : "observation",
                              "contextType" : "variable",
                              "element" : "id",
                              "variable" : "uuid1",
                              "transform" : "uuid"
                            },
                            {
                              "context" : "e1",
                              "contextType" : "variable",
                              "element" : "fullUrl",
                              "transform" : "append",
                              "parameter" : [
                                {
                                  "valueString" : "https://example/Observation/"
                                },
                                {
                                  "valueId" : "uuid1"
                                }
                              ]
                            },
                            {
                              "context" : "request",
                              "contextType" : "variable",
                              "element" : "url",
                              "transform" : "copy",
                              "parameter" : [
                                {
                                  "valueString" : "Observation"
                                }
                              ]
                            },
                            {
                              "context" : "encountert",
                              "contextType" : "variable",
                              "element" : "reasonReference",
                              "variable" : "reference",
                              "transform" : "create",
                              "parameter" : [
                                {
                                  "valueString" : "Reference"
                                }
                              ]
                            },
                            {
                              "context" : "reference",
                              "contextType" : "variable",
                              "element" : "reference",
                              "transform" : "evaluate",
                              "parameter" : [
                                {
                                  "valueString" : "'https://example/Observation/' + %observation.id"
                                }
                              ]
                            }
                          ],
                          "rule" : [
                            {
                              "name" : "reference",
                              "source" : [
                                {
                                  "context" : "obs"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "observation",
                                  "contextType" : "variable",
                                  "element" : "subject",
                                  "variable" : "reference",
                                  "transform" : "create",
                                  "parameter" : [
                                    {
                                      "valueString" : "Reference"
                                    }
                                  ]
                                },
                                {
                                  "context" : "reference",
                                  "contextType" : "variable",
                                  "element" : "reference",
                                  "transform" : "evaluate",
                                  "parameter" : [
                                    {
                                      "valueString" : "'https://example/Patient/' + %patient.id"
                                    }
                                  ]
                                }
                              ]
                            },
                            {
                              "name" : "reference",
                              "source" : [
                                {
                                  "context" : "obs"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "observation",
                                  "contextType" : "variable",
                                  "element" : "encounter",
                                  "variable" : "reference",
                                  "transform" : "create",
                                  "parameter" : [
                                    {
                                      "valueString" : "Reference"
                                    }
                                  ]
                                },
                                {
                                  "context" : "reference",
                                  "contextType" : "variable",
                                  "element" : "reference",
                                  "transform" : "evaluate",
                                  "parameter" : [
                                    {
                                      "valueString" : "'https://example/Encounter/' + %encountert.id"
                                    }
                                  ]
                                }
                              ]
                            },
                            {
                              "name" : "code",
                              "source" : [
                                {
                                  "context" : "obs",
                                  "element" : "code",
                                  "variable" : "vvv"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "observation",
                                  "contextType" : "variable",
                                  "element" : "code",
                                  "variable" : "vvv",
                                  "transform" : "create"
                                }
                              ]
                            },
                            {
                              "name" : "statusCode",
                              "source" : [
                                {
                                  "context" : "obs",
                                  "element" : "statusCode",
                                  "variable" : "statusc",
                                  "condition" : "(code = 'completed')"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "observation",
                                  "contextType" : "variable",
                                  "element" : "status",
                                  "transform" : "copy",
                                  "parameter" : [
                                    {
                                      "valueString" : "final"
                                    }
                                  ]
                                }
                              ]
                            },
                            {
                              "name" : "statusCode",
                              "source" : [
                                {
                                  "context" : "obs",
                                  "element" : "statusCode",
                                  "variable" : "statusc",
                                  "condition" : "(code = 'active')"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "observation",
                                  "contextType" : "variable",
                                  "element" : "status",
                                  "transform" : "copy",
                                  "parameter" : [
                                    {
                                      "valueString" : "registered"
                                    }
                                  ]
                                }
                              ]
                            },
                            {
                              "name" : "statusCode",
                              "source" : [
                                {
                                  "context" : "obs",
                                  "element" : "statusCode",
                                  "variable" : "statusc",
                                  "condition" : "(code = 'aborted')"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "observation",
                                  "contextType" : "variable",
                                  "element" : "status",
                                  "transform" : "copy",
                                  "parameter" : [
                                    {
                                      "valueString" : "cancelled"
                                    }
                                  ]
                                }
                              ]
                            },
                            {
                              "name" : "statusCode",
                              "source" : [
                                {
                                  "context" : "obs",
                                  "element" : "statusCode",
                                  "variable" : "statusc",
                                  "condition" : "(code = 'suspended')"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "observation",
                                  "contextType" : "variable",
                                  "element" : "status",
                                  "transform" : "copy",
                                  "parameter" : [
                                    {
                                      "valueString" : "partial"
                                    }
                                  ]
                                }
                              ]
                            },
                            {
                              "name" : "status",
                              "source" : [
                                {
                                  "context" : "obs"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "observation",
                                  "contextType" : "variable",
                                  "element" : "status",
                                  "transform" : "copy",
                                  "parameter" : [
                                    {
                                      "valueString" : "final"
                                    }
                                  ]
                                }
                              ],
                              "documentation" : "obs where obs.statusCode.exists().not() then {"
                            },
                            {
                              "name" : "value2",
                              "source" : [
                                {
                                  "context" : "obs",
                                  "element" : "effectiveTime",
                                  "variable" : "effectiveTime"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "observation",
                                  "contextType" : "variable",
                                  "element" : "effective",
                                  "variable" : "value",
                                  "transform" : "create",
                                  "parameter" : [
                                    {
                                      "valueString" : "dateTime"
                                    }
                                  ]
                                }
                              ],
                              "dependent" : [
                                {
                                  "name" : "TSDateTime",
                                  "variable" : [
                                    "effectiveTime",
                                    "value"
                                  ]
                                }
                              ],
                              "documentation" : "}\"statuscode\";"
                            },
                            {
                              "name" : "where",
                              "source" : [
                                {
                                  "context" : "obs",
                                  "condition" : "effectiveTime.low.exists() or effectiveTime.high.exists()"
                                }
                              ],
                              "rule" : [
                                {
                                  "name" : "effectiveTime",
                                  "source" : [
                                    {
                                      "context" : "obs",
                                      "element" : "effectiveTime",
                                      "variable" : "eff"
                                    }
                                  ],
                                  "target" : [
                                    {
                                      "context" : "observation",
                                      "contextType" : "variable",
                                      "element" : "effective",
                                      "variable" : "period",
                                      "transform" : "create",
                                      "parameter" : [
                                        {
                                          "valueString" : "Period"
                                        }
                                      ]
                                    }
                                  ],
                                  "dependent" : [
                                    {
                                      "name" : "IVLTSPeriod",
                                      "variable" : [
                                        "eff",
                                        "period"
                                      ]
                                    }
                                  ]
                                }
                              ]
                            },
                            {
                              "name" : "val",
                              "source" : [
                                {
                                  "context" : "obs",
                                  "element" : "value",
                                  "variable" : "val"
                                }
                              ],
                              "rule" : [
                                {
                                  "name" : "coding",
                                  "source" : [
                                    {
                                      "context" : "val"
                                    }
                                  ],
                                  "target" : [
                                    {
                                      "context" : "observation",
                                      "contextType" : "variable",
                                      "element" : "value",
                                      "variable" : "ce",
                                      "transform" : "create",
                                      "parameter" : [
                                        {
                                          "valueString" : "CodeableConcept"
                                        }
                                      ]
                                    }
                                  ],
                                  "rule" : [
                                    {
                                      "name" : "originltext",
                                      "source" : [
                                        {
                                          "context" : "val",
                                          "element" : "originalText",
                                          "variable" : "originalText"
                                        }
                                      ],
                                      "rule" : [
                                        {
                                          "name" : "reference",
                                          "source" : [
                                            {
                                              "context" : "originalText",
                                              "element" : "reference",
                                              "variable" : "reference"
                                            }
                                          ],
                                          "target" : [
                                            {
                                              "context" : "ce",
                                              "contextType" : "variable",
                                              "element" : "text",
                                              "transform" : "copy",
                                              "parameter" : [
                                                {
                                                  "valueId" : "reference"
                                                }
                                              ]
                                            }
                                          ]
                                        }
                                      ]
                                    },
                                    {
                                      "name" : "code",
                                      "source" : [
                                        {
                                          "context" : "val"
                                        }
                                      ],
                                      "target" : [
                                        {
                                          "context" : "ce",
                                          "contextType" : "variable",
                                          "element" : "coding",
                                          "variable" : "coding"
                                        }
                                      ],
                                      "rule" : [
                                        {
                                          "name" : "code",
                                          "source" : [
                                            {
                                              "context" : "val",
                                              "element" : "code",
                                              "variable" : "code"
                                            }
                                          ],
                                          "target" : [
                                            {
                                              "context" : "coding",
                                              "contextType" : "variable",
                                              "element" : "code",
                                              "transform" : "cast",
                                              "parameter" : [
                                                {
                                                  "valueId" : "code"
                                                },
                                                {
                                                  "valueString" : "string"
                                                }
                                              ]
                                            }
                                          ]
                                        },
                                        {
                                          "name" : "codeSystem",
                                          "source" : [
                                            {
                                              "context" : "val",
                                              "element" : "codeSystem",
                                              "variable" : "system"
                                            }
                                          ],
                                          "target" : [
                                            {
                                              "context" : "coding",
                                              "contextType" : "variable",
                                              "element" : "system",
                                              "transform" : "translate",
                                              "parameter" : [
                                                {
                                                  "valueId" : "system"
                                                },
                                                {
                                                  "valueString" : "http://hl7.org/fhir/ConceptMap/special-oid2uri"
                                                },
                                                {
                                                  "valueString" : "uri"
                                                }
                                              ]
                                            }
                                          ]
                                        },
                                        {
                                          "name" : "displayName",
                                          "source" : [
                                            {
                                              "context" : "val",
                                              "element" : "displayName",
                                              "variable" : "display"
                                            }
                                          ],
                                          "target" : [
                                            {
                                              "context" : "coding",
                                              "contextType" : "variable",
                                              "element" : "display",
                                              "transform" : "cast",
                                              "parameter" : [
                                                {
                                                  "valueId" : "display"
                                                },
                                                {
                                                  "valueString" : "string"
                                                }
                                              ]
                                            }
                                          ]
                                        },
                                        {
                                          "name" : "codeSystemVersion",
                                          "source" : [
                                            {
                                              "context" : "val",
                                              "element" : "codeSystemVersion",
                                              "variable" : "version"
                                            }
                                          ],
                                          "target" : [
                                            {
                                              "context" : "coding",
                                              "contextType" : "variable",
                                              "element" : "version",
                                              "transform" : "cast",
                                              "parameter" : [
                                                {
                                                  "valueId" : "version"
                                                },
                                                {
                                                  "valueString" : "string"
                                                }
                                              ]
                                            }
                                          ]
                                        }
                                      ]
                                    },
                                    {
                                      "name" : "translation",
                                      "source" : [
                                        {
                                          "context" : "val",
                                          "element" : "translation",
                                          "variable" : "translation"
                                        }
                                      ],
                                      "target" : [
                                        {
                                          "context" : "ce",
                                          "contextType" : "variable",
                                          "element" : "coding",
                                          "variable" : "coding"
                                        }
                                      ],
                                      "rule" : [
                                        {
                                          "name" : "code",
                                          "source" : [
                                            {
                                              "context" : "translation",
                                              "element" : "code",
                                              "variable" : "code"
                                            }
                                          ],
                                          "target" : [
                                            {
                                              "context" : "coding",
                                              "contextType" : "variable",
                                              "element" : "code",
                                              "transform" : "cast",
                                              "parameter" : [
                                                {
                                                  "valueId" : "code"
                                                },
                                                {
                                                  "valueString" : "string"
                                                }
                                              ]
                                            }
                                          ]
                                        },
                                        {
                                          "name" : "codeSystem",
                                          "source" : [
                                            {
                                              "context" : "translation",
                                              "element" : "codeSystem",
                                              "variable" : "system"
                                            }
                                          ],
                                          "target" : [
                                            {
                                              "context" : "coding",
                                              "contextType" : "variable",
                                              "element" : "system",
                                              "transform" : "translate",
                                              "parameter" : [
                                                {
                                                  "valueId" : "system"
                                                },
                                                {
                                                  "valueString" : "http://hl7.org/fhir/ConceptMap/special-oid2uri"
                                                },
                                                {
                                                  "valueString" : "uri"
                                                }
                                              ]
                                            }
                                          ]
                                        },
                                        {
                                          "name" : "displayName",
                                          "source" : [
                                            {
                                              "context" : "translation",
                                              "element" : "displayName",
                                              "variable" : "display"
                                            }
                                          ],
                                          "target" : [
                                            {
                                              "context" : "coding",
                                              "contextType" : "variable",
                                              "element" : "display",
                                              "transform" : "cast",
                                              "parameter" : [
                                                {
                                                  "valueId" : "display"
                                                },
                                                {
                                                  "valueString" : "string"
                                                }
                                              ]
                                            }
                                          ]
                                        },
                                        {
                                          "name" : "codeSystemVersion",
                                          "source" : [
                                            {
                                              "context" : "translation",
                                              "element" : "codeSystemVersion",
                                              "variable" : "version"
                                            }
                                          ],
                                          "target" : [
                                            {
                                              "context" : "coding",
                                              "contextType" : "variable",
                                              "element" : "version",
                                              "transform" : "cast",
                                              "parameter" : [
                                                {
                                                  "valueId" : "version"
                                                },
                                                {
                                                  "valueString" : "string"
                                                }
                                              ]
                                            }
                                          ]
                                        },
                                        {
                                          "name" : "qualifier",
                                          "source" : [
                                            {
                                              "context" : "translation",
                                              "element" : "qualifier",
                                              "variable" : "qualifier"
                                            }
                                          ],
                                          "rule" : [
                                            {
                                              "name" : "value",
                                              "source" : [
                                                {
                                                  "context" : "qualifier",
                                                  "element" : "value",
                                                  "variable" : "value"
                                                }
                                              ],
                                              "target" : [
                                                {
                                                  "context" : "ce",
                                                  "contextType" : "variable",
                                                  "element" : "coding",
                                                  "variable" : "coding"
                                                }
                                              ],
                                              "rule" : [
                                                {
                                                  "name" : "code",
                                                  "source" : [
                                                    {
                                                      "context" : "value",
                                                      "element" : "code",
                                                      "variable" : "code"
                                                    }
                                                  ],
                                                  "target" : [
                                                    {
                                                      "context" : "coding",
                                                      "contextType" : "variable",
                                                      "element" : "code",
                                                      "transform" : "cast",
                                                      "parameter" : [
                                                        {
                                                          "valueId" : "code"
                                                        },
                                                        {
                                                          "valueString" : "string"
                                                        }
                                                      ]
                                                    }
                                                  ]
                                                },
                                                {
                                                  "name" : "codeSystem",
                                                  "source" : [
                                                    {
                                                      "context" : "value",
                                                      "element" : "codeSystem",
                                                      "variable" : "system"
                                                    }
                                                  ],
                                                  "target" : [
                                                    {
                                                      "context" : "coding",
                                                      "contextType" : "variable",
                                                      "element" : "system",
                                                      "transform" : "translate",
                                                      "parameter" : [
                                                        {
                                                          "valueId" : "system"
                                                        },
                                                        {
                                                          "valueString" : "http://hl7.org/fhir/ConceptMap/special-oid2uri"
                                                        },
                                                        {
                                                          "valueString" : "uri"
                                                        }
                                                      ]
                                                    }
                                                  ]
                                                },
                                                {
                                                  "name" : "displayName",
                                                  "source" : [
                                                    {
                                                      "context" : "value",
                                                      "element" : "displayName",
                                                      "variable" : "display"
                                                    }
                                                  ],
                                                  "target" : [
                                                    {
                                                      "context" : "coding",
                                                      "contextType" : "variable",
                                                      "element" : "display",
                                                      "transform" : "cast",
                                                      "parameter" : [
                                                        {
                                                          "valueId" : "display"
                                                        },
                                                        {
                                                          "valueString" : "string"
                                                        }
                                                      ]
                                                    }
                                                  ]
                                                },
                                                {
                                                  "name" : "codeSystemVersion",
                                                  "source" : [
                                                    {
                                                      "context" : "value",
                                                      "element" : "codeSystemVersion",
                                                      "variable" : "version"
                                                    }
                                                  ],
                                                  "target" : [
                                                    {
                                                      "context" : "coding",
                                                      "contextType" : "variable",
                                                      "element" : "version",
                                                      "transform" : "cast",
                                                      "parameter" : [
                                                        {
                                                          "valueId" : "version"
                                                        },
                                                        {
                                                          "valueString" : "string"
                                                        }
                                                      ]
                                                    }
                                                  ]
                                                }
                                              ]
                                            }
                                          ]
                                        }
                                      ]
                                    }
                                  ]
                                }
                              ]
                            },
                            {
                              "name" : "value",
                              "source" : [
                                {
                                  "context" : "obs",
                                  "type" : "INT",
                                  "element" : "value",
                                  "variable" : "int"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "ob",
                                  "contextType" : "variable",
                                  "element" : "value",
                                  "transform" : "evaluate",
                                  "parameter" : [
                                    {
                                      "valueString" : "int.value"
                                    }
                                  ]
                                }
                              ]
                            },
                            {
                              "name" : "boolean",
                              "source" : [
                                {
                                  "context" : "obs",
                                  "type" : "BL",
                                  "element" : "value",
                                  "variable" : "boolean"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "ob",
                                  "contextType" : "variable",
                                  "element" : "value",
                                  "transform" : "evaluate",
                                  "parameter" : [
                                    {
                                      "valueString" : "boolean.value"
                                    }
                                  ]
                                }
                              ]
                            },
                            {
                              "name" : "valueQuantity",
                              "source" : [
                                {
                                  "context" : "obs",
                                  "type" : "PQ",
                                  "element" : "value",
                                  "variable" : "val"
                                }
                              ],
                              "rule" : [
                                {
                                  "name" : "quantity",
                                  "source" : [
                                    {
                                      "context" : "val"
                                    }
                                  ],
                                  "target" : [
                                    {
                                      "context" : "ob",
                                      "contextType" : "variable",
                                      "element" : "value",
                                      "variable" : "quantity",
                                      "transform" : "create",
                                      "parameter" : [
                                        {
                                          "valueString" : "Quantity"
                                        }
                                      ]
                                    }
                                  ],
                                  "rule" : [
                                    {
                                      "name" : "value",
                                      "source" : [
                                        {
                                          "context" : "val",
                                          "element" : "value",
                                          "variable" : "value"
                                        }
                                      ],
                                      "target" : [
                                        {
                                          "context" : "quantity",
                                          "contextType" : "variable",
                                          "element" : "value",
                                          "transform" : "copy",
                                          "parameter" : [
                                            {
                                              "valueId" : "value"
                                            }
                                          ]
                                        }
                                      ]
                                    },
                                    {
                                      "name" : "unit",
                                      "source" : [
                                        {
                                          "context" : "val",
                                          "element" : "unit",
                                          "variable" : "unit"
                                        }
                                      ],
                                      "target" : [
                                        {
                                          "context" : "quantity",
                                          "contextType" : "variable",
                                          "element" : "unit",
                                          "transform" : "copy",
                                          "parameter" : [
                                            {
                                              "valueId" : "unit"
                                            }
                                          ]
                                        }
                                      ]
                                    }
                                  ]
                                }
                              ]
                            },
                            {
                              "name" : "value",
                              "source" : [
                                {
                                  "context" : "obs",
                                  "type" : "ST",
                                  "element" : "value",
                                  "variable" : "value"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "ob",
                                  "contextType" : "variable",
                                  "element" : "value",
                                  "transform" : "create",
                                  "parameter" : [
                                    {
                                      "valueString" : "string"
                                    }
                                  ]
                                },
                                {
                                  "context" : "ob",
                                  "contextType" : "variable",
                                  "element" : "value",
                                  "transform" : "evaluate",
                                  "parameter" : [
                                    {
                                      "valueString" : "value.dataString"
                                    }
                                  ]
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  ],
                  "documentation" : "--------------Diagnosi alla dimissione-------------------------------------------------------------"
                },
                {
                  "name" : "3",
                  "source" : [
                    {
                      "context" : "act",
                      "element" : "entryRelationship",
                      "variable" : "entriRel3"
                    }
                  ],
                  "rule" : [
                    {
                      "name" : "x",
                      "source" : [
                        {
                          "context" : "entriRel3",
                          "element" : "observation",
                          "variable" : "obs2"
                        }
                      ],
                      "rule" : [
                        {
                          "name" : "act",
                          "source" : [
                            {
                              "context" : "obs2",
                              "element" : "code",
                              "variable" : "code"
                            }
                          ],
                          "rule" : [
                            {
                              "name" : "entry-obs1",
                              "source" : [
                                {
                                  "context" : "code",
                                  "element" : "code",
                                  "condition" : "(code.code = '11302-7')"
                                }
                              ],
                              "rule" : [
                                {
                                  "name" : "hospital",
                                  "source" : [
                                    {
                                      "context" : "obs2"
                                    }
                                  ],
                                  "target" : [
                                    {
                                      "context" : "encountert",
                                      "contextType" : "variable",
                                      "element" : "hospitalization",
                                      "variable" : "hospital"
                                    }
                                  ],
                                  "rule" : [
                                    {
                                      "name" : "value",
                                      "source" : [
                                        {
                                          "context" : "obs2",
                                          "element" : "value",
                                          "variable" : "vvv"
                                        }
                                      ],
                                      "target" : [
                                        {
                                          "context" : "hospital",
                                          "contextType" : "variable",
                                          "element" : "dischargeDisposition",
                                          "variable" : "vvv",
                                          "transform" : "create"
                                        }
                                      ]
                                    }
                                  ]
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  ],
                  "documentation" : "--------Esito----------------------------"
                }
              ]
            }
          ]
        },
        {
          "name" : "entry",
          "source" : [
            {
              "context" : "src",
              "element" : "entry",
              "variable" : "entry1"
            }
          ],
          "rule" : [
            {
              "name" : "obs",
              "source" : [
                {
                  "context" : "entry1",
                  "element" : "observation",
                  "variable" : "obs"
                }
              ],
              "rule" : [
                {
                  "name" : "obstarg",
                  "source" : [
                    {
                      "context" : "obs"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "bundle",
                      "contextType" : "variable",
                      "element" : "entry",
                      "variable" : "e1"
                    },
                    {
                      "context" : "e1",
                      "contextType" : "variable",
                      "element" : "request",
                      "variable" : "request",
                      "transform" : "create",
                      "parameter" : [
                        {
                          "valueString" : "BackboneElement"
                        }
                      ]
                    },
                    {
                      "context" : "request",
                      "contextType" : "variable",
                      "element" : "method",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "POST"
                        }
                      ]
                    },
                    {
                      "context" : "e1",
                      "contextType" : "variable",
                      "element" : "resource",
                      "variable" : "observation",
                      "transform" : "create",
                      "parameter" : [
                        {
                          "valueString" : "Observation"
                        }
                      ]
                    },
                    {
                      "context" : "observation",
                      "contextType" : "variable",
                      "element" : "id",
                      "variable" : "uuid1",
                      "transform" : "uuid"
                    },
                    {
                      "context" : "e1",
                      "contextType" : "variable",
                      "element" : "fullUrl",
                      "transform" : "append",
                      "parameter" : [
                        {
                          "valueString" : "https://example/Observation/"
                        },
                        {
                          "valueId" : "uuid1"
                        }
                      ]
                    },
                    {
                      "context" : "request",
                      "contextType" : "variable",
                      "element" : "url",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "Observation"
                        }
                      ]
                    },
                    {
                      "context" : "tgt",
                      "contextType" : "variable",
                      "element" : "entry",
                      "variable" : "reference",
                      "transform" : "create",
                      "parameter" : [
                        {
                          "valueString" : "Reference"
                        }
                      ]
                    },
                    {
                      "context" : "reference",
                      "contextType" : "variable",
                      "element" : "reference",
                      "transform" : "evaluate",
                      "parameter" : [
                        {
                          "valueString" : "'https://example/Observation/' + %observation.id"
                        }
                      ]
                    }
                  ],
                  "rule" : [
                    {
                      "name" : "value",
                      "source" : [
                        {
                          "context" : "obs",
                          "element" : "value",
                          "variable" : "val",
                          "condition" : "('xsi:type' = 'BL')"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "observation",
                          "contextType" : "variable",
                          "element" : "value",
                          "transform" : "evaluate",
                          "parameter" : [
                            {
                              "valueString" : "val.value"
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "name" : "act",
                      "source" : [
                        {
                          "context" : "obs"
                        }
                      ],
                      "dependent" : [
                        {
                          "name" : "Observation",
                          "variable" : [
                            "obs",
                            "patient",
                            "enc",
                            "observation",
                            "bundle"
                          ]
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ]
        }
      ]
    },
    {
      "name" : "ClinicalDocumentSectionTerapiaFarmacologicaDimissione",
      "typeMode" : "none",
      "documentation" : "-----------------------------------------------------------------------------------------------------------------------\r\n------------------------------TerapiaFarmacologicaDimissione-----------------------------------------------------------------------------------------",
      "input" : [
        {
          "name" : "cda",
          "type" : "ClinicalDocument",
          "mode" : "source"
        },
        {
          "name" : "src",
          "type" : "Section",
          "mode" : "source"
        },
        {
          "name" : "patient",
          "type" : "Patient",
          "mode" : "target"
        },
        {
          "name" : "tgt",
          "mode" : "target"
        },
        {
          "name" : "bundle",
          "type" : "Bundle",
          "mode" : "target"
        },
        {
          "name" : "enc",
          "type" : "Encounter",
          "mode" : "target"
        }
      ],
      "rule" : [
        {
          "name" : "title",
          "source" : [
            {
              "context" : "src",
              "element" : "title",
              "variable" : "t"
            }
          ],
          "target" : [
            {
              "context" : "tgt",
              "contextType" : "variable",
              "element" : "title",
              "transform" : "evaluate",
              "parameter" : [
                {
                  "valueString" : "t.dataString"
                }
              ]
            }
          ]
        },
        {
          "name" : "code",
          "source" : [
            {
              "context" : "src",
              "element" : "code",
              "variable" : "vvv"
            }
          ],
          "target" : [
            {
              "context" : "tgt",
              "contextType" : "variable",
              "element" : "code",
              "variable" : "vvv",
              "transform" : "create"
            }
          ]
        },
        {
          "name" : "text",
          "source" : [
            {
              "context" : "src",
              "condition" : "src.entry.exists().not()"
            }
          ],
          "rule" : [
            {
              "name" : "note",
              "source" : [
                {
                  "context" : "src",
                  "element" : "text",
                  "variable" : "cdaText"
                }
              ],
              "target" : [
                {
                  "context" : "bundle",
                  "contextType" : "variable",
                  "element" : "entry",
                  "variable" : "e1"
                },
                {
                  "context" : "e1",
                  "contextType" : "variable",
                  "element" : "request",
                  "variable" : "request",
                  "transform" : "create",
                  "parameter" : [
                    {
                      "valueString" : "BackboneElement"
                    }
                  ]
                },
                {
                  "context" : "request",
                  "contextType" : "variable",
                  "element" : "method",
                  "transform" : "copy",
                  "parameter" : [
                    {
                      "valueString" : "POST"
                    }
                  ]
                },
                {
                  "context" : "e1",
                  "contextType" : "variable",
                  "element" : "resource",
                  "variable" : "medRq",
                  "transform" : "create",
                  "parameter" : [
                    {
                      "valueString" : "MedicationRequest"
                    }
                  ]
                },
                {
                  "context" : "medRq",
                  "contextType" : "variable",
                  "element" : "id",
                  "variable" : "uuid1",
                  "transform" : "uuid"
                },
                {
                  "context" : "e1",
                  "contextType" : "variable",
                  "element" : "fullUrl",
                  "transform" : "append",
                  "parameter" : [
                    {
                      "valueString" : "https://example/MedicationRequest/"
                    },
                    {
                      "valueId" : "uuid1"
                    }
                  ]
                },
                {
                  "context" : "request",
                  "contextType" : "variable",
                  "element" : "url",
                  "transform" : "copy",
                  "parameter" : [
                    {
                      "valueString" : "MedicationRequest"
                    }
                  ]
                },
                {
                  "context" : "tgt",
                  "contextType" : "variable",
                  "element" : "entry",
                  "variable" : "reference",
                  "transform" : "create",
                  "parameter" : [
                    {
                      "valueString" : "Reference"
                    }
                  ]
                },
                {
                  "context" : "reference",
                  "contextType" : "variable",
                  "element" : "reference",
                  "transform" : "evaluate",
                  "parameter" : [
                    {
                      "valueString" : "'https://example/MedicationRequest/' + %medRq.id"
                    }
                  ]
                },
                {
                  "context" : "medRq",
                  "contextType" : "variable",
                  "element" : "note",
                  "variable" : "note",
                  "transform" : "create",
                  "parameter" : [
                    {
                      "valueString" : "Annotation"
                    }
                  ]
                }
              ],
              "rule" : [
                {
                  "name" : "reference",
                  "source" : [
                    {
                      "context" : "cdaText"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "note",
                      "contextType" : "variable",
                      "element" : "text",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueId" : "cdaText"
                        }
                      ]
                    }
                  ]
                },
                {
                  "name" : "reference",
                  "source" : [
                    {
                      "context" : "cdaText"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "medRq",
                      "contextType" : "variable",
                      "element" : "subject",
                      "variable" : "reference",
                      "transform" : "create",
                      "parameter" : [
                        {
                          "valueString" : "Reference"
                        }
                      ]
                    },
                    {
                      "context" : "reference",
                      "contextType" : "variable",
                      "element" : "reference",
                      "transform" : "evaluate",
                      "parameter" : [
                        {
                          "valueString" : "'https://example/Patient/' + %patient.id"
                        }
                      ]
                    }
                  ]
                },
                {
                  "name" : "reference",
                  "source" : [
                    {
                      "context" : "cdaText"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "medRq",
                      "contextType" : "variable",
                      "element" : "encounter",
                      "variable" : "reference",
                      "transform" : "create",
                      "parameter" : [
                        {
                          "valueString" : "Reference"
                        }
                      ]
                    },
                    {
                      "context" : "reference",
                      "contextType" : "variable",
                      "element" : "reference",
                      "transform" : "evaluate",
                      "parameter" : [
                        {
                          "valueString" : "'https://example/Encounter/' + %enc.id"
                        }
                      ]
                    }
                  ]
                },
                {
                  "name" : "status",
                  "source" : [
                    {
                      "context" : "cdaText"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "medRq",
                      "contextType" : "variable",
                      "element" : "status",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "active"
                        }
                      ]
                    }
                  ]
                },
                {
                  "name" : "intent",
                  "source" : [
                    {
                      "context" : "cdaText"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "medRq",
                      "contextType" : "variable",
                      "element" : "intent",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "order"
                        }
                      ]
                    }
                  ]
                },
                {
                  "name" : "auth",
                  "source" : [
                    {
                      "context" : "src",
                      "element" : "author",
                      "variable" : "auth"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "bundle",
                      "contextType" : "variable",
                      "element" : "entry",
                      "variable" : "e1"
                    },
                    {
                      "context" : "e1",
                      "contextType" : "variable",
                      "element" : "request",
                      "variable" : "request",
                      "transform" : "create",
                      "parameter" : [
                        {
                          "valueString" : "BackboneElement"
                        }
                      ]
                    },
                    {
                      "context" : "request",
                      "contextType" : "variable",
                      "element" : "method",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "PUT"
                        }
                      ]
                    },
                    {
                      "context" : "e1",
                      "contextType" : "variable",
                      "element" : "resource",
                      "variable" : "practitioner",
                      "transform" : "create",
                      "parameter" : [
                        {
                          "valueString" : "Practitioner"
                        }
                      ]
                    },
                    {
                      "context" : "practitioner",
                      "contextType" : "variable",
                      "element" : "id",
                      "variable" : "uuid1",
                      "transform" : "uuid"
                    },
                    {
                      "context" : "e1",
                      "contextType" : "variable",
                      "element" : "fullUrl",
                      "transform" : "append",
                      "parameter" : [
                        {
                          "valueString" : "https://example/Practitioner/"
                        },
                        {
                          "valueId" : "uuid1"
                        }
                      ]
                    },
                    {
                      "context" : "request",
                      "contextType" : "variable",
                      "element" : "url",
                      "transform" : "append",
                      "parameter" : [
                        {
                          "valueString" : "Practitioner/"
                        },
                        {
                          "valueId" : "uuid1"
                        }
                      ]
                    }
                  ],
                  "rule" : [
                    {
                      "name" : "time",
                      "source" : [
                        {
                          "context" : "auth",
                          "element" : "time",
                          "variable" : "t"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "note",
                          "contextType" : "variable",
                          "element" : "time",
                          "variable" : "value",
                          "transform" : "create",
                          "parameter" : [
                            {
                              "valueString" : "dateTime"
                            }
                          ]
                        }
                      ],
                      "dependent" : [
                        {
                          "name" : "TSDateTime",
                          "variable" : [
                            "t",
                            "value"
                          ]
                        }
                      ]
                    },
                    {
                      "name" : "assAuth",
                      "source" : [
                        {
                          "context" : "auth",
                          "element" : "assignedAuthor",
                          "variable" : "assAuth"
                        }
                      ],
                      "rule" : [
                        {
                          "name" : "meta",
                          "source" : [
                            {
                              "context" : "assAuth"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "practitioner",
                              "contextType" : "variable",
                              "element" : "meta",
                              "variable" : "meta"
                            }
                          ],
                          "rule" : [
                            {
                              "name" : "coding",
                              "source" : [
                                {
                                  "context" : "assAuth"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "meta",
                                  "contextType" : "variable",
                                  "element" : "tag",
                                  "variable" : "coding",
                                  "transform" : "create",
                                  "parameter" : [
                                    {
                                      "valueString" : "Coding"
                                    }
                                  ]
                                }
                              ],
                              "rule" : [
                                {
                                  "name" : "system",
                                  "source" : [
                                    {
                                      "context" : "assAuth"
                                    }
                                  ],
                                  "target" : [
                                    {
                                      "context" : "coding",
                                      "contextType" : "variable",
                                      "element" : "system",
                                      "transform" : "copy",
                                      "parameter" : [
                                        {
                                          "valueString" : "http://algoritmodiscoring"
                                        }
                                      ]
                                    }
                                  ]
                                },
                                {
                                  "name" : "code",
                                  "source" : [
                                    {
                                      "context" : "assAuth"
                                    }
                                  ],
                                  "target" : [
                                    {
                                      "context" : "coding",
                                      "contextType" : "variable",
                                      "element" : "code",
                                      "transform" : "copy",
                                      "parameter" : [
                                        {
                                          "valueString" : "ClinicalDocument/body/TerapiaFarmacologicaDimissione/author"
                                        }
                                      ]
                                    }
                                  ]
                                }
                              ]
                            }
                          ],
                          "documentation" : "assAuth.time -> note.time;"
                        },
                        {
                          "name" : "identifier",
                          "source" : [
                            {
                              "context" : "assAuth",
                              "element" : "id",
                              "variable" : "id"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "practitioner",
                              "contextType" : "variable",
                              "element" : "identifier",
                              "variable" : "identifier"
                            }
                          ],
                          "rule" : [
                            {
                              "name" : "root1",
                              "source" : [
                                {
                                  "context" : "id",
                                  "element" : "root",
                                  "variable" : "r"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "identifier",
                                  "contextType" : "variable",
                                  "element" : "system",
                                  "transform" : "translate",
                                  "parameter" : [
                                    {
                                      "valueId" : "r"
                                    },
                                    {
                                      "valueString" : "http://hl7.org/fhir/ConceptMap/special-oid2uri"
                                    },
                                    {
                                      "valueString" : "uri"
                                    }
                                  ]
                                }
                              ]
                            },
                            {
                              "name" : "extension",
                              "source" : [
                                {
                                  "context" : "id",
                                  "element" : "extension",
                                  "variable" : "ext"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "identifier",
                                  "contextType" : "variable",
                                  "element" : "value",
                                  "transform" : "copy",
                                  "parameter" : [
                                    {
                                      "valueId" : "ext"
                                    }
                                  ]
                                }
                              ]
                            },
                            {
                              "name" : "assigningAuthorityName",
                              "source" : [
                                {
                                  "context" : "id",
                                  "element" : "assigningAuthorityName",
                                  "variable" : "s"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "identifier",
                                  "contextType" : "variable",
                                  "element" : "assigner",
                                  "variable" : "a"
                                },
                                {
                                  "context" : "a",
                                  "contextType" : "variable",
                                  "element" : "display",
                                  "transform" : "copy",
                                  "parameter" : [
                                    {
                                      "valueId" : "s"
                                    }
                                  ]
                                }
                              ]
                            },
                            {
                              "name" : "r",
                              "source" : [
                                {
                                  "context" : "id",
                                  "element" : "root",
                                  "variable" : "r"
                                }
                              ],
                              "rule" : [
                                {
                                  "name" : "aut",
                                  "source" : [
                                    {
                                      "context" : "id",
                                      "element" : "extension",
                                      "variable" : "ext"
                                    }
                                  ],
                                  "target" : [
                                    {
                                      "context" : "practitioner",
                                      "contextType" : "variable",
                                      "element" : "id",
                                      "variable" : "uuid2",
                                      "transform" : "evaluate",
                                      "parameter" : [
                                        {
                                          "valueString" : "r + '-' + ext"
                                        }
                                      ]
                                    },
                                    {
                                      "context" : "e1",
                                      "contextType" : "variable",
                                      "element" : "fullUrl",
                                      "transform" : "append",
                                      "parameter" : [
                                        {
                                          "valueString" : "https://example/Practitioner/"
                                        },
                                        {
                                          "valueId" : "uuid2"
                                        }
                                      ]
                                    },
                                    {
                                      "context" : "request",
                                      "contextType" : "variable",
                                      "element" : "url",
                                      "transform" : "append",
                                      "parameter" : [
                                        {
                                          "valueString" : "Practitioner/"
                                        },
                                        {
                                          "valueId" : "uuid2"
                                        }
                                      ]
                                    },
                                    {
                                      "context" : "note",
                                      "contextType" : "variable",
                                      "element" : "author",
                                      "variable" : "reference",
                                      "transform" : "create",
                                      "parameter" : [
                                        {
                                          "valueString" : "Reference"
                                        }
                                      ]
                                    },
                                    {
                                      "context" : "reference",
                                      "contextType" : "variable",
                                      "element" : "reference",
                                      "transform" : "evaluate",
                                      "parameter" : [
                                        {
                                          "valueString" : "'https://example/Practitioner/' + %practitioner.id"
                                        }
                                      ]
                                    }
                                  ]
                                }
                              ]
                            }
                          ]
                        },
                        {
                          "name" : "2.16.840.1.113883.2.9.4.3.2",
                          "source" : [
                            {
                              "context" : "assAuth",
                              "element" : "id",
                              "variable" : "id",
                              "condition" : "(root = '2.16.840.1.113883.2.9.4.3.2')"
                            }
                          ],
                          "rule" : [
                            {
                              "name" : "UUID",
                              "source" : [
                                {
                                  "context" : "id",
                                  "element" : "extension",
                                  "variable" : "ext"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "request",
                                  "contextType" : "variable",
                                  "element" : "url",
                                  "transform" : "append",
                                  "parameter" : [
                                    {
                                      "valueString" : "Practitioner?identifier="
                                    },
                                    {
                                      "valueId" : "ext"
                                    }
                                  ]
                                }
                              ]
                            }
                          ]
                        },
                        {
                          "name" : "assPers",
                          "source" : [
                            {
                              "context" : "assAuth",
                              "element" : "assignedPerson",
                              "variable" : "asspers"
                            }
                          ],
                          "rule" : [
                            {
                              "name" : "name",
                              "source" : [
                                {
                                  "context" : "asspers",
                                  "element" : "name",
                                  "variable" : "vvv"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "practitioner",
                                  "contextType" : "variable",
                                  "element" : "name",
                                  "variable" : "vvv",
                                  "transform" : "create"
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  ]
                },
                {
                  "name" : "medicationesiste",
                  "source" : [
                    {
                      "context" : "src"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "medRq",
                      "contextType" : "variable",
                      "element" : "medication",
                      "variable" : "medication",
                      "transform" : "create",
                      "parameter" : [
                        {
                          "valueString" : "CodeableConcept"
                        }
                      ]
                    }
                  ],
                  "rule" : [
                    {
                      "name" : "text",
                      "source" : [
                        {
                          "context" : "src",
                          "element" : "text",
                          "variable" : "txt"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "medication",
                          "contextType" : "variable",
                          "element" : "text",
                          "transform" : "copy",
                          "parameter" : [
                            {
                              "valueId" : "txt"
                            }
                          ]
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ],
          "documentation" : "Sezione Narrativa------------------------------------------------------------------------------------------------------------------------------------------------"
        },
        {
          "name" : "sezioneesiste",
          "source" : [
            {
              "context" : "src",
              "condition" : "src.entry.exists()"
            }
          ],
          "rule" : [
            {
              "name" : "medication",
              "source" : [
                {
                  "context" : "src"
                }
              ],
              "target" : [
                {
                  "context" : "bundle",
                  "contextType" : "variable",
                  "element" : "entry",
                  "variable" : "e1"
                },
                {
                  "context" : "e1",
                  "contextType" : "variable",
                  "element" : "request",
                  "variable" : "request",
                  "transform" : "create",
                  "parameter" : [
                    {
                      "valueString" : "BackboneElement"
                    }
                  ]
                },
                {
                  "context" : "request",
                  "contextType" : "variable",
                  "element" : "method",
                  "transform" : "copy",
                  "parameter" : [
                    {
                      "valueString" : "POST"
                    }
                  ]
                },
                {
                  "context" : "e1",
                  "contextType" : "variable",
                  "element" : "resource",
                  "variable" : "medRq",
                  "transform" : "create",
                  "parameter" : [
                    {
                      "valueString" : "MedicationRequest"
                    }
                  ]
                },
                {
                  "context" : "medRq",
                  "contextType" : "variable",
                  "element" : "id",
                  "variable" : "uuid1",
                  "transform" : "uuid"
                },
                {
                  "context" : "e1",
                  "contextType" : "variable",
                  "element" : "fullUrl",
                  "transform" : "append",
                  "parameter" : [
                    {
                      "valueString" : "https://example/MedicationRequest/"
                    },
                    {
                      "valueId" : "uuid1"
                    }
                  ]
                },
                {
                  "context" : "request",
                  "contextType" : "variable",
                  "element" : "url",
                  "transform" : "copy",
                  "parameter" : [
                    {
                      "valueString" : "MedicationRequest"
                    }
                  ]
                },
                {
                  "context" : "tgt",
                  "contextType" : "variable",
                  "element" : "entry",
                  "variable" : "reference",
                  "transform" : "create",
                  "parameter" : [
                    {
                      "valueString" : "Reference"
                    }
                  ]
                },
                {
                  "context" : "reference",
                  "contextType" : "variable",
                  "element" : "reference",
                  "transform" : "evaluate",
                  "parameter" : [
                    {
                      "valueString" : "'https://example/MedicationRequest/' + %medRq.id"
                    }
                  ]
                },
                {
                  "context" : "medRq",
                  "contextType" : "variable",
                  "element" : "note",
                  "variable" : "note",
                  "transform" : "create",
                  "parameter" : [
                    {
                      "valueString" : "Annotation"
                    }
                  ]
                }
              ],
              "rule" : [
                {
                  "name" : "reference",
                  "source" : [
                    {
                      "context" : "src",
                      "element" : "text",
                      "variable" : "t"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "note",
                      "contextType" : "variable",
                      "element" : "text",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueId" : "t"
                        }
                      ]
                    }
                  ]
                },
                {
                  "name" : "reference",
                  "source" : [
                    {
                      "context" : "src"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "medRq",
                      "contextType" : "variable",
                      "element" : "subject",
                      "variable" : "reference",
                      "transform" : "create",
                      "parameter" : [
                        {
                          "valueString" : "Reference"
                        }
                      ]
                    },
                    {
                      "context" : "reference",
                      "contextType" : "variable",
                      "element" : "reference",
                      "transform" : "evaluate",
                      "parameter" : [
                        {
                          "valueString" : "'https://example/Patient/' + %patient.id"
                        }
                      ]
                    }
                  ]
                },
                {
                  "name" : "reference",
                  "source" : [
                    {
                      "context" : "src"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "medRq",
                      "contextType" : "variable",
                      "element" : "encounter",
                      "variable" : "reference",
                      "transform" : "create",
                      "parameter" : [
                        {
                          "valueString" : "Reference"
                        }
                      ]
                    },
                    {
                      "context" : "reference",
                      "contextType" : "variable",
                      "element" : "reference",
                      "transform" : "evaluate",
                      "parameter" : [
                        {
                          "valueString" : "'https://example/Encounter/' + %enc.id"
                        }
                      ]
                    }
                  ]
                },
                {
                  "name" : "status",
                  "source" : [
                    {
                      "context" : "src"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "medRq",
                      "contextType" : "variable",
                      "element" : "status",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "active"
                        }
                      ]
                    }
                  ]
                },
                {
                  "name" : "intent",
                  "source" : [
                    {
                      "context" : "src"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "medRq",
                      "contextType" : "variable",
                      "element" : "intent",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "order"
                        }
                      ]
                    }
                  ]
                },
                {
                  "name" : "auth",
                  "source" : [
                    {
                      "context" : "src",
                      "element" : "author",
                      "variable" : "auth"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "bundle",
                      "contextType" : "variable",
                      "element" : "entry",
                      "variable" : "e1"
                    },
                    {
                      "context" : "e1",
                      "contextType" : "variable",
                      "element" : "request",
                      "variable" : "request",
                      "transform" : "create",
                      "parameter" : [
                        {
                          "valueString" : "BackboneElement"
                        }
                      ]
                    },
                    {
                      "context" : "request",
                      "contextType" : "variable",
                      "element" : "method",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "PUT"
                        }
                      ]
                    },
                    {
                      "context" : "e1",
                      "contextType" : "variable",
                      "element" : "resource",
                      "variable" : "practitioner",
                      "transform" : "create",
                      "parameter" : [
                        {
                          "valueString" : "Practitioner"
                        }
                      ]
                    },
                    {
                      "context" : "practitioner",
                      "contextType" : "variable",
                      "element" : "id",
                      "variable" : "uuid1",
                      "transform" : "uuid"
                    },
                    {
                      "context" : "e1",
                      "contextType" : "variable",
                      "element" : "fullUrl",
                      "transform" : "append",
                      "parameter" : [
                        {
                          "valueString" : "https://example/Practitioner/"
                        },
                        {
                          "valueId" : "uuid1"
                        }
                      ]
                    },
                    {
                      "context" : "request",
                      "contextType" : "variable",
                      "element" : "url",
                      "transform" : "append",
                      "parameter" : [
                        {
                          "valueString" : "Practitioner/"
                        },
                        {
                          "valueId" : "uuid1"
                        }
                      ]
                    }
                  ],
                  "rule" : [
                    {
                      "name" : "time",
                      "source" : [
                        {
                          "context" : "auth",
                          "element" : "time",
                          "variable" : "t"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "note",
                          "contextType" : "variable",
                          "element" : "time",
                          "variable" : "value",
                          "transform" : "create",
                          "parameter" : [
                            {
                              "valueString" : "dateTime"
                            }
                          ]
                        }
                      ],
                      "dependent" : [
                        {
                          "name" : "TSDateTime",
                          "variable" : [
                            "t",
                            "value"
                          ]
                        }
                      ]
                    },
                    {
                      "name" : "assAuth",
                      "source" : [
                        {
                          "context" : "auth",
                          "element" : "assignedAuthor",
                          "variable" : "assAuth"
                        }
                      ],
                      "rule" : [
                        {
                          "name" : "meta",
                          "source" : [
                            {
                              "context" : "assAuth"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "practitioner",
                              "contextType" : "variable",
                              "element" : "meta",
                              "variable" : "meta"
                            }
                          ],
                          "rule" : [
                            {
                              "name" : "coding",
                              "source" : [
                                {
                                  "context" : "assAuth"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "meta",
                                  "contextType" : "variable",
                                  "element" : "tag",
                                  "variable" : "coding",
                                  "transform" : "create",
                                  "parameter" : [
                                    {
                                      "valueString" : "Coding"
                                    }
                                  ]
                                }
                              ],
                              "rule" : [
                                {
                                  "name" : "system",
                                  "source" : [
                                    {
                                      "context" : "assAuth"
                                    }
                                  ],
                                  "target" : [
                                    {
                                      "context" : "coding",
                                      "contextType" : "variable",
                                      "element" : "system",
                                      "transform" : "copy",
                                      "parameter" : [
                                        {
                                          "valueString" : "http://algoritmodiscoring"
                                        }
                                      ]
                                    }
                                  ]
                                },
                                {
                                  "name" : "code",
                                  "source" : [
                                    {
                                      "context" : "assAuth"
                                    }
                                  ],
                                  "target" : [
                                    {
                                      "context" : "coding",
                                      "contextType" : "variable",
                                      "element" : "code",
                                      "transform" : "copy",
                                      "parameter" : [
                                        {
                                          "valueString" : "ClinicalDocument/body/TerapiaFarmacologicaDimissione/author"
                                        }
                                      ]
                                    }
                                  ]
                                }
                              ]
                            }
                          ],
                          "documentation" : "assAuth.time -> note.time;"
                        },
                        {
                          "name" : "identifier",
                          "source" : [
                            {
                              "context" : "assAuth",
                              "element" : "id",
                              "variable" : "id"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "practitioner",
                              "contextType" : "variable",
                              "element" : "identifier",
                              "variable" : "identifier"
                            }
                          ],
                          "rule" : [
                            {
                              "name" : "root1",
                              "source" : [
                                {
                                  "context" : "id",
                                  "element" : "root",
                                  "variable" : "r"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "identifier",
                                  "contextType" : "variable",
                                  "element" : "system",
                                  "transform" : "translate",
                                  "parameter" : [
                                    {
                                      "valueId" : "r"
                                    },
                                    {
                                      "valueString" : "http://hl7.org/fhir/ConceptMap/special-oid2uri"
                                    },
                                    {
                                      "valueString" : "uri"
                                    }
                                  ]
                                }
                              ]
                            },
                            {
                              "name" : "extension",
                              "source" : [
                                {
                                  "context" : "id",
                                  "element" : "extension",
                                  "variable" : "ext"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "identifier",
                                  "contextType" : "variable",
                                  "element" : "value",
                                  "transform" : "copy",
                                  "parameter" : [
                                    {
                                      "valueId" : "ext"
                                    }
                                  ]
                                }
                              ]
                            },
                            {
                              "name" : "assigningAuthorityName",
                              "source" : [
                                {
                                  "context" : "id",
                                  "element" : "assigningAuthorityName",
                                  "variable" : "s"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "identifier",
                                  "contextType" : "variable",
                                  "element" : "assigner",
                                  "variable" : "a"
                                },
                                {
                                  "context" : "a",
                                  "contextType" : "variable",
                                  "element" : "display",
                                  "transform" : "copy",
                                  "parameter" : [
                                    {
                                      "valueId" : "s"
                                    }
                                  ]
                                }
                              ]
                            },
                            {
                              "name" : "r",
                              "source" : [
                                {
                                  "context" : "id",
                                  "element" : "root",
                                  "variable" : "r"
                                }
                              ],
                              "rule" : [
                                {
                                  "name" : "aut",
                                  "source" : [
                                    {
                                      "context" : "id",
                                      "element" : "extension",
                                      "variable" : "ext"
                                    }
                                  ],
                                  "target" : [
                                    {
                                      "context" : "practitioner",
                                      "contextType" : "variable",
                                      "element" : "id",
                                      "variable" : "uuid2",
                                      "transform" : "evaluate",
                                      "parameter" : [
                                        {
                                          "valueString" : "r + '-' + ext"
                                        }
                                      ]
                                    },
                                    {
                                      "context" : "e1",
                                      "contextType" : "variable",
                                      "element" : "fullUrl",
                                      "transform" : "append",
                                      "parameter" : [
                                        {
                                          "valueString" : "https://example/Practitioner/"
                                        },
                                        {
                                          "valueId" : "uuid2"
                                        }
                                      ]
                                    },
                                    {
                                      "context" : "request",
                                      "contextType" : "variable",
                                      "element" : "url",
                                      "transform" : "append",
                                      "parameter" : [
                                        {
                                          "valueString" : "Practitioner/"
                                        },
                                        {
                                          "valueId" : "uuid2"
                                        }
                                      ]
                                    },
                                    {
                                      "context" : "note",
                                      "contextType" : "variable",
                                      "element" : "author",
                                      "variable" : "reference",
                                      "transform" : "create",
                                      "parameter" : [
                                        {
                                          "valueString" : "Reference"
                                        }
                                      ]
                                    },
                                    {
                                      "context" : "reference",
                                      "contextType" : "variable",
                                      "element" : "reference",
                                      "transform" : "evaluate",
                                      "parameter" : [
                                        {
                                          "valueString" : "'https://example/Practitioner/' + %practitioner.id"
                                        }
                                      ]
                                    }
                                  ]
                                }
                              ]
                            }
                          ]
                        },
                        {
                          "name" : "2.16.840.1.113883.2.9.4.3.2",
                          "source" : [
                            {
                              "context" : "assAuth",
                              "element" : "id",
                              "variable" : "id",
                              "condition" : "(root = '2.16.840.1.113883.2.9.4.3.2')"
                            }
                          ],
                          "rule" : [
                            {
                              "name" : "UUID",
                              "source" : [
                                {
                                  "context" : "id",
                                  "element" : "extension",
                                  "variable" : "ext"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "request",
                                  "contextType" : "variable",
                                  "element" : "url",
                                  "transform" : "append",
                                  "parameter" : [
                                    {
                                      "valueString" : "Practitioner?identifier="
                                    },
                                    {
                                      "valueId" : "ext"
                                    }
                                  ]
                                }
                              ]
                            }
                          ]
                        },
                        {
                          "name" : "assPers",
                          "source" : [
                            {
                              "context" : "assAuth",
                              "element" : "assignedPerson",
                              "variable" : "asspers"
                            }
                          ],
                          "rule" : [
                            {
                              "name" : "name",
                              "source" : [
                                {
                                  "context" : "asspers",
                                  "element" : "name",
                                  "variable" : "vvv"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "practitioner",
                                  "contextType" : "variable",
                                  "element" : "name",
                                  "variable" : "vvv",
                                  "transform" : "create"
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  ]
                },
                {
                  "name" : "entry",
                  "source" : [
                    {
                      "context" : "src",
                      "element" : "entry",
                      "variable" : "entry1"
                    }
                  ],
                  "rule" : [
                    {
                      "name" : "sub",
                      "source" : [
                        {
                          "context" : "entry1",
                          "element" : "substanceAdministration",
                          "variable" : "sub"
                        }
                      ],
                      "rule" : [
                        {
                          "name" : "statusCode",
                          "source" : [
                            {
                              "context" : "sub",
                              "element" : "statusCode",
                              "variable" : "vvv"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "medRq",
                              "contextType" : "variable",
                              "element" : "status",
                              "variable" : "vvv",
                              "transform" : "create"
                            }
                          ]
                        },
                        {
                          "name" : "dosage",
                          "source" : [
                            {
                              "context" : "sub"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "medRq",
                              "contextType" : "variable",
                              "element" : "dosageInstruction",
                              "variable" : "dosage",
                              "transform" : "create",
                              "parameter" : [
                                {
                                  "valueString" : "Dosage"
                                }
                              ]
                            }
                          ],
                          "rule" : [
                            {
                              "name" : "timing",
                              "source" : [
                                {
                                  "context" : "sub"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "dosage",
                                  "contextType" : "variable",
                                  "element" : "timing",
                                  "variable" : "tim",
                                  "transform" : "create",
                                  "parameter" : [
                                    {
                                      "valueString" : "Timing"
                                    }
                                  ]
                                }
                              ],
                              "rule" : [
                                {
                                  "name" : "repeat",
                                  "source" : [
                                    {
                                      "context" : "sub",
                                      "element" : "effectiveTime",
                                      "variable" : "eff"
                                    }
                                  ],
                                  "target" : [
                                    {
                                      "context" : "tim",
                                      "contextType" : "variable",
                                      "element" : "repeat",
                                      "variable" : "repeat"
                                    }
                                  ],
                                  "rule" : [
                                    {
                                      "name" : "boundsperiod",
                                      "source" : [
                                        {
                                          "context" : "eff"
                                        }
                                      ],
                                      "target" : [
                                        {
                                          "context" : "repeat",
                                          "contextType" : "variable",
                                          "element" : "bounds",
                                          "variable" : "period",
                                          "transform" : "create",
                                          "parameter" : [
                                            {
                                              "valueString" : "Period"
                                            }
                                          ]
                                        }
                                      ],
                                      "dependent" : [
                                        {
                                          "name" : "IVLTSPeriod",
                                          "variable" : [
                                            "eff",
                                            "period"
                                          ]
                                        }
                                      ]
                                    }
                                  ]
                                }
                              ]
                            }
                          ]
                        },
                        {
                          "name" : "eff",
                          "source" : [
                            {
                              "context" : "sub",
                              "type" : "PIVL_TS",
                              "element" : "effectiveTime",
                              "variable" : "eff"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "medRq",
                              "contextType" : "variable",
                              "element" : "dosageInstruction",
                              "variable" : "dosage",
                              "transform" : "create",
                              "parameter" : [
                                {
                                  "valueString" : "Dosage"
                                }
                              ]
                            }
                          ],
                          "rule" : [
                            {
                              "name" : "cod",
                              "source" : [
                                {
                                  "context" : "eff"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "dosage",
                                  "contextType" : "variable",
                                  "element" : "timing",
                                  "variable" : "timing",
                                  "transform" : "create",
                                  "parameter" : [
                                    {
                                      "valueString" : "Timing"
                                    }
                                  ]
                                }
                              ],
                              "dependent" : [
                                {
                                  "name" : "periodTiming",
                                  "variable" : [
                                    "eff",
                                    "timing"
                                  ]
                                }
                              ]
                            }
                          ]
                        },
                        {
                          "name" : "dosage",
                          "source" : [
                            {
                              "context" : "sub"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "medRq",
                              "contextType" : "variable",
                              "element" : "dosageInstruction",
                              "variable" : "dosage",
                              "transform" : "create",
                              "parameter" : [
                                {
                                  "valueString" : "Dosage"
                                }
                              ]
                            }
                          ],
                          "rule" : [
                            {
                              "name" : "routeCode",
                              "source" : [
                                {
                                  "context" : "sub",
                                  "element" : "routeCode",
                                  "variable" : "vvv"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "dosage",
                                  "contextType" : "variable",
                                  "element" : "route",
                                  "variable" : "vvv",
                                  "transform" : "create"
                                }
                              ]
                            }
                          ]
                        },
                        {
                          "name" : "dosage",
                          "source" : [
                            {
                              "context" : "sub"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "medRq",
                              "contextType" : "variable",
                              "element" : "dosageInstruction",
                              "variable" : "dosage",
                              "transform" : "create",
                              "parameter" : [
                                {
                                  "valueString" : "Dosage"
                                }
                              ]
                            }
                          ],
                          "rule" : [
                            {
                              "name" : "approachSiteCode",
                              "source" : [
                                {
                                  "context" : "sub",
                                  "element" : "approachSiteCode",
                                  "variable" : "vvv"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "dosage",
                                  "contextType" : "variable",
                                  "element" : "site",
                                  "variable" : "vvv",
                                  "transform" : "create"
                                }
                              ]
                            }
                          ]
                        },
                        {
                          "name" : "doseQuant",
                          "source" : [
                            {
                              "context" : "sub",
                              "element" : "doseQuantity",
                              "variable" : "doseQuant"
                            }
                          ],
                          "rule" : [
                            {
                              "name" : "Dosage",
                              "source" : [
                                {
                                  "context" : "doseQuant"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "medRq",
                                  "contextType" : "variable",
                                  "element" : "dosageInstruction",
                                  "variable" : "dosageInstruction",
                                  "transform" : "create",
                                  "parameter" : [
                                    {
                                      "valueString" : "Dosage"
                                    }
                                  ]
                                }
                              ],
                              "rule" : [
                                {
                                  "name" : "ot",
                                  "source" : [
                                    {
                                      "context" : "doseQuant",
                                      "element" : "originalText",
                                      "variable" : "ot"
                                    }
                                  ],
                                  "rule" : [
                                    {
                                      "name" : "reference",
                                      "source" : [
                                        {
                                          "context" : "ot",
                                          "element" : "reference",
                                          "variable" : "vvv"
                                        }
                                      ],
                                      "target" : [
                                        {
                                          "context" : "dosageInstruction",
                                          "contextType" : "variable",
                                          "element" : "text",
                                          "variable" : "vvv",
                                          "transform" : "create"
                                        }
                                      ]
                                    }
                                  ]
                                },
                                {
                                  "name" : "dosageRate",
                                  "source" : [
                                    {
                                      "context" : "doseQuant"
                                    }
                                  ],
                                  "target" : [
                                    {
                                      "context" : "dosageInstruction",
                                      "contextType" : "variable",
                                      "element" : "doseAndRate",
                                      "variable" : "dosageRate"
                                    }
                                  ],
                                  "rule" : [
                                    {
                                      "name" : "d",
                                      "source" : [
                                        {
                                          "context" : "doseQuant"
                                        }
                                      ],
                                      "target" : [
                                        {
                                          "context" : "dosageRate",
                                          "contextType" : "variable",
                                          "element" : "dose",
                                          "variable" : "d",
                                          "transform" : "create",
                                          "parameter" : [
                                            {
                                              "valueString" : "Range"
                                            }
                                          ]
                                        }
                                      ],
                                      "rule" : [
                                        {
                                          "name" : "low",
                                          "source" : [
                                            {
                                              "context" : "doseQuant"
                                            }
                                          ],
                                          "target" : [
                                            {
                                              "context" : "d",
                                              "contextType" : "variable",
                                              "element" : "low",
                                              "variable" : "l",
                                              "transform" : "create",
                                              "parameter" : [
                                                {
                                                  "valueString" : "SimpleQuantity"
                                                }
                                              ]
                                            }
                                          ],
                                          "rule" : [
                                            {
                                              "name" : "low",
                                              "source" : [
                                                {
                                                  "context" : "doseQuant",
                                                  "element" : "low",
                                                  "variable" : "lo"
                                                }
                                              ],
                                              "target" : [
                                                {
                                                  "context" : "l",
                                                  "contextType" : "variable",
                                                  "element" : "value",
                                                  "transform" : "evaluate",
                                                  "parameter" : [
                                                    {
                                                      "valueString" : "lo.value"
                                                    }
                                                  ]
                                                }
                                              ]
                                            },
                                            {
                                              "name" : "low",
                                              "source" : [
                                                {
                                                  "context" : "doseQuant",
                                                  "element" : "low",
                                                  "variable" : "lo"
                                                }
                                              ],
                                              "target" : [
                                                {
                                                  "context" : "l",
                                                  "contextType" : "variable",
                                                  "element" : "unit",
                                                  "transform" : "evaluate",
                                                  "parameter" : [
                                                    {
                                                      "valueString" : "lo.unit"
                                                    }
                                                  ]
                                                }
                                              ]
                                            }
                                          ]
                                        },
                                        {
                                          "name" : "low",
                                          "source" : [
                                            {
                                              "context" : "doseQuant"
                                            }
                                          ],
                                          "target" : [
                                            {
                                              "context" : "d",
                                              "contextType" : "variable",
                                              "element" : "high",
                                              "variable" : "h",
                                              "transform" : "create",
                                              "parameter" : [
                                                {
                                                  "valueString" : "SimpleQuantity"
                                                }
                                              ]
                                            }
                                          ],
                                          "rule" : [
                                            {
                                              "name" : "high",
                                              "source" : [
                                                {
                                                  "context" : "doseQuant",
                                                  "element" : "high",
                                                  "variable" : "hi"
                                                }
                                              ],
                                              "target" : [
                                                {
                                                  "context" : "h",
                                                  "contextType" : "variable",
                                                  "element" : "value",
                                                  "transform" : "evaluate",
                                                  "parameter" : [
                                                    {
                                                      "valueString" : "hi.value"
                                                    }
                                                  ]
                                                }
                                              ]
                                            },
                                            {
                                              "name" : "high",
                                              "source" : [
                                                {
                                                  "context" : "doseQuant",
                                                  "element" : "high",
                                                  "variable" : "hi"
                                                }
                                              ],
                                              "target" : [
                                                {
                                                  "context" : "h",
                                                  "contextType" : "variable",
                                                  "element" : "unit",
                                                  "transform" : "evaluate",
                                                  "parameter" : [
                                                    {
                                                      "valueString" : "hi.unit"
                                                    }
                                                  ]
                                                }
                                              ]
                                            }
                                          ]
                                        }
                                      ]
                                    }
                                  ]
                                },
                                {
                                  "name" : "dosageRate",
                                  "source" : [
                                    {
                                      "context" : "sub",
                                      "element" : "rateQuantity",
                                      "variable" : "rateQuantity"
                                    }
                                  ],
                                  "target" : [
                                    {
                                      "context" : "medRq",
                                      "contextType" : "variable",
                                      "element" : "dosageInstruction",
                                      "variable" : "dosageInstruction1",
                                      "transform" : "create",
                                      "parameter" : [
                                        {
                                          "valueString" : "Dosage"
                                        }
                                      ]
                                    }
                                  ],
                                  "rule" : [
                                    {
                                      "name" : "ot",
                                      "source" : [
                                        {
                                          "context" : "rateQuantity",
                                          "element" : "originalText",
                                          "variable" : "ot"
                                        }
                                      ],
                                      "rule" : [
                                        {
                                          "name" : "reference",
                                          "source" : [
                                            {
                                              "context" : "ot",
                                              "element" : "reference",
                                              "variable" : "vvv"
                                            }
                                          ],
                                          "target" : [
                                            {
                                              "context" : "dosageInstruction1",
                                              "contextType" : "variable",
                                              "element" : "text",
                                              "variable" : "vvv",
                                              "transform" : "create"
                                            }
                                          ]
                                        }
                                      ]
                                    },
                                    {
                                      "name" : "qualcosa",
                                      "source" : [
                                        {
                                          "context" : "rateQuantity"
                                        }
                                      ],
                                      "target" : [
                                        {
                                          "context" : "dosageInstruction1",
                                          "contextType" : "variable",
                                          "element" : "doseAndRate",
                                          "variable" : "dosageRate"
                                        }
                                      ],
                                      "rule" : [
                                        {
                                          "name" : "d",
                                          "source" : [
                                            {
                                              "context" : "rateQuantity"
                                            }
                                          ],
                                          "target" : [
                                            {
                                              "context" : "dosageRate",
                                              "contextType" : "variable",
                                              "element" : "rate",
                                              "variable" : "d",
                                              "transform" : "create",
                                              "parameter" : [
                                                {
                                                  "valueString" : "Range"
                                                }
                                              ]
                                            }
                                          ],
                                          "rule" : [
                                            {
                                              "name" : "low",
                                              "source" : [
                                                {
                                                  "context" : "rateQuantity"
                                                }
                                              ],
                                              "target" : [
                                                {
                                                  "context" : "d",
                                                  "contextType" : "variable",
                                                  "element" : "low",
                                                  "variable" : "l",
                                                  "transform" : "create",
                                                  "parameter" : [
                                                    {
                                                      "valueString" : "SimpleQuantity"
                                                    }
                                                  ]
                                                }
                                              ],
                                              "rule" : [
                                                {
                                                  "name" : "low",
                                                  "source" : [
                                                    {
                                                      "context" : "rateQuantity",
                                                      "element" : "low",
                                                      "variable" : "lo"
                                                    }
                                                  ],
                                                  "target" : [
                                                    {
                                                      "context" : "l",
                                                      "contextType" : "variable",
                                                      "element" : "value",
                                                      "transform" : "evaluate",
                                                      "parameter" : [
                                                        {
                                                          "valueString" : "lo.value"
                                                        }
                                                      ]
                                                    }
                                                  ]
                                                },
                                                {
                                                  "name" : "low",
                                                  "source" : [
                                                    {
                                                      "context" : "rateQuantity",
                                                      "element" : "low",
                                                      "variable" : "lo"
                                                    }
                                                  ],
                                                  "target" : [
                                                    {
                                                      "context" : "l",
                                                      "contextType" : "variable",
                                                      "element" : "unit",
                                                      "transform" : "evaluate",
                                                      "parameter" : [
                                                        {
                                                          "valueString" : "lo.unit"
                                                        }
                                                      ]
                                                    }
                                                  ]
                                                }
                                              ]
                                            },
                                            {
                                              "name" : "low",
                                              "source" : [
                                                {
                                                  "context" : "rateQuantity"
                                                }
                                              ],
                                              "target" : [
                                                {
                                                  "context" : "d",
                                                  "contextType" : "variable",
                                                  "element" : "high",
                                                  "variable" : "h",
                                                  "transform" : "create",
                                                  "parameter" : [
                                                    {
                                                      "valueString" : "SimpleQuantity"
                                                    }
                                                  ]
                                                }
                                              ],
                                              "rule" : [
                                                {
                                                  "name" : "high",
                                                  "source" : [
                                                    {
                                                      "context" : "rateQuantity",
                                                      "element" : "high",
                                                      "variable" : "hi"
                                                    }
                                                  ],
                                                  "target" : [
                                                    {
                                                      "context" : "h",
                                                      "contextType" : "variable",
                                                      "element" : "value",
                                                      "transform" : "evaluate",
                                                      "parameter" : [
                                                        {
                                                          "valueString" : "hi.value"
                                                        }
                                                      ]
                                                    }
                                                  ]
                                                },
                                                {
                                                  "name" : "high",
                                                  "source" : [
                                                    {
                                                      "context" : "rateQuantity",
                                                      "element" : "high",
                                                      "variable" : "hi"
                                                    }
                                                  ],
                                                  "target" : [
                                                    {
                                                      "context" : "h",
                                                      "contextType" : "variable",
                                                      "element" : "unit",
                                                      "transform" : "evaluate",
                                                      "parameter" : [
                                                        {
                                                          "valueString" : "hi.unit"
                                                        }
                                                      ]
                                                    }
                                                  ]
                                                }
                                              ]
                                            }
                                          ]
                                        }
                                      ]
                                    }
                                  ]
                                }
                              ]
                            }
                          ]
                        },
                        {
                          "name" : "admnistrationUnicode",
                          "source" : [
                            {
                              "context" : "sub"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "bundle",
                              "contextType" : "variable",
                              "element" : "entry",
                              "variable" : "e1"
                            },
                            {
                              "context" : "e1",
                              "contextType" : "variable",
                              "element" : "request",
                              "variable" : "request",
                              "transform" : "create",
                              "parameter" : [
                                {
                                  "valueString" : "BackboneElement"
                                }
                              ]
                            },
                            {
                              "context" : "request",
                              "contextType" : "variable",
                              "element" : "method",
                              "transform" : "copy",
                              "parameter" : [
                                {
                                  "valueString" : "POST"
                                }
                              ]
                            },
                            {
                              "context" : "e1",
                              "contextType" : "variable",
                              "element" : "resource",
                              "variable" : "medication",
                              "transform" : "create",
                              "parameter" : [
                                {
                                  "valueString" : "Medication"
                                }
                              ]
                            },
                            {
                              "context" : "medication",
                              "contextType" : "variable",
                              "element" : "id",
                              "variable" : "uuid1",
                              "transform" : "uuid"
                            },
                            {
                              "context" : "e1",
                              "contextType" : "variable",
                              "element" : "fullUrl",
                              "transform" : "append",
                              "parameter" : [
                                {
                                  "valueString" : "https://example/Medication/"
                                },
                                {
                                  "valueId" : "uuid1"
                                }
                              ]
                            },
                            {
                              "context" : "request",
                              "contextType" : "variable",
                              "element" : "url",
                              "transform" : "copy",
                              "parameter" : [
                                {
                                  "valueString" : "Medication"
                                }
                              ]
                            },
                            {
                              "context" : "medRq",
                              "contextType" : "variable",
                              "element" : "medication",
                              "variable" : "reference",
                              "transform" : "create",
                              "parameter" : [
                                {
                                  "valueString" : "Reference"
                                }
                              ]
                            },
                            {
                              "context" : "reference",
                              "contextType" : "variable",
                              "element" : "reference",
                              "transform" : "evaluate",
                              "parameter" : [
                                {
                                  "valueString" : "'https://example/Medication/' + %medication.id"
                                }
                              ]
                            }
                          ],
                          "rule" : [
                            {
                              "name" : "administrationUnitCode",
                              "source" : [
                                {
                                  "context" : "sub",
                                  "element" : "administrationUnitCode",
                                  "variable" : "vvv"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "medication",
                                  "contextType" : "variable",
                                  "element" : "form",
                                  "variable" : "vvv",
                                  "transform" : "create"
                                }
                              ]
                            },
                            {
                              "name" : "cons",
                              "source" : [
                                {
                                  "context" : "sub",
                                  "element" : "consumable",
                                  "variable" : "cons"
                                }
                              ],
                              "rule" : [
                                {
                                  "name" : "manumat",
                                  "source" : [
                                    {
                                      "context" : "cons",
                                      "element" : "manufacturedProduct",
                                      "variable" : "manuprod"
                                    }
                                  ],
                                  "rule" : [
                                    {
                                      "name" : "manuFact",
                                      "source" : [
                                        {
                                          "context" : "manuprod",
                                          "element" : "manufacturedMaterial",
                                          "variable" : "manufact"
                                        }
                                      ],
                                      "rule" : [
                                        {
                                          "name" : "code",
                                          "source" : [
                                            {
                                              "context" : "manufact",
                                              "element" : "code",
                                              "variable" : "vvv"
                                            }
                                          ],
                                          "target" : [
                                            {
                                              "context" : "medication",
                                              "contextType" : "variable",
                                              "element" : "code",
                                              "variable" : "vvv",
                                              "transform" : "create"
                                            }
                                          ]
                                        }
                                      ]
                                    }
                                  ]
                                }
                              ]
                            },
                            {
                              "name" : "entryR",
                              "source" : [
                                {
                                  "context" : "sub",
                                  "element" : "entryRelationship",
                                  "variable" : "entryR"
                                }
                              ],
                              "rule" : [
                                {
                                  "name" : "obs",
                                  "source" : [
                                    {
                                      "context" : "entryR",
                                      "element" : "observation",
                                      "variable" : "observation"
                                    }
                                  ],
                                  "rule" : [
                                    {
                                      "name" : "ingredient",
                                      "source" : [
                                        {
                                          "context" : "observation",
                                          "element" : "code",
                                          "condition" : "displayName = 'Grammatura'"
                                        }
                                      ],
                                      "target" : [
                                        {
                                          "context" : "medication",
                                          "contextType" : "variable",
                                          "element" : "ingredient",
                                          "variable" : "ingredient"
                                        }
                                      ],
                                      "rule" : [
                                        {
                                          "name" : "consumable",
                                          "source" : [
                                            {
                                              "context" : "sub",
                                              "element" : "consumable",
                                              "variable" : "consumable"
                                            }
                                          ],
                                          "rule" : [
                                            {
                                              "name" : "product",
                                              "source" : [
                                                {
                                                  "context" : "consumable",
                                                  "element" : "manufacturedProduct",
                                                  "variable" : "manufacturedProduct"
                                                }
                                              ],
                                              "rule" : [
                                                {
                                                  "name" : "material",
                                                  "source" : [
                                                    {
                                                      "context" : "manufacturedProduct",
                                                      "element" : "manufacturedMaterial",
                                                      "variable" : "manufacturedMaterial"
                                                    }
                                                  ],
                                                  "rule" : [
                                                    {
                                                      "name" : "CE",
                                                      "source" : [
                                                        {
                                                          "context" : "manufacturedMaterial",
                                                          "element" : "code",
                                                          "variable" : "code"
                                                        }
                                                      ],
                                                      "target" : [
                                                        {
                                                          "context" : "ingredient",
                                                          "contextType" : "variable",
                                                          "element" : "item",
                                                          "variable" : "value",
                                                          "transform" : "create",
                                                          "parameter" : [
                                                            {
                                                              "valueString" : "CodeableConcept"
                                                            }
                                                          ]
                                                        }
                                                      ],
                                                      "dependent" : [
                                                        {
                                                          "name" : "CECodeableConcept",
                                                          "variable" : [
                                                            "code",
                                                            "value"
                                                          ]
                                                        }
                                                      ]
                                                    }
                                                  ]
                                                }
                                              ]
                                            }
                                          ]
                                        },
                                        {
                                          "name" : "strenght",
                                          "source" : [
                                            {
                                              "context" : "observation",
                                              "element" : "value",
                                              "variable" : "value"
                                            }
                                          ],
                                          "target" : [
                                            {
                                              "context" : "ingredient",
                                              "contextType" : "variable",
                                              "element" : "strength",
                                              "variable" : "strength"
                                            }
                                          ],
                                          "rule" : [
                                            {
                                              "name" : "numerator",
                                              "source" : [
                                                {
                                                  "context" : "value"
                                                }
                                              ],
                                              "target" : [
                                                {
                                                  "context" : "strength",
                                                  "contextType" : "variable",
                                                  "element" : "numerator",
                                                  "variable" : "numerator"
                                                }
                                              ],
                                              "rule" : [
                                                {
                                                  "name" : "valueN",
                                                  "source" : [
                                                    {
                                                      "context" : "value"
                                                    }
                                                  ],
                                                  "target" : [
                                                    {
                                                      "context" : "numerator",
                                                      "contextType" : "variable",
                                                      "element" : "value",
                                                      "transform" : "evaluate",
                                                      "parameter" : [
                                                        {
                                                          "valueString" : "value.value"
                                                        }
                                                      ]
                                                    }
                                                  ]
                                                }
                                              ]
                                            },
                                            {
                                              "name" : "denominator",
                                              "source" : [
                                                {
                                                  "context" : "value"
                                                }
                                              ],
                                              "target" : [
                                                {
                                                  "context" : "strength",
                                                  "contextType" : "variable",
                                                  "element" : "denominator",
                                                  "variable" : "denominator"
                                                }
                                              ],
                                              "rule" : [
                                                {
                                                  "name" : "valueD",
                                                  "source" : [
                                                    {
                                                      "context" : "value"
                                                    }
                                                  ],
                                                  "target" : [
                                                    {
                                                      "context" : "denominator",
                                                      "contextType" : "variable",
                                                      "element" : "value",
                                                      "transform" : "copy",
                                                      "parameter" : [
                                                        {
                                                          "valueInteger" : 1
                                                        }
                                                      ]
                                                    }
                                                  ]
                                                }
                                              ]
                                            }
                                          ]
                                        }
                                      ]
                                    },
                                    {
                                      "name" : "quantita",
                                      "source" : [
                                        {
                                          "context" : "observation",
                                          "element" : "code",
                                          "condition" : "displayName = 'Quantità nella Confezione'"
                                        }
                                      ],
                                      "rule" : [
                                        {
                                          "name" : "amount",
                                          "source" : [
                                            {
                                              "context" : "observation",
                                              "element" : "value",
                                              "variable" : "value"
                                            }
                                          ],
                                          "target" : [
                                            {
                                              "context" : "medication",
                                              "contextType" : "variable",
                                              "element" : "amount",
                                              "variable" : "amount"
                                            }
                                          ],
                                          "rule" : [
                                            {
                                              "name" : "numerator",
                                              "source" : [
                                                {
                                                  "context" : "value"
                                                }
                                              ],
                                              "target" : [
                                                {
                                                  "context" : "amount",
                                                  "contextType" : "variable",
                                                  "element" : "numerator",
                                                  "variable" : "numerator"
                                                }
                                              ],
                                              "rule" : [
                                                {
                                                  "name" : "valueN",
                                                  "source" : [
                                                    {
                                                      "context" : "value"
                                                    }
                                                  ],
                                                  "target" : [
                                                    {
                                                      "context" : "numerator",
                                                      "contextType" : "variable",
                                                      "element" : "value",
                                                      "transform" : "evaluate",
                                                      "parameter" : [
                                                        {
                                                          "valueString" : "value.value"
                                                        }
                                                      ]
                                                    }
                                                  ]
                                                }
                                              ]
                                            },
                                            {
                                              "name" : "denominator",
                                              "source" : [
                                                {
                                                  "context" : "value"
                                                }
                                              ],
                                              "target" : [
                                                {
                                                  "context" : "amount",
                                                  "contextType" : "variable",
                                                  "element" : "denominator",
                                                  "variable" : "denominator"
                                                }
                                              ],
                                              "rule" : [
                                                {
                                                  "name" : "valueD",
                                                  "source" : [
                                                    {
                                                      "context" : "value"
                                                    }
                                                  ],
                                                  "target" : [
                                                    {
                                                      "context" : "denominator",
                                                      "contextType" : "variable",
                                                      "element" : "value",
                                                      "transform" : "copy",
                                                      "parameter" : [
                                                        {
                                                          "valueInteger" : 1
                                                        }
                                                      ]
                                                    }
                                                  ]
                                                }
                                              ]
                                            }
                                          ]
                                        }
                                      ]
                                    }
                                  ]
                                }
                              ]
                            },
                            {
                              "name" : "participant",
                              "source" : [
                                {
                                  "context" : "sub",
                                  "element" : "participant",
                                  "variable" : "part"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "bundle",
                                  "contextType" : "variable",
                                  "element" : "entry",
                                  "variable" : "e1"
                                },
                                {
                                  "context" : "e1",
                                  "contextType" : "variable",
                                  "element" : "request",
                                  "variable" : "request",
                                  "transform" : "create",
                                  "parameter" : [
                                    {
                                      "valueString" : "BackboneElement"
                                    }
                                  ]
                                },
                                {
                                  "context" : "request",
                                  "contextType" : "variable",
                                  "element" : "method",
                                  "transform" : "copy",
                                  "parameter" : [
                                    {
                                      "valueString" : "PUT"
                                    }
                                  ]
                                },
                                {
                                  "context" : "e1",
                                  "contextType" : "variable",
                                  "element" : "resource",
                                  "variable" : "participant",
                                  "transform" : "create",
                                  "parameter" : [
                                    {
                                      "valueString" : "Practitioner"
                                    }
                                  ]
                                },
                                {
                                  "context" : "participant",
                                  "contextType" : "variable",
                                  "element" : "id",
                                  "variable" : "uuid1",
                                  "transform" : "uuid"
                                },
                                {
                                  "context" : "e1",
                                  "contextType" : "variable",
                                  "element" : "fullUrl",
                                  "transform" : "append",
                                  "parameter" : [
                                    {
                                      "valueString" : "https://example/Participant/"
                                    },
                                    {
                                      "valueId" : "uuid1"
                                    }
                                  ]
                                },
                                {
                                  "context" : "request",
                                  "contextType" : "variable",
                                  "element" : "url",
                                  "transform" : "append",
                                  "parameter" : [
                                    {
                                      "valueString" : "Participant/"
                                    },
                                    {
                                      "valueId" : "uuid1"
                                    }
                                  ]
                                }
                              ],
                              "rule" : [
                                {
                                  "name" : "authoredOn",
                                  "source" : [
                                    {
                                      "context" : "part",
                                      "element" : "time",
                                      "variable" : "t"
                                    }
                                  ],
                                  "target" : [
                                    {
                                      "context" : "medRq",
                                      "contextType" : "variable",
                                      "element" : "authoredOn",
                                      "variable" : "date",
                                      "transform" : "create",
                                      "parameter" : [
                                        {
                                          "valueString" : "dateTime"
                                        }
                                      ]
                                    }
                                  ],
                                  "dependent" : [
                                    {
                                      "name" : "TSDateTime",
                                      "variable" : [
                                        "t",
                                        "date"
                                      ]
                                    }
                                  ]
                                },
                                {
                                  "name" : "partRole",
                                  "source" : [
                                    {
                                      "context" : "part",
                                      "element" : "participantRole",
                                      "variable" : "partRole"
                                    }
                                  ],
                                  "rule" : [
                                    {
                                      "name" : "meta",
                                      "source" : [
                                        {
                                          "context" : "partRole"
                                        }
                                      ],
                                      "target" : [
                                        {
                                          "context" : "participant",
                                          "contextType" : "variable",
                                          "element" : "meta",
                                          "variable" : "meta"
                                        }
                                      ],
                                      "rule" : [
                                        {
                                          "name" : "coding",
                                          "source" : [
                                            {
                                              "context" : "partRole"
                                            }
                                          ],
                                          "target" : [
                                            {
                                              "context" : "meta",
                                              "contextType" : "variable",
                                              "element" : "tag",
                                              "variable" : "coding",
                                              "transform" : "create",
                                              "parameter" : [
                                                {
                                                  "valueString" : "Coding"
                                                }
                                              ]
                                            }
                                          ],
                                          "rule" : [
                                            {
                                              "name" : "system",
                                              "source" : [
                                                {
                                                  "context" : "partRole"
                                                }
                                              ],
                                              "target" : [
                                                {
                                                  "context" : "coding",
                                                  "contextType" : "variable",
                                                  "element" : "system",
                                                  "transform" : "copy",
                                                  "parameter" : [
                                                    {
                                                      "valueString" : "http://algoritmodiscoring"
                                                    }
                                                  ]
                                                }
                                              ]
                                            },
                                            {
                                              "name" : "code",
                                              "source" : [
                                                {
                                                  "context" : "partRole"
                                                }
                                              ],
                                              "target" : [
                                                {
                                                  "context" : "coding",
                                                  "contextType" : "variable",
                                                  "element" : "code",
                                                  "transform" : "copy",
                                                  "parameter" : [
                                                    {
                                                      "valueString" : "ClinicalDocument/body/TerapiaFarmacologicaDimissione/participant"
                                                    }
                                                  ]
                                                }
                                              ]
                                            }
                                          ]
                                        }
                                      ]
                                    },
                                    {
                                      "name" : "identifier",
                                      "source" : [
                                        {
                                          "context" : "partRole",
                                          "element" : "id",
                                          "variable" : "id"
                                        }
                                      ],
                                      "target" : [
                                        {
                                          "context" : "participant",
                                          "contextType" : "variable",
                                          "element" : "identifier",
                                          "variable" : "identifier"
                                        }
                                      ],
                                      "rule" : [
                                        {
                                          "name" : "root1",
                                          "source" : [
                                            {
                                              "context" : "id",
                                              "element" : "root",
                                              "variable" : "r"
                                            }
                                          ],
                                          "target" : [
                                            {
                                              "context" : "identifier",
                                              "contextType" : "variable",
                                              "element" : "system",
                                              "transform" : "translate",
                                              "parameter" : [
                                                {
                                                  "valueId" : "r"
                                                },
                                                {
                                                  "valueString" : "http://hl7.org/fhir/ConceptMap/special-oid2uri"
                                                },
                                                {
                                                  "valueString" : "uri"
                                                }
                                              ]
                                            }
                                          ]
                                        },
                                        {
                                          "name" : "extension",
                                          "source" : [
                                            {
                                              "context" : "id",
                                              "element" : "extension",
                                              "variable" : "ext"
                                            }
                                          ],
                                          "target" : [
                                            {
                                              "context" : "identifier",
                                              "contextType" : "variable",
                                              "element" : "value",
                                              "transform" : "copy",
                                              "parameter" : [
                                                {
                                                  "valueId" : "ext"
                                                }
                                              ]
                                            }
                                          ]
                                        },
                                        {
                                          "name" : "assigningAuthorityName",
                                          "source" : [
                                            {
                                              "context" : "id",
                                              "element" : "assigningAuthorityName",
                                              "variable" : "s"
                                            }
                                          ],
                                          "target" : [
                                            {
                                              "context" : "identifier",
                                              "contextType" : "variable",
                                              "element" : "assigner",
                                              "variable" : "a"
                                            },
                                            {
                                              "context" : "a",
                                              "contextType" : "variable",
                                              "element" : "display",
                                              "transform" : "copy",
                                              "parameter" : [
                                                {
                                                  "valueId" : "s"
                                                }
                                              ]
                                            }
                                          ]
                                        },
                                        {
                                          "name" : "r",
                                          "source" : [
                                            {
                                              "context" : "id",
                                              "element" : "root",
                                              "variable" : "r"
                                            }
                                          ],
                                          "rule" : [
                                            {
                                              "name" : "aut",
                                              "source" : [
                                                {
                                                  "context" : "id",
                                                  "element" : "extension",
                                                  "variable" : "ext"
                                                }
                                              ],
                                              "target" : [
                                                {
                                                  "context" : "participant",
                                                  "contextType" : "variable",
                                                  "element" : "id",
                                                  "variable" : "uuid2",
                                                  "transform" : "evaluate",
                                                  "parameter" : [
                                                    {
                                                      "valueString" : "r + '-' + ext"
                                                    }
                                                  ]
                                                },
                                                {
                                                  "context" : "e1",
                                                  "contextType" : "variable",
                                                  "element" : "fullUrl",
                                                  "transform" : "append",
                                                  "parameter" : [
                                                    {
                                                      "valueString" : "https://example/Practitioner/"
                                                    },
                                                    {
                                                      "valueId" : "uuid2"
                                                    }
                                                  ]
                                                },
                                                {
                                                  "context" : "request",
                                                  "contextType" : "variable",
                                                  "element" : "url",
                                                  "transform" : "append",
                                                  "parameter" : [
                                                    {
                                                      "valueString" : "Practitioner/"
                                                    },
                                                    {
                                                      "valueId" : "uuid2"
                                                    }
                                                  ]
                                                },
                                                {
                                                  "context" : "medRq",
                                                  "contextType" : "variable",
                                                  "element" : "requester",
                                                  "variable" : "reference",
                                                  "transform" : "create",
                                                  "parameter" : [
                                                    {
                                                      "valueString" : "Reference"
                                                    }
                                                  ]
                                                },
                                                {
                                                  "context" : "reference",
                                                  "contextType" : "variable",
                                                  "element" : "reference",
                                                  "transform" : "evaluate",
                                                  "parameter" : [
                                                    {
                                                      "valueString" : "'https://example/Practitioner/' + %participant.id"
                                                    }
                                                  ]
                                                }
                                              ]
                                            }
                                          ]
                                        }
                                      ]
                                    },
                                    {
                                      "name" : "2.16.840.1.113883.2.9.4.3.2",
                                      "source" : [
                                        {
                                          "context" : "partRole",
                                          "element" : "id",
                                          "variable" : "id",
                                          "condition" : "(root = '2.16.840.1.113883.2.9.4.3.2')"
                                        }
                                      ],
                                      "rule" : [
                                        {
                                          "name" : "UUID",
                                          "source" : [
                                            {
                                              "context" : "id",
                                              "element" : "extension",
                                              "variable" : "ext"
                                            }
                                          ],
                                          "target" : [
                                            {
                                              "context" : "request",
                                              "contextType" : "variable",
                                              "element" : "url",
                                              "transform" : "append",
                                              "parameter" : [
                                                {
                                                  "valueString" : "Practitioner?identifier="
                                                },
                                                {
                                                  "valueId" : "ext"
                                                }
                                              ]
                                            }
                                          ]
                                        }
                                      ]
                                    },
                                    {
                                      "name" : "playent",
                                      "source" : [
                                        {
                                          "context" : "partRole",
                                          "element" : "playingEntity",
                                          "variable" : "playent"
                                        }
                                      ],
                                      "rule" : [
                                        {
                                          "name" : "name",
                                          "source" : [
                                            {
                                              "context" : "playent",
                                              "element" : "name",
                                              "variable" : "vvv"
                                            }
                                          ],
                                          "target" : [
                                            {
                                              "context" : "participant",
                                              "contextType" : "variable",
                                              "element" : "name",
                                              "variable" : "vvv",
                                              "transform" : "create"
                                            }
                                          ]
                                        }
                                      ]
                                    }
                                  ]
                                }
                              ]
                            },
                            {
                              "name" : "ref",
                              "source" : [
                                {
                                  "context" : "sub",
                                  "element" : "reference",
                                  "variable" : "ref"
                                }
                              ],
                              "rule" : [
                                {
                                  "name" : "external",
                                  "source" : [
                                    {
                                      "context" : "ref",
                                      "element" : "externalAct",
                                      "variable" : "external"
                                    }
                                  ],
                                  "rule" : [
                                    {
                                      "name" : "id",
                                      "source" : [
                                        {
                                          "context" : "external",
                                          "element" : "id",
                                          "variable" : "vvv"
                                        }
                                      ],
                                      "target" : [
                                        {
                                          "context" : "medRq",
                                          "contextType" : "variable",
                                          "element" : "identifier",
                                          "variable" : "vvv",
                                          "transform" : "create"
                                        }
                                      ]
                                    }
                                  ]
                                }
                              ]
                            },
                            {
                              "name" : "med",
                              "source" : [
                                {
                                  "context" : "sub",
                                  "element" : "entryRelationship",
                                  "variable" : "entryRelationship"
                                }
                              ],
                              "rule" : [
                                {
                                  "name" : "sub",
                                  "source" : [
                                    {
                                      "context" : "entryRelationship",
                                      "element" : "supply",
                                      "variable" : "sup"
                                    }
                                  ],
                                  "target" : [
                                    {
                                      "context" : "medRq",
                                      "contextType" : "variable",
                                      "element" : "dispenseRequest",
                                      "variable" : "dispreq"
                                    }
                                  ],
                                  "rule" : [
                                    {
                                      "name" : "quantity",
                                      "source" : [
                                        {
                                          "context" : "sup"
                                        }
                                      ],
                                      "target" : [
                                        {
                                          "context" : "dispreq",
                                          "contextType" : "variable",
                                          "element" : "quantity",
                                          "variable" : "quantity",
                                          "transform" : "create",
                                          "parameter" : [
                                            {
                                              "valueString" : "SimpleQuantity"
                                            }
                                          ]
                                        }
                                      ],
                                      "rule" : [
                                        {
                                          "name" : "quantity",
                                          "source" : [
                                            {
                                              "context" : "sup",
                                              "element" : "quantity",
                                              "variable" : "q"
                                            }
                                          ],
                                          "target" : [
                                            {
                                              "context" : "quantity",
                                              "contextType" : "variable",
                                              "element" : "value",
                                              "transform" : "evaluate",
                                              "parameter" : [
                                                {
                                                  "valueString" : "q.value"
                                                }
                                              ]
                                            }
                                          ]
                                        }
                                      ]
                                    }
                                  ]
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ],
          "documentation" : "Sezione Strutturata------------------------------------------------------------------------------------------------------------------------------------------"
        }
      ]
    },
    {
      "name" : "ModalitadiTrasposto",
      "typeMode" : "none",
      "documentation" : "-----------------------------------------------------------------------------------------------------------------------\r\n______1._____________Sections________________________",
      "input" : [
        {
          "name" : "cda",
          "type" : "ClinicalDocument",
          "mode" : "source"
        },
        {
          "name" : "src",
          "type" : "Section",
          "mode" : "source"
        },
        {
          "name" : "patient",
          "type" : "Patient",
          "mode" : "target"
        },
        {
          "name" : "tgt",
          "mode" : "target"
        },
        {
          "name" : "bundle",
          "type" : "Bundle",
          "mode" : "target"
        },
        {
          "name" : "enc",
          "type" : "Encounter",
          "mode" : "target"
        }
      ],
      "rule" : [
        {
          "name" : "title",
          "source" : [
            {
              "context" : "src",
              "element" : "title",
              "variable" : "t"
            }
          ],
          "target" : [
            {
              "context" : "tgt",
              "contextType" : "variable",
              "element" : "title",
              "transform" : "evaluate",
              "parameter" : [
                {
                  "valueString" : "t.dataString"
                }
              ]
            }
          ]
        },
        {
          "name" : "code",
          "source" : [
            {
              "context" : "src",
              "element" : "code",
              "variable" : "vvv"
            }
          ],
          "target" : [
            {
              "context" : "tgt",
              "contextType" : "variable",
              "element" : "code",
              "variable" : "vvv",
              "transform" : "create"
            }
          ]
        },
        {
          "name" : "cdaText",
          "source" : [
            {
              "context" : "src",
              "element" : "text",
              "variable" : "cdaText"
            }
          ],
          "target" : [
            {
              "context" : "tgt",
              "contextType" : "variable",
              "element" : "text",
              "variable" : "fhirText"
            }
          ],
          "rule" : [
            {
              "name" : "narrativeStatus",
              "source" : [
                {
                  "context" : "cdaText"
                }
              ],
              "target" : [
                {
                  "context" : "fhirText",
                  "contextType" : "variable",
                  "element" : "status",
                  "transform" : "copy",
                  "parameter" : [
                    {
                      "valueString" : "generated"
                    }
                  ]
                }
              ]
            },
            {
              "name" : "narrativeText",
              "source" : [
                {
                  "context" : "cdaText",
                  "variable" : "t"
                }
              ],
              "target" : [
                {
                  "context" : "fhirText",
                  "contextType" : "variable",
                  "element" : "div",
                  "transform" : "copy",
                  "parameter" : [
                    {
                      "valueId" : "t"
                    }
                  ]
                }
              ]
            }
          ]
        },
        {
          "name" : "entry",
          "source" : [
            {
              "context" : "src",
              "element" : "entry",
              "variable" : "entry1"
            }
          ],
          "rule" : [
            {
              "name" : "entry1",
              "source" : [
                {
                  "context" : "src",
                  "element" : "entry",
                  "variable" : "entry1"
                }
              ],
              "target" : [
                {
                  "context" : "tgt",
                  "contextType" : "variable",
                  "element" : "entry",
                  "variable" : "reference",
                  "transform" : "create",
                  "parameter" : [
                    {
                      "valueString" : "Reference"
                    }
                  ]
                },
                {
                  "context" : "reference",
                  "contextType" : "variable",
                  "element" : "reference",
                  "transform" : "evaluate",
                  "parameter" : [
                    {
                      "valueString" : "'https://example/Encounter/' + %enc.id"
                    }
                  ]
                }
              ],
              "rule" : [
                {
                  "name" : "act",
                  "source" : [
                    {
                      "context" : "entry1",
                      "element" : "act",
                      "variable" : "act1"
                    }
                  ],
                  "dependent" : [
                    {
                      "name" : "Act",
                      "variable" : [
                        "act1",
                        "patient",
                        "enc",
                        "bundle"
                      ]
                    }
                  ]
                }
              ]
            }
          ]
        }
      ]
    },
    {
      "name" : "MotivoDellaVisita",
      "typeMode" : "none",
      "input" : [
        {
          "name" : "cda",
          "type" : "ClinicalDocument",
          "mode" : "source"
        },
        {
          "name" : "src",
          "type" : "Section",
          "mode" : "source"
        },
        {
          "name" : "patient",
          "type" : "Patient",
          "mode" : "target"
        },
        {
          "name" : "tgt",
          "mode" : "target"
        },
        {
          "name" : "bundle",
          "type" : "Bundle",
          "mode" : "target"
        },
        {
          "name" : "enc",
          "type" : "Encounter",
          "mode" : "target"
        }
      ],
      "rule" : [
        {
          "name" : "title",
          "source" : [
            {
              "context" : "src",
              "element" : "title",
              "variable" : "t"
            }
          ],
          "target" : [
            {
              "context" : "tgt",
              "contextType" : "variable",
              "element" : "title",
              "transform" : "evaluate",
              "parameter" : [
                {
                  "valueString" : "t.dataString"
                }
              ]
            }
          ]
        },
        {
          "name" : "code",
          "source" : [
            {
              "context" : "src",
              "element" : "code",
              "variable" : "vvv"
            }
          ],
          "target" : [
            {
              "context" : "tgt",
              "contextType" : "variable",
              "element" : "code",
              "variable" : "vvv",
              "transform" : "create"
            }
          ]
        },
        {
          "name" : "cdaText",
          "source" : [
            {
              "context" : "src",
              "element" : "text",
              "variable" : "cdaText"
            }
          ],
          "target" : [
            {
              "context" : "tgt",
              "contextType" : "variable",
              "element" : "text",
              "variable" : "fhirText"
            }
          ],
          "rule" : [
            {
              "name" : "narrativeStatus",
              "source" : [
                {
                  "context" : "cdaText"
                }
              ],
              "target" : [
                {
                  "context" : "fhirText",
                  "contextType" : "variable",
                  "element" : "status",
                  "transform" : "copy",
                  "parameter" : [
                    {
                      "valueString" : "generated"
                    }
                  ]
                }
              ]
            },
            {
              "name" : "narrativeText",
              "source" : [
                {
                  "context" : "cdaText",
                  "variable" : "t"
                }
              ],
              "target" : [
                {
                  "context" : "fhirText",
                  "contextType" : "variable",
                  "element" : "div",
                  "transform" : "copy",
                  "parameter" : [
                    {
                      "valueId" : "t"
                    }
                  ]
                }
              ]
            }
          ]
        },
        {
          "name" : "entry",
          "source" : [
            {
              "context" : "src",
              "element" : "entry",
              "variable" : "entry"
            }
          ],
          "target" : [
            {
              "context" : "bundle",
              "contextType" : "variable",
              "element" : "entry",
              "variable" : "e2"
            },
            {
              "context" : "e2",
              "contextType" : "variable",
              "element" : "request",
              "variable" : "request",
              "transform" : "create",
              "parameter" : [
                {
                  "valueString" : "BackboneElement"
                }
              ]
            },
            {
              "context" : "request",
              "contextType" : "variable",
              "element" : "method",
              "transform" : "copy",
              "parameter" : [
                {
                  "valueString" : "POST"
                }
              ]
            },
            {
              "context" : "e2",
              "contextType" : "variable",
              "element" : "resource",
              "variable" : "observation",
              "transform" : "create",
              "parameter" : [
                {
                  "valueString" : "Observation"
                }
              ]
            },
            {
              "context" : "observation",
              "contextType" : "variable",
              "element" : "id",
              "variable" : "uuid2",
              "transform" : "uuid"
            },
            {
              "context" : "e2",
              "contextType" : "variable",
              "element" : "fullUrl",
              "transform" : "append",
              "parameter" : [
                {
                  "valueString" : "https://example/Observation/"
                },
                {
                  "valueId" : "uuid2"
                }
              ]
            },
            {
              "context" : "request",
              "contextType" : "variable",
              "element" : "url",
              "transform" : "copy",
              "parameter" : [
                {
                  "valueString" : "Observation"
                }
              ]
            },
            {
              "context" : "tgt",
              "contextType" : "variable",
              "element" : "entry",
              "variable" : "reference",
              "transform" : "create",
              "parameter" : [
                {
                  "valueString" : "Reference"
                }
              ]
            },
            {
              "context" : "reference",
              "contextType" : "variable",
              "element" : "reference",
              "transform" : "evaluate",
              "parameter" : [
                {
                  "valueString" : "'https://example/Observation/' + %observation.id"
                }
              ]
            }
          ],
          "rule" : [
            {
              "name" : "observation",
              "source" : [
                {
                  "context" : "entry",
                  "element" : "observation",
                  "variable" : "obs"
                }
              ],
              "dependent" : [
                {
                  "name" : "Observation",
                  "variable" : [
                    "obs",
                    "patient",
                    "enc",
                    "observation",
                    "bundle"
                  ]
                }
              ]
            }
          ]
        }
      ]
    },
    {
      "name" : "Triage",
      "typeMode" : "none",
      "input" : [
        {
          "name" : "cda",
          "type" : "ClinicalDocument",
          "mode" : "source"
        },
        {
          "name" : "src",
          "type" : "Section",
          "mode" : "source"
        },
        {
          "name" : "patient",
          "type" : "Patient",
          "mode" : "target"
        },
        {
          "name" : "tgt",
          "mode" : "target"
        },
        {
          "name" : "bundle",
          "type" : "Bundle",
          "mode" : "target"
        },
        {
          "name" : "enc",
          "type" : "Encounter",
          "mode" : "target"
        }
      ],
      "rule" : [
        {
          "name" : "title",
          "source" : [
            {
              "context" : "src",
              "element" : "title",
              "variable" : "t"
            }
          ],
          "target" : [
            {
              "context" : "tgt",
              "contextType" : "variable",
              "element" : "title",
              "transform" : "evaluate",
              "parameter" : [
                {
                  "valueString" : "t.dataString"
                }
              ]
            }
          ]
        },
        {
          "name" : "code",
          "source" : [
            {
              "context" : "src",
              "element" : "code",
              "variable" : "vvv"
            }
          ],
          "target" : [
            {
              "context" : "tgt",
              "contextType" : "variable",
              "element" : "code",
              "variable" : "vvv",
              "transform" : "create"
            }
          ]
        },
        {
          "name" : "cdaText",
          "source" : [
            {
              "context" : "src",
              "element" : "text",
              "variable" : "cdaText"
            }
          ],
          "target" : [
            {
              "context" : "tgt",
              "contextType" : "variable",
              "element" : "text",
              "variable" : "fhirText"
            }
          ],
          "rule" : [
            {
              "name" : "narrativeStatus",
              "source" : [
                {
                  "context" : "cdaText"
                }
              ],
              "target" : [
                {
                  "context" : "fhirText",
                  "contextType" : "variable",
                  "element" : "status",
                  "transform" : "copy",
                  "parameter" : [
                    {
                      "valueString" : "generated"
                    }
                  ]
                }
              ]
            },
            {
              "name" : "narrativeText",
              "source" : [
                {
                  "context" : "cdaText",
                  "variable" : "t"
                }
              ],
              "target" : [
                {
                  "context" : "fhirText",
                  "contextType" : "variable",
                  "element" : "div",
                  "transform" : "copy",
                  "parameter" : [
                    {
                      "valueId" : "t"
                    }
                  ]
                }
              ]
            }
          ]
        },
        {
          "name" : "entry",
          "source" : [
            {
              "context" : "src",
              "element" : "entry",
              "variable" : "entry"
            }
          ],
          "target" : [
            {
              "context" : "bundle",
              "contextType" : "variable",
              "element" : "entry",
              "variable" : "e2"
            },
            {
              "context" : "e2",
              "contextType" : "variable",
              "element" : "request",
              "variable" : "request",
              "transform" : "create",
              "parameter" : [
                {
                  "valueString" : "BackboneElement"
                }
              ]
            },
            {
              "context" : "request",
              "contextType" : "variable",
              "element" : "method",
              "transform" : "copy",
              "parameter" : [
                {
                  "valueString" : "POST"
                }
              ]
            },
            {
              "context" : "e2",
              "contextType" : "variable",
              "element" : "resource",
              "variable" : "observation",
              "transform" : "create",
              "parameter" : [
                {
                  "valueString" : "Observation"
                }
              ]
            },
            {
              "context" : "observation",
              "contextType" : "variable",
              "element" : "id",
              "variable" : "uuid2",
              "transform" : "uuid"
            },
            {
              "context" : "e2",
              "contextType" : "variable",
              "element" : "fullUrl",
              "transform" : "append",
              "parameter" : [
                {
                  "valueString" : "https://example/Observation/"
                },
                {
                  "valueId" : "uuid2"
                }
              ]
            },
            {
              "context" : "request",
              "contextType" : "variable",
              "element" : "url",
              "transform" : "copy",
              "parameter" : [
                {
                  "valueString" : "Observation"
                }
              ]
            },
            {
              "context" : "tgt",
              "contextType" : "variable",
              "element" : "entry",
              "variable" : "reference",
              "transform" : "create",
              "parameter" : [
                {
                  "valueString" : "Reference"
                }
              ]
            },
            {
              "context" : "reference",
              "contextType" : "variable",
              "element" : "reference",
              "transform" : "evaluate",
              "parameter" : [
                {
                  "valueString" : "'https://example/Observation/' + %observation.id"
                }
              ]
            }
          ],
          "rule" : [
            {
              "name" : "observation",
              "source" : [
                {
                  "context" : "entry",
                  "element" : "observation",
                  "variable" : "obs"
                }
              ],
              "dependent" : [
                {
                  "name" : "Observation",
                  "variable" : [
                    "obs",
                    "patient",
                    "enc",
                    "observation",
                    "bundle"
                  ]
                }
              ]
            }
          ]
        }
      ]
    },
    {
      "name" : "InquadramentoClinicoIniziale",
      "typeMode" : "none",
      "input" : [
        {
          "name" : "cda",
          "type" : "ClinicalDocument",
          "mode" : "source"
        },
        {
          "name" : "src",
          "type" : "Section",
          "mode" : "source"
        },
        {
          "name" : "patient",
          "type" : "Patient",
          "mode" : "target"
        },
        {
          "name" : "tgt",
          "mode" : "target"
        },
        {
          "name" : "bundle",
          "type" : "Bundle",
          "mode" : "target"
        },
        {
          "name" : "enc",
          "type" : "Encounter",
          "mode" : "target"
        }
      ],
      "rule" : [
        {
          "name" : "title",
          "source" : [
            {
              "context" : "src",
              "element" : "title",
              "variable" : "t"
            }
          ],
          "target" : [
            {
              "context" : "tgt",
              "contextType" : "variable",
              "element" : "title",
              "transform" : "evaluate",
              "parameter" : [
                {
                  "valueString" : "t.dataString"
                }
              ]
            }
          ]
        },
        {
          "name" : "code",
          "source" : [
            {
              "context" : "src",
              "element" : "code",
              "variable" : "vvv"
            }
          ],
          "target" : [
            {
              "context" : "tgt",
              "contextType" : "variable",
              "element" : "code",
              "variable" : "vvv",
              "transform" : "create"
            }
          ]
        },
        {
          "name" : "cdaText",
          "source" : [
            {
              "context" : "src",
              "element" : "text",
              "variable" : "cdaText"
            }
          ],
          "target" : [
            {
              "context" : "bundle",
              "contextType" : "variable",
              "element" : "entry",
              "variable" : "e1"
            },
            {
              "context" : "e1",
              "contextType" : "variable",
              "element" : "request",
              "variable" : "request",
              "transform" : "create",
              "parameter" : [
                {
                  "valueString" : "BackboneElement"
                }
              ]
            },
            {
              "context" : "request",
              "contextType" : "variable",
              "element" : "method",
              "transform" : "copy",
              "parameter" : [
                {
                  "valueString" : "POST"
                }
              ]
            },
            {
              "context" : "e1",
              "contextType" : "variable",
              "element" : "resource",
              "variable" : "observation",
              "transform" : "create",
              "parameter" : [
                {
                  "valueString" : "Observation"
                }
              ]
            },
            {
              "context" : "observation",
              "contextType" : "variable",
              "element" : "id",
              "variable" : "uuid1",
              "transform" : "uuid"
            },
            {
              "context" : "e1",
              "contextType" : "variable",
              "element" : "fullUrl",
              "transform" : "append",
              "parameter" : [
                {
                  "valueString" : "https://example/Observation/"
                },
                {
                  "valueId" : "uuid1"
                }
              ]
            },
            {
              "context" : "request",
              "contextType" : "variable",
              "element" : "url",
              "transform" : "copy",
              "parameter" : [
                {
                  "valueString" : "Observation"
                }
              ]
            },
            {
              "context" : "tgt",
              "contextType" : "variable",
              "element" : "entry",
              "variable" : "reference",
              "transform" : "create",
              "parameter" : [
                {
                  "valueString" : "Reference"
                }
              ]
            },
            {
              "context" : "reference",
              "contextType" : "variable",
              "element" : "reference",
              "transform" : "evaluate",
              "parameter" : [
                {
                  "valueString" : "'https://example/Observation/' + %observation.id"
                }
              ]
            },
            {
              "context" : "tgt",
              "contextType" : "variable",
              "element" : "text",
              "variable" : "fhirText"
            }
          ],
          "rule" : [
            {
              "name" : "code",
              "source" : [
                {
                  "context" : "src",
                  "element" : "code",
                  "variable" : "vvv"
                }
              ],
              "target" : [
                {
                  "context" : "observation",
                  "contextType" : "variable",
                  "element" : "code",
                  "variable" : "vvv",
                  "transform" : "create"
                }
              ]
            },
            {
              "name" : "statuscode",
              "source" : [
                {
                  "context" : "src",
                  "condition" : "observation.statusCode.exists().not()"
                }
              ],
              "rule" : [
                {
                  "name" : "status",
                  "source" : [
                    {
                      "context" : "src"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "observation",
                      "contextType" : "variable",
                      "element" : "status",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "final"
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "name" : "reference",
              "source" : [
                {
                  "context" : "src"
                }
              ],
              "target" : [
                {
                  "context" : "observation",
                  "contextType" : "variable",
                  "element" : "subject",
                  "variable" : "reference",
                  "transform" : "create",
                  "parameter" : [
                    {
                      "valueString" : "Reference"
                    }
                  ]
                },
                {
                  "context" : "reference",
                  "contextType" : "variable",
                  "element" : "reference",
                  "transform" : "evaluate",
                  "parameter" : [
                    {
                      "valueString" : "'https://example/Patient/' + %patient.id"
                    }
                  ]
                }
              ]
            },
            {
              "name" : "reference",
              "source" : [
                {
                  "context" : "src"
                }
              ],
              "target" : [
                {
                  "context" : "observation",
                  "contextType" : "variable",
                  "element" : "encounter",
                  "variable" : "reference",
                  "transform" : "create",
                  "parameter" : [
                    {
                      "valueString" : "Reference"
                    }
                  ]
                },
                {
                  "context" : "reference",
                  "contextType" : "variable",
                  "element" : "reference",
                  "transform" : "evaluate",
                  "parameter" : [
                    {
                      "valueString" : "'https://example/Encounter/' + %enc.id"
                    }
                  ]
                }
              ]
            },
            {
              "name" : "reference",
              "source" : [
                {
                  "context" : "cdaText"
                }
              ],
              "target" : [
                {
                  "context" : "observation",
                  "contextType" : "variable",
                  "element" : "note",
                  "variable" : "note"
                }
              ],
              "rule" : [
                {
                  "name" : "Author",
                  "source" : [
                    {
                      "context" : "src",
                      "element" : "author",
                      "variable" : "author"
                    }
                  ],
                  "rule" : [
                    {
                      "name" : "practitioner",
                      "source" : [
                        {
                          "context" : "author"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "bundle",
                          "contextType" : "variable",
                          "element" : "entry",
                          "variable" : "e2"
                        },
                        {
                          "context" : "e2",
                          "contextType" : "variable",
                          "element" : "request",
                          "variable" : "request",
                          "transform" : "create",
                          "parameter" : [
                            {
                              "valueString" : "BackboneElement"
                            }
                          ]
                        },
                        {
                          "context" : "request",
                          "contextType" : "variable",
                          "element" : "method",
                          "transform" : "copy",
                          "parameter" : [
                            {
                              "valueString" : "PUT"
                            }
                          ]
                        },
                        {
                          "context" : "e2",
                          "contextType" : "variable",
                          "element" : "resource",
                          "variable" : "practitioner",
                          "transform" : "create",
                          "parameter" : [
                            {
                              "valueString" : "Practitioner"
                            }
                          ]
                        }
                      ],
                      "rule" : [
                        {
                          "name" : "assignedAuthor",
                          "source" : [
                            {
                              "context" : "author",
                              "element" : "assignedAuthor",
                              "variable" : "assignedAuthor"
                            }
                          ],
                          "rule" : [
                            {
                              "name" : "meta",
                              "source" : [
                                {
                                  "context" : "assignedAuthor"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "practitioner",
                                  "contextType" : "variable",
                                  "element" : "meta",
                                  "variable" : "meta"
                                }
                              ],
                              "rule" : [
                                {
                                  "name" : "coding",
                                  "source" : [
                                    {
                                      "context" : "assignedAuthor"
                                    }
                                  ],
                                  "target" : [
                                    {
                                      "context" : "meta",
                                      "contextType" : "variable",
                                      "element" : "tag",
                                      "variable" : "coding",
                                      "transform" : "create",
                                      "parameter" : [
                                        {
                                          "valueString" : "Coding"
                                        }
                                      ]
                                    }
                                  ],
                                  "rule" : [
                                    {
                                      "name" : "system",
                                      "source" : [
                                        {
                                          "context" : "assignedAuthor"
                                        }
                                      ],
                                      "target" : [
                                        {
                                          "context" : "coding",
                                          "contextType" : "variable",
                                          "element" : "system",
                                          "transform" : "copy",
                                          "parameter" : [
                                            {
                                              "valueString" : "http://algoritmodiscoring"
                                            }
                                          ]
                                        }
                                      ]
                                    },
                                    {
                                      "name" : "code",
                                      "source" : [
                                        {
                                          "context" : "assignedAuthor"
                                        }
                                      ],
                                      "target" : [
                                        {
                                          "context" : "coding",
                                          "contextType" : "variable",
                                          "element" : "code",
                                          "transform" : "copy",
                                          "parameter" : [
                                            {
                                              "valueString" : "ClinicalDocument/body/InquadramentoClinicoIniziale/author"
                                            }
                                          ]
                                        }
                                      ]
                                    }
                                  ]
                                }
                              ]
                            },
                            {
                              "name" : "identifier",
                              "source" : [
                                {
                                  "context" : "assignedAuthor",
                                  "element" : "id",
                                  "variable" : "id"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "practitioner",
                                  "contextType" : "variable",
                                  "element" : "identifier",
                                  "variable" : "identifier"
                                }
                              ],
                              "rule" : [
                                {
                                  "name" : "root1",
                                  "source" : [
                                    {
                                      "context" : "id",
                                      "element" : "root",
                                      "variable" : "r"
                                    }
                                  ],
                                  "target" : [
                                    {
                                      "context" : "identifier",
                                      "contextType" : "variable",
                                      "element" : "system",
                                      "transform" : "translate",
                                      "parameter" : [
                                        {
                                          "valueId" : "r"
                                        },
                                        {
                                          "valueString" : "http://hl7.org/fhir/ConceptMap/special-oid2uri"
                                        },
                                        {
                                          "valueString" : "uri"
                                        }
                                      ]
                                    }
                                  ]
                                },
                                {
                                  "name" : "extension",
                                  "source" : [
                                    {
                                      "context" : "id",
                                      "element" : "extension",
                                      "variable" : "ext"
                                    }
                                  ],
                                  "target" : [
                                    {
                                      "context" : "identifier",
                                      "contextType" : "variable",
                                      "element" : "value",
                                      "transform" : "copy",
                                      "parameter" : [
                                        {
                                          "valueId" : "ext"
                                        }
                                      ]
                                    }
                                  ]
                                },
                                {
                                  "name" : "assigningAuthorityName",
                                  "source" : [
                                    {
                                      "context" : "id",
                                      "element" : "assigningAuthorityName",
                                      "variable" : "s"
                                    }
                                  ],
                                  "target" : [
                                    {
                                      "context" : "identifier",
                                      "contextType" : "variable",
                                      "element" : "assigner",
                                      "variable" : "a"
                                    },
                                    {
                                      "context" : "a",
                                      "contextType" : "variable",
                                      "element" : "display",
                                      "transform" : "copy",
                                      "parameter" : [
                                        {
                                          "valueId" : "s"
                                        }
                                      ]
                                    }
                                  ]
                                },
                                {
                                  "name" : "r",
                                  "source" : [
                                    {
                                      "context" : "id",
                                      "element" : "root",
                                      "variable" : "r"
                                    }
                                  ],
                                  "rule" : [
                                    {
                                      "name" : "aut",
                                      "source" : [
                                        {
                                          "context" : "id",
                                          "element" : "extension",
                                          "variable" : "ext"
                                        }
                                      ],
                                      "target" : [
                                        {
                                          "context" : "practitioner",
                                          "contextType" : "variable",
                                          "element" : "id",
                                          "variable" : "uuid2",
                                          "transform" : "evaluate",
                                          "parameter" : [
                                            {
                                              "valueString" : "r + '-' + ext"
                                            }
                                          ]
                                        },
                                        {
                                          "context" : "e2",
                                          "contextType" : "variable",
                                          "element" : "fullUrl",
                                          "transform" : "append",
                                          "parameter" : [
                                            {
                                              "valueString" : "https://example/Practitioner/"
                                            },
                                            {
                                              "valueId" : "uuid2"
                                            }
                                          ]
                                        },
                                        {
                                          "context" : "request",
                                          "contextType" : "variable",
                                          "element" : "url",
                                          "transform" : "append",
                                          "parameter" : [
                                            {
                                              "valueString" : "Practitioner/"
                                            },
                                            {
                                              "valueId" : "uuid2"
                                            }
                                          ]
                                        },
                                        {
                                          "context" : "note",
                                          "contextType" : "variable",
                                          "element" : "author",
                                          "variable" : "reference",
                                          "transform" : "create",
                                          "parameter" : [
                                            {
                                              "valueString" : "Reference"
                                            }
                                          ]
                                        },
                                        {
                                          "context" : "reference",
                                          "contextType" : "variable",
                                          "element" : "reference",
                                          "transform" : "evaluate",
                                          "parameter" : [
                                            {
                                              "valueString" : "'https://example/Practitioner/' + %practitioner.id"
                                            }
                                          ]
                                        }
                                      ]
                                    }
                                  ]
                                }
                              ]
                            },
                            {
                              "name" : "2.16.840.1.113883.2.9.4.3.2",
                              "source" : [
                                {
                                  "context" : "assignedAuthor",
                                  "element" : "id",
                                  "variable" : "id",
                                  "condition" : "(root = '2.16.840.1.113883.2.9.4.3.2')"
                                }
                              ],
                              "rule" : [
                                {
                                  "name" : "UUID",
                                  "source" : [
                                    {
                                      "context" : "id",
                                      "element" : "extension",
                                      "variable" : "ext"
                                    }
                                  ],
                                  "target" : [
                                    {
                                      "context" : "request",
                                      "contextType" : "variable",
                                      "element" : "url",
                                      "transform" : "append",
                                      "parameter" : [
                                        {
                                          "valueString" : "Practitioner?identifier="
                                        },
                                        {
                                          "valueId" : "ext"
                                        }
                                      ]
                                    }
                                  ]
                                }
                              ]
                            },
                            {
                              "name" : "name",
                              "source" : [
                                {
                                  "context" : "assignedAuthor",
                                  "element" : "assignedPerson",
                                  "variable" : "person"
                                }
                              ],
                              "rule" : [
                                {
                                  "name" : "name",
                                  "source" : [
                                    {
                                      "context" : "person",
                                      "element" : "name",
                                      "variable" : "vvv"
                                    }
                                  ],
                                  "target" : [
                                    {
                                      "context" : "practitioner",
                                      "contextType" : "variable",
                                      "element" : "name",
                                      "variable" : "vvv",
                                      "transform" : "create"
                                    }
                                  ]
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "name" : "time",
                      "source" : [
                        {
                          "context" : "author",
                          "element" : "time",
                          "variable" : "t"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "note",
                          "contextType" : "variable",
                          "element" : "time",
                          "variable" : "value",
                          "transform" : "create",
                          "parameter" : [
                            {
                              "valueString" : "dateTime"
                            }
                          ]
                        }
                      ],
                      "dependent" : [
                        {
                          "name" : "TSDateTime",
                          "variable" : [
                            "t",
                            "value"
                          ]
                        }
                      ]
                    }
                  ]
                },
                {
                  "name" : "reference",
                  "source" : [
                    {
                      "context" : "cdaText",
                      "variable" : "t"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "note",
                      "contextType" : "variable",
                      "element" : "text",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueId" : "t"
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ]
        },
        {
          "name" : "component",
          "source" : [
            {
              "context" : "src",
              "element" : "component",
              "variable" : "component"
            }
          ],
          "rule" : [
            {
              "name" : "Sottosection",
              "source" : [
                {
                  "context" : "component",
                  "element" : "section",
                  "variable" : "sottosection"
                }
              ],
              "rule" : [
                {
                  "name" : "Sectionfhir",
                  "source" : [
                    {
                      "context" : "sottosection"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "tgt",
                      "contextType" : "variable",
                      "element" : "section",
                      "variable" : "section"
                    }
                  ],
                  "rule" : [
                    {
                      "name" : "code",
                      "source" : [
                        {
                          "context" : "sottosection",
                          "element" : "code",
                          "variable" : "vvv",
                          "condition" : "(code = '11329-0')"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "section",
                          "contextType" : "variable",
                          "element" : "code",
                          "variable" : "vvv",
                          "transform" : "create"
                        }
                      ],
                      "documentation" : "1. Anamnesi Narrativa-------------------------------------------------------------------------------------------------------------------------------------------"
                    },
                    {
                      "name" : "11329-0",
                      "source" : [
                        {
                          "context" : "sottosection",
                          "element" : "code",
                          "variable" : "code1",
                          "condition" : "(code = '11329-0')"
                        }
                      ],
                      "rule" : [
                        {
                          "name" : "where",
                          "source" : [
                            {
                              "context" : "src",
                              "condition" : "sottosection.entry.exists().not()"
                            }
                          ],
                          "rule" : [
                            {
                              "name" : "title",
                              "source" : [
                                {
                                  "context" : "sottosection",
                                  "element" : "title",
                                  "variable" : "t"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "section",
                                  "contextType" : "variable",
                                  "element" : "title",
                                  "transform" : "evaluate",
                                  "parameter" : [
                                    {
                                      "valueString" : "t.dataString"
                                    }
                                  ]
                                }
                              ]
                            },
                            {
                              "name" : "cdaText",
                              "source" : [
                                {
                                  "context" : "sottosection",
                                  "element" : "text",
                                  "variable" : "cdaText"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "bundle",
                                  "contextType" : "variable",
                                  "element" : "entry",
                                  "variable" : "e8"
                                },
                                {
                                  "context" : "e8",
                                  "contextType" : "variable",
                                  "element" : "request",
                                  "variable" : "request",
                                  "transform" : "create",
                                  "parameter" : [
                                    {
                                      "valueString" : "BackboneElement"
                                    }
                                  ]
                                },
                                {
                                  "context" : "request",
                                  "contextType" : "variable",
                                  "element" : "method",
                                  "transform" : "copy",
                                  "parameter" : [
                                    {
                                      "valueString" : "POST"
                                    }
                                  ]
                                },
                                {
                                  "context" : "e8",
                                  "contextType" : "variable",
                                  "element" : "resource",
                                  "variable" : "observation",
                                  "transform" : "create",
                                  "parameter" : [
                                    {
                                      "valueString" : "Observation"
                                    }
                                  ]
                                },
                                {
                                  "context" : "observation",
                                  "contextType" : "variable",
                                  "element" : "id",
                                  "variable" : "uuid8",
                                  "transform" : "uuid"
                                },
                                {
                                  "context" : "e8",
                                  "contextType" : "variable",
                                  "element" : "fullUrl",
                                  "transform" : "append",
                                  "parameter" : [
                                    {
                                      "valueString" : "https://example/Observation/"
                                    },
                                    {
                                      "valueId" : "uuid8"
                                    }
                                  ]
                                },
                                {
                                  "context" : "request",
                                  "contextType" : "variable",
                                  "element" : "url",
                                  "transform" : "copy",
                                  "parameter" : [
                                    {
                                      "valueString" : "Observation"
                                    }
                                  ]
                                },
                                {
                                  "context" : "section",
                                  "contextType" : "variable",
                                  "element" : "entry",
                                  "variable" : "reference",
                                  "transform" : "create",
                                  "parameter" : [
                                    {
                                      "valueString" : "Reference"
                                    }
                                  ]
                                },
                                {
                                  "context" : "reference",
                                  "contextType" : "variable",
                                  "element" : "reference",
                                  "transform" : "evaluate",
                                  "parameter" : [
                                    {
                                      "valueString" : "'https://example/Observation/' + %observation.id"
                                    }
                                  ]
                                }
                              ],
                              "rule" : [
                                {
                                  "name" : "reference",
                                  "source" : [
                                    {
                                      "context" : "cdaText"
                                    }
                                  ],
                                  "target" : [
                                    {
                                      "context" : "observation",
                                      "contextType" : "variable",
                                      "element" : "subject",
                                      "variable" : "reference",
                                      "transform" : "create",
                                      "parameter" : [
                                        {
                                          "valueString" : "Reference"
                                        }
                                      ]
                                    },
                                    {
                                      "context" : "reference",
                                      "contextType" : "variable",
                                      "element" : "reference",
                                      "transform" : "evaluate",
                                      "parameter" : [
                                        {
                                          "valueString" : "'https://example/Patient/' + %patient.id"
                                        }
                                      ]
                                    }
                                  ]
                                },
                                {
                                  "name" : "reference",
                                  "source" : [
                                    {
                                      "context" : "cdaText"
                                    }
                                  ],
                                  "target" : [
                                    {
                                      "context" : "observation",
                                      "contextType" : "variable",
                                      "element" : "encounter",
                                      "variable" : "reference",
                                      "transform" : "create",
                                      "parameter" : [
                                        {
                                          "valueString" : "Reference"
                                        }
                                      ]
                                    },
                                    {
                                      "context" : "reference",
                                      "contextType" : "variable",
                                      "element" : "reference",
                                      "transform" : "evaluate",
                                      "parameter" : [
                                        {
                                          "valueString" : "'https://example/Encounter/' + %enc.id"
                                        }
                                      ]
                                    }
                                  ]
                                },
                                {
                                  "name" : "code",
                                  "source" : [
                                    {
                                      "context" : "sottosection",
                                      "element" : "code",
                                      "variable" : "vvv"
                                    }
                                  ],
                                  "target" : [
                                    {
                                      "context" : "observation",
                                      "contextType" : "variable",
                                      "element" : "code",
                                      "variable" : "vvv",
                                      "transform" : "create"
                                    }
                                  ]
                                },
                                {
                                  "name" : "statuscode",
                                  "source" : [
                                    {
                                      "context" : "src",
                                      "condition" : "observation.statusCode.exists().not()"
                                    }
                                  ],
                                  "rule" : [
                                    {
                                      "name" : "status",
                                      "source" : [
                                        {
                                          "context" : "src"
                                        }
                                      ],
                                      "target" : [
                                        {
                                          "context" : "observation",
                                          "contextType" : "variable",
                                          "element" : "status",
                                          "transform" : "copy",
                                          "parameter" : [
                                            {
                                              "valueString" : "final"
                                            }
                                          ]
                                        }
                                      ]
                                    }
                                  ]
                                },
                                {
                                  "name" : "reference",
                                  "source" : [
                                    {
                                      "context" : "cdaText"
                                    }
                                  ],
                                  "target" : [
                                    {
                                      "context" : "observation",
                                      "contextType" : "variable",
                                      "element" : "note",
                                      "variable" : "note"
                                    }
                                  ],
                                  "rule" : [
                                    {
                                      "name" : "reference",
                                      "source" : [
                                        {
                                          "context" : "cdaText",
                                          "variable" : "t"
                                        }
                                      ],
                                      "target" : [
                                        {
                                          "context" : "note",
                                          "contextType" : "variable",
                                          "element" : "text",
                                          "transform" : "copy",
                                          "parameter" : [
                                            {
                                              "valueId" : "t"
                                            }
                                          ]
                                        }
                                      ]
                                    },
                                    {
                                      "name" : "author",
                                      "source" : [
                                        {
                                          "context" : "sottosection",
                                          "element" : "author",
                                          "variable" : "authors"
                                        }
                                      ],
                                      "rule" : [
                                        {
                                          "name" : "timeAuthor",
                                          "source" : [
                                            {
                                              "context" : "authors",
                                              "element" : "time",
                                              "variable" : "time"
                                            }
                                          ],
                                          "target" : [
                                            {
                                              "context" : "note",
                                              "contextType" : "variable",
                                              "element" : "time",
                                              "variable" : "value",
                                              "transform" : "create",
                                              "parameter" : [
                                                {
                                                  "valueString" : "dateTime"
                                                }
                                              ]
                                            }
                                          ],
                                          "dependent" : [
                                            {
                                              "name" : "TSDateTime",
                                              "variable" : [
                                                "time",
                                                "value"
                                              ]
                                            }
                                          ]
                                        },
                                        {
                                          "name" : "assighedAuthor",
                                          "source" : [
                                            {
                                              "context" : "authors",
                                              "element" : "assignedAuthor",
                                              "variable" : "assignedAuthor"
                                            }
                                          ],
                                          "target" : [
                                            {
                                              "context" : "bundle",
                                              "contextType" : "variable",
                                              "element" : "entry",
                                              "variable" : "e9"
                                            },
                                            {
                                              "context" : "e9",
                                              "contextType" : "variable",
                                              "element" : "request",
                                              "variable" : "request",
                                              "transform" : "create",
                                              "parameter" : [
                                                {
                                                  "valueString" : "BackboneElement"
                                                }
                                              ]
                                            },
                                            {
                                              "context" : "request",
                                              "contextType" : "variable",
                                              "element" : "method",
                                              "transform" : "copy",
                                              "parameter" : [
                                                {
                                                  "valueString" : "PUT"
                                                }
                                              ]
                                            },
                                            {
                                              "context" : "e9",
                                              "contextType" : "variable",
                                              "element" : "resource",
                                              "variable" : "practitioner",
                                              "transform" : "create",
                                              "parameter" : [
                                                {
                                                  "valueString" : "Practitioner"
                                                }
                                              ]
                                            }
                                          ],
                                          "rule" : [
                                            {
                                              "name" : "meta",
                                              "source" : [
                                                {
                                                  "context" : "assignedAuthor"
                                                }
                                              ],
                                              "target" : [
                                                {
                                                  "context" : "practitioner",
                                                  "contextType" : "variable",
                                                  "element" : "meta",
                                                  "variable" : "meta"
                                                }
                                              ],
                                              "rule" : [
                                                {
                                                  "name" : "coding",
                                                  "source" : [
                                                    {
                                                      "context" : "assignedAuthor"
                                                    }
                                                  ],
                                                  "target" : [
                                                    {
                                                      "context" : "meta",
                                                      "contextType" : "variable",
                                                      "element" : "tag",
                                                      "variable" : "coding",
                                                      "transform" : "create",
                                                      "parameter" : [
                                                        {
                                                          "valueString" : "Coding"
                                                        }
                                                      ]
                                                    }
                                                  ],
                                                  "rule" : [
                                                    {
                                                      "name" : "system",
                                                      "source" : [
                                                        {
                                                          "context" : "assignedAuthor"
                                                        }
                                                      ],
                                                      "target" : [
                                                        {
                                                          "context" : "coding",
                                                          "contextType" : "variable",
                                                          "element" : "system",
                                                          "transform" : "copy",
                                                          "parameter" : [
                                                            {
                                                              "valueString" : "http://algoritmodiscoring"
                                                            }
                                                          ]
                                                        }
                                                      ]
                                                    },
                                                    {
                                                      "name" : "code",
                                                      "source" : [
                                                        {
                                                          "context" : "assignedAuthor"
                                                        }
                                                      ],
                                                      "target" : [
                                                        {
                                                          "context" : "coding",
                                                          "contextType" : "variable",
                                                          "element" : "code",
                                                          "transform" : "copy",
                                                          "parameter" : [
                                                            {
                                                              "valueString" : "ClinicalDocument/body/EsameObiettivo/author"
                                                            }
                                                          ]
                                                        }
                                                      ]
                                                    }
                                                  ]
                                                }
                                              ]
                                            },
                                            {
                                              "name" : "identifier",
                                              "source" : [
                                                {
                                                  "context" : "assignedAuthor",
                                                  "element" : "id",
                                                  "variable" : "id"
                                                }
                                              ],
                                              "target" : [
                                                {
                                                  "context" : "practitioner",
                                                  "contextType" : "variable",
                                                  "element" : "identifier",
                                                  "variable" : "identifier"
                                                }
                                              ],
                                              "rule" : [
                                                {
                                                  "name" : "root1",
                                                  "source" : [
                                                    {
                                                      "context" : "id",
                                                      "element" : "root",
                                                      "variable" : "r"
                                                    }
                                                  ],
                                                  "target" : [
                                                    {
                                                      "context" : "identifier",
                                                      "contextType" : "variable",
                                                      "element" : "system",
                                                      "transform" : "translate",
                                                      "parameter" : [
                                                        {
                                                          "valueId" : "r"
                                                        },
                                                        {
                                                          "valueString" : "http://hl7.org/fhir/ConceptMap/special-oid2uri"
                                                        },
                                                        {
                                                          "valueString" : "uri"
                                                        }
                                                      ]
                                                    }
                                                  ]
                                                },
                                                {
                                                  "name" : "extension",
                                                  "source" : [
                                                    {
                                                      "context" : "id",
                                                      "element" : "extension",
                                                      "variable" : "ext"
                                                    }
                                                  ],
                                                  "target" : [
                                                    {
                                                      "context" : "identifier",
                                                      "contextType" : "variable",
                                                      "element" : "value",
                                                      "transform" : "copy",
                                                      "parameter" : [
                                                        {
                                                          "valueId" : "ext"
                                                        }
                                                      ]
                                                    }
                                                  ]
                                                },
                                                {
                                                  "name" : "assigningAuthorityName",
                                                  "source" : [
                                                    {
                                                      "context" : "id",
                                                      "element" : "assigningAuthorityName",
                                                      "variable" : "s"
                                                    }
                                                  ],
                                                  "target" : [
                                                    {
                                                      "context" : "identifier",
                                                      "contextType" : "variable",
                                                      "element" : "assigner",
                                                      "variable" : "a"
                                                    },
                                                    {
                                                      "context" : "a",
                                                      "contextType" : "variable",
                                                      "element" : "display",
                                                      "transform" : "copy",
                                                      "parameter" : [
                                                        {
                                                          "valueId" : "s"
                                                        }
                                                      ]
                                                    }
                                                  ]
                                                },
                                                {
                                                  "name" : "r",
                                                  "source" : [
                                                    {
                                                      "context" : "id",
                                                      "element" : "root",
                                                      "variable" : "r"
                                                    }
                                                  ],
                                                  "rule" : [
                                                    {
                                                      "name" : "autore",
                                                      "source" : [
                                                        {
                                                          "context" : "id",
                                                          "element" : "extension",
                                                          "variable" : "ext"
                                                        }
                                                      ],
                                                      "target" : [
                                                        {
                                                          "context" : "practitioner",
                                                          "contextType" : "variable",
                                                          "element" : "id",
                                                          "variable" : "uuid9",
                                                          "transform" : "evaluate",
                                                          "parameter" : [
                                                            {
                                                              "valueString" : "r + '-' + ext"
                                                            }
                                                          ]
                                                        },
                                                        {
                                                          "context" : "e9",
                                                          "contextType" : "variable",
                                                          "element" : "fullUrl",
                                                          "transform" : "append",
                                                          "parameter" : [
                                                            {
                                                              "valueString" : "https://example/Practitioner/"
                                                            },
                                                            {
                                                              "valueId" : "uuid9"
                                                            }
                                                          ]
                                                        },
                                                        {
                                                          "context" : "request",
                                                          "contextType" : "variable",
                                                          "element" : "url",
                                                          "transform" : "append",
                                                          "parameter" : [
                                                            {
                                                              "valueString" : "Practitioner/"
                                                            },
                                                            {
                                                              "valueId" : "uuid9"
                                                            }
                                                          ]
                                                        },
                                                        {
                                                          "context" : "note",
                                                          "contextType" : "variable",
                                                          "element" : "author",
                                                          "variable" : "reference",
                                                          "transform" : "create",
                                                          "parameter" : [
                                                            {
                                                              "valueString" : "Reference"
                                                            }
                                                          ]
                                                        },
                                                        {
                                                          "context" : "reference",
                                                          "contextType" : "variable",
                                                          "element" : "reference",
                                                          "transform" : "evaluate",
                                                          "parameter" : [
                                                            {
                                                              "valueString" : "'https://example/Practitioner/' + %practitioner.id"
                                                            }
                                                          ]
                                                        }
                                                      ]
                                                    }
                                                  ]
                                                }
                                              ]
                                            },
                                            {
                                              "name" : "2.16.840.1.113883.2.9.4.3.2",
                                              "source" : [
                                                {
                                                  "context" : "assignedAuthor",
                                                  "element" : "id",
                                                  "variable" : "id",
                                                  "condition" : "(root = '2.16.840.1.113883.2.9.4.3.2')"
                                                }
                                              ],
                                              "rule" : [
                                                {
                                                  "name" : "UUID",
                                                  "source" : [
                                                    {
                                                      "context" : "id",
                                                      "element" : "extension",
                                                      "variable" : "ext"
                                                    }
                                                  ],
                                                  "target" : [
                                                    {
                                                      "context" : "request",
                                                      "contextType" : "variable",
                                                      "element" : "url",
                                                      "transform" : "append",
                                                      "parameter" : [
                                                        {
                                                          "valueString" : "Practitioner?identifier="
                                                        },
                                                        {
                                                          "valueId" : "ext"
                                                        }
                                                      ]
                                                    }
                                                  ]
                                                }
                                              ]
                                            },
                                            {
                                              "name" : "assignedPerson",
                                              "source" : [
                                                {
                                                  "context" : "assignedAuthor",
                                                  "element" : "assignedPerson",
                                                  "variable" : "person"
                                                }
                                              ],
                                              "rule" : [
                                                {
                                                  "name" : "name",
                                                  "source" : [
                                                    {
                                                      "context" : "person",
                                                      "element" : "name",
                                                      "variable" : "vvv"
                                                    }
                                                  ],
                                                  "target" : [
                                                    {
                                                      "context" : "practitioner",
                                                      "contextType" : "variable",
                                                      "element" : "name",
                                                      "variable" : "vvv",
                                                      "transform" : "create"
                                                    }
                                                  ]
                                                }
                                              ]
                                            }
                                          ]
                                        }
                                      ]
                                    }
                                  ]
                                }
                              ]
                            }
                          ]
                        },
                        {
                          "name" : "subsection1",
                          "source" : [
                            {
                              "context" : "sottosection",
                              "element" : "entry",
                              "variable" : "entry1"
                            }
                          ],
                          "rule" : [
                            {
                              "name" : "entryobservation1",
                              "source" : [
                                {
                                  "context" : "entry1",
                                  "element" : "observation",
                                  "variable" : "obs"
                                }
                              ],
                              "rule" : [
                                {
                                  "name" : "89261-2",
                                  "source" : [
                                    {
                                      "context" : "obs",
                                      "element" : "code",
                                      "condition" : "(code = '75326-9')"
                                    }
                                  ],
                                  "rule" : [
                                    {
                                      "name" : "condition",
                                      "source" : [
                                        {
                                          "context" : "obs"
                                        }
                                      ],
                                      "target" : [
                                        {
                                          "context" : "bundle",
                                          "contextType" : "variable",
                                          "element" : "entry",
                                          "variable" : "e1"
                                        },
                                        {
                                          "context" : "e1",
                                          "contextType" : "variable",
                                          "element" : "request",
                                          "variable" : "request",
                                          "transform" : "create",
                                          "parameter" : [
                                            {
                                              "valueString" : "BackboneElement"
                                            }
                                          ]
                                        },
                                        {
                                          "context" : "request",
                                          "contextType" : "variable",
                                          "element" : "method",
                                          "transform" : "copy",
                                          "parameter" : [
                                            {
                                              "valueString" : "POST"
                                            }
                                          ]
                                        },
                                        {
                                          "context" : "e1",
                                          "contextType" : "variable",
                                          "element" : "resource",
                                          "variable" : "condition",
                                          "transform" : "create",
                                          "parameter" : [
                                            {
                                              "valueString" : "Condition"
                                            }
                                          ]
                                        },
                                        {
                                          "context" : "condition",
                                          "contextType" : "variable",
                                          "element" : "id",
                                          "variable" : "uuid1",
                                          "transform" : "uuid"
                                        },
                                        {
                                          "context" : "e1",
                                          "contextType" : "variable",
                                          "element" : "fullUrl",
                                          "transform" : "append",
                                          "parameter" : [
                                            {
                                              "valueString" : "https://example/Condition/"
                                            },
                                            {
                                              "valueId" : "uuid1"
                                            }
                                          ]
                                        },
                                        {
                                          "context" : "request",
                                          "contextType" : "variable",
                                          "element" : "url",
                                          "transform" : "copy",
                                          "parameter" : [
                                            {
                                              "valueString" : "Condition"
                                            }
                                          ]
                                        },
                                        {
                                          "context" : "section",
                                          "contextType" : "variable",
                                          "element" : "entry",
                                          "variable" : "reference",
                                          "transform" : "create",
                                          "parameter" : [
                                            {
                                              "valueString" : "Reference"
                                            }
                                          ]
                                        },
                                        {
                                          "context" : "reference",
                                          "contextType" : "variable",
                                          "element" : "reference",
                                          "transform" : "evaluate",
                                          "parameter" : [
                                            {
                                              "valueString" : "'https://example/Condition/' + %condition.id"
                                            }
                                          ]
                                        }
                                      ],
                                      "rule" : [
                                        {
                                          "name" : "code",
                                          "source" : [
                                            {
                                              "context" : "obs",
                                              "element" : "code",
                                              "variable" : "vvv"
                                            }
                                          ],
                                          "target" : [
                                            {
                                              "context" : "condition",
                                              "contextType" : "variable",
                                              "element" : "category",
                                              "variable" : "vvv",
                                              "transform" : "create"
                                            }
                                          ]
                                        },
                                        {
                                          "name" : "reference",
                                          "source" : [
                                            {
                                              "context" : "obs"
                                            }
                                          ],
                                          "target" : [
                                            {
                                              "context" : "condition",
                                              "contextType" : "variable",
                                              "element" : "subject",
                                              "variable" : "reference",
                                              "transform" : "create",
                                              "parameter" : [
                                                {
                                                  "valueString" : "Reference"
                                                }
                                              ]
                                            },
                                            {
                                              "context" : "reference",
                                              "contextType" : "variable",
                                              "element" : "reference",
                                              "transform" : "evaluate",
                                              "parameter" : [
                                                {
                                                  "valueString" : "'https://example/Patient/' + %patient.id"
                                                }
                                              ]
                                            }
                                          ]
                                        },
                                        {
                                          "name" : "reference",
                                          "source" : [
                                            {
                                              "context" : "obs"
                                            }
                                          ],
                                          "target" : [
                                            {
                                              "context" : "condition",
                                              "contextType" : "variable",
                                              "element" : "encounter",
                                              "variable" : "reference",
                                              "transform" : "create",
                                              "parameter" : [
                                                {
                                                  "valueString" : "Reference"
                                                }
                                              ]
                                            },
                                            {
                                              "context" : "reference",
                                              "contextType" : "variable",
                                              "element" : "reference",
                                              "transform" : "evaluate",
                                              "parameter" : [
                                                {
                                                  "valueString" : "'https://example/Encounter/' + %enc.id"
                                                }
                                              ]
                                            }
                                          ]
                                        },
                                        {
                                          "name" : "status",
                                          "source" : [
                                            {
                                              "context" : "obs",
                                              "element" : "statusCode",
                                              "variable" : "status",
                                              "condition" : "(code = 'completed')"
                                            }
                                          ],
                                          "target" : [
                                            {
                                              "context" : "condition",
                                              "contextType" : "variable",
                                              "element" : "verificationStatus",
                                              "variable" : "status2"
                                            }
                                          ],
                                          "rule" : [
                                            {
                                              "name" : "st3",
                                              "source" : [
                                                {
                                                  "context" : "status"
                                                }
                                              ],
                                              "target" : [
                                                {
                                                  "context" : "status2",
                                                  "contextType" : "variable",
                                                  "element" : "coding",
                                                  "variable" : "status3"
                                                }
                                              ],
                                              "rule" : [
                                                {
                                                  "name" : "finald",
                                                  "source" : [
                                                    {
                                                      "context" : "status"
                                                    }
                                                  ],
                                                  "target" : [
                                                    {
                                                      "context" : "status3",
                                                      "contextType" : "variable",
                                                      "element" : "code",
                                                      "transform" : "copy",
                                                      "parameter" : [
                                                        {
                                                          "valueString" : "confirmed"
                                                        }
                                                      ]
                                                    }
                                                  ]
                                                },
                                                {
                                                  "name" : "system",
                                                  "source" : [
                                                    {
                                                      "context" : "status"
                                                    }
                                                  ],
                                                  "target" : [
                                                    {
                                                      "context" : "status3",
                                                      "contextType" : "variable",
                                                      "element" : "system",
                                                      "transform" : "copy",
                                                      "parameter" : [
                                                        {
                                                          "valueString" : "http://terminology.hl7.org/CodeSystem/condition-ver-status"
                                                        }
                                                      ]
                                                    }
                                                  ]
                                                }
                                              ]
                                            }
                                          ]
                                        },
                                        {
                                          "name" : "cdaText1",
                                          "source" : [
                                            {
                                              "context" : "sottosection",
                                              "element" : "text",
                                              "variable" : "cdaText1"
                                            }
                                          ],
                                          "target" : [
                                            {
                                              "context" : "condition",
                                              "contextType" : "variable",
                                              "element" : "note",
                                              "variable" : "note"
                                            }
                                          ],
                                          "rule" : [
                                            {
                                              "name" : "reference",
                                              "source" : [
                                                {
                                                  "context" : "cdaText1",
                                                  "variable" : "t"
                                                }
                                              ],
                                              "target" : [
                                                {
                                                  "context" : "note",
                                                  "contextType" : "variable",
                                                  "element" : "text",
                                                  "transform" : "copy",
                                                  "parameter" : [
                                                    {
                                                      "valueId" : "t"
                                                    }
                                                  ]
                                                }
                                              ]
                                            },
                                            {
                                              "name" : "author",
                                              "source" : [
                                                {
                                                  "context" : "sottosection",
                                                  "element" : "author",
                                                  "variable" : "authors"
                                                }
                                              ],
                                              "rule" : [
                                                {
                                                  "name" : "timeAuthor",
                                                  "source" : [
                                                    {
                                                      "context" : "authors",
                                                      "element" : "time",
                                                      "variable" : "time"
                                                    }
                                                  ],
                                                  "target" : [
                                                    {
                                                      "context" : "note",
                                                      "contextType" : "variable",
                                                      "element" : "time",
                                                      "variable" : "value",
                                                      "transform" : "create",
                                                      "parameter" : [
                                                        {
                                                          "valueString" : "dateTime"
                                                        }
                                                      ]
                                                    }
                                                  ],
                                                  "dependent" : [
                                                    {
                                                      "name" : "TSDateTime",
                                                      "variable" : [
                                                        "time",
                                                        "value"
                                                      ]
                                                    }
                                                  ]
                                                },
                                                {
                                                  "name" : "assighedAuthor",
                                                  "source" : [
                                                    {
                                                      "context" : "authors",
                                                      "element" : "assignedAuthor",
                                                      "variable" : "assignedAuthor"
                                                    }
                                                  ],
                                                  "target" : [
                                                    {
                                                      "context" : "bundle",
                                                      "contextType" : "variable",
                                                      "element" : "entry",
                                                      "variable" : "e5"
                                                    },
                                                    {
                                                      "context" : "e5",
                                                      "contextType" : "variable",
                                                      "element" : "request",
                                                      "variable" : "request",
                                                      "transform" : "create",
                                                      "parameter" : [
                                                        {
                                                          "valueString" : "BackboneElement"
                                                        }
                                                      ]
                                                    },
                                                    {
                                                      "context" : "request",
                                                      "contextType" : "variable",
                                                      "element" : "method",
                                                      "transform" : "copy",
                                                      "parameter" : [
                                                        {
                                                          "valueString" : "PUT"
                                                        }
                                                      ]
                                                    },
                                                    {
                                                      "context" : "e5",
                                                      "contextType" : "variable",
                                                      "element" : "resource",
                                                      "variable" : "practitioner",
                                                      "transform" : "create",
                                                      "parameter" : [
                                                        {
                                                          "valueString" : "Practitioner"
                                                        }
                                                      ]
                                                    }
                                                  ],
                                                  "rule" : [
                                                    {
                                                      "name" : "meta",
                                                      "source" : [
                                                        {
                                                          "context" : "assignedAuthor"
                                                        }
                                                      ],
                                                      "target" : [
                                                        {
                                                          "context" : "practitioner",
                                                          "contextType" : "variable",
                                                          "element" : "meta",
                                                          "variable" : "meta"
                                                        }
                                                      ],
                                                      "rule" : [
                                                        {
                                                          "name" : "coding",
                                                          "source" : [
                                                            {
                                                              "context" : "assignedAuthor"
                                                            }
                                                          ],
                                                          "target" : [
                                                            {
                                                              "context" : "meta",
                                                              "contextType" : "variable",
                                                              "element" : "tag",
                                                              "variable" : "coding",
                                                              "transform" : "create",
                                                              "parameter" : [
                                                                {
                                                                  "valueString" : "Coding"
                                                                }
                                                              ]
                                                            }
                                                          ],
                                                          "rule" : [
                                                            {
                                                              "name" : "system",
                                                              "source" : [
                                                                {
                                                                  "context" : "assignedAuthor"
                                                                }
                                                              ],
                                                              "target" : [
                                                                {
                                                                  "context" : "coding",
                                                                  "contextType" : "variable",
                                                                  "element" : "system",
                                                                  "transform" : "copy",
                                                                  "parameter" : [
                                                                    {
                                                                      "valueString" : "http://algoritmodiscoring"
                                                                    }
                                                                  ]
                                                                }
                                                              ]
                                                            },
                                                            {
                                                              "name" : "code",
                                                              "source" : [
                                                                {
                                                                  "context" : "assignedAuthor"
                                                                }
                                                              ],
                                                              "target" : [
                                                                {
                                                                  "context" : "coding",
                                                                  "contextType" : "variable",
                                                                  "element" : "code",
                                                                  "transform" : "copy",
                                                                  "parameter" : [
                                                                    {
                                                                      "valueString" : "ClinicalDocument/body/Anamnesi/author"
                                                                    }
                                                                  ]
                                                                }
                                                              ]
                                                            }
                                                          ]
                                                        }
                                                      ]
                                                    },
                                                    {
                                                      "name" : "identifier",
                                                      "source" : [
                                                        {
                                                          "context" : "assignedAuthor",
                                                          "element" : "id",
                                                          "variable" : "id"
                                                        }
                                                      ],
                                                      "target" : [
                                                        {
                                                          "context" : "practitioner",
                                                          "contextType" : "variable",
                                                          "element" : "identifier",
                                                          "variable" : "identifier"
                                                        }
                                                      ],
                                                      "rule" : [
                                                        {
                                                          "name" : "root1",
                                                          "source" : [
                                                            {
                                                              "context" : "id",
                                                              "element" : "root",
                                                              "variable" : "r"
                                                            }
                                                          ],
                                                          "target" : [
                                                            {
                                                              "context" : "identifier",
                                                              "contextType" : "variable",
                                                              "element" : "system",
                                                              "transform" : "translate",
                                                              "parameter" : [
                                                                {
                                                                  "valueId" : "r"
                                                                },
                                                                {
                                                                  "valueString" : "http://hl7.org/fhir/ConceptMap/special-oid2uri"
                                                                },
                                                                {
                                                                  "valueString" : "uri"
                                                                }
                                                              ]
                                                            }
                                                          ]
                                                        },
                                                        {
                                                          "name" : "extension",
                                                          "source" : [
                                                            {
                                                              "context" : "id",
                                                              "element" : "extension",
                                                              "variable" : "ext"
                                                            }
                                                          ],
                                                          "target" : [
                                                            {
                                                              "context" : "identifier",
                                                              "contextType" : "variable",
                                                              "element" : "value",
                                                              "transform" : "copy",
                                                              "parameter" : [
                                                                {
                                                                  "valueId" : "ext"
                                                                }
                                                              ]
                                                            }
                                                          ]
                                                        },
                                                        {
                                                          "name" : "assigningAuthorityName",
                                                          "source" : [
                                                            {
                                                              "context" : "id",
                                                              "element" : "assigningAuthorityName",
                                                              "variable" : "s"
                                                            }
                                                          ],
                                                          "target" : [
                                                            {
                                                              "context" : "identifier",
                                                              "contextType" : "variable",
                                                              "element" : "assigner",
                                                              "variable" : "a"
                                                            },
                                                            {
                                                              "context" : "a",
                                                              "contextType" : "variable",
                                                              "element" : "display",
                                                              "transform" : "copy",
                                                              "parameter" : [
                                                                {
                                                                  "valueId" : "s"
                                                                }
                                                              ]
                                                            }
                                                          ]
                                                        },
                                                        {
                                                          "name" : "r",
                                                          "source" : [
                                                            {
                                                              "context" : "id",
                                                              "element" : "root",
                                                              "variable" : "r"
                                                            }
                                                          ],
                                                          "rule" : [
                                                            {
                                                              "name" : "extension",
                                                              "source" : [
                                                                {
                                                                  "context" : "id",
                                                                  "element" : "extension",
                                                                  "variable" : "ext"
                                                                }
                                                              ],
                                                              "target" : [
                                                                {
                                                                  "context" : "practitioner",
                                                                  "contextType" : "variable",
                                                                  "element" : "id",
                                                                  "variable" : "uuid5",
                                                                  "transform" : "evaluate",
                                                                  "parameter" : [
                                                                    {
                                                                      "valueString" : "r + '-' + ext"
                                                                    }
                                                                  ]
                                                                },
                                                                {
                                                                  "context" : "e5",
                                                                  "contextType" : "variable",
                                                                  "element" : "fullUrl",
                                                                  "transform" : "append",
                                                                  "parameter" : [
                                                                    {
                                                                      "valueString" : "https://example/Practitioner/"
                                                                    },
                                                                    {
                                                                      "valueId" : "uuid5"
                                                                    }
                                                                  ]
                                                                },
                                                                {
                                                                  "context" : "request",
                                                                  "contextType" : "variable",
                                                                  "element" : "url",
                                                                  "transform" : "append",
                                                                  "parameter" : [
                                                                    {
                                                                      "valueString" : "Practitioner/"
                                                                    },
                                                                    {
                                                                      "valueId" : "uuid5"
                                                                    }
                                                                  ]
                                                                },
                                                                {
                                                                  "context" : "note",
                                                                  "contextType" : "variable",
                                                                  "element" : "author",
                                                                  "variable" : "reference",
                                                                  "transform" : "create",
                                                                  "parameter" : [
                                                                    {
                                                                      "valueString" : "Reference"
                                                                    }
                                                                  ]
                                                                },
                                                                {
                                                                  "context" : "reference",
                                                                  "contextType" : "variable",
                                                                  "element" : "reference",
                                                                  "transform" : "evaluate",
                                                                  "parameter" : [
                                                                    {
                                                                      "valueString" : "'https://example/Practitioner/' + %practitioner.id"
                                                                    }
                                                                  ]
                                                                }
                                                              ]
                                                            }
                                                          ]
                                                        }
                                                      ]
                                                    },
                                                    {
                                                      "name" : "2.16.840.1.113883.2.9.4.3.2",
                                                      "source" : [
                                                        {
                                                          "context" : "assignedAuthor",
                                                          "element" : "id",
                                                          "variable" : "id",
                                                          "condition" : "(root = '2.16.840.1.113883.2.9.4.3.2')"
                                                        }
                                                      ],
                                                      "rule" : [
                                                        {
                                                          "name" : "UUID",
                                                          "source" : [
                                                            {
                                                              "context" : "id",
                                                              "element" : "extension",
                                                              "variable" : "ext"
                                                            }
                                                          ],
                                                          "target" : [
                                                            {
                                                              "context" : "request",
                                                              "contextType" : "variable",
                                                              "element" : "url",
                                                              "transform" : "append",
                                                              "parameter" : [
                                                                {
                                                                  "valueString" : "Practitioner?identifier="
                                                                },
                                                                {
                                                                  "valueId" : "ext"
                                                                }
                                                              ]
                                                            }
                                                          ]
                                                        }
                                                      ]
                                                    },
                                                    {
                                                      "name" : "assignedPerson",
                                                      "source" : [
                                                        {
                                                          "context" : "assignedAuthor",
                                                          "element" : "assignedPerson",
                                                          "variable" : "person"
                                                        }
                                                      ],
                                                      "rule" : [
                                                        {
                                                          "name" : "name",
                                                          "source" : [
                                                            {
                                                              "context" : "person",
                                                              "element" : "name",
                                                              "variable" : "vvv"
                                                            }
                                                          ],
                                                          "target" : [
                                                            {
                                                              "context" : "practitioner",
                                                              "contextType" : "variable",
                                                              "element" : "name",
                                                              "variable" : "vvv",
                                                              "transform" : "create"
                                                            }
                                                          ]
                                                        }
                                                      ]
                                                    }
                                                  ]
                                                }
                                              ]
                                            }
                                          ],
                                          "documentation" : "blocco Narrativo"
                                        },
                                        {
                                          "name" : "effectivetime1",
                                          "source" : [
                                            {
                                              "context" : "obs",
                                              "element" : "effectiveTime",
                                              "variable" : "effective1"
                                            }
                                          ],
                                          "rule" : [
                                            {
                                              "name" : "ef",
                                              "source" : [
                                                {
                                                  "context" : "effective1",
                                                  "condition" : "effective1.low.exists() or effective1.high.exists()"
                                                }
                                              ],
                                              "rule" : [
                                                {
                                                  "name" : "onsetperiod",
                                                  "source" : [
                                                    {
                                                      "context" : "effective1"
                                                    }
                                                  ],
                                                  "target" : [
                                                    {
                                                      "context" : "condition",
                                                      "contextType" : "variable",
                                                      "element" : "onset",
                                                      "variable" : "periodonset",
                                                      "transform" : "create",
                                                      "parameter" : [
                                                        {
                                                          "valueString" : "Period"
                                                        }
                                                      ]
                                                    }
                                                  ],
                                                  "dependent" : [
                                                    {
                                                      "name" : "IVLTSPeriod",
                                                      "variable" : [
                                                        "effective1",
                                                        "periodonset"
                                                      ]
                                                    }
                                                  ]
                                                }
                                              ]
                                            }
                                          ]
                                        },
                                        {
                                          "name" : "onsetDateTime",
                                          "source" : [
                                            {
                                              "context" : "obs",
                                              "element" : "effectiveTime",
                                              "variable" : "effectiveTime"
                                            }
                                          ],
                                          "target" : [
                                            {
                                              "context" : "condition",
                                              "contextType" : "variable",
                                              "element" : "onset",
                                              "variable" : "value",
                                              "transform" : "create",
                                              "parameter" : [
                                                {
                                                  "valueString" : "dateTime"
                                                }
                                              ]
                                            }
                                          ],
                                          "dependent" : [
                                            {
                                              "name" : "TSDateTime",
                                              "variable" : [
                                                "effectiveTime",
                                                "value"
                                              ]
                                            }
                                          ]
                                        },
                                        {
                                          "name" : "value",
                                          "source" : [
                                            {
                                              "context" : "obs",
                                              "type" : "INT",
                                              "element" : "value",
                                              "variable" : "int"
                                            }
                                          ],
                                          "target" : [
                                            {
                                              "context" : "ob",
                                              "contextType" : "variable",
                                              "element" : "value",
                                              "transform" : "evaluate",
                                              "parameter" : [
                                                {
                                                  "valueString" : "int.value"
                                                }
                                              ]
                                            }
                                          ]
                                        },
                                        {
                                          "name" : "boolean",
                                          "source" : [
                                            {
                                              "context" : "obs",
                                              "type" : "BL",
                                              "element" : "value",
                                              "variable" : "boolean"
                                            }
                                          ],
                                          "target" : [
                                            {
                                              "context" : "ob",
                                              "contextType" : "variable",
                                              "element" : "value",
                                              "transform" : "evaluate",
                                              "parameter" : [
                                                {
                                                  "valueString" : "boolean.value"
                                                }
                                              ]
                                            }
                                          ]
                                        },
                                        {
                                          "name" : "value",
                                          "source" : [
                                            {
                                              "context" : "obs",
                                              "type" : "ST",
                                              "element" : "value",
                                              "variable" : "value"
                                            }
                                          ],
                                          "target" : [
                                            {
                                              "context" : "ob",
                                              "contextType" : "variable",
                                              "element" : "value",
                                              "transform" : "create",
                                              "parameter" : [
                                                {
                                                  "valueString" : "string"
                                                }
                                              ]
                                            },
                                            {
                                              "context" : "ob",
                                              "contextType" : "variable",
                                              "element" : "value",
                                              "transform" : "evaluate",
                                              "parameter" : [
                                                {
                                                  "valueString" : "value.dataString"
                                                }
                                              ]
                                            }
                                          ]
                                        },
                                        {
                                          "name" : "val",
                                          "source" : [
                                            {
                                              "context" : "obs",
                                              "type" : "CE",
                                              "element" : "value",
                                              "variable" : "val"
                                            }
                                          ],
                                          "rule" : [
                                            {
                                              "name" : "coding",
                                              "source" : [
                                                {
                                                  "context" : "val"
                                                }
                                              ],
                                              "target" : [
                                                {
                                                  "context" : "ob",
                                                  "contextType" : "variable",
                                                  "element" : "value",
                                                  "variable" : "ce",
                                                  "transform" : "create",
                                                  "parameter" : [
                                                    {
                                                      "valueString" : "CodeableConcept"
                                                    }
                                                  ]
                                                }
                                              ],
                                              "rule" : [
                                                {
                                                  "name" : "originltext",
                                                  "source" : [
                                                    {
                                                      "context" : "val",
                                                      "element" : "originalText",
                                                      "variable" : "originalText"
                                                    }
                                                  ],
                                                  "rule" : [
                                                    {
                                                      "name" : "reference",
                                                      "source" : [
                                                        {
                                                          "context" : "originalText",
                                                          "element" : "reference",
                                                          "variable" : "reference"
                                                        }
                                                      ],
                                                      "target" : [
                                                        {
                                                          "context" : "ce",
                                                          "contextType" : "variable",
                                                          "element" : "text",
                                                          "transform" : "copy",
                                                          "parameter" : [
                                                            {
                                                              "valueId" : "reference"
                                                            }
                                                          ]
                                                        }
                                                      ]
                                                    }
                                                  ]
                                                },
                                                {
                                                  "name" : "code",
                                                  "source" : [
                                                    {
                                                      "context" : "val"
                                                    }
                                                  ],
                                                  "target" : [
                                                    {
                                                      "context" : "ce",
                                                      "contextType" : "variable",
                                                      "element" : "coding",
                                                      "variable" : "coding"
                                                    }
                                                  ],
                                                  "rule" : [
                                                    {
                                                      "name" : "code",
                                                      "source" : [
                                                        {
                                                          "context" : "val",
                                                          "element" : "code",
                                                          "variable" : "code"
                                                        }
                                                      ],
                                                      "target" : [
                                                        {
                                                          "context" : "coding",
                                                          "contextType" : "variable",
                                                          "element" : "code",
                                                          "transform" : "cast",
                                                          "parameter" : [
                                                            {
                                                              "valueId" : "code"
                                                            },
                                                            {
                                                              "valueString" : "string"
                                                            }
                                                          ]
                                                        }
                                                      ]
                                                    },
                                                    {
                                                      "name" : "codeSystem",
                                                      "source" : [
                                                        {
                                                          "context" : "val",
                                                          "element" : "codeSystem",
                                                          "variable" : "system"
                                                        }
                                                      ],
                                                      "target" : [
                                                        {
                                                          "context" : "coding",
                                                          "contextType" : "variable",
                                                          "element" : "system",
                                                          "transform" : "translate",
                                                          "parameter" : [
                                                            {
                                                              "valueId" : "system"
                                                            },
                                                            {
                                                              "valueString" : "http://hl7.org/fhir/ConceptMap/special-oid2uri"
                                                            },
                                                            {
                                                              "valueString" : "uri"
                                                            }
                                                          ]
                                                        }
                                                      ]
                                                    },
                                                    {
                                                      "name" : "displayName",
                                                      "source" : [
                                                        {
                                                          "context" : "val",
                                                          "element" : "displayName",
                                                          "variable" : "display"
                                                        }
                                                      ],
                                                      "target" : [
                                                        {
                                                          "context" : "coding",
                                                          "contextType" : "variable",
                                                          "element" : "display",
                                                          "transform" : "cast",
                                                          "parameter" : [
                                                            {
                                                              "valueId" : "display"
                                                            },
                                                            {
                                                              "valueString" : "string"
                                                            }
                                                          ]
                                                        }
                                                      ]
                                                    },
                                                    {
                                                      "name" : "codeSystemVersion",
                                                      "source" : [
                                                        {
                                                          "context" : "val",
                                                          "element" : "codeSystemVersion",
                                                          "variable" : "version"
                                                        }
                                                      ],
                                                      "target" : [
                                                        {
                                                          "context" : "coding",
                                                          "contextType" : "variable",
                                                          "element" : "version",
                                                          "transform" : "cast",
                                                          "parameter" : [
                                                            {
                                                              "valueId" : "version"
                                                            },
                                                            {
                                                              "valueString" : "string"
                                                            }
                                                          ]
                                                        }
                                                      ]
                                                    }
                                                  ]
                                                },
                                                {
                                                  "name" : "translation",
                                                  "source" : [
                                                    {
                                                      "context" : "val",
                                                      "element" : "translation",
                                                      "variable" : "translation"
                                                    }
                                                  ],
                                                  "target" : [
                                                    {
                                                      "context" : "ce",
                                                      "contextType" : "variable",
                                                      "element" : "coding",
                                                      "variable" : "coding"
                                                    }
                                                  ],
                                                  "rule" : [
                                                    {
                                                      "name" : "code",
                                                      "source" : [
                                                        {
                                                          "context" : "translation",
                                                          "element" : "code",
                                                          "variable" : "code"
                                                        }
                                                      ],
                                                      "target" : [
                                                        {
                                                          "context" : "coding",
                                                          "contextType" : "variable",
                                                          "element" : "code",
                                                          "transform" : "cast",
                                                          "parameter" : [
                                                            {
                                                              "valueId" : "code"
                                                            },
                                                            {
                                                              "valueString" : "string"
                                                            }
                                                          ]
                                                        }
                                                      ]
                                                    },
                                                    {
                                                      "name" : "codeSystem",
                                                      "source" : [
                                                        {
                                                          "context" : "translation",
                                                          "element" : "codeSystem",
                                                          "variable" : "system"
                                                        }
                                                      ],
                                                      "target" : [
                                                        {
                                                          "context" : "coding",
                                                          "contextType" : "variable",
                                                          "element" : "system",
                                                          "transform" : "translate",
                                                          "parameter" : [
                                                            {
                                                              "valueId" : "system"
                                                            },
                                                            {
                                                              "valueString" : "http://hl7.org/fhir/ConceptMap/special-oid2uri"
                                                            },
                                                            {
                                                              "valueString" : "uri"
                                                            }
                                                          ]
                                                        }
                                                      ]
                                                    },
                                                    {
                                                      "name" : "displayName",
                                                      "source" : [
                                                        {
                                                          "context" : "translation",
                                                          "element" : "displayName",
                                                          "variable" : "display"
                                                        }
                                                      ],
                                                      "target" : [
                                                        {
                                                          "context" : "coding",
                                                          "contextType" : "variable",
                                                          "element" : "display",
                                                          "transform" : "cast",
                                                          "parameter" : [
                                                            {
                                                              "valueId" : "display"
                                                            },
                                                            {
                                                              "valueString" : "string"
                                                            }
                                                          ]
                                                        }
                                                      ]
                                                    },
                                                    {
                                                      "name" : "codeSystemVersion",
                                                      "source" : [
                                                        {
                                                          "context" : "translation",
                                                          "element" : "codeSystemVersion",
                                                          "variable" : "version"
                                                        }
                                                      ],
                                                      "target" : [
                                                        {
                                                          "context" : "coding",
                                                          "contextType" : "variable",
                                                          "element" : "version",
                                                          "transform" : "cast",
                                                          "parameter" : [
                                                            {
                                                              "valueId" : "version"
                                                            },
                                                            {
                                                              "valueString" : "string"
                                                            }
                                                          ]
                                                        }
                                                      ]
                                                    },
                                                    {
                                                      "name" : "qualifier",
                                                      "source" : [
                                                        {
                                                          "context" : "translation",
                                                          "element" : "qualifier",
                                                          "variable" : "qualifier"
                                                        }
                                                      ],
                                                      "rule" : [
                                                        {
                                                          "name" : "value",
                                                          "source" : [
                                                            {
                                                              "context" : "qualifier",
                                                              "element" : "value",
                                                              "variable" : "value"
                                                            }
                                                          ],
                                                          "target" : [
                                                            {
                                                              "context" : "ce",
                                                              "contextType" : "variable",
                                                              "element" : "coding",
                                                              "variable" : "coding"
                                                            }
                                                          ],
                                                          "rule" : [
                                                            {
                                                              "name" : "code",
                                                              "source" : [
                                                                {
                                                                  "context" : "value",
                                                                  "element" : "code",
                                                                  "variable" : "code"
                                                                }
                                                              ],
                                                              "target" : [
                                                                {
                                                                  "context" : "coding",
                                                                  "contextType" : "variable",
                                                                  "element" : "code",
                                                                  "transform" : "cast",
                                                                  "parameter" : [
                                                                    {
                                                                      "valueId" : "code"
                                                                    },
                                                                    {
                                                                      "valueString" : "string"
                                                                    }
                                                                  ]
                                                                }
                                                              ]
                                                            },
                                                            {
                                                              "name" : "codeSystem",
                                                              "source" : [
                                                                {
                                                                  "context" : "value",
                                                                  "element" : "codeSystem",
                                                                  "variable" : "system"
                                                                }
                                                              ],
                                                              "target" : [
                                                                {
                                                                  "context" : "coding",
                                                                  "contextType" : "variable",
                                                                  "element" : "system",
                                                                  "transform" : "translate",
                                                                  "parameter" : [
                                                                    {
                                                                      "valueId" : "system"
                                                                    },
                                                                    {
                                                                      "valueString" : "http://hl7.org/fhir/ConceptMap/special-oid2uri"
                                                                    },
                                                                    {
                                                                      "valueString" : "uri"
                                                                    }
                                                                  ]
                                                                }
                                                              ]
                                                            },
                                                            {
                                                              "name" : "displayName",
                                                              "source" : [
                                                                {
                                                                  "context" : "value",
                                                                  "element" : "displayName",
                                                                  "variable" : "display"
                                                                }
                                                              ],
                                                              "target" : [
                                                                {
                                                                  "context" : "coding",
                                                                  "contextType" : "variable",
                                                                  "element" : "display",
                                                                  "transform" : "cast",
                                                                  "parameter" : [
                                                                    {
                                                                      "valueId" : "display"
                                                                    },
                                                                    {
                                                                      "valueString" : "string"
                                                                    }
                                                                  ]
                                                                }
                                                              ]
                                                            },
                                                            {
                                                              "name" : "codeSystemVersion",
                                                              "source" : [
                                                                {
                                                                  "context" : "value",
                                                                  "element" : "codeSystemVersion",
                                                                  "variable" : "version"
                                                                }
                                                              ],
                                                              "target" : [
                                                                {
                                                                  "context" : "coding",
                                                                  "contextType" : "variable",
                                                                  "element" : "version",
                                                                  "transform" : "cast",
                                                                  "parameter" : [
                                                                    {
                                                                      "valueId" : "version"
                                                                    },
                                                                    {
                                                                      "valueString" : "string"
                                                                    }
                                                                  ]
                                                                }
                                                              ]
                                                            }
                                                          ]
                                                        }
                                                      ]
                                                    }
                                                  ]
                                                }
                                              ]
                                            }
                                          ]
                                        },
                                        {
                                          "name" : "Value",
                                          "source" : [
                                            {
                                              "context" : "obs",
                                              "type" : "CD",
                                              "element" : "value",
                                              "variable" : "val"
                                            }
                                          ],
                                          "rule" : [
                                            {
                                              "name" : "Ce",
                                              "source" : [
                                                {
                                                  "context" : "val"
                                                }
                                              ],
                                              "target" : [
                                                {
                                                  "context" : "condition",
                                                  "contextType" : "variable",
                                                  "element" : "code",
                                                  "variable" : "ce",
                                                  "transform" : "create",
                                                  "parameter" : [
                                                    {
                                                      "valueString" : "CodeableConcept"
                                                    }
                                                  ]
                                                }
                                              ],
                                              "rule" : [
                                                {
                                                  "name" : "originalText",
                                                  "source" : [
                                                    {
                                                      "context" : "val",
                                                      "element" : "originalText",
                                                      "variable" : "vvv"
                                                    }
                                                  ],
                                                  "target" : [
                                                    {
                                                      "context" : "ce",
                                                      "contextType" : "variable",
                                                      "element" : "text",
                                                      "variable" : "vvv",
                                                      "transform" : "create"
                                                    }
                                                  ]
                                                },
                                                {
                                                  "name" : "coding",
                                                  "source" : [
                                                    {
                                                      "context" : "val"
                                                    }
                                                  ],
                                                  "target" : [
                                                    {
                                                      "context" : "ce",
                                                      "contextType" : "variable",
                                                      "element" : "coding",
                                                      "variable" : "coding"
                                                    }
                                                  ],
                                                  "rule" : [
                                                    {
                                                      "name" : "code",
                                                      "source" : [
                                                        {
                                                          "context" : "val",
                                                          "element" : "code",
                                                          "variable" : "code"
                                                        }
                                                      ],
                                                      "target" : [
                                                        {
                                                          "context" : "coding",
                                                          "contextType" : "variable",
                                                          "element" : "code",
                                                          "transform" : "cast",
                                                          "parameter" : [
                                                            {
                                                              "valueId" : "code"
                                                            },
                                                            {
                                                              "valueString" : "string"
                                                            }
                                                          ]
                                                        }
                                                      ]
                                                    },
                                                    {
                                                      "name" : "codeSystem",
                                                      "source" : [
                                                        {
                                                          "context" : "val",
                                                          "element" : "codeSystem",
                                                          "variable" : "system"
                                                        }
                                                      ],
                                                      "target" : [
                                                        {
                                                          "context" : "coding",
                                                          "contextType" : "variable",
                                                          "element" : "system",
                                                          "transform" : "translate",
                                                          "parameter" : [
                                                            {
                                                              "valueId" : "system"
                                                            },
                                                            {
                                                              "valueString" : "http://hl7.org/fhir/ConceptMap/special-oid2uri"
                                                            },
                                                            {
                                                              "valueString" : "uri"
                                                            }
                                                          ]
                                                        }
                                                      ]
                                                    },
                                                    {
                                                      "name" : "displayName",
                                                      "source" : [
                                                        {
                                                          "context" : "val",
                                                          "element" : "displayName",
                                                          "variable" : "display"
                                                        }
                                                      ],
                                                      "target" : [
                                                        {
                                                          "context" : "coding",
                                                          "contextType" : "variable",
                                                          "element" : "display",
                                                          "transform" : "cast",
                                                          "parameter" : [
                                                            {
                                                              "valueId" : "display"
                                                            },
                                                            {
                                                              "valueString" : "string"
                                                            }
                                                          ]
                                                        }
                                                      ]
                                                    }
                                                  ]
                                                }
                                              ]
                                            }
                                          ]
                                        },
                                        {
                                          "name" : "EntryRelationship1",
                                          "source" : [
                                            {
                                              "context" : "obs",
                                              "element" : "entryRelationship",
                                              "variable" : "entriRel"
                                            }
                                          ],
                                          "rule" : [
                                            {
                                              "name" : "evidence",
                                              "source" : [
                                                {
                                                  "context" : "entriRel"
                                                }
                                              ],
                                              "target" : [
                                                {
                                                  "context" : "condition",
                                                  "contextType" : "variable",
                                                  "element" : "evidence",
                                                  "variable" : "evidence",
                                                  "transform" : "create",
                                                  "parameter" : [
                                                    {
                                                      "valueString" : "BackboneElement"
                                                    }
                                                  ]
                                                }
                                              ],
                                              "rule" : [
                                                {
                                                  "name" : "Observation2",
                                                  "source" : [
                                                    {
                                                      "context" : "entriRel",
                                                      "element" : "observation",
                                                      "variable" : "observation2"
                                                    }
                                                  ],
                                                  "rule" : [
                                                    {
                                                      "name" : "code",
                                                      "source" : [
                                                        {
                                                          "context" : "observation2",
                                                          "element" : "code",
                                                          "variable" : "code"
                                                        }
                                                      ],
                                                      "rule" : [
                                                        {
                                                          "name" : "whereDecorsoClinico",
                                                          "source" : [
                                                            {
                                                              "context" : "code",
                                                              "element" : "code",
                                                              "condition" : "(code.code = '89261-2')"
                                                            }
                                                          ],
                                                          "rule" : [
                                                            {
                                                              "name" : "obser",
                                                              "source" : [
                                                                {
                                                                  "context" : "obs"
                                                                }
                                                              ],
                                                              "target" : [
                                                                {
                                                                  "context" : "bundle",
                                                                  "contextType" : "variable",
                                                                  "element" : "entry",
                                                                  "variable" : "e1"
                                                                },
                                                                {
                                                                  "context" : "e1",
                                                                  "contextType" : "variable",
                                                                  "element" : "request",
                                                                  "variable" : "request",
                                                                  "transform" : "create",
                                                                  "parameter" : [
                                                                    {
                                                                      "valueString" : "BackboneElement"
                                                                    }
                                                                  ]
                                                                },
                                                                {
                                                                  "context" : "request",
                                                                  "contextType" : "variable",
                                                                  "element" : "method",
                                                                  "transform" : "copy",
                                                                  "parameter" : [
                                                                    {
                                                                      "valueString" : "POST"
                                                                    }
                                                                  ]
                                                                },
                                                                {
                                                                  "context" : "e1",
                                                                  "contextType" : "variable",
                                                                  "element" : "resource",
                                                                  "variable" : "observation",
                                                                  "transform" : "create",
                                                                  "parameter" : [
                                                                    {
                                                                      "valueString" : "Observation"
                                                                    }
                                                                  ]
                                                                },
                                                                {
                                                                  "context" : "observation",
                                                                  "contextType" : "variable",
                                                                  "element" : "id",
                                                                  "variable" : "uuid1",
                                                                  "transform" : "uuid"
                                                                },
                                                                {
                                                                  "context" : "e1",
                                                                  "contextType" : "variable",
                                                                  "element" : "fullUrl",
                                                                  "transform" : "append",
                                                                  "parameter" : [
                                                                    {
                                                                      "valueString" : "https://example/Observation/"
                                                                    },
                                                                    {
                                                                      "valueId" : "uuid1"
                                                                    }
                                                                  ]
                                                                },
                                                                {
                                                                  "context" : "request",
                                                                  "contextType" : "variable",
                                                                  "element" : "url",
                                                                  "transform" : "copy",
                                                                  "parameter" : [
                                                                    {
                                                                      "valueString" : "Observation"
                                                                    }
                                                                  ]
                                                                }
                                                              ],
                                                              "rule" : [
                                                                {
                                                                  "name" : "ref",
                                                                  "source" : [
                                                                    {
                                                                      "context" : "entriRel"
                                                                    }
                                                                  ],
                                                                  "target" : [
                                                                    {
                                                                      "context" : "evidence",
                                                                      "contextType" : "variable",
                                                                      "element" : "detail",
                                                                      "variable" : "reference",
                                                                      "transform" : "create",
                                                                      "parameter" : [
                                                                        {
                                                                          "valueString" : "Reference"
                                                                        }
                                                                      ]
                                                                    },
                                                                    {
                                                                      "context" : "reference",
                                                                      "contextType" : "variable",
                                                                      "element" : "reference",
                                                                      "transform" : "evaluate",
                                                                      "parameter" : [
                                                                        {
                                                                          "valueString" : "'https://example/Observation/' + %observation.id"
                                                                        }
                                                                      ]
                                                                    }
                                                                  ]
                                                                },
                                                                {
                                                                  "name" : "code",
                                                                  "source" : [
                                                                    {
                                                                      "context" : "observation2",
                                                                      "element" : "code",
                                                                      "variable" : "vvv"
                                                                    }
                                                                  ],
                                                                  "target" : [
                                                                    {
                                                                      "context" : "observation",
                                                                      "contextType" : "variable",
                                                                      "element" : "code",
                                                                      "variable" : "vvv",
                                                                      "transform" : "create"
                                                                    }
                                                                  ]
                                                                },
                                                                {
                                                                  "name" : "statuscode",
                                                                  "source" : [
                                                                    {
                                                                      "context" : "observation2",
                                                                      "condition" : "observation.statusCode.exists().not()"
                                                                    }
                                                                  ],
                                                                  "rule" : [
                                                                    {
                                                                      "name" : "status",
                                                                      "source" : [
                                                                        {
                                                                          "context" : "observation2"
                                                                        }
                                                                      ],
                                                                      "target" : [
                                                                        {
                                                                          "context" : "observation",
                                                                          "contextType" : "variable",
                                                                          "element" : "status",
                                                                          "transform" : "copy",
                                                                          "parameter" : [
                                                                            {
                                                                              "valueString" : "final"
                                                                            }
                                                                          ]
                                                                        }
                                                                      ]
                                                                    }
                                                                  ]
                                                                },
                                                                {
                                                                  "name" : "Annontation",
                                                                  "source" : [
                                                                    {
                                                                      "context" : "observation2",
                                                                      "element" : "text",
                                                                      "variable" : "text"
                                                                    }
                                                                  ],
                                                                  "target" : [
                                                                    {
                                                                      "context" : "observation",
                                                                      "contextType" : "variable",
                                                                      "element" : "note",
                                                                      "variable" : "note",
                                                                      "transform" : "create",
                                                                      "parameter" : [
                                                                        {
                                                                          "valueString" : "Annotation"
                                                                        }
                                                                      ]
                                                                    }
                                                                  ],
                                                                  "rule" : [
                                                                    {
                                                                      "name" : "val",
                                                                      "source" : [
                                                                        {
                                                                          "context" : "text",
                                                                          "element" : "reference",
                                                                          "variable" : "ref"
                                                                        }
                                                                      ],
                                                                      "target" : [
                                                                        {
                                                                          "context" : "note",
                                                                          "contextType" : "variable",
                                                                          "element" : "text",
                                                                          "transform" : "evaluate",
                                                                          "parameter" : [
                                                                            {
                                                                              "valueString" : "ref.value"
                                                                            }
                                                                          ]
                                                                        }
                                                                      ]
                                                                    }
                                                                  ]
                                                                },
                                                                {
                                                                  "name" : "reference",
                                                                  "source" : [
                                                                    {
                                                                      "context" : "obs"
                                                                    }
                                                                  ],
                                                                  "target" : [
                                                                    {
                                                                      "context" : "observation",
                                                                      "contextType" : "variable",
                                                                      "element" : "subject",
                                                                      "variable" : "reference",
                                                                      "transform" : "create",
                                                                      "parameter" : [
                                                                        {
                                                                          "valueString" : "Reference"
                                                                        }
                                                                      ]
                                                                    },
                                                                    {
                                                                      "context" : "reference",
                                                                      "contextType" : "variable",
                                                                      "element" : "reference",
                                                                      "transform" : "evaluate",
                                                                      "parameter" : [
                                                                        {
                                                                          "valueString" : "'https://example/Patient/' + %patient.id"
                                                                        }
                                                                      ]
                                                                    }
                                                                  ]
                                                                },
                                                                {
                                                                  "name" : "reference",
                                                                  "source" : [
                                                                    {
                                                                      "context" : "obs"
                                                                    }
                                                                  ],
                                                                  "target" : [
                                                                    {
                                                                      "context" : "observation",
                                                                      "contextType" : "variable",
                                                                      "element" : "encounter",
                                                                      "variable" : "reference",
                                                                      "transform" : "create",
                                                                      "parameter" : [
                                                                        {
                                                                          "valueString" : "Reference"
                                                                        }
                                                                      ]
                                                                    },
                                                                    {
                                                                      "context" : "reference",
                                                                      "contextType" : "variable",
                                                                      "element" : "reference",
                                                                      "transform" : "evaluate",
                                                                      "parameter" : [
                                                                        {
                                                                          "valueString" : "'https://example/Encounter/' + %enc.id"
                                                                        }
                                                                      ]
                                                                    }
                                                                  ]
                                                                },
                                                                {
                                                                  "name" : "statusCode",
                                                                  "source" : [
                                                                    {
                                                                      "context" : "observation2",
                                                                      "element" : "statusCode",
                                                                      "variable" : "statusc",
                                                                      "condition" : "(code = 'completed')"
                                                                    }
                                                                  ],
                                                                  "target" : [
                                                                    {
                                                                      "context" : "ob",
                                                                      "contextType" : "variable",
                                                                      "element" : "status",
                                                                      "transform" : "copy",
                                                                      "parameter" : [
                                                                        {
                                                                          "valueString" : "final"
                                                                        }
                                                                      ]
                                                                    }
                                                                  ]
                                                                },
                                                                {
                                                                  "name" : "statusCode",
                                                                  "source" : [
                                                                    {
                                                                      "context" : "observation2",
                                                                      "element" : "statusCode",
                                                                      "variable" : "statusc",
                                                                      "condition" : "(code = 'active')"
                                                                    }
                                                                  ],
                                                                  "target" : [
                                                                    {
                                                                      "context" : "ob",
                                                                      "contextType" : "variable",
                                                                      "element" : "status",
                                                                      "transform" : "copy",
                                                                      "parameter" : [
                                                                        {
                                                                          "valueString" : "registered"
                                                                        }
                                                                      ]
                                                                    }
                                                                  ]
                                                                },
                                                                {
                                                                  "name" : "statusCode",
                                                                  "source" : [
                                                                    {
                                                                      "context" : "observation2",
                                                                      "element" : "statusCode",
                                                                      "variable" : "statusc",
                                                                      "condition" : "(code = 'aborted')"
                                                                    }
                                                                  ],
                                                                  "target" : [
                                                                    {
                                                                      "context" : "ob",
                                                                      "contextType" : "variable",
                                                                      "element" : "status",
                                                                      "transform" : "copy",
                                                                      "parameter" : [
                                                                        {
                                                                          "valueString" : "cancelled"
                                                                        }
                                                                      ]
                                                                    }
                                                                  ]
                                                                },
                                                                {
                                                                  "name" : "statusCode",
                                                                  "source" : [
                                                                    {
                                                                      "context" : "observation2",
                                                                      "element" : "statusCode",
                                                                      "variable" : "statusc",
                                                                      "condition" : "(code = 'suspended')"
                                                                    }
                                                                  ],
                                                                  "target" : [
                                                                    {
                                                                      "context" : "ob",
                                                                      "contextType" : "variable",
                                                                      "element" : "status",
                                                                      "transform" : "copy",
                                                                      "parameter" : [
                                                                        {
                                                                          "valueString" : "partial"
                                                                        }
                                                                      ]
                                                                    }
                                                                  ]
                                                                },
                                                                {
                                                                  "name" : "value",
                                                                  "source" : [
                                                                    {
                                                                      "context" : "observation2",
                                                                      "type" : "INT",
                                                                      "element" : "value",
                                                                      "variable" : "int"
                                                                    }
                                                                  ],
                                                                  "target" : [
                                                                    {
                                                                      "context" : "observation",
                                                                      "contextType" : "variable",
                                                                      "element" : "value",
                                                                      "transform" : "evaluate",
                                                                      "parameter" : [
                                                                        {
                                                                          "valueString" : "int.value"
                                                                        }
                                                                      ]
                                                                    }
                                                                  ]
                                                                },
                                                                {
                                                                  "name" : "boolean",
                                                                  "source" : [
                                                                    {
                                                                      "context" : "observation2",
                                                                      "type" : "BL",
                                                                      "element" : "value",
                                                                      "variable" : "boolean"
                                                                    }
                                                                  ],
                                                                  "target" : [
                                                                    {
                                                                      "context" : "observation",
                                                                      "contextType" : "variable",
                                                                      "element" : "value",
                                                                      "transform" : "evaluate",
                                                                      "parameter" : [
                                                                        {
                                                                          "valueString" : "boolean.value"
                                                                        }
                                                                      ]
                                                                    }
                                                                  ]
                                                                },
                                                                {
                                                                  "name" : "value",
                                                                  "source" : [
                                                                    {
                                                                      "context" : "observation2",
                                                                      "type" : "ST",
                                                                      "element" : "value",
                                                                      "variable" : "value"
                                                                    }
                                                                  ],
                                                                  "target" : [
                                                                    {
                                                                      "context" : "observation",
                                                                      "contextType" : "variable",
                                                                      "element" : "value",
                                                                      "transform" : "create",
                                                                      "parameter" : [
                                                                        {
                                                                          "valueString" : "string"
                                                                        }
                                                                      ]
                                                                    },
                                                                    {
                                                                      "context" : "observation",
                                                                      "contextType" : "variable",
                                                                      "element" : "value",
                                                                      "transform" : "evaluate",
                                                                      "parameter" : [
                                                                        {
                                                                          "valueString" : "value.dataString"
                                                                        }
                                                                      ]
                                                                    }
                                                                  ]
                                                                },
                                                                {
                                                                  "name" : "value2",
                                                                  "source" : [
                                                                    {
                                                                      "context" : "observation2",
                                                                      "element" : "effectiveTime",
                                                                      "variable" : "effectiveTime"
                                                                    }
                                                                  ],
                                                                  "target" : [
                                                                    {
                                                                      "context" : "observation",
                                                                      "contextType" : "variable",
                                                                      "element" : "effective",
                                                                      "variable" : "value",
                                                                      "transform" : "create",
                                                                      "parameter" : [
                                                                        {
                                                                          "valueString" : "dateTime"
                                                                        }
                                                                      ]
                                                                    }
                                                                  ],
                                                                  "dependent" : [
                                                                    {
                                                                      "name" : "TSDateTime",
                                                                      "variable" : [
                                                                        "effectiveTime",
                                                                        "value"
                                                                      ]
                                                                    }
                                                                  ]
                                                                },
                                                                {
                                                                  "name" : "where",
                                                                  "source" : [
                                                                    {
                                                                      "context" : "observation2",
                                                                      "condition" : "effectiveTime.low.exists() or effectiveTime.high.exists()"
                                                                    }
                                                                  ],
                                                                  "rule" : [
                                                                    {
                                                                      "name" : "effectiveTime",
                                                                      "source" : [
                                                                        {
                                                                          "context" : "observation2",
                                                                          "element" : "effectiveTime",
                                                                          "variable" : "eff"
                                                                        }
                                                                      ],
                                                                      "target" : [
                                                                        {
                                                                          "context" : "observation",
                                                                          "contextType" : "variable",
                                                                          "element" : "effective",
                                                                          "variable" : "period",
                                                                          "transform" : "create",
                                                                          "parameter" : [
                                                                            {
                                                                              "valueString" : "Period"
                                                                            }
                                                                          ]
                                                                        }
                                                                      ],
                                                                      "dependent" : [
                                                                        {
                                                                          "name" : "IVLTSPeriod",
                                                                          "variable" : [
                                                                            "eff",
                                                                            "period"
                                                                          ]
                                                                        }
                                                                      ]
                                                                    }
                                                                  ]
                                                                },
                                                                {
                                                                  "name" : "valueQuantity",
                                                                  "source" : [
                                                                    {
                                                                      "context" : "observation2",
                                                                      "type" : "PQ",
                                                                      "element" : "value",
                                                                      "variable" : "val"
                                                                    }
                                                                  ],
                                                                  "rule" : [
                                                                    {
                                                                      "name" : "quantity",
                                                                      "source" : [
                                                                        {
                                                                          "context" : "val"
                                                                        }
                                                                      ],
                                                                      "target" : [
                                                                        {
                                                                          "context" : "observation",
                                                                          "contextType" : "variable",
                                                                          "element" : "value",
                                                                          "variable" : "quantity",
                                                                          "transform" : "create",
                                                                          "parameter" : [
                                                                            {
                                                                              "valueString" : "Quantity"
                                                                            }
                                                                          ]
                                                                        }
                                                                      ],
                                                                      "rule" : [
                                                                        {
                                                                          "name" : "value",
                                                                          "source" : [
                                                                            {
                                                                              "context" : "val",
                                                                              "element" : "value",
                                                                              "variable" : "value"
                                                                            }
                                                                          ],
                                                                          "target" : [
                                                                            {
                                                                              "context" : "quantity",
                                                                              "contextType" : "variable",
                                                                              "element" : "value",
                                                                              "transform" : "copy",
                                                                              "parameter" : [
                                                                                {
                                                                                  "valueId" : "value"
                                                                                }
                                                                              ]
                                                                            }
                                                                          ]
                                                                        },
                                                                        {
                                                                          "name" : "unit",
                                                                          "source" : [
                                                                            {
                                                                              "context" : "val",
                                                                              "element" : "unit",
                                                                              "variable" : "unit"
                                                                            }
                                                                          ],
                                                                          "target" : [
                                                                            {
                                                                              "context" : "quantity",
                                                                              "contextType" : "variable",
                                                                              "element" : "unit",
                                                                              "transform" : "copy",
                                                                              "parameter" : [
                                                                                {
                                                                                  "valueId" : "unit"
                                                                                }
                                                                              ]
                                                                            }
                                                                          ]
                                                                        }
                                                                      ]
                                                                    }
                                                                  ]
                                                                },
                                                                {
                                                                  "name" : "Value",
                                                                  "source" : [
                                                                    {
                                                                      "context" : "observation2",
                                                                      "type" : "CE",
                                                                      "element" : "value",
                                                                      "variable" : "val"
                                                                    }
                                                                  ],
                                                                  "rule" : [
                                                                    {
                                                                      "name" : "Ce",
                                                                      "source" : [
                                                                        {
                                                                          "context" : "val"
                                                                        }
                                                                      ],
                                                                      "target" : [
                                                                        {
                                                                          "context" : "observation",
                                                                          "contextType" : "variable",
                                                                          "element" : "value",
                                                                          "variable" : "ce",
                                                                          "transform" : "create",
                                                                          "parameter" : [
                                                                            {
                                                                              "valueString" : "CodeableConcept"
                                                                            }
                                                                          ]
                                                                        }
                                                                      ],
                                                                      "rule" : [
                                                                        {
                                                                          "name" : "originalText",
                                                                          "source" : [
                                                                            {
                                                                              "context" : "val",
                                                                              "element" : "originalText",
                                                                              "variable" : "vvv"
                                                                            }
                                                                          ],
                                                                          "target" : [
                                                                            {
                                                                              "context" : "ce",
                                                                              "contextType" : "variable",
                                                                              "element" : "text",
                                                                              "variable" : "vvv",
                                                                              "transform" : "create"
                                                                            }
                                                                          ]
                                                                        },
                                                                        {
                                                                          "name" : "coding",
                                                                          "source" : [
                                                                            {
                                                                              "context" : "val"
                                                                            }
                                                                          ],
                                                                          "target" : [
                                                                            {
                                                                              "context" : "ce",
                                                                              "contextType" : "variable",
                                                                              "element" : "coding",
                                                                              "variable" : "coding"
                                                                            }
                                                                          ],
                                                                          "rule" : [
                                                                            {
                                                                              "name" : "code",
                                                                              "source" : [
                                                                                {
                                                                                  "context" : "val",
                                                                                  "element" : "code",
                                                                                  "variable" : "code"
                                                                                }
                                                                              ],
                                                                              "target" : [
                                                                                {
                                                                                  "context" : "coding",
                                                                                  "contextType" : "variable",
                                                                                  "element" : "code",
                                                                                  "transform" : "cast",
                                                                                  "parameter" : [
                                                                                    {
                                                                                      "valueId" : "code"
                                                                                    },
                                                                                    {
                                                                                      "valueString" : "string"
                                                                                    }
                                                                                  ]
                                                                                }
                                                                              ]
                                                                            },
                                                                            {
                                                                              "name" : "codeSystem",
                                                                              "source" : [
                                                                                {
                                                                                  "context" : "val",
                                                                                  "element" : "codeSystem",
                                                                                  "variable" : "system"
                                                                                }
                                                                              ],
                                                                              "target" : [
                                                                                {
                                                                                  "context" : "coding",
                                                                                  "contextType" : "variable",
                                                                                  "element" : "system",
                                                                                  "transform" : "translate",
                                                                                  "parameter" : [
                                                                                    {
                                                                                      "valueId" : "system"
                                                                                    },
                                                                                    {
                                                                                      "valueString" : "http://hl7.org/fhir/ConceptMap/special-oid2uri"
                                                                                    },
                                                                                    {
                                                                                      "valueString" : "uri"
                                                                                    }
                                                                                  ]
                                                                                }
                                                                              ]
                                                                            },
                                                                            {
                                                                              "name" : "displayName",
                                                                              "source" : [
                                                                                {
                                                                                  "context" : "val",
                                                                                  "element" : "displayName",
                                                                                  "variable" : "display"
                                                                                }
                                                                              ],
                                                                              "target" : [
                                                                                {
                                                                                  "context" : "coding",
                                                                                  "contextType" : "variable",
                                                                                  "element" : "display",
                                                                                  "transform" : "cast",
                                                                                  "parameter" : [
                                                                                    {
                                                                                      "valueId" : "display"
                                                                                    },
                                                                                    {
                                                                                      "valueString" : "string"
                                                                                    }
                                                                                  ]
                                                                                }
                                                                              ]
                                                                            }
                                                                          ]
                                                                        }
                                                                      ]
                                                                    }
                                                                  ]
                                                                }
                                                              ]
                                                            }
                                                          ]
                                                        }
                                                      ]
                                                    }
                                                  ]
                                                }
                                              ]
                                            }
                                          ]
                                        },
                                        {
                                          "name" : "entryrelationshipstatus",
                                          "source" : [
                                            {
                                              "context" : "obs",
                                              "element" : "entryRelationship",
                                              "variable" : "entriRel"
                                            }
                                          ],
                                          "rule" : [
                                            {
                                              "name" : "observationstatus",
                                              "source" : [
                                                {
                                                  "context" : "entriRel",
                                                  "element" : "observation",
                                                  "variable" : "observation2"
                                                }
                                              ],
                                              "rule" : [
                                                {
                                                  "name" : "codestatus",
                                                  "source" : [
                                                    {
                                                      "context" : "observation2",
                                                      "element" : "code",
                                                      "variable" : "code"
                                                    }
                                                  ],
                                                  "rule" : [
                                                    {
                                                      "name" : "whereDecorsoClinico",
                                                      "source" : [
                                                        {
                                                          "context" : "code",
                                                          "element" : "code",
                                                          "condition" : "(code.code = '33999-4')"
                                                        }
                                                      ],
                                                      "rule" : [
                                                        {
                                                          "name" : "code",
                                                          "source" : [
                                                            {
                                                              "context" : "observation2"
                                                            }
                                                          ],
                                                          "target" : [
                                                            {
                                                              "context" : "condition",
                                                              "contextType" : "variable",
                                                              "element" : "clinicalStatus",
                                                              "variable" : "status",
                                                              "transform" : "create",
                                                              "parameter" : [
                                                                {
                                                                  "valueString" : "CodeableConcept"
                                                                }
                                                              ]
                                                            }
                                                          ],
                                                          "rule" : [
                                                            {
                                                              "name" : "textstat",
                                                              "source" : [
                                                                {
                                                                  "context" : "observation2",
                                                                  "element" : "text",
                                                                  "variable" : "text"
                                                                }
                                                              ],
                                                              "rule" : [
                                                                {
                                                                  "name" : "statref",
                                                                  "source" : [
                                                                    {
                                                                      "context" : "text",
                                                                      "element" : "reference",
                                                                      "variable" : "refstat"
                                                                    }
                                                                  ],
                                                                  "target" : [
                                                                    {
                                                                      "context" : "status",
                                                                      "contextType" : "variable",
                                                                      "element" : "text",
                                                                      "transform" : "evaluate",
                                                                      "parameter" : [
                                                                        {
                                                                          "valueString" : "refstat.value"
                                                                        }
                                                                      ]
                                                                    }
                                                                  ]
                                                                }
                                                              ]
                                                            },
                                                            {
                                                              "name" : "coding",
                                                              "source" : [
                                                                {
                                                                  "context" : "observation2"
                                                                }
                                                              ],
                                                              "target" : [
                                                                {
                                                                  "context" : "status",
                                                                  "contextType" : "variable",
                                                                  "element" : "coding",
                                                                  "variable" : "coding",
                                                                  "transform" : "create",
                                                                  "parameter" : [
                                                                    {
                                                                      "valueString" : "Coding"
                                                                    }
                                                                  ]
                                                                }
                                                              ],
                                                              "rule" : [
                                                                {
                                                                  "name" : "value1",
                                                                  "source" : [
                                                                    {
                                                                      "context" : "observation2",
                                                                      "element" : "value",
                                                                      "variable" : "value"
                                                                    }
                                                                  ],
                                                                  "rule" : [
                                                                    {
                                                                      "name" : "active",
                                                                      "source" : [
                                                                        {
                                                                          "context" : "value",
                                                                          "element" : "code",
                                                                          "condition" : "(value.code = 'LA16666-2')"
                                                                        }
                                                                      ],
                                                                      "target" : [
                                                                        {
                                                                          "context" : "coding",
                                                                          "contextType" : "variable",
                                                                          "element" : "code",
                                                                          "transform" : "copy",
                                                                          "parameter" : [
                                                                            {
                                                                              "valueString" : "active"
                                                                            }
                                                                          ]
                                                                        }
                                                                      ]
                                                                    },
                                                                    {
                                                                      "name" : "inactive",
                                                                      "source" : [
                                                                        {
                                                                          "context" : "value",
                                                                          "element" : "code",
                                                                          "condition" : "(value.code = 'LA18632-2')"
                                                                        }
                                                                      ],
                                                                      "target" : [
                                                                        {
                                                                          "context" : "coding",
                                                                          "contextType" : "variable",
                                                                          "element" : "code",
                                                                          "transform" : "copy",
                                                                          "parameter" : [
                                                                            {
                                                                              "valueString" : "inactive"
                                                                            }
                                                                          ]
                                                                        }
                                                                      ]
                                                                    },
                                                                    {
                                                                      "name" : "system",
                                                                      "source" : [
                                                                        {
                                                                          "context" : "value",
                                                                          "element" : "codeSystem",
                                                                          "variable" : "system"
                                                                        }
                                                                      ],
                                                                      "target" : [
                                                                        {
                                                                          "context" : "coding",
                                                                          "contextType" : "variable",
                                                                          "element" : "system",
                                                                          "transform" : "copy",
                                                                          "parameter" : [
                                                                            {
                                                                              "valueString" : "http://terminology.hl7.org/CodeSystem/condition-clinical"
                                                                            }
                                                                          ]
                                                                        }
                                                                      ]
                                                                    },
                                                                    {
                                                                      "name" : "displayName",
                                                                      "source" : [
                                                                        {
                                                                          "context" : "value",
                                                                          "element" : "displayName",
                                                                          "variable" : "display"
                                                                        }
                                                                      ],
                                                                      "target" : [
                                                                        {
                                                                          "context" : "coding",
                                                                          "contextType" : "variable",
                                                                          "element" : "display",
                                                                          "transform" : "cast",
                                                                          "parameter" : [
                                                                            {
                                                                              "valueId" : "display"
                                                                            },
                                                                            {
                                                                              "valueString" : "string"
                                                                            }
                                                                          ]
                                                                        }
                                                                      ]
                                                                    }
                                                                  ]
                                                                }
                                                              ]
                                                            }
                                                          ]
                                                        }
                                                      ]
                                                    }
                                                  ]
                                                }
                                              ]
                                            }
                                          ]
                                        }
                                      ]
                                    }
                                  ]
                                }
                              ]
                            },
                            {
                              "name" : "observation1",
                              "source" : [
                                {
                                  "context" : "entry1",
                                  "element" : "organizer",
                                  "variable" : "organizer"
                                }
                              ],
                              "rule" : [
                                {
                                  "name" : "10157-6",
                                  "source" : [
                                    {
                                      "context" : "organizer",
                                      "element" : "code",
                                      "condition" : "(code = '10157-6')"
                                    }
                                  ],
                                  "rule" : [
                                    {
                                      "name" : "organizer",
                                      "source" : [
                                        {
                                          "context" : "organizer"
                                        }
                                      ],
                                      "target" : [
                                        {
                                          "context" : "bundle",
                                          "contextType" : "variable",
                                          "element" : "entry",
                                          "variable" : "e4"
                                        },
                                        {
                                          "context" : "e4",
                                          "contextType" : "variable",
                                          "element" : "request",
                                          "variable" : "request",
                                          "transform" : "create",
                                          "parameter" : [
                                            {
                                              "valueString" : "BackboneElement"
                                            }
                                          ]
                                        },
                                        {
                                          "context" : "request",
                                          "contextType" : "variable",
                                          "element" : "method",
                                          "transform" : "copy",
                                          "parameter" : [
                                            {
                                              "valueString" : "POST"
                                            }
                                          ]
                                        },
                                        {
                                          "context" : "e4",
                                          "contextType" : "variable",
                                          "element" : "resource",
                                          "variable" : "FamilyMemberHistory",
                                          "transform" : "create",
                                          "parameter" : [
                                            {
                                              "valueString" : "FamilyMemberHistory"
                                            }
                                          ]
                                        },
                                        {
                                          "context" : "FamilyMemberHistory",
                                          "contextType" : "variable",
                                          "element" : "id",
                                          "variable" : "uuid5",
                                          "transform" : "uuid"
                                        },
                                        {
                                          "context" : "e4",
                                          "contextType" : "variable",
                                          "element" : "fullUrl",
                                          "transform" : "append",
                                          "parameter" : [
                                            {
                                              "valueString" : "https://example/FamilyMemberHistory/"
                                            },
                                            {
                                              "valueId" : "uuid5"
                                            }
                                          ]
                                        },
                                        {
                                          "context" : "request",
                                          "contextType" : "variable",
                                          "element" : "url",
                                          "transform" : "copy",
                                          "parameter" : [
                                            {
                                              "valueString" : "FamilyMemberHistory"
                                            }
                                          ]
                                        },
                                        {
                                          "context" : "section",
                                          "contextType" : "variable",
                                          "element" : "entry",
                                          "variable" : "reference",
                                          "transform" : "create",
                                          "parameter" : [
                                            {
                                              "valueString" : "Reference"
                                            }
                                          ]
                                        },
                                        {
                                          "context" : "reference",
                                          "contextType" : "variable",
                                          "element" : "reference",
                                          "transform" : "evaluate",
                                          "parameter" : [
                                            {
                                              "valueString" : "'https://example/FamilyMemberHistory/' + %FamilyMemberHistory.id"
                                            }
                                          ]
                                        }
                                      ],
                                      "rule" : [
                                        {
                                          "name" : "effective",
                                          "source" : [
                                            {
                                              "context" : "organizer",
                                              "element" : "effectiveTime",
                                              "variable" : "effective"
                                            }
                                          ],
                                          "rule" : [
                                            {
                                              "name" : "date",
                                              "source" : [
                                                {
                                                  "context" : "effective",
                                                  "element" : "value",
                                                  "variable" : "eff"
                                                }
                                              ],
                                              "target" : [
                                                {
                                                  "context" : "FamilyMemberHistory",
                                                  "contextType" : "variable",
                                                  "element" : "date",
                                                  "variable" : "value",
                                                  "transform" : "create",
                                                  "parameter" : [
                                                    {
                                                      "valueString" : "dateTime"
                                                    }
                                                  ]
                                                }
                                              ],
                                              "dependent" : [
                                                {
                                                  "name" : "TSDateTime",
                                                  "variable" : [
                                                    "eff",
                                                    "value"
                                                  ]
                                                }
                                              ]
                                            }
                                          ]
                                        },
                                        {
                                          "name" : "reference",
                                          "source" : [
                                            {
                                              "context" : "organizer"
                                            }
                                          ],
                                          "target" : [
                                            {
                                              "context" : "FamilyMemberHistory",
                                              "contextType" : "variable",
                                              "element" : "patient",
                                              "variable" : "reference",
                                              "transform" : "create",
                                              "parameter" : [
                                                {
                                                  "valueString" : "Reference"
                                                }
                                              ]
                                            },
                                            {
                                              "context" : "reference",
                                              "contextType" : "variable",
                                              "element" : "reference",
                                              "transform" : "evaluate",
                                              "parameter" : [
                                                {
                                                  "valueString" : "'https://example/Patient/' + %patient.id"
                                                }
                                              ]
                                            }
                                          ]
                                        },
                                        {
                                          "name" : "subject",
                                          "source" : [
                                            {
                                              "context" : "organizer",
                                              "element" : "subject",
                                              "variable" : "subject"
                                            }
                                          ],
                                          "rule" : [
                                            {
                                              "name" : "relatedSubject",
                                              "source" : [
                                                {
                                                  "context" : "subject",
                                                  "element" : "relatedSubject",
                                                  "variable" : "relatedSubject"
                                                }
                                              ],
                                              "rule" : [
                                                {
                                                  "name" : "relationship",
                                                  "source" : [
                                                    {
                                                      "context" : "relatedSubject",
                                                      "element" : "code",
                                                      "variable" : "vvv"
                                                    }
                                                  ],
                                                  "target" : [
                                                    {
                                                      "context" : "FamilyMemberHistory",
                                                      "contextType" : "variable",
                                                      "element" : "relationship",
                                                      "variable" : "vvv",
                                                      "transform" : "create"
                                                    }
                                                  ]
                                                },
                                                {
                                                  "name" : "subject1",
                                                  "source" : [
                                                    {
                                                      "context" : "relatedSubject",
                                                      "element" : "subject",
                                                      "variable" : "subject"
                                                    }
                                                  ],
                                                  "target" : [
                                                    {
                                                      "context" : "FamilyMemberHistory",
                                                      "contextType" : "variable",
                                                      "element" : "sex",
                                                      "variable" : "sex"
                                                    }
                                                  ],
                                                  "rule" : [
                                                    {
                                                      "name" : "coding",
                                                      "source" : [
                                                        {
                                                          "context" : "subject",
                                                          "element" : "administrativeGenderCode",
                                                          "variable" : "administrativeGenderCode"
                                                        }
                                                      ],
                                                      "target" : [
                                                        {
                                                          "context" : "sex",
                                                          "contextType" : "variable",
                                                          "element" : "coding",
                                                          "variable" : "coding"
                                                        }
                                                      ],
                                                      "rule" : [
                                                        {
                                                          "name" : "gender",
                                                          "source" : [
                                                            {
                                                              "context" : "administrativeGenderCode",
                                                              "element" : "code",
                                                              "variable" : "code"
                                                            }
                                                          ],
                                                          "target" : [
                                                            {
                                                              "context" : "coding",
                                                              "contextType" : "variable",
                                                              "element" : "code",
                                                              "transform" : "translate",
                                                              "parameter" : [
                                                                {
                                                                  "valueId" : "code"
                                                                },
                                                                {
                                                                  "valueString" : "#AdministrativeGender"
                                                                },
                                                                {
                                                                  "valueString" : "code"
                                                                }
                                                              ]
                                                            }
                                                          ]
                                                        },
                                                        {
                                                          "name" : "system",
                                                          "source" : [
                                                            {
                                                              "context" : "administrativeGenderCode"
                                                            }
                                                          ],
                                                          "target" : [
                                                            {
                                                              "context" : "coding",
                                                              "contextType" : "variable",
                                                              "element" : "system",
                                                              "transform" : "copy",
                                                              "parameter" : [
                                                                {
                                                                  "valueString" : "http://hl7.org/fhir/administrative-gender"
                                                                }
                                                              ]
                                                            }
                                                          ]
                                                        }
                                                      ]
                                                    }
                                                  ]
                                                }
                                              ]
                                            }
                                          ]
                                        },
                                        {
                                          "name" : "cdaText1",
                                          "source" : [
                                            {
                                              "context" : "sottosection",
                                              "element" : "text",
                                              "variable" : "cdaText1"
                                            }
                                          ],
                                          "target" : [
                                            {
                                              "context" : "FamilyMemberHistory",
                                              "contextType" : "variable",
                                              "element" : "note",
                                              "variable" : "note"
                                            }
                                          ],
                                          "rule" : [
                                            {
                                              "name" : "reference",
                                              "source" : [
                                                {
                                                  "context" : "cdaText1",
                                                  "variable" : "t"
                                                }
                                              ],
                                              "target" : [
                                                {
                                                  "context" : "note",
                                                  "contextType" : "variable",
                                                  "element" : "text",
                                                  "transform" : "copy",
                                                  "parameter" : [
                                                    {
                                                      "valueId" : "t"
                                                    }
                                                  ]
                                                }
                                              ]
                                            },
                                            {
                                              "name" : "author",
                                              "source" : [
                                                {
                                                  "context" : "sottosection",
                                                  "element" : "author",
                                                  "variable" : "authors"
                                                }
                                              ],
                                              "rule" : [
                                                {
                                                  "name" : "timeAuthor",
                                                  "source" : [
                                                    {
                                                      "context" : "authors",
                                                      "element" : "time",
                                                      "variable" : "time"
                                                    }
                                                  ],
                                                  "target" : [
                                                    {
                                                      "context" : "note",
                                                      "contextType" : "variable",
                                                      "element" : "time",
                                                      "variable" : "value",
                                                      "transform" : "create",
                                                      "parameter" : [
                                                        {
                                                          "valueString" : "dateTime"
                                                        }
                                                      ]
                                                    }
                                                  ],
                                                  "dependent" : [
                                                    {
                                                      "name" : "TSDateTime",
                                                      "variable" : [
                                                        "time",
                                                        "value"
                                                      ]
                                                    }
                                                  ]
                                                },
                                                {
                                                  "name" : "assighedAuthor",
                                                  "source" : [
                                                    {
                                                      "context" : "authors",
                                                      "element" : "assignedAuthor",
                                                      "variable" : "assignedAuthor"
                                                    }
                                                  ],
                                                  "target" : [
                                                    {
                                                      "context" : "bundle",
                                                      "contextType" : "variable",
                                                      "element" : "entry",
                                                      "variable" : "e7"
                                                    },
                                                    {
                                                      "context" : "e7",
                                                      "contextType" : "variable",
                                                      "element" : "request",
                                                      "variable" : "request",
                                                      "transform" : "create",
                                                      "parameter" : [
                                                        {
                                                          "valueString" : "BackboneElement"
                                                        }
                                                      ]
                                                    },
                                                    {
                                                      "context" : "request",
                                                      "contextType" : "variable",
                                                      "element" : "method",
                                                      "transform" : "copy",
                                                      "parameter" : [
                                                        {
                                                          "valueString" : "PUT"
                                                        }
                                                      ]
                                                    },
                                                    {
                                                      "context" : "e7",
                                                      "contextType" : "variable",
                                                      "element" : "resource",
                                                      "variable" : "practitioner",
                                                      "transform" : "create",
                                                      "parameter" : [
                                                        {
                                                          "valueString" : "Practitioner"
                                                        }
                                                      ]
                                                    }
                                                  ],
                                                  "rule" : [
                                                    {
                                                      "name" : "meta",
                                                      "source" : [
                                                        {
                                                          "context" : "assignedAuthor"
                                                        }
                                                      ],
                                                      "target" : [
                                                        {
                                                          "context" : "practitioner",
                                                          "contextType" : "variable",
                                                          "element" : "meta",
                                                          "variable" : "meta"
                                                        }
                                                      ],
                                                      "rule" : [
                                                        {
                                                          "name" : "coding",
                                                          "source" : [
                                                            {
                                                              "context" : "assignedAuthor"
                                                            }
                                                          ],
                                                          "target" : [
                                                            {
                                                              "context" : "meta",
                                                              "contextType" : "variable",
                                                              "element" : "tag",
                                                              "variable" : "coding",
                                                              "transform" : "create",
                                                              "parameter" : [
                                                                {
                                                                  "valueString" : "Coding"
                                                                }
                                                              ]
                                                            }
                                                          ],
                                                          "rule" : [
                                                            {
                                                              "name" : "system",
                                                              "source" : [
                                                                {
                                                                  "context" : "assignedAuthor"
                                                                }
                                                              ],
                                                              "target" : [
                                                                {
                                                                  "context" : "coding",
                                                                  "contextType" : "variable",
                                                                  "element" : "system",
                                                                  "transform" : "copy",
                                                                  "parameter" : [
                                                                    {
                                                                      "valueString" : "http://algoritmodiscoring"
                                                                    }
                                                                  ]
                                                                }
                                                              ]
                                                            },
                                                            {
                                                              "name" : "code",
                                                              "source" : [
                                                                {
                                                                  "context" : "assignedAuthor"
                                                                }
                                                              ],
                                                              "target" : [
                                                                {
                                                                  "context" : "coding",
                                                                  "contextType" : "variable",
                                                                  "element" : "code",
                                                                  "transform" : "copy",
                                                                  "parameter" : [
                                                                    {
                                                                      "valueString" : "ClinicalDocument/body/Anamnesi/author"
                                                                    }
                                                                  ]
                                                                }
                                                              ]
                                                            }
                                                          ]
                                                        }
                                                      ]
                                                    },
                                                    {
                                                      "name" : "identifier",
                                                      "source" : [
                                                        {
                                                          "context" : "assignedAuthor",
                                                          "element" : "id",
                                                          "variable" : "id"
                                                        }
                                                      ],
                                                      "target" : [
                                                        {
                                                          "context" : "practitioner",
                                                          "contextType" : "variable",
                                                          "element" : "identifier",
                                                          "variable" : "identifier"
                                                        }
                                                      ],
                                                      "rule" : [
                                                        {
                                                          "name" : "root1",
                                                          "source" : [
                                                            {
                                                              "context" : "id",
                                                              "element" : "root",
                                                              "variable" : "r"
                                                            }
                                                          ],
                                                          "target" : [
                                                            {
                                                              "context" : "identifier",
                                                              "contextType" : "variable",
                                                              "element" : "system",
                                                              "transform" : "translate",
                                                              "parameter" : [
                                                                {
                                                                  "valueId" : "r"
                                                                },
                                                                {
                                                                  "valueString" : "http://hl7.org/fhir/ConceptMap/special-oid2uri"
                                                                },
                                                                {
                                                                  "valueString" : "uri"
                                                                }
                                                              ]
                                                            }
                                                          ]
                                                        },
                                                        {
                                                          "name" : "extension",
                                                          "source" : [
                                                            {
                                                              "context" : "id",
                                                              "element" : "extension",
                                                              "variable" : "ext"
                                                            }
                                                          ],
                                                          "target" : [
                                                            {
                                                              "context" : "identifier",
                                                              "contextType" : "variable",
                                                              "element" : "value",
                                                              "transform" : "copy",
                                                              "parameter" : [
                                                                {
                                                                  "valueId" : "ext"
                                                                }
                                                              ]
                                                            }
                                                          ]
                                                        },
                                                        {
                                                          "name" : "assigningAuthorityName",
                                                          "source" : [
                                                            {
                                                              "context" : "id",
                                                              "element" : "assigningAuthorityName",
                                                              "variable" : "s"
                                                            }
                                                          ],
                                                          "target" : [
                                                            {
                                                              "context" : "identifier",
                                                              "contextType" : "variable",
                                                              "element" : "assigner",
                                                              "variable" : "a"
                                                            },
                                                            {
                                                              "context" : "a",
                                                              "contextType" : "variable",
                                                              "element" : "display",
                                                              "transform" : "copy",
                                                              "parameter" : [
                                                                {
                                                                  "valueId" : "s"
                                                                }
                                                              ]
                                                            }
                                                          ]
                                                        },
                                                        {
                                                          "name" : "r",
                                                          "source" : [
                                                            {
                                                              "context" : "id",
                                                              "element" : "root",
                                                              "variable" : "r"
                                                            }
                                                          ],
                                                          "rule" : [
                                                            {
                                                              "name" : "extension",
                                                              "source" : [
                                                                {
                                                                  "context" : "id",
                                                                  "element" : "extension",
                                                                  "variable" : "ext"
                                                                }
                                                              ],
                                                              "target" : [
                                                                {
                                                                  "context" : "practitioner",
                                                                  "contextType" : "variable",
                                                                  "element" : "id",
                                                                  "variable" : "uuid7",
                                                                  "transform" : "evaluate",
                                                                  "parameter" : [
                                                                    {
                                                                      "valueString" : "r + '-' + ext"
                                                                    }
                                                                  ]
                                                                },
                                                                {
                                                                  "context" : "e7",
                                                                  "contextType" : "variable",
                                                                  "element" : "fullUrl",
                                                                  "transform" : "append",
                                                                  "parameter" : [
                                                                    {
                                                                      "valueString" : "https://example/Practitioner/"
                                                                    },
                                                                    {
                                                                      "valueId" : "uuid7"
                                                                    }
                                                                  ]
                                                                },
                                                                {
                                                                  "context" : "request",
                                                                  "contextType" : "variable",
                                                                  "element" : "url",
                                                                  "transform" : "append",
                                                                  "parameter" : [
                                                                    {
                                                                      "valueString" : "Practitioner/"
                                                                    },
                                                                    {
                                                                      "valueId" : "uuid7"
                                                                    }
                                                                  ]
                                                                },
                                                                {
                                                                  "context" : "note",
                                                                  "contextType" : "variable",
                                                                  "element" : "author",
                                                                  "variable" : "reference",
                                                                  "transform" : "create",
                                                                  "parameter" : [
                                                                    {
                                                                      "valueString" : "Reference"
                                                                    }
                                                                  ]
                                                                },
                                                                {
                                                                  "context" : "reference",
                                                                  "contextType" : "variable",
                                                                  "element" : "reference",
                                                                  "transform" : "evaluate",
                                                                  "parameter" : [
                                                                    {
                                                                      "valueString" : "'https://example/Practitioner/' + %practitioner.id"
                                                                    }
                                                                  ]
                                                                }
                                                              ]
                                                            }
                                                          ]
                                                        }
                                                      ]
                                                    },
                                                    {
                                                      "name" : "2.16.840.1.113883.2.9.4.3.2",
                                                      "source" : [
                                                        {
                                                          "context" : "assignedAuthor",
                                                          "element" : "id",
                                                          "variable" : "id",
                                                          "condition" : "(root = '2.16.840.1.113883.2.9.4.3.2')"
                                                        }
                                                      ],
                                                      "rule" : [
                                                        {
                                                          "name" : "UUID",
                                                          "source" : [
                                                            {
                                                              "context" : "id",
                                                              "element" : "extension",
                                                              "variable" : "ext"
                                                            }
                                                          ],
                                                          "target" : [
                                                            {
                                                              "context" : "request",
                                                              "contextType" : "variable",
                                                              "element" : "url",
                                                              "transform" : "append",
                                                              "parameter" : [
                                                                {
                                                                  "valueString" : "Practitioner?identifier="
                                                                },
                                                                {
                                                                  "valueId" : "ext"
                                                                }
                                                              ]
                                                            }
                                                          ]
                                                        }
                                                      ]
                                                    },
                                                    {
                                                      "name" : "assignedPerson",
                                                      "source" : [
                                                        {
                                                          "context" : "assignedAuthor",
                                                          "element" : "assignedPerson",
                                                          "variable" : "person"
                                                        }
                                                      ],
                                                      "rule" : [
                                                        {
                                                          "name" : "name",
                                                          "source" : [
                                                            {
                                                              "context" : "person",
                                                              "element" : "name",
                                                              "variable" : "vvv"
                                                            }
                                                          ],
                                                          "target" : [
                                                            {
                                                              "context" : "practitioner",
                                                              "contextType" : "variable",
                                                              "element" : "name",
                                                              "variable" : "vvv",
                                                              "transform" : "create"
                                                            }
                                                          ]
                                                        }
                                                      ]
                                                    }
                                                  ]
                                                }
                                              ]
                                            }
                                          ],
                                          "documentation" : "blocco Narrativo"
                                        },
                                        {
                                          "name" : "component",
                                          "source" : [
                                            {
                                              "context" : "organizer",
                                              "element" : "component",
                                              "variable" : "component"
                                            }
                                          ],
                                          "target" : [
                                            {
                                              "context" : "FamilyMemberHistory",
                                              "contextType" : "variable",
                                              "element" : "condition",
                                              "variable" : "condition"
                                            }
                                          ],
                                          "rule" : [
                                            {
                                              "name" : "observationCondition",
                                              "source" : [
                                                {
                                                  "context" : "component",
                                                  "element" : "observation",
                                                  "variable" : "observation"
                                                }
                                              ],
                                              "rule" : [
                                                {
                                                  "name" : "code",
                                                  "source" : [
                                                    {
                                                      "context" : "observation",
                                                      "element" : "code",
                                                      "variable" : "vvv"
                                                    }
                                                  ],
                                                  "target" : [
                                                    {
                                                      "context" : "condition",
                                                      "contextType" : "variable",
                                                      "element" : "code",
                                                      "variable" : "vvv",
                                                      "transform" : "create"
                                                    }
                                                  ]
                                                },
                                                {
                                                  "name" : "reference",
                                                  "source" : [
                                                    {
                                                      "context" : "observation",
                                                      "element" : "text",
                                                      "variable" : "text"
                                                    }
                                                  ],
                                                  "target" : [
                                                    {
                                                      "context" : "FamilyMemberHistory",
                                                      "contextType" : "variable",
                                                      "element" : "note",
                                                      "variable" : "note"
                                                    }
                                                  ],
                                                  "rule" : [
                                                    {
                                                      "name" : "value",
                                                      "source" : [
                                                        {
                                                          "context" : "text",
                                                          "element" : "reference",
                                                          "variable" : "reference"
                                                        }
                                                      ],
                                                      "target" : [
                                                        {
                                                          "context" : "note",
                                                          "contextType" : "variable",
                                                          "element" : "text",
                                                          "transform" : "evaluate",
                                                          "parameter" : [
                                                            {
                                                              "valueString" : "reference.value"
                                                            }
                                                          ]
                                                        }
                                                      ]
                                                    }
                                                  ]
                                                },
                                                {
                                                  "name" : "statusCode",
                                                  "source" : [
                                                    {
                                                      "context" : "observation",
                                                      "element" : "statusCode",
                                                      "variable" : "vvv"
                                                    }
                                                  ],
                                                  "target" : [
                                                    {
                                                      "context" : "FamilyMemberHistory",
                                                      "contextType" : "variable",
                                                      "element" : "status",
                                                      "variable" : "vvv",
                                                      "transform" : "create"
                                                    }
                                                  ]
                                                },
                                                {
                                                  "name" : "codeable",
                                                  "source" : [
                                                    {
                                                      "context" : "observation",
                                                      "element" : "value",
                                                      "variable" : "vvv"
                                                    }
                                                  ],
                                                  "target" : [
                                                    {
                                                      "context" : "condition",
                                                      "contextType" : "variable",
                                                      "element" : "outcome",
                                                      "variable" : "vvv",
                                                      "transform" : "create"
                                                    }
                                                  ]
                                                },
                                                {
                                                  "name" : "EntryRel",
                                                  "source" : [
                                                    {
                                                      "context" : "observation",
                                                      "element" : "entryRelationship",
                                                      "variable" : "entryRelationship"
                                                    }
                                                  ],
                                                  "rule" : [
                                                    {
                                                      "name" : "obser",
                                                      "source" : [
                                                        {
                                                          "context" : "entryRelationship",
                                                          "element" : "observation",
                                                          "variable" : "obsservation1"
                                                        }
                                                      ],
                                                      "rule" : [
                                                        {
                                                          "name" : "code",
                                                          "source" : [
                                                            {
                                                              "context" : "obsservation1",
                                                              "element" : "code",
                                                              "variable" : "code"
                                                            }
                                                          ],
                                                          "rule" : [
                                                            {
                                                              "name" : "insorgenza",
                                                              "source" : [
                                                                {
                                                                  "context" : "code",
                                                                  "element" : "code",
                                                                  "condition" : "(code.code = '35267-4')"
                                                                }
                                                              ],
                                                              "rule" : [
                                                                {
                                                                  "name" : "value",
                                                                  "source" : [
                                                                    {
                                                                      "context" : "obsservation1",
                                                                      "element" : "value",
                                                                      "variable" : "value"
                                                                    }
                                                                  ],
                                                                  "target" : [
                                                                    {
                                                                      "context" : "condition",
                                                                      "contextType" : "variable",
                                                                      "element" : "onset",
                                                                      "variable" : "Age",
                                                                      "transform" : "create",
                                                                      "parameter" : [
                                                                        {
                                                                          "valueString" : "Age"
                                                                        }
                                                                      ]
                                                                    }
                                                                  ],
                                                                  "rule" : [
                                                                    {
                                                                      "name" : "age",
                                                                      "source" : [
                                                                        {
                                                                          "context" : "value",
                                                                          "element" : "value",
                                                                          "variable" : "valueAge"
                                                                        }
                                                                      ],
                                                                      "target" : [
                                                                        {
                                                                          "context" : "Age",
                                                                          "contextType" : "variable",
                                                                          "element" : "value",
                                                                          "transform" : "copy",
                                                                          "parameter" : [
                                                                            {
                                                                              "valueId" : "valueAge"
                                                                            }
                                                                          ]
                                                                        }
                                                                      ]
                                                                    },
                                                                    {
                                                                      "name" : "unit",
                                                                      "source" : [
                                                                        {
                                                                          "context" : "value",
                                                                          "element" : "unit",
                                                                          "variable" : "unit"
                                                                        }
                                                                      ],
                                                                      "target" : [
                                                                        {
                                                                          "context" : "Age",
                                                                          "contextType" : "variable",
                                                                          "element" : "code",
                                                                          "transform" : "copy",
                                                                          "parameter" : [
                                                                            {
                                                                              "valueId" : "unit"
                                                                            }
                                                                          ]
                                                                        }
                                                                      ]
                                                                    },
                                                                    {
                                                                      "name" : "unit",
                                                                      "source" : [
                                                                        {
                                                                          "context" : "value",
                                                                          "element" : "unit",
                                                                          "variable" : "unit"
                                                                        }
                                                                      ],
                                                                      "target" : [
                                                                        {
                                                                          "context" : "Age",
                                                                          "contextType" : "variable",
                                                                          "element" : "unit",
                                                                          "transform" : "copy",
                                                                          "parameter" : [
                                                                            {
                                                                              "valueId" : "unit"
                                                                            }
                                                                          ]
                                                                        }
                                                                      ]
                                                                    },
                                                                    {
                                                                      "name" : "system",
                                                                      "source" : [
                                                                        {
                                                                          "context" : "value"
                                                                        }
                                                                      ],
                                                                      "target" : [
                                                                        {
                                                                          "context" : "Age",
                                                                          "contextType" : "variable",
                                                                          "element" : "system",
                                                                          "transform" : "copy",
                                                                          "parameter" : [
                                                                            {
                                                                              "valueString" : "http://unitsofmeasure.org"
                                                                            }
                                                                          ]
                                                                        }
                                                                      ]
                                                                    }
                                                                  ]
                                                                }
                                                              ]
                                                            }
                                                          ]
                                                        },
                                                        {
                                                          "name" : "code",
                                                          "source" : [
                                                            {
                                                              "context" : "obsservation1",
                                                              "element" : "code",
                                                              "variable" : "code"
                                                            }
                                                          ],
                                                          "rule" : [
                                                            {
                                                              "name" : "deceased",
                                                              "source" : [
                                                                {
                                                                  "context" : "code",
                                                                  "element" : "code",
                                                                  "condition" : "(code.code = '39016-1')"
                                                                }
                                                              ],
                                                              "rule" : [
                                                                {
                                                                  "name" : "value",
                                                                  "source" : [
                                                                    {
                                                                      "context" : "obsservation1",
                                                                      "element" : "value",
                                                                      "variable" : "value"
                                                                    }
                                                                  ],
                                                                  "target" : [
                                                                    {
                                                                      "context" : "FamilyMemberHistory",
                                                                      "contextType" : "variable",
                                                                      "element" : "deceased",
                                                                      "variable" : "Age",
                                                                      "transform" : "create",
                                                                      "parameter" : [
                                                                        {
                                                                          "valueString" : "Age"
                                                                        }
                                                                      ]
                                                                    }
                                                                  ],
                                                                  "rule" : [
                                                                    {
                                                                      "name" : "age",
                                                                      "source" : [
                                                                        {
                                                                          "context" : "value",
                                                                          "element" : "value",
                                                                          "variable" : "valueAge"
                                                                        }
                                                                      ],
                                                                      "target" : [
                                                                        {
                                                                          "context" : "Age",
                                                                          "contextType" : "variable",
                                                                          "element" : "value",
                                                                          "transform" : "copy",
                                                                          "parameter" : [
                                                                            {
                                                                              "valueId" : "valueAge"
                                                                            }
                                                                          ]
                                                                        }
                                                                      ]
                                                                    },
                                                                    {
                                                                      "name" : "unit",
                                                                      "source" : [
                                                                        {
                                                                          "context" : "value",
                                                                          "element" : "unit",
                                                                          "variable" : "unit"
                                                                        }
                                                                      ],
                                                                      "target" : [
                                                                        {
                                                                          "context" : "Age",
                                                                          "contextType" : "variable",
                                                                          "element" : "code",
                                                                          "transform" : "copy",
                                                                          "parameter" : [
                                                                            {
                                                                              "valueId" : "unit"
                                                                            }
                                                                          ]
                                                                        }
                                                                      ]
                                                                    },
                                                                    {
                                                                      "name" : "unit",
                                                                      "source" : [
                                                                        {
                                                                          "context" : "value",
                                                                          "element" : "unit",
                                                                          "variable" : "unit"
                                                                        }
                                                                      ],
                                                                      "target" : [
                                                                        {
                                                                          "context" : "Age",
                                                                          "contextType" : "variable",
                                                                          "element" : "unit",
                                                                          "transform" : "copy",
                                                                          "parameter" : [
                                                                            {
                                                                              "valueId" : "unit"
                                                                            }
                                                                          ]
                                                                        }
                                                                      ]
                                                                    },
                                                                    {
                                                                      "name" : "system",
                                                                      "source" : [
                                                                        {
                                                                          "context" : "value"
                                                                        }
                                                                      ],
                                                                      "target" : [
                                                                        {
                                                                          "context" : "Age",
                                                                          "contextType" : "variable",
                                                                          "element" : "system",
                                                                          "transform" : "copy",
                                                                          "parameter" : [
                                                                            {
                                                                              "valueString" : "http://unitsofmeasure.org"
                                                                            }
                                                                          ]
                                                                        }
                                                                      ]
                                                                    }
                                                                  ]
                                                                }
                                                              ]
                                                            }
                                                          ]
                                                        }
                                                      ]
                                                    }
                                                  ]
                                                },
                                                {
                                                  "name" : "cont",
                                                  "source" : [
                                                    {
                                                      "context" : "observation",
                                                      "condition" : "observation.effectiveTime.exists()"
                                                    }
                                                  ],
                                                  "rule" : [
                                                    {
                                                      "name" : "effttemp",
                                                      "source" : [
                                                        {
                                                          "context" : "observation",
                                                          "element" : "effectiveTime",
                                                          "variable" : "effectiveTime"
                                                        }
                                                      ],
                                                      "target" : [
                                                        {
                                                          "context" : "FamilyMemberHistory",
                                                          "contextType" : "variable",
                                                          "element" : "condition",
                                                          "variable" : "condition",
                                                          "transform" : "create",
                                                          "parameter" : [
                                                            {
                                                              "valueString" : "BackboneElement"
                                                            }
                                                          ]
                                                        }
                                                      ],
                                                      "rule" : [
                                                        {
                                                          "name" : "efft",
                                                          "source" : [
                                                            {
                                                              "context" : "effectiveTime"
                                                            }
                                                          ],
                                                          "target" : [
                                                            {
                                                              "context" : "condition",
                                                              "contextType" : "variable",
                                                              "element" : "onset",
                                                              "variable" : "period",
                                                              "transform" : "create",
                                                              "parameter" : [
                                                                {
                                                                  "valueString" : "Period"
                                                                }
                                                              ]
                                                            }
                                                          ],
                                                          "rule" : [
                                                            {
                                                              "name" : "val",
                                                              "source" : [
                                                                {
                                                                  "context" : "effectiveTime"
                                                                }
                                                              ],
                                                              "target" : [
                                                                {
                                                                  "context" : "period",
                                                                  "contextType" : "variable",
                                                                  "element" : "start",
                                                                  "variable" : "start",
                                                                  "transform" : "create",
                                                                  "parameter" : [
                                                                    {
                                                                      "valueString" : "dateTime"
                                                                    }
                                                                  ]
                                                                }
                                                              ],
                                                              "dependent" : [
                                                                {
                                                                  "name" : "TSDateTime",
                                                                  "variable" : [
                                                                    "effectiveTime",
                                                                    "start"
                                                                  ]
                                                                }
                                                              ]
                                                            }
                                                          ]
                                                        },
                                                        {
                                                          "name" : "code",
                                                          "source" : [
                                                            {
                                                              "context" : "observation",
                                                              "element" : "code",
                                                              "variable" : "vvv"
                                                            }
                                                          ],
                                                          "target" : [
                                                            {
                                                              "context" : "condition",
                                                              "contextType" : "variable",
                                                              "element" : "code",
                                                              "variable" : "vvv",
                                                              "transform" : "create"
                                                            }
                                                          ]
                                                        },
                                                        {
                                                          "name" : "codeable",
                                                          "source" : [
                                                            {
                                                              "context" : "observation",
                                                              "element" : "value",
                                                              "variable" : "vvv"
                                                            }
                                                          ],
                                                          "target" : [
                                                            {
                                                              "context" : "condition",
                                                              "contextType" : "variable",
                                                              "element" : "outcome",
                                                              "variable" : "vvv",
                                                              "transform" : "create"
                                                            }
                                                          ]
                                                        }
                                                      ]
                                                    }
                                                  ]
                                                }
                                              ]
                                            }
                                          ]
                                        }
                                      ]
                                    }
                                  ]
                                }
                              ],
                              "documentation" : "Anamnesi Familiare---------------------------------------------------------------------------------------------------------------------------------------------"
                            }
                          ],
                          "documentation" : "Anamnesi Strutturata-----------------------------------------------------------------------------------------------------------------------------------------"
                        }
                      ]
                    },
                    {
                      "name" : "code",
                      "source" : [
                        {
                          "context" : "sottosection",
                          "element" : "code",
                          "variable" : "vvv",
                          "condition" : "(code = '29545-1')"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "section",
                          "contextType" : "variable",
                          "element" : "code",
                          "variable" : "vvv",
                          "transform" : "create"
                        }
                      ],
                      "documentation" : "2. Esame Obiettivo Narrativa-----------------------------------------------------------------------------------------------------------------------------------"
                    },
                    {
                      "name" : "condizioneesameObiettivo",
                      "source" : [
                        {
                          "context" : "sottosection",
                          "element" : "code",
                          "variable" : "code1",
                          "condition" : "(code = '29545-1')"
                        }
                      ],
                      "rule" : [
                        {
                          "name" : "title",
                          "source" : [
                            {
                              "context" : "sottosection",
                              "element" : "title",
                              "variable" : "t"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "section",
                              "contextType" : "variable",
                              "element" : "title",
                              "transform" : "evaluate",
                              "parameter" : [
                                {
                                  "valueString" : "t.dataString"
                                }
                              ]
                            }
                          ]
                        },
                        {
                          "name" : "cdaText",
                          "source" : [
                            {
                              "context" : "sottosection",
                              "element" : "text",
                              "variable" : "cdaText"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "bundle",
                              "contextType" : "variable",
                              "element" : "entry",
                              "variable" : "e8"
                            },
                            {
                              "context" : "e8",
                              "contextType" : "variable",
                              "element" : "request",
                              "variable" : "request",
                              "transform" : "create",
                              "parameter" : [
                                {
                                  "valueString" : "BackboneElement"
                                }
                              ]
                            },
                            {
                              "context" : "request",
                              "contextType" : "variable",
                              "element" : "method",
                              "transform" : "copy",
                              "parameter" : [
                                {
                                  "valueString" : "POST"
                                }
                              ]
                            },
                            {
                              "context" : "e8",
                              "contextType" : "variable",
                              "element" : "resource",
                              "variable" : "observation",
                              "transform" : "create",
                              "parameter" : [
                                {
                                  "valueString" : "Observation"
                                }
                              ]
                            },
                            {
                              "context" : "observation",
                              "contextType" : "variable",
                              "element" : "id",
                              "variable" : "uuid8",
                              "transform" : "uuid"
                            },
                            {
                              "context" : "e8",
                              "contextType" : "variable",
                              "element" : "fullUrl",
                              "transform" : "append",
                              "parameter" : [
                                {
                                  "valueString" : "https://example/Observation/"
                                },
                                {
                                  "valueId" : "uuid8"
                                }
                              ]
                            },
                            {
                              "context" : "request",
                              "contextType" : "variable",
                              "element" : "url",
                              "transform" : "copy",
                              "parameter" : [
                                {
                                  "valueString" : "Observation"
                                }
                              ]
                            },
                            {
                              "context" : "section",
                              "contextType" : "variable",
                              "element" : "entry",
                              "variable" : "reference",
                              "transform" : "create",
                              "parameter" : [
                                {
                                  "valueString" : "Reference"
                                }
                              ]
                            },
                            {
                              "context" : "reference",
                              "contextType" : "variable",
                              "element" : "reference",
                              "transform" : "evaluate",
                              "parameter" : [
                                {
                                  "valueString" : "'https://example/Observation/' + %observation.id"
                                }
                              ]
                            }
                          ],
                          "rule" : [
                            {
                              "name" : "reference",
                              "source" : [
                                {
                                  "context" : "cdaText"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "observation",
                                  "contextType" : "variable",
                                  "element" : "subject",
                                  "variable" : "reference",
                                  "transform" : "create",
                                  "parameter" : [
                                    {
                                      "valueString" : "Reference"
                                    }
                                  ]
                                },
                                {
                                  "context" : "reference",
                                  "contextType" : "variable",
                                  "element" : "reference",
                                  "transform" : "evaluate",
                                  "parameter" : [
                                    {
                                      "valueString" : "'https://example/Patient/' + %patient.id"
                                    }
                                  ]
                                }
                              ]
                            },
                            {
                              "name" : "reference",
                              "source" : [
                                {
                                  "context" : "cdaText"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "observation",
                                  "contextType" : "variable",
                                  "element" : "encounter",
                                  "variable" : "reference",
                                  "transform" : "create",
                                  "parameter" : [
                                    {
                                      "valueString" : "Reference"
                                    }
                                  ]
                                },
                                {
                                  "context" : "reference",
                                  "contextType" : "variable",
                                  "element" : "reference",
                                  "transform" : "evaluate",
                                  "parameter" : [
                                    {
                                      "valueString" : "'https://example/Encounter/' + %enc.id"
                                    }
                                  ]
                                }
                              ]
                            },
                            {
                              "name" : "code",
                              "source" : [
                                {
                                  "context" : "sottosection",
                                  "element" : "code",
                                  "variable" : "vvv"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "observation",
                                  "contextType" : "variable",
                                  "element" : "code",
                                  "variable" : "vvv",
                                  "transform" : "create"
                                }
                              ]
                            },
                            {
                              "name" : "statuscode",
                              "source" : [
                                {
                                  "context" : "sottosection",
                                  "condition" : "observation.statusCode.exists().not()"
                                }
                              ],
                              "rule" : [
                                {
                                  "name" : "status",
                                  "source" : [
                                    {
                                      "context" : "sottosection"
                                    }
                                  ],
                                  "target" : [
                                    {
                                      "context" : "observation",
                                      "contextType" : "variable",
                                      "element" : "status",
                                      "transform" : "copy",
                                      "parameter" : [
                                        {
                                          "valueString" : "final"
                                        }
                                      ]
                                    }
                                  ]
                                }
                              ]
                            },
                            {
                              "name" : "reference",
                              "source" : [
                                {
                                  "context" : "cdaText"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "observation",
                                  "contextType" : "variable",
                                  "element" : "note",
                                  "variable" : "note"
                                }
                              ],
                              "rule" : [
                                {
                                  "name" : "reference",
                                  "source" : [
                                    {
                                      "context" : "cdaText",
                                      "variable" : "t"
                                    }
                                  ],
                                  "target" : [
                                    {
                                      "context" : "note",
                                      "contextType" : "variable",
                                      "element" : "text",
                                      "transform" : "copy",
                                      "parameter" : [
                                        {
                                          "valueId" : "t"
                                        }
                                      ]
                                    }
                                  ]
                                },
                                {
                                  "name" : "author",
                                  "source" : [
                                    {
                                      "context" : "sottosection",
                                      "element" : "author",
                                      "variable" : "authors"
                                    }
                                  ],
                                  "rule" : [
                                    {
                                      "name" : "timeAuthor",
                                      "source" : [
                                        {
                                          "context" : "authors",
                                          "element" : "time",
                                          "variable" : "time"
                                        }
                                      ],
                                      "target" : [
                                        {
                                          "context" : "note",
                                          "contextType" : "variable",
                                          "element" : "time",
                                          "variable" : "value",
                                          "transform" : "create",
                                          "parameter" : [
                                            {
                                              "valueString" : "dateTime"
                                            }
                                          ]
                                        }
                                      ],
                                      "dependent" : [
                                        {
                                          "name" : "TSDateTime",
                                          "variable" : [
                                            "time",
                                            "value"
                                          ]
                                        }
                                      ]
                                    },
                                    {
                                      "name" : "assighedAuthor",
                                      "source" : [
                                        {
                                          "context" : "authors",
                                          "element" : "assignedAuthor",
                                          "variable" : "assignedAuthor"
                                        }
                                      ],
                                      "target" : [
                                        {
                                          "context" : "bundle",
                                          "contextType" : "variable",
                                          "element" : "entry",
                                          "variable" : "e9"
                                        },
                                        {
                                          "context" : "e9",
                                          "contextType" : "variable",
                                          "element" : "request",
                                          "variable" : "request",
                                          "transform" : "create",
                                          "parameter" : [
                                            {
                                              "valueString" : "BackboneElement"
                                            }
                                          ]
                                        },
                                        {
                                          "context" : "request",
                                          "contextType" : "variable",
                                          "element" : "method",
                                          "transform" : "copy",
                                          "parameter" : [
                                            {
                                              "valueString" : "PUT"
                                            }
                                          ]
                                        },
                                        {
                                          "context" : "e9",
                                          "contextType" : "variable",
                                          "element" : "resource",
                                          "variable" : "practitioner",
                                          "transform" : "create",
                                          "parameter" : [
                                            {
                                              "valueString" : "Practitioner"
                                            }
                                          ]
                                        }
                                      ],
                                      "rule" : [
                                        {
                                          "name" : "meta",
                                          "source" : [
                                            {
                                              "context" : "assignedAuthor"
                                            }
                                          ],
                                          "target" : [
                                            {
                                              "context" : "practitioner",
                                              "contextType" : "variable",
                                              "element" : "meta",
                                              "variable" : "meta"
                                            }
                                          ],
                                          "rule" : [
                                            {
                                              "name" : "coding",
                                              "source" : [
                                                {
                                                  "context" : "assignedAuthor"
                                                }
                                              ],
                                              "target" : [
                                                {
                                                  "context" : "meta",
                                                  "contextType" : "variable",
                                                  "element" : "tag",
                                                  "variable" : "coding",
                                                  "transform" : "create",
                                                  "parameter" : [
                                                    {
                                                      "valueString" : "Coding"
                                                    }
                                                  ]
                                                }
                                              ],
                                              "rule" : [
                                                {
                                                  "name" : "system",
                                                  "source" : [
                                                    {
                                                      "context" : "assignedAuthor"
                                                    }
                                                  ],
                                                  "target" : [
                                                    {
                                                      "context" : "coding",
                                                      "contextType" : "variable",
                                                      "element" : "system",
                                                      "transform" : "copy",
                                                      "parameter" : [
                                                        {
                                                          "valueString" : "http://algoritmodiscoring"
                                                        }
                                                      ]
                                                    }
                                                  ]
                                                },
                                                {
                                                  "name" : "code",
                                                  "source" : [
                                                    {
                                                      "context" : "assignedAuthor"
                                                    }
                                                  ],
                                                  "target" : [
                                                    {
                                                      "context" : "coding",
                                                      "contextType" : "variable",
                                                      "element" : "code",
                                                      "transform" : "copy",
                                                      "parameter" : [
                                                        {
                                                          "valueString" : "ClinicalDocument/body/EsameObiettivo/author"
                                                        }
                                                      ]
                                                    }
                                                  ]
                                                }
                                              ]
                                            }
                                          ]
                                        },
                                        {
                                          "name" : "identifier",
                                          "source" : [
                                            {
                                              "context" : "assignedAuthor",
                                              "element" : "id",
                                              "variable" : "id"
                                            }
                                          ],
                                          "target" : [
                                            {
                                              "context" : "practitioner",
                                              "contextType" : "variable",
                                              "element" : "identifier",
                                              "variable" : "identifier"
                                            }
                                          ],
                                          "rule" : [
                                            {
                                              "name" : "root1",
                                              "source" : [
                                                {
                                                  "context" : "id",
                                                  "element" : "root",
                                                  "variable" : "r"
                                                }
                                              ],
                                              "target" : [
                                                {
                                                  "context" : "identifier",
                                                  "contextType" : "variable",
                                                  "element" : "system",
                                                  "transform" : "translate",
                                                  "parameter" : [
                                                    {
                                                      "valueId" : "r"
                                                    },
                                                    {
                                                      "valueString" : "http://hl7.org/fhir/ConceptMap/special-oid2uri"
                                                    },
                                                    {
                                                      "valueString" : "uri"
                                                    }
                                                  ]
                                                }
                                              ]
                                            },
                                            {
                                              "name" : "extension",
                                              "source" : [
                                                {
                                                  "context" : "id",
                                                  "element" : "extension",
                                                  "variable" : "ext"
                                                }
                                              ],
                                              "target" : [
                                                {
                                                  "context" : "identifier",
                                                  "contextType" : "variable",
                                                  "element" : "value",
                                                  "transform" : "copy",
                                                  "parameter" : [
                                                    {
                                                      "valueId" : "ext"
                                                    }
                                                  ]
                                                }
                                              ]
                                            },
                                            {
                                              "name" : "assigningAuthorityName",
                                              "source" : [
                                                {
                                                  "context" : "id",
                                                  "element" : "assigningAuthorityName",
                                                  "variable" : "s"
                                                }
                                              ],
                                              "target" : [
                                                {
                                                  "context" : "identifier",
                                                  "contextType" : "variable",
                                                  "element" : "assigner",
                                                  "variable" : "a"
                                                },
                                                {
                                                  "context" : "a",
                                                  "contextType" : "variable",
                                                  "element" : "display",
                                                  "transform" : "copy",
                                                  "parameter" : [
                                                    {
                                                      "valueId" : "s"
                                                    }
                                                  ]
                                                }
                                              ]
                                            },
                                            {
                                              "name" : "r",
                                              "source" : [
                                                {
                                                  "context" : "id",
                                                  "element" : "root",
                                                  "variable" : "r"
                                                }
                                              ],
                                              "rule" : [
                                                {
                                                  "name" : "autore",
                                                  "source" : [
                                                    {
                                                      "context" : "id",
                                                      "element" : "extension",
                                                      "variable" : "ext"
                                                    }
                                                  ],
                                                  "target" : [
                                                    {
                                                      "context" : "practitioner",
                                                      "contextType" : "variable",
                                                      "element" : "id",
                                                      "variable" : "uuid9",
                                                      "transform" : "evaluate",
                                                      "parameter" : [
                                                        {
                                                          "valueString" : "r + '-' + ext"
                                                        }
                                                      ]
                                                    },
                                                    {
                                                      "context" : "e9",
                                                      "contextType" : "variable",
                                                      "element" : "fullUrl",
                                                      "transform" : "append",
                                                      "parameter" : [
                                                        {
                                                          "valueString" : "https://example/Practitioner/"
                                                        },
                                                        {
                                                          "valueId" : "uuid9"
                                                        }
                                                      ]
                                                    },
                                                    {
                                                      "context" : "request",
                                                      "contextType" : "variable",
                                                      "element" : "url",
                                                      "transform" : "append",
                                                      "parameter" : [
                                                        {
                                                          "valueString" : "Practitioner/"
                                                        },
                                                        {
                                                          "valueId" : "uuid9"
                                                        }
                                                      ]
                                                    },
                                                    {
                                                      "context" : "note",
                                                      "contextType" : "variable",
                                                      "element" : "author",
                                                      "variable" : "reference",
                                                      "transform" : "create",
                                                      "parameter" : [
                                                        {
                                                          "valueString" : "Reference"
                                                        }
                                                      ]
                                                    },
                                                    {
                                                      "context" : "reference",
                                                      "contextType" : "variable",
                                                      "element" : "reference",
                                                      "transform" : "evaluate",
                                                      "parameter" : [
                                                        {
                                                          "valueString" : "'https://example/Practitioner/' + %practitioner.id"
                                                        }
                                                      ]
                                                    }
                                                  ]
                                                }
                                              ]
                                            }
                                          ]
                                        },
                                        {
                                          "name" : "2.16.840.1.113883.2.9.4.3.2",
                                          "source" : [
                                            {
                                              "context" : "assignedAuthor",
                                              "element" : "id",
                                              "variable" : "id",
                                              "condition" : "(root = '2.16.840.1.113883.2.9.4.3.2')"
                                            }
                                          ],
                                          "rule" : [
                                            {
                                              "name" : "UUID",
                                              "source" : [
                                                {
                                                  "context" : "id",
                                                  "element" : "extension",
                                                  "variable" : "ext"
                                                }
                                              ],
                                              "target" : [
                                                {
                                                  "context" : "request",
                                                  "contextType" : "variable",
                                                  "element" : "url",
                                                  "transform" : "append",
                                                  "parameter" : [
                                                    {
                                                      "valueString" : "Practitioner?identifier="
                                                    },
                                                    {
                                                      "valueId" : "ext"
                                                    }
                                                  ]
                                                }
                                              ]
                                            }
                                          ]
                                        },
                                        {
                                          "name" : "assignedPerson",
                                          "source" : [
                                            {
                                              "context" : "assignedAuthor",
                                              "element" : "assignedPerson",
                                              "variable" : "person"
                                            }
                                          ],
                                          "rule" : [
                                            {
                                              "name" : "name",
                                              "source" : [
                                                {
                                                  "context" : "person",
                                                  "element" : "name",
                                                  "variable" : "vvv"
                                                }
                                              ],
                                              "target" : [
                                                {
                                                  "context" : "practitioner",
                                                  "contextType" : "variable",
                                                  "element" : "name",
                                                  "variable" : "vvv",
                                                  "transform" : "create"
                                                }
                                              ]
                                            }
                                          ]
                                        }
                                      ]
                                    }
                                  ]
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "name" : "code",
                      "source" : [
                        {
                          "context" : "sottosection",
                          "element" : "code",
                          "variable" : "vvv",
                          "condition" : "(code = '42346-7')"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "section",
                          "contextType" : "variable",
                          "element" : "code",
                          "variable" : "vvv",
                          "transform" : "create"
                        }
                      ],
                      "documentation" : "3. Terapia Farmacologica all'ingresso Narrativa --------------------------------------------------------------------------------------------------------------"
                    },
                    {
                      "name" : "condizioneterapiaingresso",
                      "source" : [
                        {
                          "context" : "sottosection",
                          "element" : "code",
                          "variable" : "code1",
                          "condition" : "(code = '42346-7')"
                        }
                      ],
                      "rule" : [
                        {
                          "name" : "title",
                          "source" : [
                            {
                              "context" : "sottosection",
                              "element" : "title",
                              "variable" : "t"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "section",
                              "contextType" : "variable",
                              "element" : "title",
                              "transform" : "evaluate",
                              "parameter" : [
                                {
                                  "valueString" : "t.dataString"
                                }
                              ]
                            }
                          ]
                        },
                        {
                          "name" : "cdaText",
                          "source" : [
                            {
                              "context" : "sottosection",
                              "element" : "text",
                              "variable" : "cdaText"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "bundle",
                              "contextType" : "variable",
                              "element" : "entry",
                              "variable" : "e10"
                            },
                            {
                              "context" : "e10",
                              "contextType" : "variable",
                              "element" : "request",
                              "variable" : "request",
                              "transform" : "create",
                              "parameter" : [
                                {
                                  "valueString" : "BackboneElement"
                                }
                              ]
                            },
                            {
                              "context" : "request",
                              "contextType" : "variable",
                              "element" : "method",
                              "transform" : "copy",
                              "parameter" : [
                                {
                                  "valueString" : "POST"
                                }
                              ]
                            },
                            {
                              "context" : "e10",
                              "contextType" : "variable",
                              "element" : "resource",
                              "variable" : "medicStatement",
                              "transform" : "create",
                              "parameter" : [
                                {
                                  "valueString" : "MedicationStatement"
                                }
                              ]
                            },
                            {
                              "context" : "medicStatement",
                              "contextType" : "variable",
                              "element" : "id",
                              "variable" : "uuid10",
                              "transform" : "uuid"
                            },
                            {
                              "context" : "e10",
                              "contextType" : "variable",
                              "element" : "fullUrl",
                              "transform" : "append",
                              "parameter" : [
                                {
                                  "valueString" : "https://example/MedicationStatement/"
                                },
                                {
                                  "valueId" : "uuid10"
                                }
                              ]
                            },
                            {
                              "context" : "request",
                              "contextType" : "variable",
                              "element" : "url",
                              "transform" : "copy",
                              "parameter" : [
                                {
                                  "valueString" : "MedicationStatement"
                                }
                              ]
                            },
                            {
                              "context" : "section",
                              "contextType" : "variable",
                              "element" : "entry",
                              "variable" : "reference",
                              "transform" : "create",
                              "parameter" : [
                                {
                                  "valueString" : "Reference"
                                }
                              ]
                            },
                            {
                              "context" : "reference",
                              "contextType" : "variable",
                              "element" : "reference",
                              "transform" : "evaluate",
                              "parameter" : [
                                {
                                  "valueString" : "'https://example/MedicationStatement/' + %medicStatement.id"
                                }
                              ]
                            }
                          ],
                          "rule" : [
                            {
                              "name" : "reference",
                              "source" : [
                                {
                                  "context" : "cdaText"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "medicStatement",
                                  "contextType" : "variable",
                                  "element" : "subject",
                                  "variable" : "reference",
                                  "transform" : "create",
                                  "parameter" : [
                                    {
                                      "valueString" : "Reference"
                                    }
                                  ]
                                },
                                {
                                  "context" : "reference",
                                  "contextType" : "variable",
                                  "element" : "reference",
                                  "transform" : "evaluate",
                                  "parameter" : [
                                    {
                                      "valueString" : "'https://example/Patient/' + %patient.id"
                                    }
                                  ]
                                }
                              ]
                            },
                            {
                              "name" : "statuscode",
                              "source" : [
                                {
                                  "context" : "sottosection",
                                  "condition" : "medicStatement.statusCode.exists().not()"
                                }
                              ],
                              "rule" : [
                                {
                                  "name" : "status",
                                  "source" : [
                                    {
                                      "context" : "sottosection"
                                    }
                                  ],
                                  "target" : [
                                    {
                                      "context" : "medicStatement",
                                      "contextType" : "variable",
                                      "element" : "status",
                                      "transform" : "copy",
                                      "parameter" : [
                                        {
                                          "valueString" : "completed"
                                        }
                                      ]
                                    }
                                  ]
                                }
                              ]
                            },
                            {
                              "name" : "medication",
                              "source" : [
                                {
                                  "context" : "cdaText"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "medicStatement",
                                  "contextType" : "variable",
                                  "element" : "medication",
                                  "variable" : "medication",
                                  "transform" : "create",
                                  "parameter" : [
                                    {
                                      "valueString" : "CodeableConcept"
                                    }
                                  ]
                                }
                              ],
                              "rule" : [
                                {
                                  "name" : "text",
                                  "source" : [
                                    {
                                      "context" : "cdaText",
                                      "variable" : "txt"
                                    }
                                  ],
                                  "target" : [
                                    {
                                      "context" : "medication",
                                      "contextType" : "variable",
                                      "element" : "text",
                                      "transform" : "copy",
                                      "parameter" : [
                                        {
                                          "valueId" : "txt"
                                        }
                                      ]
                                    }
                                  ]
                                }
                              ]
                            },
                            {
                              "name" : "reference",
                              "source" : [
                                {
                                  "context" : "cdaText"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "medicStatement",
                                  "contextType" : "variable",
                                  "element" : "note",
                                  "variable" : "note"
                                }
                              ],
                              "rule" : [
                                {
                                  "name" : "reference",
                                  "source" : [
                                    {
                                      "context" : "cdaText",
                                      "variable" : "t"
                                    }
                                  ],
                                  "target" : [
                                    {
                                      "context" : "note",
                                      "contextType" : "variable",
                                      "element" : "text",
                                      "transform" : "copy",
                                      "parameter" : [
                                        {
                                          "valueId" : "t"
                                        }
                                      ]
                                    }
                                  ]
                                },
                                {
                                  "name" : "author",
                                  "source" : [
                                    {
                                      "context" : "sottosection",
                                      "element" : "author",
                                      "variable" : "authors"
                                    }
                                  ],
                                  "rule" : [
                                    {
                                      "name" : "timeAuthor",
                                      "source" : [
                                        {
                                          "context" : "authors",
                                          "element" : "time",
                                          "variable" : "time"
                                        }
                                      ],
                                      "target" : [
                                        {
                                          "context" : "note",
                                          "contextType" : "variable",
                                          "element" : "time",
                                          "variable" : "value",
                                          "transform" : "create",
                                          "parameter" : [
                                            {
                                              "valueString" : "dateTime"
                                            }
                                          ]
                                        }
                                      ],
                                      "dependent" : [
                                        {
                                          "name" : "TSDateTime",
                                          "variable" : [
                                            "time",
                                            "value"
                                          ]
                                        }
                                      ]
                                    },
                                    {
                                      "name" : "assighedAuthor",
                                      "source" : [
                                        {
                                          "context" : "authors",
                                          "element" : "assignedAuthor",
                                          "variable" : "assignedAuthor"
                                        }
                                      ],
                                      "target" : [
                                        {
                                          "context" : "bundle",
                                          "contextType" : "variable",
                                          "element" : "entry",
                                          "variable" : "e11"
                                        },
                                        {
                                          "context" : "e11",
                                          "contextType" : "variable",
                                          "element" : "request",
                                          "variable" : "request",
                                          "transform" : "create",
                                          "parameter" : [
                                            {
                                              "valueString" : "BackboneElement"
                                            }
                                          ]
                                        },
                                        {
                                          "context" : "request",
                                          "contextType" : "variable",
                                          "element" : "method",
                                          "transform" : "copy",
                                          "parameter" : [
                                            {
                                              "valueString" : "PUT"
                                            }
                                          ]
                                        },
                                        {
                                          "context" : "e11",
                                          "contextType" : "variable",
                                          "element" : "resource",
                                          "variable" : "practitioner",
                                          "transform" : "create",
                                          "parameter" : [
                                            {
                                              "valueString" : "Practitioner"
                                            }
                                          ]
                                        }
                                      ],
                                      "rule" : [
                                        {
                                          "name" : "meta",
                                          "source" : [
                                            {
                                              "context" : "assignedAuthor"
                                            }
                                          ],
                                          "target" : [
                                            {
                                              "context" : "practitioner",
                                              "contextType" : "variable",
                                              "element" : "meta",
                                              "variable" : "meta"
                                            }
                                          ],
                                          "rule" : [
                                            {
                                              "name" : "coding",
                                              "source" : [
                                                {
                                                  "context" : "assignedAuthor"
                                                }
                                              ],
                                              "target" : [
                                                {
                                                  "context" : "meta",
                                                  "contextType" : "variable",
                                                  "element" : "tag",
                                                  "variable" : "coding",
                                                  "transform" : "create",
                                                  "parameter" : [
                                                    {
                                                      "valueString" : "Coding"
                                                    }
                                                  ]
                                                }
                                              ],
                                              "rule" : [
                                                {
                                                  "name" : "system",
                                                  "source" : [
                                                    {
                                                      "context" : "assignedAuthor"
                                                    }
                                                  ],
                                                  "target" : [
                                                    {
                                                      "context" : "coding",
                                                      "contextType" : "variable",
                                                      "element" : "system",
                                                      "transform" : "copy",
                                                      "parameter" : [
                                                        {
                                                          "valueString" : "http://algoritmodiscoring"
                                                        }
                                                      ]
                                                    }
                                                  ]
                                                },
                                                {
                                                  "name" : "code",
                                                  "source" : [
                                                    {
                                                      "context" : "assignedAuthor"
                                                    }
                                                  ],
                                                  "target" : [
                                                    {
                                                      "context" : "coding",
                                                      "contextType" : "variable",
                                                      "element" : "code",
                                                      "transform" : "copy",
                                                      "parameter" : [
                                                        {
                                                          "valueString" : "ClinicalDocument/body/TerapiaFarmacologicaIngresso/author"
                                                        }
                                                      ]
                                                    }
                                                  ]
                                                }
                                              ]
                                            }
                                          ]
                                        },
                                        {
                                          "name" : "identifier",
                                          "source" : [
                                            {
                                              "context" : "assignedAuthor",
                                              "element" : "id",
                                              "variable" : "id"
                                            }
                                          ],
                                          "target" : [
                                            {
                                              "context" : "practitioner",
                                              "contextType" : "variable",
                                              "element" : "identifier",
                                              "variable" : "identifier"
                                            }
                                          ],
                                          "rule" : [
                                            {
                                              "name" : "root1",
                                              "source" : [
                                                {
                                                  "context" : "id",
                                                  "element" : "root",
                                                  "variable" : "r"
                                                }
                                              ],
                                              "target" : [
                                                {
                                                  "context" : "identifier",
                                                  "contextType" : "variable",
                                                  "element" : "system",
                                                  "transform" : "translate",
                                                  "parameter" : [
                                                    {
                                                      "valueId" : "r"
                                                    },
                                                    {
                                                      "valueString" : "http://hl7.org/fhir/ConceptMap/special-oid2uri"
                                                    },
                                                    {
                                                      "valueString" : "uri"
                                                    }
                                                  ]
                                                }
                                              ]
                                            },
                                            {
                                              "name" : "extension",
                                              "source" : [
                                                {
                                                  "context" : "id",
                                                  "element" : "extension",
                                                  "variable" : "ext"
                                                }
                                              ],
                                              "target" : [
                                                {
                                                  "context" : "identifier",
                                                  "contextType" : "variable",
                                                  "element" : "value",
                                                  "transform" : "copy",
                                                  "parameter" : [
                                                    {
                                                      "valueId" : "ext"
                                                    }
                                                  ]
                                                }
                                              ]
                                            },
                                            {
                                              "name" : "assigningAuthorityName",
                                              "source" : [
                                                {
                                                  "context" : "id",
                                                  "element" : "assigningAuthorityName",
                                                  "variable" : "s"
                                                }
                                              ],
                                              "target" : [
                                                {
                                                  "context" : "identifier",
                                                  "contextType" : "variable",
                                                  "element" : "assigner",
                                                  "variable" : "a"
                                                },
                                                {
                                                  "context" : "a",
                                                  "contextType" : "variable",
                                                  "element" : "display",
                                                  "transform" : "copy",
                                                  "parameter" : [
                                                    {
                                                      "valueId" : "s"
                                                    }
                                                  ]
                                                }
                                              ]
                                            },
                                            {
                                              "name" : "r",
                                              "source" : [
                                                {
                                                  "context" : "id",
                                                  "element" : "root",
                                                  "variable" : "r"
                                                }
                                              ],
                                              "rule" : [
                                                {
                                                  "name" : "extension",
                                                  "source" : [
                                                    {
                                                      "context" : "id",
                                                      "element" : "extension",
                                                      "variable" : "ext"
                                                    }
                                                  ],
                                                  "target" : [
                                                    {
                                                      "context" : "practitioner",
                                                      "contextType" : "variable",
                                                      "element" : "id",
                                                      "variable" : "uuid11",
                                                      "transform" : "evaluate",
                                                      "parameter" : [
                                                        {
                                                          "valueString" : "r + '-' + ext"
                                                        }
                                                      ]
                                                    },
                                                    {
                                                      "context" : "e11",
                                                      "contextType" : "variable",
                                                      "element" : "fullUrl",
                                                      "transform" : "append",
                                                      "parameter" : [
                                                        {
                                                          "valueString" : "https://example/Practitioner/"
                                                        },
                                                        {
                                                          "valueId" : "uuid11"
                                                        }
                                                      ]
                                                    },
                                                    {
                                                      "context" : "request",
                                                      "contextType" : "variable",
                                                      "element" : "url",
                                                      "transform" : "append",
                                                      "parameter" : [
                                                        {
                                                          "valueString" : "Practitioner/"
                                                        },
                                                        {
                                                          "valueId" : "uuid11"
                                                        }
                                                      ]
                                                    },
                                                    {
                                                      "context" : "note",
                                                      "contextType" : "variable",
                                                      "element" : "author",
                                                      "variable" : "reference",
                                                      "transform" : "create",
                                                      "parameter" : [
                                                        {
                                                          "valueString" : "Reference"
                                                        }
                                                      ]
                                                    },
                                                    {
                                                      "context" : "reference",
                                                      "contextType" : "variable",
                                                      "element" : "reference",
                                                      "transform" : "evaluate",
                                                      "parameter" : [
                                                        {
                                                          "valueString" : "'https://example/Practitioner/' + %practitioner.id"
                                                        }
                                                      ]
                                                    }
                                                  ]
                                                }
                                              ]
                                            }
                                          ]
                                        },
                                        {
                                          "name" : "2.16.840.1.113883.2.9.4.3.2",
                                          "source" : [
                                            {
                                              "context" : "assignedAuthor",
                                              "element" : "id",
                                              "variable" : "id",
                                              "condition" : "(root = '2.16.840.1.113883.2.9.4.3.2')"
                                            }
                                          ],
                                          "rule" : [
                                            {
                                              "name" : "UUID",
                                              "source" : [
                                                {
                                                  "context" : "id",
                                                  "element" : "extension",
                                                  "variable" : "ext"
                                                }
                                              ],
                                              "target" : [
                                                {
                                                  "context" : "request",
                                                  "contextType" : "variable",
                                                  "element" : "url",
                                                  "transform" : "append",
                                                  "parameter" : [
                                                    {
                                                      "valueString" : "Practitioner?identifier="
                                                    },
                                                    {
                                                      "valueId" : "ext"
                                                    }
                                                  ]
                                                }
                                              ]
                                            }
                                          ]
                                        },
                                        {
                                          "name" : "assignedPerson",
                                          "source" : [
                                            {
                                              "context" : "assignedAuthor",
                                              "element" : "assignedPerson",
                                              "variable" : "person"
                                            }
                                          ],
                                          "rule" : [
                                            {
                                              "name" : "name",
                                              "source" : [
                                                {
                                                  "context" : "person",
                                                  "element" : "name",
                                                  "variable" : "vvv"
                                                }
                                              ],
                                              "target" : [
                                                {
                                                  "context" : "practitioner",
                                                  "contextType" : "variable",
                                                  "element" : "name",
                                                  "variable" : "vvv",
                                                  "transform" : "create"
                                                }
                                              ]
                                            }
                                          ]
                                        }
                                      ]
                                    }
                                  ]
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "name" : "code",
                      "source" : [
                        {
                          "context" : "sottosection",
                          "element" : "code",
                          "variable" : "vvv",
                          "condition" : "(code = '48765-2')"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "section",
                          "contextType" : "variable",
                          "element" : "code",
                          "variable" : "vvv",
                          "transform" : "create"
                        }
                      ],
                      "documentation" : "4. Allergie"
                    },
                    {
                      "name" : "condizioneallergie",
                      "source" : [
                        {
                          "context" : "sottosection",
                          "element" : "code",
                          "variable" : "code1",
                          "condition" : "(code = '48765-2')"
                        }
                      ],
                      "rule" : [
                        {
                          "name" : "title",
                          "source" : [
                            {
                              "context" : "sottosection",
                              "element" : "title",
                              "variable" : "t"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "section",
                              "contextType" : "variable",
                              "element" : "title",
                              "transform" : "evaluate",
                              "parameter" : [
                                {
                                  "valueString" : "t.dataString"
                                }
                              ]
                            }
                          ]
                        },
                        {
                          "name" : "where",
                          "source" : [
                            {
                              "context" : "src",
                              "condition" : "sottosection.entry.exists().not()"
                            }
                          ],
                          "rule" : [
                            {
                              "name" : "title",
                              "source" : [
                                {
                                  "context" : "sottosection",
                                  "element" : "title",
                                  "variable" : "t"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "section",
                                  "contextType" : "variable",
                                  "element" : "title",
                                  "transform" : "evaluate",
                                  "parameter" : [
                                    {
                                      "valueString" : "t.dataString"
                                    }
                                  ]
                                }
                              ]
                            },
                            {
                              "name" : "cdaText",
                              "source" : [
                                {
                                  "context" : "sottosection",
                                  "element" : "text",
                                  "variable" : "cdaText"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "bundle",
                                  "contextType" : "variable",
                                  "element" : "entry",
                                  "variable" : "e8"
                                },
                                {
                                  "context" : "e8",
                                  "contextType" : "variable",
                                  "element" : "request",
                                  "variable" : "request",
                                  "transform" : "create",
                                  "parameter" : [
                                    {
                                      "valueString" : "BackboneElement"
                                    }
                                  ]
                                },
                                {
                                  "context" : "request",
                                  "contextType" : "variable",
                                  "element" : "method",
                                  "transform" : "copy",
                                  "parameter" : [
                                    {
                                      "valueString" : "POST"
                                    }
                                  ]
                                },
                                {
                                  "context" : "e8",
                                  "contextType" : "variable",
                                  "element" : "resource",
                                  "variable" : "AllergyIntolerance",
                                  "transform" : "create",
                                  "parameter" : [
                                    {
                                      "valueString" : "AllergyIntolerance"
                                    }
                                  ]
                                },
                                {
                                  "context" : "AllergyIntolerance",
                                  "contextType" : "variable",
                                  "element" : "id",
                                  "variable" : "uuid8",
                                  "transform" : "uuid"
                                },
                                {
                                  "context" : "e8",
                                  "contextType" : "variable",
                                  "element" : "fullUrl",
                                  "transform" : "append",
                                  "parameter" : [
                                    {
                                      "valueString" : "https://example/AllergyIntolerance/"
                                    },
                                    {
                                      "valueId" : "uuid8"
                                    }
                                  ]
                                },
                                {
                                  "context" : "request",
                                  "contextType" : "variable",
                                  "element" : "url",
                                  "transform" : "copy",
                                  "parameter" : [
                                    {
                                      "valueString" : "AllergyIntolerance"
                                    }
                                  ]
                                },
                                {
                                  "context" : "section",
                                  "contextType" : "variable",
                                  "element" : "entry",
                                  "variable" : "reference",
                                  "transform" : "create",
                                  "parameter" : [
                                    {
                                      "valueString" : "Reference"
                                    }
                                  ]
                                },
                                {
                                  "context" : "reference",
                                  "contextType" : "variable",
                                  "element" : "reference",
                                  "transform" : "evaluate",
                                  "parameter" : [
                                    {
                                      "valueString" : "'https://example/AllergyIntolerance/' + %AllergyIntolerance.id"
                                    }
                                  ]
                                }
                              ],
                              "rule" : [
                                {
                                  "name" : "reference",
                                  "source" : [
                                    {
                                      "context" : "cdaText"
                                    }
                                  ],
                                  "target" : [
                                    {
                                      "context" : "AllergyIntolerance",
                                      "contextType" : "variable",
                                      "element" : "patient",
                                      "variable" : "reference",
                                      "transform" : "create",
                                      "parameter" : [
                                        {
                                          "valueString" : "Reference"
                                        }
                                      ]
                                    },
                                    {
                                      "context" : "reference",
                                      "contextType" : "variable",
                                      "element" : "reference",
                                      "transform" : "evaluate",
                                      "parameter" : [
                                        {
                                          "valueString" : "'https://example/Patient/' + %patient.id"
                                        }
                                      ]
                                    }
                                  ]
                                },
                                {
                                  "name" : "reference",
                                  "source" : [
                                    {
                                      "context" : "cdaText"
                                    }
                                  ],
                                  "target" : [
                                    {
                                      "context" : "AllergyIntolerance",
                                      "contextType" : "variable",
                                      "element" : "encounter",
                                      "variable" : "reference",
                                      "transform" : "create",
                                      "parameter" : [
                                        {
                                          "valueString" : "Reference"
                                        }
                                      ]
                                    },
                                    {
                                      "context" : "reference",
                                      "contextType" : "variable",
                                      "element" : "reference",
                                      "transform" : "evaluate",
                                      "parameter" : [
                                        {
                                          "valueString" : "'https://example/Encounter/' + %enc.id"
                                        }
                                      ]
                                    }
                                  ]
                                },
                                {
                                  "name" : "clinicalStatus",
                                  "source" : [
                                    {
                                      "context" : "cdaText"
                                    }
                                  ],
                                  "target" : [
                                    {
                                      "context" : "AllergyIntolerance",
                                      "contextType" : "variable",
                                      "element" : "clinicalStatus",
                                      "variable" : "status",
                                      "transform" : "create",
                                      "parameter" : [
                                        {
                                          "valueString" : "CodeableConcept"
                                        }
                                      ]
                                    }
                                  ],
                                  "rule" : [
                                    {
                                      "name" : "coding",
                                      "source" : [
                                        {
                                          "context" : "cdaText"
                                        }
                                      ],
                                      "target" : [
                                        {
                                          "context" : "status",
                                          "contextType" : "variable",
                                          "element" : "coding",
                                          "variable" : "coding",
                                          "transform" : "create",
                                          "parameter" : [
                                            {
                                              "valueString" : "Coding"
                                            }
                                          ]
                                        }
                                      ],
                                      "rule" : [
                                        {
                                          "name" : "active",
                                          "source" : [
                                            {
                                              "context" : "cdaText"
                                            }
                                          ],
                                          "target" : [
                                            {
                                              "context" : "coding",
                                              "contextType" : "variable",
                                              "element" : "code",
                                              "transform" : "copy",
                                              "parameter" : [
                                                {
                                                  "valueString" : "active"
                                                }
                                              ]
                                            }
                                          ]
                                        },
                                        {
                                          "name" : "system",
                                          "source" : [
                                            {
                                              "context" : "cdaText"
                                            }
                                          ],
                                          "target" : [
                                            {
                                              "context" : "coding",
                                              "contextType" : "variable",
                                              "element" : "system",
                                              "transform" : "copy",
                                              "parameter" : [
                                                {
                                                  "valueString" : "http://terminology.hl7.org/CodeSystem/allergyintolerance-clinical"
                                                }
                                              ]
                                            }
                                          ]
                                        },
                                        {
                                          "name" : "active",
                                          "source" : [
                                            {
                                              "context" : "cdaText"
                                            }
                                          ],
                                          "target" : [
                                            {
                                              "context" : "coding",
                                              "contextType" : "variable",
                                              "element" : "display",
                                              "transform" : "copy",
                                              "parameter" : [
                                                {
                                                  "valueString" : "active"
                                                }
                                              ]
                                            }
                                          ]
                                        }
                                      ]
                                    }
                                  ]
                                },
                                {
                                  "name" : "reference",
                                  "source" : [
                                    {
                                      "context" : "cdaText"
                                    }
                                  ],
                                  "target" : [
                                    {
                                      "context" : "AllergyIntolerance",
                                      "contextType" : "variable",
                                      "element" : "note",
                                      "variable" : "note"
                                    }
                                  ],
                                  "rule" : [
                                    {
                                      "name" : "reference",
                                      "source" : [
                                        {
                                          "context" : "cdaText",
                                          "variable" : "t"
                                        }
                                      ],
                                      "target" : [
                                        {
                                          "context" : "note",
                                          "contextType" : "variable",
                                          "element" : "text",
                                          "transform" : "copy",
                                          "parameter" : [
                                            {
                                              "valueId" : "t"
                                            }
                                          ]
                                        }
                                      ]
                                    },
                                    {
                                      "name" : "author",
                                      "source" : [
                                        {
                                          "context" : "sottosection",
                                          "element" : "author",
                                          "variable" : "authors"
                                        }
                                      ],
                                      "rule" : [
                                        {
                                          "name" : "timeAuthor",
                                          "source" : [
                                            {
                                              "context" : "authors",
                                              "element" : "time",
                                              "variable" : "time"
                                            }
                                          ],
                                          "target" : [
                                            {
                                              "context" : "note",
                                              "contextType" : "variable",
                                              "element" : "time",
                                              "variable" : "value",
                                              "transform" : "create",
                                              "parameter" : [
                                                {
                                                  "valueString" : "dateTime"
                                                }
                                              ]
                                            }
                                          ],
                                          "dependent" : [
                                            {
                                              "name" : "TSDateTime",
                                              "variable" : [
                                                "time",
                                                "value"
                                              ]
                                            }
                                          ]
                                        },
                                        {
                                          "name" : "assighedAuthor",
                                          "source" : [
                                            {
                                              "context" : "authors",
                                              "element" : "assignedAuthor",
                                              "variable" : "assignedAuthor"
                                            }
                                          ],
                                          "target" : [
                                            {
                                              "context" : "bundle",
                                              "contextType" : "variable",
                                              "element" : "entry",
                                              "variable" : "e9"
                                            },
                                            {
                                              "context" : "e9",
                                              "contextType" : "variable",
                                              "element" : "request",
                                              "variable" : "request",
                                              "transform" : "create",
                                              "parameter" : [
                                                {
                                                  "valueString" : "BackboneElement"
                                                }
                                              ]
                                            },
                                            {
                                              "context" : "request",
                                              "contextType" : "variable",
                                              "element" : "method",
                                              "transform" : "copy",
                                              "parameter" : [
                                                {
                                                  "valueString" : "PUT"
                                                }
                                              ]
                                            },
                                            {
                                              "context" : "e9",
                                              "contextType" : "variable",
                                              "element" : "resource",
                                              "variable" : "practitioner",
                                              "transform" : "create",
                                              "parameter" : [
                                                {
                                                  "valueString" : "Practitioner"
                                                }
                                              ]
                                            }
                                          ],
                                          "rule" : [
                                            {
                                              "name" : "meta",
                                              "source" : [
                                                {
                                                  "context" : "assignedAuthor"
                                                }
                                              ],
                                              "target" : [
                                                {
                                                  "context" : "practitioner",
                                                  "contextType" : "variable",
                                                  "element" : "meta",
                                                  "variable" : "meta"
                                                }
                                              ],
                                              "rule" : [
                                                {
                                                  "name" : "coding",
                                                  "source" : [
                                                    {
                                                      "context" : "assignedAuthor"
                                                    }
                                                  ],
                                                  "target" : [
                                                    {
                                                      "context" : "meta",
                                                      "contextType" : "variable",
                                                      "element" : "tag",
                                                      "variable" : "coding",
                                                      "transform" : "create",
                                                      "parameter" : [
                                                        {
                                                          "valueString" : "Coding"
                                                        }
                                                      ]
                                                    }
                                                  ],
                                                  "rule" : [
                                                    {
                                                      "name" : "system",
                                                      "source" : [
                                                        {
                                                          "context" : "assignedAuthor"
                                                        }
                                                      ],
                                                      "target" : [
                                                        {
                                                          "context" : "coding",
                                                          "contextType" : "variable",
                                                          "element" : "system",
                                                          "transform" : "copy",
                                                          "parameter" : [
                                                            {
                                                              "valueString" : "http://algoritmodiscoring"
                                                            }
                                                          ]
                                                        }
                                                      ]
                                                    },
                                                    {
                                                      "name" : "code",
                                                      "source" : [
                                                        {
                                                          "context" : "assignedAuthor"
                                                        }
                                                      ],
                                                      "target" : [
                                                        {
                                                          "context" : "coding",
                                                          "contextType" : "variable",
                                                          "element" : "code",
                                                          "transform" : "copy",
                                                          "parameter" : [
                                                            {
                                                              "valueString" : "ClinicalDocument/body/EsameObiettivo/author"
                                                            }
                                                          ]
                                                        }
                                                      ]
                                                    }
                                                  ]
                                                }
                                              ]
                                            },
                                            {
                                              "name" : "identifier",
                                              "source" : [
                                                {
                                                  "context" : "assignedAuthor",
                                                  "element" : "id",
                                                  "variable" : "id"
                                                }
                                              ],
                                              "target" : [
                                                {
                                                  "context" : "practitioner",
                                                  "contextType" : "variable",
                                                  "element" : "identifier",
                                                  "variable" : "identifier"
                                                }
                                              ],
                                              "rule" : [
                                                {
                                                  "name" : "root1",
                                                  "source" : [
                                                    {
                                                      "context" : "id",
                                                      "element" : "root",
                                                      "variable" : "r"
                                                    }
                                                  ],
                                                  "target" : [
                                                    {
                                                      "context" : "identifier",
                                                      "contextType" : "variable",
                                                      "element" : "system",
                                                      "transform" : "translate",
                                                      "parameter" : [
                                                        {
                                                          "valueId" : "r"
                                                        },
                                                        {
                                                          "valueString" : "http://hl7.org/fhir/ConceptMap/special-oid2uri"
                                                        },
                                                        {
                                                          "valueString" : "uri"
                                                        }
                                                      ]
                                                    }
                                                  ]
                                                },
                                                {
                                                  "name" : "extension",
                                                  "source" : [
                                                    {
                                                      "context" : "id",
                                                      "element" : "extension",
                                                      "variable" : "ext"
                                                    }
                                                  ],
                                                  "target" : [
                                                    {
                                                      "context" : "identifier",
                                                      "contextType" : "variable",
                                                      "element" : "value",
                                                      "transform" : "copy",
                                                      "parameter" : [
                                                        {
                                                          "valueId" : "ext"
                                                        }
                                                      ]
                                                    }
                                                  ]
                                                },
                                                {
                                                  "name" : "assigningAuthorityName",
                                                  "source" : [
                                                    {
                                                      "context" : "id",
                                                      "element" : "assigningAuthorityName",
                                                      "variable" : "s"
                                                    }
                                                  ],
                                                  "target" : [
                                                    {
                                                      "context" : "identifier",
                                                      "contextType" : "variable",
                                                      "element" : "assigner",
                                                      "variable" : "a"
                                                    },
                                                    {
                                                      "context" : "a",
                                                      "contextType" : "variable",
                                                      "element" : "display",
                                                      "transform" : "copy",
                                                      "parameter" : [
                                                        {
                                                          "valueId" : "s"
                                                        }
                                                      ]
                                                    }
                                                  ]
                                                },
                                                {
                                                  "name" : "r",
                                                  "source" : [
                                                    {
                                                      "context" : "id",
                                                      "element" : "root",
                                                      "variable" : "r"
                                                    }
                                                  ],
                                                  "rule" : [
                                                    {
                                                      "name" : "autore",
                                                      "source" : [
                                                        {
                                                          "context" : "id",
                                                          "element" : "extension",
                                                          "variable" : "ext"
                                                        }
                                                      ],
                                                      "target" : [
                                                        {
                                                          "context" : "practitioner",
                                                          "contextType" : "variable",
                                                          "element" : "id",
                                                          "variable" : "uuid9",
                                                          "transform" : "evaluate",
                                                          "parameter" : [
                                                            {
                                                              "valueString" : "r + '-' + ext"
                                                            }
                                                          ]
                                                        },
                                                        {
                                                          "context" : "e9",
                                                          "contextType" : "variable",
                                                          "element" : "fullUrl",
                                                          "transform" : "append",
                                                          "parameter" : [
                                                            {
                                                              "valueString" : "https://example/Practitioner/"
                                                            },
                                                            {
                                                              "valueId" : "uuid9"
                                                            }
                                                          ]
                                                        },
                                                        {
                                                          "context" : "request",
                                                          "contextType" : "variable",
                                                          "element" : "url",
                                                          "transform" : "append",
                                                          "parameter" : [
                                                            {
                                                              "valueString" : "Practitioner/"
                                                            },
                                                            {
                                                              "valueId" : "uuid9"
                                                            }
                                                          ]
                                                        },
                                                        {
                                                          "context" : "note",
                                                          "contextType" : "variable",
                                                          "element" : "author",
                                                          "variable" : "reference",
                                                          "transform" : "create",
                                                          "parameter" : [
                                                            {
                                                              "valueString" : "Reference"
                                                            }
                                                          ]
                                                        },
                                                        {
                                                          "context" : "reference",
                                                          "contextType" : "variable",
                                                          "element" : "reference",
                                                          "transform" : "evaluate",
                                                          "parameter" : [
                                                            {
                                                              "valueString" : "'https://example/Practitioner/' + %practitioner.id"
                                                            }
                                                          ]
                                                        }
                                                      ]
                                                    }
                                                  ]
                                                }
                                              ]
                                            },
                                            {
                                              "name" : "2.16.840.1.113883.2.9.4.3.2",
                                              "source" : [
                                                {
                                                  "context" : "assignedAuthor",
                                                  "element" : "id",
                                                  "variable" : "id",
                                                  "condition" : "(root = '2.16.840.1.113883.2.9.4.3.2')"
                                                }
                                              ],
                                              "rule" : [
                                                {
                                                  "name" : "UUID",
                                                  "source" : [
                                                    {
                                                      "context" : "id",
                                                      "element" : "extension",
                                                      "variable" : "ext"
                                                    }
                                                  ],
                                                  "target" : [
                                                    {
                                                      "context" : "request",
                                                      "contextType" : "variable",
                                                      "element" : "url",
                                                      "transform" : "append",
                                                      "parameter" : [
                                                        {
                                                          "valueString" : "Practitioner?identifier="
                                                        },
                                                        {
                                                          "valueId" : "ext"
                                                        }
                                                      ]
                                                    }
                                                  ]
                                                }
                                              ]
                                            },
                                            {
                                              "name" : "assignedPerson",
                                              "source" : [
                                                {
                                                  "context" : "assignedAuthor",
                                                  "element" : "assignedPerson",
                                                  "variable" : "person"
                                                }
                                              ],
                                              "rule" : [
                                                {
                                                  "name" : "name",
                                                  "source" : [
                                                    {
                                                      "context" : "person",
                                                      "element" : "name",
                                                      "variable" : "vvv"
                                                    }
                                                  ],
                                                  "target" : [
                                                    {
                                                      "context" : "practitioner",
                                                      "contextType" : "variable",
                                                      "element" : "name",
                                                      "variable" : "vvv",
                                                      "transform" : "create"
                                                    }
                                                  ]
                                                }
                                              ]
                                            }
                                          ]
                                        }
                                      ]
                                    }
                                  ]
                                }
                              ]
                            }
                          ],
                          "documentation" : "Allergia Narrativa-------------------------------------------------------------------------------------------------------------------------------------------"
                        },
                        {
                          "name" : "allergy",
                          "source" : [
                            {
                              "context" : "sottosection",
                              "element" : "entry",
                              "variable" : "entry1"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "bundle",
                              "contextType" : "variable",
                              "element" : "entry",
                              "variable" : "e12"
                            },
                            {
                              "context" : "e12",
                              "contextType" : "variable",
                              "element" : "request",
                              "variable" : "request",
                              "transform" : "create",
                              "parameter" : [
                                {
                                  "valueString" : "BackboneElement"
                                }
                              ]
                            },
                            {
                              "context" : "request",
                              "contextType" : "variable",
                              "element" : "method",
                              "transform" : "copy",
                              "parameter" : [
                                {
                                  "valueString" : "POST"
                                }
                              ]
                            },
                            {
                              "context" : "e12",
                              "contextType" : "variable",
                              "element" : "resource",
                              "variable" : "allergy",
                              "transform" : "create",
                              "parameter" : [
                                {
                                  "valueString" : "AllergyIntolerance"
                                }
                              ]
                            },
                            {
                              "context" : "allergy",
                              "contextType" : "variable",
                              "element" : "id",
                              "variable" : "uuid12",
                              "transform" : "uuid"
                            },
                            {
                              "context" : "e12",
                              "contextType" : "variable",
                              "element" : "fullUrl",
                              "transform" : "append",
                              "parameter" : [
                                {
                                  "valueString" : "https://example/AllergyIntolerance/"
                                },
                                {
                                  "valueId" : "uuid12"
                                }
                              ]
                            },
                            {
                              "context" : "request",
                              "contextType" : "variable",
                              "element" : "url",
                              "transform" : "copy",
                              "parameter" : [
                                {
                                  "valueString" : "AllergyIntolerance"
                                }
                              ]
                            },
                            {
                              "context" : "section",
                              "contextType" : "variable",
                              "element" : "entry",
                              "variable" : "reference",
                              "transform" : "create",
                              "parameter" : [
                                {
                                  "valueString" : "Reference"
                                }
                              ]
                            },
                            {
                              "context" : "reference",
                              "contextType" : "variable",
                              "element" : "reference",
                              "transform" : "evaluate",
                              "parameter" : [
                                {
                                  "valueString" : "'https://example/AllergyIntolerance/' + %allergy.id"
                                }
                              ]
                            }
                          ],
                          "rule" : [
                            {
                              "name" : "reference",
                              "source" : [
                                {
                                  "context" : "src"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "allergy",
                                  "contextType" : "variable",
                                  "element" : "patient",
                                  "variable" : "reference",
                                  "transform" : "create",
                                  "parameter" : [
                                    {
                                      "valueString" : "Reference"
                                    }
                                  ]
                                },
                                {
                                  "context" : "reference",
                                  "contextType" : "variable",
                                  "element" : "reference",
                                  "transform" : "evaluate",
                                  "parameter" : [
                                    {
                                      "valueString" : "'https://example/Patient/' + %patient.id"
                                    }
                                  ]
                                }
                              ]
                            },
                            {
                              "name" : "reference",
                              "source" : [
                                {
                                  "context" : "src"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "allergy",
                                  "contextType" : "variable",
                                  "element" : "encounter",
                                  "variable" : "reference",
                                  "transform" : "create",
                                  "parameter" : [
                                    {
                                      "valueString" : "Reference"
                                    }
                                  ]
                                },
                                {
                                  "context" : "reference",
                                  "contextType" : "variable",
                                  "element" : "reference",
                                  "transform" : "evaluate",
                                  "parameter" : [
                                    {
                                      "valueString" : "'https://example/Encounter/' + %enc.id"
                                    }
                                  ]
                                }
                              ]
                            },
                            {
                              "name" : "entryact2",
                              "source" : [
                                {
                                  "context" : "entry1",
                                  "element" : "act",
                                  "variable" : "actallint"
                                }
                              ],
                              "rule" : [
                                {
                                  "name" : "onsetDateTime",
                                  "source" : [
                                    {
                                      "context" : "actallint",
                                      "element" : "effectiveTime",
                                      "variable" : "effectiveTime"
                                    }
                                  ],
                                  "target" : [
                                    {
                                      "context" : "allergy",
                                      "contextType" : "variable",
                                      "element" : "onset",
                                      "variable" : "value",
                                      "transform" : "create",
                                      "parameter" : [
                                        {
                                          "valueString" : "dateTime"
                                        }
                                      ]
                                    }
                                  ],
                                  "dependent" : [
                                    {
                                      "name" : "TSDateTime",
                                      "variable" : [
                                        "effectiveTime",
                                        "value"
                                      ]
                                    }
                                  ]
                                },
                                {
                                  "name" : "where",
                                  "source" : [
                                    {
                                      "context" : "actallint",
                                      "condition" : "effectiveTime.low.exists() or effectiveTime.high.exists()"
                                    }
                                  ],
                                  "rule" : [
                                    {
                                      "name" : "onsetPeriod",
                                      "source" : [
                                        {
                                          "context" : "actallint",
                                          "element" : "effectiveTime",
                                          "variable" : "eff"
                                        }
                                      ],
                                      "target" : [
                                        {
                                          "context" : "allergy",
                                          "contextType" : "variable",
                                          "element" : "onset",
                                          "variable" : "period",
                                          "transform" : "create",
                                          "parameter" : [
                                            {
                                              "valueString" : "Period"
                                            }
                                          ]
                                        }
                                      ],
                                      "dependent" : [
                                        {
                                          "name" : "IVLTSPeriod",
                                          "variable" : [
                                            "eff",
                                            "period"
                                          ]
                                        }
                                      ]
                                    }
                                  ]
                                },
                                {
                                  "name" : "cdaText1",
                                  "source" : [
                                    {
                                      "context" : "sottosection",
                                      "element" : "text",
                                      "variable" : "cdaText1"
                                    }
                                  ],
                                  "target" : [
                                    {
                                      "context" : "allergy",
                                      "contextType" : "variable",
                                      "element" : "note",
                                      "variable" : "note"
                                    }
                                  ],
                                  "rule" : [
                                    {
                                      "name" : "reference",
                                      "source" : [
                                        {
                                          "context" : "cdaText1",
                                          "variable" : "t"
                                        }
                                      ],
                                      "target" : [
                                        {
                                          "context" : "note",
                                          "contextType" : "variable",
                                          "element" : "text",
                                          "transform" : "copy",
                                          "parameter" : [
                                            {
                                              "valueId" : "t"
                                            }
                                          ]
                                        }
                                      ]
                                    },
                                    {
                                      "name" : "author",
                                      "source" : [
                                        {
                                          "context" : "sottosection",
                                          "element" : "author",
                                          "variable" : "authors"
                                        }
                                      ],
                                      "rule" : [
                                        {
                                          "name" : "timeAuthor",
                                          "source" : [
                                            {
                                              "context" : "authors",
                                              "element" : "time",
                                              "variable" : "time"
                                            }
                                          ],
                                          "target" : [
                                            {
                                              "context" : "note",
                                              "contextType" : "variable",
                                              "element" : "time",
                                              "variable" : "value",
                                              "transform" : "create",
                                              "parameter" : [
                                                {
                                                  "valueString" : "dateTime"
                                                }
                                              ]
                                            }
                                          ],
                                          "dependent" : [
                                            {
                                              "name" : "TSDateTime",
                                              "variable" : [
                                                "time",
                                                "value"
                                              ]
                                            }
                                          ]
                                        },
                                        {
                                          "name" : "assighedAuthor",
                                          "source" : [
                                            {
                                              "context" : "authors",
                                              "element" : "assignedAuthor",
                                              "variable" : "assignedAuthor"
                                            }
                                          ],
                                          "target" : [
                                            {
                                              "context" : "bundle",
                                              "contextType" : "variable",
                                              "element" : "entry",
                                              "variable" : "e13"
                                            },
                                            {
                                              "context" : "e13",
                                              "contextType" : "variable",
                                              "element" : "request",
                                              "variable" : "request",
                                              "transform" : "create",
                                              "parameter" : [
                                                {
                                                  "valueString" : "BackboneElement"
                                                }
                                              ]
                                            },
                                            {
                                              "context" : "request",
                                              "contextType" : "variable",
                                              "element" : "method",
                                              "transform" : "copy",
                                              "parameter" : [
                                                {
                                                  "valueString" : "PUT"
                                                }
                                              ]
                                            },
                                            {
                                              "context" : "e13",
                                              "contextType" : "variable",
                                              "element" : "resource",
                                              "variable" : "practitioner",
                                              "transform" : "create",
                                              "parameter" : [
                                                {
                                                  "valueString" : "Practitioner"
                                                }
                                              ]
                                            }
                                          ],
                                          "rule" : [
                                            {
                                              "name" : "meta",
                                              "source" : [
                                                {
                                                  "context" : "assignedAuthor"
                                                }
                                              ],
                                              "target" : [
                                                {
                                                  "context" : "practitioner",
                                                  "contextType" : "variable",
                                                  "element" : "meta",
                                                  "variable" : "meta"
                                                }
                                              ],
                                              "rule" : [
                                                {
                                                  "name" : "coding",
                                                  "source" : [
                                                    {
                                                      "context" : "assignedAuthor"
                                                    }
                                                  ],
                                                  "target" : [
                                                    {
                                                      "context" : "meta",
                                                      "contextType" : "variable",
                                                      "element" : "tag",
                                                      "variable" : "coding",
                                                      "transform" : "create",
                                                      "parameter" : [
                                                        {
                                                          "valueString" : "Coding"
                                                        }
                                                      ]
                                                    }
                                                  ],
                                                  "rule" : [
                                                    {
                                                      "name" : "system",
                                                      "source" : [
                                                        {
                                                          "context" : "assignedAuthor"
                                                        }
                                                      ],
                                                      "target" : [
                                                        {
                                                          "context" : "coding",
                                                          "contextType" : "variable",
                                                          "element" : "system",
                                                          "transform" : "copy",
                                                          "parameter" : [
                                                            {
                                                              "valueString" : "http://algoritmodiscoring"
                                                            }
                                                          ]
                                                        }
                                                      ]
                                                    },
                                                    {
                                                      "name" : "code",
                                                      "source" : [
                                                        {
                                                          "context" : "assignedAuthor"
                                                        }
                                                      ],
                                                      "target" : [
                                                        {
                                                          "context" : "coding",
                                                          "contextType" : "variable",
                                                          "element" : "code",
                                                          "transform" : "copy",
                                                          "parameter" : [
                                                            {
                                                              "valueString" : "ClinicalDocument/body/Allergie/author"
                                                            }
                                                          ]
                                                        }
                                                      ]
                                                    }
                                                  ]
                                                }
                                              ]
                                            },
                                            {
                                              "name" : "identifier",
                                              "source" : [
                                                {
                                                  "context" : "assignedAuthor",
                                                  "element" : "id",
                                                  "variable" : "id"
                                                }
                                              ],
                                              "target" : [
                                                {
                                                  "context" : "practitioner",
                                                  "contextType" : "variable",
                                                  "element" : "identifier",
                                                  "variable" : "identifier"
                                                }
                                              ],
                                              "rule" : [
                                                {
                                                  "name" : "root1",
                                                  "source" : [
                                                    {
                                                      "context" : "id",
                                                      "element" : "root",
                                                      "variable" : "r"
                                                    }
                                                  ],
                                                  "target" : [
                                                    {
                                                      "context" : "identifier",
                                                      "contextType" : "variable",
                                                      "element" : "system",
                                                      "transform" : "translate",
                                                      "parameter" : [
                                                        {
                                                          "valueId" : "r"
                                                        },
                                                        {
                                                          "valueString" : "http://hl7.org/fhir/ConceptMap/special-oid2uri"
                                                        },
                                                        {
                                                          "valueString" : "uri"
                                                        }
                                                      ]
                                                    }
                                                  ]
                                                },
                                                {
                                                  "name" : "extension",
                                                  "source" : [
                                                    {
                                                      "context" : "id",
                                                      "element" : "extension",
                                                      "variable" : "ext"
                                                    }
                                                  ],
                                                  "target" : [
                                                    {
                                                      "context" : "identifier",
                                                      "contextType" : "variable",
                                                      "element" : "value",
                                                      "transform" : "copy",
                                                      "parameter" : [
                                                        {
                                                          "valueId" : "ext"
                                                        }
                                                      ]
                                                    }
                                                  ]
                                                },
                                                {
                                                  "name" : "assigningAuthorityName",
                                                  "source" : [
                                                    {
                                                      "context" : "id",
                                                      "element" : "assigningAuthorityName",
                                                      "variable" : "s"
                                                    }
                                                  ],
                                                  "target" : [
                                                    {
                                                      "context" : "identifier",
                                                      "contextType" : "variable",
                                                      "element" : "assigner",
                                                      "variable" : "a"
                                                    },
                                                    {
                                                      "context" : "a",
                                                      "contextType" : "variable",
                                                      "element" : "display",
                                                      "transform" : "copy",
                                                      "parameter" : [
                                                        {
                                                          "valueId" : "s"
                                                        }
                                                      ]
                                                    }
                                                  ]
                                                },
                                                {
                                                  "name" : "r",
                                                  "source" : [
                                                    {
                                                      "context" : "id",
                                                      "element" : "root",
                                                      "variable" : "r"
                                                    }
                                                  ],
                                                  "rule" : [
                                                    {
                                                      "name" : "extension",
                                                      "source" : [
                                                        {
                                                          "context" : "id",
                                                          "element" : "extension",
                                                          "variable" : "ext"
                                                        }
                                                      ],
                                                      "target" : [
                                                        {
                                                          "context" : "practitioner",
                                                          "contextType" : "variable",
                                                          "element" : "id",
                                                          "variable" : "uuid13",
                                                          "transform" : "evaluate",
                                                          "parameter" : [
                                                            {
                                                              "valueString" : "r + '-' + ext"
                                                            }
                                                          ]
                                                        },
                                                        {
                                                          "context" : "e13",
                                                          "contextType" : "variable",
                                                          "element" : "fullUrl",
                                                          "transform" : "append",
                                                          "parameter" : [
                                                            {
                                                              "valueString" : "https://example/Practitioner/"
                                                            },
                                                            {
                                                              "valueId" : "uuid13"
                                                            }
                                                          ]
                                                        },
                                                        {
                                                          "context" : "request",
                                                          "contextType" : "variable",
                                                          "element" : "url",
                                                          "transform" : "append",
                                                          "parameter" : [
                                                            {
                                                              "valueString" : "Practitioner/"
                                                            },
                                                            {
                                                              "valueId" : "uuid13"
                                                            }
                                                          ]
                                                        },
                                                        {
                                                          "context" : "note",
                                                          "contextType" : "variable",
                                                          "element" : "author",
                                                          "variable" : "reference",
                                                          "transform" : "create",
                                                          "parameter" : [
                                                            {
                                                              "valueString" : "Reference"
                                                            }
                                                          ]
                                                        },
                                                        {
                                                          "context" : "reference",
                                                          "contextType" : "variable",
                                                          "element" : "reference",
                                                          "transform" : "evaluate",
                                                          "parameter" : [
                                                            {
                                                              "valueString" : "'https://example/Practitioner/' + %practitioner.id"
                                                            }
                                                          ]
                                                        }
                                                      ]
                                                    }
                                                  ]
                                                }
                                              ]
                                            },
                                            {
                                              "name" : "2.16.840.1.113883.2.9.4.3.2",
                                              "source" : [
                                                {
                                                  "context" : "assignedAuthor",
                                                  "element" : "id",
                                                  "variable" : "id",
                                                  "condition" : "(root = '2.16.840.1.113883.2.9.4.3.2')"
                                                }
                                              ],
                                              "rule" : [
                                                {
                                                  "name" : "UUID",
                                                  "source" : [
                                                    {
                                                      "context" : "id",
                                                      "element" : "extension",
                                                      "variable" : "ext"
                                                    }
                                                  ],
                                                  "target" : [
                                                    {
                                                      "context" : "request",
                                                      "contextType" : "variable",
                                                      "element" : "url",
                                                      "transform" : "append",
                                                      "parameter" : [
                                                        {
                                                          "valueString" : "Practitioner?identifier="
                                                        },
                                                        {
                                                          "valueId" : "ext"
                                                        }
                                                      ]
                                                    }
                                                  ]
                                                }
                                              ]
                                            },
                                            {
                                              "name" : "assignedPerson",
                                              "source" : [
                                                {
                                                  "context" : "assignedAuthor",
                                                  "element" : "assignedPerson",
                                                  "variable" : "person"
                                                }
                                              ],
                                              "rule" : [
                                                {
                                                  "name" : "name",
                                                  "source" : [
                                                    {
                                                      "context" : "person",
                                                      "element" : "name",
                                                      "variable" : "vvv"
                                                    }
                                                  ],
                                                  "target" : [
                                                    {
                                                      "context" : "practitioner",
                                                      "contextType" : "variable",
                                                      "element" : "name",
                                                      "variable" : "vvv",
                                                      "transform" : "create"
                                                    }
                                                  ]
                                                }
                                              ]
                                            }
                                          ]
                                        }
                                      ]
                                    }
                                  ],
                                  "documentation" : "mapping note"
                                },
                                {
                                  "name" : "entryrelationshipact",
                                  "source" : [
                                    {
                                      "context" : "actallint",
                                      "element" : "entryRelationship",
                                      "variable" : "entryact"
                                    }
                                  ],
                                  "rule" : [
                                    {
                                      "name" : "entryobservation",
                                      "source" : [
                                        {
                                          "context" : "entryact",
                                          "element" : "observation",
                                          "variable" : "entryobs"
                                        }
                                      ],
                                      "rule" : [
                                        {
                                          "name" : "code",
                                          "source" : [
                                            {
                                              "context" : "entryobs",
                                              "element" : "value",
                                              "variable" : "code"
                                            }
                                          ],
                                          "rule" : [
                                            {
                                              "name" : "type",
                                              "source" : [
                                                {
                                                  "context" : "code",
                                                  "element" : "code",
                                                  "variable" : "code1"
                                                }
                                              ],
                                              "target" : [
                                                {
                                                  "context" : "allergy",
                                                  "contextType" : "variable",
                                                  "element" : "type",
                                                  "transform" : "translate",
                                                  "parameter" : [
                                                    {
                                                      "valueId" : "code1"
                                                    },
                                                    {
                                                      "valueString" : "#AllergyTypeMap"
                                                    },
                                                    {
                                                      "valueString" : "code"
                                                    }
                                                  ]
                                                }
                                              ]
                                            },
                                            {
                                              "name" : "category",
                                              "source" : [
                                                {
                                                  "context" : "code",
                                                  "element" : "code",
                                                  "variable" : "code2"
                                                }
                                              ],
                                              "target" : [
                                                {
                                                  "context" : "allergy",
                                                  "contextType" : "variable",
                                                  "element" : "category",
                                                  "transform" : "translate",
                                                  "parameter" : [
                                                    {
                                                      "valueId" : "code2"
                                                    },
                                                    {
                                                      "valueString" : "#AllergyCategoryMap"
                                                    },
                                                    {
                                                      "valueString" : "code"
                                                    }
                                                  ]
                                                }
                                              ]
                                            }
                                          ]
                                        },
                                        {
                                          "name" : "participant",
                                          "source" : [
                                            {
                                              "context" : "entryobs",
                                              "element" : "participant",
                                              "variable" : "partic"
                                            }
                                          ],
                                          "rule" : [
                                            {
                                              "name" : "participantRole",
                                              "source" : [
                                                {
                                                  "context" : "partic",
                                                  "element" : "participantRole",
                                                  "variable" : "pratRole"
                                                }
                                              ],
                                              "rule" : [
                                                {
                                                  "name" : "playingEntity",
                                                  "source" : [
                                                    {
                                                      "context" : "pratRole",
                                                      "element" : "playingEntity",
                                                      "variable" : "pratent"
                                                    }
                                                  ],
                                                  "rule" : [
                                                    {
                                                      "name" : "reaction",
                                                      "source" : [
                                                        {
                                                          "context" : "pratent"
                                                        }
                                                      ],
                                                      "target" : [
                                                        {
                                                          "context" : "allergy",
                                                          "contextType" : "variable",
                                                          "element" : "reaction",
                                                          "variable" : "reaction",
                                                          "transform" : "create",
                                                          "parameter" : [
                                                            {
                                                              "valueString" : "BackboneElement"
                                                            }
                                                          ]
                                                        }
                                                      ],
                                                      "rule" : [
                                                        {
                                                          "name" : "subs",
                                                          "source" : [
                                                            {
                                                              "context" : "pratent",
                                                              "element" : "code",
                                                              "variable" : "vvv"
                                                            }
                                                          ],
                                                          "target" : [
                                                            {
                                                              "context" : "reaction",
                                                              "contextType" : "variable",
                                                              "element" : "substance",
                                                              "variable" : "vvv",
                                                              "transform" : "create"
                                                            }
                                                          ]
                                                        },
                                                        {
                                                          "name" : "entryRelationship",
                                                          "source" : [
                                                            {
                                                              "context" : "entryobs",
                                                              "element" : "entryRelationship",
                                                              "variable" : "entryobs1",
                                                              "condition" : "(typeCode = 'MFST')"
                                                            }
                                                          ],
                                                          "rule" : [
                                                            {
                                                              "name" : "entryobservation",
                                                              "source" : [
                                                                {
                                                                  "context" : "entryobs1",
                                                                  "element" : "observation",
                                                                  "variable" : "entobs"
                                                                }
                                                              ],
                                                              "rule" : [
                                                                {
                                                                  "name" : "eff",
                                                                  "source" : [
                                                                    {
                                                                      "context" : "entobs",
                                                                      "element" : "effectiveTime",
                                                                      "variable" : "eff"
                                                                    }
                                                                  ],
                                                                  "rule" : [
                                                                    {
                                                                      "name" : "low",
                                                                      "source" : [
                                                                        {
                                                                          "context" : "eff",
                                                                          "element" : "low",
                                                                          "variable" : "l"
                                                                        }
                                                                      ],
                                                                      "target" : [
                                                                        {
                                                                          "context" : "reaction",
                                                                          "contextType" : "variable",
                                                                          "element" : "onset",
                                                                          "variable" : "value",
                                                                          "transform" : "create",
                                                                          "parameter" : [
                                                                            {
                                                                              "valueString" : "dateTime"
                                                                            }
                                                                          ]
                                                                        }
                                                                      ],
                                                                      "dependent" : [
                                                                        {
                                                                          "name" : "TSDateTime",
                                                                          "variable" : [
                                                                            "l",
                                                                            "value"
                                                                          ]
                                                                        }
                                                                      ]
                                                                    }
                                                                  ]
                                                                },
                                                                {
                                                                  "name" : "manifest",
                                                                  "source" : [
                                                                    {
                                                                      "context" : "entobs",
                                                                      "element" : "value",
                                                                      "variable" : "vvv"
                                                                    }
                                                                  ],
                                                                  "target" : [
                                                                    {
                                                                      "context" : "reaction",
                                                                      "contextType" : "variable",
                                                                      "element" : "manifestation",
                                                                      "variable" : "vvv",
                                                                      "transform" : "create"
                                                                    }
                                                                  ]
                                                                }
                                                              ]
                                                            }
                                                          ]
                                                        }
                                                      ]
                                                    }
                                                  ]
                                                }
                                              ]
                                            }
                                          ]
                                        },
                                        {
                                          "name" : "entryrelationship2",
                                          "source" : [
                                            {
                                              "context" : "entryobs",
                                              "element" : "entryRelationship",
                                              "variable" : "entryobs2"
                                            }
                                          ],
                                          "rule" : [
                                            {
                                              "name" : "entryobservation2",
                                              "source" : [
                                                {
                                                  "context" : "entryobs2",
                                                  "element" : "observation",
                                                  "variable" : "entobs"
                                                }
                                              ],
                                              "rule" : [
                                                {
                                                  "name" : "severity",
                                                  "source" : [
                                                    {
                                                      "context" : "entobs",
                                                      "element" : "code",
                                                      "variable" : "code",
                                                      "condition" : "(code = 'SEV')"
                                                    }
                                                  ],
                                                  "rule" : [
                                                    {
                                                      "name" : "value",
                                                      "source" : [
                                                        {
                                                          "context" : "entobs",
                                                          "element" : "value",
                                                          "variable" : "value"
                                                        }
                                                      ],
                                                      "rule" : [
                                                        {
                                                          "name" : "active",
                                                          "source" : [
                                                            {
                                                              "context" : "value",
                                                              "element" : "code",
                                                              "condition" : "(value.code = 'M')"
                                                            }
                                                          ],
                                                          "target" : [
                                                            {
                                                              "context" : "allergy",
                                                              "contextType" : "variable",
                                                              "element" : "criticality",
                                                              "transform" : "copy",
                                                              "parameter" : [
                                                                {
                                                                  "valueString" : "unable-to-assess"
                                                                }
                                                              ]
                                                            }
                                                          ]
                                                        },
                                                        {
                                                          "name" : "active",
                                                          "source" : [
                                                            {
                                                              "context" : "value",
                                                              "element" : "code",
                                                              "condition" : "(value.code = 'L')"
                                                            }
                                                          ],
                                                          "target" : [
                                                            {
                                                              "context" : "allergy",
                                                              "contextType" : "variable",
                                                              "element" : "criticality",
                                                              "transform" : "copy",
                                                              "parameter" : [
                                                                {
                                                                  "valueString" : "low"
                                                                }
                                                              ]
                                                            }
                                                          ]
                                                        },
                                                        {
                                                          "name" : "active",
                                                          "source" : [
                                                            {
                                                              "context" : "value",
                                                              "element" : "code",
                                                              "condition" : "(value.code = 'H')"
                                                            }
                                                          ],
                                                          "target" : [
                                                            {
                                                              "context" : "allergy",
                                                              "contextType" : "variable",
                                                              "element" : "criticality",
                                                              "transform" : "copy",
                                                              "parameter" : [
                                                                {
                                                                  "valueString" : "high"
                                                                }
                                                              ]
                                                            }
                                                          ]
                                                        }
                                                      ]
                                                    }
                                                  ]
                                                }
                                              ]
                                            }
                                          ]
                                        },
                                        {
                                          "name" : "entryrelationship3",
                                          "source" : [
                                            {
                                              "context" : "entryobs",
                                              "element" : "entryRelationship",
                                              "variable" : "entryobs3"
                                            }
                                          ],
                                          "rule" : [
                                            {
                                              "name" : "entryobservation3",
                                              "source" : [
                                                {
                                                  "context" : "entryobs3",
                                                  "element" : "observation",
                                                  "variable" : "entobs"
                                                }
                                              ],
                                              "rule" : [
                                                {
                                                  "name" : "33999-4",
                                                  "source" : [
                                                    {
                                                      "context" : "entobs",
                                                      "element" : "code",
                                                      "variable" : "code",
                                                      "condition" : "(code = '33999-4')"
                                                    }
                                                  ],
                                                  "rule" : [
                                                    {
                                                      "name" : "clinicalStatus",
                                                      "source" : [
                                                        {
                                                          "context" : "entobs"
                                                        }
                                                      ],
                                                      "target" : [
                                                        {
                                                          "context" : "allergy",
                                                          "contextType" : "variable",
                                                          "element" : "clinicalStatus",
                                                          "variable" : "status",
                                                          "transform" : "create",
                                                          "parameter" : [
                                                            {
                                                              "valueString" : "CodeableConcept"
                                                            }
                                                          ]
                                                        }
                                                      ],
                                                      "rule" : [
                                                        {
                                                          "name" : "coding",
                                                          "source" : [
                                                            {
                                                              "context" : "entobs"
                                                            }
                                                          ],
                                                          "target" : [
                                                            {
                                                              "context" : "status",
                                                              "contextType" : "variable",
                                                              "element" : "coding",
                                                              "variable" : "coding",
                                                              "transform" : "create",
                                                              "parameter" : [
                                                                {
                                                                  "valueString" : "Coding"
                                                                }
                                                              ]
                                                            }
                                                          ],
                                                          "rule" : [
                                                            {
                                                              "name" : "value1",
                                                              "source" : [
                                                                {
                                                                  "context" : "entobs",
                                                                  "element" : "value",
                                                                  "variable" : "value"
                                                                }
                                                              ],
                                                              "rule" : [
                                                                {
                                                                  "name" : "active",
                                                                  "source" : [
                                                                    {
                                                                      "context" : "value",
                                                                      "element" : "code",
                                                                      "condition" : "(value.code = 'LA16666-2')"
                                                                    }
                                                                  ],
                                                                  "target" : [
                                                                    {
                                                                      "context" : "coding",
                                                                      "contextType" : "variable",
                                                                      "element" : "code",
                                                                      "transform" : "copy",
                                                                      "parameter" : [
                                                                        {
                                                                          "valueString" : "active"
                                                                        }
                                                                      ]
                                                                    }
                                                                  ]
                                                                },
                                                                {
                                                                  "name" : "active",
                                                                  "source" : [
                                                                    {
                                                                      "context" : "value",
                                                                      "element" : "code",
                                                                      "condition" : "(value.code = 'LA18632-2')"
                                                                    }
                                                                  ],
                                                                  "target" : [
                                                                    {
                                                                      "context" : "coding",
                                                                      "contextType" : "variable",
                                                                      "element" : "code",
                                                                      "transform" : "copy",
                                                                      "parameter" : [
                                                                        {
                                                                          "valueString" : "inactive"
                                                                        }
                                                                      ]
                                                                    }
                                                                  ]
                                                                },
                                                                {
                                                                  "name" : "system",
                                                                  "source" : [
                                                                    {
                                                                      "context" : "value",
                                                                      "element" : "codeSystem",
                                                                      "variable" : "system"
                                                                    }
                                                                  ],
                                                                  "target" : [
                                                                    {
                                                                      "context" : "coding",
                                                                      "contextType" : "variable",
                                                                      "element" : "system",
                                                                      "transform" : "copy",
                                                                      "parameter" : [
                                                                        {
                                                                          "valueString" : "http://terminology.hl7.org/CodeSystem/allergyintolerance-clinical"
                                                                        }
                                                                      ]
                                                                    }
                                                                  ]
                                                                },
                                                                {
                                                                  "name" : "displayName",
                                                                  "source" : [
                                                                    {
                                                                      "context" : "value",
                                                                      "element" : "displayName",
                                                                      "variable" : "display"
                                                                    }
                                                                  ],
                                                                  "target" : [
                                                                    {
                                                                      "context" : "coding",
                                                                      "contextType" : "variable",
                                                                      "element" : "display",
                                                                      "transform" : "cast",
                                                                      "parameter" : [
                                                                        {
                                                                          "valueId" : "display"
                                                                        },
                                                                        {
                                                                          "valueString" : "string"
                                                                        }
                                                                      ]
                                                                    }
                                                                  ],
                                                                  "documentation" : "value->coding.version='ConditionClinicalStatusCodes 4.0.1'\"version\";"
                                                                }
                                                              ]
                                                            }
                                                          ]
                                                        }
                                                      ],
                                                      "documentation" : "entobs.value->allergy.clinicalStatus \"cstatus\";"
                                                    }
                                                  ]
                                                }
                                              ]
                                            }
                                          ]
                                        },
                                        {
                                          "name" : "entryrelationshi4",
                                          "source" : [
                                            {
                                              "context" : "entryobs",
                                              "element" : "entryRelationship",
                                              "variable" : "entryobs4"
                                            }
                                          ],
                                          "rule" : [
                                            {
                                              "name" : "entryact1",
                                              "source" : [
                                                {
                                                  "context" : "entryobs4",
                                                  "element" : "act",
                                                  "variable" : "entact"
                                                }
                                              ],
                                              "rule" : [
                                                {
                                                  "name" : "txtact",
                                                  "source" : [
                                                    {
                                                      "context" : "entact",
                                                      "element" : "text",
                                                      "variable" : "actext"
                                                    }
                                                  ],
                                                  "rule" : [
                                                    {
                                                      "name" : "notetxt",
                                                      "source" : [
                                                        {
                                                          "context" : "actext",
                                                          "element" : "reference",
                                                          "variable" : "reftxt"
                                                        }
                                                      ],
                                                      "target" : [
                                                        {
                                                          "context" : "allergy",
                                                          "contextType" : "variable",
                                                          "element" : "note",
                                                          "variable" : "note",
                                                          "transform" : "create",
                                                          "parameter" : [
                                                            {
                                                              "valueString" : "BackboneElement"
                                                            }
                                                          ]
                                                        }
                                                      ],
                                                      "rule" : [
                                                        {
                                                          "name" : "notxt",
                                                          "source" : [
                                                            {
                                                              "context" : "reftxt",
                                                              "variable" : "ref"
                                                            }
                                                          ],
                                                          "target" : [
                                                            {
                                                              "context" : "note",
                                                              "contextType" : "variable",
                                                              "element" : "text",
                                                              "transform" : "evaluate",
                                                              "parameter" : [
                                                                {
                                                                  "valueString" : "ref.value"
                                                                }
                                                              ]
                                                            }
                                                          ]
                                                        }
                                                      ]
                                                    }
                                                  ]
                                                }
                                              ]
                                            }
                                          ]
                                        }
                                      ]
                                    }
                                  ]
                                }
                              ]
                            }
                          ],
                          "documentation" : "Allergia Strutturata----------------------------------------------------------------------------------------------------------------------------------------"
                        }
                      ]
                    },
                    {
                      "name" : "code",
                      "source" : [
                        {
                          "context" : "sottosection",
                          "element" : "code",
                          "variable" : "vvv",
                          "condition" : "(code = '11450-4')"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "section",
                          "contextType" : "variable",
                          "element" : "code",
                          "variable" : "vvv",
                          "transform" : "create"
                        }
                      ],
                      "documentation" : "5. Problemi aperti"
                    },
                    {
                      "name" : "condizioneproblemiaperti",
                      "source" : [
                        {
                          "context" : "sottosection",
                          "element" : "code",
                          "variable" : "code1",
                          "condition" : "(code = '11450-4')"
                        }
                      ],
                      "rule" : [
                        {
                          "name" : "title",
                          "source" : [
                            {
                              "context" : "sottosection",
                              "element" : "title",
                              "variable" : "t"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "section",
                              "contextType" : "variable",
                              "element" : "title",
                              "transform" : "evaluate",
                              "parameter" : [
                                {
                                  "valueString" : "t.dataString"
                                }
                              ]
                            }
                          ]
                        },
                        {
                          "name" : "cdaText",
                          "source" : [
                            {
                              "context" : "sottosection",
                              "element" : "text",
                              "variable" : "cdaText"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "bundle",
                              "contextType" : "variable",
                              "element" : "entry",
                              "variable" : "e14"
                            },
                            {
                              "context" : "e14",
                              "contextType" : "variable",
                              "element" : "request",
                              "variable" : "request",
                              "transform" : "create",
                              "parameter" : [
                                {
                                  "valueString" : "BackboneElement"
                                }
                              ]
                            },
                            {
                              "context" : "request",
                              "contextType" : "variable",
                              "element" : "method",
                              "transform" : "copy",
                              "parameter" : [
                                {
                                  "valueString" : "POST"
                                }
                              ]
                            },
                            {
                              "context" : "e14",
                              "contextType" : "variable",
                              "element" : "resource",
                              "variable" : "condition",
                              "transform" : "create",
                              "parameter" : [
                                {
                                  "valueString" : "Condition"
                                }
                              ]
                            },
                            {
                              "context" : "condition",
                              "contextType" : "variable",
                              "element" : "id",
                              "variable" : "uuid14",
                              "transform" : "uuid"
                            },
                            {
                              "context" : "e14",
                              "contextType" : "variable",
                              "element" : "fullUrl",
                              "transform" : "append",
                              "parameter" : [
                                {
                                  "valueString" : "https://example/Condition/"
                                },
                                {
                                  "valueId" : "uuid14"
                                }
                              ]
                            },
                            {
                              "context" : "request",
                              "contextType" : "variable",
                              "element" : "url",
                              "transform" : "copy",
                              "parameter" : [
                                {
                                  "valueString" : "Condition"
                                }
                              ]
                            },
                            {
                              "context" : "section",
                              "contextType" : "variable",
                              "element" : "entry",
                              "variable" : "reference",
                              "transform" : "create",
                              "parameter" : [
                                {
                                  "valueString" : "Reference"
                                }
                              ]
                            },
                            {
                              "context" : "reference",
                              "contextType" : "variable",
                              "element" : "reference",
                              "transform" : "evaluate",
                              "parameter" : [
                                {
                                  "valueString" : "'https://example/Condition/' + %condition.id"
                                }
                              ]
                            }
                          ],
                          "rule" : [
                            {
                              "name" : "reference",
                              "source" : [
                                {
                                  "context" : "cdaText"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "condition",
                                  "contextType" : "variable",
                                  "element" : "subject",
                                  "variable" : "reference",
                                  "transform" : "create",
                                  "parameter" : [
                                    {
                                      "valueString" : "Reference"
                                    }
                                  ]
                                },
                                {
                                  "context" : "reference",
                                  "contextType" : "variable",
                                  "element" : "reference",
                                  "transform" : "evaluate",
                                  "parameter" : [
                                    {
                                      "valueString" : "'https://example/Patient/' + %patient.id"
                                    }
                                  ]
                                }
                              ]
                            },
                            {
                              "name" : "reference",
                              "source" : [
                                {
                                  "context" : "cdaText"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "condition",
                                  "contextType" : "variable",
                                  "element" : "encounter",
                                  "variable" : "reference",
                                  "transform" : "create",
                                  "parameter" : [
                                    {
                                      "valueString" : "Reference"
                                    }
                                  ]
                                },
                                {
                                  "context" : "reference",
                                  "contextType" : "variable",
                                  "element" : "reference",
                                  "transform" : "evaluate",
                                  "parameter" : [
                                    {
                                      "valueString" : "'https://example/Encounter/' + %enc.id"
                                    }
                                  ]
                                }
                              ]
                            },
                            {
                              "name" : "code",
                              "source" : [
                                {
                                  "context" : "sottosection",
                                  "element" : "code",
                                  "variable" : "vvv"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "condition",
                                  "contextType" : "variable",
                                  "element" : "code",
                                  "variable" : "vvv",
                                  "transform" : "create"
                                }
                              ]
                            },
                            {
                              "name" : "reference",
                              "source" : [
                                {
                                  "context" : "cdaText"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "condition",
                                  "contextType" : "variable",
                                  "element" : "note",
                                  "variable" : "note"
                                }
                              ],
                              "rule" : [
                                {
                                  "name" : "reference",
                                  "source" : [
                                    {
                                      "context" : "cdaText",
                                      "variable" : "t"
                                    }
                                  ],
                                  "target" : [
                                    {
                                      "context" : "note",
                                      "contextType" : "variable",
                                      "element" : "text",
                                      "transform" : "copy",
                                      "parameter" : [
                                        {
                                          "valueId" : "t"
                                        }
                                      ]
                                    }
                                  ]
                                },
                                {
                                  "name" : "author",
                                  "source" : [
                                    {
                                      "context" : "sottosection",
                                      "element" : "author",
                                      "variable" : "authors"
                                    }
                                  ],
                                  "rule" : [
                                    {
                                      "name" : "timeAuthor",
                                      "source" : [
                                        {
                                          "context" : "authors",
                                          "element" : "time",
                                          "variable" : "time"
                                        }
                                      ],
                                      "target" : [
                                        {
                                          "context" : "note",
                                          "contextType" : "variable",
                                          "element" : "time",
                                          "variable" : "value",
                                          "transform" : "create",
                                          "parameter" : [
                                            {
                                              "valueString" : "dateTime"
                                            }
                                          ]
                                        }
                                      ],
                                      "dependent" : [
                                        {
                                          "name" : "TSDateTime",
                                          "variable" : [
                                            "time",
                                            "value"
                                          ]
                                        }
                                      ]
                                    },
                                    {
                                      "name" : "assighedAuthor",
                                      "source" : [
                                        {
                                          "context" : "authors",
                                          "element" : "assignedAuthor",
                                          "variable" : "assignedAuthor"
                                        }
                                      ],
                                      "target" : [
                                        {
                                          "context" : "bundle",
                                          "contextType" : "variable",
                                          "element" : "entry",
                                          "variable" : "e15"
                                        },
                                        {
                                          "context" : "e15",
                                          "contextType" : "variable",
                                          "element" : "request",
                                          "variable" : "request",
                                          "transform" : "create",
                                          "parameter" : [
                                            {
                                              "valueString" : "BackboneElement"
                                            }
                                          ]
                                        },
                                        {
                                          "context" : "request",
                                          "contextType" : "variable",
                                          "element" : "method",
                                          "transform" : "copy",
                                          "parameter" : [
                                            {
                                              "valueString" : "PUT"
                                            }
                                          ]
                                        },
                                        {
                                          "context" : "e15",
                                          "contextType" : "variable",
                                          "element" : "resource",
                                          "variable" : "practitioner",
                                          "transform" : "create",
                                          "parameter" : [
                                            {
                                              "valueString" : "Practitioner"
                                            }
                                          ]
                                        }
                                      ],
                                      "rule" : [
                                        {
                                          "name" : "meta",
                                          "source" : [
                                            {
                                              "context" : "assignedAuthor"
                                            }
                                          ],
                                          "target" : [
                                            {
                                              "context" : "practitioner",
                                              "contextType" : "variable",
                                              "element" : "meta",
                                              "variable" : "meta"
                                            }
                                          ],
                                          "rule" : [
                                            {
                                              "name" : "coding",
                                              "source" : [
                                                {
                                                  "context" : "assignedAuthor"
                                                }
                                              ],
                                              "target" : [
                                                {
                                                  "context" : "meta",
                                                  "contextType" : "variable",
                                                  "element" : "tag",
                                                  "variable" : "coding",
                                                  "transform" : "create",
                                                  "parameter" : [
                                                    {
                                                      "valueString" : "Coding"
                                                    }
                                                  ]
                                                }
                                              ],
                                              "rule" : [
                                                {
                                                  "name" : "system",
                                                  "source" : [
                                                    {
                                                      "context" : "assignedAuthor"
                                                    }
                                                  ],
                                                  "target" : [
                                                    {
                                                      "context" : "coding",
                                                      "contextType" : "variable",
                                                      "element" : "system",
                                                      "transform" : "copy",
                                                      "parameter" : [
                                                        {
                                                          "valueString" : "http://algoritmodiscoring"
                                                        }
                                                      ]
                                                    }
                                                  ]
                                                },
                                                {
                                                  "name" : "code",
                                                  "source" : [
                                                    {
                                                      "context" : "assignedAuthor"
                                                    }
                                                  ],
                                                  "target" : [
                                                    {
                                                      "context" : "coding",
                                                      "contextType" : "variable",
                                                      "element" : "code",
                                                      "transform" : "copy",
                                                      "parameter" : [
                                                        {
                                                          "valueString" : "ClinicalDocument/body/ProblemiAperti/author"
                                                        }
                                                      ]
                                                    }
                                                  ]
                                                }
                                              ]
                                            }
                                          ]
                                        },
                                        {
                                          "name" : "identifier",
                                          "source" : [
                                            {
                                              "context" : "assignedAuthor",
                                              "element" : "id",
                                              "variable" : "id"
                                            }
                                          ],
                                          "target" : [
                                            {
                                              "context" : "practitioner",
                                              "contextType" : "variable",
                                              "element" : "identifier",
                                              "variable" : "identifier"
                                            }
                                          ],
                                          "rule" : [
                                            {
                                              "name" : "root1",
                                              "source" : [
                                                {
                                                  "context" : "id",
                                                  "element" : "root",
                                                  "variable" : "r"
                                                }
                                              ],
                                              "target" : [
                                                {
                                                  "context" : "identifier",
                                                  "contextType" : "variable",
                                                  "element" : "system",
                                                  "transform" : "translate",
                                                  "parameter" : [
                                                    {
                                                      "valueId" : "r"
                                                    },
                                                    {
                                                      "valueString" : "http://hl7.org/fhir/ConceptMap/special-oid2uri"
                                                    },
                                                    {
                                                      "valueString" : "uri"
                                                    }
                                                  ]
                                                }
                                              ]
                                            },
                                            {
                                              "name" : "extension",
                                              "source" : [
                                                {
                                                  "context" : "id",
                                                  "element" : "extension",
                                                  "variable" : "ext"
                                                }
                                              ],
                                              "target" : [
                                                {
                                                  "context" : "identifier",
                                                  "contextType" : "variable",
                                                  "element" : "value",
                                                  "transform" : "copy",
                                                  "parameter" : [
                                                    {
                                                      "valueId" : "ext"
                                                    }
                                                  ]
                                                }
                                              ]
                                            },
                                            {
                                              "name" : "assigningAuthorityName",
                                              "source" : [
                                                {
                                                  "context" : "id",
                                                  "element" : "assigningAuthorityName",
                                                  "variable" : "s"
                                                }
                                              ],
                                              "target" : [
                                                {
                                                  "context" : "identifier",
                                                  "contextType" : "variable",
                                                  "element" : "assigner",
                                                  "variable" : "a"
                                                },
                                                {
                                                  "context" : "a",
                                                  "contextType" : "variable",
                                                  "element" : "display",
                                                  "transform" : "copy",
                                                  "parameter" : [
                                                    {
                                                      "valueId" : "s"
                                                    }
                                                  ]
                                                }
                                              ]
                                            },
                                            {
                                              "name" : "r",
                                              "source" : [
                                                {
                                                  "context" : "id",
                                                  "element" : "root",
                                                  "variable" : "r"
                                                }
                                              ],
                                              "rule" : [
                                                {
                                                  "name" : "aut",
                                                  "source" : [
                                                    {
                                                      "context" : "id",
                                                      "element" : "extension",
                                                      "variable" : "ext"
                                                    }
                                                  ],
                                                  "target" : [
                                                    {
                                                      "context" : "practitioner",
                                                      "contextType" : "variable",
                                                      "element" : "id",
                                                      "variable" : "uuid15",
                                                      "transform" : "evaluate",
                                                      "parameter" : [
                                                        {
                                                          "valueString" : "r + '-' + ext"
                                                        }
                                                      ]
                                                    },
                                                    {
                                                      "context" : "e15",
                                                      "contextType" : "variable",
                                                      "element" : "fullUrl",
                                                      "transform" : "append",
                                                      "parameter" : [
                                                        {
                                                          "valueString" : "https://example/Practitioner/"
                                                        },
                                                        {
                                                          "valueId" : "uuid15"
                                                        }
                                                      ]
                                                    },
                                                    {
                                                      "context" : "request",
                                                      "contextType" : "variable",
                                                      "element" : "url",
                                                      "transform" : "append",
                                                      "parameter" : [
                                                        {
                                                          "valueString" : "Practitioner/"
                                                        },
                                                        {
                                                          "valueId" : "uuid15"
                                                        }
                                                      ]
                                                    },
                                                    {
                                                      "context" : "note",
                                                      "contextType" : "variable",
                                                      "element" : "author",
                                                      "variable" : "reference",
                                                      "transform" : "create",
                                                      "parameter" : [
                                                        {
                                                          "valueString" : "Reference"
                                                        }
                                                      ]
                                                    },
                                                    {
                                                      "context" : "reference",
                                                      "contextType" : "variable",
                                                      "element" : "reference",
                                                      "transform" : "evaluate",
                                                      "parameter" : [
                                                        {
                                                          "valueString" : "'https://example/Practitioner/' + %practitioner.id"
                                                        }
                                                      ]
                                                    }
                                                  ]
                                                }
                                              ]
                                            }
                                          ]
                                        },
                                        {
                                          "name" : "2.16.840.1.113883.2.9.4.3.2",
                                          "source" : [
                                            {
                                              "context" : "assignedAuthor",
                                              "element" : "id",
                                              "variable" : "id",
                                              "condition" : "(root = '2.16.840.1.113883.2.9.4.3.2')"
                                            }
                                          ],
                                          "rule" : [
                                            {
                                              "name" : "UUID",
                                              "source" : [
                                                {
                                                  "context" : "id",
                                                  "element" : "extension",
                                                  "variable" : "ext"
                                                }
                                              ],
                                              "target" : [
                                                {
                                                  "context" : "request",
                                                  "contextType" : "variable",
                                                  "element" : "url",
                                                  "transform" : "append",
                                                  "parameter" : [
                                                    {
                                                      "valueString" : "Practitioner?identifier="
                                                    },
                                                    {
                                                      "valueId" : "ext"
                                                    }
                                                  ]
                                                }
                                              ]
                                            }
                                          ]
                                        },
                                        {
                                          "name" : "assignedPerson",
                                          "source" : [
                                            {
                                              "context" : "assignedAuthor",
                                              "element" : "assignedPerson",
                                              "variable" : "person"
                                            }
                                          ],
                                          "rule" : [
                                            {
                                              "name" : "name",
                                              "source" : [
                                                {
                                                  "context" : "person",
                                                  "element" : "name",
                                                  "variable" : "vvv"
                                                }
                                              ],
                                              "target" : [
                                                {
                                                  "context" : "practitioner",
                                                  "contextType" : "variable",
                                                  "element" : "name",
                                                  "variable" : "vvv",
                                                  "transform" : "create"
                                                }
                                              ]
                                            }
                                          ]
                                        }
                                      ]
                                    }
                                  ]
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ],
          "documentation" : "START sottosections"
        }
      ]
    },
    {
      "name" : "Act",
      "typeMode" : "none",
      "documentation" : "______2._____________ClinicalStatements________________________",
      "input" : [
        {
          "name" : "cda",
          "type" : "Act",
          "mode" : "source"
        },
        {
          "name" : "pat",
          "type" : "Patient",
          "mode" : "target"
        },
        {
          "name" : "enc",
          "type" : "Encounter",
          "mode" : "target"
        },
        {
          "name" : "bundle",
          "type" : "Bundle",
          "mode" : "target"
        }
      ],
      "rule" : [
        {
          "name" : "code",
          "source" : [
            {
              "context" : "cda",
              "element" : "code",
              "variable" : "code"
            }
          ],
          "target" : [
            {
              "context" : "enc",
              "contextType" : "variable",
              "element" : "extension",
              "variable" : "extension2"
            }
          ],
          "dependent" : [
            {
              "name" : "modeOfArrival",
              "variable" : [
                "code",
                "extension2"
              ]
            }
          ]
        },
        {
          "name" : "participant",
          "source" : [
            {
              "context" : "cda",
              "element" : "participant",
              "variable" : "participant"
            }
          ],
          "rule" : [
            {
              "name" : "fhirParticipant",
              "source" : [
                {
                  "context" : "participant"
                }
              ],
              "target" : [
                {
                  "context" : "enc",
                  "contextType" : "variable",
                  "element" : "participant",
                  "variable" : "FhirParticipant"
                }
              ],
              "rule" : [
                {
                  "name" : "type",
                  "source" : [
                    {
                      "context" : "participant",
                      "variable" : "p"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "FhirParticipant",
                      "contextType" : "variable",
                      "element" : "type",
                      "variable" : "type"
                    }
                  ],
                  "rule" : [
                    {
                      "name" : "codeType",
                      "source" : [
                        {
                          "context" : "p"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "type",
                          "contextType" : "variable",
                          "element" : "coding",
                          "variable" : "coding"
                        }
                      ],
                      "rule" : [
                        {
                          "name" : "codice",
                          "source" : [
                            {
                              "context" : "p"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "coding",
                              "contextType" : "variable",
                              "element" : "code",
                              "transform" : "evaluate",
                              "parameter" : [
                                {
                                  "valueString" : "p.typeCode"
                                }
                              ]
                            }
                          ]
                        },
                        {
                          "name" : "system",
                          "source" : [
                            {
                              "context" : "p"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "coding",
                              "contextType" : "variable",
                              "element" : "system",
                              "transform" : "copy",
                              "parameter" : [
                                {
                                  "valueString" : "http://terminology.hl7.org/CodeSystem/v3-ParticipationType"
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "name" : "participantrole",
              "source" : [
                {
                  "context" : "participant",
                  "element" : "participantRole",
                  "variable" : "participantRole"
                }
              ],
              "target" : [
                {
                  "context" : "bundle",
                  "contextType" : "variable",
                  "element" : "entry",
                  "variable" : "e1"
                },
                {
                  "context" : "e1",
                  "contextType" : "variable",
                  "element" : "request",
                  "variable" : "request",
                  "transform" : "create",
                  "parameter" : [
                    {
                      "valueString" : "BackboneElement"
                    }
                  ]
                },
                {
                  "context" : "request",
                  "contextType" : "variable",
                  "element" : "method",
                  "transform" : "copy",
                  "parameter" : [
                    {
                      "valueString" : "POST"
                    }
                  ]
                },
                {
                  "context" : "e1",
                  "contextType" : "variable",
                  "element" : "resource",
                  "variable" : "practitionerRole",
                  "transform" : "create",
                  "parameter" : [
                    {
                      "valueString" : "PractitionerRole"
                    }
                  ]
                },
                {
                  "context" : "practitionerRole",
                  "contextType" : "variable",
                  "element" : "id",
                  "variable" : "uuid1",
                  "transform" : "uuid"
                },
                {
                  "context" : "e1",
                  "contextType" : "variable",
                  "element" : "fullUrl",
                  "transform" : "append",
                  "parameter" : [
                    {
                      "valueString" : "https://example/PractitionerRole/"
                    },
                    {
                      "valueId" : "uuid1"
                    }
                  ]
                },
                {
                  "context" : "request",
                  "contextType" : "variable",
                  "element" : "url",
                  "transform" : "copy",
                  "parameter" : [
                    {
                      "valueString" : "PractitionerRole"
                    }
                  ]
                },
                {
                  "context" : "enc",
                  "contextType" : "variable",
                  "element" : "participant",
                  "variable" : "participant1",
                  "transform" : "create",
                  "parameter" : [
                    {
                      "valueString" : "BackboneElement"
                    }
                  ]
                },
                {
                  "context" : "participant1",
                  "contextType" : "variable",
                  "element" : "individual",
                  "variable" : "referencepart",
                  "transform" : "create",
                  "parameter" : [
                    {
                      "valueString" : "Reference"
                    }
                  ]
                },
                {
                  "context" : "referencepart",
                  "contextType" : "variable",
                  "element" : "reference",
                  "transform" : "evaluate",
                  "parameter" : [
                    {
                      "valueString" : "'https://example/PractitionerRole/' + %practitionerRole.id"
                    }
                  ]
                }
              ],
              "rule" : [
                {
                  "name" : "code",
                  "source" : [
                    {
                      "context" : "participantRole",
                      "element" : "code",
                      "variable" : "vvv"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "practitionerRole",
                      "contextType" : "variable",
                      "element" : "code",
                      "variable" : "vvv",
                      "transform" : "create"
                    }
                  ]
                }
              ]
            }
          ]
        }
      ]
    },
    {
      "name" : "modeOfArrival",
      "typeMode" : "none",
      "documentation" : "______3._____________Extensions_DtType________________________",
      "input" : [
        {
          "name" : "src",
          "type" : "CE",
          "mode" : "source"
        },
        {
          "name" : "ext",
          "type" : "Extension",
          "mode" : "target"
        }
      ],
      "rule" : [
        {
          "name" : "url",
          "source" : [
            {
              "context" : "src"
            }
          ],
          "target" : [
            {
              "context" : "ext",
              "contextType" : "variable",
              "element" : "url",
              "transform" : "copy",
              "parameter" : [
                {
                  "valueString" : "http://hl7.org/fhir/StructureDefinition/encounter-modeOfArrival"
                }
              ]
            }
          ]
        },
        {
          "name" : "coding",
          "source" : [
            {
              "context" : "src"
            }
          ],
          "target" : [
            {
              "context" : "ext",
              "contextType" : "variable",
              "element" : "value",
              "variable" : "code1",
              "transform" : "create",
              "parameter" : [
                {
                  "valueString" : "Coding"
                }
              ]
            }
          ],
          "dependent" : [
            {
              "name" : "coding",
              "variable" : [
                "src",
                "code1"
              ]
            }
          ]
        }
      ]
    },
    {
      "name" : "coding",
      "typeMode" : "none",
      "input" : [
        {
          "name" : "src",
          "type" : "CE",
          "mode" : "source"
        },
        {
          "name" : "tgt",
          "type" : "Coding",
          "mode" : "target"
        }
      ],
      "rule" : [
        {
          "name" : "code",
          "source" : [
            {
              "context" : "src",
              "element" : "code",
              "variable" : "code"
            }
          ],
          "target" : [
            {
              "context" : "tgt",
              "contextType" : "variable",
              "element" : "code",
              "transform" : "cast",
              "parameter" : [
                {
                  "valueId" : "code"
                },
                {
                  "valueString" : "string"
                }
              ]
            }
          ]
        },
        {
          "name" : "codeSystem",
          "source" : [
            {
              "context" : "src",
              "element" : "codeSystem",
              "variable" : "system"
            }
          ],
          "target" : [
            {
              "context" : "tgt",
              "contextType" : "variable",
              "element" : "system",
              "transform" : "translate",
              "parameter" : [
                {
                  "valueId" : "system"
                },
                {
                  "valueString" : "http://hl7.org/fhir/ConceptMap/special-oid2uri"
                },
                {
                  "valueString" : "uri"
                }
              ]
            }
          ]
        },
        {
          "name" : "displayName",
          "source" : [
            {
              "context" : "src",
              "element" : "displayName",
              "variable" : "display"
            }
          ],
          "target" : [
            {
              "context" : "tgt",
              "contextType" : "variable",
              "element" : "display",
              "transform" : "cast",
              "parameter" : [
                {
                  "valueId" : "display"
                },
                {
                  "valueString" : "string"
                }
              ]
            }
          ]
        },
        {
          "name" : "codeSystemVersion",
          "source" : [
            {
              "context" : "src",
              "element" : "codeSystemVersion",
              "variable" : "version"
            }
          ],
          "target" : [
            {
              "context" : "tgt",
              "contextType" : "variable",
              "element" : "version",
              "transform" : "cast",
              "parameter" : [
                {
                  "valueId" : "version"
                },
                {
                  "valueString" : "string"
                }
              ]
            }
          ]
        }
      ]
    },
    {
      "name" : "periodTiming",
      "typeMode" : "none",
      "input" : [
        {
          "name" : "effectiveTime",
          "type" : "PIVL_TS",
          "mode" : "source"
        },
        {
          "name" : "timing",
          "type" : "Timing",
          "mode" : "target"
        }
      ],
      "rule" : [
        {
          "name" : "repeat",
          "source" : [
            {
              "context" : "effectiveTime"
            }
          ],
          "target" : [
            {
              "context" : "timing",
              "contextType" : "variable",
              "element" : "repeat",
              "variable" : "r"
            }
          ],
          "rule" : [
            {
              "name" : "period",
              "source" : [
                {
                  "context" : "effectiveTime",
                  "element" : "period",
                  "variable" : "p"
                }
              ],
              "target" : [
                {
                  "context" : "r",
                  "contextType" : "variable",
                  "element" : "period",
                  "transform" : "evaluate",
                  "parameter" : [
                    {
                      "valueString" : "p.value"
                    }
                  ]
                }
              ]
            },
            {
              "name" : "period",
              "source" : [
                {
                  "context" : "effectiveTime",
                  "element" : "period",
                  "variable" : "p"
                }
              ],
              "target" : [
                {
                  "context" : "r",
                  "contextType" : "variable",
                  "element" : "periodUnit",
                  "transform" : "evaluate",
                  "parameter" : [
                    {
                      "valueString" : "p.unit"
                    }
                  ]
                }
              ]
            }
          ]
        }
      ]
    }
  ]
}