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 - LDO - JSON Representation

Draft as of 2024-04-11

Raw json | Download


{
  "resourceType" : "StructureMap",
  "id" : "cda2fhirLdo",
  "text" : {
    "status" : "generated",
    "div" : "<div xmlns=\"http://www.w3.org/1999/xhtml\">\n         <pre>map &quot;http://hl7.it/fhir/cda2fhir/StructureMap/cda2fhirLdo&quot; = &quot;cda2fhirLdo&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/PQ&quot; alias PQ as source\nuses &quot;http://hl7.org/fhir/StructureDefinition/SimpleQuantity&quot; alias SimpleQuantity as target\n\nimports &quot;http://hl7.it/fhir/cda2fhir/StructureMap/cda2fhirDataTypes&quot;\nimports &quot;http://hl7.it/fhir/cda2fhir/StructureMap/cda2fhirHeader&quot;\n\ngroup CdaToBundle(source cda : ClinicalDocument, target bundle : Bundle) {\n  cda -&gt;  bundle.entry as e,  e.request = create('BackboneElement') as request,  request.method = 'POST',  e.resource = create('Composition') as composition,  composition.id = uuid() as uuid1,  e.fullUrl = append('https://example/Composition/', uuid1),  request.url = 'Composition',  bundle.entry as e2,  e2.request = create('BackboneElement') as requestPAT,  requestPAT.method = 'PUT',  e2.resource = create('Patient') as patient,  patient.id = uuid() as uuid2,  e2.fullUrl = append('https://example/Patient/', uuid2),  bundle.entry as e3,  e3.request = create('BackboneElement') as request,  request.method = 'POST',  e3.resource = create('Encounter') as encounter,  encounter.id = uuid() as uuid3,  e3.fullUrl = append('https://example/Encounter/', uuid3),  request.url = 'Encounter',  bundle.entry as e5,  e5.request = create('BackboneElement') as request,  request.method = 'POST',  e5.resource = create('DocumentReference') as DocumentReference,  DocumentReference.id = uuid() as uuid5,  e5.fullUrl = append('https://example/DocumentReference/', uuid5),  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 ext -&gt; identifier.value = ext;\n          id.assigningAuthorityName as s -&gt;  identifier.assigner as a,  a.display = s;\n        } &quot;record&quot;;\n        patient.id as id where (root = '2.16.840.1.113883.2.9.4.3.2') or (root = '2.16.840.1.113883.2.9.4.3.7') or (root = '2.16.840.1.113883.2.9.4.3.3') or (root = '2.16.840.1.113883.2.9.4.3.17') or (root = '2.16.840.1.113883.2.9.4.3.18') or (root = '2.16.840.1.113883.2.9.2.10.4.1.1') or (root = '2.16.840.1.113883.2.9.2.20.4.1.1') or (root = '2.16.840.1.113883.2.9.2.30.4.1.1') or (root = '2.16.840.1.113883.2.9.2.41.4.1.1') or (root = '2.16.840.1.113883.2.9.2.42.4.1.1') or (root = '2.16.840.1.113883.2.9.2.50.4.1.1') or (root = '2.16.840.1.113883.2.9.2.60.4.1.1') or (root = '2.16.840.1.113883.2.9.2.70.4.1.1') or (root = '2.16.840.1.113883.2.9.2.80.4.1.1') or (root = '2.16.840.1.113883.2.9.2.90.4.1.1') or (root = '2.16.840.1.113883.2.9.2.100.4.1.1') or (root = '2.16.840.1.113883.2.9.2.110.4.1.1') or (root = '2.16.840.1.113883.2.9.2.120.4.1.1') or (root = '2.16.840.1.113883.2.9.2.130.4.1.1') or (root = '2.16.840.1.113883.2.9.2.140.4.1.1') or (root = '2.16.840.1.113883.2.9.2.150.4.1.1') or (root = '2.16.840.1.113883.2.9.2.160.4.1.1') or (root = '2.16.840.1.113883.2.9.2.170.4.1.1') or (root = '2.16.840.1.113883.2.9.2.180.4.1.1') or (root = '2.16.840.1.113883.2.9.2.190.4.1.1') or (root = '2.16.840.1.113883.2.9.2.200.4.1.1') or (root = '2.16.840.1.113883.2.9.2.10.4.1') or (root = '2.16.840.1.113883.2.9.2.20.4.1') or (root = '2.16.840.1.113883.2.9.2.30.4.1') or (root = '2.16.840.1.113883.2.9.2.41.4.1') or (root = '2.16.840.1.113883.2.9.2.42.4.1') or (root = '2.16.840.1.113883.2.9.2.50.4.1') or (root = '2.16.840.1.113883.2.9.2.60.4.1') or (root = '2.16.840.1.113883.2.9.2.70.4.1') or (root = '2.16.840.1.113883.2.9.2.80.4.1') or (root = '2.16.840.1.113883.2.9.2.90.4.1') or (root = '2.16.840.1.113883.2.9.2.100.4.1') or (root = '2.16.840.1.113883.2.9.2.110.4.1') or (root = '2.16.840.1.113883.2.9.2.120.4.1') or (root = '2.16.840.1.113883.2.9.2.130.4.1') or (root = '2.16.840.1.113883.2.9.2.140.4.1') or (root = '2.16.840.1.113883.2.9.2.150.4.1') or (root = '2.16.840.1.113883.2.9.2.160.4.1') or (root = '2.16.840.1.113883.2.9.2.170.4.1') or (root = '2.16.840.1.113883.2.9.2.180.4.1') or (root = '2.16.840.1.113883.2.9.2.190.4.1') or (root = '2.16.840.1.113883.2.9.2.200.4.1') or (root = '2.16.840.1.113883.2.9.4.3.15') then {\n          id.extension as ext -&gt; requestPAT.url = append('Patient?identifier=', ext) &quot;UUID&quot;;\n        } &quot;ext&quot;;\n      } &quot;recPat&quot;;\n    } &quot;patient&quot;;\n  } &quot;ClinicalDocumentToBody&quot;;\n}\n\ngroup ClinicalDocumentToBundle(source cda : ClinicalDocument, target patient : Patient, target composition : Composition, target encounter : Encounter, target bundle : Bundle, target DocumentReference : DocumentReference) {\n  cda -&gt; bundle.id = uuid() &quot;id&quot;;\n  cda.id -&gt; bundle.identifier &quot;identifier&quot;;\n  cda -&gt; bundle.type = 'transaction' &quot;type&quot;;\n  cda -&gt; bundle.timestamp = (timestamp.now()) &quot;date&quot;;\n  cda then ClinicalDocumentComposition(cda, composition, patient, encounter, bundle, DocumentReference) &quot;composition&quot;;\n  cda.component as component then {\n    component.structuredBody as body then {\n      body.component as component then {\n        // discretizzi il primo livello di component\n        component.section as srcSection then {\n          srcSection.code where (code = '46241-6') -&gt; composition.section as tgtSection then ClinicalDocumentSectionMotivoRicovero(cda, srcSection, patient, tgtSection, bundle, encounter) &quot;motivoRicovero&quot;;\n          srcSection.code where (code = '47039-3') -&gt; composition.section as tgtSection then ClinicalDocumentSectionInquadramentoClinico(cda, srcSection, patient, tgtSection, bundle, encounter) &quot;inquadramentoClinico&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 = '11493-4') -&gt; composition.section as tgtSection then ClinicalDocumentSectionRiscontri(cda, srcSection, patient, tgtSection, bundle, encounter) &quot;HospitalDischargeStudiesSummary&quot;;\n          srcSection.code where (code = '34104-0') -&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 ClinicalDocumentSectionEsamiEseguitiRicovero(cda, srcSection, patient, tgtSection, bundle, encounter) &quot;EsamiEseguitiDuranteilRicovero&quot;;\n          srcSection.code where (code = '47519-4') -&gt; composition.section as tgtSection then ClinicalDocumentSectionProcedureEseguiteRicovero(cda, srcSection, patient, tgtSection, bundle, encounter) &quot;HistoryOfProceduresDocument&quot;;\n          srcSection.code where (code = '48765-2') -&gt; composition.section as tgtSection then ClinicalDocumentSectionAllergie(cda, srcSection, patient, tgtSection, bundle, encounter) &quot;EsamiEseguitiDuranteIlRicovero&quot;;\n          srcSection.code where (code = '10160-0') -&gt; composition.section as tgtSection then ClinicalDocumentSectionTerapiaFarmacologicaDuranteRicovero(cda, srcSection, patient, tgtSection, bundle, encounter) &quot;TerapiaFarmacologicaAllaDimissione&quot;;\n          srcSection.code where (code = '11535-2') -&gt; composition.section as tgtSection then ClinicalDocumentSectionDiagnosiDimissione(cda, srcSection, patient, tgtSection, bundle, encounter) &quot;DiagnosiDiDimissione&quot;;\n          srcSection.code where (code = '18776-5') -&gt; composition.section as tgtSection then ClinicalDocumentSectionIstruzioniFollowUp(cda, srcSection, patient, tgtSection, bundle, encounter) &quot;DiagnosiDiDimissione&quot;;\n          srcSection.code where (code = '10183-2') -&gt; composition.section as tgtSection then ClinicalDocumentSectionTerapiaDimissione(cda, srcSection, patient, tgtSection, bundle, encounter) &quot;TerapiaFarmacologicaAllaDimissione&quot;;\n        };\n      };\n    } &quot;body&quot;;\n  };\n}\n\n// -------------------------------------------------------------------------------------------------------------------\ngroup ClinicalDocumentSectionMotivoRicovero(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;cText&quot;;\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  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 ClinicalDocumentSectionInquadramentoClinico(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    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    cdaText -&gt; fhirText.status = 'generated' &quot;narrativeStatus&quot;;\n    cdaText as t -&gt; fhirText.div = t &quot;narrativeText&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  src.component as component then {\n    component.section as section2 then {\n      // ANAMNESI\n      section2 -&gt; tgt.section as sec2 then {\n        section2.code where (code = '11329-0') -&gt; sec2.code;\n        section2.title as t -&gt; sec2.title = (t.dataString);\n        // section2.code -&gt; sec2.code;\n        src where src.entry.exists() then {\n          section2.text as cdaText -&gt; sec2.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;exist&quot;;\n        src where src.entry.exists().not() then {\n          section2.text as cdaText -&gt;  bundle.entry as e1,  e1.request = create('BackboneElement') as request,  request.method = 'POST',  e1.resource = create('Observation') as condition,  condition.id = uuid() as uuid1,  e1.fullUrl = append('https://example/Observation/', uuid1),  request.url = 'Observation',  sec2.entry = create('Reference') as reference,  reference.reference = ('https://example/Observation/' + %condition.id) then {\n            section2.code -&gt; condition.code;\n            src where condition.statusCode.exists().not() then {\n              src -&gt; condition.status = 'final' &quot;status&quot;;\n            } &quot;statuscode&quot;;\n            cdaText -&gt; condition.note as note 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              cdaText as t -&gt; note.text = t &quot;reference&quot;;\n            } &quot;reference&quot;;\n          } &quot;cdaText&quot;;\n        } &quot;where&quot;;\n        section2.entry as entry1 then {\n          entry1.observation as obs then {\n            // EntryRelationship per il Problem\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',  sec2.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                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.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; ob.value = (int.value);\n                            observation2.value : BL as boolean -&gt; ob.value = (boolean.value) &quot;boolean&quot;;\n                            observation2.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                            observation2.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                            observation2.value : ST as value -&gt;  ob.value = create('string'),  ob.value = (value.dataString);\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;whereEntryPatologicaProssima&quot;;\n            } &quot;observationcondition&quot;;\n          } &quot;entry&quot;;\n        } &quot;subsection1&quot;;\n        // ESAME PBIETTIVO\n        section2.code where (code = '29545-1') then ClinicalDocumentSottoSectionOBS(section2, sec2, bundle, enc, patient) &quot;esameObiettivo&quot;;\n        // TETAPIA FARMACOLOGICA\n        section2.code where (code = '42346-7') then ClinicalDocumentSottoSectionMS(section2, sec2, bundle, patient, enc) &quot;TerapiaFarmacologicaAllIngresso&quot;;\n      } &quot;sec2fhir&quot;;\n    } &quot;componentSec&quot;;\n  };\n}\n\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.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    cdaText -&gt; fhirText.status = 'generated' &quot;narrativeStatus&quot;;\n    cdaText as t -&gt; fhirText.div = t &quot;narrativeText&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    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      cdaText as t -&gt; note.text = t &quot;reference&quot;;\n    } &quot;reference&quot;;\n  } &quot;cdaText&quot;;\n  src.component as component then {\n    component.section as section2 then {\n      src then ClinicalDocumentSottoSectionOBS(section2, tgt, bundle, enc, patient) &quot;Decorso&quot;;\n    } &quot;1&quot;;\n  } &quot;2&quot;;\n}\n\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;exist&quot;;\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('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      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  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}\n\ngroup ClinicalDocumentSectionRiscontri(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    cdaText -&gt; fhirText.status = 'generated' &quot;narrativeStatus&quot;;\n    cdaText as t -&gt; fhirText.div = t &quot;narrativeText&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    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      cdaText as t -&gt; note.text = t &quot;reference&quot;;\n    } &quot;reference&quot;;\n  } &quot;cdaText&quot;;\n  src.component as component then {\n    component.section as section2 then {\n      src then ClinicalDocumentSottoSectionOBS(section2, tgt, bundle, enc, patient) &quot;Decorso&quot;;\n    } &quot;1&quot;;\n  } &quot;2&quot;;\n}\n\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;exist&quot;;\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('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      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  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 ObservationConsulenza(obs, patient, enc, observation, bundle) &quot;act&quot;;\n  };\n}\n\ngroup ClinicalDocumentSectionEsamiEseguitiRicovero(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;exists&quot;;\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('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      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  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 ObservationEsamiDuranteRicovero(obs, patient, enc, observation, bundle) &quot;act&quot;;\n  };\n}\n\ngroup ClinicalDocumentSectionProcedureEseguiteRicovero(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;exists&quot;;\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('Procedure') as procedure,  procedure.id = uuid() as uuid1,  e1.fullUrl = append('https://example/Procedure/', uuid1),  request.url = 'Procedure',  tgt.entry = create('Reference') as reference,  reference.reference = ('https://example/Procedure/' + %procedure.id) then {\n      src -&gt;  procedure.subject = create('Reference') as reference,  reference.reference = ('https://example/Patient/' + %patient.id) &quot;reference&quot;;\n      src -&gt;  procedure.encounter = create('Reference') as reference,  reference.reference = ('https://example/Encounter/' + %enc.id) &quot;reference&quot;;\n      src -&gt; procedure.status = 'unknown' &quot;statuscode&quot;;\n      cdaText -&gt; procedure.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  src.entry as entry1 -&gt;  bundle.entry as e1,  e1.request = create('BackboneElement') as request,  request.method = 'POST',  e1.resource = create('Procedure') as procedure,  procedure.id = uuid() as uuid1,  e1.fullUrl = append('https://example/Procedure/', uuid1),  request.url = 'Procedure',  tgt.entry = create('Reference') as reference,  reference.reference = ('https://example/Procedure/' + %procedure.id) then {\n    src -&gt;  procedure.subject = create('Reference') as reference,  reference.reference = ('https://example/Patient/' + %patient.id) &quot;reference&quot;;\n    src -&gt;  procedure.encounter = create('Reference') as reference,  reference.reference = ('https://example/Encounter/' + %enc.id) &quot;reference&quot;;\n    entry1.procedure as proceduresrc then {\n      proceduresrc.code -&gt; procedure.code;\n      proceduresrc.text as txt -&gt; procedure.note as note then {\n        txt.reference as ref -&gt; note.text = (ref.value);\n      };\n      proceduresrc where proc.statusCode.exists().not() then {\n        proceduresrc -&gt; procedure.status = 'unknown' &quot;statuscode&quot;;\n      } &quot;status&quot;;\n      proceduresrc.statusCode as statusc where (code = 'completed') -&gt; procedure.status = 'completed';\n      proceduresrc.statusCode as statusc where (code = 'active') -&gt; procedure.status = 'in-progress';\n      proceduresrc.statusCode as statusc where (code = 'aborted') -&gt; procedure.status = 'stopped';\n      proceduresrc.statusCode as statusc where (code = 'suspended') -&gt; procedure.status = 'on-hold';\n      proceduresrc.statusCode as statusc where (code = 'cancelled') -&gt; procedure.status = 'not-done';\n      proceduresrc.statusCode as statusc where (code = 'held') -&gt; procedure.status = 'on-hold';\n      proceduresrc.statusCode as statusc where (code = 'new') -&gt; procedure.status = 'preparation';\n      proceduresrc.statusCode as statusc where (code = 'obsolete') -&gt; procedure.status = 'entered-in-error';\n      proceduresrc.statusCode as statusc where (code = 'nullified') -&gt; procedure.status = 'unknown';\n      proceduresrc.effectiveTime as efft -&gt; procedure.performed = create('Period') as period then IVLTSPeriod(efft, period);\n      proceduresrc.entryRelationship as entriRel -&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',  procedure.reasonReference = create('Reference') as reference,  reference.reference = ('https://example/Observation/' + %observation.id) then {\n        entriRel -&gt;  observation.subject = create('Reference') as reference,  reference.reference = ('https://example/Patient/' + %patient.id) &quot;reference&quot;;\n        entriRel -&gt;  observation.encounter = create('Reference') as reference,  reference.reference = ('https://example/Encounter/' + %enc.id) &quot;reference&quot;;\n        entriRel.observation as obs then {\n          obs.code -&gt; observation.code;\n          obs where observation.statusCode.exists().not() then {\n            obs -&gt; observation.status = 'final' &quot;status&quot;;\n          } &quot;statuscode&quot;;\n        } &quot;ObservationValue&quot;;\n      } &quot;Observation&quot;;\n    } &quot;Procedure&quot;;\n  } &quot;Entry&quot;;\n}\n\ngroup ClinicalDocumentSectionAllergie(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;exists&quot;;\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('AllergyIntolerance') as allergy,  allergy.id = uuid() as uuid1,  e1.fullUrl = append('https://example/AllergyIntolerance/', uuid1),  request.url = 'AllergyIntolerance',  tgt.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      src -&gt; allergy.clinicalStatus = create('CodeableConcept') as status then {\n        src -&gt; status.text = 'string' &quot;text&quot;;\n        src -&gt; status.coding = create('Coding') as coding then {\n          src -&gt; coding.code = 'active' &quot;active&quot;;\n          src -&gt; coding.system = 'http://terminology.hl7.org/CodeSystem/allergyintolerance-clinical' &quot;system&quot;;\n        } &quot;coding&quot;;\n      } &quot;allergy&quot;;\n      src.code -&gt; allergy.code;\n      cdaText -&gt; allergy.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  src.entry as entry1 -&gt;  bundle.entry as e1,  e1.request = create('BackboneElement') as request,  request.method = 'POST',  e1.resource = create('AllergyIntolerance') as allergy,  allergy.id = uuid() as uuid1,  e1.fullUrl = append('https://example/AllergyIntolerance/', uuid1),  request.url = 'AllergyIntolerance',  tgt.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 eff -&gt; allergy.onset = create('Period') as per then IVLTSPeriod(eff, per);\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 start then TSDateTime(l, start) &quot;val&quot;;\n                      } &quot;eff&quot;;\n                      entobs.value -&gt; reaction.manifestation &quot;manifest&quot;;\n                    } &quot;observ&quot;;\n                  } &quot;entry&quot;;\n                } &quot;cod&quot;;\n              } &quot;react&quot;;\n            } &quot;pratentit&quot;;\n          } &quot;PratRole&quot;;\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                } &quot;entobs&quot;;\n              } &quot;sev&quot;;\n            } &quot;severity&quot;;\n          } &quot;observ&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 -&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.displayName as display -&gt; coding.display = cast(display, 'string');\n                    } &quot;value1&quot;;\n                  } &quot;coding&quot;;\n                } &quot;clinicalStatus&quot;;\n              } &quot;stat&quot;;\n            } &quot;obobs3serv&quot;;\n          } &quot;entry3&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;obobs4serv&quot;;\n          } &quot;entry4&quot;;\n        } &quot;partic&quot;;\n      };\n    };\n  } &quot;allergy&quot;;\n}\n\ngroup ClinicalDocumentSectionDiagnosiDimissione(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;exists&quot;;\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('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      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  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}\n\ngroup ClinicalDocumentSectionIstruzioniFollowUp(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.text as cdaText -&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    cdaText -&gt; carePlan.note as note then {\n      cdaText as t -&gt; note.text = t &quot;reference&quot;;\n    } &quot;reference&quot;;\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  } &quot;entry&quot;;\n}\n\ngroup ClinicalDocumentSectionTerapiaFarmacologicaDuranteRicovero(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;exists&quot;;\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('MedicationAdministration') as medicationAdm,  medicationAdm.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/' + %medicationAdm.id) then {\n      cdaText -&gt;  medicationAdm.subject = create('Reference') as reference,  reference.reference = ('https://example/Patient/' + %patient.id) &quot;reference&quot;;\n      cdaText -&gt;  medicationAdm.context = create('Reference') as reference,  reference.reference = ('https://example/Encounter/' + %enc.id) &quot;reference&quot;;\n      cdaText -&gt; medicationAdm.medication = create('CodeableConcept') as codecon then {\n        cdaText -&gt; codecon.text = 'string' &quot;text&quot;;\n      } &quot;code&quot;;\n      src -&gt; medicationAdm.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; medicationAdm.status = 'completed' &quot;status&quot;;\n      } &quot;statuscode&quot;;\n      cdaText -&gt; medicationAdm.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  src.entry as entry1 -&gt;  bundle.entry as e1,  e1.request = create('BackboneElement') as request,  request.method = 'POST',  e1.resource = create('MedicationAdministration') as medicationAdm,  medicationAdm.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/' + %medicationAdm.id) then {\n    entry1 -&gt;  medicationAdm.subject = create('Reference') as reference,  reference.reference = ('https://example/Patient/' + %patient.id) &quot;reference&quot;;\n    entry1 -&gt;  medicationAdm.context = create('Reference') as reference,  reference.reference = ('https://example/Encounter/' + %enc.id) &quot;reference&quot;;\n    entry1.substanceAdministration as sa then {\n      sa.text as tx -&gt; medicationAdm.note as note then {\n        sa.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.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/TerapiaFarmacologicaRicovero/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 = 'Practitioner',  medicationAdm.performer as perf,  perf.actor = create('Reference') as reference,  reference.reference = ('https://example/Practitioner/' + %practitioner.id) &quot;aut&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.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;diverso&quot;;\n            assEnty.assignedPerson as assi then {\n              assi.name -&gt; practitioner.name;\n            } &quot;assi&quot;;\n          } &quot;assEntity&quot;;\n        } &quot;perf&quot;;\n        tx.reference as ref -&gt; note.text = (ref.value);\n      } &quot;tx&quot;;\n      sa.statusCode as st -&gt; medicationAdm.status = (st.code);\n      sa.effectiveTime as eff -&gt; medicationAdm.effective = create('Period') as period then IVLTSPeriod(eff, period) &quot;period&quot;;\n      sa -&gt; medicationAdm.dosage as dos then {\n        sa.routeCode -&gt; dos.route;\n      } &quot;dos&quot;;\n      sa -&gt; medicationAdm.dosage as dos then {\n        sa.approachSiteCode -&gt; dos.site;\n      } &quot;dos&quot;;\n      sa.doseQuantity as doseQuant -&gt;  bundle.entry as e1,  e1.request = create('BackboneElement') as request,  request.method = 'POST',  e1.resource = create('MedicationRequest') as medicationRq,  medicationRq.id = uuid() as uuid1,  e1.fullUrl = append('https://example/MedicationRequest/', uuid1),  request.url = 'MedicationRequest',  medicationAdm.request = create('Reference') as reference,  reference.reference = ('https://example/MedicationRequest/' + %medicationRq.id) then {\n        doseQuant -&gt; medicationRq.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        } &quot;Dosage&quot;;\n        sa -&gt;  medicationRq.subject = create('Reference') as reference,  reference.reference = ('https://example/Patient/' + %patient.id) &quot;reference&quot;;\n        sa -&gt;  medicationRq.encounter = create('Reference') as reference,  reference.reference = ('https://example/Encounter/' + %enc.id) &quot;reference&quot;;\n        sa -&gt; medicationRq.status = 'active' &quot;status&quot;;\n        sa -&gt; medicationRq.intent = 'order' &quot;intent&quot;;\n        sa.rateQuantity as rateQuantity -&gt; medicationRq.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;dosageRate&quot;;\n        } &quot;Dosage&quot;;\n        sa -&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',  medicationAdm.medication = create('Reference') as reference,  reference.reference = ('https://example/Medication/' + %medication.id) then {\n          sa -&gt;  medicationRq.medication = create('Reference') as reference,  reference.reference = ('https://example/Medication/' + %medication.id) &quot;reference&quot;;\n          sa.administrationUnitCode -&gt; medication.form;\n          sa.consumable as consumable then {\n            consumable.manufacturedProduct as manufac then {\n              manufac.manufacturedMaterial as manuprod then {\n                manuprod.code -&gt; medication.code;\n              } &quot;manufactproduct&quot;;\n            } &quot;manufac&quot;;\n          };\n          sa.entryRelationship as entryRR then {\n            entryRR.observation as observation then {\n              observation.code where displayName = 'Grammatura' -&gt; medication.ingredient as ingredient then {\n                sa.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;entryRr&quot;;\n        } &quot;medication&quot;;\n        sa.entryRelationship as entryRelationship then {\n          entryRelationship.supply as sup -&gt; medicationRq.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;entryR&quot;;\n        sa.participant as participant then {\n          participant.time as t -&gt; medicationRq.authoredOn = (t.value);\n          participant.participantRole as participantR -&gt;  bundle.entry as e1,  e1.request = create('BackboneElement') as request,  request.method = 'PUT',  e1.resource = create('Practitioner') as practitioner then {\n            participantR -&gt; practitioner.meta as meta then {\n              participantR -&gt; meta.tag = create('Coding') as coding then {\n                participantR -&gt; coding.system = 'http://algoritmodiscoring' &quot;system&quot;;\n                participantR -&gt; coding.code = 'ClinicalDocument/body/TerapiaFarmacologicaRicovero/participant' &quot;code&quot;;\n              } &quot;coding&quot;;\n            } &quot;meta&quot;;\n            participantR.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/', uuid1),  medicationRq.requester = create('Reference') as reference,  reference.reference = ('https://example/Practitioner/' + %practitioner.id) &quot;aut&quot;;\n              } &quot;r&quot;;\n            } &quot;identifier&quot;;\n            participantR.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            participantR.playingEntity as assi then {\n              assi.name -&gt; practitioner.name;\n            } &quot;assi&quot;;\n          } &quot;perf&quot;;\n          sa.effectiveTime : EIVL as eff -&gt; medicationRq.dosageInstruction = create('Dosage') as dosage then {\n            eff -&gt; dosage.timing = create('Timing') as timing then {\n              eff -&gt; timing.repeat as rep then {\n                eff.event as ev -&gt; rep.where = (ev.code);\n              } &quot;rep&quot;;\n            } &quot;timing&quot;;\n          } &quot;period&quot;;\n          sa.effectiveTime : TS as eff -&gt;  medicationRq.dosageInstruction = create('Dosage') as dosage,  dosage.timing = create('Timing') as timing,  timing.event = (eff.value) &quot;tim&quot;;\n          sa.effectiveTime : PIVL_TS as eff -&gt; medicationAdm.dosage = create('BackboneElement') as dosage then {\n            eff -&gt; dosage.rate = create('Ratio') as ratio then {\n              eff -&gt; ratio.numerator = create('Quantity') as quan then {\n                eff.period as per -&gt; quan.value = (per.value);\n                eff.period as per -&gt; quan.unit = (per.unit);\n              } &quot;quanti&quot;;\n              eff -&gt; ratio.denominator = create('Quantity') as quan then {\n                eff.period -&gt; quan.value = '1';\n                eff.period as per -&gt; quan.unit = (per.unit);\n              } &quot;quanti&quot;;\n            } &quot;ratio&quot;;\n          } &quot;eff&quot;;\n        } &quot;Medicationrequest&quot;;\n      } &quot;sa&quot;;\n    } &quot;entry&quot;;\n  } &quot;sa&quot;;\n}\n\ngroup ClinicalDocumentSottoSectionOBS(source src : Section, target tgt, target bundle : Bundle, target enc : Encounter, target patient : Patient) {\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    cdaText -&gt; fhirText.status = 'generated' &quot;narrativeStatus&quot;;\n    cdaText as t -&gt; fhirText.div = t &quot;narrativeText&quot;;\n    src.code -&gt; observation.code;\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 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}\n\ngroup ClinicalDocumentSottoSectionMS(source src : Section, target tgt, target bundle : Bundle, target patient : Patient, 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('MedicationStatement') as Medicationstatement,  Medicationstatement.id = uuid() as uuid1,  e1.fullUrl = append('https://example/MedicationStatement/', uuid1),  request.url = 'MedicationStatement',  tgt.entry = create('Reference') as reference,  reference.reference = ('https://example/MedicationStatement/' + %Medicationstatement.id),  tgt.text as fhirText then {\n    cdaText -&gt; Medicationstatement.note as note then {\n      cdaText as t -&gt; note.text = t &quot;reference&quot;;\n      cdaText as t -&gt;  Medicationstatement.medication = create('CodeableConcept') as medication,  medication.text = t &quot;text&quot;;\n    } &quot;reference&quot;;\n    src -&gt;  Medicationstatement.subject = create('Reference') as reference,  reference.reference = ('https://example/Patient/' + %patient.id) &quot;reference&quot;;\n    src -&gt; Medicationstatement.status = 'unknown' &quot;status&quot;;\n  } &quot;cdaText&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) &quot;value3&quot;;\n  } &quot;where&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 : 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        };\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        };\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.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;IVLPQ&quot;;\n    } &quot;obsRange&quot;;\n  } &quot;refRange&quot;;\n}\n\ngroup ObservationConsulenza(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;value2c&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) &quot;value3c&quot;;\n  } &quot;where&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 : 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 -&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        };\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 -&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;IVLPQ&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 then {\n    performer.assignedEntity as assEntity then {\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/Consulenza/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),  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      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    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 then {\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/Consulenza/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 uuid3,  e1.fullUrl = append('https://example/Practitioner/', uuid3),  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      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      participantRole.playingEntity as pe then {\n        pe.name -&gt; practitioner.name;\n      } &quot;pe&quot;;\n    };\n  };\n}\n\ngroup ObservationEsamiDuranteRicovero(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;value2r&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) &quot;value3r&quot;;\n  } &quot;where&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 : 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 -&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        };\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 -&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.effectiveTime as eff -&gt; ob.effective = create('Period') as per then IVLTSPeriod(eff, per);\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;IVLPQ&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 then {\n    performer.assignedEntity as assEntity then {\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/EsamiDuranteRicovero/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),  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      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    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 then {\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/EsamiDuranteRicovero/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 uuid3,  e1.fullUrl = append('https://example/Practitioner/', uuid3),  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      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      participantRole.playingEntity as pe then {\n        pe.name -&gt; practitioner.name;\n      } &quot;pe&quot;;\n    };\n  };\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// ---------------------------------------------------------------------------------------\ngroup Act(source cda : Act, target pat : Patient, target ac : DiagnosticReport, target enc : Encounter, target bundle : Bundle) {\n  cda.code -&gt; ac.code;\n  cda.statusCode as statusc where (code = 'completed') -&gt; ob.status = 'final';\n  cda.statusCode as statusc where (code = 'active') -&gt; ob.status = 'registered';\n  cda.statusCode as statusc where (code = 'aborted') -&gt; ob.status = 'cancelled';\n  cda.statusCode as statusc where (code = 'suspended') -&gt; ob.status = 'partial';\n  cda.effectiveTime as effectiveTime -&gt; ac.effective = create('dateTime') as value then TSDateTime(effectiveTime, value) &quot;value2a&quot;;\n  obs where effectiveTime.low.exists() or effectiveTime.high.exists() then {\n    cda.effectiveTime as eff -&gt; ac.effective = create('Period') as period then IVLTSPeriod(eff, period) &quot;value3a&quot;;\n  } &quot;where&quot;;\n  cda -&gt;  ac.subject = create('Reference') as reference,  reference.reference = ('https://example/' + %pat.id) &quot;reference&quot;;\n  cda -&gt;  ac.encounter = create('Reference') as reference,  reference.reference = ('https://example/' + %enc.id) &quot;reference&quot;;\n  cda.participant as part -&gt; enc.participant as participant then {\n    part -&gt; participant.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.participantRole as participantRole -&gt; participant.individual = create('Reference') as reference then {\n      participantRole -&gt;  bundle.entry as e,  e.request = create('BackboneElement') as request,  request.method = 'PUT',  e.resource = create('Practitioner') as practitioner,  practitioner.id = uuid() as uuid1,  e.fullUrl = append('https://example/Practitioner/', uuid1),  reference.reference = ('https://example/Practitioner/' + %practitioner.id) then {\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/Act/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 then {\n            participantRole -&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        } &quot;identifier&quot;;\n        participantRole.playingEntity as playingEntity then {\n          playingEntity.name -&gt; practitioner.name;\n        };\n      } &quot;participanRoleBund&quot;;\n    };\n  };\n  cda.entryRelationship as entryRelationship then {\n    entryRelationship.observation as observation -&gt;  bundle.entry as e,  e.request = create('BackboneElement') as request,  request.method = 'POST',  e.resource = create('Observation') as obs,  obs.id = uuid() as uuid2,  e.fullUrl = append('https://example/Observation/', uuid2),  request.url = append('Observation/', uuid2),  ac.result = create('Reference') as reference,  reference.reference = ('https://example/Observation/' + %obs.id) then Observation(observation, pat, enc, obs, bundle) &quot;OBS&quot;;\n  };\n}\n\ngroup ClinicalDocumentSectionTerapiaDimissione(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;exist&quot;;\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 medicationRq,  medicationRq.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/' + %medicationRq.id) then {\n      src -&gt;  medicationRq.subject = create('Reference') as reference,  reference.reference = ('https://example/Patient/' + %patient.id) &quot;reference&quot;;\n      src -&gt;  medicationRq.encounter = create('Reference') as reference,  reference.reference = ('https://example/Encounter/' + %enc.id) &quot;reference&quot;;\n      src -&gt; medicationRq.status = 'active' &quot;status&quot;;\n      src -&gt; medicationRq.intent = 'order' &quot;intent&quot;;\n      cdaText -&gt; medicationRq.medication = create('CodeableConcept') as codecon then {\n        cdaText -&gt; codecon.text = 'string' &quot;text&quot;;\n      } &quot;code&quot;;\n      cdaText -&gt; medicationRq.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  src.entry as entry1 -&gt;  bundle.entry as e1,  e1.request = create('BackboneElement') as request,  request.method = 'POST',  e1.resource = create('MedicationRequest') as medicationRq,  medicationRq.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/' + %medicationRq.id) then {\n    src -&gt;  medicationRq.subject = create('Reference') as reference,  reference.reference = ('https://example/Patient/' + %patient.id) &quot;reference&quot;;\n    src -&gt;  medicationRq.encounter = create('Reference') as reference,  reference.reference = ('https://example/Encounter/' + %enc.id) &quot;reference&quot;;\n    src -&gt; medicationRq.status = 'active' &quot;status&quot;;\n    src -&gt; medicationRq.intent = 'order' &quot;intent&quot;;\n    entry1.substanceAdministration as substract then {\n      substract.consumable as cons then {\n        cons.manufacturedProduct as man1 -&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',  medicationRq.medication = create('Reference') as medref,  medref.reference = ('https://example/Medication/' + %medication.id) then {\n          man1.manufacturedMaterial as mm then {\n            mm.code -&gt; medication.code;\n          } &quot;mm&quot;;\n          substract.administrationUnitCode -&gt; medication.form;\n          substract.entryRelationship as entryR then {\n            entryR.observation as observation then {\n              observation.code where displayName = 'Grammatura' -&gt; medication.ingredient as ingredient then {\n                substract.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          substract.entryRelationship as entryRelationship then {\n            entryRelationship.supply as sup -&gt; medicationRq.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;entry&quot;;\n        } &quot;man1&quot;;\n      } &quot;cons&quot;;\n      substract.text as tx -&gt; medicationRq.note as note then {\n        tx.reference as ref -&gt; note.text = (ref.value);\n      } &quot;tx&quot;;\n      substract.statusCode as st -&gt; medicationRq.status = (st.code);\n      substract.effectiveTime : IVL_TS as eff -&gt; medicationRq.dosageInstruction = create('Dosage') as dosage then {\n        eff -&gt; dosage.timing = create('Timing') as timing then {\n          eff -&gt; timing.repeat as rep then {\n            eff -&gt; rep.bounds = create('Period') as period then IVLTSPeriod(eff, period) &quot;period&quot;;\n          } &quot;rep&quot;;\n        } &quot;timing&quot;;\n      } &quot;period&quot;;\n      substract.effectiveTime : EIVL_TS as eff -&gt; medicationRq.dosageInstruction = create('Dosage') as dosage then {\n        eff -&gt; dosage.timing = create('Timing') as timing then {\n          eff -&gt; timing.repeat as rep then {\n            eff.event as ev -&gt; rep.when = (ev.code);\n          } &quot;rep&quot;;\n        } &quot;timing&quot;;\n      } &quot;period&quot;;\n      substract.effectiveTime : IVL_TS as eff -&gt;  medicationRq.dosageInstruction = create('Dosage') as dosage,  dosage.timing = create('Timing') as timing,  timing.event = (eff.value) &quot;tim&quot;;\n      substract.effectiveTime : PIVL_TS as eff -&gt; medicationRq.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      substract -&gt; medicationRq.dosageInstruction = create('Dosage') as dosage then {\n        substract.routeCode -&gt; dosage.route;\n      } &quot;dosage&quot;;\n      substract -&gt; medicationRq.dosageInstruction = create('Dosage') as dosage then {\n        substract.approachSiteCode -&gt; dosage.site;\n      } &quot;dosage&quot;;\n      substract.doseQuantity as doseQuant -&gt; medicationRq.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      } &quot;Dosage&quot;;\n      substract.rateQuantity as rateQuantity -&gt; medicationRq.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;dosageRate&quot;;\n      } &quot;rateq&quot;;\n      substract.participant as part -&gt;  bundle.entry as e1,  e1.request = create('BackboneElement') as request,  request.method = 'PUT',  e1.resource = create('Practitioner') as practitioner then {\n        part.time as time -&gt; medicationRq.authoredOn = (time.value);\n        part.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/TerapiaFarmacologicaRicovero/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/', uuid1),  medicationRq.performer = 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 assi then {\n            assi.name -&gt; practitioner.name;\n          } &quot;assi&quot;;\n        } &quot;perf&quot;;\n      } &quot;partRole&quot;;\n    } &quot;participant&quot;;\n  } &quot;substract&quot;;\n}\n\n</pre>\n      </div>"
  },
  "url" : "http://hl7.it/fhir/cda2fhir/StructureMap/cda2fhirLdo",
  "version" : "0.1.0",
  "name" : "cda2fhirLdo",
  "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/PQ",
      "mode" : "source",
      "alias" : "PQ"
    },
    {
      "url" : "http://hl7.org/fhir/StructureDefinition/SimpleQuantity",
      "mode" : "target",
      "alias" : "SimpleQuantity"
    }
  ],
  "import" : [
    🔗 "http://hl7.it/fhir/cda2fhir/StructureMap/cda2fhirDataTypes"🔗 ,
    "http://hl7.it/fhir/cda2fhir/StructureMap/cda2fhirHeader"
  ],
  "group" : [
    {
      "name" : "CdaToBundle",
      "typeMode" : "none",
      "input" : [
        {
          "name" : "cda",
          "type" : "ClinicalDocument",
          "mode" : "source"
        },
        {
          "name" : "bundle",
          "type" : "Bundle",
          "mode" : "target"
        }
      ],
      "rule" : [
        {
          "name" : "ClinicalDocumentToBody",
          "source" : [
            {
              "context" : "cda"
            }
          ],
          "target" : [
            {
              "context" : "bundle",
              "contextType" : "variable",
              "element" : "entry",
              "variable" : "e"
            },
            {
              "context" : "e",
              "contextType" : "variable",
              "element" : "request",
              "variable" : "request",
              "transform" : "create",
              "parameter" : [
                {
                  "valueString" : "BackboneElement"
                }
              ]
            },
            {
              "context" : "request",
              "contextType" : "variable",
              "element" : "method",
              "transform" : "copy",
              "parameter" : [
                {
                  "valueString" : "POST"
                }
              ]
            },
            {
              "context" : "e",
              "contextType" : "variable",
              "element" : "resource",
              "variable" : "composition",
              "transform" : "create",
              "parameter" : [
                {
                  "valueString" : "Composition"
                }
              ]
            },
            {
              "context" : "composition",
              "contextType" : "variable",
              "element" : "id",
              "variable" : "uuid1",
              "transform" : "uuid"
            },
            {
              "context" : "e",
              "contextType" : "variable",
              "element" : "fullUrl",
              "transform" : "append",
              "parameter" : [
                {
                  "valueString" : "https://example/Composition/"
                },
                {
                  "valueId" : "uuid1"
                }
              ]
            },
            {
              "context" : "request",
              "contextType" : "variable",
              "element" : "url",
              "transform" : "copy",
              "parameter" : [
                {
                  "valueString" : "Composition"
                }
              ]
            },
            {
              "context" : "bundle",
              "contextType" : "variable",
              "element" : "entry",
              "variable" : "e2"
            },
            {
              "context" : "e2",
              "contextType" : "variable",
              "element" : "request",
              "variable" : "requestPAT",
              "transform" : "create",
              "parameter" : [
                {
                  "valueString" : "BackboneElement"
                }
              ]
            },
            {
              "context" : "requestPAT",
              "contextType" : "variable",
              "element" : "method",
              "transform" : "copy",
              "parameter" : [
                {
                  "valueString" : "PUT"
                }
              ]
            },
            {
              "context" : "e2",
              "contextType" : "variable",
              "element" : "resource",
              "variable" : "patient",
              "transform" : "create",
              "parameter" : [
                {
                  "valueString" : "Patient"
                }
              ]
            },
            {
              "context" : "patient",
              "contextType" : "variable",
              "element" : "id",
              "variable" : "uuid2",
              "transform" : "uuid"
            },
            {
              "context" : "e2",
              "contextType" : "variable",
              "element" : "fullUrl",
              "transform" : "append",
              "parameter" : [
                {
                  "valueString" : "https://example/Patient/"
                },
                {
                  "valueId" : "uuid2"
                }
              ]
            },
            {
              "context" : "bundle",
              "contextType" : "variable",
              "element" : "entry",
              "variable" : "e3"
            },
            {
              "context" : "e3",
              "contextType" : "variable",
              "element" : "request",
              "variable" : "request",
              "transform" : "create",
              "parameter" : [
                {
                  "valueString" : "BackboneElement"
                }
              ]
            },
            {
              "context" : "request",
              "contextType" : "variable",
              "element" : "method",
              "transform" : "copy",
              "parameter" : [
                {
                  "valueString" : "POST"
                }
              ]
            },
            {
              "context" : "e3",
              "contextType" : "variable",
              "element" : "resource",
              "variable" : "encounter",
              "transform" : "create",
              "parameter" : [
                {
                  "valueString" : "Encounter"
                }
              ]
            },
            {
              "context" : "encounter",
              "contextType" : "variable",
              "element" : "id",
              "variable" : "uuid3",
              "transform" : "uuid"
            },
            {
              "context" : "e3",
              "contextType" : "variable",
              "element" : "fullUrl",
              "transform" : "append",
              "parameter" : [
                {
                  "valueString" : "https://example/Encounter/"
                },
                {
                  "valueId" : "uuid3"
                }
              ]
            },
            {
              "context" : "request",
              "contextType" : "variable",
              "element" : "url",
              "transform" : "copy",
              "parameter" : [
                {
                  "valueString" : "Encounter"
                }
              ]
            },
            {
              "context" : "bundle",
              "contextType" : "variable",
              "element" : "entry",
              "variable" : "e5"
            },
            {
              "context" : "e5",
              "contextType" : "variable",
              "element" : "request",
              "variable" : "request",
              "transform" : "create",
              "parameter" : [
                {
                  "valueString" : "BackboneElement"
                }
              ]
            },
            {
              "context" : "request",
              "contextType" : "variable",
              "element" : "method",
              "transform" : "copy",
              "parameter" : [
                {
                  "valueString" : "POST"
                }
              ]
            },
            {
              "context" : "e5",
              "contextType" : "variable",
              "element" : "resource",
              "variable" : "DocumentReference",
              "transform" : "create",
              "parameter" : [
                {
                  "valueString" : "DocumentReference"
                }
              ]
            },
            {
              "context" : "DocumentReference",
              "contextType" : "variable",
              "element" : "id",
              "variable" : "uuid5",
              "transform" : "uuid"
            },
            {
              "context" : "e5",
              "contextType" : "variable",
              "element" : "fullUrl",
              "transform" : "append",
              "parameter" : [
                {
                  "valueString" : "https://example/DocumentReference/"
                },
                {
                  "valueId" : "uuid5"
                }
              ]
            },
            {
              "context" : "request",
              "contextType" : "variable",
              "element" : "url",
              "transform" : "copy",
              "parameter" : [
                {
                  "valueString" : "DocumentReference"
                }
              ]
            }
          ],
          "rule" : [
            {
              "name" : "cdatobundle",
              "source" : [
                {
                  "context" : "cda"
                }
              ],
              "dependent" : [
                {
                  "name" : "ClinicalDocumentToBundle",
                  "variable" : [
                    "cda",
                    "patient",
                    "composition",
                    "encounter",
                    "bundle",
                    "DocumentReference"
                  ]
                }
              ]
            },
            {
              "name" : "patient",
              "source" : [
                {
                  "context" : "cda",
                  "element" : "recordTarget",
                  "variable" : "recordTarget"
                }
              ],
              "rule" : [
                {
                  "name" : "recPat",
                  "source" : [
                    {
                      "context" : "recordTarget",
                      "element" : "patientRole",
                      "variable" : "patient"
                    }
                  ],
                  "rule" : [
                    {
                      "name" : "record",
                      "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" : "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" : "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" : "motivoRicovero",
                          "source" : [
                            {
                              "context" : "srcSection",
                              "element" : "code",
                              "condition" : "(code = '46241-6')"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "composition",
                              "contextType" : "variable",
                              "element" : "section",
                              "variable" : "tgtSection"
                            }
                          ],
                          "dependent" : [
                            {
                              "name" : "ClinicalDocumentSectionMotivoRicovero",
                              "variable" : [
                                "cda",
                                "srcSection",
                                "patient",
                                "tgtSection",
                                "bundle",
                                "encounter"
                              ]
                            }
                          ]
                        },
                        {
                          "name" : "inquadramentoClinico",
                          "source" : [
                            {
                              "context" : "srcSection",
                              "element" : "code",
                              "condition" : "(code = '47039-3')"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "composition",
                              "contextType" : "variable",
                              "element" : "section",
                              "variable" : "tgtSection"
                            }
                          ],
                          "dependent" : [
                            {
                              "name" : "ClinicalDocumentSectionInquadramentoClinico",
                              "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 = '11493-4')"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "composition",
                              "contextType" : "variable",
                              "element" : "section",
                              "variable" : "tgtSection"
                            }
                          ],
                          "dependent" : [
                            {
                              "name" : "ClinicalDocumentSectionRiscontri",
                              "variable" : [
                                "cda",
                                "srcSection",
                                "patient",
                                "tgtSection",
                                "bundle",
                                "encounter"
                              ]
                            }
                          ]
                        },
                        {
                          "name" : "HospitalDischargeStudiesSummary",
                          "source" : [
                            {
                              "context" : "srcSection",
                              "element" : "code",
                              "condition" : "(code = '34104-0')"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "composition",
                              "contextType" : "variable",
                              "element" : "section",
                              "variable" : "tgtSection"
                            }
                          ],
                          "dependent" : [
                            {
                              "name" : "ClinicalDocumentSectionConsulenza",
                              "variable" : [
                                "cda",
                                "srcSection",
                                "patient",
                                "tgtSection",
                                "bundle",
                                "encounter"
                              ]
                            }
                          ]
                        },
                        {
                          "name" : "EsamiEseguitiDuranteilRicovero",
                          "source" : [
                            {
                              "context" : "srcSection",
                              "element" : "code",
                              "condition" : "(code = '30954-2')"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "composition",
                              "contextType" : "variable",
                              "element" : "section",
                              "variable" : "tgtSection"
                            }
                          ],
                          "dependent" : [
                            {
                              "name" : "ClinicalDocumentSectionEsamiEseguitiRicovero",
                              "variable" : [
                                "cda",
                                "srcSection",
                                "patient",
                                "tgtSection",
                                "bundle",
                                "encounter"
                              ]
                            }
                          ]
                        },
                        {
                          "name" : "HistoryOfProceduresDocument",
                          "source" : [
                            {
                              "context" : "srcSection",
                              "element" : "code",
                              "condition" : "(code = '47519-4')"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "composition",
                              "contextType" : "variable",
                              "element" : "section",
                              "variable" : "tgtSection"
                            }
                          ],
                          "dependent" : [
                            {
                              "name" : "ClinicalDocumentSectionProcedureEseguiteRicovero",
                              "variable" : [
                                "cda",
                                "srcSection",
                                "patient",
                                "tgtSection",
                                "bundle",
                                "encounter"
                              ]
                            }
                          ]
                        },
                        {
                          "name" : "EsamiEseguitiDuranteIlRicovero",
                          "source" : [
                            {
                              "context" : "srcSection",
                              "element" : "code",
                              "condition" : "(code = '48765-2')"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "composition",
                              "contextType" : "variable",
                              "element" : "section",
                              "variable" : "tgtSection"
                            }
                          ],
                          "dependent" : [
                            {
                              "name" : "ClinicalDocumentSectionAllergie",
                              "variable" : [
                                "cda",
                                "srcSection",
                                "patient",
                                "tgtSection",
                                "bundle",
                                "encounter"
                              ]
                            }
                          ]
                        },
                        {
                          "name" : "TerapiaFarmacologicaAllaDimissione",
                          "source" : [
                            {
                              "context" : "srcSection",
                              "element" : "code",
                              "condition" : "(code = '10160-0')"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "composition",
                              "contextType" : "variable",
                              "element" : "section",
                              "variable" : "tgtSection"
                            }
                          ],
                          "dependent" : [
                            {
                              "name" : "ClinicalDocumentSectionTerapiaFarmacologicaDuranteRicovero",
                              "variable" : [
                                "cda",
                                "srcSection",
                                "patient",
                                "tgtSection",
                                "bundle",
                                "encounter"
                              ]
                            }
                          ]
                        },
                        {
                          "name" : "DiagnosiDiDimissione",
                          "source" : [
                            {
                              "context" : "srcSection",
                              "element" : "code",
                              "condition" : "(code = '11535-2')"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "composition",
                              "contextType" : "variable",
                              "element" : "section",
                              "variable" : "tgtSection"
                            }
                          ],
                          "dependent" : [
                            {
                              "name" : "ClinicalDocumentSectionDiagnosiDimissione",
                              "variable" : [
                                "cda",
                                "srcSection",
                                "patient",
                                "tgtSection",
                                "bundle",
                                "encounter"
                              ]
                            }
                          ]
                        },
                        {
                          "name" : "DiagnosiDiDimissione",
                          "source" : [
                            {
                              "context" : "srcSection",
                              "element" : "code",
                              "condition" : "(code = '18776-5')"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "composition",
                              "contextType" : "variable",
                              "element" : "section",
                              "variable" : "tgtSection"
                            }
                          ],
                          "dependent" : [
                            {
                              "name" : "ClinicalDocumentSectionIstruzioniFollowUp",
                              "variable" : [
                                "cda",
                                "srcSection",
                                "patient",
                                "tgtSection",
                                "bundle",
                                "encounter"
                              ]
                            }
                          ]
                        },
                        {
                          "name" : "TerapiaFarmacologicaAllaDimissione",
                          "source" : [
                            {
                              "context" : "srcSection",
                              "element" : "code",
                              "condition" : "(code = '10183-2')"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "composition",
                              "contextType" : "variable",
                              "element" : "section",
                              "variable" : "tgtSection"
                            }
                          ],
                          "dependent" : [
                            {
                              "name" : "ClinicalDocumentSectionTerapiaDimissione",
                              "variable" : [
                                "cda",
                                "srcSection",
                                "patient",
                                "tgtSection",
                                "bundle",
                                "encounter"
                              ]
                            }
                          ]
                        }
                      ],
                      "documentation" : "discretizzi il primo livello di component"
                    }
                  ]
                }
              ]
            }
          ]
        }
      ]
    },
    {
      "name" : "ClinicalDocumentSectionMotivoRicovero",
      "typeMode" : "none",
      "documentation" : "-------------------------------------------------------------------------------------------------------------------",
      "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" : "cText",
          "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"
                  ]
                }
              ]
            }
          ]
        },
        {
          "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"
                            }
                          ]
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ]
        }
      ]
    },
    {
      "name" : "ClinicalDocumentSectionInquadramentoClinico",
      "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" : "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" : "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" : "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"
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ]
        },
        {
          "name" : "component",
          "source" : [
            {
              "context" : "src",
              "element" : "component",
              "variable" : "component"
            }
          ],
          "rule" : [
            {
              "name" : "componentSec",
              "source" : [
                {
                  "context" : "component",
                  "element" : "section",
                  "variable" : "section2"
                }
              ],
              "rule" : [
                {
                  "name" : "sec2fhir",
                  "source" : [
                    {
                      "context" : "section2"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "tgt",
                      "contextType" : "variable",
                      "element" : "section",
                      "variable" : "sec2"
                    }
                  ],
                  "rule" : [
                    {
                      "name" : "code",
                      "source" : [
                        {
                          "context" : "section2",
                          "element" : "code",
                          "variable" : "vvv",
                          "condition" : "(code = '11329-0')"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "sec2",
                          "contextType" : "variable",
                          "element" : "code",
                          "variable" : "vvv",
                          "transform" : "create"
                        }
                      ]
                    },
                    {
                      "name" : "title",
                      "source" : [
                        {
                          "context" : "section2",
                          "element" : "title",
                          "variable" : "t"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "sec2",
                          "contextType" : "variable",
                          "element" : "title",
                          "transform" : "evaluate",
                          "parameter" : [
                            {
                              "valueString" : "t.dataString"
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "name" : "exist",
                      "source" : [
                        {
                          "context" : "src",
                          "condition" : "src.entry.exists()"
                        }
                      ],
                      "rule" : [
                        {
                          "name" : "cdaText",
                          "source" : [
                            {
                              "context" : "section2",
                              "element" : "text",
                              "variable" : "cdaText"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "sec2",
                              "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"
                                    }
                                  ]
                                }
                              ]
                            }
                          ]
                        }
                      ],
                      "documentation" : "section2.code -> sec2.code;"
                    },
                    {
                      "name" : "where",
                      "source" : [
                        {
                          "context" : "src",
                          "condition" : "src.entry.exists().not()"
                        }
                      ],
                      "rule" : [
                        {
                          "name" : "cdaText",
                          "source" : [
                            {
                              "context" : "section2",
                              "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" : "condition",
                              "transform" : "create",
                              "parameter" : [
                                {
                                  "valueString" : "Observation"
                                }
                              ]
                            },
                            {
                              "context" : "condition",
                              "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" : "sec2",
                              "contextType" : "variable",
                              "element" : "entry",
                              "variable" : "reference",
                              "transform" : "create",
                              "parameter" : [
                                {
                                  "valueString" : "Reference"
                                }
                              ]
                            },
                            {
                              "context" : "reference",
                              "contextType" : "variable",
                              "element" : "reference",
                              "transform" : "evaluate",
                              "parameter" : [
                                {
                                  "valueString" : "'https://example/Observation/' + %condition.id"
                                }
                              ]
                            }
                          ],
                          "rule" : [
                            {
                              "name" : "code",
                              "source" : [
                                {
                                  "context" : "section2",
                                  "element" : "code",
                                  "variable" : "vvv"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "condition",
                                  "contextType" : "variable",
                                  "element" : "code",
                                  "variable" : "vvv",
                                  "transform" : "create"
                                }
                              ]
                            },
                            {
                              "name" : "statuscode",
                              "source" : [
                                {
                                  "context" : "src",
                                  "condition" : "condition.statusCode.exists().not()"
                                }
                              ],
                              "rule" : [
                                {
                                  "name" : "status",
                                  "source" : [
                                    {
                                      "context" : "src"
                                    }
                                  ],
                                  "target" : [
                                    {
                                      "context" : "condition",
                                      "contextType" : "variable",
                                      "element" : "status",
                                      "transform" : "copy",
                                      "parameter" : [
                                        {
                                          "valueString" : "final"
                                        }
                                      ]
                                    }
                                  ]
                                }
                              ]
                            },
                            {
                              "name" : "reference",
                              "source" : [
                                {
                                  "context" : "cdaText"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "condition",
                                  "contextType" : "variable",
                                  "element" : "note",
                                  "variable" : "note"
                                }
                              ],
                              "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" : "reference",
                                  "source" : [
                                    {
                                      "context" : "cdaText",
                                      "variable" : "t"
                                    }
                                  ],
                                  "target" : [
                                    {
                                      "context" : "note",
                                      "contextType" : "variable",
                                      "element" : "text",
                                      "transform" : "copy",
                                      "parameter" : [
                                        {
                                          "valueId" : "t"
                                        }
                                      ]
                                    }
                                  ]
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "name" : "subsection1",
                      "source" : [
                        {
                          "context" : "section2",
                          "element" : "entry",
                          "variable" : "entry1"
                        }
                      ],
                      "rule" : [
                        {
                          "name" : "entry",
                          "source" : [
                            {
                              "context" : "entry1",
                              "element" : "observation",
                              "variable" : "obs"
                            }
                          ],
                          "rule" : [
                            {
                              "name" : "observationcondition",
                              "source" : [
                                {
                                  "context" : "obs",
                                  "element" : "code",
                                  "condition" : "(code = '75326-9')"
                                }
                              ],
                              "rule" : [
                                {
                                  "name" : "whereEntryPatologicaProssima",
                                  "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" : "sec2",
                                      "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" : "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" : "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" : "ob",
                                                                  "contextType" : "variable",
                                                                  "element" : "value",
                                                                  "transform" : "evaluate",
                                                                  "parameter" : [
                                                                    {
                                                                      "valueString" : "int.value"
                                                                    }
                                                                  ]
                                                                }
                                                              ]
                                                            },
                                                            {
                                                              "name" : "boolean",
                                                              "source" : [
                                                                {
                                                                  "context" : "observation2",
                                                                  "type" : "BL",
                                                                  "element" : "value",
                                                                  "variable" : "boolean"
                                                                }
                                                              ],
                                                              "target" : [
                                                                {
                                                                  "context" : "ob",
                                                                  "contextType" : "variable",
                                                                  "element" : "value",
                                                                  "transform" : "evaluate",
                                                                  "parameter" : [
                                                                    {
                                                                      "valueString" : "boolean.value"
                                                                    }
                                                                  ]
                                                                }
                                                              ]
                                                            },
                                                            {
                                                              "name" : "val",
                                                              "source" : [
                                                                {
                                                                  "context" : "observation2",
                                                                  "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" : "valueQuantity",
                                                              "source" : [
                                                                {
                                                                  "context" : "observation2",
                                                                  "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" : "observation2",
                                                                  "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" : "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"
                                                                        }
                                                                      ]
                                                                    }
                                                                  ]
                                                                }
                                                              ]
                                                            }
                                                          ]
                                                        }
                                                      ]
                                                    }
                                                  ]
                                                }
                                              ]
                                            }
                                          ]
                                        }
                                      ]
                                    }
                                  ]
                                }
                              ],
                              "documentation" : "EntryRelationship per il Problem"
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "name" : "esameObiettivo",
                      "source" : [
                        {
                          "context" : "section2",
                          "element" : "code",
                          "condition" : "(code = '29545-1')"
                        }
                      ],
                      "dependent" : [
                        {
                          "name" : "ClinicalDocumentSottoSectionOBS",
                          "variable" : [
                            "section2",
                            "sec2",
                            "bundle",
                            "enc",
                            "patient"
                          ]
                        }
                      ],
                      "documentation" : "ESAME PBIETTIVO"
                    },
                    {
                      "name" : "TerapiaFarmacologicaAllIngresso",
                      "source" : [
                        {
                          "context" : "section2",
                          "element" : "code",
                          "condition" : "(code = '42346-7')"
                        }
                      ],
                      "dependent" : [
                        {
                          "name" : "ClinicalDocumentSottoSectionMS",
                          "variable" : [
                            "section2",
                            "sec2",
                            "bundle",
                            "patient",
                            "enc"
                          ]
                        }
                      ],
                      "documentation" : "TETAPIA FARMACOLOGICA"
                    }
                  ],
                  "documentation" : "ANAMNESI"
                }
              ]
            }
          ]
        }
      ]
    },
    {
      "name" : "ClinicalDocumentSectionDecorsoOspedaliero",
      "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" : "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" : "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" : "reference",
                  "source" : [
                    {
                      "context" : "cdaText",
                      "variable" : "t"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "note",
                      "contextType" : "variable",
                      "element" : "text",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueId" : "t"
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ]
        },
        {
          "name" : "2",
          "source" : [
            {
              "context" : "src",
              "element" : "component",
              "variable" : "component"
            }
          ],
          "rule" : [
            {
              "name" : "1",
              "source" : [
                {
                  "context" : "component",
                  "element" : "section",
                  "variable" : "section2"
                }
              ],
              "rule" : [
                {
                  "name" : "Decorso",
                  "source" : [
                    {
                      "context" : "src"
                    }
                  ],
                  "dependent" : [
                    {
                      "name" : "ClinicalDocumentSottoSectionOBS",
                      "variable" : [
                        "section2",
                        "tgt",
                        "bundle",
                        "enc",
                        "patient"
                      ]
                    }
                  ]
                }
              ]
            }
          ]
        }
      ]
    },
    {
      "name" : "ClinicalDocumentSectionComplicanze",
      "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" : "exist",
          "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" : "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" : "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"
                            }
                          ]
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ]
        },
        {
          "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"
                  ]
                }
              ]
            }
          ]
        }
      ]
    },
    {
      "name" : "ClinicalDocumentSectionRiscontri",
      "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" : "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" : "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" : "reference",
                  "source" : [
                    {
                      "context" : "cdaText",
                      "variable" : "t"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "note",
                      "contextType" : "variable",
                      "element" : "text",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueId" : "t"
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ]
        },
        {
          "name" : "2",
          "source" : [
            {
              "context" : "src",
              "element" : "component",
              "variable" : "component"
            }
          ],
          "rule" : [
            {
              "name" : "1",
              "source" : [
                {
                  "context" : "component",
                  "element" : "section",
                  "variable" : "section2"
                }
              ],
              "rule" : [
                {
                  "name" : "Decorso",
                  "source" : [
                    {
                      "context" : "src"
                    }
                  ],
                  "dependent" : [
                    {
                      "name" : "ClinicalDocumentSottoSectionOBS",
                      "variable" : [
                        "section2",
                        "tgt",
                        "bundle",
                        "enc",
                        "patient"
                      ]
                    }
                  ]
                }
              ]
            }
          ]
        }
      ]
    },
    {
      "name" : "ClinicalDocumentSectionConsulenza",
      "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" : "exist",
          "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" : "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" : "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"
                            }
                          ]
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ]
        },
        {
          "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" : "ObservationConsulenza",
                  "variable" : [
                    "obs",
                    "patient",
                    "enc",
                    "observation",
                    "bundle"
                  ]
                }
              ]
            }
          ]
        }
      ]
    },
    {
      "name" : "ClinicalDocumentSectionEsamiEseguitiRicovero",
      "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" : "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" : "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" : "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"
                            }
                          ]
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ]
        },
        {
          "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" : "ObservationEsamiDuranteRicovero",
                  "variable" : [
                    "obs",
                    "patient",
                    "enc",
                    "observation",
                    "bundle"
                  ]
                }
              ]
            }
          ]
        }
      ]
    },
    {
      "name" : "ClinicalDocumentSectionProcedureEseguiteRicovero",
      "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" : "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" : "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" : "procedure",
                  "transform" : "create",
                  "parameter" : [
                    {
                      "valueString" : "Procedure"
                    }
                  ]
                },
                {
                  "context" : "procedure",
                  "contextType" : "variable",
                  "element" : "id",
                  "variable" : "uuid1",
                  "transform" : "uuid"
                },
                {
                  "context" : "e1",
                  "contextType" : "variable",
                  "element" : "fullUrl",
                  "transform" : "append",
                  "parameter" : [
                    {
                      "valueString" : "https://example/Procedure/"
                    },
                    {
                      "valueId" : "uuid1"
                    }
                  ]
                },
                {
                  "context" : "request",
                  "contextType" : "variable",
                  "element" : "url",
                  "transform" : "copy",
                  "parameter" : [
                    {
                      "valueString" : "Procedure"
                    }
                  ]
                },
                {
                  "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/Procedure/' + %procedure.id"
                    }
                  ]
                }
              ],
              "rule" : [
                {
                  "name" : "reference",
                  "source" : [
                    {
                      "context" : "src"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "procedure",
                      "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" : "procedure",
                      "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" : "src"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "procedure",
                      "contextType" : "variable",
                      "element" : "status",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "unknown"
                        }
                      ]
                    }
                  ]
                },
                {
                  "name" : "reference",
                  "source" : [
                    {
                      "context" : "cdaText"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "procedure",
                      "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" : "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" : "procedure",
              "transform" : "create",
              "parameter" : [
                {
                  "valueString" : "Procedure"
                }
              ]
            },
            {
              "context" : "procedure",
              "contextType" : "variable",
              "element" : "id",
              "variable" : "uuid1",
              "transform" : "uuid"
            },
            {
              "context" : "e1",
              "contextType" : "variable",
              "element" : "fullUrl",
              "transform" : "append",
              "parameter" : [
                {
                  "valueString" : "https://example/Procedure/"
                },
                {
                  "valueId" : "uuid1"
                }
              ]
            },
            {
              "context" : "request",
              "contextType" : "variable",
              "element" : "url",
              "transform" : "copy",
              "parameter" : [
                {
                  "valueString" : "Procedure"
                }
              ]
            },
            {
              "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/Procedure/' + %procedure.id"
                }
              ]
            }
          ],
          "rule" : [
            {
              "name" : "reference",
              "source" : [
                {
                  "context" : "src"
                }
              ],
              "target" : [
                {
                  "context" : "procedure",
                  "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" : "procedure",
                  "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" : "Procedure",
              "source" : [
                {
                  "context" : "entry1",
                  "element" : "procedure",
                  "variable" : "proceduresrc"
                }
              ],
              "rule" : [
                {
                  "name" : "code",
                  "source" : [
                    {
                      "context" : "proceduresrc",
                      "element" : "code",
                      "variable" : "vvv"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "procedure",
                      "contextType" : "variable",
                      "element" : "code",
                      "variable" : "vvv",
                      "transform" : "create"
                    }
                  ]
                },
                {
                  "name" : "text",
                  "source" : [
                    {
                      "context" : "proceduresrc",
                      "element" : "text",
                      "variable" : "txt"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "procedure",
                      "contextType" : "variable",
                      "element" : "note",
                      "variable" : "note"
                    }
                  ],
                  "rule" : [
                    {
                      "name" : "reference",
                      "source" : [
                        {
                          "context" : "txt",
                          "element" : "reference",
                          "variable" : "ref"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "note",
                          "contextType" : "variable",
                          "element" : "text",
                          "transform" : "evaluate",
                          "parameter" : [
                            {
                              "valueString" : "ref.value"
                            }
                          ]
                        }
                      ]
                    }
                  ]
                },
                {
                  "name" : "status",
                  "source" : [
                    {
                      "context" : "proceduresrc",
                      "condition" : "proc.statusCode.exists().not()"
                    }
                  ],
                  "rule" : [
                    {
                      "name" : "statuscode",
                      "source" : [
                        {
                          "context" : "proceduresrc"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "procedure",
                          "contextType" : "variable",
                          "element" : "status",
                          "transform" : "copy",
                          "parameter" : [
                            {
                              "valueString" : "unknown"
                            }
                          ]
                        }
                      ]
                    }
                  ]
                },
                {
                  "name" : "statusCode",
                  "source" : [
                    {
                      "context" : "proceduresrc",
                      "element" : "statusCode",
                      "variable" : "statusc",
                      "condition" : "(code = 'completed')"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "procedure",
                      "contextType" : "variable",
                      "element" : "status",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "completed"
                        }
                      ]
                    }
                  ]
                },
                {
                  "name" : "statusCode",
                  "source" : [
                    {
                      "context" : "proceduresrc",
                      "element" : "statusCode",
                      "variable" : "statusc",
                      "condition" : "(code = 'active')"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "procedure",
                      "contextType" : "variable",
                      "element" : "status",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "in-progress"
                        }
                      ]
                    }
                  ]
                },
                {
                  "name" : "statusCode",
                  "source" : [
                    {
                      "context" : "proceduresrc",
                      "element" : "statusCode",
                      "variable" : "statusc",
                      "condition" : "(code = 'aborted')"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "procedure",
                      "contextType" : "variable",
                      "element" : "status",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "stopped"
                        }
                      ]
                    }
                  ]
                },
                {
                  "name" : "statusCode",
                  "source" : [
                    {
                      "context" : "proceduresrc",
                      "element" : "statusCode",
                      "variable" : "statusc",
                      "condition" : "(code = 'suspended')"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "procedure",
                      "contextType" : "variable",
                      "element" : "status",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "on-hold"
                        }
                      ]
                    }
                  ]
                },
                {
                  "name" : "statusCode",
                  "source" : [
                    {
                      "context" : "proceduresrc",
                      "element" : "statusCode",
                      "variable" : "statusc",
                      "condition" : "(code = 'cancelled')"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "procedure",
                      "contextType" : "variable",
                      "element" : "status",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "not-done"
                        }
                      ]
                    }
                  ]
                },
                {
                  "name" : "statusCode",
                  "source" : [
                    {
                      "context" : "proceduresrc",
                      "element" : "statusCode",
                      "variable" : "statusc",
                      "condition" : "(code = 'held')"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "procedure",
                      "contextType" : "variable",
                      "element" : "status",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "on-hold"
                        }
                      ]
                    }
                  ]
                },
                {
                  "name" : "statusCode",
                  "source" : [
                    {
                      "context" : "proceduresrc",
                      "element" : "statusCode",
                      "variable" : "statusc",
                      "condition" : "(code = 'new')"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "procedure",
                      "contextType" : "variable",
                      "element" : "status",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "preparation"
                        }
                      ]
                    }
                  ]
                },
                {
                  "name" : "statusCode",
                  "source" : [
                    {
                      "context" : "proceduresrc",
                      "element" : "statusCode",
                      "variable" : "statusc",
                      "condition" : "(code = 'obsolete')"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "procedure",
                      "contextType" : "variable",
                      "element" : "status",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "entered-in-error"
                        }
                      ]
                    }
                  ]
                },
                {
                  "name" : "statusCode",
                  "source" : [
                    {
                      "context" : "proceduresrc",
                      "element" : "statusCode",
                      "variable" : "statusc",
                      "condition" : "(code = 'nullified')"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "procedure",
                      "contextType" : "variable",
                      "element" : "status",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "unknown"
                        }
                      ]
                    }
                  ]
                },
                {
                  "name" : "effectiveTime",
                  "source" : [
                    {
                      "context" : "proceduresrc",
                      "element" : "effectiveTime",
                      "variable" : "efft"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "procedure",
                      "contextType" : "variable",
                      "element" : "performed",
                      "variable" : "period",
                      "transform" : "create",
                      "parameter" : [
                        {
                          "valueString" : "Period"
                        }
                      ]
                    }
                  ],
                  "dependent" : [
                    {
                      "name" : "IVLTSPeriod",
                      "variable" : [
                        "efft",
                        "period"
                      ]
                    }
                  ]
                },
                {
                  "name" : "Observation",
                  "source" : [
                    {
                      "context" : "proceduresrc",
                      "element" : "entryRelationship",
                      "variable" : "entriRel"
                    }
                  ],
                  "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" : "procedure",
                      "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" : "entriRel"
                        }
                      ],
                      "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" : "entriRel"
                        }
                      ],
                      "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" : "ObservationValue",
                      "source" : [
                        {
                          "context" : "entriRel",
                          "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",
                              "condition" : "observation.statusCode.exists().not()"
                            }
                          ],
                          "rule" : [
                            {
                              "name" : "status",
                              "source" : [
                                {
                                  "context" : "obs"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "observation",
                                  "contextType" : "variable",
                                  "element" : "status",
                                  "transform" : "copy",
                                  "parameter" : [
                                    {
                                      "valueString" : "final"
                                    }
                                  ]
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ]
        }
      ]
    },
    {
      "name" : "ClinicalDocumentSectionAllergie",
      "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" : "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" : "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" : "allergy",
                  "transform" : "create",
                  "parameter" : [
                    {
                      "valueString" : "AllergyIntolerance"
                    }
                  ]
                },
                {
                  "context" : "allergy",
                  "contextType" : "variable",
                  "element" : "id",
                  "variable" : "uuid1",
                  "transform" : "uuid"
                },
                {
                  "context" : "e1",
                  "contextType" : "variable",
                  "element" : "fullUrl",
                  "transform" : "append",
                  "parameter" : [
                    {
                      "valueString" : "https://example/AllergyIntolerance/"
                    },
                    {
                      "valueId" : "uuid1"
                    }
                  ]
                },
                {
                  "context" : "request",
                  "contextType" : "variable",
                  "element" : "url",
                  "transform" : "copy",
                  "parameter" : [
                    {
                      "valueString" : "AllergyIntolerance"
                    }
                  ]
                },
                {
                  "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/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" : "allergy",
                  "source" : [
                    {
                      "context" : "src"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "allergy",
                      "contextType" : "variable",
                      "element" : "clinicalStatus",
                      "variable" : "status",
                      "transform" : "create",
                      "parameter" : [
                        {
                          "valueString" : "CodeableConcept"
                        }
                      ]
                    }
                  ],
                  "rule" : [
                    {
                      "name" : "text",
                      "source" : [
                        {
                          "context" : "src"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "status",
                          "contextType" : "variable",
                          "element" : "text",
                          "transform" : "copy",
                          "parameter" : [
                            {
                              "valueString" : "string"
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "name" : "coding",
                      "source" : [
                        {
                          "context" : "src"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "status",
                          "contextType" : "variable",
                          "element" : "coding",
                          "variable" : "coding",
                          "transform" : "create",
                          "parameter" : [
                            {
                              "valueString" : "Coding"
                            }
                          ]
                        }
                      ],
                      "rule" : [
                        {
                          "name" : "active",
                          "source" : [
                            {
                              "context" : "src"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "coding",
                              "contextType" : "variable",
                              "element" : "code",
                              "transform" : "copy",
                              "parameter" : [
                                {
                                  "valueString" : "active"
                                }
                              ]
                            }
                          ]
                        },
                        {
                          "name" : "system",
                          "source" : [
                            {
                              "context" : "src"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "coding",
                              "contextType" : "variable",
                              "element" : "system",
                              "transform" : "copy",
                              "parameter" : [
                                {
                                  "valueString" : "http://terminology.hl7.org/CodeSystem/allergyintolerance-clinical"
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  ]
                },
                {
                  "name" : "code",
                  "source" : [
                    {
                      "context" : "src",
                      "element" : "code",
                      "variable" : "vvv"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "allergy",
                      "contextType" : "variable",
                      "element" : "code",
                      "variable" : "vvv",
                      "transform" : "create"
                    }
                  ]
                },
                {
                  "name" : "reference",
                  "source" : [
                    {
                      "context" : "cdaText"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "allergy",
                      "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" : "allergy",
          "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" : "allergy",
              "transform" : "create",
              "parameter" : [
                {
                  "valueString" : "AllergyIntolerance"
                }
              ]
            },
            {
              "context" : "allergy",
              "contextType" : "variable",
              "element" : "id",
              "variable" : "uuid1",
              "transform" : "uuid"
            },
            {
              "context" : "e1",
              "contextType" : "variable",
              "element" : "fullUrl",
              "transform" : "append",
              "parameter" : [
                {
                  "valueString" : "https://example/AllergyIntolerance/"
                },
                {
                  "valueId" : "uuid1"
                }
              ]
            },
            {
              "context" : "request",
              "contextType" : "variable",
              "element" : "url",
              "transform" : "copy",
              "parameter" : [
                {
                  "valueString" : "AllergyIntolerance"
                }
              ]
            },
            {
              "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/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" : "act",
              "source" : [
                {
                  "context" : "entry1",
                  "element" : "act",
                  "variable" : "actallint"
                }
              ],
              "rule" : [
                {
                  "name" : "effectiveTime",
                  "source" : [
                    {
                      "context" : "actallint",
                      "element" : "effectiveTime",
                      "variable" : "eff"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "allergy",
                      "contextType" : "variable",
                      "element" : "onset",
                      "variable" : "per",
                      "transform" : "create",
                      "parameter" : [
                        {
                          "valueString" : "Period"
                        }
                      ]
                    }
                  ],
                  "dependent" : [
                    {
                      "name" : "IVLTSPeriod",
                      "variable" : [
                        "eff",
                        "per"
                      ]
                    }
                  ]
                },
                {
                  "name" : "entryRelationship",
                  "source" : [
                    {
                      "context" : "actallint",
                      "element" : "entryRelationship",
                      "variable" : "entryact"
                    }
                  ],
                  "rule" : [
                    {
                      "name" : "partic",
                      "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" : "PratRole",
                          "source" : [
                            {
                              "context" : "entryobs",
                              "element" : "participant",
                              "variable" : "partic"
                            }
                          ],
                          "rule" : [
                            {
                              "name" : "pratentit",
                              "source" : [
                                {
                                  "context" : "partic",
                                  "element" : "participantRole",
                                  "variable" : "pratRole"
                                }
                              ],
                              "rule" : [
                                {
                                  "name" : "react",
                                  "source" : [
                                    {
                                      "context" : "pratRole",
                                      "element" : "playingEntity",
                                      "variable" : "pratent"
                                    }
                                  ],
                                  "rule" : [
                                    {
                                      "name" : "cod",
                                      "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" : "entry",
                                          "source" : [
                                            {
                                              "context" : "entryobs",
                                              "element" : "entryRelationship",
                                              "variable" : "entryobs1",
                                              "condition" : "(typeCode = 'MFST')"
                                            }
                                          ],
                                          "rule" : [
                                            {
                                              "name" : "observ",
                                              "source" : [
                                                {
                                                  "context" : "entryobs1",
                                                  "element" : "observation",
                                                  "variable" : "entobs"
                                                }
                                              ],
                                              "rule" : [
                                                {
                                                  "name" : "eff",
                                                  "source" : [
                                                    {
                                                      "context" : "entobs",
                                                      "element" : "effectiveTime",
                                                      "variable" : "eff"
                                                    }
                                                  ],
                                                  "rule" : [
                                                    {
                                                      "name" : "val",
                                                      "source" : [
                                                        {
                                                          "context" : "eff",
                                                          "element" : "low",
                                                          "variable" : "l"
                                                        }
                                                      ],
                                                      "target" : [
                                                        {
                                                          "context" : "reaction",
                                                          "contextType" : "variable",
                                                          "element" : "onset",
                                                          "variable" : "start",
                                                          "transform" : "create",
                                                          "parameter" : [
                                                            {
                                                              "valueString" : "dateTime"
                                                            }
                                                          ]
                                                        }
                                                      ],
                                                      "dependent" : [
                                                        {
                                                          "name" : "TSDateTime",
                                                          "variable" : [
                                                            "l",
                                                            "start"
                                                          ]
                                                        }
                                                      ]
                                                    }
                                                  ]
                                                },
                                                {
                                                  "name" : "manifest",
                                                  "source" : [
                                                    {
                                                      "context" : "entobs",
                                                      "element" : "value",
                                                      "variable" : "vvv"
                                                    }
                                                  ],
                                                  "target" : [
                                                    {
                                                      "context" : "reaction",
                                                      "contextType" : "variable",
                                                      "element" : "manifestation",
                                                      "variable" : "vvv",
                                                      "transform" : "create"
                                                    }
                                                  ]
                                                }
                                              ]
                                            }
                                          ]
                                        }
                                      ]
                                    }
                                  ]
                                }
                              ]
                            }
                          ]
                        },
                        {
                          "name" : "observ",
                          "source" : [
                            {
                              "context" : "entryobs",
                              "element" : "entryRelationship",
                              "variable" : "entryobs2"
                            }
                          ],
                          "rule" : [
                            {
                              "name" : "severity",
                              "source" : [
                                {
                                  "context" : "entryobs2",
                                  "element" : "observation",
                                  "variable" : "entobs"
                                }
                              ],
                              "rule" : [
                                {
                                  "name" : "sev",
                                  "source" : [
                                    {
                                      "context" : "entobs",
                                      "element" : "code",
                                      "variable" : "code",
                                      "condition" : "(code = 'SEV')"
                                    }
                                  ],
                                  "rule" : [
                                    {
                                      "name" : "entobs",
                                      "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" : "entry3",
                          "source" : [
                            {
                              "context" : "entryobs",
                              "element" : "entryRelationship",
                              "variable" : "entryobs3"
                            }
                          ],
                          "rule" : [
                            {
                              "name" : "obobs3serv",
                              "source" : [
                                {
                                  "context" : "entryobs3",
                                  "element" : "observation",
                                  "variable" : "entobs"
                                }
                              ],
                              "rule" : [
                                {
                                  "name" : "stat",
                                  "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"
                                                        }
                                                      ]
                                                    }
                                                  ]
                                                }
                                              ]
                                            }
                                          ]
                                        }
                                      ]
                                    }
                                  ]
                                }
                              ]
                            }
                          ]
                        },
                        {
                          "name" : "entry4",
                          "source" : [
                            {
                              "context" : "entryobs",
                              "element" : "entryRelationship",
                              "variable" : "entryobs4"
                            }
                          ],
                          "rule" : [
                            {
                              "name" : "obobs4serv",
                              "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"
                                                }
                                              ]
                                            }
                                          ]
                                        }
                                      ]
                                    }
                                  ]
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ]
        }
      ]
    },
    {
      "name" : "ClinicalDocumentSectionDiagnosiDimissione",
      "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" : "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" : "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" : "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"
                            }
                          ]
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ]
        },
        {
          "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"
                  ]
                }
              ]
            }
          ]
        }
      ]
    },
    {
      "name" : "ClinicalDocumentSectionIstruzioniFollowUp",
      "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" : "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" : "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" : "cdaText"
                }
              ],
              "target" : [
                {
                  "context" : "carePlan",
                  "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" : "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" : "ClinicalDocumentSectionTerapiaFarmacologicaDuranteRicovero",
      "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" : "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" : "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" : "medicationAdm",
                  "transform" : "create",
                  "parameter" : [
                    {
                      "valueString" : "MedicationAdministration"
                    }
                  ]
                },
                {
                  "context" : "medicationAdm",
                  "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/' + %medicationAdm.id"
                    }
                  ]
                }
              ],
              "rule" : [
                {
                  "name" : "reference",
                  "source" : [
                    {
                      "context" : "cdaText"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "medicationAdm",
                      "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" : "medicationAdm",
                      "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" : "code",
                  "source" : [
                    {
                      "context" : "cdaText"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "medicationAdm",
                      "contextType" : "variable",
                      "element" : "medication",
                      "variable" : "codecon",
                      "transform" : "create",
                      "parameter" : [
                        {
                          "valueString" : "CodeableConcept"
                        }
                      ]
                    }
                  ],
                  "rule" : [
                    {
                      "name" : "text",
                      "source" : [
                        {
                          "context" : "cdaText"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "codecon",
                          "contextType" : "variable",
                          "element" : "text",
                          "transform" : "copy",
                          "parameter" : [
                            {
                              "valueString" : "string"
                            }
                          ]
                        }
                      ]
                    }
                  ]
                },
                {
                  "name" : "Period",
                  "source" : [
                    {
                      "context" : "src"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "medicationAdm",
                      "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" : "medicationAdm",
                          "contextType" : "variable",
                          "element" : "status",
                          "transform" : "copy",
                          "parameter" : [
                            {
                              "valueString" : "completed"
                            }
                          ]
                        }
                      ]
                    }
                  ]
                },
                {
                  "name" : "reference",
                  "source" : [
                    {
                      "context" : "cdaText"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "medicationAdm",
                      "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" : "sa",
          "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" : "medicationAdm",
              "transform" : "create",
              "parameter" : [
                {
                  "valueString" : "MedicationAdministration"
                }
              ]
            },
            {
              "context" : "medicationAdm",
              "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/' + %medicationAdm.id"
                }
              ]
            }
          ],
          "rule" : [
            {
              "name" : "reference",
              "source" : [
                {
                  "context" : "entry1"
                }
              ],
              "target" : [
                {
                  "context" : "medicationAdm",
                  "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" : "medicationAdm",
                  "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" : "entry",
              "source" : [
                {
                  "context" : "entry1",
                  "element" : "substanceAdministration",
                  "variable" : "sa"
                }
              ],
              "rule" : [
                {
                  "name" : "tx",
                  "source" : [
                    {
                      "context" : "sa",
                      "element" : "text",
                      "variable" : "tx"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "medicationAdm",
                      "contextType" : "variable",
                      "element" : "note",
                      "variable" : "note"
                    }
                  ],
                  "rule" : [
                    {
                      "name" : "perf",
                      "source" : [
                        {
                          "context" : "sa",
                          "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" : "time",
                          "source" : [
                            {
                              "context" : "performer",
                              "element" : "time",
                              "variable" : "ti"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "note",
                              "contextType" : "variable",
                              "element" : "time",
                              "transform" : "evaluate",
                              "parameter" : [
                                {
                                  "valueString" : "ti.value"
                                }
                              ]
                            }
                          ]
                        },
                        {
                          "name" : "assEntity",
                          "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/TerapiaFarmacologicaRicovero/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" : "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" : "copy",
                                          "parameter" : [
                                            {
                                              "valueString" : "Practitioner"
                                            }
                                          ]
                                        },
                                        {
                                          "context" : "medicationAdm",
                                          "contextType" : "variable",
                                          "element" : "performer",
                                          "variable" : "perf"
                                        },
                                        {
                                          "context" : "perf",
                                          "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" : "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" : "diverso",
                              "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" : "assi",
                              "source" : [
                                {
                                  "context" : "assEnty",
                                  "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"
                                    }
                                  ]
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "name" : "reference",
                      "source" : [
                        {
                          "context" : "tx",
                          "element" : "reference",
                          "variable" : "ref"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "note",
                          "contextType" : "variable",
                          "element" : "text",
                          "transform" : "evaluate",
                          "parameter" : [
                            {
                              "valueString" : "ref.value"
                            }
                          ]
                        }
                      ]
                    }
                  ]
                },
                {
                  "name" : "statusCode",
                  "source" : [
                    {
                      "context" : "sa",
                      "element" : "statusCode",
                      "variable" : "st"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "medicationAdm",
                      "contextType" : "variable",
                      "element" : "status",
                      "transform" : "evaluate",
                      "parameter" : [
                        {
                          "valueString" : "st.code"
                        }
                      ]
                    }
                  ]
                },
                {
                  "name" : "period",
                  "source" : [
                    {
                      "context" : "sa",
                      "element" : "effectiveTime",
                      "variable" : "eff"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "medicationAdm",
                      "contextType" : "variable",
                      "element" : "effective",
                      "variable" : "period",
                      "transform" : "create",
                      "parameter" : [
                        {
                          "valueString" : "Period"
                        }
                      ]
                    }
                  ],
                  "dependent" : [
                    {
                      "name" : "IVLTSPeriod",
                      "variable" : [
                        "eff",
                        "period"
                      ]
                    }
                  ]
                },
                {
                  "name" : "dos",
                  "source" : [
                    {
                      "context" : "sa"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "medicationAdm",
                      "contextType" : "variable",
                      "element" : "dosage",
                      "variable" : "dos"
                    }
                  ],
                  "rule" : [
                    {
                      "name" : "routeCode",
                      "source" : [
                        {
                          "context" : "sa",
                          "element" : "routeCode",
                          "variable" : "vvv"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "dos",
                          "contextType" : "variable",
                          "element" : "route",
                          "variable" : "vvv",
                          "transform" : "create"
                        }
                      ]
                    }
                  ]
                },
                {
                  "name" : "dos",
                  "source" : [
                    {
                      "context" : "sa"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "medicationAdm",
                      "contextType" : "variable",
                      "element" : "dosage",
                      "variable" : "dos"
                    }
                  ],
                  "rule" : [
                    {
                      "name" : "approachSiteCode",
                      "source" : [
                        {
                          "context" : "sa",
                          "element" : "approachSiteCode",
                          "variable" : "vvv"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "dos",
                          "contextType" : "variable",
                          "element" : "site",
                          "variable" : "vvv",
                          "transform" : "create"
                        }
                      ]
                    }
                  ]
                },
                {
                  "name" : "sa",
                  "source" : [
                    {
                      "context" : "sa",
                      "element" : "doseQuantity",
                      "variable" : "doseQuant"
                    }
                  ],
                  "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" : "medicationRq",
                      "transform" : "create",
                      "parameter" : [
                        {
                          "valueString" : "MedicationRequest"
                        }
                      ]
                    },
                    {
                      "context" : "medicationRq",
                      "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" : "medicationAdm",
                      "contextType" : "variable",
                      "element" : "request",
                      "variable" : "reference",
                      "transform" : "create",
                      "parameter" : [
                        {
                          "valueString" : "Reference"
                        }
                      ]
                    },
                    {
                      "context" : "reference",
                      "contextType" : "variable",
                      "element" : "reference",
                      "transform" : "evaluate",
                      "parameter" : [
                        {
                          "valueString" : "'https://example/MedicationRequest/' + %medicationRq.id"
                        }
                      ]
                    }
                  ],
                  "rule" : [
                    {
                      "name" : "Dosage",
                      "source" : [
                        {
                          "context" : "doseQuant"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "medicationRq",
                          "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" : "reference",
                      "source" : [
                        {
                          "context" : "sa"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "medicationRq",
                          "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" : "sa"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "medicationRq",
                          "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" : "sa"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "medicationRq",
                          "contextType" : "variable",
                          "element" : "status",
                          "transform" : "copy",
                          "parameter" : [
                            {
                              "valueString" : "active"
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "name" : "intent",
                      "source" : [
                        {
                          "context" : "sa"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "medicationRq",
                          "contextType" : "variable",
                          "element" : "intent",
                          "transform" : "copy",
                          "parameter" : [
                            {
                              "valueString" : "order"
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "name" : "Dosage",
                      "source" : [
                        {
                          "context" : "sa",
                          "element" : "rateQuantity",
                          "variable" : "rateQuantity"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "medicationRq",
                          "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" : "dosageRate",
                          "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" : "medication",
                      "source" : [
                        {
                          "context" : "sa"
                        }
                      ],
                      "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" : "medicationAdm",
                          "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" : "reference",
                          "source" : [
                            {
                              "context" : "sa"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "medicationRq",
                              "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"
                                }
                              ]
                            }
                          ]
                        },
                        {
                          "name" : "administrationUnitCode",
                          "source" : [
                            {
                              "context" : "sa",
                              "element" : "administrationUnitCode",
                              "variable" : "vvv"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "medication",
                              "contextType" : "variable",
                              "element" : "form",
                              "variable" : "vvv",
                              "transform" : "create"
                            }
                          ]
                        },
                        {
                          "name" : "consumable",
                          "source" : [
                            {
                              "context" : "sa",
                              "element" : "consumable",
                              "variable" : "consumable"
                            }
                          ],
                          "rule" : [
                            {
                              "name" : "manufac",
                              "source" : [
                                {
                                  "context" : "consumable",
                                  "element" : "manufacturedProduct",
                                  "variable" : "manufac"
                                }
                              ],
                              "rule" : [
                                {
                                  "name" : "manufactproduct",
                                  "source" : [
                                    {
                                      "context" : "manufac",
                                      "element" : "manufacturedMaterial",
                                      "variable" : "manuprod"
                                    }
                                  ],
                                  "rule" : [
                                    {
                                      "name" : "code",
                                      "source" : [
                                        {
                                          "context" : "manuprod",
                                          "element" : "code",
                                          "variable" : "vvv"
                                        }
                                      ],
                                      "target" : [
                                        {
                                          "context" : "medication",
                                          "contextType" : "variable",
                                          "element" : "code",
                                          "variable" : "vvv",
                                          "transform" : "create"
                                        }
                                      ]
                                    }
                                  ]
                                }
                              ]
                            }
                          ]
                        },
                        {
                          "name" : "entryRr",
                          "source" : [
                            {
                              "context" : "sa",
                              "element" : "entryRelationship",
                              "variable" : "entryRR"
                            }
                          ],
                          "rule" : [
                            {
                              "name" : "obs",
                              "source" : [
                                {
                                  "context" : "entryRR",
                                  "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" : "sa",
                                          "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" : "entryR",
                      "source" : [
                        {
                          "context" : "sa",
                          "element" : "entryRelationship",
                          "variable" : "entryRelationship"
                        }
                      ],
                      "rule" : [
                        {
                          "name" : "sub",
                          "source" : [
                            {
                              "context" : "entryRelationship",
                              "element" : "supply",
                              "variable" : "sup"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "medicationRq",
                              "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"
                                        }
                                      ]
                                    }
                                  ]
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "name" : "Medicationrequest",
                      "source" : [
                        {
                          "context" : "sa",
                          "element" : "participant",
                          "variable" : "participant"
                        }
                      ],
                      "rule" : [
                        {
                          "name" : "time",
                          "source" : [
                            {
                              "context" : "participant",
                              "element" : "time",
                              "variable" : "t"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "medicationRq",
                              "contextType" : "variable",
                              "element" : "authoredOn",
                              "transform" : "evaluate",
                              "parameter" : [
                                {
                                  "valueString" : "t.value"
                                }
                              ]
                            }
                          ]
                        },
                        {
                          "name" : "perf",
                          "source" : [
                            {
                              "context" : "participant",
                              "element" : "participantRole",
                              "variable" : "participantR"
                            }
                          ],
                          "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" : "meta",
                              "source" : [
                                {
                                  "context" : "participantR"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "practitioner",
                                  "contextType" : "variable",
                                  "element" : "meta",
                                  "variable" : "meta"
                                }
                              ],
                              "rule" : [
                                {
                                  "name" : "coding",
                                  "source" : [
                                    {
                                      "context" : "participantR"
                                    }
                                  ],
                                  "target" : [
                                    {
                                      "context" : "meta",
                                      "contextType" : "variable",
                                      "element" : "tag",
                                      "variable" : "coding",
                                      "transform" : "create",
                                      "parameter" : [
                                        {
                                          "valueString" : "Coding"
                                        }
                                      ]
                                    }
                                  ],
                                  "rule" : [
                                    {
                                      "name" : "system",
                                      "source" : [
                                        {
                                          "context" : "participantR"
                                        }
                                      ],
                                      "target" : [
                                        {
                                          "context" : "coding",
                                          "contextType" : "variable",
                                          "element" : "system",
                                          "transform" : "copy",
                                          "parameter" : [
                                            {
                                              "valueString" : "http://algoritmodiscoring"
                                            }
                                          ]
                                        }
                                      ]
                                    },
                                    {
                                      "name" : "code",
                                      "source" : [
                                        {
                                          "context" : "participantR"
                                        }
                                      ],
                                      "target" : [
                                        {
                                          "context" : "coding",
                                          "contextType" : "variable",
                                          "element" : "code",
                                          "transform" : "copy",
                                          "parameter" : [
                                            {
                                              "valueString" : "ClinicalDocument/body/TerapiaFarmacologicaRicovero/participant"
                                            }
                                          ]
                                        }
                                      ]
                                    }
                                  ]
                                }
                              ]
                            },
                            {
                              "name" : "identifier",
                              "source" : [
                                {
                                  "context" : "participantR",
                                  "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" : "uuid1"
                                            }
                                          ]
                                        },
                                        {
                                          "context" : "medicationRq",
                                          "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" : "participantR",
                                  "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" : "participantR",
                                  "element" : "playingEntity",
                                  "variable" : "assi"
                                }
                              ],
                              "rule" : [
                                {
                                  "name" : "name",
                                  "source" : [
                                    {
                                      "context" : "assi",
                                      "element" : "name",
                                      "variable" : "vvv"
                                    }
                                  ],
                                  "target" : [
                                    {
                                      "context" : "practitioner",
                                      "contextType" : "variable",
                                      "element" : "name",
                                      "variable" : "vvv",
                                      "transform" : "create"
                                    }
                                  ]
                                }
                              ]
                            }
                          ]
                        },
                        {
                          "name" : "period",
                          "source" : [
                            {
                              "context" : "sa",
                              "type" : "EIVL",
                              "element" : "effectiveTime",
                              "variable" : "eff"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "medicationRq",
                              "contextType" : "variable",
                              "element" : "dosageInstruction",
                              "variable" : "dosage",
                              "transform" : "create",
                              "parameter" : [
                                {
                                  "valueString" : "Dosage"
                                }
                              ]
                            }
                          ],
                          "rule" : [
                            {
                              "name" : "timing",
                              "source" : [
                                {
                                  "context" : "eff"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "dosage",
                                  "contextType" : "variable",
                                  "element" : "timing",
                                  "variable" : "timing",
                                  "transform" : "create",
                                  "parameter" : [
                                    {
                                      "valueString" : "Timing"
                                    }
                                  ]
                                }
                              ],
                              "rule" : [
                                {
                                  "name" : "rep",
                                  "source" : [
                                    {
                                      "context" : "eff"
                                    }
                                  ],
                                  "target" : [
                                    {
                                      "context" : "timing",
                                      "contextType" : "variable",
                                      "element" : "repeat",
                                      "variable" : "rep"
                                    }
                                  ],
                                  "rule" : [
                                    {
                                      "name" : "event",
                                      "source" : [
                                        {
                                          "context" : "eff",
                                          "element" : "event",
                                          "variable" : "ev"
                                        }
                                      ],
                                      "target" : [
                                        {
                                          "context" : "rep",
                                          "contextType" : "variable",
                                          "element" : "where",
                                          "transform" : "evaluate",
                                          "parameter" : [
                                            {
                                              "valueString" : "ev.code"
                                            }
                                          ]
                                        }
                                      ]
                                    }
                                  ]
                                }
                              ]
                            }
                          ]
                        },
                        {
                          "name" : "tim",
                          "source" : [
                            {
                              "context" : "sa",
                              "type" : "TS",
                              "element" : "effectiveTime",
                              "variable" : "eff"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "medicationRq",
                              "contextType" : "variable",
                              "element" : "dosageInstruction",
                              "variable" : "dosage",
                              "transform" : "create",
                              "parameter" : [
                                {
                                  "valueString" : "Dosage"
                                }
                              ]
                            },
                            {
                              "context" : "dosage",
                              "contextType" : "variable",
                              "element" : "timing",
                              "variable" : "timing",
                              "transform" : "create",
                              "parameter" : [
                                {
                                  "valueString" : "Timing"
                                }
                              ]
                            },
                            {
                              "context" : "timing",
                              "contextType" : "variable",
                              "element" : "event",
                              "transform" : "evaluate",
                              "parameter" : [
                                {
                                  "valueString" : "eff.value"
                                }
                              ]
                            }
                          ]
                        },
                        {
                          "name" : "eff",
                          "source" : [
                            {
                              "context" : "sa",
                              "type" : "PIVL_TS",
                              "element" : "effectiveTime",
                              "variable" : "eff"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "medicationAdm",
                              "contextType" : "variable",
                              "element" : "dosage",
                              "variable" : "dosage",
                              "transform" : "create",
                              "parameter" : [
                                {
                                  "valueString" : "BackboneElement"
                                }
                              ]
                            }
                          ],
                          "rule" : [
                            {
                              "name" : "ratio",
                              "source" : [
                                {
                                  "context" : "eff"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "dosage",
                                  "contextType" : "variable",
                                  "element" : "rate",
                                  "variable" : "ratio",
                                  "transform" : "create",
                                  "parameter" : [
                                    {
                                      "valueString" : "Ratio"
                                    }
                                  ]
                                }
                              ],
                              "rule" : [
                                {
                                  "name" : "quanti",
                                  "source" : [
                                    {
                                      "context" : "eff"
                                    }
                                  ],
                                  "target" : [
                                    {
                                      "context" : "ratio",
                                      "contextType" : "variable",
                                      "element" : "numerator",
                                      "variable" : "quan",
                                      "transform" : "create",
                                      "parameter" : [
                                        {
                                          "valueString" : "Quantity"
                                        }
                                      ]
                                    }
                                  ],
                                  "rule" : [
                                    {
                                      "name" : "period",
                                      "source" : [
                                        {
                                          "context" : "eff",
                                          "element" : "period",
                                          "variable" : "per"
                                        }
                                      ],
                                      "target" : [
                                        {
                                          "context" : "quan",
                                          "contextType" : "variable",
                                          "element" : "value",
                                          "transform" : "evaluate",
                                          "parameter" : [
                                            {
                                              "valueString" : "per.value"
                                            }
                                          ]
                                        }
                                      ]
                                    },
                                    {
                                      "name" : "period",
                                      "source" : [
                                        {
                                          "context" : "eff",
                                          "element" : "period",
                                          "variable" : "per"
                                        }
                                      ],
                                      "target" : [
                                        {
                                          "context" : "quan",
                                          "contextType" : "variable",
                                          "element" : "unit",
                                          "transform" : "evaluate",
                                          "parameter" : [
                                            {
                                              "valueString" : "per.unit"
                                            }
                                          ]
                                        }
                                      ]
                                    }
                                  ]
                                },
                                {
                                  "name" : "quanti",
                                  "source" : [
                                    {
                                      "context" : "eff"
                                    }
                                  ],
                                  "target" : [
                                    {
                                      "context" : "ratio",
                                      "contextType" : "variable",
                                      "element" : "denominator",
                                      "variable" : "quan",
                                      "transform" : "create",
                                      "parameter" : [
                                        {
                                          "valueString" : "Quantity"
                                        }
                                      ]
                                    }
                                  ],
                                  "rule" : [
                                    {
                                      "name" : "period",
                                      "source" : [
                                        {
                                          "context" : "eff",
                                          "element" : "period"
                                        }
                                      ],
                                      "target" : [
                                        {
                                          "context" : "quan",
                                          "contextType" : "variable",
                                          "element" : "value",
                                          "transform" : "copy",
                                          "parameter" : [
                                            {
                                              "valueString" : "1"
                                            }
                                          ]
                                        }
                                      ]
                                    },
                                    {
                                      "name" : "period",
                                      "source" : [
                                        {
                                          "context" : "eff",
                                          "element" : "period",
                                          "variable" : "per"
                                        }
                                      ],
                                      "target" : [
                                        {
                                          "context" : "quan",
                                          "contextType" : "variable",
                                          "element" : "unit",
                                          "transform" : "evaluate",
                                          "parameter" : [
                                            {
                                              "valueString" : "per.unit"
                                            }
                                          ]
                                        }
                                      ]
                                    }
                                  ]
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ]
        }
      ]
    },
    {
      "name" : "ClinicalDocumentSottoSectionOBS",
      "typeMode" : "none",
      "input" : [
        {
          "name" : "src",
          "type" : "Section",
          "mode" : "source"
        },
        {
          "name" : "tgt",
          "mode" : "target"
        },
        {
          "name" : "bundle",
          "type" : "Bundle",
          "mode" : "target"
        },
        {
          "name" : "enc",
          "type" : "Encounter",
          "mode" : "target"
        },
        {
          "name" : "patient",
          "type" : "Patient",
          "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" : "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" : "code",
              "source" : [
                {
                  "context" : "src",
                  "element" : "code",
                  "variable" : "vvv"
                }
              ],
              "target" : [
                {
                  "context" : "observation",
                  "contextType" : "variable",
                  "element" : "code",
                  "variable" : "vvv",
                  "transform" : "create"
                }
              ]
            },
            {
              "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" : "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" : "ClinicalDocumentSottoSectionMS",
      "typeMode" : "none",
      "input" : [
        {
          "name" : "src",
          "type" : "Section",
          "mode" : "source"
        },
        {
          "name" : "tgt",
          "mode" : "target"
        },
        {
          "name" : "bundle",
          "type" : "Bundle",
          "mode" : "target"
        },
        {
          "name" : "patient",
          "type" : "Patient",
          "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" : "Medicationstatement",
              "transform" : "create",
              "parameter" : [
                {
                  "valueString" : "MedicationStatement"
                }
              ]
            },
            {
              "context" : "Medicationstatement",
              "contextType" : "variable",
              "element" : "id",
              "variable" : "uuid1",
              "transform" : "uuid"
            },
            {
              "context" : "e1",
              "contextType" : "variable",
              "element" : "fullUrl",
              "transform" : "append",
              "parameter" : [
                {
                  "valueString" : "https://example/MedicationStatement/"
                },
                {
                  "valueId" : "uuid1"
                }
              ]
            },
            {
              "context" : "request",
              "contextType" : "variable",
              "element" : "url",
              "transform" : "copy",
              "parameter" : [
                {
                  "valueString" : "MedicationStatement"
                }
              ]
            },
            {
              "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/MedicationStatement/' + %Medicationstatement.id"
                }
              ]
            },
            {
              "context" : "tgt",
              "contextType" : "variable",
              "element" : "text",
              "variable" : "fhirText"
            }
          ],
          "rule" : [
            {
              "name" : "reference",
              "source" : [
                {
                  "context" : "cdaText"
                }
              ],
              "target" : [
                {
                  "context" : "Medicationstatement",
                  "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" : "text",
                  "source" : [
                    {
                      "context" : "cdaText",
                      "variable" : "t"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "Medicationstatement",
                      "contextType" : "variable",
                      "element" : "medication",
                      "variable" : "medication",
                      "transform" : "create",
                      "parameter" : [
                        {
                          "valueString" : "CodeableConcept"
                        }
                      ]
                    },
                    {
                      "context" : "medication",
                      "contextType" : "variable",
                      "element" : "text",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueId" : "t"
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "name" : "reference",
              "source" : [
                {
                  "context" : "src"
                }
              ],
              "target" : [
                {
                  "context" : "Medicationstatement",
                  "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" : "src"
                }
              ],
              "target" : [
                {
                  "context" : "Medicationstatement",
                  "contextType" : "variable",
                  "element" : "status",
                  "transform" : "copy",
                  "parameter" : [
                    {
                      "valueString" : "unknown"
                    }
                  ]
                }
              ]
            }
          ]
        }
      ]
    },
    {
      "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" : "value3",
              "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" : "boolean",
          "source" : [
            {
              "context" : "obs",
              "type" : "BL",
              "element" : "value",
              "variable" : "boolean"
            }
          ],
          "target" : [
            {
              "context" : "ob",
              "contextType" : "variable",
              "element" : "value",
              "transform" : "evaluate",
              "parameter" : [
                {
                  "valueString" : "boolean.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" : "qualifier",
                      "source" : [
                        {
                          "context" : "translation",
                          "element" : "qualifier",
                          "variable" : "qualifier"
                        }
                      ],
                      "rule" : [
                        {
                          "name" : "value",
                          "source" : [
                            {
                              "context" : "qualifier",
                              "element" : "value",
                              "variable" : "value"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "ce",
                              "contextType" : "variable",
                              "element" : "coding",
                              "variable" : "coding"
                            }
                          ],
                          "rule" : [
                            {
                              "name" : "code",
                              "source" : [
                                {
                                  "context" : "value",
                                  "element" : "code",
                                  "variable" : "code"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "coding",
                                  "contextType" : "variable",
                                  "element" : "code",
                                  "transform" : "cast",
                                  "parameter" : [
                                    {
                                      "valueId" : "code"
                                    },
                                    {
                                      "valueString" : "string"
                                    }
                                  ]
                                }
                              ]
                            },
                            {
                              "name" : "codeSystem",
                              "source" : [
                                {
                                  "context" : "value",
                                  "element" : "codeSystem",
                                  "variable" : "system"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "coding",
                                  "contextType" : "variable",
                                  "element" : "system",
                                  "transform" : "translate",
                                  "parameter" : [
                                    {
                                      "valueId" : "system"
                                    },
                                    {
                                      "valueString" : "http://hl7.org/fhir/ConceptMap/special-oid2uri"
                                    },
                                    {
                                      "valueString" : "uri"
                                    }
                                  ]
                                }
                              ]
                            },
                            {
                              "name" : "displayName",
                              "source" : [
                                {
                                  "context" : "value",
                                  "element" : "displayName",
                                  "variable" : "display"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "coding",
                                  "contextType" : "variable",
                                  "element" : "display",
                                  "transform" : "cast",
                                  "parameter" : [
                                    {
                                      "valueId" : "display"
                                    },
                                    {
                                      "valueString" : "string"
                                    }
                                  ]
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ]
        },
        {
          "name" : "val",
          "source" : [
            {
              "context" : "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" : "qualifier",
                      "source" : [
                        {
                          "context" : "translation",
                          "element" : "qualifier",
                          "variable" : "qualifier"
                        }
                      ],
                      "rule" : [
                        {
                          "name" : "value",
                          "source" : [
                            {
                              "context" : "qualifier",
                              "element" : "value",
                              "variable" : "value"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "ce",
                              "contextType" : "variable",
                              "element" : "coding",
                              "variable" : "coding"
                            }
                          ],
                          "rule" : [
                            {
                              "name" : "code",
                              "source" : [
                                {
                                  "context" : "value",
                                  "element" : "code",
                                  "variable" : "code"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "coding",
                                  "contextType" : "variable",
                                  "element" : "code",
                                  "transform" : "cast",
                                  "parameter" : [
                                    {
                                      "valueId" : "code"
                                    },
                                    {
                                      "valueString" : "string"
                                    }
                                  ]
                                }
                              ]
                            },
                            {
                              "name" : "codeSystem",
                              "source" : [
                                {
                                  "context" : "value",
                                  "element" : "codeSystem",
                                  "variable" : "system"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "coding",
                                  "contextType" : "variable",
                                  "element" : "system",
                                  "transform" : "translate",
                                  "parameter" : [
                                    {
                                      "valueId" : "system"
                                    },
                                    {
                                      "valueString" : "http://hl7.org/fhir/ConceptMap/special-oid2uri"
                                    },
                                    {
                                      "valueString" : "uri"
                                    }
                                  ]
                                }
                              ]
                            },
                            {
                              "name" : "displayName",
                              "source" : [
                                {
                                  "context" : "value",
                                  "element" : "displayName",
                                  "variable" : "display"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "coding",
                                  "contextType" : "variable",
                                  "element" : "display",
                                  "transform" : "cast",
                                  "parameter" : [
                                    {
                                      "valueId" : "display"
                                    },
                                    {
                                      "valueString" : "string"
                                    }
                                  ]
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ]
        },
        {
          "name" : "valueQuantity",
          "source" : [
            {
              "context" : "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" : "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" : "IVLPQ",
                  "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" : "ObservationConsulenza",
      "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" : "value2c",
          "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" : "value3c",
              "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" : "boolean",
          "source" : [
            {
              "context" : "obs",
              "type" : "BL",
              "element" : "value",
              "variable" : "boolean"
            }
          ],
          "target" : [
            {
              "context" : "ob",
              "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" : "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" : "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" : "qualifier",
                      "source" : [
                        {
                          "context" : "translation",
                          "element" : "qualifier",
                          "variable" : "qualifier"
                        }
                      ],
                      "rule" : [
                        {
                          "name" : "value",
                          "source" : [
                            {
                              "context" : "qualifier",
                              "element" : "value",
                              "variable" : "value"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "ce",
                              "contextType" : "variable",
                              "element" : "coding",
                              "variable" : "coding"
                            }
                          ],
                          "rule" : [
                            {
                              "name" : "code",
                              "source" : [
                                {
                                  "context" : "value",
                                  "element" : "code",
                                  "variable" : "code"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "coding",
                                  "contextType" : "variable",
                                  "element" : "code",
                                  "transform" : "cast",
                                  "parameter" : [
                                    {
                                      "valueId" : "code"
                                    },
                                    {
                                      "valueString" : "string"
                                    }
                                  ]
                                }
                              ]
                            },
                            {
                              "name" : "codeSystem",
                              "source" : [
                                {
                                  "context" : "value",
                                  "element" : "codeSystem",
                                  "variable" : "system"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "coding",
                                  "contextType" : "variable",
                                  "element" : "system",
                                  "transform" : "translate",
                                  "parameter" : [
                                    {
                                      "valueId" : "system"
                                    },
                                    {
                                      "valueString" : "http://hl7.org/fhir/ConceptMap/special-oid2uri"
                                    },
                                    {
                                      "valueString" : "uri"
                                    }
                                  ]
                                }
                              ]
                            },
                            {
                              "name" : "displayName",
                              "source" : [
                                {
                                  "context" : "value",
                                  "element" : "displayName",
                                  "variable" : "display"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "coding",
                                  "contextType" : "variable",
                                  "element" : "display",
                                  "transform" : "cast",
                                  "parameter" : [
                                    {
                                      "valueId" : "display"
                                    },
                                    {
                                      "valueString" : "string"
                                    }
                                  ]
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ]
        },
        {
          "name" : "valueQuantity",
          "source" : [
            {
              "context" : "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" : "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" : "IVLPQ",
                  "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"
            }
          ],
          "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/Consulenza/performer"
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  ]
                },
                {
                  "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" : "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"
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ]
        },
        {
          "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" : "time",
              "source" : [
                {
                  "context" : "participant",
                  "element" : "time",
                  "variable" : "t"
                }
              ],
              "target" : [
                {
                  "context" : "serviceRequest",
                  "contextType" : "variable",
                  "element" : "authoredOn",
                  "transform" : "evaluate",
                  "parameter" : [
                    {
                      "valueString" : "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"
                    }
                  ]
                }
              ],
              "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/Consulenza/participant"
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  ]
                },
                {
                  "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" : "uuid3",
                              "transform" : "evaluate",
                              "parameter" : [
                                {
                                  "valueString" : "r + '-' + ext"
                                }
                              ]
                            },
                            {
                              "context" : "e1",
                              "contextType" : "variable",
                              "element" : "fullUrl",
                              "transform" : "append",
                              "parameter" : [
                                {
                                  "valueString" : "https://example/Practitioner/"
                                },
                                {
                                  "valueId" : "uuid3"
                                }
                              ]
                            },
                            {
                              "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" : "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"
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ]
        }
      ]
    },
    {
      "name" : "ObservationEsamiDuranteRicovero",
      "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" : "value2r",
          "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" : "value3r",
              "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" : "boolean",
          "source" : [
            {
              "context" : "obs",
              "type" : "BL",
              "element" : "value",
              "variable" : "boolean"
            }
          ],
          "target" : [
            {
              "context" : "ob",
              "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" : "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" : "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" : "qualifier",
                      "source" : [
                        {
                          "context" : "translation",
                          "element" : "qualifier",
                          "variable" : "qualifier"
                        }
                      ],
                      "rule" : [
                        {
                          "name" : "value",
                          "source" : [
                            {
                              "context" : "qualifier",
                              "element" : "value",
                              "variable" : "value"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "ce",
                              "contextType" : "variable",
                              "element" : "coding",
                              "variable" : "coding"
                            }
                          ],
                          "rule" : [
                            {
                              "name" : "code",
                              "source" : [
                                {
                                  "context" : "value",
                                  "element" : "code",
                                  "variable" : "code"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "coding",
                                  "contextType" : "variable",
                                  "element" : "code",
                                  "transform" : "cast",
                                  "parameter" : [
                                    {
                                      "valueId" : "code"
                                    },
                                    {
                                      "valueString" : "string"
                                    }
                                  ]
                                }
                              ]
                            },
                            {
                              "name" : "codeSystem",
                              "source" : [
                                {
                                  "context" : "value",
                                  "element" : "codeSystem",
                                  "variable" : "system"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "coding",
                                  "contextType" : "variable",
                                  "element" : "system",
                                  "transform" : "translate",
                                  "parameter" : [
                                    {
                                      "valueId" : "system"
                                    },
                                    {
                                      "valueString" : "http://hl7.org/fhir/ConceptMap/special-oid2uri"
                                    },
                                    {
                                      "valueString" : "uri"
                                    }
                                  ]
                                }
                              ]
                            },
                            {
                              "name" : "displayName",
                              "source" : [
                                {
                                  "context" : "value",
                                  "element" : "displayName",
                                  "variable" : "display"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "coding",
                                  "contextType" : "variable",
                                  "element" : "display",
                                  "transform" : "cast",
                                  "parameter" : [
                                    {
                                      "valueId" : "display"
                                    },
                                    {
                                      "valueString" : "string"
                                    }
                                  ]
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ]
        },
        {
          "name" : "valueQuantity",
          "source" : [
            {
              "context" : "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" : "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" : "effectiveTime",
          "source" : [
            {
              "context" : "obs",
              "element" : "effectiveTime",
              "variable" : "eff"
            }
          ],
          "target" : [
            {
              "context" : "ob",
              "contextType" : "variable",
              "element" : "effective",
              "variable" : "per",
              "transform" : "create",
              "parameter" : [
                {
                  "valueString" : "Period"
                }
              ]
            }
          ],
          "dependent" : [
            {
              "name" : "IVLTSPeriod",
              "variable" : [
                "eff",
                "per"
              ]
            }
          ]
        },
        {
          "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" : "IVLPQ",
                  "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"
            }
          ],
          "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/EsamiDuranteRicovero/performer"
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  ]
                },
                {
                  "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" : "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"
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ]
        },
        {
          "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" : "time",
              "source" : [
                {
                  "context" : "participant",
                  "element" : "time",
                  "variable" : "t"
                }
              ],
              "target" : [
                {
                  "context" : "serviceRequest",
                  "contextType" : "variable",
                  "element" : "authoredOn",
                  "transform" : "evaluate",
                  "parameter" : [
                    {
                      "valueString" : "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"
                    }
                  ]
                }
              ],
              "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/EsamiDuranteRicovero/participant"
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  ]
                },
                {
                  "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" : "uuid3",
                              "transform" : "evaluate",
                              "parameter" : [
                                {
                                  "valueString" : "r + '-' + ext"
                                }
                              ]
                            },
                            {
                              "context" : "e1",
                              "contextType" : "variable",
                              "element" : "fullUrl",
                              "transform" : "append",
                              "parameter" : [
                                {
                                  "valueString" : "https://example/Practitioner/"
                                },
                                {
                                  "valueId" : "uuid3"
                                }
                              ]
                            },
                            {
                              "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" : "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"
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ]
        }
      ]
    },
    {
      "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"
                    }
                  ]
                }
              ]
            }
          ]
        }
      ]
    },
    {
      "name" : "Act",
      "typeMode" : "none",
      "documentation" : "---------------------------------------------------------------------------------------",
      "input" : [
        {
          "name" : "cda",
          "type" : "Act",
          "mode" : "source"
        },
        {
          "name" : "pat",
          "type" : "Patient",
          "mode" : "target"
        },
        {
          "name" : "ac",
          "type" : "DiagnosticReport",
          "mode" : "target"
        },
        {
          "name" : "enc",
          "type" : "Encounter",
          "mode" : "target"
        },
        {
          "name" : "bundle",
          "type" : "Bundle",
          "mode" : "target"
        }
      ],
      "rule" : [
        {
          "name" : "code",
          "source" : [
            {
              "context" : "cda",
              "element" : "code",
              "variable" : "vvv"
            }
          ],
          "target" : [
            {
              "context" : "ac",
              "contextType" : "variable",
              "element" : "code",
              "variable" : "vvv",
              "transform" : "create"
            }
          ]
        },
        {
          "name" : "statusCode",
          "source" : [
            {
              "context" : "cda",
              "element" : "statusCode",
              "variable" : "statusc",
              "condition" : "(code = 'completed')"
            }
          ],
          "target" : [
            {
              "context" : "ob",
              "contextType" : "variable",
              "element" : "status",
              "transform" : "copy",
              "parameter" : [
                {
                  "valueString" : "final"
                }
              ]
            }
          ]
        },
        {
          "name" : "statusCode",
          "source" : [
            {
              "context" : "cda",
              "element" : "statusCode",
              "variable" : "statusc",
              "condition" : "(code = 'active')"
            }
          ],
          "target" : [
            {
              "context" : "ob",
              "contextType" : "variable",
              "element" : "status",
              "transform" : "copy",
              "parameter" : [
                {
                  "valueString" : "registered"
                }
              ]
            }
          ]
        },
        {
          "name" : "statusCode",
          "source" : [
            {
              "context" : "cda",
              "element" : "statusCode",
              "variable" : "statusc",
              "condition" : "(code = 'aborted')"
            }
          ],
          "target" : [
            {
              "context" : "ob",
              "contextType" : "variable",
              "element" : "status",
              "transform" : "copy",
              "parameter" : [
                {
                  "valueString" : "cancelled"
                }
              ]
            }
          ]
        },
        {
          "name" : "statusCode",
          "source" : [
            {
              "context" : "cda",
              "element" : "statusCode",
              "variable" : "statusc",
              "condition" : "(code = 'suspended')"
            }
          ],
          "target" : [
            {
              "context" : "ob",
              "contextType" : "variable",
              "element" : "status",
              "transform" : "copy",
              "parameter" : [
                {
                  "valueString" : "partial"
                }
              ]
            }
          ]
        },
        {
          "name" : "value2a",
          "source" : [
            {
              "context" : "cda",
              "element" : "effectiveTime",
              "variable" : "effectiveTime"
            }
          ],
          "target" : [
            {
              "context" : "ac",
              "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" : "value3a",
              "source" : [
                {
                  "context" : "cda",
                  "element" : "effectiveTime",
                  "variable" : "eff"
                }
              ],
              "target" : [
                {
                  "context" : "ac",
                  "contextType" : "variable",
                  "element" : "effective",
                  "variable" : "period",
                  "transform" : "create",
                  "parameter" : [
                    {
                      "valueString" : "Period"
                    }
                  ]
                }
              ],
              "dependent" : [
                {
                  "name" : "IVLTSPeriod",
                  "variable" : [
                    "eff",
                    "period"
                  ]
                }
              ]
            }
          ]
        },
        {
          "name" : "reference",
          "source" : [
            {
              "context" : "cda"
            }
          ],
          "target" : [
            {
              "context" : "ac",
              "contextType" : "variable",
              "element" : "subject",
              "variable" : "reference",
              "transform" : "create",
              "parameter" : [
                {
                  "valueString" : "Reference"
                }
              ]
            },
            {
              "context" : "reference",
              "contextType" : "variable",
              "element" : "reference",
              "transform" : "evaluate",
              "parameter" : [
                {
                  "valueString" : "'https://example/' + %pat.id"
                }
              ]
            }
          ]
        },
        {
          "name" : "reference",
          "source" : [
            {
              "context" : "cda"
            }
          ],
          "target" : [
            {
              "context" : "ac",
              "contextType" : "variable",
              "element" : "encounter",
              "variable" : "reference",
              "transform" : "create",
              "parameter" : [
                {
                  "valueString" : "Reference"
                }
              ]
            },
            {
              "context" : "reference",
              "contextType" : "variable",
              "element" : "reference",
              "transform" : "evaluate",
              "parameter" : [
                {
                  "valueString" : "'https://example/' + %enc.id"
                }
              ]
            }
          ]
        },
        {
          "name" : "participant",
          "source" : [
            {
              "context" : "cda",
              "element" : "participant",
              "variable" : "part"
            }
          ],
          "target" : [
            {
              "context" : "enc",
              "contextType" : "variable",
              "element" : "participant",
              "variable" : "participant"
            }
          ],
          "rule" : [
            {
              "name" : "type",
              "source" : [
                {
                  "context" : "part"
                }
              ],
              "target" : [
                {
                  "context" : "participant",
                  "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" : "participantRole",
              "source" : [
                {
                  "context" : "part",
                  "element" : "participantRole",
                  "variable" : "participantRole"
                }
              ],
              "target" : [
                {
                  "context" : "participant",
                  "contextType" : "variable",
                  "element" : "individual",
                  "variable" : "reference",
                  "transform" : "create",
                  "parameter" : [
                    {
                      "valueString" : "Reference"
                    }
                  ]
                }
              ],
              "rule" : [
                {
                  "name" : "participanRoleBund",
                  "source" : [
                    {
                      "context" : "participantRole"
                    }
                  ],
                  "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" : "PUT"
                        }
                      ]
                    },
                    {
                      "context" : "e",
                      "contextType" : "variable",
                      "element" : "resource",
                      "variable" : "practitioner",
                      "transform" : "create",
                      "parameter" : [
                        {
                          "valueString" : "Practitioner"
                        }
                      ]
                    },
                    {
                      "context" : "practitioner",
                      "contextType" : "variable",
                      "element" : "id",
                      "variable" : "uuid1",
                      "transform" : "uuid"
                    },
                    {
                      "context" : "e",
                      "contextType" : "variable",
                      "element" : "fullUrl",
                      "transform" : "append",
                      "parameter" : [
                        {
                          "valueString" : "https://example/Practitioner/"
                        },
                        {
                          "valueId" : "uuid1"
                        }
                      ]
                    },
                    {
                      "context" : "reference",
                      "contextType" : "variable",
                      "element" : "reference",
                      "transform" : "evaluate",
                      "parameter" : [
                        {
                          "valueString" : "'https://example/Practitioner/' + %practitioner.id"
                        }
                      ]
                    }
                  ],
                  "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/Act/participant"
                                    }
                                  ]
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "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" : "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" : "participantRole"
                                }
                              ],
                              "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" : "playingEntity",
                      "source" : [
                        {
                          "context" : "participantRole",
                          "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"
                            }
                          ]
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ]
        },
        {
          "name" : "entryRelationship",
          "source" : [
            {
              "context" : "cda",
              "element" : "entryRelationship",
              "variable" : "entryRelationship"
            }
          ],
          "rule" : [
            {
              "name" : "OBS",
              "source" : [
                {
                  "context" : "entryRelationship",
                  "element" : "observation",
                  "variable" : "observation"
                }
              ],
              "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" : "obs",
                  "transform" : "create",
                  "parameter" : [
                    {
                      "valueString" : "Observation"
                    }
                  ]
                },
                {
                  "context" : "obs",
                  "contextType" : "variable",
                  "element" : "id",
                  "variable" : "uuid2",
                  "transform" : "uuid"
                },
                {
                  "context" : "e",
                  "contextType" : "variable",
                  "element" : "fullUrl",
                  "transform" : "append",
                  "parameter" : [
                    {
                      "valueString" : "https://example/Observation/"
                    },
                    {
                      "valueId" : "uuid2"
                    }
                  ]
                },
                {
                  "context" : "request",
                  "contextType" : "variable",
                  "element" : "url",
                  "transform" : "append",
                  "parameter" : [
                    {
                      "valueString" : "Observation/"
                    },
                    {
                      "valueId" : "uuid2"
                    }
                  ]
                },
                {
                  "context" : "ac",
                  "contextType" : "variable",
                  "element" : "result",
                  "variable" : "reference",
                  "transform" : "create",
                  "parameter" : [
                    {
                      "valueString" : "Reference"
                    }
                  ]
                },
                {
                  "context" : "reference",
                  "contextType" : "variable",
                  "element" : "reference",
                  "transform" : "evaluate",
                  "parameter" : [
                    {
                      "valueString" : "'https://example/Observation/' + %obs.id"
                    }
                  ]
                }
              ],
              "dependent" : [
                {
                  "name" : "Observation",
                  "variable" : [
                    "observation",
                    "pat",
                    "enc",
                    "obs",
                    "bundle"
                  ]
                }
              ]
            }
          ]
        }
      ]
    },
    {
      "name" : "ClinicalDocumentSectionTerapiaDimissione",
      "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" : "exist",
          "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" : "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" : "medicationRq",
                  "transform" : "create",
                  "parameter" : [
                    {
                      "valueString" : "MedicationRequest"
                    }
                  ]
                },
                {
                  "context" : "medicationRq",
                  "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/' + %medicationRq.id"
                    }
                  ]
                }
              ],
              "rule" : [
                {
                  "name" : "reference",
                  "source" : [
                    {
                      "context" : "src"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "medicationRq",
                      "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" : "medicationRq",
                      "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" : "medicationRq",
                      "contextType" : "variable",
                      "element" : "status",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "active"
                        }
                      ]
                    }
                  ]
                },
                {
                  "name" : "intent",
                  "source" : [
                    {
                      "context" : "src"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "medicationRq",
                      "contextType" : "variable",
                      "element" : "intent",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "order"
                        }
                      ]
                    }
                  ]
                },
                {
                  "name" : "code",
                  "source" : [
                    {
                      "context" : "cdaText"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "medicationRq",
                      "contextType" : "variable",
                      "element" : "medication",
                      "variable" : "codecon",
                      "transform" : "create",
                      "parameter" : [
                        {
                          "valueString" : "CodeableConcept"
                        }
                      ]
                    }
                  ],
                  "rule" : [
                    {
                      "name" : "text",
                      "source" : [
                        {
                          "context" : "cdaText"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "codecon",
                          "contextType" : "variable",
                          "element" : "text",
                          "transform" : "copy",
                          "parameter" : [
                            {
                              "valueString" : "string"
                            }
                          ]
                        }
                      ]
                    }
                  ]
                },
                {
                  "name" : "reference",
                  "source" : [
                    {
                      "context" : "cdaText"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "medicationRq",
                      "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" : "substract",
          "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" : "medicationRq",
              "transform" : "create",
              "parameter" : [
                {
                  "valueString" : "MedicationRequest"
                }
              ]
            },
            {
              "context" : "medicationRq",
              "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/' + %medicationRq.id"
                }
              ]
            }
          ],
          "rule" : [
            {
              "name" : "reference",
              "source" : [
                {
                  "context" : "src"
                }
              ],
              "target" : [
                {
                  "context" : "medicationRq",
                  "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" : "medicationRq",
                  "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" : "medicationRq",
                  "contextType" : "variable",
                  "element" : "status",
                  "transform" : "copy",
                  "parameter" : [
                    {
                      "valueString" : "active"
                    }
                  ]
                }
              ]
            },
            {
              "name" : "intent",
              "source" : [
                {
                  "context" : "src"
                }
              ],
              "target" : [
                {
                  "context" : "medicationRq",
                  "contextType" : "variable",
                  "element" : "intent",
                  "transform" : "copy",
                  "parameter" : [
                    {
                      "valueString" : "order"
                    }
                  ]
                }
              ]
            },
            {
              "name" : "participant",
              "source" : [
                {
                  "context" : "entry1",
                  "element" : "substanceAdministration",
                  "variable" : "substract"
                }
              ],
              "rule" : [
                {
                  "name" : "cons",
                  "source" : [
                    {
                      "context" : "substract",
                      "element" : "consumable",
                      "variable" : "cons"
                    }
                  ],
                  "rule" : [
                    {
                      "name" : "man1",
                      "source" : [
                        {
                          "context" : "cons",
                          "element" : "manufacturedProduct",
                          "variable" : "man1"
                        }
                      ],
                      "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" : "medicationRq",
                          "contextType" : "variable",
                          "element" : "medication",
                          "variable" : "medref",
                          "transform" : "create",
                          "parameter" : [
                            {
                              "valueString" : "Reference"
                            }
                          ]
                        },
                        {
                          "context" : "medref",
                          "contextType" : "variable",
                          "element" : "reference",
                          "transform" : "evaluate",
                          "parameter" : [
                            {
                              "valueString" : "'https://example/Medication/' + %medication.id"
                            }
                          ]
                        }
                      ],
                      "rule" : [
                        {
                          "name" : "mm",
                          "source" : [
                            {
                              "context" : "man1",
                              "element" : "manufacturedMaterial",
                              "variable" : "mm"
                            }
                          ],
                          "rule" : [
                            {
                              "name" : "code",
                              "source" : [
                                {
                                  "context" : "mm",
                                  "element" : "code",
                                  "variable" : "vvv"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "medication",
                                  "contextType" : "variable",
                                  "element" : "code",
                                  "variable" : "vvv",
                                  "transform" : "create"
                                }
                              ]
                            }
                          ]
                        },
                        {
                          "name" : "administrationUnitCode",
                          "source" : [
                            {
                              "context" : "substract",
                              "element" : "administrationUnitCode",
                              "variable" : "vvv"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "medication",
                              "contextType" : "variable",
                              "element" : "form",
                              "variable" : "vvv",
                              "transform" : "create"
                            }
                          ]
                        },
                        {
                          "name" : "entryR",
                          "source" : [
                            {
                              "context" : "substract",
                              "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" : "substract",
                                          "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" : "entry",
                          "source" : [
                            {
                              "context" : "substract",
                              "element" : "entryRelationship",
                              "variable" : "entryRelationship"
                            }
                          ],
                          "rule" : [
                            {
                              "name" : "sub",
                              "source" : [
                                {
                                  "context" : "entryRelationship",
                                  "element" : "supply",
                                  "variable" : "sup"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "medicationRq",
                                  "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"
                                            }
                                          ]
                                        }
                                      ]
                                    }
                                  ]
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  ]
                },
                {
                  "name" : "tx",
                  "source" : [
                    {
                      "context" : "substract",
                      "element" : "text",
                      "variable" : "tx"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "medicationRq",
                      "contextType" : "variable",
                      "element" : "note",
                      "variable" : "note"
                    }
                  ],
                  "rule" : [
                    {
                      "name" : "reference",
                      "source" : [
                        {
                          "context" : "tx",
                          "element" : "reference",
                          "variable" : "ref"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "note",
                          "contextType" : "variable",
                          "element" : "text",
                          "transform" : "evaluate",
                          "parameter" : [
                            {
                              "valueString" : "ref.value"
                            }
                          ]
                        }
                      ]
                    }
                  ]
                },
                {
                  "name" : "statusCode",
                  "source" : [
                    {
                      "context" : "substract",
                      "element" : "statusCode",
                      "variable" : "st"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "medicationRq",
                      "contextType" : "variable",
                      "element" : "status",
                      "transform" : "evaluate",
                      "parameter" : [
                        {
                          "valueString" : "st.code"
                        }
                      ]
                    }
                  ]
                },
                {
                  "name" : "period",
                  "source" : [
                    {
                      "context" : "substract",
                      "type" : "IVL_TS",
                      "element" : "effectiveTime",
                      "variable" : "eff"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "medicationRq",
                      "contextType" : "variable",
                      "element" : "dosageInstruction",
                      "variable" : "dosage",
                      "transform" : "create",
                      "parameter" : [
                        {
                          "valueString" : "Dosage"
                        }
                      ]
                    }
                  ],
                  "rule" : [
                    {
                      "name" : "timing",
                      "source" : [
                        {
                          "context" : "eff"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "dosage",
                          "contextType" : "variable",
                          "element" : "timing",
                          "variable" : "timing",
                          "transform" : "create",
                          "parameter" : [
                            {
                              "valueString" : "Timing"
                            }
                          ]
                        }
                      ],
                      "rule" : [
                        {
                          "name" : "rep",
                          "source" : [
                            {
                              "context" : "eff"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "timing",
                              "contextType" : "variable",
                              "element" : "repeat",
                              "variable" : "rep"
                            }
                          ],
                          "rule" : [
                            {
                              "name" : "period",
                              "source" : [
                                {
                                  "context" : "eff"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "rep",
                                  "contextType" : "variable",
                                  "element" : "bounds",
                                  "variable" : "period",
                                  "transform" : "create",
                                  "parameter" : [
                                    {
                                      "valueString" : "Period"
                                    }
                                  ]
                                }
                              ],
                              "dependent" : [
                                {
                                  "name" : "IVLTSPeriod",
                                  "variable" : [
                                    "eff",
                                    "period"
                                  ]
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  ]
                },
                {
                  "name" : "period",
                  "source" : [
                    {
                      "context" : "substract",
                      "type" : "EIVL_TS",
                      "element" : "effectiveTime",
                      "variable" : "eff"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "medicationRq",
                      "contextType" : "variable",
                      "element" : "dosageInstruction",
                      "variable" : "dosage",
                      "transform" : "create",
                      "parameter" : [
                        {
                          "valueString" : "Dosage"
                        }
                      ]
                    }
                  ],
                  "rule" : [
                    {
                      "name" : "timing",
                      "source" : [
                        {
                          "context" : "eff"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "dosage",
                          "contextType" : "variable",
                          "element" : "timing",
                          "variable" : "timing",
                          "transform" : "create",
                          "parameter" : [
                            {
                              "valueString" : "Timing"
                            }
                          ]
                        }
                      ],
                      "rule" : [
                        {
                          "name" : "rep",
                          "source" : [
                            {
                              "context" : "eff"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "timing",
                              "contextType" : "variable",
                              "element" : "repeat",
                              "variable" : "rep"
                            }
                          ],
                          "rule" : [
                            {
                              "name" : "event",
                              "source" : [
                                {
                                  "context" : "eff",
                                  "element" : "event",
                                  "variable" : "ev"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "rep",
                                  "contextType" : "variable",
                                  "element" : "when",
                                  "transform" : "evaluate",
                                  "parameter" : [
                                    {
                                      "valueString" : "ev.code"
                                    }
                                  ]
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  ]
                },
                {
                  "name" : "tim",
                  "source" : [
                    {
                      "context" : "substract",
                      "type" : "IVL_TS",
                      "element" : "effectiveTime",
                      "variable" : "eff"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "medicationRq",
                      "contextType" : "variable",
                      "element" : "dosageInstruction",
                      "variable" : "dosage",
                      "transform" : "create",
                      "parameter" : [
                        {
                          "valueString" : "Dosage"
                        }
                      ]
                    },
                    {
                      "context" : "dosage",
                      "contextType" : "variable",
                      "element" : "timing",
                      "variable" : "timing",
                      "transform" : "create",
                      "parameter" : [
                        {
                          "valueString" : "Timing"
                        }
                      ]
                    },
                    {
                      "context" : "timing",
                      "contextType" : "variable",
                      "element" : "event",
                      "transform" : "evaluate",
                      "parameter" : [
                        {
                          "valueString" : "eff.value"
                        }
                      ]
                    }
                  ]
                },
                {
                  "name" : "eff",
                  "source" : [
                    {
                      "context" : "substract",
                      "type" : "PIVL_TS",
                      "element" : "effectiveTime",
                      "variable" : "eff"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "medicationRq",
                      "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" : "substract"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "medicationRq",
                      "contextType" : "variable",
                      "element" : "dosageInstruction",
                      "variable" : "dosage",
                      "transform" : "create",
                      "parameter" : [
                        {
                          "valueString" : "Dosage"
                        }
                      ]
                    }
                  ],
                  "rule" : [
                    {
                      "name" : "routeCode",
                      "source" : [
                        {
                          "context" : "substract",
                          "element" : "routeCode",
                          "variable" : "vvv"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "dosage",
                          "contextType" : "variable",
                          "element" : "route",
                          "variable" : "vvv",
                          "transform" : "create"
                        }
                      ]
                    }
                  ]
                },
                {
                  "name" : "dosage",
                  "source" : [
                    {
                      "context" : "substract"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "medicationRq",
                      "contextType" : "variable",
                      "element" : "dosageInstruction",
                      "variable" : "dosage",
                      "transform" : "create",
                      "parameter" : [
                        {
                          "valueString" : "Dosage"
                        }
                      ]
                    }
                  ],
                  "rule" : [
                    {
                      "name" : "approachSiteCode",
                      "source" : [
                        {
                          "context" : "substract",
                          "element" : "approachSiteCode",
                          "variable" : "vvv"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "dosage",
                          "contextType" : "variable",
                          "element" : "site",
                          "variable" : "vvv",
                          "transform" : "create"
                        }
                      ]
                    }
                  ]
                },
                {
                  "name" : "Dosage",
                  "source" : [
                    {
                      "context" : "substract",
                      "element" : "doseQuantity",
                      "variable" : "doseQuant"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "medicationRq",
                      "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" : "rateq",
                  "source" : [
                    {
                      "context" : "substract",
                      "element" : "rateQuantity",
                      "variable" : "rateQuantity"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "medicationRq",
                      "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" : "dosageRate",
                      "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" : "partRole",
                  "source" : [
                    {
                      "context" : "substract",
                      "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" : "practitioner",
                      "transform" : "create",
                      "parameter" : [
                        {
                          "valueString" : "Practitioner"
                        }
                      ]
                    }
                  ],
                  "rule" : [
                    {
                      "name" : "time",
                      "source" : [
                        {
                          "context" : "part",
                          "element" : "time",
                          "variable" : "time"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "medicationRq",
                          "contextType" : "variable",
                          "element" : "authoredOn",
                          "transform" : "evaluate",
                          "parameter" : [
                            {
                              "valueString" : "time.value"
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "name" : "perf",
                      "source" : [
                        {
                          "context" : "part",
                          "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/TerapiaFarmacologicaRicovero/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" : "uuid1"
                                        }
                                      ]
                                    },
                                    {
                                      "context" : "medicationRq",
                                      "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" : "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" : "assi",
                          "source" : [
                            {
                              "context" : "partRole",
                              "element" : "playingEntity",
                              "variable" : "assi"
                            }
                          ],
                          "rule" : [
                            {
                              "name" : "name",
                              "source" : [
                                {
                                  "context" : "assi",
                                  "element" : "name",
                                  "variable" : "vvv"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "practitioner",
                                  "contextType" : "variable",
                                  "element" : "name",
                                  "variable" : "vvv",
                                  "transform" : "create"
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ]
        }
      ]
    }
  ]
}