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

Draft as of 2024-04-11

Raw ttl | Download

@prefix fhir: <http://hl7.org/fhir/> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

# - resource -------------------------------------------------------------------

 a fhir:StructureMap ;
  fhir:nodeRole fhir:treeRoot ;
  fhir:id [ fhir:v "cda2fhirLdo"] ; # 
  fhir:text [
fhir:status [ fhir:v "generated" ] ;
fhir: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>"
  ] ; # 
  fhir:url [ fhir:v "http://hl7.it/fhir/cda2fhir/StructureMap/cda2fhirLdo"^^xsd:anyURI] ; # 
  fhir:version [ fhir:v "0.1.0"] ; # 
  fhir:name [ fhir:v "cda2fhirLdo"] ; # 
  fhir:status [ fhir:v "draft"] ; # 
  fhir:date [ fhir:v "2024-04-11T15:38:19+02:00"^^xsd:dateTime] ; # 
  fhir:publisher [ fhir:v "HL7 Italy"] ; # 
  fhir:contact ( [
fhir:name [ fhir:v "HL7 Italy" ] ;
    ( fhir:telecom [
fhir:system [ fhir:v "url" ] ;
fhir:value [ fhir:v "http://hl7.it" ]     ] )
  ] ) ; # 
  fhir:jurisdiction ( [
    ( fhir:coding [
fhir:system [ fhir:v "urn:iso:std:iso:3166"^^xsd:anyURI ] ;
fhir:code [ fhir:v "IT" ] ;
fhir:display [ fhir:v "Italy" ]     ] )
  ] ) ; # 
  fhir:structure ( [
fhir:url [
fhir:v "http://hl7.org/fhir/cda/StructureDefinition/ClinicalDocument"^^xsd:anyURI ;
fhir:link <http://hl7.org/fhir/cda/StructureDefinition/ClinicalDocument>     ] ;
fhir:mode [ fhir:v "source" ] ;
fhir:alias [ fhir:v "ClinicalDocument" ]
  ] [
fhir:url [
fhir:v "http://hl7.org/fhir/cda/StructureDefinition/AssignedAuthor"^^xsd:anyURI ;
fhir:link <http://hl7.org/fhir/cda/StructureDefinition/AssignedAuthor>     ] ;
fhir:mode [ fhir:v "queried" ] ;
fhir:alias [ fhir:v "AssignedAuthor" ]
  ] [
fhir:url [
fhir:v "http://hl7.org/fhir/cda/StructureDefinition/AssignedEntity"^^xsd:anyURI ;
fhir:link <http://hl7.org/fhir/cda/StructureDefinition/AssignedEntity>     ] ;
fhir:mode [ fhir:v "queried" ] ;
fhir:alias [ fhir:v "AssignedEntity" ]
  ] [
fhir:url [
fhir:v "http://hl7.org/fhir/cda/StructureDefinition/AssociatedEntity"^^xsd:anyURI ;
fhir:link <http://hl7.org/fhir/cda/StructureDefinition/AssociatedEntity>     ] ;
fhir:mode [ fhir:v "queried" ] ;
fhir:alias [ fhir:v "AssociatedEntity" ]
  ] [
fhir:url [
fhir:v "http://hl7.org/fhir/cda/StructureDefinition/CustodianOrganization"^^xsd:anyURI ;
fhir:link <http://hl7.org/fhir/cda/StructureDefinition/CustodianOrganization>     ] ;
fhir:mode [ fhir:v "queried" ] ;
fhir:alias [ fhir:v "CustodianOrganization" ]
  ] [
fhir:url [
fhir:v "http://hl7.org/fhir/cda/StructureDefinition/OrganizationPartOf"^^xsd:anyURI ;
fhir:link <http://hl7.org/fhir/cda/StructureDefinition/OrganizationPartOf>     ] ;
fhir:mode [ fhir:v "queried" ] ;
fhir:alias [ fhir:v "OrganizationPartOf" ]
  ] [
fhir:url [
fhir:v "http://hl7.org/fhir/cda/StructureDefinition/Organization"^^xsd:anyURI ;
fhir:link <http://hl7.org/fhir/cda/StructureDefinition/Organization>     ] ;
fhir:mode [ fhir:v "queried" ] ;
fhir:alias [ fhir:v "rapresentedOrganization" ]
  ] [
fhir:url [
fhir:v "http://hl7.org/fhir/cda/StructureDefinition/Section"^^xsd:anyURI ;
fhir:link <http://hl7.org/fhir/cda/StructureDefinition/Section>     ] ;
fhir:mode [ fhir:v "queried" ] ;
fhir:alias [ fhir:v "Section" ]
  ] [
fhir:url [
fhir:v "http://hl7.org/fhir/cda/StructureDefinition/PatientRole"^^xsd:anyURI ;
fhir:link <http://hl7.org/fhir/cda/StructureDefinition/PatientRole>     ] ;
fhir:mode [ fhir:v "queried" ] ;
fhir:alias [ fhir:v "PatientRole" ]
  ] [
fhir:url [
fhir:v "http://hl7.org/fhir/cda/StructureDefinition/AD"^^xsd:anyURI ;
fhir:link <http://hl7.org/fhir/cda/StructureDefinition/AD>     ] ;
fhir:mode [ fhir:v "source" ] ;
fhir:alias [ fhir:v "AD" ]
  ] [
fhir:url [
fhir:v "http://hl7.org/fhir/StructureDefinition/Bundle"^^xsd:anyURI ;
fhir:link <http://hl7.org/fhir/StructureDefinition/Bundle>     ] ;
fhir:mode [ fhir:v "target" ] ;
fhir:alias [ fhir:v "Bundle" ]
  ] [
fhir:url [
fhir:v "http://hl7.org/fhir/StructureDefinition/Composition"^^xsd:anyURI ;
fhir:link <http://hl7.org/fhir/StructureDefinition/Composition>     ] ;
fhir:mode [ fhir:v "produced" ] ;
fhir:alias [ fhir:v "Composition" ]
  ] [
fhir:url [
fhir:v "http://hl7.org/fhir/StructureDefinition/Patient"^^xsd:anyURI ;
fhir:link <http://hl7.org/fhir/StructureDefinition/Patient>     ] ;
fhir:mode [ fhir:v "produced" ] ;
fhir:alias [ fhir:v "Patient" ]
  ] [
fhir:url [
fhir:v "http://hl7.org/fhir/StructureDefinition/Encounter"^^xsd:anyURI ;
fhir:link <http://hl7.org/fhir/StructureDefinition/Encounter>     ] ;
fhir:mode [ fhir:v "produced" ] ;
fhir:alias [ fhir:v "Encounter" ]
  ] [
fhir:url [
fhir:v "http://hl7.org/fhir/StructureDefinition/Person"^^xsd:anyURI ;
fhir:link <http://hl7.org/fhir/StructureDefinition/Person>     ] ;
fhir:mode [ fhir:v "produced" ] ;
fhir:alias [ fhir:v "Patient" ]
  ] [
fhir:url [
fhir:v "http://hl7.org/fhir/StructureDefinition/Practitioner"^^xsd:anyURI ;
fhir:link <http://hl7.org/fhir/StructureDefinition/Practitioner>     ] ;
fhir:mode [ fhir:v "produced" ] ;
fhir:alias [ fhir:v "Practitioner" ]
  ] [
fhir:url [
fhir:v "http://hl7.org/fhir/StructureDefinition/Organization"^^xsd:anyURI ;
fhir:link <http://hl7.org/fhir/StructureDefinition/Organization>     ] ;
fhir:mode [ fhir:v "produced" ] ;
fhir:alias [ fhir:v "Organization" ]
  ] [
fhir:url [
fhir:v "http://hl7.org/fhir/cda/StructureDefinition/Act"^^xsd:anyURI ;
fhir:link <http://hl7.org/fhir/cda/StructureDefinition/Act>     ] ;
fhir:mode [ fhir:v "produced" ] ;
fhir:alias [ fhir:v "Act" ]
  ] [
fhir:url [
fhir:v "http://hl7.org/fhir/cda/StructureDefinition/IVL-PQ"^^xsd:anyURI ;
fhir:link <http://hl7.org/fhir/cda/StructureDefinition/IVL-PQ>     ] ;
fhir:mode [ fhir:v "source" ] ;
fhir:alias [ fhir:v "IVL_PQ" ]
  ] [
fhir:url [
fhir:v "http://hl7.org/fhir/cda/StructureDefinition/PQ"^^xsd:anyURI ;
fhir:link <http://hl7.org/fhir/cda/StructureDefinition/PQ>     ] ;
fhir:mode [ fhir:v "source" ] ;
fhir:alias [ fhir:v "PQ" ]
  ] [
fhir:url [
fhir:v "http://hl7.org/fhir/StructureDefinition/SimpleQuantity"^^xsd:anyURI ;
fhir:link <http://hl7.org/fhir/StructureDefinition/SimpleQuantity>     ] ;
fhir:mode [ fhir:v "target" ] ;
fhir:alias [ fhir:v "SimpleQuantity" ]
  ] ) ; # 
  fhir:import ( [
fhir:v "http://hl7.it/fhir/cda2fhir/StructureMap/cda2fhirDataTypes"^^xsd:anyURI ;
fhir:link <http://hl7.it/fhir/cda2fhir/StructureMap/cda2fhirDataTypes>
  ] [
fhir:v "http://hl7.it/fhir/cda2fhir/StructureMap/cda2fhirHeader"^^xsd:anyURI ;
fhir:link <http://hl7.it/fhir/cda2fhir/StructureMap/cda2fhirHeader>
  ] ) ; # 
  fhir:group ( [
fhir:name [ fhir:v "CdaToBundle" ] ;
fhir:typeMode [ fhir:v "none" ] ;
    ( fhir:input [
fhir:name [ fhir:v "cda" ] ;
fhir:type [ fhir:v "ClinicalDocument" ] ;
fhir:mode [ fhir:v "source" ]     ] [
fhir:name [ fhir:v "bundle" ] ;
fhir:type [ fhir:v "Bundle" ] ;
fhir:mode [ fhir:v "target" ]     ] ) ;
    ( fhir:rule [
fhir:name [ fhir:v "ClinicalDocumentToBody" ] ;
      ( fhir:source [
fhir:context [ fhir:v "cda" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "bundle" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "entry" ] ;
fhir:variable [ fhir:v "e" ]       ] [
fhir:context [ fhir:v "e" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "request" ] ;
fhir:variable [ fhir:v "request" ] ;
fhir:transform [ fhir:v "create" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "BackboneElement" ]         ] )       ] [
fhir:context [ fhir:v "request" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "method" ] ;
fhir:transform [ fhir:v "copy" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "POST" ]         ] )       ] [
fhir:context [ fhir:v "e" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "resource" ] ;
fhir:variable [ fhir:v "composition" ] ;
fhir:transform [ fhir:v "create" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "Composition" ]         ] )       ] [
fhir:context [ fhir:v "composition" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "id" ] ;
fhir:variable [ fhir:v "uuid1" ] ;
fhir:transform [ fhir:v "uuid" ]       ] [
fhir:context [ fhir:v "e" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "fullUrl" ] ;
fhir:transform [ fhir:v "append" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "https://example/Composition/" ]         ] [
fhir:value [ fhir:v "uuid1" ]         ] )       ] [
fhir:context [ fhir:v "request" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "url" ] ;
fhir:transform [ fhir:v "copy" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "Composition" ]         ] )       ] [
fhir:context [ fhir:v "bundle" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "entry" ] ;
fhir:variable [ fhir:v "e2" ]       ] [
fhir:context [ fhir:v "e2" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "request" ] ;
fhir:variable [ fhir:v "requestPAT" ] ;
fhir:transform [ fhir:v "create" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "BackboneElement" ]         ] )       ] [
fhir:context [ fhir:v "requestPAT" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "method" ] ;
fhir:transform [ fhir:v "copy" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "PUT" ]         ] )       ] [
fhir:context [ fhir:v "e2" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "resource" ] ;
fhir:variable [ fhir:v "patient" ] ;
fhir:transform [ fhir:v "create" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "Patient" ]         ] )       ] [
fhir:context [ fhir:v "patient" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "id" ] ;
fhir:variable [ fhir:v "uuid2" ] ;
fhir:transform [ fhir:v "uuid" ]       ] [
fhir:context [ fhir:v "e2" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "fullUrl" ] ;
fhir:transform [ fhir:v "append" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "https://example/Patient/" ]         ] [
fhir:value [ fhir:v "uuid2" ]         ] )       ] [
fhir:context [ fhir:v "bundle" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "entry" ] ;
fhir:variable [ fhir:v "e3" ]       ] [
fhir:context [ fhir:v "e3" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "request" ] ;
fhir:variable [ fhir:v "request" ] ;
fhir:transform [ fhir:v "create" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "BackboneElement" ]         ] )       ] [
fhir:context [ fhir:v "request" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "method" ] ;
fhir:transform [ fhir:v "copy" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "POST" ]         ] )       ] [
fhir:context [ fhir:v "e3" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "resource" ] ;
fhir:variable [ fhir:v "encounter" ] ;
fhir:transform [ fhir:v "create" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "Encounter" ]         ] )       ] [
fhir:context [ fhir:v "encounter" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "id" ] ;
fhir:variable [ fhir:v "uuid3" ] ;
fhir:transform [ fhir:v "uuid" ]       ] [
fhir:context [ fhir:v "e3" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "fullUrl" ] ;
fhir:transform [ fhir:v "append" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "https://example/Encounter/" ]         ] [
fhir:value [ fhir:v "uuid3" ]         ] )       ] [
fhir:context [ fhir:v "request" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "url" ] ;
fhir:transform [ fhir:v "copy" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "Encounter" ]         ] )       ] [
fhir:context [ fhir:v "bundle" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "entry" ] ;
fhir:variable [ fhir:v "e5" ]       ] [
fhir:context [ fhir:v "e5" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "request" ] ;
fhir:variable [ fhir:v "request" ] ;
fhir:transform [ fhir:v "create" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "BackboneElement" ]         ] )       ] [
fhir:context [ fhir:v "request" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "method" ] ;
fhir:transform [ fhir:v "copy" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "POST" ]         ] )       ] [
fhir:context [ fhir:v "e5" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "resource" ] ;
fhir:variable [ fhir:v "DocumentReference" ] ;
fhir:transform [ fhir:v "create" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "DocumentReference" ]         ] )       ] [
fhir:context [ fhir:v "DocumentReference" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "id" ] ;
fhir:variable [ fhir:v "uuid5" ] ;
fhir:transform [ fhir:v "uuid" ]       ] [
fhir:context [ fhir:v "e5" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "fullUrl" ] ;
fhir:transform [ fhir:v "append" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "https://example/DocumentReference/" ]         ] [
fhir:value [ fhir:v "uuid5" ]         ] )       ] [
fhir:context [ fhir:v "request" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "url" ] ;
fhir:transform [ fhir:v "copy" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "DocumentReference" ]         ] )       ] ) ;
      ( fhir:rule [
fhir:name [ fhir:v "cdatobundle" ] ;
        ( fhir:source [
fhir:context [ fhir:v "cda" ]         ] ) ;
        ( fhir:dependent [
fhir:name [ fhir:v "ClinicalDocumentToBundle" ] ;
          ( fhir:variable [ fhir:v "cda" ] [ fhir:v "patient" ] [ fhir:v "composition" ] [ fhir:v "encounter" ] [ fhir:v "bundle" ] [ fhir:v "DocumentReference" ] )         ] )       ] [
fhir:name [ fhir:v "patient" ] ;
        ( fhir:source [
fhir:context [ fhir:v "cda" ] ;
fhir:element [ fhir:v "recordTarget" ] ;
fhir:variable [ fhir:v "recordTarget" ]         ] ) ;
        ( fhir:rule [
fhir:name [ fhir:v "recPat" ] ;
          ( fhir:source [
fhir:context [ fhir:v "recordTarget" ] ;
fhir:element [ fhir:v "patientRole" ] ;
fhir:variable [ fhir:v "patient" ]           ] ) ;
          ( fhir:rule [
fhir:name [ fhir:v "record" ] ;
            ( fhir:source [
fhir:context [ fhir:v "patient" ] ;
fhir:element [ fhir:v "id" ] ;
fhir:variable [ fhir:v "id" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "patient" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "identifier" ] ;
fhir:variable [ fhir:v "identifier" ]             ] ) ;
            ( fhir:rule [
fhir:name [ fhir:v "root1" ] ;
              ( fhir:source [
fhir:context [ fhir:v "id" ] ;
fhir:element [ fhir:v "root" ] ;
fhir:variable [ fhir:v "r" ]               ] ) ;
              ( fhir:target [
fhir:context [ fhir:v "identifier" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "system" ] ;
fhir:transform [ fhir:v "translate" ] ;
                ( fhir:parameter [
fhir:value [ fhir:v "r" ]                 ] [
fhir:value [ fhir:v "http://hl7.org/fhir/ConceptMap/special-oid2uri" ]                 ] [
fhir:value [ fhir:v "uri" ]                 ] )               ] )             ] [
fhir:name [ fhir:v "extension" ] ;
              ( fhir:source [
fhir:context [ fhir:v "id" ] ;
fhir:element [ fhir:v "extension" ] ;
fhir:variable [ fhir:v "ext" ]               ] ) ;
              ( fhir:target [
fhir:context [ fhir:v "identifier" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:transform [ fhir:v "copy" ] ;
                ( fhir:parameter [
fhir:value [ fhir:v "ext" ]                 ] )               ] )             ] [
fhir:name [ fhir:v "assigningAuthorityName" ] ;
              ( fhir:source [
fhir:context [ fhir:v "id" ] ;
fhir:element [ fhir:v "assigningAuthorityName" ] ;
fhir:variable [ fhir:v "s" ]               ] ) ;
              ( fhir:target [
fhir:context [ fhir:v "identifier" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "assigner" ] ;
fhir:variable [ fhir:v "a" ]               ] [
fhir:context [ fhir:v "a" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "display" ] ;
fhir:transform [ fhir:v "copy" ] ;
                ( fhir:parameter [
fhir:value [ fhir:v "s" ]                 ] )               ] )             ] )           ] [
fhir:name [ fhir:v "ext" ] ;
            ( fhir:source [
fhir:context [ fhir:v "patient" ] ;
fhir:element [ fhir:v "id" ] ;
fhir:variable [ fhir:v "id" ] ;
fhir:condition [ fhir:v "(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')" ]             ] ) ;
            ( fhir:rule [
fhir:name [ fhir:v "UUID" ] ;
              ( fhir:source [
fhir:context [ fhir:v "id" ] ;
fhir:element [ fhir:v "extension" ] ;
fhir:variable [ fhir:v "ext" ]               ] ) ;
              ( fhir:target [
fhir:context [ fhir:v "requestPAT" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "url" ] ;
fhir:transform [ fhir:v "append" ] ;
                ( fhir:parameter [
fhir:value [ fhir:v "Patient?identifier=" ]                 ] [
fhir:value [ fhir:v "ext" ]                 ] )               ] )             ] )           ] )         ] )       ] )     ] )
  ] [
fhir:name [ fhir:v "ClinicalDocumentToBundle" ] ;
fhir:typeMode [ fhir:v "none" ] ;
    ( fhir:input [
fhir:name [ fhir:v "cda" ] ;
fhir:type [ fhir:v "ClinicalDocument" ] ;
fhir:mode [ fhir:v "source" ]     ] [
fhir:name [ fhir:v "patient" ] ;
fhir:type [ fhir:v "Patient" ] ;
fhir:mode [ fhir:v "target" ]     ] [
fhir:name [ fhir:v "composition" ] ;
fhir:type [ fhir:v "Composition" ] ;
fhir:mode [ fhir:v "target" ]     ] [
fhir:name [ fhir:v "encounter" ] ;
fhir:type [ fhir:v "Encounter" ] ;
fhir:mode [ fhir:v "target" ]     ] [
fhir:name [ fhir:v "bundle" ] ;
fhir:type [ fhir:v "Bundle" ] ;
fhir:mode [ fhir:v "target" ]     ] [
fhir:name [ fhir:v "DocumentReference" ] ;
fhir:type [ fhir:v "DocumentReference" ] ;
fhir:mode [ fhir:v "target" ]     ] ) ;
    ( fhir:rule [
fhir:name [ fhir:v "id" ] ;
      ( fhir:source [
fhir:context [ fhir:v "cda" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "bundle" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "id" ] ;
fhir:transform [ fhir:v "uuid" ]       ] )     ] [
fhir:name [ fhir:v "identifier" ] ;
      ( fhir:source [
fhir:context [ fhir:v "cda" ] ;
fhir:element [ fhir:v "id" ] ;
fhir:variable [ fhir:v "vvv" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "bundle" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "identifier" ] ;
fhir:variable [ fhir:v "vvv" ] ;
fhir:transform [ fhir:v "create" ]       ] )     ] [
fhir:name [ fhir:v "type" ] ;
      ( fhir:source [
fhir:context [ fhir:v "cda" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "bundle" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "type" ] ;
fhir:transform [ fhir:v "copy" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "transaction" ]         ] )       ] )     ] [
fhir:name [ fhir:v "date" ] ;
      ( fhir:source [
fhir:context [ fhir:v "cda" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "bundle" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "timestamp" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "timestamp.now()" ]         ] )       ] )     ] [
fhir:name [ fhir:v "composition" ] ;
      ( fhir:source [
fhir:context [ fhir:v "cda" ]       ] ) ;
      ( fhir:dependent [
fhir:name [ fhir:v "ClinicalDocumentComposition" ] ;
        ( fhir:variable [ fhir:v "cda" ] [ fhir:v "composition" ] [ fhir:v "patient" ] [ fhir:v "encounter" ] [ fhir:v "bundle" ] [ fhir:v "DocumentReference" ] )       ] )     ] [
fhir:name [ fhir:v "component" ] ;
      ( fhir:source [
fhir:context [ fhir:v "cda" ] ;
fhir:element [ fhir:v "component" ] ;
fhir:variable [ fhir:v "component" ]       ] ) ;
      ( fhir:rule [
fhir:name [ fhir:v "body" ] ;
        ( fhir:source [
fhir:context [ fhir:v "component" ] ;
fhir:element [ fhir:v "structuredBody" ] ;
fhir:variable [ fhir:v "body" ]         ] ) ;
        ( fhir:rule [
fhir:name [ fhir:v "component" ] ;
          ( fhir:source [
fhir:context [ fhir:v "body" ] ;
fhir:element [ fhir:v "component" ] ;
fhir:variable [ fhir:v "component" ]           ] ) ;
          ( fhir:rule [
fhir:name [ fhir:v "section" ] ;
            ( fhir:source [
fhir:context [ fhir:v "component" ] ;
fhir:element [ fhir:v "section" ] ;
fhir:variable [ fhir:v "srcSection" ]             ] ) ;
            ( fhir:rule [
fhir:name [ fhir:v "motivoRicovero" ] ;
              ( fhir:source [
fhir:context [ fhir:v "srcSection" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:condition [ fhir:v "(code = '46241-6')" ]               ] ) ;
              ( fhir:target [
fhir:context [ fhir:v "composition" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "section" ] ;
fhir:variable [ fhir:v "tgtSection" ]               ] ) ;
              ( fhir:dependent [
fhir:name [ fhir:v "ClinicalDocumentSectionMotivoRicovero" ] ;
                ( fhir:variable [ fhir:v "cda" ] [ fhir:v "srcSection" ] [ fhir:v "patient" ] [ fhir:v "tgtSection" ] [ fhir:v "bundle" ] [ fhir:v "encounter" ] )               ] )             ] [
fhir:name [ fhir:v "inquadramentoClinico" ] ;
              ( fhir:source [
fhir:context [ fhir:v "srcSection" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:condition [ fhir:v "(code = '47039-3')" ]               ] ) ;
              ( fhir:target [
fhir:context [ fhir:v "composition" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "section" ] ;
fhir:variable [ fhir:v "tgtSection" ]               ] ) ;
              ( fhir:dependent [
fhir:name [ fhir:v "ClinicalDocumentSectionInquadramentoClinico" ] ;
                ( fhir:variable [ fhir:v "cda" ] [ fhir:v "srcSection" ] [ fhir:v "patient" ] [ fhir:v "tgtSection" ] [ fhir:v "bundle" ] [ fhir:v "encounter" ] )               ] )             ] [
fhir:name [ fhir:v "DecorsoOspedaliero" ] ;
              ( fhir:source [
fhir:context [ fhir:v "srcSection" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:condition [ fhir:v "(code = '8648-8')" ]               ] ) ;
              ( fhir:target [
fhir:context [ fhir:v "composition" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "section" ] ;
fhir:variable [ fhir:v "tgtSection" ]               ] ) ;
              ( fhir:dependent [
fhir:name [ fhir:v "ClinicalDocumentSectionDecorsoOspedaliero" ] ;
                ( fhir:variable [ fhir:v "cda" ] [ fhir:v "srcSection" ] [ fhir:v "patient" ] [ fhir:v "tgtSection" ] [ fhir:v "bundle" ] [ fhir:v "encounter" ] )               ] )             ] [
fhir:name [ fhir:v "Complicazioni" ] ;
              ( fhir:source [
fhir:context [ fhir:v "srcSection" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:condition [ fhir:v "(code = '55109-3')" ]               ] ) ;
              ( fhir:target [
fhir:context [ fhir:v "composition" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "section" ] ;
fhir:variable [ fhir:v "tgtSection" ]               ] ) ;
              ( fhir:dependent [
fhir:name [ fhir:v "ClinicalDocumentSectionComplicanze" ] ;
                ( fhir:variable [ fhir:v "cda" ] [ fhir:v "srcSection" ] [ fhir:v "patient" ] [ fhir:v "tgtSection" ] [ fhir:v "bundle" ] [ fhir:v "encounter" ] )               ] )             ] [
fhir:name [ fhir:v "HospitalDischargeStudiesSummary" ] ;
              ( fhir:source [
fhir:context [ fhir:v "srcSection" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:condition [ fhir:v "(code = '11493-4')" ]               ] ) ;
              ( fhir:target [
fhir:context [ fhir:v "composition" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "section" ] ;
fhir:variable [ fhir:v "tgtSection" ]               ] ) ;
              ( fhir:dependent [
fhir:name [ fhir:v "ClinicalDocumentSectionRiscontri" ] ;
                ( fhir:variable [ fhir:v "cda" ] [ fhir:v "srcSection" ] [ fhir:v "patient" ] [ fhir:v "tgtSection" ] [ fhir:v "bundle" ] [ fhir:v "encounter" ] )               ] )             ] [
fhir:name [ fhir:v "HospitalDischargeStudiesSummary" ] ;
              ( fhir:source [
fhir:context [ fhir:v "srcSection" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:condition [ fhir:v "(code = '34104-0')" ]               ] ) ;
              ( fhir:target [
fhir:context [ fhir:v "composition" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "section" ] ;
fhir:variable [ fhir:v "tgtSection" ]               ] ) ;
              ( fhir:dependent [
fhir:name [ fhir:v "ClinicalDocumentSectionConsulenza" ] ;
                ( fhir:variable [ fhir:v "cda" ] [ fhir:v "srcSection" ] [ fhir:v "patient" ] [ fhir:v "tgtSection" ] [ fhir:v "bundle" ] [ fhir:v "encounter" ] )               ] )             ] [
fhir:name [ fhir:v "EsamiEseguitiDuranteilRicovero" ] ;
              ( fhir:source [
fhir:context [ fhir:v "srcSection" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:condition [ fhir:v "(code = '30954-2')" ]               ] ) ;
              ( fhir:target [
fhir:context [ fhir:v "composition" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "section" ] ;
fhir:variable [ fhir:v "tgtSection" ]               ] ) ;
              ( fhir:dependent [
fhir:name [ fhir:v "ClinicalDocumentSectionEsamiEseguitiRicovero" ] ;
                ( fhir:variable [ fhir:v "cda" ] [ fhir:v "srcSection" ] [ fhir:v "patient" ] [ fhir:v "tgtSection" ] [ fhir:v "bundle" ] [ fhir:v "encounter" ] )               ] )             ] [
fhir:name [ fhir:v "HistoryOfProceduresDocument" ] ;
              ( fhir:source [
fhir:context [ fhir:v "srcSection" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:condition [ fhir:v "(code = '47519-4')" ]               ] ) ;
              ( fhir:target [
fhir:context [ fhir:v "composition" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "section" ] ;
fhir:variable [ fhir:v "tgtSection" ]               ] ) ;
              ( fhir:dependent [
fhir:name [ fhir:v "ClinicalDocumentSectionProcedureEseguiteRicovero" ] ;
                ( fhir:variable [ fhir:v "cda" ] [ fhir:v "srcSection" ] [ fhir:v "patient" ] [ fhir:v "tgtSection" ] [ fhir:v "bundle" ] [ fhir:v "encounter" ] )               ] )             ] [
fhir:name [ fhir:v "EsamiEseguitiDuranteIlRicovero" ] ;
              ( fhir:source [
fhir:context [ fhir:v "srcSection" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:condition [ fhir:v "(code = '48765-2')" ]               ] ) ;
              ( fhir:target [
fhir:context [ fhir:v "composition" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "section" ] ;
fhir:variable [ fhir:v "tgtSection" ]               ] ) ;
              ( fhir:dependent [
fhir:name [ fhir:v "ClinicalDocumentSectionAllergie" ] ;
                ( fhir:variable [ fhir:v "cda" ] [ fhir:v "srcSection" ] [ fhir:v "patient" ] [ fhir:v "tgtSection" ] [ fhir:v "bundle" ] [ fhir:v "encounter" ] )               ] )             ] [
fhir:name [ fhir:v "TerapiaFarmacologicaAllaDimissione" ] ;
              ( fhir:source [
fhir:context [ fhir:v "srcSection" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:condition [ fhir:v "(code = '10160-0')" ]               ] ) ;
              ( fhir:target [
fhir:context [ fhir:v "composition" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "section" ] ;
fhir:variable [ fhir:v "tgtSection" ]               ] ) ;
              ( fhir:dependent [
fhir:name [ fhir:v "ClinicalDocumentSectionTerapiaFarmacologicaDuranteRicovero" ] ;
                ( fhir:variable [ fhir:v "cda" ] [ fhir:v "srcSection" ] [ fhir:v "patient" ] [ fhir:v "tgtSection" ] [ fhir:v "bundle" ] [ fhir:v "encounter" ] )               ] )             ] [
fhir:name [ fhir:v "DiagnosiDiDimissione" ] ;
              ( fhir:source [
fhir:context [ fhir:v "srcSection" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:condition [ fhir:v "(code = '11535-2')" ]               ] ) ;
              ( fhir:target [
fhir:context [ fhir:v "composition" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "section" ] ;
fhir:variable [ fhir:v "tgtSection" ]               ] ) ;
              ( fhir:dependent [
fhir:name [ fhir:v "ClinicalDocumentSectionDiagnosiDimissione" ] ;
                ( fhir:variable [ fhir:v "cda" ] [ fhir:v "srcSection" ] [ fhir:v "patient" ] [ fhir:v "tgtSection" ] [ fhir:v "bundle" ] [ fhir:v "encounter" ] )               ] )             ] [
fhir:name [ fhir:v "DiagnosiDiDimissione" ] ;
              ( fhir:source [
fhir:context [ fhir:v "srcSection" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:condition [ fhir:v "(code = '18776-5')" ]               ] ) ;
              ( fhir:target [
fhir:context [ fhir:v "composition" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "section" ] ;
fhir:variable [ fhir:v "tgtSection" ]               ] ) ;
              ( fhir:dependent [
fhir:name [ fhir:v "ClinicalDocumentSectionIstruzioniFollowUp" ] ;
                ( fhir:variable [ fhir:v "cda" ] [ fhir:v "srcSection" ] [ fhir:v "patient" ] [ fhir:v "tgtSection" ] [ fhir:v "bundle" ] [ fhir:v "encounter" ] )               ] )             ] [
fhir:name [ fhir:v "TerapiaFarmacologicaAllaDimissione" ] ;
              ( fhir:source [
fhir:context [ fhir:v "srcSection" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:condition [ fhir:v "(code = '10183-2')" ]               ] ) ;
              ( fhir:target [
fhir:context [ fhir:v "composition" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "section" ] ;
fhir:variable [ fhir:v "tgtSection" ]               ] ) ;
              ( fhir:dependent [
fhir:name [ fhir:v "ClinicalDocumentSectionTerapiaDimissione" ] ;
                ( fhir:variable [ fhir:v "cda" ] [ fhir:v "srcSection" ] [ fhir:v "patient" ] [ fhir:v "tgtSection" ] [ fhir:v "bundle" ] [ fhir:v "encounter" ] )               ] )             ] ) ;
fhir:documentation [ fhir:v "discretizzi il primo livello di component" ]           ] )         ] )       ] )     ] )
  ] [
fhir:name [ fhir:v "ClinicalDocumentSectionMotivoRicovero" ] ;
fhir:typeMode [ fhir:v "none" ] ;
fhir:documentation [ fhir:v "-------------------------------------------------------------------------------------------------------------------" ] ;
    ( fhir:input [
fhir:name [ fhir:v "cda" ] ;
fhir:type [ fhir:v "ClinicalDocument" ] ;
fhir:mode [ fhir:v "source" ]     ] [
fhir:name [ fhir:v "src" ] ;
fhir:type [ fhir:v "Section" ] ;
fhir:mode [ fhir:v "source" ]     ] [
fhir:name [ fhir:v "patient" ] ;
fhir:type [ fhir:v "Patient" ] ;
fhir:mode [ fhir:v "target" ]     ] [
fhir:name [ fhir:v "tgt" ] ;
fhir:mode [ fhir:v "target" ]     ] [
fhir:name [ fhir:v "bundle" ] ;
fhir:type [ fhir:v "Bundle" ] ;
fhir:mode [ fhir:v "target" ]     ] [
fhir:name [ fhir:v "enc" ] ;
fhir:type [ fhir:v "Encounter" ] ;
fhir:mode [ fhir:v "target" ]     ] ) ;
    ( fhir:rule [
fhir:name [ fhir:v "title" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "title" ] ;
fhir:variable [ fhir:v "t" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "title" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "t.dataString" ]         ] )       ] )     ] [
fhir:name [ fhir:v "code" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "vvv" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "vvv" ] ;
fhir:transform [ fhir:v "create" ]       ] )     ] [
fhir:name [ fhir:v "cText" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:condition [ fhir:v "src.entry.exists()" ]       ] ) ;
      ( fhir:rule [
fhir:name [ fhir:v "cdaText" ] ;
        ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "text" ] ;
fhir:variable [ fhir:v "cdaText" ]         ] ) ;
        ( fhir:target [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "text" ] ;
fhir:variable [ fhir:v "fhirText" ]         ] ) ;
        ( fhir:rule [
fhir:name [ fhir:v "narrativeStatus" ] ;
          ( fhir:source [
fhir:context [ fhir:v "cdaText" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "fhirText" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "status" ] ;
fhir:transform [ fhir:v "copy" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "generated" ]             ] )           ] )         ] [
fhir:name [ fhir:v "narrativeText" ] ;
          ( fhir:source [
fhir:context [ fhir:v "cdaText" ] ;
fhir:variable [ fhir:v "t" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "fhirText" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "div" ] ;
fhir:transform [ fhir:v "copy" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "t" ]             ] )           ] )         ] )       ] )     ] [
fhir:name [ fhir:v "entry" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "entry" ] ;
fhir:variable [ fhir:v "entry1" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "bundle" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "entry" ] ;
fhir:variable [ fhir:v "e1" ]       ] [
fhir:context [ fhir:v "e1" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "request" ] ;
fhir:variable [ fhir:v "request" ] ;
fhir:transform [ fhir:v "create" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "BackboneElement" ]         ] )       ] [
fhir:context [ fhir:v "request" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "method" ] ;
fhir:transform [ fhir:v "copy" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "POST" ]         ] )       ] [
fhir:context [ fhir:v "e1" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "resource" ] ;
fhir:variable [ fhir:v "observation" ] ;
fhir:transform [ fhir:v "create" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "Observation" ]         ] )       ] [
fhir:context [ fhir:v "observation" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "id" ] ;
fhir:variable [ fhir:v "uuid1" ] ;
fhir:transform [ fhir:v "uuid" ]       ] [
fhir:context [ fhir:v "e1" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "fullUrl" ] ;
fhir:transform [ fhir:v "append" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "https://example/Observation/" ]         ] [
fhir:value [ fhir:v "uuid1" ]         ] )       ] [
fhir:context [ fhir:v "request" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "url" ] ;
fhir:transform [ fhir:v "copy" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "Observation" ]         ] )       ] [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "entry" ] ;
fhir:variable [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "create" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "Reference" ]         ] )       ] [
fhir:context [ fhir:v "reference" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "'https://example/Observation/' + %observation.id" ]         ] )       ] ) ;
      ( fhir:rule [
fhir:name [ fhir:v "act" ] ;
        ( fhir:source [
fhir:context [ fhir:v "entry1" ] ;
fhir:element [ fhir:v "observation" ] ;
fhir:variable [ fhir:v "obs" ]         ] ) ;
        ( fhir:dependent [
fhir:name [ fhir:v "Observation" ] ;
          ( fhir:variable [ fhir:v "obs" ] [ fhir:v "patient" ] [ fhir:v "enc" ] [ fhir:v "observation" ] [ fhir:v "bundle" ] )         ] )       ] )     ] [
fhir:name [ fhir:v "where" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:condition [ fhir:v "src.entry.exists().not()" ]       ] ) ;
      ( fhir:rule [
fhir:name [ fhir:v "cdaText" ] ;
        ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "text" ] ;
fhir:variable [ fhir:v "cdaText" ]         ] ) ;
        ( fhir:target [
fhir:context [ fhir:v "bundle" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "entry" ] ;
fhir:variable [ fhir:v "e8" ]         ] [
fhir:context [ fhir:v "e8" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "request" ] ;
fhir:variable [ fhir:v "request" ] ;
fhir:transform [ fhir:v "create" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "BackboneElement" ]           ] )         ] [
fhir:context [ fhir:v "request" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "method" ] ;
fhir:transform [ fhir:v "copy" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "POST" ]           ] )         ] [
fhir:context [ fhir:v "e8" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "resource" ] ;
fhir:variable [ fhir:v "Observation" ] ;
fhir:transform [ fhir:v "create" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "Observation" ]           ] )         ] [
fhir:context [ fhir:v "Observation" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "id" ] ;
fhir:variable [ fhir:v "uuid8" ] ;
fhir:transform [ fhir:v "uuid" ]         ] [
fhir:context [ fhir:v "e8" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "fullUrl" ] ;
fhir:transform [ fhir:v "append" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "https://example/Observation/" ]           ] [
fhir:value [ fhir:v "uuid8" ]           ] )         ] [
fhir:context [ fhir:v "request" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "url" ] ;
fhir:transform [ fhir:v "copy" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "Observation" ]           ] )         ] [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "entry" ] ;
fhir:variable [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "create" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "Reference" ]           ] )         ] [
fhir:context [ fhir:v "reference" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "'https://example/Observation/' + %Observation.id" ]           ] )         ] ) ;
        ( fhir:rule [
fhir:name [ fhir:v "reference" ] ;
          ( fhir:source [
fhir:context [ fhir:v "src" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "Observation" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "subject" ] ;
fhir:variable [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "create" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "Reference" ]             ] )           ] [
fhir:context [ fhir:v "reference" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "'https://example/Patient/' + %patient.id" ]             ] )           ] )         ] [
fhir:name [ fhir:v "reference" ] ;
          ( fhir:source [
fhir:context [ fhir:v "src" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "Observation" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "encounter" ] ;
fhir:variable [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "create" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "Reference" ]             ] )           ] [
fhir:context [ fhir:v "reference" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "'https://example/Encounter/' + %enc.id" ]             ] )           ] )         ] [
fhir:name [ fhir:v "code" ] ;
          ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "vvv" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "Observation" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "vvv" ] ;
fhir:transform [ fhir:v "create" ]           ] )         ] [
fhir:name [ fhir:v "statuscode" ] ;
          ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:condition [ fhir:v "observation.statusCode.exists().not()" ]           ] ) ;
          ( fhir:rule [
fhir:name [ fhir:v "status" ] ;
            ( fhir:source [
fhir:context [ fhir:v "src" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "Observation" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "status" ] ;
fhir:transform [ fhir:v "copy" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "final" ]               ] )             ] )           ] )         ] [
fhir:name [ fhir:v "reference" ] ;
          ( fhir:source [
fhir:context [ fhir:v "cdaText" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "Observation" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "note" ] ;
fhir:variable [ fhir:v "note" ]           ] ) ;
          ( fhir:rule [
fhir:name [ fhir:v "reference" ] ;
            ( fhir:source [
fhir:context [ fhir:v "cdaText" ] ;
fhir:variable [ fhir:v "t" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "note" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "text" ] ;
fhir:transform [ fhir:v "copy" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "t" ]               ] )             ] )           ] )         ] )       ] )     ] )
  ] [
fhir:name [ fhir:v "ClinicalDocumentSectionInquadramentoClinico" ] ;
fhir:typeMode [ fhir:v "none" ] ;
    ( fhir:input [
fhir:name [ fhir:v "cda" ] ;
fhir:type [ fhir:v "ClinicalDocument" ] ;
fhir:mode [ fhir:v "source" ]     ] [
fhir:name [ fhir:v "src" ] ;
fhir:type [ fhir:v "Section" ] ;
fhir:mode [ fhir:v "source" ]     ] [
fhir:name [ fhir:v "patient" ] ;
fhir:type [ fhir:v "Patient" ] ;
fhir:mode [ fhir:v "target" ]     ] [
fhir:name [ fhir:v "tgt" ] ;
fhir:mode [ fhir:v "target" ]     ] [
fhir:name [ fhir:v "bundle" ] ;
fhir:type [ fhir:v "Bundle" ] ;
fhir:mode [ fhir:v "target" ]     ] [
fhir:name [ fhir:v "enc" ] ;
fhir:type [ fhir:v "Encounter" ] ;
fhir:mode [ fhir:v "target" ]     ] ) ;
    ( fhir:rule [
fhir:name [ fhir:v "title" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "title" ] ;
fhir:variable [ fhir:v "t" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "title" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "t.dataString" ]         ] )       ] )     ] [
fhir:name [ fhir:v "code" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "vvv" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "vvv" ] ;
fhir:transform [ fhir:v "create" ]       ] )     ] [
fhir:name [ fhir:v "cdaText" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "text" ] ;
fhir:variable [ fhir:v "cdaText" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "bundle" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "entry" ] ;
fhir:variable [ fhir:v "e1" ]       ] [
fhir:context [ fhir:v "e1" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "request" ] ;
fhir:variable [ fhir:v "request" ] ;
fhir:transform [ fhir:v "create" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "BackboneElement" ]         ] )       ] [
fhir:context [ fhir:v "request" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "method" ] ;
fhir:transform [ fhir:v "copy" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "POST" ]         ] )       ] [
fhir:context [ fhir:v "e1" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "resource" ] ;
fhir:variable [ fhir:v "observation" ] ;
fhir:transform [ fhir:v "create" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "Observation" ]         ] )       ] [
fhir:context [ fhir:v "observation" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "id" ] ;
fhir:variable [ fhir:v "uuid1" ] ;
fhir:transform [ fhir:v "uuid" ]       ] [
fhir:context [ fhir:v "e1" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "fullUrl" ] ;
fhir:transform [ fhir:v "append" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "https://example/Observation/" ]         ] [
fhir:value [ fhir:v "uuid1" ]         ] )       ] [
fhir:context [ fhir:v "request" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "url" ] ;
fhir:transform [ fhir:v "copy" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "Observation" ]         ] )       ] [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "entry" ] ;
fhir:variable [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "create" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "Reference" ]         ] )       ] [
fhir:context [ fhir:v "reference" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "'https://example/Observation/' + %observation.id" ]         ] )       ] [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "text" ] ;
fhir:variable [ fhir:v "fhirText" ]       ] ) ;
      ( fhir:rule [
fhir:name [ fhir:v "reference" ] ;
        ( fhir:source [
fhir:context [ fhir:v "cdaText" ]         ] ) ;
        ( fhir:target [
fhir:context [ fhir:v "observation" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "subject" ] ;
fhir:variable [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "create" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "Reference" ]           ] )         ] [
fhir:context [ fhir:v "reference" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "'https://example/Patient/' + %patient.id" ]           ] )         ] )       ] [
fhir:name [ fhir:v "reference" ] ;
        ( fhir:source [
fhir:context [ fhir:v "cdaText" ]         ] ) ;
        ( fhir:target [
fhir:context [ fhir:v "observation" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "encounter" ] ;
fhir:variable [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "create" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "Reference" ]           ] )         ] [
fhir:context [ fhir:v "reference" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "'https://example/Encounter/' + %enc.id" ]           ] )         ] )       ] [
fhir:name [ fhir:v "narrativeStatus" ] ;
        ( fhir:source [
fhir:context [ fhir:v "cdaText" ]         ] ) ;
        ( fhir:target [
fhir:context [ fhir:v "fhirText" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "status" ] ;
fhir:transform [ fhir:v "copy" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "generated" ]           ] )         ] )       ] [
fhir:name [ fhir:v "narrativeText" ] ;
        ( fhir:source [
fhir:context [ fhir:v "cdaText" ] ;
fhir:variable [ fhir:v "t" ]         ] ) ;
        ( fhir:target [
fhir:context [ fhir:v "fhirText" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "div" ] ;
fhir:transform [ fhir:v "copy" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "t" ]           ] )         ] )       ] [
fhir:name [ fhir:v "code" ] ;
        ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "vvv" ]         ] ) ;
        ( fhir:target [
fhir:context [ fhir:v "observation" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "vvv" ] ;
fhir:transform [ fhir:v "create" ]         ] )       ] [
fhir:name [ fhir:v "statuscode" ] ;
        ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:condition [ fhir:v "observation.statusCode.exists().not()" ]         ] ) ;
        ( fhir:rule [
fhir:name [ fhir:v "status" ] ;
          ( fhir:source [
fhir:context [ fhir:v "src" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "observation" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "status" ] ;
fhir:transform [ fhir:v "copy" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "final" ]             ] )           ] )         ] )       ] [
fhir:name [ fhir:v "reference" ] ;
        ( fhir:source [
fhir:context [ fhir:v "cdaText" ]         ] ) ;
        ( fhir:target [
fhir:context [ fhir:v "observation" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "note" ] ;
fhir:variable [ fhir:v "note" ]         ] ) ;
        ( fhir:rule [
fhir:name [ fhir:v "reference" ] ;
          ( fhir:source [
fhir:context [ fhir:v "cdaText" ] ;
fhir:variable [ fhir:v "t" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "note" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "text" ] ;
fhir:transform [ fhir:v "copy" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "t" ]             ] )           ] )         ] )       ] )     ] [
fhir:name [ fhir:v "component" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "component" ] ;
fhir:variable [ fhir:v "component" ]       ] ) ;
      ( fhir:rule [
fhir:name [ fhir:v "componentSec" ] ;
        ( fhir:source [
fhir:context [ fhir:v "component" ] ;
fhir:element [ fhir:v "section" ] ;
fhir:variable [ fhir:v "section2" ]         ] ) ;
        ( fhir:rule [
fhir:name [ fhir:v "sec2fhir" ] ;
          ( fhir:source [
fhir:context [ fhir:v "section2" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "section" ] ;
fhir:variable [ fhir:v "sec2" ]           ] ) ;
          ( fhir:rule [
fhir:name [ fhir:v "code" ] ;
            ( fhir:source [
fhir:context [ fhir:v "section2" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "vvv" ] ;
fhir:condition [ fhir:v "(code = '11329-0')" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "sec2" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "vvv" ] ;
fhir:transform [ fhir:v "create" ]             ] )           ] [
fhir:name [ fhir:v "title" ] ;
            ( fhir:source [
fhir:context [ fhir:v "section2" ] ;
fhir:element [ fhir:v "title" ] ;
fhir:variable [ fhir:v "t" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "sec2" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "title" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "t.dataString" ]               ] )             ] )           ] [
fhir:name [ fhir:v "exist" ] ;
            ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:condition [ fhir:v "src.entry.exists()" ]             ] ) ;
            ( fhir:rule [
fhir:name [ fhir:v "cdaText" ] ;
              ( fhir:source [
fhir:context [ fhir:v "section2" ] ;
fhir:element [ fhir:v "text" ] ;
fhir:variable [ fhir:v "cdaText" ]               ] ) ;
              ( fhir:target [
fhir:context [ fhir:v "sec2" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "text" ] ;
fhir:variable [ fhir:v "fhirText" ]               ] ) ;
              ( fhir:rule [
fhir:name [ fhir:v "narrativeStatus" ] ;
                ( fhir:source [
fhir:context [ fhir:v "cdaText" ]                 ] ) ;
                ( fhir:target [
fhir:context [ fhir:v "fhirText" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "status" ] ;
fhir:transform [ fhir:v "copy" ] ;
                  ( fhir:parameter [
fhir:value [ fhir:v "generated" ]                   ] )                 ] )               ] [
fhir:name [ fhir:v "narrativeText" ] ;
                ( fhir:source [
fhir:context [ fhir:v "cdaText" ] ;
fhir:variable [ fhir:v "t" ]                 ] ) ;
                ( fhir:target [
fhir:context [ fhir:v "fhirText" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "div" ] ;
fhir:transform [ fhir:v "copy" ] ;
                  ( fhir:parameter [
fhir:value [ fhir:v "t" ]                   ] )                 ] )               ] )             ] ) ;
fhir:documentation [ fhir:v "section2.code -> sec2.code;" ]           ] [
fhir:name [ fhir:v "where" ] ;
            ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:condition [ fhir:v "src.entry.exists().not()" ]             ] ) ;
            ( fhir:rule [
fhir:name [ fhir:v "cdaText" ] ;
              ( fhir:source [
fhir:context [ fhir:v "section2" ] ;
fhir:element [ fhir:v "text" ] ;
fhir:variable [ fhir:v "cdaText" ]               ] ) ;
              ( fhir:target [
fhir:context [ fhir:v "bundle" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "entry" ] ;
fhir:variable [ fhir:v "e1" ]               ] [
fhir:context [ fhir:v "e1" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "request" ] ;
fhir:variable [ fhir:v "request" ] ;
fhir:transform [ fhir:v "create" ] ;
                ( fhir:parameter [
fhir:value [ fhir:v "BackboneElement" ]                 ] )               ] [
fhir:context [ fhir:v "request" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "method" ] ;
fhir:transform [ fhir:v "copy" ] ;
                ( fhir:parameter [
fhir:value [ fhir:v "POST" ]                 ] )               ] [
fhir:context [ fhir:v "e1" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "resource" ] ;
fhir:variable [ fhir:v "condition" ] ;
fhir:transform [ fhir:v "create" ] ;
                ( fhir:parameter [
fhir:value [ fhir:v "Observation" ]                 ] )               ] [
fhir:context [ fhir:v "condition" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "id" ] ;
fhir:variable [ fhir:v "uuid1" ] ;
fhir:transform [ fhir:v "uuid" ]               ] [
fhir:context [ fhir:v "e1" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "fullUrl" ] ;
fhir:transform [ fhir:v "append" ] ;
                ( fhir:parameter [
fhir:value [ fhir:v "https://example/Observation/" ]                 ] [
fhir:value [ fhir:v "uuid1" ]                 ] )               ] [
fhir:context [ fhir:v "request" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "url" ] ;
fhir:transform [ fhir:v "copy" ] ;
                ( fhir:parameter [
fhir:value [ fhir:v "Observation" ]                 ] )               ] [
fhir:context [ fhir:v "sec2" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "entry" ] ;
fhir:variable [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "create" ] ;
                ( fhir:parameter [
fhir:value [ fhir:v "Reference" ]                 ] )               ] [
fhir:context [ fhir:v "reference" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
                ( fhir:parameter [
fhir:value [ fhir:v "'https://example/Observation/' + %condition.id" ]                 ] )               ] ) ;
              ( fhir:rule [
fhir:name [ fhir:v "code" ] ;
                ( fhir:source [
fhir:context [ fhir:v "section2" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "vvv" ]                 ] ) ;
                ( fhir:target [
fhir:context [ fhir:v "condition" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "vvv" ] ;
fhir:transform [ fhir:v "create" ]                 ] )               ] [
fhir:name [ fhir:v "statuscode" ] ;
                ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:condition [ fhir:v "condition.statusCode.exists().not()" ]                 ] ) ;
                ( fhir:rule [
fhir:name [ fhir:v "status" ] ;
                  ( fhir:source [
fhir:context [ fhir:v "src" ]                   ] ) ;
                  ( fhir:target [
fhir:context [ fhir:v "condition" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "status" ] ;
fhir:transform [ fhir:v "copy" ] ;
                    ( fhir:parameter [
fhir:value [ fhir:v "final" ]                     ] )                   ] )                 ] )               ] [
fhir:name [ fhir:v "reference" ] ;
                ( fhir:source [
fhir:context [ fhir:v "cdaText" ]                 ] ) ;
                ( fhir:target [
fhir:context [ fhir:v "condition" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "note" ] ;
fhir:variable [ fhir:v "note" ]                 ] ) ;
                ( fhir:rule [
fhir:name [ fhir:v "reference" ] ;
                  ( fhir:source [
fhir:context [ fhir:v "cdaText" ]                   ] ) ;
                  ( fhir:target [
fhir:context [ fhir:v "condition" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "subject" ] ;
fhir:variable [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "create" ] ;
                    ( fhir:parameter [
fhir:value [ fhir:v "Reference" ]                     ] )                   ] [
fhir:context [ fhir:v "reference" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
                    ( fhir:parameter [
fhir:value [ fhir:v "'https://example/Patient/' + %patient.id" ]                     ] )                   ] )                 ] [
fhir:name [ fhir:v "reference" ] ;
                  ( fhir:source [
fhir:context [ fhir:v "cdaText" ]                   ] ) ;
                  ( fhir:target [
fhir:context [ fhir:v "condition" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "encounter" ] ;
fhir:variable [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "create" ] ;
                    ( fhir:parameter [
fhir:value [ fhir:v "Reference" ]                     ] )                   ] [
fhir:context [ fhir:v "reference" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
                    ( fhir:parameter [
fhir:value [ fhir:v "'https://example/Encounter/' + %enc.id" ]                     ] )                   ] )                 ] [
fhir:name [ fhir:v "reference" ] ;
                  ( fhir:source [
fhir:context [ fhir:v "cdaText" ] ;
fhir:variable [ fhir:v "t" ]                   ] ) ;
                  ( fhir:target [
fhir:context [ fhir:v "note" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "text" ] ;
fhir:transform [ fhir:v "copy" ] ;
                    ( fhir:parameter [
fhir:value [ fhir:v "t" ]                     ] )                   ] )                 ] )               ] )             ] )           ] [
fhir:name [ fhir:v "subsection1" ] ;
            ( fhir:source [
fhir:context [ fhir:v "section2" ] ;
fhir:element [ fhir:v "entry" ] ;
fhir:variable [ fhir:v "entry1" ]             ] ) ;
            ( fhir:rule [
fhir:name [ fhir:v "entry" ] ;
              ( fhir:source [
fhir:context [ fhir:v "entry1" ] ;
fhir:element [ fhir:v "observation" ] ;
fhir:variable [ fhir:v "obs" ]               ] ) ;
              ( fhir:rule [
fhir:name [ fhir:v "observationcondition" ] ;
                ( fhir:source [
fhir:context [ fhir:v "obs" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:condition [ fhir:v "(code = '75326-9')" ]                 ] ) ;
                ( fhir:rule [
fhir:name [ fhir:v "whereEntryPatologicaProssima" ] ;
                  ( fhir:source [
fhir:context [ fhir:v "obs" ]                   ] ) ;
                  ( fhir:target [
fhir:context [ fhir:v "bundle" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "entry" ] ;
fhir:variable [ fhir:v "e1" ]                   ] [
fhir:context [ fhir:v "e1" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "request" ] ;
fhir:variable [ fhir:v "request" ] ;
fhir:transform [ fhir:v "create" ] ;
                    ( fhir:parameter [
fhir:value [ fhir:v "BackboneElement" ]                     ] )                   ] [
fhir:context [ fhir:v "request" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "method" ] ;
fhir:transform [ fhir:v "copy" ] ;
                    ( fhir:parameter [
fhir:value [ fhir:v "POST" ]                     ] )                   ] [
fhir:context [ fhir:v "e1" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "resource" ] ;
fhir:variable [ fhir:v "condition" ] ;
fhir:transform [ fhir:v "create" ] ;
                    ( fhir:parameter [
fhir:value [ fhir:v "Condition" ]                     ] )                   ] [
fhir:context [ fhir:v "condition" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "id" ] ;
fhir:variable [ fhir:v "uuid1" ] ;
fhir:transform [ fhir:v "uuid" ]                   ] [
fhir:context [ fhir:v "e1" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "fullUrl" ] ;
fhir:transform [ fhir:v "append" ] ;
                    ( fhir:parameter [
fhir:value [ fhir:v "https://example/Condition/" ]                     ] [
fhir:value [ fhir:v "uuid1" ]                     ] )                   ] [
fhir:context [ fhir:v "request" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "url" ] ;
fhir:transform [ fhir:v "copy" ] ;
                    ( fhir:parameter [
fhir:value [ fhir:v "Condition" ]                     ] )                   ] [
fhir:context [ fhir:v "sec2" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "entry" ] ;
fhir:variable [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "create" ] ;
                    ( fhir:parameter [
fhir:value [ fhir:v "Reference" ]                     ] )                   ] [
fhir:context [ fhir:v "reference" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
                    ( fhir:parameter [
fhir:value [ fhir:v "'https://example/Condition/' + %condition.id" ]                     ] )                   ] ) ;
                  ( fhir:rule [
fhir:name [ fhir:v "code" ] ;
                    ( fhir:source [
fhir:context [ fhir:v "obs" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "vvv" ]                     ] ) ;
                    ( fhir:target [
fhir:context [ fhir:v "condition" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "category" ] ;
fhir:variable [ fhir:v "vvv" ] ;
fhir:transform [ fhir:v "create" ]                     ] )                   ] [
fhir:name [ fhir:v "reference" ] ;
                    ( fhir:source [
fhir:context [ fhir:v "obs" ]                     ] ) ;
                    ( fhir:target [
fhir:context [ fhir:v "condition" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "subject" ] ;
fhir:variable [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "create" ] ;
                      ( fhir:parameter [
fhir:value [ fhir:v "Reference" ]                       ] )                     ] [
fhir:context [ fhir:v "reference" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
                      ( fhir:parameter [
fhir:value [ fhir:v "'https://example/Patient/' + %patient.id" ]                       ] )                     ] )                   ] [
fhir:name [ fhir:v "reference" ] ;
                    ( fhir:source [
fhir:context [ fhir:v "obs" ]                     ] ) ;
                    ( fhir:target [
fhir:context [ fhir:v "condition" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "encounter" ] ;
fhir:variable [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "create" ] ;
                      ( fhir:parameter [
fhir:value [ fhir:v "Reference" ]                       ] )                     ] [
fhir:context [ fhir:v "reference" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
                      ( fhir:parameter [
fhir:value [ fhir:v "'https://example/Encounter/' + %enc.id" ]                       ] )                     ] )                   ] [
fhir:name [ fhir:v "status" ] ;
                    ( fhir:source [
fhir:context [ fhir:v "obs" ] ;
fhir:element [ fhir:v "statusCode" ] ;
fhir:variable [ fhir:v "status" ] ;
fhir:condition [ fhir:v "(code = 'completed')" ]                     ] ) ;
                    ( fhir:target [
fhir:context [ fhir:v "condition" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "verificationStatus" ] ;
fhir:variable [ fhir:v "status2" ]                     ] ) ;
                    ( fhir:rule [
fhir:name [ fhir:v "st3" ] ;
                      ( fhir:source [
fhir:context [ fhir:v "status" ]                       ] ) ;
                      ( fhir:target [
fhir:context [ fhir:v "status2" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "coding" ] ;
fhir:variable [ fhir:v "status3" ]                       ] ) ;
                      ( fhir:rule [
fhir:name [ fhir:v "finald" ] ;
                        ( fhir:source [
fhir:context [ fhir:v "status" ]                         ] ) ;
                        ( fhir:target [
fhir:context [ fhir:v "status3" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:transform [ fhir:v "copy" ] ;
                          ( fhir:parameter [
fhir:value [ fhir:v "confirmed" ]                           ] )                         ] )                       ] [
fhir:name [ fhir:v "system" ] ;
                        ( fhir:source [
fhir:context [ fhir:v "status" ]                         ] ) ;
                        ( fhir:target [
fhir:context [ fhir:v "status3" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "system" ] ;
fhir:transform [ fhir:v "copy" ] ;
                          ( fhir:parameter [
fhir:value [ fhir:v "http://terminology.hl7.org/CodeSystem/condition-ver-status" ]                           ] )                         ] )                       ] )                     ] )                   ] [
fhir:name [ fhir:v "effectivetime1" ] ;
                    ( fhir:source [
fhir:context [ fhir:v "obs" ] ;
fhir:element [ fhir:v "effectiveTime" ] ;
fhir:variable [ fhir:v "effective1" ]                     ] ) ;
                    ( fhir:rule [
fhir:name [ fhir:v "ef" ] ;
                      ( fhir:source [
fhir:context [ fhir:v "effective1" ] ;
fhir:condition [ fhir:v "effective1.low.exists() or effective1.high.exists()" ]                       ] ) ;
                      ( fhir:rule [
fhir:name [ fhir:v "onsetperiod" ] ;
                        ( fhir:source [
fhir:context [ fhir:v "effective1" ]                         ] ) ;
                        ( fhir:target [
fhir:context [ fhir:v "condition" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "onset" ] ;
fhir:variable [ fhir:v "periodonset" ] ;
fhir:transform [ fhir:v "create" ] ;
                          ( fhir:parameter [
fhir:value [ fhir:v "Period" ]                           ] )                         ] ) ;
                        ( fhir:dependent [
fhir:name [ fhir:v "IVLTSPeriod" ] ;
                          ( fhir:variable [ fhir:v "effective1" ] [ fhir:v "periodonset" ] )                         ] )                       ] )                     ] )                   ] [
fhir:name [ fhir:v "Value" ] ;
                    ( fhir:source [
fhir:context [ fhir:v "obs" ] ;
fhir:type [ fhir:v "CD" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:variable [ fhir:v "val" ]                     ] ) ;
                    ( fhir:rule [
fhir:name [ fhir:v "Ce" ] ;
                      ( fhir:source [
fhir:context [ fhir:v "val" ]                       ] ) ;
                      ( fhir:target [
fhir:context [ fhir:v "condition" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "ce" ] ;
fhir:transform [ fhir:v "create" ] ;
                        ( fhir:parameter [
fhir:value [ fhir:v "CodeableConcept" ]                         ] )                       ] ) ;
                      ( fhir:rule [
fhir:name [ fhir:v "originalText" ] ;
                        ( fhir:source [
fhir:context [ fhir:v "val" ] ;
fhir:element [ fhir:v "originalText" ] ;
fhir:variable [ fhir:v "vvv" ]                         ] ) ;
                        ( fhir:target [
fhir:context [ fhir:v "ce" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "text" ] ;
fhir:variable [ fhir:v "vvv" ] ;
fhir:transform [ fhir:v "create" ]                         ] )                       ] [
fhir:name [ fhir:v "coding" ] ;
                        ( fhir:source [
fhir:context [ fhir:v "val" ]                         ] ) ;
                        ( fhir:target [
fhir:context [ fhir:v "ce" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "coding" ] ;
fhir:variable [ fhir:v "coding" ]                         ] ) ;
                        ( fhir:rule [
fhir:name [ fhir:v "code" ] ;
                          ( fhir:source [
fhir:context [ fhir:v "val" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "code" ]                           ] ) ;
                          ( fhir:target [
fhir:context [ fhir:v "coding" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:transform [ fhir:v "cast" ] ;
                            ( fhir:parameter [
fhir:value [ fhir:v "code" ]                             ] [
fhir:value [ fhir:v "string" ]                             ] )                           ] )                         ] [
fhir:name [ fhir:v "codeSystem" ] ;
                          ( fhir:source [
fhir:context [ fhir:v "val" ] ;
fhir:element [ fhir:v "codeSystem" ] ;
fhir:variable [ fhir:v "system" ]                           ] ) ;
                          ( fhir:target [
fhir:context [ fhir:v "coding" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "system" ] ;
fhir:transform [ fhir:v "translate" ] ;
                            ( fhir:parameter [
fhir:value [ fhir:v "system" ]                             ] [
fhir:value [ fhir:v "http://hl7.org/fhir/ConceptMap/special-oid2uri" ]                             ] [
fhir:value [ fhir:v "uri" ]                             ] )                           ] )                         ] [
fhir:name [ fhir:v "displayName" ] ;
                          ( fhir:source [
fhir:context [ fhir:v "val" ] ;
fhir:element [ fhir:v "displayName" ] ;
fhir:variable [ fhir:v "display" ]                           ] ) ;
                          ( fhir:target [
fhir:context [ fhir:v "coding" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "display" ] ;
fhir:transform [ fhir:v "cast" ] ;
                            ( fhir:parameter [
fhir:value [ fhir:v "display" ]                             ] [
fhir:value [ fhir:v "string" ]                             ] )                           ] )                         ] )                       ] )                     ] )                   ] [
fhir:name [ fhir:v "EntryRelationship1" ] ;
                    ( fhir:source [
fhir:context [ fhir:v "obs" ] ;
fhir:element [ fhir:v "entryRelationship" ] ;
fhir:variable [ fhir:v "entriRel" ]                     ] ) ;
                    ( fhir:rule [
fhir:name [ fhir:v "evidence" ] ;
                      ( fhir:source [
fhir:context [ fhir:v "entriRel" ]                       ] ) ;
                      ( fhir:target [
fhir:context [ fhir:v "condition" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "evidence" ] ;
fhir:variable [ fhir:v "evidence" ] ;
fhir:transform [ fhir:v "create" ] ;
                        ( fhir:parameter [
fhir:value [ fhir:v "BackboneElement" ]                         ] )                       ] ) ;
                      ( fhir:rule [
fhir:name [ fhir:v "Observation2" ] ;
                        ( fhir:source [
fhir:context [ fhir:v "entriRel" ] ;
fhir:element [ fhir:v "observation" ] ;
fhir:variable [ fhir:v "observation2" ]                         ] ) ;
                        ( fhir:rule [
fhir:name [ fhir:v "code" ] ;
                          ( fhir:source [
fhir:context [ fhir:v "observation2" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "code" ]                           ] ) ;
                          ( fhir:rule [
fhir:name [ fhir:v "whereDecorsoClinico" ] ;
                            ( fhir:source [
fhir:context [ fhir:v "code" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:condition [ fhir:v "(code.code = '89261-2')" ]                             ] ) ;
                            ( fhir:rule [
fhir:name [ fhir:v "obser" ] ;
                              ( fhir:source [
fhir:context [ fhir:v "obs" ]                               ] ) ;
                              ( fhir:target [
fhir:context [ fhir:v "bundle" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "entry" ] ;
fhir:variable [ fhir:v "e1" ]                               ] [
fhir:context [ fhir:v "e1" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "request" ] ;
fhir:variable [ fhir:v "request" ] ;
fhir:transform [ fhir:v "create" ] ;
                                ( fhir:parameter [
fhir:value [ fhir:v "BackboneElement" ]                                 ] )                               ] [
fhir:context [ fhir:v "request" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "method" ] ;
fhir:transform [ fhir:v "copy" ] ;
                                ( fhir:parameter [
fhir:value [ fhir:v "POST" ]                                 ] )                               ] [
fhir:context [ fhir:v "e1" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "resource" ] ;
fhir:variable [ fhir:v "observation" ] ;
fhir:transform [ fhir:v "create" ] ;
                                ( fhir:parameter [
fhir:value [ fhir:v "Observation" ]                                 ] )                               ] [
fhir:context [ fhir:v "observation" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "id" ] ;
fhir:variable [ fhir:v "uuid1" ] ;
fhir:transform [ fhir:v "uuid" ]                               ] [
fhir:context [ fhir:v "e1" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "fullUrl" ] ;
fhir:transform [ fhir:v "append" ] ;
                                ( fhir:parameter [
fhir:value [ fhir:v "https://example/Observation/" ]                                 ] [
fhir:value [ fhir:v "uuid1" ]                                 ] )                               ] [
fhir:context [ fhir:v "request" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "url" ] ;
fhir:transform [ fhir:v "copy" ] ;
                                ( fhir:parameter [
fhir:value [ fhir:v "Observation" ]                                 ] )                               ] ) ;
                              ( fhir:rule [
fhir:name [ fhir:v "ref" ] ;
                                ( fhir:source [
fhir:context [ fhir:v "entriRel" ]                                 ] ) ;
                                ( fhir:target [
fhir:context [ fhir:v "evidence" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "detail" ] ;
fhir:variable [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "create" ] ;
                                  ( fhir:parameter [
fhir:value [ fhir:v "Reference" ]                                   ] )                                 ] [
fhir:context [ fhir:v "reference" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
                                  ( fhir:parameter [
fhir:value [ fhir:v "'https://example/Observation/' + %observation.id" ]                                   ] )                                 ] )                               ] [
fhir:name [ fhir:v "code" ] ;
                                ( fhir:source [
fhir:context [ fhir:v "observation2" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "vvv" ]                                 ] ) ;
                                ( fhir:target [
fhir:context [ fhir:v "observation" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "vvv" ] ;
fhir:transform [ fhir:v "create" ]                                 ] )                               ] [
fhir:name [ fhir:v "statuscode" ] ;
                                ( fhir:source [
fhir:context [ fhir:v "observation2" ] ;
fhir:condition [ fhir:v "observation.statusCode.exists().not()" ]                                 ] ) ;
                                ( fhir:rule [
fhir:name [ fhir:v "status" ] ;
                                  ( fhir:source [
fhir:context [ fhir:v "observation2" ]                                   ] ) ;
                                  ( fhir:target [
fhir:context [ fhir:v "observation" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "status" ] ;
fhir:transform [ fhir:v "copy" ] ;
                                    ( fhir:parameter [
fhir:value [ fhir:v "final" ]                                     ] )                                   ] )                                 ] )                               ] [
fhir:name [ fhir:v "Annontation" ] ;
                                ( fhir:source [
fhir:context [ fhir:v "observation2" ] ;
fhir:element [ fhir:v "text" ] ;
fhir:variable [ fhir:v "text" ]                                 ] ) ;
                                ( fhir:target [
fhir:context [ fhir:v "observation" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "note" ] ;
fhir:variable [ fhir:v "note" ] ;
fhir:transform [ fhir:v "create" ] ;
                                  ( fhir:parameter [
fhir:value [ fhir:v "Annotation" ]                                   ] )                                 ] ) ;
                                ( fhir:rule [
fhir:name [ fhir:v "val" ] ;
                                  ( fhir:source [
fhir:context [ fhir:v "text" ] ;
fhir:element [ fhir:v "reference" ] ;
fhir:variable [ fhir:v "ref" ]                                   ] ) ;
                                  ( fhir:target [
fhir:context [ fhir:v "note" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "text" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
                                    ( fhir:parameter [
fhir:value [ fhir:v "ref.value" ]                                     ] )                                   ] )                                 ] )                               ] [
fhir:name [ fhir:v "reference" ] ;
                                ( fhir:source [
fhir:context [ fhir:v "obs" ]                                 ] ) ;
                                ( fhir:target [
fhir:context [ fhir:v "observation" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "subject" ] ;
fhir:variable [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "create" ] ;
                                  ( fhir:parameter [
fhir:value [ fhir:v "Reference" ]                                   ] )                                 ] [
fhir:context [ fhir:v "reference" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
                                  ( fhir:parameter [
fhir:value [ fhir:v "'https://example/Patient/' + %patient.id" ]                                   ] )                                 ] )                               ] [
fhir:name [ fhir:v "reference" ] ;
                                ( fhir:source [
fhir:context [ fhir:v "obs" ]                                 ] ) ;
                                ( fhir:target [
fhir:context [ fhir:v "observation" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "encounter" ] ;
fhir:variable [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "create" ] ;
                                  ( fhir:parameter [
fhir:value [ fhir:v "Reference" ]                                   ] )                                 ] [
fhir:context [ fhir:v "reference" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
                                  ( fhir:parameter [
fhir:value [ fhir:v "'https://example/Encounter/' + %enc.id" ]                                   ] )                                 ] )                               ] [
fhir:name [ fhir:v "statusCode" ] ;
                                ( fhir:source [
fhir:context [ fhir:v "observation2" ] ;
fhir:element [ fhir:v "statusCode" ] ;
fhir:variable [ fhir:v "statusc" ] ;
fhir:condition [ fhir:v "(code = 'completed')" ]                                 ] ) ;
                                ( fhir:target [
fhir:context [ fhir:v "ob" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "status" ] ;
fhir:transform [ fhir:v "copy" ] ;
                                  ( fhir:parameter [
fhir:value [ fhir:v "final" ]                                   ] )                                 ] )                               ] [
fhir:name [ fhir:v "statusCode" ] ;
                                ( fhir:source [
fhir:context [ fhir:v "observation2" ] ;
fhir:element [ fhir:v "statusCode" ] ;
fhir:variable [ fhir:v "statusc" ] ;
fhir:condition [ fhir:v "(code = 'active')" ]                                 ] ) ;
                                ( fhir:target [
fhir:context [ fhir:v "ob" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "status" ] ;
fhir:transform [ fhir:v "copy" ] ;
                                  ( fhir:parameter [
fhir:value [ fhir:v "registered" ]                                   ] )                                 ] )                               ] [
fhir:name [ fhir:v "statusCode" ] ;
                                ( fhir:source [
fhir:context [ fhir:v "observation2" ] ;
fhir:element [ fhir:v "statusCode" ] ;
fhir:variable [ fhir:v "statusc" ] ;
fhir:condition [ fhir:v "(code = 'aborted')" ]                                 ] ) ;
                                ( fhir:target [
fhir:context [ fhir:v "ob" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "status" ] ;
fhir:transform [ fhir:v "copy" ] ;
                                  ( fhir:parameter [
fhir:value [ fhir:v "cancelled" ]                                   ] )                                 ] )                               ] [
fhir:name [ fhir:v "statusCode" ] ;
                                ( fhir:source [
fhir:context [ fhir:v "observation2" ] ;
fhir:element [ fhir:v "statusCode" ] ;
fhir:variable [ fhir:v "statusc" ] ;
fhir:condition [ fhir:v "(code = 'suspended')" ]                                 ] ) ;
                                ( fhir:target [
fhir:context [ fhir:v "ob" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "status" ] ;
fhir:transform [ fhir:v "copy" ] ;
                                  ( fhir:parameter [
fhir:value [ fhir:v "partial" ]                                   ] )                                 ] )                               ] [
fhir:name [ fhir:v "value" ] ;
                                ( fhir:source [
fhir:context [ fhir:v "observation2" ] ;
fhir:type [ fhir:v "INT" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:variable [ fhir:v "int" ]                                 ] ) ;
                                ( fhir:target [
fhir:context [ fhir:v "ob" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
                                  ( fhir:parameter [
fhir:value [ fhir:v "int.value" ]                                   ] )                                 ] )                               ] [
fhir:name [ fhir:v "boolean" ] ;
                                ( fhir:source [
fhir:context [ fhir:v "observation2" ] ;
fhir:type [ fhir:v "BL" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:variable [ fhir:v "boolean" ]                                 ] ) ;
                                ( fhir:target [
fhir:context [ fhir:v "ob" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
                                  ( fhir:parameter [
fhir:value [ fhir:v "boolean.value" ]                                   ] )                                 ] )                               ] [
fhir:name [ fhir:v "val" ] ;
                                ( fhir:source [
fhir:context [ fhir:v "observation2" ] ;
fhir:type [ fhir:v "CD" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:variable [ fhir:v "val" ]                                 ] ) ;
                                ( fhir:rule [
fhir:name [ fhir:v "coding" ] ;
                                  ( fhir:source [
fhir:context [ fhir:v "val" ]                                   ] ) ;
                                  ( fhir:target [
fhir:context [ fhir:v "ob" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:variable [ fhir:v "ce" ] ;
fhir:transform [ fhir:v "create" ] ;
                                    ( fhir:parameter [
fhir:value [ fhir:v "CodeableConcept" ]                                     ] )                                   ] ) ;
                                  ( fhir:rule [
fhir:name [ fhir:v "originltext" ] ;
                                    ( fhir:source [
fhir:context [ fhir:v "val" ] ;
fhir:element [ fhir:v "originalText" ] ;
fhir:variable [ fhir:v "originalText" ]                                     ] ) ;
                                    ( fhir:rule [
fhir:name [ fhir:v "reference" ] ;
                                      ( fhir:source [
fhir:context [ fhir:v "originalText" ] ;
fhir:element [ fhir:v "reference" ] ;
fhir:variable [ fhir:v "reference" ]                                       ] ) ;
                                      ( fhir:target [
fhir:context [ fhir:v "ce" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "text" ] ;
fhir:transform [ fhir:v "copy" ] ;
                                        ( fhir:parameter [
fhir:value [ fhir:v "reference" ]                                         ] )                                       ] )                                     ] )                                   ] [
fhir:name [ fhir:v "code" ] ;
                                    ( fhir:source [
fhir:context [ fhir:v "val" ]                                     ] ) ;
                                    ( fhir:target [
fhir:context [ fhir:v "ce" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "coding" ] ;
fhir:variable [ fhir:v "coding" ]                                     ] ) ;
                                    ( fhir:rule [
fhir:name [ fhir:v "code" ] ;
                                      ( fhir:source [
fhir:context [ fhir:v "val" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "code" ]                                       ] ) ;
                                      ( fhir:target [
fhir:context [ fhir:v "coding" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:transform [ fhir:v "cast" ] ;
                                        ( fhir:parameter [
fhir:value [ fhir:v "code" ]                                         ] [
fhir:value [ fhir:v "string" ]                                         ] )                                       ] )                                     ] [
fhir:name [ fhir:v "codeSystem" ] ;
                                      ( fhir:source [
fhir:context [ fhir:v "val" ] ;
fhir:element [ fhir:v "codeSystem" ] ;
fhir:variable [ fhir:v "system" ]                                       ] ) ;
                                      ( fhir:target [
fhir:context [ fhir:v "coding" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "system" ] ;
fhir:transform [ fhir:v "translate" ] ;
                                        ( fhir:parameter [
fhir:value [ fhir:v "system" ]                                         ] [
fhir:value [ fhir:v "http://hl7.org/fhir/ConceptMap/special-oid2uri" ]                                         ] [
fhir:value [ fhir:v "uri" ]                                         ] )                                       ] )                                     ] [
fhir:name [ fhir:v "displayName" ] ;
                                      ( fhir:source [
fhir:context [ fhir:v "val" ] ;
fhir:element [ fhir:v "displayName" ] ;
fhir:variable [ fhir:v "display" ]                                       ] ) ;
                                      ( fhir:target [
fhir:context [ fhir:v "coding" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "display" ] ;
fhir:transform [ fhir:v "cast" ] ;
                                        ( fhir:parameter [
fhir:value [ fhir:v "display" ]                                         ] [
fhir:value [ fhir:v "string" ]                                         ] )                                       ] )                                     ] [
fhir:name [ fhir:v "codeSystemVersion" ] ;
                                      ( fhir:source [
fhir:context [ fhir:v "val" ] ;
fhir:element [ fhir:v "codeSystemVersion" ] ;
fhir:variable [ fhir:v "version" ]                                       ] ) ;
                                      ( fhir:target [
fhir:context [ fhir:v "coding" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "version" ] ;
fhir:transform [ fhir:v "cast" ] ;
                                        ( fhir:parameter [
fhir:value [ fhir:v "version" ]                                         ] [
fhir:value [ fhir:v "string" ]                                         ] )                                       ] )                                     ] )                                   ] [
fhir:name [ fhir:v "translation" ] ;
                                    ( fhir:source [
fhir:context [ fhir:v "val" ] ;
fhir:element [ fhir:v "translation" ] ;
fhir:variable [ fhir:v "translation" ]                                     ] ) ;
                                    ( fhir:target [
fhir:context [ fhir:v "ce" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "coding" ] ;
fhir:variable [ fhir:v "coding" ]                                     ] ) ;
                                    ( fhir:rule [
fhir:name [ fhir:v "code" ] ;
                                      ( fhir:source [
fhir:context [ fhir:v "translation" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "code" ]                                       ] ) ;
                                      ( fhir:target [
fhir:context [ fhir:v "coding" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:transform [ fhir:v "cast" ] ;
                                        ( fhir:parameter [
fhir:value [ fhir:v "code" ]                                         ] [
fhir:value [ fhir:v "string" ]                                         ] )                                       ] )                                     ] [
fhir:name [ fhir:v "codeSystem" ] ;
                                      ( fhir:source [
fhir:context [ fhir:v "translation" ] ;
fhir:element [ fhir:v "codeSystem" ] ;
fhir:variable [ fhir:v "system" ]                                       ] ) ;
                                      ( fhir:target [
fhir:context [ fhir:v "coding" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "system" ] ;
fhir:transform [ fhir:v "translate" ] ;
                                        ( fhir:parameter [
fhir:value [ fhir:v "system" ]                                         ] [
fhir:value [ fhir:v "http://hl7.org/fhir/ConceptMap/special-oid2uri" ]                                         ] [
fhir:value [ fhir:v "uri" ]                                         ] )                                       ] )                                     ] [
fhir:name [ fhir:v "displayName" ] ;
                                      ( fhir:source [
fhir:context [ fhir:v "translation" ] ;
fhir:element [ fhir:v "displayName" ] ;
fhir:variable [ fhir:v "display" ]                                       ] ) ;
                                      ( fhir:target [
fhir:context [ fhir:v "coding" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "display" ] ;
fhir:transform [ fhir:v "cast" ] ;
                                        ( fhir:parameter [
fhir:value [ fhir:v "display" ]                                         ] [
fhir:value [ fhir:v "string" ]                                         ] )                                       ] )                                     ] [
fhir:name [ fhir:v "codeSystemVersion" ] ;
                                      ( fhir:source [
fhir:context [ fhir:v "translation" ] ;
fhir:element [ fhir:v "codeSystemVersion" ] ;
fhir:variable [ fhir:v "version" ]                                       ] ) ;
                                      ( fhir:target [
fhir:context [ fhir:v "coding" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "version" ] ;
fhir:transform [ fhir:v "cast" ] ;
                                        ( fhir:parameter [
fhir:value [ fhir:v "version" ]                                         ] [
fhir:value [ fhir:v "string" ]                                         ] )                                       ] )                                     ] [
fhir:name [ fhir:v "qualifier" ] ;
                                      ( fhir:source [
fhir:context [ fhir:v "translation" ] ;
fhir:element [ fhir:v "qualifier" ] ;
fhir:variable [ fhir:v "qualifier" ]                                       ] ) ;
                                      ( fhir:rule [
fhir:name [ fhir:v "value" ] ;
                                        ( fhir:source [
fhir:context [ fhir:v "qualifier" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:variable [ fhir:v "value" ]                                         ] ) ;
                                        ( fhir:target [
fhir:context [ fhir:v "ce" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "coding" ] ;
fhir:variable [ fhir:v "coding" ]                                         ] ) ;
                                        ( fhir:rule [
fhir:name [ fhir:v "code" ] ;
                                          ( fhir:source [
fhir:context [ fhir:v "value" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "code" ]                                           ] ) ;
                                          ( fhir:target [
fhir:context [ fhir:v "coding" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:transform [ fhir:v "cast" ] ;
                                            ( fhir:parameter [
fhir:value [ fhir:v "code" ]                                             ] [
fhir:value [ fhir:v "string" ]                                             ] )                                           ] )                                         ] [
fhir:name [ fhir:v "codeSystem" ] ;
                                          ( fhir:source [
fhir:context [ fhir:v "value" ] ;
fhir:element [ fhir:v "codeSystem" ] ;
fhir:variable [ fhir:v "system" ]                                           ] ) ;
                                          ( fhir:target [
fhir:context [ fhir:v "coding" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "system" ] ;
fhir:transform [ fhir:v "translate" ] ;
                                            ( fhir:parameter [
fhir:value [ fhir:v "system" ]                                             ] [
fhir:value [ fhir:v "http://hl7.org/fhir/ConceptMap/special-oid2uri" ]                                             ] [
fhir:value [ fhir:v "uri" ]                                             ] )                                           ] )                                         ] [
fhir:name [ fhir:v "displayName" ] ;
                                          ( fhir:source [
fhir:context [ fhir:v "value" ] ;
fhir:element [ fhir:v "displayName" ] ;
fhir:variable [ fhir:v "display" ]                                           ] ) ;
                                          ( fhir:target [
fhir:context [ fhir:v "coding" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "display" ] ;
fhir:transform [ fhir:v "cast" ] ;
                                            ( fhir:parameter [
fhir:value [ fhir:v "display" ]                                             ] [
fhir:value [ fhir:v "string" ]                                             ] )                                           ] )                                         ] [
fhir:name [ fhir:v "codeSystemVersion" ] ;
                                          ( fhir:source [
fhir:context [ fhir:v "value" ] ;
fhir:element [ fhir:v "codeSystemVersion" ] ;
fhir:variable [ fhir:v "version" ]                                           ] ) ;
                                          ( fhir:target [
fhir:context [ fhir:v "coding" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "version" ] ;
fhir:transform [ fhir:v "cast" ] ;
                                            ( fhir:parameter [
fhir:value [ fhir:v "version" ]                                             ] [
fhir:value [ fhir:v "string" ]                                             ] )                                           ] )                                         ] )                                       ] )                                     ] )                                   ] )                                 ] )                               ] [
fhir:name [ fhir:v "valueQuantity" ] ;
                                ( fhir:source [
fhir:context [ fhir:v "observation2" ] ;
fhir:type [ fhir:v "PQ" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:variable [ fhir:v "val" ]                                 ] ) ;
                                ( fhir:rule [
fhir:name [ fhir:v "quantity" ] ;
                                  ( fhir:source [
fhir:context [ fhir:v "val" ]                                   ] ) ;
                                  ( fhir:target [
fhir:context [ fhir:v "ob" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:variable [ fhir:v "quantity" ] ;
fhir:transform [ fhir:v "create" ] ;
                                    ( fhir:parameter [
fhir:value [ fhir:v "Quantity" ]                                     ] )                                   ] ) ;
                                  ( fhir:rule [
fhir:name [ fhir:v "value" ] ;
                                    ( fhir:source [
fhir:context [ fhir:v "val" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:variable [ fhir:v "value" ]                                     ] ) ;
                                    ( fhir:target [
fhir:context [ fhir:v "quantity" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:transform [ fhir:v "copy" ] ;
                                      ( fhir:parameter [
fhir:value [ fhir:v "value" ]                                       ] )                                     ] )                                   ] [
fhir:name [ fhir:v "unit" ] ;
                                    ( fhir:source [
fhir:context [ fhir:v "val" ] ;
fhir:element [ fhir:v "unit" ] ;
fhir:variable [ fhir:v "unit" ]                                     ] ) ;
                                    ( fhir:target [
fhir:context [ fhir:v "quantity" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "unit" ] ;
fhir:transform [ fhir:v "copy" ] ;
                                      ( fhir:parameter [
fhir:value [ fhir:v "unit" ]                                       ] )                                     ] )                                   ] )                                 ] )                               ] [
fhir:name [ fhir:v "value" ] ;
                                ( fhir:source [
fhir:context [ fhir:v "observation2" ] ;
fhir:type [ fhir:v "ST" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:variable [ fhir:v "value" ]                                 ] ) ;
                                ( fhir:target [
fhir:context [ fhir:v "ob" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:transform [ fhir:v "create" ] ;
                                  ( fhir:parameter [
fhir:value [ fhir:v "string" ]                                   ] )                                 ] [
fhir:context [ fhir:v "ob" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
                                  ( fhir:parameter [
fhir:value [ fhir:v "value.dataString" ]                                   ] )                                 ] )                               ] [
fhir:name [ fhir:v "Value" ] ;
                                ( fhir:source [
fhir:context [ fhir:v "observation2" ] ;
fhir:type [ fhir:v "CE" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:variable [ fhir:v "val" ]                                 ] ) ;
                                ( fhir:rule [
fhir:name [ fhir:v "Ce" ] ;
                                  ( fhir:source [
fhir:context [ fhir:v "val" ]                                   ] ) ;
                                  ( fhir:target [
fhir:context [ fhir:v "observation" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:variable [ fhir:v "ce" ] ;
fhir:transform [ fhir:v "create" ] ;
                                    ( fhir:parameter [
fhir:value [ fhir:v "CodeableConcept" ]                                     ] )                                   ] ) ;
                                  ( fhir:rule [
fhir:name [ fhir:v "originalText" ] ;
                                    ( fhir:source [
fhir:context [ fhir:v "val" ] ;
fhir:element [ fhir:v "originalText" ] ;
fhir:variable [ fhir:v "vvv" ]                                     ] ) ;
                                    ( fhir:target [
fhir:context [ fhir:v "ce" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "text" ] ;
fhir:variable [ fhir:v "vvv" ] ;
fhir:transform [ fhir:v "create" ]                                     ] )                                   ] [
fhir:name [ fhir:v "coding" ] ;
                                    ( fhir:source [
fhir:context [ fhir:v "val" ]                                     ] ) ;
                                    ( fhir:target [
fhir:context [ fhir:v "ce" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "coding" ] ;
fhir:variable [ fhir:v "coding" ]                                     ] ) ;
                                    ( fhir:rule [
fhir:name [ fhir:v "code" ] ;
                                      ( fhir:source [
fhir:context [ fhir:v "val" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "code" ]                                       ] ) ;
                                      ( fhir:target [
fhir:context [ fhir:v "coding" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:transform [ fhir:v "cast" ] ;
                                        ( fhir:parameter [
fhir:value [ fhir:v "code" ]                                         ] [
fhir:value [ fhir:v "string" ]                                         ] )                                       ] )                                     ] [
fhir:name [ fhir:v "codeSystem" ] ;
                                      ( fhir:source [
fhir:context [ fhir:v "val" ] ;
fhir:element [ fhir:v "codeSystem" ] ;
fhir:variable [ fhir:v "system" ]                                       ] ) ;
                                      ( fhir:target [
fhir:context [ fhir:v "coding" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "system" ] ;
fhir:transform [ fhir:v "translate" ] ;
                                        ( fhir:parameter [
fhir:value [ fhir:v "system" ]                                         ] [
fhir:value [ fhir:v "http://hl7.org/fhir/ConceptMap/special-oid2uri" ]                                         ] [
fhir:value [ fhir:v "uri" ]                                         ] )                                       ] )                                     ] [
fhir:name [ fhir:v "displayName" ] ;
                                      ( fhir:source [
fhir:context [ fhir:v "val" ] ;
fhir:element [ fhir:v "displayName" ] ;
fhir:variable [ fhir:v "display" ]                                       ] ) ;
                                      ( fhir:target [
fhir:context [ fhir:v "coding" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "display" ] ;
fhir:transform [ fhir:v "cast" ] ;
                                        ( fhir:parameter [
fhir:value [ fhir:v "display" ]                                         ] [
fhir:value [ fhir:v "string" ]                                         ] )                                       ] )                                     ] )                                   ] )                                 ] )                               ] )                             ] )                           ] )                         ] )                       ] )                     ] )                   ] [
fhir:name [ fhir:v "entryrelationshipstatus" ] ;
                    ( fhir:source [
fhir:context [ fhir:v "obs" ] ;
fhir:element [ fhir:v "entryRelationship" ] ;
fhir:variable [ fhir:v "entriRel" ]                     ] ) ;
                    ( fhir:rule [
fhir:name [ fhir:v "observationstatus" ] ;
                      ( fhir:source [
fhir:context [ fhir:v "entriRel" ] ;
fhir:element [ fhir:v "observation" ] ;
fhir:variable [ fhir:v "observation2" ]                       ] ) ;
                      ( fhir:rule [
fhir:name [ fhir:v "codestatus" ] ;
                        ( fhir:source [
fhir:context [ fhir:v "observation2" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "code" ]                         ] ) ;
                        ( fhir:rule [
fhir:name [ fhir:v "whereDecorsoClinico" ] ;
                          ( fhir:source [
fhir:context [ fhir:v "code" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:condition [ fhir:v "(code.code = '33999-4')" ]                           ] ) ;
                          ( fhir:rule [
fhir:name [ fhir:v "code" ] ;
                            ( fhir:source [
fhir:context [ fhir:v "observation2" ]                             ] ) ;
                            ( fhir:target [
fhir:context [ fhir:v "condition" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "clinicalStatus" ] ;
fhir:variable [ fhir:v "status" ] ;
fhir:transform [ fhir:v "create" ] ;
                              ( fhir:parameter [
fhir:value [ fhir:v "CodeableConcept" ]                               ] )                             ] ) ;
                            ( fhir:rule [
fhir:name [ fhir:v "textstat" ] ;
                              ( fhir:source [
fhir:context [ fhir:v "observation2" ] ;
fhir:element [ fhir:v "text" ] ;
fhir:variable [ fhir:v "text" ]                               ] ) ;
                              ( fhir:rule [
fhir:name [ fhir:v "statref" ] ;
                                ( fhir:source [
fhir:context [ fhir:v "text" ] ;
fhir:element [ fhir:v "reference" ] ;
fhir:variable [ fhir:v "refstat" ]                                 ] ) ;
                                ( fhir:target [
fhir:context [ fhir:v "status" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "text" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
                                  ( fhir:parameter [
fhir:value [ fhir:v "refstat.value" ]                                   ] )                                 ] )                               ] )                             ] [
fhir:name [ fhir:v "coding" ] ;
                              ( fhir:source [
fhir:context [ fhir:v "observation2" ]                               ] ) ;
                              ( fhir:target [
fhir:context [ fhir:v "status" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "coding" ] ;
fhir:variable [ fhir:v "coding" ] ;
fhir:transform [ fhir:v "create" ] ;
                                ( fhir:parameter [
fhir:value [ fhir:v "Coding" ]                                 ] )                               ] ) ;
                              ( fhir:rule [
fhir:name [ fhir:v "value1" ] ;
                                ( fhir:source [
fhir:context [ fhir:v "observation2" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:variable [ fhir:v "value" ]                                 ] ) ;
                                ( fhir:rule [
fhir:name [ fhir:v "active" ] ;
                                  ( fhir:source [
fhir:context [ fhir:v "value" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:condition [ fhir:v "(value.code = 'LA16666-2')" ]                                   ] ) ;
                                  ( fhir:target [
fhir:context [ fhir:v "coding" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:transform [ fhir:v "copy" ] ;
                                    ( fhir:parameter [
fhir:value [ fhir:v "active" ]                                     ] )                                   ] )                                 ] [
fhir:name [ fhir:v "inactive" ] ;
                                  ( fhir:source [
fhir:context [ fhir:v "value" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:condition [ fhir:v "(value.code = 'LA18632-2')" ]                                   ] ) ;
                                  ( fhir:target [
fhir:context [ fhir:v "coding" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:transform [ fhir:v "copy" ] ;
                                    ( fhir:parameter [
fhir:value [ fhir:v "inactive" ]                                     ] )                                   ] )                                 ] [
fhir:name [ fhir:v "system" ] ;
                                  ( fhir:source [
fhir:context [ fhir:v "value" ] ;
fhir:element [ fhir:v "codeSystem" ] ;
fhir:variable [ fhir:v "system" ]                                   ] ) ;
                                  ( fhir:target [
fhir:context [ fhir:v "coding" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "system" ] ;
fhir:transform [ fhir:v "copy" ] ;
                                    ( fhir:parameter [
fhir:value [ fhir:v "http://terminology.hl7.org/CodeSystem/condition-clinical" ]                                     ] )                                   ] )                                 ] [
fhir:name [ fhir:v "displayName" ] ;
                                  ( fhir:source [
fhir:context [ fhir:v "value" ] ;
fhir:element [ fhir:v "displayName" ] ;
fhir:variable [ fhir:v "display" ]                                   ] ) ;
                                  ( fhir:target [
fhir:context [ fhir:v "coding" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "display" ] ;
fhir:transform [ fhir:v "cast" ] ;
                                    ( fhir:parameter [
fhir:value [ fhir:v "display" ]                                     ] [
fhir:value [ fhir:v "string" ]                                     ] )                                   ] )                                 ] )                               ] )                             ] )                           ] )                         ] )                       ] )                     ] )                   ] )                 ] ) ;
fhir:documentation [ fhir:v "EntryRelationship per il Problem" ]               ] )             ] )           ] [
fhir:name [ fhir:v "esameObiettivo" ] ;
            ( fhir:source [
fhir:context [ fhir:v "section2" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:condition [ fhir:v "(code = '29545-1')" ]             ] ) ;
            ( fhir:dependent [
fhir:name [ fhir:v "ClinicalDocumentSottoSectionOBS" ] ;
              ( fhir:variable [ fhir:v "section2" ] [ fhir:v "sec2" ] [ fhir:v "bundle" ] [ fhir:v "enc" ] [ fhir:v "patient" ] )             ] ) ;
fhir:documentation [ fhir:v "ESAME PBIETTIVO" ]           ] [
fhir:name [ fhir:v "TerapiaFarmacologicaAllIngresso" ] ;
            ( fhir:source [
fhir:context [ fhir:v "section2" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:condition [ fhir:v "(code = '42346-7')" ]             ] ) ;
            ( fhir:dependent [
fhir:name [ fhir:v "ClinicalDocumentSottoSectionMS" ] ;
              ( fhir:variable [ fhir:v "section2" ] [ fhir:v "sec2" ] [ fhir:v "bundle" ] [ fhir:v "patient" ] [ fhir:v "enc" ] )             ] ) ;
fhir:documentation [ fhir:v "TETAPIA FARMACOLOGICA" ]           ] ) ;
fhir:documentation [ fhir:v "ANAMNESI" ]         ] )       ] )     ] )
  ] [
fhir:name [ fhir:v "ClinicalDocumentSectionDecorsoOspedaliero" ] ;
fhir:typeMode [ fhir:v "none" ] ;
    ( fhir:input [
fhir:name [ fhir:v "cda" ] ;
fhir:type [ fhir:v "ClinicalDocument" ] ;
fhir:mode [ fhir:v "source" ]     ] [
fhir:name [ fhir:v "src" ] ;
fhir:type [ fhir:v "Section" ] ;
fhir:mode [ fhir:v "source" ]     ] [
fhir:name [ fhir:v "patient" ] ;
fhir:type [ fhir:v "Patient" ] ;
fhir:mode [ fhir:v "target" ]     ] [
fhir:name [ fhir:v "tgt" ] ;
fhir:mode [ fhir:v "target" ]     ] [
fhir:name [ fhir:v "bundle" ] ;
fhir:type [ fhir:v "Bundle" ] ;
fhir:mode [ fhir:v "target" ]     ] [
fhir:name [ fhir:v "enc" ] ;
fhir:type [ fhir:v "Encounter" ] ;
fhir:mode [ fhir:v "target" ]     ] ) ;
    ( fhir:rule [
fhir:name [ fhir:v "title" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "title" ] ;
fhir:variable [ fhir:v "t" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "title" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "t.dataString" ]         ] )       ] )     ] [
fhir:name [ fhir:v "code" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "vvv" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "vvv" ] ;
fhir:transform [ fhir:v "create" ]       ] )     ] [
fhir:name [ fhir:v "cdaText" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "text" ] ;
fhir:variable [ fhir:v "cdaText" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "bundle" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "entry" ] ;
fhir:variable [ fhir:v "e1" ]       ] [
fhir:context [ fhir:v "e1" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "request" ] ;
fhir:variable [ fhir:v "request" ] ;
fhir:transform [ fhir:v "create" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "BackboneElement" ]         ] )       ] [
fhir:context [ fhir:v "request" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "method" ] ;
fhir:transform [ fhir:v "copy" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "POST" ]         ] )       ] [
fhir:context [ fhir:v "e1" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "resource" ] ;
fhir:variable [ fhir:v "observation" ] ;
fhir:transform [ fhir:v "create" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "Observation" ]         ] )       ] [
fhir:context [ fhir:v "observation" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "id" ] ;
fhir:variable [ fhir:v "uuid1" ] ;
fhir:transform [ fhir:v "uuid" ]       ] [
fhir:context [ fhir:v "e1" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "fullUrl" ] ;
fhir:transform [ fhir:v "append" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "https://example/Observation/" ]         ] [
fhir:value [ fhir:v "uuid1" ]         ] )       ] [
fhir:context [ fhir:v "request" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "url" ] ;
fhir:transform [ fhir:v "copy" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "Observation" ]         ] )       ] [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "entry" ] ;
fhir:variable [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "create" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "Reference" ]         ] )       ] [
fhir:context [ fhir:v "reference" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "'https://example/Observation/' + %observation.id" ]         ] )       ] [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "text" ] ;
fhir:variable [ fhir:v "fhirText" ]       ] ) ;
      ( fhir:rule [
fhir:name [ fhir:v "narrativeStatus" ] ;
        ( fhir:source [
fhir:context [ fhir:v "cdaText" ]         ] ) ;
        ( fhir:target [
fhir:context [ fhir:v "fhirText" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "status" ] ;
fhir:transform [ fhir:v "copy" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "generated" ]           ] )         ] )       ] [
fhir:name [ fhir:v "narrativeText" ] ;
        ( fhir:source [
fhir:context [ fhir:v "cdaText" ] ;
fhir:variable [ fhir:v "t" ]         ] ) ;
        ( fhir:target [
fhir:context [ fhir:v "fhirText" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "div" ] ;
fhir:transform [ fhir:v "copy" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "t" ]           ] )         ] )       ] [
fhir:name [ fhir:v "code" ] ;
        ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "vvv" ]         ] ) ;
        ( fhir:target [
fhir:context [ fhir:v "observation" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "vvv" ] ;
fhir:transform [ fhir:v "create" ]         ] )       ] [
fhir:name [ fhir:v "statuscode" ] ;
        ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:condition [ fhir:v "observation.statusCode.exists().not()" ]         ] ) ;
        ( fhir:rule [
fhir:name [ fhir:v "status" ] ;
          ( fhir:source [
fhir:context [ fhir:v "src" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "observation" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "status" ] ;
fhir:transform [ fhir:v "copy" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "final" ]             ] )           ] )         ] )       ] [
fhir:name [ fhir:v "reference" ] ;
        ( fhir:source [
fhir:context [ fhir:v "src" ]         ] ) ;
        ( fhir:target [
fhir:context [ fhir:v "observation" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "subject" ] ;
fhir:variable [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "create" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "Reference" ]           ] )         ] [
fhir:context [ fhir:v "reference" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "'https://example/Patient/' + %patient.id" ]           ] )         ] )       ] [
fhir:name [ fhir:v "reference" ] ;
        ( fhir:source [
fhir:context [ fhir:v "src" ]         ] ) ;
        ( fhir:target [
fhir:context [ fhir:v "observation" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "encounter" ] ;
fhir:variable [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "create" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "Reference" ]           ] )         ] [
fhir:context [ fhir:v "reference" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "'https://example/Encounter/' + %enc.id" ]           ] )         ] )       ] [
fhir:name [ fhir:v "reference" ] ;
        ( fhir:source [
fhir:context [ fhir:v "cdaText" ]         ] ) ;
        ( fhir:target [
fhir:context [ fhir:v "observation" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "note" ] ;
fhir:variable [ fhir:v "note" ]         ] ) ;
        ( fhir:rule [
fhir:name [ fhir:v "reference" ] ;
          ( fhir:source [
fhir:context [ fhir:v "cdaText" ] ;
fhir:variable [ fhir:v "t" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "note" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "text" ] ;
fhir:transform [ fhir:v "copy" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "t" ]             ] )           ] )         ] )       ] )     ] [
fhir:name [ fhir:v "2" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "component" ] ;
fhir:variable [ fhir:v "component" ]       ] ) ;
      ( fhir:rule [
fhir:name [ fhir:v "1" ] ;
        ( fhir:source [
fhir:context [ fhir:v "component" ] ;
fhir:element [ fhir:v "section" ] ;
fhir:variable [ fhir:v "section2" ]         ] ) ;
        ( fhir:rule [
fhir:name [ fhir:v "Decorso" ] ;
          ( fhir:source [
fhir:context [ fhir:v "src" ]           ] ) ;
          ( fhir:dependent [
fhir:name [ fhir:v "ClinicalDocumentSottoSectionOBS" ] ;
            ( fhir:variable [ fhir:v "section2" ] [ fhir:v "tgt" ] [ fhir:v "bundle" ] [ fhir:v "enc" ] [ fhir:v "patient" ] )           ] )         ] )       ] )     ] )
  ] [
fhir:name [ fhir:v "ClinicalDocumentSectionComplicanze" ] ;
fhir:typeMode [ fhir:v "none" ] ;
    ( fhir:input [
fhir:name [ fhir:v "cda" ] ;
fhir:type [ fhir:v "ClinicalDocument" ] ;
fhir:mode [ fhir:v "source" ]     ] [
fhir:name [ fhir:v "src" ] ;
fhir:type [ fhir:v "Section" ] ;
fhir:mode [ fhir:v "source" ]     ] [
fhir:name [ fhir:v "patient" ] ;
fhir:type [ fhir:v "Patient" ] ;
fhir:mode [ fhir:v "target" ]     ] [
fhir:name [ fhir:v "tgt" ] ;
fhir:mode [ fhir:v "target" ]     ] [
fhir:name [ fhir:v "bundle" ] ;
fhir:type [ fhir:v "Bundle" ] ;
fhir:mode [ fhir:v "target" ]     ] [
fhir:name [ fhir:v "enc" ] ;
fhir:type [ fhir:v "Encounter" ] ;
fhir:mode [ fhir:v "target" ]     ] ) ;
    ( fhir:rule [
fhir:name [ fhir:v "title" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "title" ] ;
fhir:variable [ fhir:v "t" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "title" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "t.dataString" ]         ] )       ] )     ] [
fhir:name [ fhir:v "code" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "vvv" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "vvv" ] ;
fhir:transform [ fhir:v "create" ]       ] )     ] [
fhir:name [ fhir:v "exist" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:condition [ fhir:v "src.entry.exists()" ]       ] ) ;
      ( fhir:rule [
fhir:name [ fhir:v "cdaText" ] ;
        ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "text" ] ;
fhir:variable [ fhir:v "cdaText" ]         ] ) ;
        ( fhir:target [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "text" ] ;
fhir:variable [ fhir:v "fhirText" ]         ] ) ;
        ( fhir:rule [
fhir:name [ fhir:v "narrativeStatus" ] ;
          ( fhir:source [
fhir:context [ fhir:v "cdaText" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "fhirText" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "status" ] ;
fhir:transform [ fhir:v "copy" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "generated" ]             ] )           ] )         ] [
fhir:name [ fhir:v "narrativeText" ] ;
          ( fhir:source [
fhir:context [ fhir:v "cdaText" ] ;
fhir:variable [ fhir:v "t" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "fhirText" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "div" ] ;
fhir:transform [ fhir:v "copy" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "t" ]             ] )           ] )         ] )       ] )     ] [
fhir:name [ fhir:v "where" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:condition [ fhir:v "src.entry.exists().not()" ]       ] ) ;
      ( fhir:rule [
fhir:name [ fhir:v "cdaText" ] ;
        ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "text" ] ;
fhir:variable [ fhir:v "cdaText" ]         ] ) ;
        ( fhir:target [
fhir:context [ fhir:v "bundle" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "entry" ] ;
fhir:variable [ fhir:v "e1" ]         ] [
fhir:context [ fhir:v "e1" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "request" ] ;
fhir:variable [ fhir:v "request" ] ;
fhir:transform [ fhir:v "create" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "BackboneElement" ]           ] )         ] [
fhir:context [ fhir:v "request" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "method" ] ;
fhir:transform [ fhir:v "copy" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "POST" ]           ] )         ] [
fhir:context [ fhir:v "e1" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "resource" ] ;
fhir:variable [ fhir:v "observation" ] ;
fhir:transform [ fhir:v "create" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "Observation" ]           ] )         ] [
fhir:context [ fhir:v "observation" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "id" ] ;
fhir:variable [ fhir:v "uuid1" ] ;
fhir:transform [ fhir:v "uuid" ]         ] [
fhir:context [ fhir:v "e1" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "fullUrl" ] ;
fhir:transform [ fhir:v "append" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "https://example/Observation/" ]           ] [
fhir:value [ fhir:v "uuid1" ]           ] )         ] [
fhir:context [ fhir:v "request" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "url" ] ;
fhir:transform [ fhir:v "copy" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "Observation" ]           ] )         ] [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "entry" ] ;
fhir:variable [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "create" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "Reference" ]           ] )         ] [
fhir:context [ fhir:v "reference" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "'https://example/Observation/' + %observation.id" ]           ] )         ] ) ;
        ( fhir:rule [
fhir:name [ fhir:v "reference" ] ;
          ( fhir:source [
fhir:context [ fhir:v "src" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "observation" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "subject" ] ;
fhir:variable [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "create" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "Reference" ]             ] )           ] [
fhir:context [ fhir:v "reference" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "'https://example/Patient/' + %patient.id" ]             ] )           ] )         ] [
fhir:name [ fhir:v "reference" ] ;
          ( fhir:source [
fhir:context [ fhir:v "src" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "observation" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "encounter" ] ;
fhir:variable [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "create" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "Reference" ]             ] )           ] [
fhir:context [ fhir:v "reference" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "'https://example/Encounter/' + %enc.id" ]             ] )           ] )         ] [
fhir:name [ fhir:v "code" ] ;
          ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "vvv" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "observation" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "vvv" ] ;
fhir:transform [ fhir:v "create" ]           ] )         ] [
fhir:name [ fhir:v "statuscode" ] ;
          ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:condition [ fhir:v "observation.statusCode.exists().not()" ]           ] ) ;
          ( fhir:rule [
fhir:name [ fhir:v "status" ] ;
            ( fhir:source [
fhir:context [ fhir:v "src" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "observation" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "status" ] ;
fhir:transform [ fhir:v "copy" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "final" ]               ] )             ] )           ] )         ] [
fhir:name [ fhir:v "reference" ] ;
          ( fhir:source [
fhir:context [ fhir:v "cdaText" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "observation" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "note" ] ;
fhir:variable [ fhir:v "note" ]           ] ) ;
          ( fhir:rule [
fhir:name [ fhir:v "reference" ] ;
            ( fhir:source [
fhir:context [ fhir:v "cdaText" ] ;
fhir:variable [ fhir:v "t" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "note" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "text" ] ;
fhir:transform [ fhir:v "copy" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "t" ]               ] )             ] )           ] )         ] )       ] )     ] [
fhir:name [ fhir:v "entry" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "entry" ] ;
fhir:variable [ fhir:v "entry1" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "bundle" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "entry" ] ;
fhir:variable [ fhir:v "e1" ]       ] [
fhir:context [ fhir:v "e1" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "request" ] ;
fhir:variable [ fhir:v "request" ] ;
fhir:transform [ fhir:v "create" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "BackboneElement" ]         ] )       ] [
fhir:context [ fhir:v "request" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "method" ] ;
fhir:transform [ fhir:v "copy" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "POST" ]         ] )       ] [
fhir:context [ fhir:v "e1" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "resource" ] ;
fhir:variable [ fhir:v "observation" ] ;
fhir:transform [ fhir:v "create" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "Observation" ]         ] )       ] [
fhir:context [ fhir:v "observation" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "id" ] ;
fhir:variable [ fhir:v "uuid1" ] ;
fhir:transform [ fhir:v "uuid" ]       ] [
fhir:context [ fhir:v "e1" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "fullUrl" ] ;
fhir:transform [ fhir:v "append" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "https://example/Observation/" ]         ] [
fhir:value [ fhir:v "uuid1" ]         ] )       ] [
fhir:context [ fhir:v "request" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "url" ] ;
fhir:transform [ fhir:v "copy" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "Observation" ]         ] )       ] [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "entry" ] ;
fhir:variable [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "create" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "Reference" ]         ] )       ] [
fhir:context [ fhir:v "reference" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "'https://example/Observation/' + %observation.id" ]         ] )       ] ) ;
      ( fhir:rule [
fhir:name [ fhir:v "act" ] ;
        ( fhir:source [
fhir:context [ fhir:v "entry1" ] ;
fhir:element [ fhir:v "observation" ] ;
fhir:variable [ fhir:v "obs" ]         ] ) ;
        ( fhir:dependent [
fhir:name [ fhir:v "Observation" ] ;
          ( fhir:variable [ fhir:v "obs" ] [ fhir:v "patient" ] [ fhir:v "enc" ] [ fhir:v "observation" ] [ fhir:v "bundle" ] )         ] )       ] )     ] )
  ] [
fhir:name [ fhir:v "ClinicalDocumentSectionRiscontri" ] ;
fhir:typeMode [ fhir:v "none" ] ;
    ( fhir:input [
fhir:name [ fhir:v "cda" ] ;
fhir:type [ fhir:v "ClinicalDocument" ] ;
fhir:mode [ fhir:v "source" ]     ] [
fhir:name [ fhir:v "src" ] ;
fhir:type [ fhir:v "Section" ] ;
fhir:mode [ fhir:v "source" ]     ] [
fhir:name [ fhir:v "patient" ] ;
fhir:type [ fhir:v "Patient" ] ;
fhir:mode [ fhir:v "target" ]     ] [
fhir:name [ fhir:v "tgt" ] ;
fhir:mode [ fhir:v "target" ]     ] [
fhir:name [ fhir:v "bundle" ] ;
fhir:type [ fhir:v "Bundle" ] ;
fhir:mode [ fhir:v "target" ]     ] [
fhir:name [ fhir:v "enc" ] ;
fhir:type [ fhir:v "Encounter" ] ;
fhir:mode [ fhir:v "target" ]     ] ) ;
    ( fhir:rule [
fhir:name [ fhir:v "title" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "title" ] ;
fhir:variable [ fhir:v "t" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "title" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "t.dataString" ]         ] )       ] )     ] [
fhir:name [ fhir:v "code" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "vvv" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "vvv" ] ;
fhir:transform [ fhir:v "create" ]       ] )     ] [
fhir:name [ fhir:v "cdaText" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "text" ] ;
fhir:variable [ fhir:v "cdaText" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "bundle" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "entry" ] ;
fhir:variable [ fhir:v "e1" ]       ] [
fhir:context [ fhir:v "e1" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "request" ] ;
fhir:variable [ fhir:v "request" ] ;
fhir:transform [ fhir:v "create" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "BackboneElement" ]         ] )       ] [
fhir:context [ fhir:v "request" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "method" ] ;
fhir:transform [ fhir:v "copy" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "POST" ]         ] )       ] [
fhir:context [ fhir:v "e1" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "resource" ] ;
fhir:variable [ fhir:v "observation" ] ;
fhir:transform [ fhir:v "create" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "Observation" ]         ] )       ] [
fhir:context [ fhir:v "observation" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "id" ] ;
fhir:variable [ fhir:v "uuid1" ] ;
fhir:transform [ fhir:v "uuid" ]       ] [
fhir:context [ fhir:v "e1" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "fullUrl" ] ;
fhir:transform [ fhir:v "append" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "https://example/Observation/" ]         ] [
fhir:value [ fhir:v "uuid1" ]         ] )       ] [
fhir:context [ fhir:v "request" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "url" ] ;
fhir:transform [ fhir:v "copy" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "Observation" ]         ] )       ] [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "entry" ] ;
fhir:variable [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "create" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "Reference" ]         ] )       ] [
fhir:context [ fhir:v "reference" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "'https://example/Observation/' + %observation.id" ]         ] )       ] [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "text" ] ;
fhir:variable [ fhir:v "fhirText" ]       ] ) ;
      ( fhir:rule [
fhir:name [ fhir:v "narrativeStatus" ] ;
        ( fhir:source [
fhir:context [ fhir:v "cdaText" ]         ] ) ;
        ( fhir:target [
fhir:context [ fhir:v "fhirText" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "status" ] ;
fhir:transform [ fhir:v "copy" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "generated" ]           ] )         ] )       ] [
fhir:name [ fhir:v "narrativeText" ] ;
        ( fhir:source [
fhir:context [ fhir:v "cdaText" ] ;
fhir:variable [ fhir:v "t" ]         ] ) ;
        ( fhir:target [
fhir:context [ fhir:v "fhirText" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "div" ] ;
fhir:transform [ fhir:v "copy" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "t" ]           ] )         ] )       ] [
fhir:name [ fhir:v "code" ] ;
        ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "vvv" ]         ] ) ;
        ( fhir:target [
fhir:context [ fhir:v "observation" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "vvv" ] ;
fhir:transform [ fhir:v "create" ]         ] )       ] [
fhir:name [ fhir:v "statuscode" ] ;
        ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:condition [ fhir:v "observation.statusCode.exists().not()" ]         ] ) ;
        ( fhir:rule [
fhir:name [ fhir:v "status" ] ;
          ( fhir:source [
fhir:context [ fhir:v "src" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "observation" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "status" ] ;
fhir:transform [ fhir:v "copy" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "final" ]             ] )           ] )         ] )       ] [
fhir:name [ fhir:v "reference" ] ;
        ( fhir:source [
fhir:context [ fhir:v "src" ]         ] ) ;
        ( fhir:target [
fhir:context [ fhir:v "observation" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "subject" ] ;
fhir:variable [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "create" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "Reference" ]           ] )         ] [
fhir:context [ fhir:v "reference" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "'https://example/Patient/' + %patient.id" ]           ] )         ] )       ] [
fhir:name [ fhir:v "reference" ] ;
        ( fhir:source [
fhir:context [ fhir:v "src" ]         ] ) ;
        ( fhir:target [
fhir:context [ fhir:v "observation" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "encounter" ] ;
fhir:variable [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "create" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "Reference" ]           ] )         ] [
fhir:context [ fhir:v "reference" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "'https://example/Encounter/' + %enc.id" ]           ] )         ] )       ] [
fhir:name [ fhir:v "reference" ] ;
        ( fhir:source [
fhir:context [ fhir:v "cdaText" ]         ] ) ;
        ( fhir:target [
fhir:context [ fhir:v "observation" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "note" ] ;
fhir:variable [ fhir:v "note" ]         ] ) ;
        ( fhir:rule [
fhir:name [ fhir:v "reference" ] ;
          ( fhir:source [
fhir:context [ fhir:v "cdaText" ] ;
fhir:variable [ fhir:v "t" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "note" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "text" ] ;
fhir:transform [ fhir:v "copy" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "t" ]             ] )           ] )         ] )       ] )     ] [
fhir:name [ fhir:v "2" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "component" ] ;
fhir:variable [ fhir:v "component" ]       ] ) ;
      ( fhir:rule [
fhir:name [ fhir:v "1" ] ;
        ( fhir:source [
fhir:context [ fhir:v "component" ] ;
fhir:element [ fhir:v "section" ] ;
fhir:variable [ fhir:v "section2" ]         ] ) ;
        ( fhir:rule [
fhir:name [ fhir:v "Decorso" ] ;
          ( fhir:source [
fhir:context [ fhir:v "src" ]           ] ) ;
          ( fhir:dependent [
fhir:name [ fhir:v "ClinicalDocumentSottoSectionOBS" ] ;
            ( fhir:variable [ fhir:v "section2" ] [ fhir:v "tgt" ] [ fhir:v "bundle" ] [ fhir:v "enc" ] [ fhir:v "patient" ] )           ] )         ] )       ] )     ] )
  ] [
fhir:name [ fhir:v "ClinicalDocumentSectionConsulenza" ] ;
fhir:typeMode [ fhir:v "none" ] ;
    ( fhir:input [
fhir:name [ fhir:v "cda" ] ;
fhir:type [ fhir:v "ClinicalDocument" ] ;
fhir:mode [ fhir:v "source" ]     ] [
fhir:name [ fhir:v "src" ] ;
fhir:type [ fhir:v "Section" ] ;
fhir:mode [ fhir:v "source" ]     ] [
fhir:name [ fhir:v "patient" ] ;
fhir:type [ fhir:v "Patient" ] ;
fhir:mode [ fhir:v "target" ]     ] [
fhir:name [ fhir:v "tgt" ] ;
fhir:mode [ fhir:v "target" ]     ] [
fhir:name [ fhir:v "bundle" ] ;
fhir:type [ fhir:v "Bundle" ] ;
fhir:mode [ fhir:v "target" ]     ] [
fhir:name [ fhir:v "enc" ] ;
fhir:type [ fhir:v "Encounter" ] ;
fhir:mode [ fhir:v "target" ]     ] ) ;
    ( fhir:rule [
fhir:name [ fhir:v "title" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "title" ] ;
fhir:variable [ fhir:v "t" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "title" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "t.dataString" ]         ] )       ] )     ] [
fhir:name [ fhir:v "code" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "vvv" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "vvv" ] ;
fhir:transform [ fhir:v "create" ]       ] )     ] [
fhir:name [ fhir:v "exist" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:condition [ fhir:v "src.entry.exists()" ]       ] ) ;
      ( fhir:rule [
fhir:name [ fhir:v "cdaText" ] ;
        ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "text" ] ;
fhir:variable [ fhir:v "cdaText" ]         ] ) ;
        ( fhir:target [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "text" ] ;
fhir:variable [ fhir:v "fhirText" ]         ] ) ;
        ( fhir:rule [
fhir:name [ fhir:v "narrativeStatus" ] ;
          ( fhir:source [
fhir:context [ fhir:v "cdaText" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "fhirText" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "status" ] ;
fhir:transform [ fhir:v "copy" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "generated" ]             ] )           ] )         ] [
fhir:name [ fhir:v "narrativeText" ] ;
          ( fhir:source [
fhir:context [ fhir:v "cdaText" ] ;
fhir:variable [ fhir:v "t" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "fhirText" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "div" ] ;
fhir:transform [ fhir:v "copy" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "t" ]             ] )           ] )         ] )       ] )     ] [
fhir:name [ fhir:v "where" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:condition [ fhir:v "src.entry.exists().not()" ]       ] ) ;
      ( fhir:rule [
fhir:name [ fhir:v "cdaText" ] ;
        ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "text" ] ;
fhir:variable [ fhir:v "cdaText" ]         ] ) ;
        ( fhir:target [
fhir:context [ fhir:v "bundle" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "entry" ] ;
fhir:variable [ fhir:v "e1" ]         ] [
fhir:context [ fhir:v "e1" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "request" ] ;
fhir:variable [ fhir:v "request" ] ;
fhir:transform [ fhir:v "create" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "BackboneElement" ]           ] )         ] [
fhir:context [ fhir:v "request" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "method" ] ;
fhir:transform [ fhir:v "copy" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "POST" ]           ] )         ] [
fhir:context [ fhir:v "e1" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "resource" ] ;
fhir:variable [ fhir:v "observation" ] ;
fhir:transform [ fhir:v "create" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "Observation" ]           ] )         ] [
fhir:context [ fhir:v "observation" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "id" ] ;
fhir:variable [ fhir:v "uuid1" ] ;
fhir:transform [ fhir:v "uuid" ]         ] [
fhir:context [ fhir:v "e1" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "fullUrl" ] ;
fhir:transform [ fhir:v "append" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "https://example/Observation/" ]           ] [
fhir:value [ fhir:v "uuid1" ]           ] )         ] [
fhir:context [ fhir:v "request" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "url" ] ;
fhir:transform [ fhir:v "copy" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "Observation" ]           ] )         ] [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "entry" ] ;
fhir:variable [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "create" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "Reference" ]           ] )         ] [
fhir:context [ fhir:v "reference" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "'https://example/Observation/' + %observation.id" ]           ] )         ] ) ;
        ( fhir:rule [
fhir:name [ fhir:v "reference" ] ;
          ( fhir:source [
fhir:context [ fhir:v "src" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "observation" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "subject" ] ;
fhir:variable [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "create" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "Reference" ]             ] )           ] [
fhir:context [ fhir:v "reference" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "'https://example/Patient/' + %patient.id" ]             ] )           ] )         ] [
fhir:name [ fhir:v "reference" ] ;
          ( fhir:source [
fhir:context [ fhir:v "src" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "observation" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "encounter" ] ;
fhir:variable [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "create" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "Reference" ]             ] )           ] [
fhir:context [ fhir:v "reference" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "'https://example/Encounter/' + %enc.id" ]             ] )           ] )         ] [
fhir:name [ fhir:v "code" ] ;
          ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "vvv" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "observation" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "vvv" ] ;
fhir:transform [ fhir:v "create" ]           ] )         ] [
fhir:name [ fhir:v "statuscode" ] ;
          ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:condition [ fhir:v "observation.statusCode.exists().not()" ]           ] ) ;
          ( fhir:rule [
fhir:name [ fhir:v "status" ] ;
            ( fhir:source [
fhir:context [ fhir:v "src" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "observation" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "status" ] ;
fhir:transform [ fhir:v "copy" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "final" ]               ] )             ] )           ] )         ] [
fhir:name [ fhir:v "reference" ] ;
          ( fhir:source [
fhir:context [ fhir:v "cdaText" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "observation" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "note" ] ;
fhir:variable [ fhir:v "note" ]           ] ) ;
          ( fhir:rule [
fhir:name [ fhir:v "reference" ] ;
            ( fhir:source [
fhir:context [ fhir:v "cdaText" ] ;
fhir:variable [ fhir:v "t" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "note" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "text" ] ;
fhir:transform [ fhir:v "copy" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "t" ]               ] )             ] )           ] )         ] )       ] )     ] [
fhir:name [ fhir:v "entry" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "entry" ] ;
fhir:variable [ fhir:v "entry1" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "bundle" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "entry" ] ;
fhir:variable [ fhir:v "e1" ]       ] [
fhir:context [ fhir:v "e1" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "request" ] ;
fhir:variable [ fhir:v "request" ] ;
fhir:transform [ fhir:v "create" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "BackboneElement" ]         ] )       ] [
fhir:context [ fhir:v "request" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "method" ] ;
fhir:transform [ fhir:v "copy" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "POST" ]         ] )       ] [
fhir:context [ fhir:v "e1" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "resource" ] ;
fhir:variable [ fhir:v "observation" ] ;
fhir:transform [ fhir:v "create" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "Observation" ]         ] )       ] [
fhir:context [ fhir:v "observation" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "id" ] ;
fhir:variable [ fhir:v "uuid1" ] ;
fhir:transform [ fhir:v "uuid" ]       ] [
fhir:context [ fhir:v "e1" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "fullUrl" ] ;
fhir:transform [ fhir:v "append" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "https://example/Observation/" ]         ] [
fhir:value [ fhir:v "uuid1" ]         ] )       ] [
fhir:context [ fhir:v "request" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "url" ] ;
fhir:transform [ fhir:v "copy" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "Observation" ]         ] )       ] [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "entry" ] ;
fhir:variable [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "create" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "Reference" ]         ] )       ] [
fhir:context [ fhir:v "reference" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "'https://example/Observation/' + %observation.id" ]         ] )       ] ) ;
      ( fhir:rule [
fhir:name [ fhir:v "act" ] ;
        ( fhir:source [
fhir:context [ fhir:v "entry1" ] ;
fhir:element [ fhir:v "observation" ] ;
fhir:variable [ fhir:v "obs" ]         ] ) ;
        ( fhir:dependent [
fhir:name [ fhir:v "ObservationConsulenza" ] ;
          ( fhir:variable [ fhir:v "obs" ] [ fhir:v "patient" ] [ fhir:v "enc" ] [ fhir:v "observation" ] [ fhir:v "bundle" ] )         ] )       ] )     ] )
  ] [
fhir:name [ fhir:v "ClinicalDocumentSectionEsamiEseguitiRicovero" ] ;
fhir:typeMode [ fhir:v "none" ] ;
    ( fhir:input [
fhir:name [ fhir:v "cda" ] ;
fhir:type [ fhir:v "ClinicalDocument" ] ;
fhir:mode [ fhir:v "source" ]     ] [
fhir:name [ fhir:v "src" ] ;
fhir:type [ fhir:v "Section" ] ;
fhir:mode [ fhir:v "source" ]     ] [
fhir:name [ fhir:v "patient" ] ;
fhir:type [ fhir:v "Patient" ] ;
fhir:mode [ fhir:v "target" ]     ] [
fhir:name [ fhir:v "tgt" ] ;
fhir:mode [ fhir:v "target" ]     ] [
fhir:name [ fhir:v "bundle" ] ;
fhir:type [ fhir:v "Bundle" ] ;
fhir:mode [ fhir:v "target" ]     ] [
fhir:name [ fhir:v "enc" ] ;
fhir:type [ fhir:v "Encounter" ] ;
fhir:mode [ fhir:v "target" ]     ] ) ;
    ( fhir:rule [
fhir:name [ fhir:v "title" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "title" ] ;
fhir:variable [ fhir:v "t" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "title" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "t.dataString" ]         ] )       ] )     ] [
fhir:name [ fhir:v "code" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "vvv" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "vvv" ] ;
fhir:transform [ fhir:v "create" ]       ] )     ] [
fhir:name [ fhir:v "exists" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:condition [ fhir:v "src.entry.exists()" ]       ] ) ;
      ( fhir:rule [
fhir:name [ fhir:v "cdaText" ] ;
        ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "text" ] ;
fhir:variable [ fhir:v "cdaText" ]         ] ) ;
        ( fhir:target [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "text" ] ;
fhir:variable [ fhir:v "fhirText" ]         ] ) ;
        ( fhir:rule [
fhir:name [ fhir:v "narrativeStatus" ] ;
          ( fhir:source [
fhir:context [ fhir:v "cdaText" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "fhirText" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "status" ] ;
fhir:transform [ fhir:v "copy" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "generated" ]             ] )           ] )         ] [
fhir:name [ fhir:v "narrativeText" ] ;
          ( fhir:source [
fhir:context [ fhir:v "cdaText" ] ;
fhir:variable [ fhir:v "t" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "fhirText" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "div" ] ;
fhir:transform [ fhir:v "copy" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "t" ]             ] )           ] )         ] )       ] )     ] [
fhir:name [ fhir:v "where" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:condition [ fhir:v "src.entry.exists().not()" ]       ] ) ;
      ( fhir:rule [
fhir:name [ fhir:v "cdaText" ] ;
        ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "text" ] ;
fhir:variable [ fhir:v "cdaText" ]         ] ) ;
        ( fhir:target [
fhir:context [ fhir:v "bundle" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "entry" ] ;
fhir:variable [ fhir:v "e1" ]         ] [
fhir:context [ fhir:v "e1" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "request" ] ;
fhir:variable [ fhir:v "request" ] ;
fhir:transform [ fhir:v "create" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "BackboneElement" ]           ] )         ] [
fhir:context [ fhir:v "request" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "method" ] ;
fhir:transform [ fhir:v "copy" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "POST" ]           ] )         ] [
fhir:context [ fhir:v "e1" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "resource" ] ;
fhir:variable [ fhir:v "observation" ] ;
fhir:transform [ fhir:v "create" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "Observation" ]           ] )         ] [
fhir:context [ fhir:v "observation" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "id" ] ;
fhir:variable [ fhir:v "uuid1" ] ;
fhir:transform [ fhir:v "uuid" ]         ] [
fhir:context [ fhir:v "e1" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "fullUrl" ] ;
fhir:transform [ fhir:v "append" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "https://example/Observation/" ]           ] [
fhir:value [ fhir:v "uuid1" ]           ] )         ] [
fhir:context [ fhir:v "request" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "url" ] ;
fhir:transform [ fhir:v "copy" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "Observation" ]           ] )         ] [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "entry" ] ;
fhir:variable [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "create" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "Reference" ]           ] )         ] [
fhir:context [ fhir:v "reference" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "'https://example/Observation/' + %observation.id" ]           ] )         ] ) ;
        ( fhir:rule [
fhir:name [ fhir:v "reference" ] ;
          ( fhir:source [
fhir:context [ fhir:v "src" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "observation" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "subject" ] ;
fhir:variable [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "create" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "Reference" ]             ] )           ] [
fhir:context [ fhir:v "reference" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "'https://example/Patient/' + %patient.id" ]             ] )           ] )         ] [
fhir:name [ fhir:v "reference" ] ;
          ( fhir:source [
fhir:context [ fhir:v "src" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "observation" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "encounter" ] ;
fhir:variable [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "create" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "Reference" ]             ] )           ] [
fhir:context [ fhir:v "reference" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "'https://example/Encounter/' + %enc.id" ]             ] )           ] )         ] [
fhir:name [ fhir:v "code" ] ;
          ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "vvv" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "observation" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "vvv" ] ;
fhir:transform [ fhir:v "create" ]           ] )         ] [
fhir:name [ fhir:v "statuscode" ] ;
          ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:condition [ fhir:v "observation.statusCode.exists().not()" ]           ] ) ;
          ( fhir:rule [
fhir:name [ fhir:v "status" ] ;
            ( fhir:source [
fhir:context [ fhir:v "src" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "observation" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "status" ] ;
fhir:transform [ fhir:v "copy" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "final" ]               ] )             ] )           ] )         ] [
fhir:name [ fhir:v "reference" ] ;
          ( fhir:source [
fhir:context [ fhir:v "cdaText" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "observation" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "note" ] ;
fhir:variable [ fhir:v "note" ]           ] ) ;
          ( fhir:rule [
fhir:name [ fhir:v "reference" ] ;
            ( fhir:source [
fhir:context [ fhir:v "cdaText" ] ;
fhir:variable [ fhir:v "t" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "note" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "text" ] ;
fhir:transform [ fhir:v "copy" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "t" ]               ] )             ] )           ] )         ] )       ] )     ] [
fhir:name [ fhir:v "entry" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "entry" ] ;
fhir:variable [ fhir:v "entry1" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "bundle" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "entry" ] ;
fhir:variable [ fhir:v "e1" ]       ] [
fhir:context [ fhir:v "e1" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "request" ] ;
fhir:variable [ fhir:v "request" ] ;
fhir:transform [ fhir:v "create" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "BackboneElement" ]         ] )       ] [
fhir:context [ fhir:v "request" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "method" ] ;
fhir:transform [ fhir:v "copy" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "POST" ]         ] )       ] [
fhir:context [ fhir:v "e1" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "resource" ] ;
fhir:variable [ fhir:v "observation" ] ;
fhir:transform [ fhir:v "create" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "Observation" ]         ] )       ] [
fhir:context [ fhir:v "observation" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "id" ] ;
fhir:variable [ fhir:v "uuid1" ] ;
fhir:transform [ fhir:v "uuid" ]       ] [
fhir:context [ fhir:v "e1" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "fullUrl" ] ;
fhir:transform [ fhir:v "append" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "https://example/Observation/" ]         ] [
fhir:value [ fhir:v "uuid1" ]         ] )       ] [
fhir:context [ fhir:v "request" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "url" ] ;
fhir:transform [ fhir:v "copy" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "Observation" ]         ] )       ] [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "entry" ] ;
fhir:variable [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "create" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "Reference" ]         ] )       ] [
fhir:context [ fhir:v "reference" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "'https://example/Observation/' + %observation.id" ]         ] )       ] ) ;
      ( fhir:rule [
fhir:name [ fhir:v "act" ] ;
        ( fhir:source [
fhir:context [ fhir:v "entry1" ] ;
fhir:element [ fhir:v "observation" ] ;
fhir:variable [ fhir:v "obs" ]         ] ) ;
        ( fhir:dependent [
fhir:name [ fhir:v "ObservationEsamiDuranteRicovero" ] ;
          ( fhir:variable [ fhir:v "obs" ] [ fhir:v "patient" ] [ fhir:v "enc" ] [ fhir:v "observation" ] [ fhir:v "bundle" ] )         ] )       ] )     ] )
  ] [
fhir:name [ fhir:v "ClinicalDocumentSectionProcedureEseguiteRicovero" ] ;
fhir:typeMode [ fhir:v "none" ] ;
    ( fhir:input [
fhir:name [ fhir:v "cda" ] ;
fhir:type [ fhir:v "ClinicalDocument" ] ;
fhir:mode [ fhir:v "source" ]     ] [
fhir:name [ fhir:v "src" ] ;
fhir:type [ fhir:v "Section" ] ;
fhir:mode [ fhir:v "source" ]     ] [
fhir:name [ fhir:v "patient" ] ;
fhir:type [ fhir:v "Patient" ] ;
fhir:mode [ fhir:v "target" ]     ] [
fhir:name [ fhir:v "tgt" ] ;
fhir:mode [ fhir:v "target" ]     ] [
fhir:name [ fhir:v "bundle" ] ;
fhir:type [ fhir:v "Bundle" ] ;
fhir:mode [ fhir:v "target" ]     ] [
fhir:name [ fhir:v "enc" ] ;
fhir:type [ fhir:v "Encounter" ] ;
fhir:mode [ fhir:v "target" ]     ] ) ;
    ( fhir:rule [
fhir:name [ fhir:v "title" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "title" ] ;
fhir:variable [ fhir:v "t" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "title" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "t.dataString" ]         ] )       ] )     ] [
fhir:name [ fhir:v "code" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "vvv" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "vvv" ] ;
fhir:transform [ fhir:v "create" ]       ] )     ] [
fhir:name [ fhir:v "exists" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:condition [ fhir:v "src.entry.exists()" ]       ] ) ;
      ( fhir:rule [
fhir:name [ fhir:v "cdaText" ] ;
        ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "text" ] ;
fhir:variable [ fhir:v "cdaText" ]         ] ) ;
        ( fhir:target [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "text" ] ;
fhir:variable [ fhir:v "fhirText" ]         ] ) ;
        ( fhir:rule [
fhir:name [ fhir:v "narrativeStatus" ] ;
          ( fhir:source [
fhir:context [ fhir:v "cdaText" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "fhirText" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "status" ] ;
fhir:transform [ fhir:v "copy" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "generated" ]             ] )           ] )         ] [
fhir:name [ fhir:v "narrativeText" ] ;
          ( fhir:source [
fhir:context [ fhir:v "cdaText" ] ;
fhir:variable [ fhir:v "t" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "fhirText" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "div" ] ;
fhir:transform [ fhir:v "copy" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "t" ]             ] )           ] )         ] )       ] )     ] [
fhir:name [ fhir:v "where" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:condition [ fhir:v "src.entry.exists().not()" ]       ] ) ;
      ( fhir:rule [
fhir:name [ fhir:v "cdaText" ] ;
        ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "text" ] ;
fhir:variable [ fhir:v "cdaText" ]         ] ) ;
        ( fhir:target [
fhir:context [ fhir:v "bundle" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "entry" ] ;
fhir:variable [ fhir:v "e1" ]         ] [
fhir:context [ fhir:v "e1" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "request" ] ;
fhir:variable [ fhir:v "request" ] ;
fhir:transform [ fhir:v "create" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "BackboneElement" ]           ] )         ] [
fhir:context [ fhir:v "request" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "method" ] ;
fhir:transform [ fhir:v "copy" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "POST" ]           ] )         ] [
fhir:context [ fhir:v "e1" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "resource" ] ;
fhir:variable [ fhir:v "procedure" ] ;
fhir:transform [ fhir:v "create" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "Procedure" ]           ] )         ] [
fhir:context [ fhir:v "procedure" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "id" ] ;
fhir:variable [ fhir:v "uuid1" ] ;
fhir:transform [ fhir:v "uuid" ]         ] [
fhir:context [ fhir:v "e1" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "fullUrl" ] ;
fhir:transform [ fhir:v "append" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "https://example/Procedure/" ]           ] [
fhir:value [ fhir:v "uuid1" ]           ] )         ] [
fhir:context [ fhir:v "request" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "url" ] ;
fhir:transform [ fhir:v "copy" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "Procedure" ]           ] )         ] [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "entry" ] ;
fhir:variable [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "create" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "Reference" ]           ] )         ] [
fhir:context [ fhir:v "reference" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "'https://example/Procedure/' + %procedure.id" ]           ] )         ] ) ;
        ( fhir:rule [
fhir:name [ fhir:v "reference" ] ;
          ( fhir:source [
fhir:context [ fhir:v "src" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "procedure" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "subject" ] ;
fhir:variable [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "create" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "Reference" ]             ] )           ] [
fhir:context [ fhir:v "reference" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "'https://example/Patient/' + %patient.id" ]             ] )           ] )         ] [
fhir:name [ fhir:v "reference" ] ;
          ( fhir:source [
fhir:context [ fhir:v "src" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "procedure" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "encounter" ] ;
fhir:variable [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "create" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "Reference" ]             ] )           ] [
fhir:context [ fhir:v "reference" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "'https://example/Encounter/' + %enc.id" ]             ] )           ] )         ] [
fhir:name [ fhir:v "statuscode" ] ;
          ( fhir:source [
fhir:context [ fhir:v "src" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "procedure" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "status" ] ;
fhir:transform [ fhir:v "copy" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "unknown" ]             ] )           ] )         ] [
fhir:name [ fhir:v "reference" ] ;
          ( fhir:source [
fhir:context [ fhir:v "cdaText" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "procedure" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "note" ] ;
fhir:variable [ fhir:v "note" ]           ] ) ;
          ( fhir:rule [
fhir:name [ fhir:v "reference" ] ;
            ( fhir:source [
fhir:context [ fhir:v "cdaText" ] ;
fhir:variable [ fhir:v "t" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "note" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "text" ] ;
fhir:transform [ fhir:v "copy" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "t" ]               ] )             ] )           ] )         ] )       ] )     ] [
fhir:name [ fhir:v "Entry" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "entry" ] ;
fhir:variable [ fhir:v "entry1" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "bundle" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "entry" ] ;
fhir:variable [ fhir:v "e1" ]       ] [
fhir:context [ fhir:v "e1" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "request" ] ;
fhir:variable [ fhir:v "request" ] ;
fhir:transform [ fhir:v "create" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "BackboneElement" ]         ] )       ] [
fhir:context [ fhir:v "request" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "method" ] ;
fhir:transform [ fhir:v "copy" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "POST" ]         ] )       ] [
fhir:context [ fhir:v "e1" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "resource" ] ;
fhir:variable [ fhir:v "procedure" ] ;
fhir:transform [ fhir:v "create" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "Procedure" ]         ] )       ] [
fhir:context [ fhir:v "procedure" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "id" ] ;
fhir:variable [ fhir:v "uuid1" ] ;
fhir:transform [ fhir:v "uuid" ]       ] [
fhir:context [ fhir:v "e1" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "fullUrl" ] ;
fhir:transform [ fhir:v "append" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "https://example/Procedure/" ]         ] [
fhir:value [ fhir:v "uuid1" ]         ] )       ] [
fhir:context [ fhir:v "request" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "url" ] ;
fhir:transform [ fhir:v "copy" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "Procedure" ]         ] )       ] [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "entry" ] ;
fhir:variable [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "create" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "Reference" ]         ] )       ] [
fhir:context [ fhir:v "reference" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "'https://example/Procedure/' + %procedure.id" ]         ] )       ] ) ;
      ( fhir:rule [
fhir:name [ fhir:v "reference" ] ;
        ( fhir:source [
fhir:context [ fhir:v "src" ]         ] ) ;
        ( fhir:target [
fhir:context [ fhir:v "procedure" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "subject" ] ;
fhir:variable [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "create" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "Reference" ]           ] )         ] [
fhir:context [ fhir:v "reference" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "'https://example/Patient/' + %patient.id" ]           ] )         ] )       ] [
fhir:name [ fhir:v "reference" ] ;
        ( fhir:source [
fhir:context [ fhir:v "src" ]         ] ) ;
        ( fhir:target [
fhir:context [ fhir:v "procedure" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "encounter" ] ;
fhir:variable [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "create" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "Reference" ]           ] )         ] [
fhir:context [ fhir:v "reference" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "'https://example/Encounter/' + %enc.id" ]           ] )         ] )       ] [
fhir:name [ fhir:v "Procedure" ] ;
        ( fhir:source [
fhir:context [ fhir:v "entry1" ] ;
fhir:element [ fhir:v "procedure" ] ;
fhir:variable [ fhir:v "proceduresrc" ]         ] ) ;
        ( fhir:rule [
fhir:name [ fhir:v "code" ] ;
          ( fhir:source [
fhir:context [ fhir:v "proceduresrc" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "vvv" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "procedure" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "vvv" ] ;
fhir:transform [ fhir:v "create" ]           ] )         ] [
fhir:name [ fhir:v "text" ] ;
          ( fhir:source [
fhir:context [ fhir:v "proceduresrc" ] ;
fhir:element [ fhir:v "text" ] ;
fhir:variable [ fhir:v "txt" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "procedure" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "note" ] ;
fhir:variable [ fhir:v "note" ]           ] ) ;
          ( fhir:rule [
fhir:name [ fhir:v "reference" ] ;
            ( fhir:source [
fhir:context [ fhir:v "txt" ] ;
fhir:element [ fhir:v "reference" ] ;
fhir:variable [ fhir:v "ref" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "note" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "text" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "ref.value" ]               ] )             ] )           ] )         ] [
fhir:name [ fhir:v "status" ] ;
          ( fhir:source [
fhir:context [ fhir:v "proceduresrc" ] ;
fhir:condition [ fhir:v "proc.statusCode.exists().not()" ]           ] ) ;
          ( fhir:rule [
fhir:name [ fhir:v "statuscode" ] ;
            ( fhir:source [
fhir:context [ fhir:v "proceduresrc" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "procedure" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "status" ] ;
fhir:transform [ fhir:v "copy" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "unknown" ]               ] )             ] )           ] )         ] [
fhir:name [ fhir:v "statusCode" ] ;
          ( fhir:source [
fhir:context [ fhir:v "proceduresrc" ] ;
fhir:element [ fhir:v "statusCode" ] ;
fhir:variable [ fhir:v "statusc" ] ;
fhir:condition [ fhir:v "(code = 'completed')" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "procedure" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "status" ] ;
fhir:transform [ fhir:v "copy" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "completed" ]             ] )           ] )         ] [
fhir:name [ fhir:v "statusCode" ] ;
          ( fhir:source [
fhir:context [ fhir:v "proceduresrc" ] ;
fhir:element [ fhir:v "statusCode" ] ;
fhir:variable [ fhir:v "statusc" ] ;
fhir:condition [ fhir:v "(code = 'active')" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "procedure" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "status" ] ;
fhir:transform [ fhir:v "copy" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "in-progress" ]             ] )           ] )         ] [
fhir:name [ fhir:v "statusCode" ] ;
          ( fhir:source [
fhir:context [ fhir:v "proceduresrc" ] ;
fhir:element [ fhir:v "statusCode" ] ;
fhir:variable [ fhir:v "statusc" ] ;
fhir:condition [ fhir:v "(code = 'aborted')" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "procedure" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "status" ] ;
fhir:transform [ fhir:v "copy" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "stopped" ]             ] )           ] )         ] [
fhir:name [ fhir:v "statusCode" ] ;
          ( fhir:source [
fhir:context [ fhir:v "proceduresrc" ] ;
fhir:element [ fhir:v "statusCode" ] ;
fhir:variable [ fhir:v "statusc" ] ;
fhir:condition [ fhir:v "(code = 'suspended')" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "procedure" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "status" ] ;
fhir:transform [ fhir:v "copy" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "on-hold" ]             ] )           ] )         ] [
fhir:name [ fhir:v "statusCode" ] ;
          ( fhir:source [
fhir:context [ fhir:v "proceduresrc" ] ;
fhir:element [ fhir:v "statusCode" ] ;
fhir:variable [ fhir:v "statusc" ] ;
fhir:condition [ fhir:v "(code = 'cancelled')" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "procedure" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "status" ] ;
fhir:transform [ fhir:v "copy" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "not-done" ]             ] )           ] )         ] [
fhir:name [ fhir:v "statusCode" ] ;
          ( fhir:source [
fhir:context [ fhir:v "proceduresrc" ] ;
fhir:element [ fhir:v "statusCode" ] ;
fhir:variable [ fhir:v "statusc" ] ;
fhir:condition [ fhir:v "(code = 'held')" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "procedure" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "status" ] ;
fhir:transform [ fhir:v "copy" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "on-hold" ]             ] )           ] )         ] [
fhir:name [ fhir:v "statusCode" ] ;
          ( fhir:source [
fhir:context [ fhir:v "proceduresrc" ] ;
fhir:element [ fhir:v "statusCode" ] ;
fhir:variable [ fhir:v "statusc" ] ;
fhir:condition [ fhir:v "(code = 'new')" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "procedure" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "status" ] ;
fhir:transform [ fhir:v "copy" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "preparation" ]             ] )           ] )         ] [
fhir:name [ fhir:v "statusCode" ] ;
          ( fhir:source [
fhir:context [ fhir:v "proceduresrc" ] ;
fhir:element [ fhir:v "statusCode" ] ;
fhir:variable [ fhir:v "statusc" ] ;
fhir:condition [ fhir:v "(code = 'obsolete')" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "procedure" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "status" ] ;
fhir:transform [ fhir:v "copy" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "entered-in-error" ]             ] )           ] )         ] [
fhir:name [ fhir:v "statusCode" ] ;
          ( fhir:source [
fhir:context [ fhir:v "proceduresrc" ] ;
fhir:element [ fhir:v "statusCode" ] ;
fhir:variable [ fhir:v "statusc" ] ;
fhir:condition [ fhir:v "(code = 'nullified')" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "procedure" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "status" ] ;
fhir:transform [ fhir:v "copy" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "unknown" ]             ] )           ] )         ] [
fhir:name [ fhir:v "effectiveTime" ] ;
          ( fhir:source [
fhir:context [ fhir:v "proceduresrc" ] ;
fhir:element [ fhir:v "effectiveTime" ] ;
fhir:variable [ fhir:v "efft" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "procedure" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "performed" ] ;
fhir:variable [ fhir:v "period" ] ;
fhir:transform [ fhir:v "create" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "Period" ]             ] )           ] ) ;
          ( fhir:dependent [
fhir:name [ fhir:v "IVLTSPeriod" ] ;
            ( fhir:variable [ fhir:v "efft" ] [ fhir:v "period" ] )           ] )         ] [
fhir:name [ fhir:v "Observation" ] ;
          ( fhir:source [
fhir:context [ fhir:v "proceduresrc" ] ;
fhir:element [ fhir:v "entryRelationship" ] ;
fhir:variable [ fhir:v "entriRel" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "bundle" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "entry" ] ;
fhir:variable [ fhir:v "e1" ]           ] [
fhir:context [ fhir:v "e1" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "request" ] ;
fhir:variable [ fhir:v "request" ] ;
fhir:transform [ fhir:v "create" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "BackboneElement" ]             ] )           ] [
fhir:context [ fhir:v "request" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "method" ] ;
fhir:transform [ fhir:v "copy" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "POST" ]             ] )           ] [
fhir:context [ fhir:v "e1" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "resource" ] ;
fhir:variable [ fhir:v "observation" ] ;
fhir:transform [ fhir:v "create" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "Observation" ]             ] )           ] [
fhir:context [ fhir:v "observation" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "id" ] ;
fhir:variable [ fhir:v "uuid1" ] ;
fhir:transform [ fhir:v "uuid" ]           ] [
fhir:context [ fhir:v "e1" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "fullUrl" ] ;
fhir:transform [ fhir:v "append" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "https://example/Observation/" ]             ] [
fhir:value [ fhir:v "uuid1" ]             ] )           ] [
fhir:context [ fhir:v "request" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "url" ] ;
fhir:transform [ fhir:v "copy" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "Observation" ]             ] )           ] [
fhir:context [ fhir:v "procedure" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "reasonReference" ] ;
fhir:variable [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "create" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "Reference" ]             ] )           ] [
fhir:context [ fhir:v "reference" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "'https://example/Observation/' + %observation.id" ]             ] )           ] ) ;
          ( fhir:rule [
fhir:name [ fhir:v "reference" ] ;
            ( fhir:source [
fhir:context [ fhir:v "entriRel" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "observation" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "subject" ] ;
fhir:variable [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "create" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "Reference" ]               ] )             ] [
fhir:context [ fhir:v "reference" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "'https://example/Patient/' + %patient.id" ]               ] )             ] )           ] [
fhir:name [ fhir:v "reference" ] ;
            ( fhir:source [
fhir:context [ fhir:v "entriRel" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "observation" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "encounter" ] ;
fhir:variable [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "create" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "Reference" ]               ] )             ] [
fhir:context [ fhir:v "reference" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "'https://example/Encounter/' + %enc.id" ]               ] )             ] )           ] [
fhir:name [ fhir:v "ObservationValue" ] ;
            ( fhir:source [
fhir:context [ fhir:v "entriRel" ] ;
fhir:element [ fhir:v "observation" ] ;
fhir:variable [ fhir:v "obs" ]             ] ) ;
            ( fhir:rule [
fhir:name [ fhir:v "code" ] ;
              ( fhir:source [
fhir:context [ fhir:v "obs" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "vvv" ]               ] ) ;
              ( fhir:target [
fhir:context [ fhir:v "observation" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "vvv" ] ;
fhir:transform [ fhir:v "create" ]               ] )             ] [
fhir:name [ fhir:v "statuscode" ] ;
              ( fhir:source [
fhir:context [ fhir:v "obs" ] ;
fhir:condition [ fhir:v "observation.statusCode.exists().not()" ]               ] ) ;
              ( fhir:rule [
fhir:name [ fhir:v "status" ] ;
                ( fhir:source [
fhir:context [ fhir:v "obs" ]                 ] ) ;
                ( fhir:target [
fhir:context [ fhir:v "observation" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "status" ] ;
fhir:transform [ fhir:v "copy" ] ;
                  ( fhir:parameter [
fhir:value [ fhir:v "final" ]                   ] )                 ] )               ] )             ] )           ] )         ] )       ] )     ] )
  ] [
fhir:name [ fhir:v "ClinicalDocumentSectionAllergie" ] ;
fhir:typeMode [ fhir:v "none" ] ;
    ( fhir:input [
fhir:name [ fhir:v "cda" ] ;
fhir:type [ fhir:v "ClinicalDocument" ] ;
fhir:mode [ fhir:v "source" ]     ] [
fhir:name [ fhir:v "src" ] ;
fhir:type [ fhir:v "Section" ] ;
fhir:mode [ fhir:v "source" ]     ] [
fhir:name [ fhir:v "patient" ] ;
fhir:type [ fhir:v "Patient" ] ;
fhir:mode [ fhir:v "target" ]     ] [
fhir:name [ fhir:v "tgt" ] ;
fhir:mode [ fhir:v "target" ]     ] [
fhir:name [ fhir:v "bundle" ] ;
fhir:type [ fhir:v "Bundle" ] ;
fhir:mode [ fhir:v "target" ]     ] [
fhir:name [ fhir:v "enc" ] ;
fhir:type [ fhir:v "Encounter" ] ;
fhir:mode [ fhir:v "target" ]     ] ) ;
    ( fhir:rule [
fhir:name [ fhir:v "title" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "title" ] ;
fhir:variable [ fhir:v "t" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "title" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "t.dataString" ]         ] )       ] )     ] [
fhir:name [ fhir:v "code" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "vvv" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "vvv" ] ;
fhir:transform [ fhir:v "create" ]       ] )     ] [
fhir:name [ fhir:v "exists" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:condition [ fhir:v "src.entry.exists()" ]       ] ) ;
      ( fhir:rule [
fhir:name [ fhir:v "cdaText" ] ;
        ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "text" ] ;
fhir:variable [ fhir:v "cdaText" ]         ] ) ;
        ( fhir:target [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "text" ] ;
fhir:variable [ fhir:v "fhirText" ]         ] ) ;
        ( fhir:rule [
fhir:name [ fhir:v "narrativeStatus" ] ;
          ( fhir:source [
fhir:context [ fhir:v "cdaText" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "fhirText" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "status" ] ;
fhir:transform [ fhir:v "copy" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "generated" ]             ] )           ] )         ] [
fhir:name [ fhir:v "narrativeText" ] ;
          ( fhir:source [
fhir:context [ fhir:v "cdaText" ] ;
fhir:variable [ fhir:v "t" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "fhirText" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "div" ] ;
fhir:transform [ fhir:v "copy" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "t" ]             ] )           ] )         ] )       ] )     ] [
fhir:name [ fhir:v "where" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:condition [ fhir:v "src.entry.exists().not()" ]       ] ) ;
      ( fhir:rule [
fhir:name [ fhir:v "cdaText" ] ;
        ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "text" ] ;
fhir:variable [ fhir:v "cdaText" ]         ] ) ;
        ( fhir:target [
fhir:context [ fhir:v "bundle" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "entry" ] ;
fhir:variable [ fhir:v "e1" ]         ] [
fhir:context [ fhir:v "e1" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "request" ] ;
fhir:variable [ fhir:v "request" ] ;
fhir:transform [ fhir:v "create" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "BackboneElement" ]           ] )         ] [
fhir:context [ fhir:v "request" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "method" ] ;
fhir:transform [ fhir:v "copy" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "POST" ]           ] )         ] [
fhir:context [ fhir:v "e1" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "resource" ] ;
fhir:variable [ fhir:v "allergy" ] ;
fhir:transform [ fhir:v "create" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "AllergyIntolerance" ]           ] )         ] [
fhir:context [ fhir:v "allergy" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "id" ] ;
fhir:variable [ fhir:v "uuid1" ] ;
fhir:transform [ fhir:v "uuid" ]         ] [
fhir:context [ fhir:v "e1" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "fullUrl" ] ;
fhir:transform [ fhir:v "append" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "https://example/AllergyIntolerance/" ]           ] [
fhir:value [ fhir:v "uuid1" ]           ] )         ] [
fhir:context [ fhir:v "request" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "url" ] ;
fhir:transform [ fhir:v "copy" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "AllergyIntolerance" ]           ] )         ] [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "entry" ] ;
fhir:variable [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "create" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "Reference" ]           ] )         ] [
fhir:context [ fhir:v "reference" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "'https://example/AllergyIntolerance/' + %allergy.id" ]           ] )         ] ) ;
        ( fhir:rule [
fhir:name [ fhir:v "reference" ] ;
          ( fhir:source [
fhir:context [ fhir:v "src" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "allergy" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "patient" ] ;
fhir:variable [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "create" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "Reference" ]             ] )           ] [
fhir:context [ fhir:v "reference" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "'https://example/Patient/' + %patient.id" ]             ] )           ] )         ] [
fhir:name [ fhir:v "reference" ] ;
          ( fhir:source [
fhir:context [ fhir:v "src" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "allergy" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "encounter" ] ;
fhir:variable [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "create" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "Reference" ]             ] )           ] [
fhir:context [ fhir:v "reference" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "'https://example/Encounter/' + %enc.id" ]             ] )           ] )         ] [
fhir:name [ fhir:v "allergy" ] ;
          ( fhir:source [
fhir:context [ fhir:v "src" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "allergy" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "clinicalStatus" ] ;
fhir:variable [ fhir:v "status" ] ;
fhir:transform [ fhir:v "create" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "CodeableConcept" ]             ] )           ] ) ;
          ( fhir:rule [
fhir:name [ fhir:v "text" ] ;
            ( fhir:source [
fhir:context [ fhir:v "src" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "status" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "text" ] ;
fhir:transform [ fhir:v "copy" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "string" ]               ] )             ] )           ] [
fhir:name [ fhir:v "coding" ] ;
            ( fhir:source [
fhir:context [ fhir:v "src" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "status" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "coding" ] ;
fhir:variable [ fhir:v "coding" ] ;
fhir:transform [ fhir:v "create" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "Coding" ]               ] )             ] ) ;
            ( fhir:rule [
fhir:name [ fhir:v "active" ] ;
              ( fhir:source [
fhir:context [ fhir:v "src" ]               ] ) ;
              ( fhir:target [
fhir:context [ fhir:v "coding" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:transform [ fhir:v "copy" ] ;
                ( fhir:parameter [
fhir:value [ fhir:v "active" ]                 ] )               ] )             ] [
fhir:name [ fhir:v "system" ] ;
              ( fhir:source [
fhir:context [ fhir:v "src" ]               ] ) ;
              ( fhir:target [
fhir:context [ fhir:v "coding" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "system" ] ;
fhir:transform [ fhir:v "copy" ] ;
                ( fhir:parameter [
fhir:value [ fhir:v "http://terminology.hl7.org/CodeSystem/allergyintolerance-clinical" ]                 ] )               ] )             ] )           ] )         ] [
fhir:name [ fhir:v "code" ] ;
          ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "vvv" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "allergy" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "vvv" ] ;
fhir:transform [ fhir:v "create" ]           ] )         ] [
fhir:name [ fhir:v "reference" ] ;
          ( fhir:source [
fhir:context [ fhir:v "cdaText" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "allergy" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "note" ] ;
fhir:variable [ fhir:v "note" ]           ] ) ;
          ( fhir:rule [
fhir:name [ fhir:v "reference" ] ;
            ( fhir:source [
fhir:context [ fhir:v "cdaText" ] ;
fhir:variable [ fhir:v "t" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "note" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "text" ] ;
fhir:transform [ fhir:v "copy" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "t" ]               ] )             ] )           ] )         ] )       ] )     ] [
fhir:name [ fhir:v "allergy" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "entry" ] ;
fhir:variable [ fhir:v "entry1" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "bundle" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "entry" ] ;
fhir:variable [ fhir:v "e1" ]       ] [
fhir:context [ fhir:v "e1" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "request" ] ;
fhir:variable [ fhir:v "request" ] ;
fhir:transform [ fhir:v "create" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "BackboneElement" ]         ] )       ] [
fhir:context [ fhir:v "request" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "method" ] ;
fhir:transform [ fhir:v "copy" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "POST" ]         ] )       ] [
fhir:context [ fhir:v "e1" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "resource" ] ;
fhir:variable [ fhir:v "allergy" ] ;
fhir:transform [ fhir:v "create" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "AllergyIntolerance" ]         ] )       ] [
fhir:context [ fhir:v "allergy" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "id" ] ;
fhir:variable [ fhir:v "uuid1" ] ;
fhir:transform [ fhir:v "uuid" ]       ] [
fhir:context [ fhir:v "e1" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "fullUrl" ] ;
fhir:transform [ fhir:v "append" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "https://example/AllergyIntolerance/" ]         ] [
fhir:value [ fhir:v "uuid1" ]         ] )       ] [
fhir:context [ fhir:v "request" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "url" ] ;
fhir:transform [ fhir:v "copy" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "AllergyIntolerance" ]         ] )       ] [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "entry" ] ;
fhir:variable [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "create" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "Reference" ]         ] )       ] [
fhir:context [ fhir:v "reference" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "'https://example/AllergyIntolerance/' + %allergy.id" ]         ] )       ] ) ;
      ( fhir:rule [
fhir:name [ fhir:v "reference" ] ;
        ( fhir:source [
fhir:context [ fhir:v "src" ]         ] ) ;
        ( fhir:target [
fhir:context [ fhir:v "allergy" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "patient" ] ;
fhir:variable [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "create" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "Reference" ]           ] )         ] [
fhir:context [ fhir:v "reference" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "'https://example/Patient/' + %patient.id" ]           ] )         ] )       ] [
fhir:name [ fhir:v "reference" ] ;
        ( fhir:source [
fhir:context [ fhir:v "src" ]         ] ) ;
        ( fhir:target [
fhir:context [ fhir:v "allergy" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "encounter" ] ;
fhir:variable [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "create" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "Reference" ]           ] )         ] [
fhir:context [ fhir:v "reference" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "'https://example/Encounter/' + %enc.id" ]           ] )         ] )       ] [
fhir:name [ fhir:v "act" ] ;
        ( fhir:source [
fhir:context [ fhir:v "entry1" ] ;
fhir:element [ fhir:v "act" ] ;
fhir:variable [ fhir:v "actallint" ]         ] ) ;
        ( fhir:rule [
fhir:name [ fhir:v "effectiveTime" ] ;
          ( fhir:source [
fhir:context [ fhir:v "actallint" ] ;
fhir:element [ fhir:v "effectiveTime" ] ;
fhir:variable [ fhir:v "eff" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "allergy" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "onset" ] ;
fhir:variable [ fhir:v "per" ] ;
fhir:transform [ fhir:v "create" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "Period" ]             ] )           ] ) ;
          ( fhir:dependent [
fhir:name [ fhir:v "IVLTSPeriod" ] ;
            ( fhir:variable [ fhir:v "eff" ] [ fhir:v "per" ] )           ] )         ] [
fhir:name [ fhir:v "entryRelationship" ] ;
          ( fhir:source [
fhir:context [ fhir:v "actallint" ] ;
fhir:element [ fhir:v "entryRelationship" ] ;
fhir:variable [ fhir:v "entryact" ]           ] ) ;
          ( fhir:rule [
fhir:name [ fhir:v "partic" ] ;
            ( fhir:source [
fhir:context [ fhir:v "entryact" ] ;
fhir:element [ fhir:v "observation" ] ;
fhir:variable [ fhir:v "entryobs" ]             ] ) ;
            ( fhir:rule [
fhir:name [ fhir:v "code" ] ;
              ( fhir:source [
fhir:context [ fhir:v "entryobs" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:variable [ fhir:v "code" ]               ] ) ;
              ( fhir:rule [
fhir:name [ fhir:v "type" ] ;
                ( fhir:source [
fhir:context [ fhir:v "code" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "code1" ]                 ] ) ;
                ( fhir:target [
fhir:context [ fhir:v "allergy" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "type" ] ;
fhir:transform [ fhir:v "translate" ] ;
                  ( fhir:parameter [
fhir:value [ fhir:v "code1" ]                   ] [
fhir:value [ fhir:v "#AllergyTypeMap" ]                   ] [
fhir:value [ fhir:v "code" ]                   ] )                 ] )               ] [
fhir:name [ fhir:v "category" ] ;
                ( fhir:source [
fhir:context [ fhir:v "code" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "code2" ]                 ] ) ;
                ( fhir:target [
fhir:context [ fhir:v "allergy" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "category" ] ;
fhir:transform [ fhir:v "translate" ] ;
                  ( fhir:parameter [
fhir:value [ fhir:v "code2" ]                   ] [
fhir:value [ fhir:v "#AllergyCategoryMap" ]                   ] [
fhir:value [ fhir:v "code" ]                   ] )                 ] )               ] )             ] [
fhir:name [ fhir:v "PratRole" ] ;
              ( fhir:source [
fhir:context [ fhir:v "entryobs" ] ;
fhir:element [ fhir:v "participant" ] ;
fhir:variable [ fhir:v "partic" ]               ] ) ;
              ( fhir:rule [
fhir:name [ fhir:v "pratentit" ] ;
                ( fhir:source [
fhir:context [ fhir:v "partic" ] ;
fhir:element [ fhir:v "participantRole" ] ;
fhir:variable [ fhir:v "pratRole" ]                 ] ) ;
                ( fhir:rule [
fhir:name [ fhir:v "react" ] ;
                  ( fhir:source [
fhir:context [ fhir:v "pratRole" ] ;
fhir:element [ fhir:v "playingEntity" ] ;
fhir:variable [ fhir:v "pratent" ]                   ] ) ;
                  ( fhir:rule [
fhir:name [ fhir:v "cod" ] ;
                    ( fhir:source [
fhir:context [ fhir:v "pratent" ]                     ] ) ;
                    ( fhir:target [
fhir:context [ fhir:v "allergy" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "reaction" ] ;
fhir:variable [ fhir:v "reaction" ] ;
fhir:transform [ fhir:v "create" ] ;
                      ( fhir:parameter [
fhir:value [ fhir:v "BackboneElement" ]                       ] )                     ] ) ;
                    ( fhir:rule [
fhir:name [ fhir:v "subs" ] ;
                      ( fhir:source [
fhir:context [ fhir:v "pratent" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "vvv" ]                       ] ) ;
                      ( fhir:target [
fhir:context [ fhir:v "reaction" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "substance" ] ;
fhir:variable [ fhir:v "vvv" ] ;
fhir:transform [ fhir:v "create" ]                       ] )                     ] [
fhir:name [ fhir:v "entry" ] ;
                      ( fhir:source [
fhir:context [ fhir:v "entryobs" ] ;
fhir:element [ fhir:v "entryRelationship" ] ;
fhir:variable [ fhir:v "entryobs1" ] ;
fhir:condition [ fhir:v "(typeCode = 'MFST')" ]                       ] ) ;
                      ( fhir:rule [
fhir:name [ fhir:v "observ" ] ;
                        ( fhir:source [
fhir:context [ fhir:v "entryobs1" ] ;
fhir:element [ fhir:v "observation" ] ;
fhir:variable [ fhir:v "entobs" ]                         ] ) ;
                        ( fhir:rule [
fhir:name [ fhir:v "eff" ] ;
                          ( fhir:source [
fhir:context [ fhir:v "entobs" ] ;
fhir:element [ fhir:v "effectiveTime" ] ;
fhir:variable [ fhir:v "eff" ]                           ] ) ;
                          ( fhir:rule [
fhir:name [ fhir:v "val" ] ;
                            ( fhir:source [
fhir:context [ fhir:v "eff" ] ;
fhir:element [ fhir:v "low" ] ;
fhir:variable [ fhir:v "l" ]                             ] ) ;
                            ( fhir:target [
fhir:context [ fhir:v "reaction" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "onset" ] ;
fhir:variable [ fhir:v "start" ] ;
fhir:transform [ fhir:v "create" ] ;
                              ( fhir:parameter [
fhir:value [ fhir:v "dateTime" ]                               ] )                             ] ) ;
                            ( fhir:dependent [
fhir:name [ fhir:v "TSDateTime" ] ;
                              ( fhir:variable [ fhir:v "l" ] [ fhir:v "start" ] )                             ] )                           ] )                         ] [
fhir:name [ fhir:v "manifest" ] ;
                          ( fhir:source [
fhir:context [ fhir:v "entobs" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:variable [ fhir:v "vvv" ]                           ] ) ;
                          ( fhir:target [
fhir:context [ fhir:v "reaction" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "manifestation" ] ;
fhir:variable [ fhir:v "vvv" ] ;
fhir:transform [ fhir:v "create" ]                           ] )                         ] )                       ] )                     ] )                   ] )                 ] )               ] )             ] [
fhir:name [ fhir:v "observ" ] ;
              ( fhir:source [
fhir:context [ fhir:v "entryobs" ] ;
fhir:element [ fhir:v "entryRelationship" ] ;
fhir:variable [ fhir:v "entryobs2" ]               ] ) ;
              ( fhir:rule [
fhir:name [ fhir:v "severity" ] ;
                ( fhir:source [
fhir:context [ fhir:v "entryobs2" ] ;
fhir:element [ fhir:v "observation" ] ;
fhir:variable [ fhir:v "entobs" ]                 ] ) ;
                ( fhir:rule [
fhir:name [ fhir:v "sev" ] ;
                  ( fhir:source [
fhir:context [ fhir:v "entobs" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "code" ] ;
fhir:condition [ fhir:v "(code = 'SEV')" ]                   ] ) ;
                  ( fhir:rule [
fhir:name [ fhir:v "entobs" ] ;
                    ( fhir:source [
fhir:context [ fhir:v "entobs" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:variable [ fhir:v "value" ]                     ] ) ;
                    ( fhir:rule [
fhir:name [ fhir:v "active" ] ;
                      ( fhir:source [
fhir:context [ fhir:v "value" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:condition [ fhir:v "(value.code = 'M')" ]                       ] ) ;
                      ( fhir:target [
fhir:context [ fhir:v "allergy" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "criticality" ] ;
fhir:transform [ fhir:v "copy" ] ;
                        ( fhir:parameter [
fhir:value [ fhir:v "unable-to-assess" ]                         ] )                       ] )                     ] [
fhir:name [ fhir:v "active" ] ;
                      ( fhir:source [
fhir:context [ fhir:v "value" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:condition [ fhir:v "(value.code = 'L')" ]                       ] ) ;
                      ( fhir:target [
fhir:context [ fhir:v "allergy" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "criticality" ] ;
fhir:transform [ fhir:v "copy" ] ;
                        ( fhir:parameter [
fhir:value [ fhir:v "low" ]                         ] )                       ] )                     ] [
fhir:name [ fhir:v "active" ] ;
                      ( fhir:source [
fhir:context [ fhir:v "value" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:condition [ fhir:v "(value.code = 'H')" ]                       ] ) ;
                      ( fhir:target [
fhir:context [ fhir:v "allergy" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "criticality" ] ;
fhir:transform [ fhir:v "copy" ] ;
                        ( fhir:parameter [
fhir:value [ fhir:v "high" ]                         ] )                       ] )                     ] )                   ] )                 ] )               ] )             ] [
fhir:name [ fhir:v "entry3" ] ;
              ( fhir:source [
fhir:context [ fhir:v "entryobs" ] ;
fhir:element [ fhir:v "entryRelationship" ] ;
fhir:variable [ fhir:v "entryobs3" ]               ] ) ;
              ( fhir:rule [
fhir:name [ fhir:v "obobs3serv" ] ;
                ( fhir:source [
fhir:context [ fhir:v "entryobs3" ] ;
fhir:element [ fhir:v "observation" ] ;
fhir:variable [ fhir:v "entobs" ]                 ] ) ;
                ( fhir:rule [
fhir:name [ fhir:v "stat" ] ;
                  ( fhir:source [
fhir:context [ fhir:v "entobs" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "code" ] ;
fhir:condition [ fhir:v "(code = '33999-4')" ]                   ] ) ;
                  ( fhir:rule [
fhir:name [ fhir:v "clinicalStatus" ] ;
                    ( fhir:source [
fhir:context [ fhir:v "entobs" ]                     ] ) ;
                    ( fhir:target [
fhir:context [ fhir:v "allergy" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "clinicalStatus" ] ;
fhir:variable [ fhir:v "status" ] ;
fhir:transform [ fhir:v "create" ] ;
                      ( fhir:parameter [
fhir:value [ fhir:v "CodeableConcept" ]                       ] )                     ] ) ;
                    ( fhir:rule [
fhir:name [ fhir:v "coding" ] ;
                      ( fhir:source [
fhir:context [ fhir:v "entobs" ]                       ] ) ;
                      ( fhir:target [
fhir:context [ fhir:v "status" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "coding" ] ;
fhir:variable [ fhir:v "coding" ] ;
fhir:transform [ fhir:v "create" ] ;
                        ( fhir:parameter [
fhir:value [ fhir:v "Coding" ]                         ] )                       ] ) ;
                      ( fhir:rule [
fhir:name [ fhir:v "value1" ] ;
                        ( fhir:source [
fhir:context [ fhir:v "entobs" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:variable [ fhir:v "value" ]                         ] ) ;
                        ( fhir:rule [
fhir:name [ fhir:v "active" ] ;
                          ( fhir:source [
fhir:context [ fhir:v "value" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:condition [ fhir:v "(value.code = 'LA16666-2')" ]                           ] ) ;
                          ( fhir:target [
fhir:context [ fhir:v "coding" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:transform [ fhir:v "copy" ] ;
                            ( fhir:parameter [
fhir:value [ fhir:v "active" ]                             ] )                           ] )                         ] [
fhir:name [ fhir:v "active" ] ;
                          ( fhir:source [
fhir:context [ fhir:v "value" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:condition [ fhir:v "(value.code = 'LA18632-2')" ]                           ] ) ;
                          ( fhir:target [
fhir:context [ fhir:v "coding" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:transform [ fhir:v "copy" ] ;
                            ( fhir:parameter [
fhir:value [ fhir:v "inactive" ]                             ] )                           ] )                         ] [
fhir:name [ fhir:v "system" ] ;
                          ( fhir:source [
fhir:context [ fhir:v "value" ] ;
fhir:element [ fhir:v "codeSystem" ] ;
fhir:variable [ fhir:v "system" ]                           ] ) ;
                          ( fhir:target [
fhir:context [ fhir:v "coding" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "system" ] ;
fhir:transform [ fhir:v "copy" ] ;
                            ( fhir:parameter [
fhir:value [ fhir:v "http://terminology.hl7.org/CodeSystem/allergyintolerance-clinical" ]                             ] )                           ] )                         ] [
fhir:name [ fhir:v "displayName" ] ;
                          ( fhir:source [
fhir:context [ fhir:v "value" ] ;
fhir:element [ fhir:v "displayName" ] ;
fhir:variable [ fhir:v "display" ]                           ] ) ;
                          ( fhir:target [
fhir:context [ fhir:v "coding" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "display" ] ;
fhir:transform [ fhir:v "cast" ] ;
                            ( fhir:parameter [
fhir:value [ fhir:v "display" ]                             ] [
fhir:value [ fhir:v "string" ]                             ] )                           ] )                         ] )                       ] )                     ] )                   ] )                 ] )               ] )             ] [
fhir:name [ fhir:v "entry4" ] ;
              ( fhir:source [
fhir:context [ fhir:v "entryobs" ] ;
fhir:element [ fhir:v "entryRelationship" ] ;
fhir:variable [ fhir:v "entryobs4" ]               ] ) ;
              ( fhir:rule [
fhir:name [ fhir:v "obobs4serv" ] ;
                ( fhir:source [
fhir:context [ fhir:v "entryobs4" ] ;
fhir:element [ fhir:v "act" ] ;
fhir:variable [ fhir:v "entact" ]                 ] ) ;
                ( fhir:rule [
fhir:name [ fhir:v "txtact" ] ;
                  ( fhir:source [
fhir:context [ fhir:v "entact" ] ;
fhir:element [ fhir:v "text" ] ;
fhir:variable [ fhir:v "actext" ]                   ] ) ;
                  ( fhir:rule [
fhir:name [ fhir:v "notetxt" ] ;
                    ( fhir:source [
fhir:context [ fhir:v "actext" ] ;
fhir:element [ fhir:v "reference" ] ;
fhir:variable [ fhir:v "reftxt" ]                     ] ) ;
                    ( fhir:target [
fhir:context [ fhir:v "allergy" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "note" ] ;
fhir:variable [ fhir:v "note" ] ;
fhir:transform [ fhir:v "create" ] ;
                      ( fhir:parameter [
fhir:value [ fhir:v "BackboneElement" ]                       ] )                     ] ) ;
                    ( fhir:rule [
fhir:name [ fhir:v "notxt" ] ;
                      ( fhir:source [
fhir:context [ fhir:v "reftxt" ] ;
fhir:variable [ fhir:v "ref" ]                       ] ) ;
                      ( fhir:target [
fhir:context [ fhir:v "note" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "text" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
                        ( fhir:parameter [
fhir:value [ fhir:v "ref.value" ]                         ] )                       ] )                     ] )                   ] )                 ] )               ] )             ] )           ] )         ] )       ] )     ] )
  ] [
fhir:name [ fhir:v "ClinicalDocumentSectionDiagnosiDimissione" ] ;
fhir:typeMode [ fhir:v "none" ] ;
    ( fhir:input [
fhir:name [ fhir:v "cda" ] ;
fhir:type [ fhir:v "ClinicalDocument" ] ;
fhir:mode [ fhir:v "source" ]     ] [
fhir:name [ fhir:v "src" ] ;
fhir:type [ fhir:v "Section" ] ;
fhir:mode [ fhir:v "source" ]     ] [
fhir:name [ fhir:v "patient" ] ;
fhir:type [ fhir:v "Patient" ] ;
fhir:mode [ fhir:v "target" ]     ] [
fhir:name [ fhir:v "tgt" ] ;
fhir:mode [ fhir:v "target" ]     ] [
fhir:name [ fhir:v "bundle" ] ;
fhir:type [ fhir:v "Bundle" ] ;
fhir:mode [ fhir:v "target" ]     ] [
fhir:name [ fhir:v "enc" ] ;
fhir:type [ fhir:v "Encounter" ] ;
fhir:mode [ fhir:v "target" ]     ] ) ;
    ( fhir:rule [
fhir:name [ fhir:v "title" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "title" ] ;
fhir:variable [ fhir:v "t" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "title" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "t.dataString" ]         ] )       ] )     ] [
fhir:name [ fhir:v "code" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "vvv" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "vvv" ] ;
fhir:transform [ fhir:v "create" ]       ] )     ] [
fhir:name [ fhir:v "exists" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:condition [ fhir:v "src.entry.exists()" ]       ] ) ;
      ( fhir:rule [
fhir:name [ fhir:v "cdaText" ] ;
        ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "text" ] ;
fhir:variable [ fhir:v "cdaText" ]         ] ) ;
        ( fhir:target [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "text" ] ;
fhir:variable [ fhir:v "fhirText" ]         ] ) ;
        ( fhir:rule [
fhir:name [ fhir:v "narrativeStatus" ] ;
          ( fhir:source [
fhir:context [ fhir:v "cdaText" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "fhirText" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "status" ] ;
fhir:transform [ fhir:v "copy" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "generated" ]             ] )           ] )         ] [
fhir:name [ fhir:v "narrativeText" ] ;
          ( fhir:source [
fhir:context [ fhir:v "cdaText" ] ;
fhir:variable [ fhir:v "t" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "fhirText" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "div" ] ;
fhir:transform [ fhir:v "copy" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "t" ]             ] )           ] )         ] )       ] )     ] [
fhir:name [ fhir:v "where" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:condition [ fhir:v "src.entry.exists().not()" ]       ] ) ;
      ( fhir:rule [
fhir:name [ fhir:v "cdaText" ] ;
        ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "text" ] ;
fhir:variable [ fhir:v "cdaText" ]         ] ) ;
        ( fhir:target [
fhir:context [ fhir:v "bundle" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "entry" ] ;
fhir:variable [ fhir:v "e1" ]         ] [
fhir:context [ fhir:v "e1" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "request" ] ;
fhir:variable [ fhir:v "request" ] ;
fhir:transform [ fhir:v "create" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "BackboneElement" ]           ] )         ] [
fhir:context [ fhir:v "request" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "method" ] ;
fhir:transform [ fhir:v "copy" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "POST" ]           ] )         ] [
fhir:context [ fhir:v "e1" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "resource" ] ;
fhir:variable [ fhir:v "observation" ] ;
fhir:transform [ fhir:v "create" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "Observation" ]           ] )         ] [
fhir:context [ fhir:v "observation" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "id" ] ;
fhir:variable [ fhir:v "uuid1" ] ;
fhir:transform [ fhir:v "uuid" ]         ] [
fhir:context [ fhir:v "e1" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "fullUrl" ] ;
fhir:transform [ fhir:v "append" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "https://example/Observation/" ]           ] [
fhir:value [ fhir:v "uuid1" ]           ] )         ] [
fhir:context [ fhir:v "request" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "url" ] ;
fhir:transform [ fhir:v "copy" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "Observation" ]           ] )         ] [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "entry" ] ;
fhir:variable [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "create" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "Reference" ]           ] )         ] [
fhir:context [ fhir:v "reference" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "'https://example/Observation/' + %observation.id" ]           ] )         ] ) ;
        ( fhir:rule [
fhir:name [ fhir:v "reference" ] ;
          ( fhir:source [
fhir:context [ fhir:v "src" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "observation" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "subject" ] ;
fhir:variable [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "create" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "Reference" ]             ] )           ] [
fhir:context [ fhir:v "reference" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "'https://example/Patient/' + %patient.id" ]             ] )           ] )         ] [
fhir:name [ fhir:v "reference" ] ;
          ( fhir:source [
fhir:context [ fhir:v "src" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "observation" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "encounter" ] ;
fhir:variable [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "create" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "Reference" ]             ] )           ] [
fhir:context [ fhir:v "reference" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "'https://example/Encounter/' + %enc.id" ]             ] )           ] )         ] [
fhir:name [ fhir:v "code" ] ;
          ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "vvv" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "observation" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "vvv" ] ;
fhir:transform [ fhir:v "create" ]           ] )         ] [
fhir:name [ fhir:v "statuscode" ] ;
          ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:condition [ fhir:v "observation.statusCode.exists().not()" ]           ] ) ;
          ( fhir:rule [
fhir:name [ fhir:v "status" ] ;
            ( fhir:source [
fhir:context [ fhir:v "src" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "observation" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "status" ] ;
fhir:transform [ fhir:v "copy" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "final" ]               ] )             ] )           ] )         ] [
fhir:name [ fhir:v "reference" ] ;
          ( fhir:source [
fhir:context [ fhir:v "cdaText" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "observation" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "note" ] ;
fhir:variable [ fhir:v "note" ]           ] ) ;
          ( fhir:rule [
fhir:name [ fhir:v "reference" ] ;
            ( fhir:source [
fhir:context [ fhir:v "cdaText" ] ;
fhir:variable [ fhir:v "t" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "note" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "text" ] ;
fhir:transform [ fhir:v "copy" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "t" ]               ] )             ] )           ] )         ] )       ] )     ] [
fhir:name [ fhir:v "entry" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "entry" ] ;
fhir:variable [ fhir:v "entry1" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "bundle" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "entry" ] ;
fhir:variable [ fhir:v "e1" ]       ] [
fhir:context [ fhir:v "e1" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "request" ] ;
fhir:variable [ fhir:v "request" ] ;
fhir:transform [ fhir:v "create" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "BackboneElement" ]         ] )       ] [
fhir:context [ fhir:v "request" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "method" ] ;
fhir:transform [ fhir:v "copy" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "POST" ]         ] )       ] [
fhir:context [ fhir:v "e1" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "resource" ] ;
fhir:variable [ fhir:v "observation" ] ;
fhir:transform [ fhir:v "create" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "Observation" ]         ] )       ] [
fhir:context [ fhir:v "observation" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "id" ] ;
fhir:variable [ fhir:v "uuid1" ] ;
fhir:transform [ fhir:v "uuid" ]       ] [
fhir:context [ fhir:v "e1" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "fullUrl" ] ;
fhir:transform [ fhir:v "append" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "https://example/Observation/" ]         ] [
fhir:value [ fhir:v "uuid1" ]         ] )       ] [
fhir:context [ fhir:v "request" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "url" ] ;
fhir:transform [ fhir:v "copy" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "Observation" ]         ] )       ] [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "entry" ] ;
fhir:variable [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "create" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "Reference" ]         ] )       ] [
fhir:context [ fhir:v "reference" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "'https://example/Observation/' + %observation.id" ]         ] )       ] ) ;
      ( fhir:rule [
fhir:name [ fhir:v "act" ] ;
        ( fhir:source [
fhir:context [ fhir:v "entry1" ] ;
fhir:element [ fhir:v "observation" ] ;
fhir:variable [ fhir:v "obs" ]         ] ) ;
        ( fhir:dependent [
fhir:name [ fhir:v "Observation" ] ;
          ( fhir:variable [ fhir:v "obs" ] [ fhir:v "patient" ] [ fhir:v "enc" ] [ fhir:v "observation" ] [ fhir:v "bundle" ] )         ] )       ] )     ] )
  ] [
fhir:name [ fhir:v "ClinicalDocumentSectionIstruzioniFollowUp" ] ;
fhir:typeMode [ fhir:v "none" ] ;
    ( fhir:input [
fhir:name [ fhir:v "cda" ] ;
fhir:type [ fhir:v "ClinicalDocument" ] ;
fhir:mode [ fhir:v "source" ]     ] [
fhir:name [ fhir:v "src" ] ;
fhir:type [ fhir:v "Section" ] ;
fhir:mode [ fhir:v "source" ]     ] [
fhir:name [ fhir:v "patient" ] ;
fhir:type [ fhir:v "Patient" ] ;
fhir:mode [ fhir:v "target" ]     ] [
fhir:name [ fhir:v "tgt" ] ;
fhir:mode [ fhir:v "target" ]     ] [
fhir:name [ fhir:v "bundle" ] ;
fhir:type [ fhir:v "Bundle" ] ;
fhir:mode [ fhir:v "target" ]     ] [
fhir:name [ fhir:v "enc" ] ;
fhir:type [ fhir:v "Encounter" ] ;
fhir:mode [ fhir:v "target" ]     ] ) ;
    ( fhir:rule [
fhir:name [ fhir:v "title" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "title" ] ;
fhir:variable [ fhir:v "t" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "title" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "t.dataString" ]         ] )       ] )     ] [
fhir:name [ fhir:v "code" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "vvv" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "vvv" ] ;
fhir:transform [ fhir:v "create" ]       ] )     ] [
fhir:name [ fhir:v "cdaText" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "text" ] ;
fhir:variable [ fhir:v "cdaText" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "text" ] ;
fhir:variable [ fhir:v "fhirText" ]       ] ) ;
      ( fhir:rule [
fhir:name [ fhir:v "narrativeStatus" ] ;
        ( fhir:source [
fhir:context [ fhir:v "cdaText" ]         ] ) ;
        ( fhir:target [
fhir:context [ fhir:v "fhirText" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "status" ] ;
fhir:transform [ fhir:v "copy" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "generated" ]           ] )         ] )       ] [
fhir:name [ fhir:v "narrativeText" ] ;
        ( fhir:source [
fhir:context [ fhir:v "cdaText" ] ;
fhir:variable [ fhir:v "t" ]         ] ) ;
        ( fhir:target [
fhir:context [ fhir:v "fhirText" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "div" ] ;
fhir:transform [ fhir:v "copy" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "t" ]           ] )         ] )       ] )     ] [
fhir:name [ fhir:v "entry" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "text" ] ;
fhir:variable [ fhir:v "cdaText" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "bundle" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "entry" ] ;
fhir:variable [ fhir:v "e1" ]       ] [
fhir:context [ fhir:v "e1" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "request" ] ;
fhir:variable [ fhir:v "request" ] ;
fhir:transform [ fhir:v "create" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "BackboneElement" ]         ] )       ] [
fhir:context [ fhir:v "request" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "method" ] ;
fhir:transform [ fhir:v "copy" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "POST" ]         ] )       ] [
fhir:context [ fhir:v "e1" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "resource" ] ;
fhir:variable [ fhir:v "carePlan" ] ;
fhir:transform [ fhir:v "create" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "CarePlan" ]         ] )       ] [
fhir:context [ fhir:v "carePlan" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "id" ] ;
fhir:variable [ fhir:v "uuid1" ] ;
fhir:transform [ fhir:v "uuid" ]       ] [
fhir:context [ fhir:v "e1" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "fullUrl" ] ;
fhir:transform [ fhir:v "append" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "https://example/CarePlan/" ]         ] [
fhir:value [ fhir:v "uuid1" ]         ] )       ] [
fhir:context [ fhir:v "request" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "url" ] ;
fhir:transform [ fhir:v "copy" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "CarePlan" ]         ] )       ] [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "entry" ] ;
fhir:variable [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "create" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "Reference" ]         ] )       ] [
fhir:context [ fhir:v "reference" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "'https://example/CarePlan/' + %carePlan.id" ]         ] )       ] ) ;
      ( fhir:rule [
fhir:name [ fhir:v "reference" ] ;
        ( fhir:source [
fhir:context [ fhir:v "cdaText" ]         ] ) ;
        ( fhir:target [
fhir:context [ fhir:v "carePlan" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "note" ] ;
fhir:variable [ fhir:v "note" ]         ] ) ;
        ( fhir:rule [
fhir:name [ fhir:v "reference" ] ;
          ( fhir:source [
fhir:context [ fhir:v "cdaText" ] ;
fhir:variable [ fhir:v "t" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "note" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "text" ] ;
fhir:transform [ fhir:v "copy" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "t" ]             ] )           ] )         ] )       ] [
fhir:name [ fhir:v "reference" ] ;
        ( fhir:source [
fhir:context [ fhir:v "src" ]         ] ) ;
        ( fhir:target [
fhir:context [ fhir:v "carePlan" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "subject" ] ;
fhir:variable [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "create" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "Reference" ]           ] )         ] [
fhir:context [ fhir:v "reference" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "'https://example/Patient/' + %patient.id" ]           ] )         ] )       ] [
fhir:name [ fhir:v "reference" ] ;
        ( fhir:source [
fhir:context [ fhir:v "src" ]         ] ) ;
        ( fhir:target [
fhir:context [ fhir:v "carePlan" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "encounter" ] ;
fhir:variable [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "create" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "Reference" ]           ] )         ] [
fhir:context [ fhir:v "reference" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "'https://example/Encounter/' + %enc.id" ]           ] )         ] )       ] [
fhir:name [ fhir:v "status" ] ;
        ( fhir:source [
fhir:context [ fhir:v "src" ]         ] ) ;
        ( fhir:target [
fhir:context [ fhir:v "carePlan" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "status" ] ;
fhir:transform [ fhir:v "copy" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "active" ]           ] )         ] )       ] [
fhir:name [ fhir:v "intent" ] ;
        ( fhir:source [
fhir:context [ fhir:v "src" ]         ] ) ;
        ( fhir:target [
fhir:context [ fhir:v "carePlan" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "intent" ] ;
fhir:transform [ fhir:v "copy" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "order" ]           ] )         ] )       ] )     ] )
  ] [
fhir:name [ fhir:v "ClinicalDocumentSectionTerapiaFarmacologicaDuranteRicovero" ] ;
fhir:typeMode [ fhir:v "none" ] ;
    ( fhir:input [
fhir:name [ fhir:v "cda" ] ;
fhir:type [ fhir:v "ClinicalDocument" ] ;
fhir:mode [ fhir:v "source" ]     ] [
fhir:name [ fhir:v "src" ] ;
fhir:type [ fhir:v "Section" ] ;
fhir:mode [ fhir:v "source" ]     ] [
fhir:name [ fhir:v "patient" ] ;
fhir:type [ fhir:v "Patient" ] ;
fhir:mode [ fhir:v "target" ]     ] [
fhir:name [ fhir:v "tgt" ] ;
fhir:mode [ fhir:v "target" ]     ] [
fhir:name [ fhir:v "bundle" ] ;
fhir:type [ fhir:v "Bundle" ] ;
fhir:mode [ fhir:v "target" ]     ] [
fhir:name [ fhir:v "enc" ] ;
fhir:type [ fhir:v "Encounter" ] ;
fhir:mode [ fhir:v "target" ]     ] ) ;
    ( fhir:rule [
fhir:name [ fhir:v "title" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "title" ] ;
fhir:variable [ fhir:v "t" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "title" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "t.dataString" ]         ] )       ] )     ] [
fhir:name [ fhir:v "code" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "vvv" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "vvv" ] ;
fhir:transform [ fhir:v "create" ]       ] )     ] [
fhir:name [ fhir:v "exists" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:condition [ fhir:v "src.entry.exists()" ]       ] ) ;
      ( fhir:rule [
fhir:name [ fhir:v "cdaText" ] ;
        ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "text" ] ;
fhir:variable [ fhir:v "cdaText" ]         ] ) ;
        ( fhir:target [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "text" ] ;
fhir:variable [ fhir:v "fhirText" ]         ] ) ;
        ( fhir:rule [
fhir:name [ fhir:v "narrativeStatus" ] ;
          ( fhir:source [
fhir:context [ fhir:v "cdaText" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "fhirText" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "status" ] ;
fhir:transform [ fhir:v "copy" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "generated" ]             ] )           ] )         ] [
fhir:name [ fhir:v "narrativeText" ] ;
          ( fhir:source [
fhir:context [ fhir:v "cdaText" ] ;
fhir:variable [ fhir:v "t" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "fhirText" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "div" ] ;
fhir:transform [ fhir:v "copy" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "t" ]             ] )           ] )         ] )       ] )     ] [
fhir:name [ fhir:v "where" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:condition [ fhir:v "src.entry.exists().not()" ]       ] ) ;
      ( fhir:rule [
fhir:name [ fhir:v "cdaText" ] ;
        ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "text" ] ;
fhir:variable [ fhir:v "cdaText" ]         ] ) ;
        ( fhir:target [
fhir:context [ fhir:v "bundle" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "entry" ] ;
fhir:variable [ fhir:v "e1" ]         ] [
fhir:context [ fhir:v "e1" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "request" ] ;
fhir:variable [ fhir:v "request" ] ;
fhir:transform [ fhir:v "create" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "BackboneElement" ]           ] )         ] [
fhir:context [ fhir:v "request" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "method" ] ;
fhir:transform [ fhir:v "copy" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "POST" ]           ] )         ] [
fhir:context [ fhir:v "e1" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "resource" ] ;
fhir:variable [ fhir:v "medicationAdm" ] ;
fhir:transform [ fhir:v "create" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "MedicationAdministration" ]           ] )         ] [
fhir:context [ fhir:v "medicationAdm" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "id" ] ;
fhir:variable [ fhir:v "uuid1" ] ;
fhir:transform [ fhir:v "uuid" ]         ] [
fhir:context [ fhir:v "e1" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "fullUrl" ] ;
fhir:transform [ fhir:v "append" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "https://example/MedicationAdministration/" ]           ] [
fhir:value [ fhir:v "uuid1" ]           ] )         ] [
fhir:context [ fhir:v "request" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "url" ] ;
fhir:transform [ fhir:v "copy" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "MedicationAdministration" ]           ] )         ] [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "entry" ] ;
fhir:variable [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "create" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "Reference" ]           ] )         ] [
fhir:context [ fhir:v "reference" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "'https://example/MedicationAdministration/' + %medicationAdm.id" ]           ] )         ] ) ;
        ( fhir:rule [
fhir:name [ fhir:v "reference" ] ;
          ( fhir:source [
fhir:context [ fhir:v "cdaText" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "medicationAdm" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "subject" ] ;
fhir:variable [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "create" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "Reference" ]             ] )           ] [
fhir:context [ fhir:v "reference" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "'https://example/Patient/' + %patient.id" ]             ] )           ] )         ] [
fhir:name [ fhir:v "reference" ] ;
          ( fhir:source [
fhir:context [ fhir:v "cdaText" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "medicationAdm" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "context" ] ;
fhir:variable [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "create" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "Reference" ]             ] )           ] [
fhir:context [ fhir:v "reference" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "'https://example/Encounter/' + %enc.id" ]             ] )           ] )         ] [
fhir:name [ fhir:v "code" ] ;
          ( fhir:source [
fhir:context [ fhir:v "cdaText" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "medicationAdm" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "medication" ] ;
fhir:variable [ fhir:v "codecon" ] ;
fhir:transform [ fhir:v "create" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "CodeableConcept" ]             ] )           ] ) ;
          ( fhir:rule [
fhir:name [ fhir:v "text" ] ;
            ( fhir:source [
fhir:context [ fhir:v "cdaText" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "codecon" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "text" ] ;
fhir:transform [ fhir:v "copy" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "string" ]               ] )             ] )           ] )         ] [
fhir:name [ fhir:v "Period" ] ;
          ( fhir:source [
fhir:context [ fhir:v "src" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "medicationAdm" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "effective" ] ;
fhir:variable [ fhir:v "period" ] ;
fhir:transform [ fhir:v "create" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "Period" ]             ] )           ] ) ;
          ( fhir:rule [
fhir:name [ fhir:v "low" ] ;
            ( fhir:source [
fhir:context [ fhir:v "src" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "period" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "start" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "start.now()" ]               ] )             ] )           ] [
fhir:name [ fhir:v "high" ] ;
            ( fhir:source [
fhir:context [ fhir:v "src" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "period" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "end" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "end.now()" ]               ] )             ] )           ] )         ] [
fhir:name [ fhir:v "statuscode" ] ;
          ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:condition [ fhir:v "sub.statusCode.exists().not()" ]           ] ) ;
          ( fhir:rule [
fhir:name [ fhir:v "status" ] ;
            ( fhir:source [
fhir:context [ fhir:v "src" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "medicationAdm" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "status" ] ;
fhir:transform [ fhir:v "copy" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "completed" ]               ] )             ] )           ] )         ] [
fhir:name [ fhir:v "reference" ] ;
          ( fhir:source [
fhir:context [ fhir:v "cdaText" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "medicationAdm" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "note" ] ;
fhir:variable [ fhir:v "note" ]           ] ) ;
          ( fhir:rule [
fhir:name [ fhir:v "reference" ] ;
            ( fhir:source [
fhir:context [ fhir:v "cdaText" ] ;
fhir:variable [ fhir:v "t" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "note" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "text" ] ;
fhir:transform [ fhir:v "copy" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "t" ]               ] )             ] )           ] )         ] )       ] )     ] [
fhir:name [ fhir:v "sa" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "entry" ] ;
fhir:variable [ fhir:v "entry1" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "bundle" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "entry" ] ;
fhir:variable [ fhir:v "e1" ]       ] [
fhir:context [ fhir:v "e1" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "request" ] ;
fhir:variable [ fhir:v "request" ] ;
fhir:transform [ fhir:v "create" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "BackboneElement" ]         ] )       ] [
fhir:context [ fhir:v "request" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "method" ] ;
fhir:transform [ fhir:v "copy" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "POST" ]         ] )       ] [
fhir:context [ fhir:v "e1" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "resource" ] ;
fhir:variable [ fhir:v "medicationAdm" ] ;
fhir:transform [ fhir:v "create" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "MedicationAdministration" ]         ] )       ] [
fhir:context [ fhir:v "medicationAdm" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "id" ] ;
fhir:variable [ fhir:v "uuid1" ] ;
fhir:transform [ fhir:v "uuid" ]       ] [
fhir:context [ fhir:v "e1" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "fullUrl" ] ;
fhir:transform [ fhir:v "append" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "https://example/MedicationAdministration/" ]         ] [
fhir:value [ fhir:v "uuid1" ]         ] )       ] [
fhir:context [ fhir:v "request" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "url" ] ;
fhir:transform [ fhir:v "copy" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "MedicationAdministration" ]         ] )       ] [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "entry" ] ;
fhir:variable [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "create" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "Reference" ]         ] )       ] [
fhir:context [ fhir:v "reference" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "'https://example/MedicationAdministration/' + %medicationAdm.id" ]         ] )       ] ) ;
      ( fhir:rule [
fhir:name [ fhir:v "reference" ] ;
        ( fhir:source [
fhir:context [ fhir:v "entry1" ]         ] ) ;
        ( fhir:target [
fhir:context [ fhir:v "medicationAdm" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "subject" ] ;
fhir:variable [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "create" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "Reference" ]           ] )         ] [
fhir:context [ fhir:v "reference" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "'https://example/Patient/' + %patient.id" ]           ] )         ] )       ] [
fhir:name [ fhir:v "reference" ] ;
        ( fhir:source [
fhir:context [ fhir:v "entry1" ]         ] ) ;
        ( fhir:target [
fhir:context [ fhir:v "medicationAdm" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "context" ] ;
fhir:variable [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "create" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "Reference" ]           ] )         ] [
fhir:context [ fhir:v "reference" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "'https://example/Encounter/' + %enc.id" ]           ] )         ] )       ] [
fhir:name [ fhir:v "entry" ] ;
        ( fhir:source [
fhir:context [ fhir:v "entry1" ] ;
fhir:element [ fhir:v "substanceAdministration" ] ;
fhir:variable [ fhir:v "sa" ]         ] ) ;
        ( fhir:rule [
fhir:name [ fhir:v "tx" ] ;
          ( fhir:source [
fhir:context [ fhir:v "sa" ] ;
fhir:element [ fhir:v "text" ] ;
fhir:variable [ fhir:v "tx" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "medicationAdm" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "note" ] ;
fhir:variable [ fhir:v "note" ]           ] ) ;
          ( fhir:rule [
fhir:name [ fhir:v "perf" ] ;
            ( fhir:source [
fhir:context [ fhir:v "sa" ] ;
fhir:element [ fhir:v "performer" ] ;
fhir:variable [ fhir:v "performer" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "bundle" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "entry" ] ;
fhir:variable [ fhir:v "e1" ]             ] [
fhir:context [ fhir:v "e1" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "request" ] ;
fhir:variable [ fhir:v "request" ] ;
fhir:transform [ fhir:v "create" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "BackboneElement" ]               ] )             ] [
fhir:context [ fhir:v "request" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "method" ] ;
fhir:transform [ fhir:v "copy" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "PUT" ]               ] )             ] [
fhir:context [ fhir:v "e1" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "resource" ] ;
fhir:variable [ fhir:v "practitioner" ] ;
fhir:transform [ fhir:v "create" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "Practitioner" ]               ] )             ] ) ;
            ( fhir:rule [
fhir:name [ fhir:v "time" ] ;
              ( fhir:source [
fhir:context [ fhir:v "performer" ] ;
fhir:element [ fhir:v "time" ] ;
fhir:variable [ fhir:v "ti" ]               ] ) ;
              ( fhir:target [
fhir:context [ fhir:v "note" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "time" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
                ( fhir:parameter [
fhir:value [ fhir:v "ti.value" ]                 ] )               ] )             ] [
fhir:name [ fhir:v "assEntity" ] ;
              ( fhir:source [
fhir:context [ fhir:v "performer" ] ;
fhir:element [ fhir:v "assignedEntity" ] ;
fhir:variable [ fhir:v "assEnty" ]               ] ) ;
              ( fhir:rule [
fhir:name [ fhir:v "meta" ] ;
                ( fhir:source [
fhir:context [ fhir:v "assEnty" ]                 ] ) ;
                ( fhir:target [
fhir:context [ fhir:v "practitioner" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "meta" ] ;
fhir:variable [ fhir:v "meta" ]                 ] ) ;
                ( fhir:rule [
fhir:name [ fhir:v "coding" ] ;
                  ( fhir:source [
fhir:context [ fhir:v "assEnty" ]                   ] ) ;
                  ( fhir:target [
fhir:context [ fhir:v "meta" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "tag" ] ;
fhir:variable [ fhir:v "coding" ] ;
fhir:transform [ fhir:v "create" ] ;
                    ( fhir:parameter [
fhir:value [ fhir:v "Coding" ]                     ] )                   ] ) ;
                  ( fhir:rule [
fhir:name [ fhir:v "system" ] ;
                    ( fhir:source [
fhir:context [ fhir:v "assEnty" ]                     ] ) ;
                    ( fhir:target [
fhir:context [ fhir:v "coding" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "system" ] ;
fhir:transform [ fhir:v "copy" ] ;
                      ( fhir:parameter [
fhir:value [ fhir:v "http://algoritmodiscoring" ]                       ] )                     ] )                   ] [
fhir:name [ fhir:v "code" ] ;
                    ( fhir:source [
fhir:context [ fhir:v "assEnty" ]                     ] ) ;
                    ( fhir:target [
fhir:context [ fhir:v "coding" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:transform [ fhir:v "copy" ] ;
                      ( fhir:parameter [
fhir:value [ fhir:v "ClinicalDocument/body/TerapiaFarmacologicaRicovero/performer" ]                       ] )                     ] )                   ] )                 ] )               ] [
fhir:name [ fhir:v "identifier" ] ;
                ( fhir:source [
fhir:context [ fhir:v "assEnty" ] ;
fhir:element [ fhir:v "id" ] ;
fhir:variable [ fhir:v "id" ]                 ] ) ;
                ( fhir:target [
fhir:context [ fhir:v "practitioner" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "identifier" ] ;
fhir:variable [ fhir:v "identifier" ]                 ] ) ;
                ( fhir:rule [
fhir:name [ fhir:v "root1" ] ;
                  ( fhir:source [
fhir:context [ fhir:v "id" ] ;
fhir:element [ fhir:v "root" ] ;
fhir:variable [ fhir:v "r" ]                   ] ) ;
                  ( fhir:target [
fhir:context [ fhir:v "identifier" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "system" ] ;
fhir:transform [ fhir:v "translate" ] ;
                    ( fhir:parameter [
fhir:value [ fhir:v "r" ]                     ] [
fhir:value [ fhir:v "http://hl7.org/fhir/ConceptMap/special-oid2uri" ]                     ] [
fhir:value [ fhir:v "uri" ]                     ] )                   ] )                 ] [
fhir:name [ fhir:v "extension" ] ;
                  ( fhir:source [
fhir:context [ fhir:v "id" ] ;
fhir:element [ fhir:v "extension" ] ;
fhir:variable [ fhir:v "ext" ]                   ] ) ;
                  ( fhir:target [
fhir:context [ fhir:v "identifier" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:transform [ fhir:v "copy" ] ;
                    ( fhir:parameter [
fhir:value [ fhir:v "ext" ]                     ] )                   ] )                 ] [
fhir:name [ fhir:v "assigningAuthorityName" ] ;
                  ( fhir:source [
fhir:context [ fhir:v "id" ] ;
fhir:element [ fhir:v "assigningAuthorityName" ] ;
fhir:variable [ fhir:v "s" ]                   ] ) ;
                  ( fhir:target [
fhir:context [ fhir:v "identifier" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "assigner" ] ;
fhir:variable [ fhir:v "a" ]                   ] [
fhir:context [ fhir:v "a" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "display" ] ;
fhir:transform [ fhir:v "copy" ] ;
                    ( fhir:parameter [
fhir:value [ fhir:v "s" ]                     ] )                   ] )                 ] [
fhir:name [ fhir:v "r" ] ;
                  ( fhir:source [
fhir:context [ fhir:v "id" ] ;
fhir:element [ fhir:v "root" ] ;
fhir:variable [ fhir:v "r" ]                   ] ) ;
                  ( fhir:rule [
fhir:name [ fhir:v "aut" ] ;
                    ( fhir:source [
fhir:context [ fhir:v "id" ] ;
fhir:element [ fhir:v "extension" ] ;
fhir:variable [ fhir:v "ext" ]                     ] ) ;
                    ( fhir:target [
fhir:context [ fhir:v "practitioner" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "id" ] ;
fhir:variable [ fhir:v "uuid2" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
                      ( fhir:parameter [
fhir:value [ fhir:v "r + '-' + ext" ]                       ] )                     ] [
fhir:context [ fhir:v "e1" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "fullUrl" ] ;
fhir:transform [ fhir:v "append" ] ;
                      ( fhir:parameter [
fhir:value [ fhir:v "https://example/Practitioner/" ]                       ] [
fhir:value [ fhir:v "uuid2" ]                       ] )                     ] [
fhir:context [ fhir:v "request" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "url" ] ;
fhir:transform [ fhir:v "copy" ] ;
                      ( fhir:parameter [
fhir:value [ fhir:v "Practitioner" ]                       ] )                     ] [
fhir:context [ fhir:v "medicationAdm" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "performer" ] ;
fhir:variable [ fhir:v "perf" ]                     ] [
fhir:context [ fhir:v "perf" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "actor" ] ;
fhir:variable [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "create" ] ;
                      ( fhir:parameter [
fhir:value [ fhir:v "Reference" ]                       ] )                     ] [
fhir:context [ fhir:v "reference" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
                      ( fhir:parameter [
fhir:value [ fhir:v "'https://example/Practitioner/' + %practitioner.id" ]                       ] )                     ] )                   ] )                 ] )               ] [
fhir:name [ fhir:v "2.16.840.1.113883.2.9.4.3.2" ] ;
                ( fhir:source [
fhir:context [ fhir:v "assEnty" ] ;
fhir:element [ fhir:v "id" ] ;
fhir:variable [ fhir:v "id" ] ;
fhir:condition [ fhir:v "(root = '2.16.840.1.113883.2.9.4.3.2')" ]                 ] ) ;
                ( fhir:rule [
fhir:name [ fhir:v "UUID" ] ;
                  ( fhir:source [
fhir:context [ fhir:v "id" ] ;
fhir:element [ fhir:v "extension" ] ;
fhir:variable [ fhir:v "ext" ]                   ] ) ;
                  ( fhir:target [
fhir:context [ fhir:v "request" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "url" ] ;
fhir:transform [ fhir:v "append" ] ;
                    ( fhir:parameter [
fhir:value [ fhir:v "Practitioner?identifier=" ]                     ] [
fhir:value [ fhir:v "ext" ]                     ] )                   ] )                 ] )               ] [
fhir:name [ fhir:v "diverso" ] ;
                ( fhir:source [
fhir:context [ fhir:v "assEnty" ] ;
fhir:element [ fhir:v "id" ] ;
fhir:variable [ fhir:v "id" ] ;
fhir:condition [ fhir:v "(root != '2.16.840.1.113883.2.9.4.3.2')" ]                 ] ) ;
                ( fhir:rule [
fhir:name [ fhir:v "UUID" ] ;
                  ( fhir:source [
fhir:context [ fhir:v "id" ] ;
fhir:element [ fhir:v "extension" ] ;
fhir:variable [ fhir:v "ext" ]                   ] ) ;
                  ( fhir:target [
fhir:context [ fhir:v "request" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "url" ] ;
fhir:transform [ fhir:v "append" ] ;
                    ( fhir:parameter [
fhir:value [ fhir:v "Practitioner?identifier=" ]                     ] [
fhir:value [ fhir:v "ext" ]                     ] )                   ] )                 ] )               ] [
fhir:name [ fhir:v "assi" ] ;
                ( fhir:source [
fhir:context [ fhir:v "assEnty" ] ;
fhir:element [ fhir:v "assignedPerson" ] ;
fhir:variable [ fhir:v "assi" ]                 ] ) ;
                ( fhir:rule [
fhir:name [ fhir:v "name" ] ;
                  ( fhir:source [
fhir:context [ fhir:v "assi" ] ;
fhir:element [ fhir:v "name" ] ;
fhir:variable [ fhir:v "vvv" ]                   ] ) ;
                  ( fhir:target [
fhir:context [ fhir:v "practitioner" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "name" ] ;
fhir:variable [ fhir:v "vvv" ] ;
fhir:transform [ fhir:v "create" ]                   ] )                 ] )               ] )             ] )           ] [
fhir:name [ fhir:v "reference" ] ;
            ( fhir:source [
fhir:context [ fhir:v "tx" ] ;
fhir:element [ fhir:v "reference" ] ;
fhir:variable [ fhir:v "ref" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "note" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "text" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "ref.value" ]               ] )             ] )           ] )         ] [
fhir:name [ fhir:v "statusCode" ] ;
          ( fhir:source [
fhir:context [ fhir:v "sa" ] ;
fhir:element [ fhir:v "statusCode" ] ;
fhir:variable [ fhir:v "st" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "medicationAdm" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "status" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "st.code" ]             ] )           ] )         ] [
fhir:name [ fhir:v "period" ] ;
          ( fhir:source [
fhir:context [ fhir:v "sa" ] ;
fhir:element [ fhir:v "effectiveTime" ] ;
fhir:variable [ fhir:v "eff" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "medicationAdm" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "effective" ] ;
fhir:variable [ fhir:v "period" ] ;
fhir:transform [ fhir:v "create" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "Period" ]             ] )           ] ) ;
          ( fhir:dependent [
fhir:name [ fhir:v "IVLTSPeriod" ] ;
            ( fhir:variable [ fhir:v "eff" ] [ fhir:v "period" ] )           ] )         ] [
fhir:name [ fhir:v "dos" ] ;
          ( fhir:source [
fhir:context [ fhir:v "sa" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "medicationAdm" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "dosage" ] ;
fhir:variable [ fhir:v "dos" ]           ] ) ;
          ( fhir:rule [
fhir:name [ fhir:v "routeCode" ] ;
            ( fhir:source [
fhir:context [ fhir:v "sa" ] ;
fhir:element [ fhir:v "routeCode" ] ;
fhir:variable [ fhir:v "vvv" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "dos" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "route" ] ;
fhir:variable [ fhir:v "vvv" ] ;
fhir:transform [ fhir:v "create" ]             ] )           ] )         ] [
fhir:name [ fhir:v "dos" ] ;
          ( fhir:source [
fhir:context [ fhir:v "sa" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "medicationAdm" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "dosage" ] ;
fhir:variable [ fhir:v "dos" ]           ] ) ;
          ( fhir:rule [
fhir:name [ fhir:v "approachSiteCode" ] ;
            ( fhir:source [
fhir:context [ fhir:v "sa" ] ;
fhir:element [ fhir:v "approachSiteCode" ] ;
fhir:variable [ fhir:v "vvv" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "dos" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "site" ] ;
fhir:variable [ fhir:v "vvv" ] ;
fhir:transform [ fhir:v "create" ]             ] )           ] )         ] [
fhir:name [ fhir:v "sa" ] ;
          ( fhir:source [
fhir:context [ fhir:v "sa" ] ;
fhir:element [ fhir:v "doseQuantity" ] ;
fhir:variable [ fhir:v "doseQuant" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "bundle" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "entry" ] ;
fhir:variable [ fhir:v "e1" ]           ] [
fhir:context [ fhir:v "e1" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "request" ] ;
fhir:variable [ fhir:v "request" ] ;
fhir:transform [ fhir:v "create" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "BackboneElement" ]             ] )           ] [
fhir:context [ fhir:v "request" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "method" ] ;
fhir:transform [ fhir:v "copy" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "POST" ]             ] )           ] [
fhir:context [ fhir:v "e1" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "resource" ] ;
fhir:variable [ fhir:v "medicationRq" ] ;
fhir:transform [ fhir:v "create" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "MedicationRequest" ]             ] )           ] [
fhir:context [ fhir:v "medicationRq" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "id" ] ;
fhir:variable [ fhir:v "uuid1" ] ;
fhir:transform [ fhir:v "uuid" ]           ] [
fhir:context [ fhir:v "e1" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "fullUrl" ] ;
fhir:transform [ fhir:v "append" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "https://example/MedicationRequest/" ]             ] [
fhir:value [ fhir:v "uuid1" ]             ] )           ] [
fhir:context [ fhir:v "request" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "url" ] ;
fhir:transform [ fhir:v "copy" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "MedicationRequest" ]             ] )           ] [
fhir:context [ fhir:v "medicationAdm" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "request" ] ;
fhir:variable [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "create" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "Reference" ]             ] )           ] [
fhir:context [ fhir:v "reference" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "'https://example/MedicationRequest/' + %medicationRq.id" ]             ] )           ] ) ;
          ( fhir:rule [
fhir:name [ fhir:v "Dosage" ] ;
            ( fhir:source [
fhir:context [ fhir:v "doseQuant" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "medicationRq" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "dosageInstruction" ] ;
fhir:variable [ fhir:v "dosageInstruction" ] ;
fhir:transform [ fhir:v "create" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "Dosage" ]               ] )             ] ) ;
            ( fhir:rule [
fhir:name [ fhir:v "ot" ] ;
              ( fhir:source [
fhir:context [ fhir:v "doseQuant" ] ;
fhir:element [ fhir:v "originalText" ] ;
fhir:variable [ fhir:v "ot" ]               ] ) ;
              ( fhir:rule [
fhir:name [ fhir:v "reference" ] ;
                ( fhir:source [
fhir:context [ fhir:v "ot" ] ;
fhir:element [ fhir:v "reference" ] ;
fhir:variable [ fhir:v "vvv" ]                 ] ) ;
                ( fhir:target [
fhir:context [ fhir:v "dosageInstruction" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "text" ] ;
fhir:variable [ fhir:v "vvv" ] ;
fhir:transform [ fhir:v "create" ]                 ] )               ] )             ] [
fhir:name [ fhir:v "dosageRate" ] ;
              ( fhir:source [
fhir:context [ fhir:v "doseQuant" ]               ] ) ;
              ( fhir:target [
fhir:context [ fhir:v "dosageInstruction" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "doseAndRate" ] ;
fhir:variable [ fhir:v "dosageRate" ]               ] ) ;
              ( fhir:rule [
fhir:name [ fhir:v "d" ] ;
                ( fhir:source [
fhir:context [ fhir:v "doseQuant" ]                 ] ) ;
                ( fhir:target [
fhir:context [ fhir:v "dosageRate" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "dose" ] ;
fhir:variable [ fhir:v "d" ] ;
fhir:transform [ fhir:v "create" ] ;
                  ( fhir:parameter [
fhir:value [ fhir:v "Range" ]                   ] )                 ] ) ;
                ( fhir:rule [
fhir:name [ fhir:v "low" ] ;
                  ( fhir:source [
fhir:context [ fhir:v "doseQuant" ]                   ] ) ;
                  ( fhir:target [
fhir:context [ fhir:v "d" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "low" ] ;
fhir:variable [ fhir:v "l" ] ;
fhir:transform [ fhir:v "create" ] ;
                    ( fhir:parameter [
fhir:value [ fhir:v "SimpleQuantity" ]                     ] )                   ] ) ;
                  ( fhir:rule [
fhir:name [ fhir:v "low" ] ;
                    ( fhir:source [
fhir:context [ fhir:v "doseQuant" ] ;
fhir:element [ fhir:v "low" ] ;
fhir:variable [ fhir:v "lo" ]                     ] ) ;
                    ( fhir:target [
fhir:context [ fhir:v "l" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
                      ( fhir:parameter [
fhir:value [ fhir:v "lo.value" ]                       ] )                     ] )                   ] [
fhir:name [ fhir:v "low" ] ;
                    ( fhir:source [
fhir:context [ fhir:v "doseQuant" ] ;
fhir:element [ fhir:v "low" ] ;
fhir:variable [ fhir:v "lo" ]                     ] ) ;
                    ( fhir:target [
fhir:context [ fhir:v "l" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "unit" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
                      ( fhir:parameter [
fhir:value [ fhir:v "lo.unit" ]                       ] )                     ] )                   ] )                 ] [
fhir:name [ fhir:v "low" ] ;
                  ( fhir:source [
fhir:context [ fhir:v "doseQuant" ]                   ] ) ;
                  ( fhir:target [
fhir:context [ fhir:v "d" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "high" ] ;
fhir:variable [ fhir:v "h" ] ;
fhir:transform [ fhir:v "create" ] ;
                    ( fhir:parameter [
fhir:value [ fhir:v "SimpleQuantity" ]                     ] )                   ] ) ;
                  ( fhir:rule [
fhir:name [ fhir:v "high" ] ;
                    ( fhir:source [
fhir:context [ fhir:v "doseQuant" ] ;
fhir:element [ fhir:v "high" ] ;
fhir:variable [ fhir:v "hi" ]                     ] ) ;
                    ( fhir:target [
fhir:context [ fhir:v "h" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
                      ( fhir:parameter [
fhir:value [ fhir:v "hi.value" ]                       ] )                     ] )                   ] [
fhir:name [ fhir:v "high" ] ;
                    ( fhir:source [
fhir:context [ fhir:v "doseQuant" ] ;
fhir:element [ fhir:v "high" ] ;
fhir:variable [ fhir:v "hi" ]                     ] ) ;
                    ( fhir:target [
fhir:context [ fhir:v "h" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "unit" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
                      ( fhir:parameter [
fhir:value [ fhir:v "hi.unit" ]                       ] )                     ] )                   ] )                 ] )               ] )             ] )           ] [
fhir:name [ fhir:v "reference" ] ;
            ( fhir:source [
fhir:context [ fhir:v "sa" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "medicationRq" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "subject" ] ;
fhir:variable [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "create" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "Reference" ]               ] )             ] [
fhir:context [ fhir:v "reference" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "'https://example/Patient/' + %patient.id" ]               ] )             ] )           ] [
fhir:name [ fhir:v "reference" ] ;
            ( fhir:source [
fhir:context [ fhir:v "sa" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "medicationRq" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "encounter" ] ;
fhir:variable [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "create" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "Reference" ]               ] )             ] [
fhir:context [ fhir:v "reference" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "'https://example/Encounter/' + %enc.id" ]               ] )             ] )           ] [
fhir:name [ fhir:v "status" ] ;
            ( fhir:source [
fhir:context [ fhir:v "sa" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "medicationRq" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "status" ] ;
fhir:transform [ fhir:v "copy" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "active" ]               ] )             ] )           ] [
fhir:name [ fhir:v "intent" ] ;
            ( fhir:source [
fhir:context [ fhir:v "sa" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "medicationRq" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "intent" ] ;
fhir:transform [ fhir:v "copy" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "order" ]               ] )             ] )           ] [
fhir:name [ fhir:v "Dosage" ] ;
            ( fhir:source [
fhir:context [ fhir:v "sa" ] ;
fhir:element [ fhir:v "rateQuantity" ] ;
fhir:variable [ fhir:v "rateQuantity" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "medicationRq" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "dosageInstruction" ] ;
fhir:variable [ fhir:v "dosageInstruction1" ] ;
fhir:transform [ fhir:v "create" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "Dosage" ]               ] )             ] ) ;
            ( fhir:rule [
fhir:name [ fhir:v "ot" ] ;
              ( fhir:source [
fhir:context [ fhir:v "rateQuantity" ] ;
fhir:element [ fhir:v "originalText" ] ;
fhir:variable [ fhir:v "ot" ]               ] ) ;
              ( fhir:rule [
fhir:name [ fhir:v "reference" ] ;
                ( fhir:source [
fhir:context [ fhir:v "ot" ] ;
fhir:element [ fhir:v "reference" ] ;
fhir:variable [ fhir:v "vvv" ]                 ] ) ;
                ( fhir:target [
fhir:context [ fhir:v "dosageInstruction1" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "text" ] ;
fhir:variable [ fhir:v "vvv" ] ;
fhir:transform [ fhir:v "create" ]                 ] )               ] )             ] [
fhir:name [ fhir:v "dosageRate" ] ;
              ( fhir:source [
fhir:context [ fhir:v "rateQuantity" ]               ] ) ;
              ( fhir:target [
fhir:context [ fhir:v "dosageInstruction1" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "doseAndRate" ] ;
fhir:variable [ fhir:v "dosageRate" ]               ] ) ;
              ( fhir:rule [
fhir:name [ fhir:v "d" ] ;
                ( fhir:source [
fhir:context [ fhir:v "rateQuantity" ]                 ] ) ;
                ( fhir:target [
fhir:context [ fhir:v "dosageRate" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "rate" ] ;
fhir:variable [ fhir:v "d" ] ;
fhir:transform [ fhir:v "create" ] ;
                  ( fhir:parameter [
fhir:value [ fhir:v "Range" ]                   ] )                 ] ) ;
                ( fhir:rule [
fhir:name [ fhir:v "low" ] ;
                  ( fhir:source [
fhir:context [ fhir:v "rateQuantity" ]                   ] ) ;
                  ( fhir:target [
fhir:context [ fhir:v "d" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "low" ] ;
fhir:variable [ fhir:v "l" ] ;
fhir:transform [ fhir:v "create" ] ;
                    ( fhir:parameter [
fhir:value [ fhir:v "SimpleQuantity" ]                     ] )                   ] ) ;
                  ( fhir:rule [
fhir:name [ fhir:v "low" ] ;
                    ( fhir:source [
fhir:context [ fhir:v "rateQuantity" ] ;
fhir:element [ fhir:v "low" ] ;
fhir:variable [ fhir:v "lo" ]                     ] ) ;
                    ( fhir:target [
fhir:context [ fhir:v "l" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
                      ( fhir:parameter [
fhir:value [ fhir:v "lo.value" ]                       ] )                     ] )                   ] [
fhir:name [ fhir:v "low" ] ;
                    ( fhir:source [
fhir:context [ fhir:v "rateQuantity" ] ;
fhir:element [ fhir:v "low" ] ;
fhir:variable [ fhir:v "lo" ]                     ] ) ;
                    ( fhir:target [
fhir:context [ fhir:v "l" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "unit" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
                      ( fhir:parameter [
fhir:value [ fhir:v "lo.unit" ]                       ] )                     ] )                   ] )                 ] [
fhir:name [ fhir:v "low" ] ;
                  ( fhir:source [
fhir:context [ fhir:v "rateQuantity" ]                   ] ) ;
                  ( fhir:target [
fhir:context [ fhir:v "d" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "high" ] ;
fhir:variable [ fhir:v "h" ] ;
fhir:transform [ fhir:v "create" ] ;
                    ( fhir:parameter [
fhir:value [ fhir:v "SimpleQuantity" ]                     ] )                   ] ) ;
                  ( fhir:rule [
fhir:name [ fhir:v "high" ] ;
                    ( fhir:source [
fhir:context [ fhir:v "rateQuantity" ] ;
fhir:element [ fhir:v "high" ] ;
fhir:variable [ fhir:v "hi" ]                     ] ) ;
                    ( fhir:target [
fhir:context [ fhir:v "h" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
                      ( fhir:parameter [
fhir:value [ fhir:v "hi.value" ]                       ] )                     ] )                   ] [
fhir:name [ fhir:v "high" ] ;
                    ( fhir:source [
fhir:context [ fhir:v "rateQuantity" ] ;
fhir:element [ fhir:v "high" ] ;
fhir:variable [ fhir:v "hi" ]                     ] ) ;
                    ( fhir:target [
fhir:context [ fhir:v "h" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "unit" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
                      ( fhir:parameter [
fhir:value [ fhir:v "hi.unit" ]                       ] )                     ] )                   ] )                 ] )               ] )             ] )           ] [
fhir:name [ fhir:v "medication" ] ;
            ( fhir:source [
fhir:context [ fhir:v "sa" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "bundle" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "entry" ] ;
fhir:variable [ fhir:v "e1" ]             ] [
fhir:context [ fhir:v "e1" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "request" ] ;
fhir:variable [ fhir:v "request" ] ;
fhir:transform [ fhir:v "create" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "BackboneElement" ]               ] )             ] [
fhir:context [ fhir:v "request" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "method" ] ;
fhir:transform [ fhir:v "copy" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "POST" ]               ] )             ] [
fhir:context [ fhir:v "e1" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "resource" ] ;
fhir:variable [ fhir:v "medication" ] ;
fhir:transform [ fhir:v "create" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "Medication" ]               ] )             ] [
fhir:context [ fhir:v "medication" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "id" ] ;
fhir:variable [ fhir:v "uuid1" ] ;
fhir:transform [ fhir:v "uuid" ]             ] [
fhir:context [ fhir:v "e1" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "fullUrl" ] ;
fhir:transform [ fhir:v "append" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "https://example/Medication/" ]               ] [
fhir:value [ fhir:v "uuid1" ]               ] )             ] [
fhir:context [ fhir:v "request" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "url" ] ;
fhir:transform [ fhir:v "copy" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "Medication" ]               ] )             ] [
fhir:context [ fhir:v "medicationAdm" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "medication" ] ;
fhir:variable [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "create" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "Reference" ]               ] )             ] [
fhir:context [ fhir:v "reference" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "'https://example/Medication/' + %medication.id" ]               ] )             ] ) ;
            ( fhir:rule [
fhir:name [ fhir:v "reference" ] ;
              ( fhir:source [
fhir:context [ fhir:v "sa" ]               ] ) ;
              ( fhir:target [
fhir:context [ fhir:v "medicationRq" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "medication" ] ;
fhir:variable [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "create" ] ;
                ( fhir:parameter [
fhir:value [ fhir:v "Reference" ]                 ] )               ] [
fhir:context [ fhir:v "reference" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
                ( fhir:parameter [
fhir:value [ fhir:v "'https://example/Medication/' + %medication.id" ]                 ] )               ] )             ] [
fhir:name [ fhir:v "administrationUnitCode" ] ;
              ( fhir:source [
fhir:context [ fhir:v "sa" ] ;
fhir:element [ fhir:v "administrationUnitCode" ] ;
fhir:variable [ fhir:v "vvv" ]               ] ) ;
              ( fhir:target [
fhir:context [ fhir:v "medication" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "form" ] ;
fhir:variable [ fhir:v "vvv" ] ;
fhir:transform [ fhir:v "create" ]               ] )             ] [
fhir:name [ fhir:v "consumable" ] ;
              ( fhir:source [
fhir:context [ fhir:v "sa" ] ;
fhir:element [ fhir:v "consumable" ] ;
fhir:variable [ fhir:v "consumable" ]               ] ) ;
              ( fhir:rule [
fhir:name [ fhir:v "manufac" ] ;
                ( fhir:source [
fhir:context [ fhir:v "consumable" ] ;
fhir:element [ fhir:v "manufacturedProduct" ] ;
fhir:variable [ fhir:v "manufac" ]                 ] ) ;
                ( fhir:rule [
fhir:name [ fhir:v "manufactproduct" ] ;
                  ( fhir:source [
fhir:context [ fhir:v "manufac" ] ;
fhir:element [ fhir:v "manufacturedMaterial" ] ;
fhir:variable [ fhir:v "manuprod" ]                   ] ) ;
                  ( fhir:rule [
fhir:name [ fhir:v "code" ] ;
                    ( fhir:source [
fhir:context [ fhir:v "manuprod" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "vvv" ]                     ] ) ;
                    ( fhir:target [
fhir:context [ fhir:v "medication" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "vvv" ] ;
fhir:transform [ fhir:v "create" ]                     ] )                   ] )                 ] )               ] )             ] [
fhir:name [ fhir:v "entryRr" ] ;
              ( fhir:source [
fhir:context [ fhir:v "sa" ] ;
fhir:element [ fhir:v "entryRelationship" ] ;
fhir:variable [ fhir:v "entryRR" ]               ] ) ;
              ( fhir:rule [
fhir:name [ fhir:v "obs" ] ;
                ( fhir:source [
fhir:context [ fhir:v "entryRR" ] ;
fhir:element [ fhir:v "observation" ] ;
fhir:variable [ fhir:v "observation" ]                 ] ) ;
                ( fhir:rule [
fhir:name [ fhir:v "ingredient" ] ;
                  ( fhir:source [
fhir:context [ fhir:v "observation" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:condition [ fhir:v "displayName = 'Grammatura'" ]                   ] ) ;
                  ( fhir:target [
fhir:context [ fhir:v "medication" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "ingredient" ] ;
fhir:variable [ fhir:v "ingredient" ]                   ] ) ;
                  ( fhir:rule [
fhir:name [ fhir:v "consumable" ] ;
                    ( fhir:source [
fhir:context [ fhir:v "sa" ] ;
fhir:element [ fhir:v "consumable" ] ;
fhir:variable [ fhir:v "consumable" ]                     ] ) ;
                    ( fhir:rule [
fhir:name [ fhir:v "product" ] ;
                      ( fhir:source [
fhir:context [ fhir:v "consumable" ] ;
fhir:element [ fhir:v "manufacturedProduct" ] ;
fhir:variable [ fhir:v "manufacturedProduct" ]                       ] ) ;
                      ( fhir:rule [
fhir:name [ fhir:v "material" ] ;
                        ( fhir:source [
fhir:context [ fhir:v "manufacturedProduct" ] ;
fhir:element [ fhir:v "manufacturedMaterial" ] ;
fhir:variable [ fhir:v "manufacturedMaterial" ]                         ] ) ;
                        ( fhir:rule [
fhir:name [ fhir:v "CE" ] ;
                          ( fhir:source [
fhir:context [ fhir:v "manufacturedMaterial" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "code" ]                           ] ) ;
                          ( fhir:target [
fhir:context [ fhir:v "ingredient" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "item" ] ;
fhir:variable [ fhir:v "value" ] ;
fhir:transform [ fhir:v "create" ] ;
                            ( fhir:parameter [
fhir:value [ fhir:v "CodeableConcept" ]                             ] )                           ] ) ;
                          ( fhir:dependent [
fhir:name [ fhir:v "CECodeableConcept" ] ;
                            ( fhir:variable [ fhir:v "code" ] [ fhir:v "value" ] )                           ] )                         ] )                       ] )                     ] )                   ] [
fhir:name [ fhir:v "strenght" ] ;
                    ( fhir:source [
fhir:context [ fhir:v "observation" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:variable [ fhir:v "value" ]                     ] ) ;
                    ( fhir:target [
fhir:context [ fhir:v "ingredient" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "strength" ] ;
fhir:variable [ fhir:v "strength" ]                     ] ) ;
                    ( fhir:rule [
fhir:name [ fhir:v "numerator" ] ;
                      ( fhir:source [
fhir:context [ fhir:v "value" ]                       ] ) ;
                      ( fhir:target [
fhir:context [ fhir:v "strength" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "numerator" ] ;
fhir:variable [ fhir:v "numerator" ]                       ] ) ;
                      ( fhir:rule [
fhir:name [ fhir:v "valueN" ] ;
                        ( fhir:source [
fhir:context [ fhir:v "value" ]                         ] ) ;
                        ( fhir:target [
fhir:context [ fhir:v "numerator" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
                          ( fhir:parameter [
fhir:value [ fhir:v "value.value" ]                           ] )                         ] )                       ] )                     ] [
fhir:name [ fhir:v "denominator" ] ;
                      ( fhir:source [
fhir:context [ fhir:v "value" ]                       ] ) ;
                      ( fhir:target [
fhir:context [ fhir:v "strength" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "denominator" ] ;
fhir:variable [ fhir:v "denominator" ]                       ] ) ;
                      ( fhir:rule [
fhir:name [ fhir:v "valueD" ] ;
                        ( fhir:source [
fhir:context [ fhir:v "value" ]                         ] ) ;
                        ( fhir:target [
fhir:context [ fhir:v "denominator" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:transform [ fhir:v "copy" ] ;
                          ( fhir:parameter [
fhir:value [ fhir:v "1"^^xsd:integer ]                           ] )                         ] )                       ] )                     ] )                   ] )                 ] [
fhir:name [ fhir:v "quantita" ] ;
                  ( fhir:source [
fhir:context [ fhir:v "observation" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:condition [ fhir:v "displayName = 'Quantità nella Confezione'" ]                   ] ) ;
                  ( fhir:rule [
fhir:name [ fhir:v "amount" ] ;
                    ( fhir:source [
fhir:context [ fhir:v "observation" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:variable [ fhir:v "value" ]                     ] ) ;
                    ( fhir:target [
fhir:context [ fhir:v "medication" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "amount" ] ;
fhir:variable [ fhir:v "amount" ]                     ] ) ;
                    ( fhir:rule [
fhir:name [ fhir:v "numerator" ] ;
                      ( fhir:source [
fhir:context [ fhir:v "value" ]                       ] ) ;
                      ( fhir:target [
fhir:context [ fhir:v "amount" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "numerator" ] ;
fhir:variable [ fhir:v "numerator" ]                       ] ) ;
                      ( fhir:rule [
fhir:name [ fhir:v "valueN" ] ;
                        ( fhir:source [
fhir:context [ fhir:v "value" ]                         ] ) ;
                        ( fhir:target [
fhir:context [ fhir:v "numerator" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
                          ( fhir:parameter [
fhir:value [ fhir:v "value.value" ]                           ] )                         ] )                       ] )                     ] [
fhir:name [ fhir:v "denominator" ] ;
                      ( fhir:source [
fhir:context [ fhir:v "value" ]                       ] ) ;
                      ( fhir:target [
fhir:context [ fhir:v "amount" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "denominator" ] ;
fhir:variable [ fhir:v "denominator" ]                       ] ) ;
                      ( fhir:rule [
fhir:name [ fhir:v "valueD" ] ;
                        ( fhir:source [
fhir:context [ fhir:v "value" ]                         ] ) ;
                        ( fhir:target [
fhir:context [ fhir:v "denominator" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:transform [ fhir:v "copy" ] ;
                          ( fhir:parameter [
fhir:value [ fhir:v "1"^^xsd:integer ]                           ] )                         ] )                       ] )                     ] )                   ] )                 ] )               ] )             ] )           ] [
fhir:name [ fhir:v "entryR" ] ;
            ( fhir:source [
fhir:context [ fhir:v "sa" ] ;
fhir:element [ fhir:v "entryRelationship" ] ;
fhir:variable [ fhir:v "entryRelationship" ]             ] ) ;
            ( fhir:rule [
fhir:name [ fhir:v "sub" ] ;
              ( fhir:source [
fhir:context [ fhir:v "entryRelationship" ] ;
fhir:element [ fhir:v "supply" ] ;
fhir:variable [ fhir:v "sup" ]               ] ) ;
              ( fhir:target [
fhir:context [ fhir:v "medicationRq" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "dispenseRequest" ] ;
fhir:variable [ fhir:v "dispreq" ]               ] ) ;
              ( fhir:rule [
fhir:name [ fhir:v "quantity" ] ;
                ( fhir:source [
fhir:context [ fhir:v "sup" ]                 ] ) ;
                ( fhir:target [
fhir:context [ fhir:v "dispreq" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "quantity" ] ;
fhir:variable [ fhir:v "quantity" ] ;
fhir:transform [ fhir:v "create" ] ;
                  ( fhir:parameter [
fhir:value [ fhir:v "SimpleQuantity" ]                   ] )                 ] ) ;
                ( fhir:rule [
fhir:name [ fhir:v "quantity" ] ;
                  ( fhir:source [
fhir:context [ fhir:v "sup" ] ;
fhir:element [ fhir:v "quantity" ] ;
fhir:variable [ fhir:v "q" ]                   ] ) ;
                  ( fhir:target [
fhir:context [ fhir:v "quantity" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
                    ( fhir:parameter [
fhir:value [ fhir:v "q.value" ]                     ] )                   ] )                 ] )               ] )             ] )           ] [
fhir:name [ fhir:v "Medicationrequest" ] ;
            ( fhir:source [
fhir:context [ fhir:v "sa" ] ;
fhir:element [ fhir:v "participant" ] ;
fhir:variable [ fhir:v "participant" ]             ] ) ;
            ( fhir:rule [
fhir:name [ fhir:v "time" ] ;
              ( fhir:source [
fhir:context [ fhir:v "participant" ] ;
fhir:element [ fhir:v "time" ] ;
fhir:variable [ fhir:v "t" ]               ] ) ;
              ( fhir:target [
fhir:context [ fhir:v "medicationRq" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "authoredOn" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
                ( fhir:parameter [
fhir:value [ fhir:v "t.value" ]                 ] )               ] )             ] [
fhir:name [ fhir:v "perf" ] ;
              ( fhir:source [
fhir:context [ fhir:v "participant" ] ;
fhir:element [ fhir:v "participantRole" ] ;
fhir:variable [ fhir:v "participantR" ]               ] ) ;
              ( fhir:target [
fhir:context [ fhir:v "bundle" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "entry" ] ;
fhir:variable [ fhir:v "e1" ]               ] [
fhir:context [ fhir:v "e1" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "request" ] ;
fhir:variable [ fhir:v "request" ] ;
fhir:transform [ fhir:v "create" ] ;
                ( fhir:parameter [
fhir:value [ fhir:v "BackboneElement" ]                 ] )               ] [
fhir:context [ fhir:v "request" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "method" ] ;
fhir:transform [ fhir:v "copy" ] ;
                ( fhir:parameter [
fhir:value [ fhir:v "PUT" ]                 ] )               ] [
fhir:context [ fhir:v "e1" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "resource" ] ;
fhir:variable [ fhir:v "practitioner" ] ;
fhir:transform [ fhir:v "create" ] ;
                ( fhir:parameter [
fhir:value [ fhir:v "Practitioner" ]                 ] )               ] ) ;
              ( fhir:rule [
fhir:name [ fhir:v "meta" ] ;
                ( fhir:source [
fhir:context [ fhir:v "participantR" ]                 ] ) ;
                ( fhir:target [
fhir:context [ fhir:v "practitioner" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "meta" ] ;
fhir:variable [ fhir:v "meta" ]                 ] ) ;
                ( fhir:rule [
fhir:name [ fhir:v "coding" ] ;
                  ( fhir:source [
fhir:context [ fhir:v "participantR" ]                   ] ) ;
                  ( fhir:target [
fhir:context [ fhir:v "meta" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "tag" ] ;
fhir:variable [ fhir:v "coding" ] ;
fhir:transform [ fhir:v "create" ] ;
                    ( fhir:parameter [
fhir:value [ fhir:v "Coding" ]                     ] )                   ] ) ;
                  ( fhir:rule [
fhir:name [ fhir:v "system" ] ;
                    ( fhir:source [
fhir:context [ fhir:v "participantR" ]                     ] ) ;
                    ( fhir:target [
fhir:context [ fhir:v "coding" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "system" ] ;
fhir:transform [ fhir:v "copy" ] ;
                      ( fhir:parameter [
fhir:value [ fhir:v "http://algoritmodiscoring" ]                       ] )                     ] )                   ] [
fhir:name [ fhir:v "code" ] ;
                    ( fhir:source [
fhir:context [ fhir:v "participantR" ]                     ] ) ;
                    ( fhir:target [
fhir:context [ fhir:v "coding" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:transform [ fhir:v "copy" ] ;
                      ( fhir:parameter [
fhir:value [ fhir:v "ClinicalDocument/body/TerapiaFarmacologicaRicovero/participant" ]                       ] )                     ] )                   ] )                 ] )               ] [
fhir:name [ fhir:v "identifier" ] ;
                ( fhir:source [
fhir:context [ fhir:v "participantR" ] ;
fhir:element [ fhir:v "id" ] ;
fhir:variable [ fhir:v "id" ]                 ] ) ;
                ( fhir:target [
fhir:context [ fhir:v "practitioner" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "identifier" ] ;
fhir:variable [ fhir:v "identifier" ]                 ] ) ;
                ( fhir:rule [
fhir:name [ fhir:v "root1" ] ;
                  ( fhir:source [
fhir:context [ fhir:v "id" ] ;
fhir:element [ fhir:v "root" ] ;
fhir:variable [ fhir:v "r" ]                   ] ) ;
                  ( fhir:target [
fhir:context [ fhir:v "identifier" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "system" ] ;
fhir:transform [ fhir:v "translate" ] ;
                    ( fhir:parameter [
fhir:value [ fhir:v "r" ]                     ] [
fhir:value [ fhir:v "http://hl7.org/fhir/ConceptMap/special-oid2uri" ]                     ] [
fhir:value [ fhir:v "uri" ]                     ] )                   ] )                 ] [
fhir:name [ fhir:v "extension" ] ;
                  ( fhir:source [
fhir:context [ fhir:v "id" ] ;
fhir:element [ fhir:v "extension" ] ;
fhir:variable [ fhir:v "ext" ]                   ] ) ;
                  ( fhir:target [
fhir:context [ fhir:v "identifier" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:transform [ fhir:v "copy" ] ;
                    ( fhir:parameter [
fhir:value [ fhir:v "ext" ]                     ] )                   ] )                 ] [
fhir:name [ fhir:v "assigningAuthorityName" ] ;
                  ( fhir:source [
fhir:context [ fhir:v "id" ] ;
fhir:element [ fhir:v "assigningAuthorityName" ] ;
fhir:variable [ fhir:v "s" ]                   ] ) ;
                  ( fhir:target [
fhir:context [ fhir:v "identifier" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "assigner" ] ;
fhir:variable [ fhir:v "a" ]                   ] [
fhir:context [ fhir:v "a" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "display" ] ;
fhir:transform [ fhir:v "copy" ] ;
                    ( fhir:parameter [
fhir:value [ fhir:v "s" ]                     ] )                   ] )                 ] [
fhir:name [ fhir:v "r" ] ;
                  ( fhir:source [
fhir:context [ fhir:v "id" ] ;
fhir:element [ fhir:v "root" ] ;
fhir:variable [ fhir:v "r" ]                   ] ) ;
                  ( fhir:rule [
fhir:name [ fhir:v "aut" ] ;
                    ( fhir:source [
fhir:context [ fhir:v "id" ] ;
fhir:element [ fhir:v "extension" ] ;
fhir:variable [ fhir:v "ext" ]                     ] ) ;
                    ( fhir:target [
fhir:context [ fhir:v "practitioner" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "id" ] ;
fhir:variable [ fhir:v "uuid2" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
                      ( fhir:parameter [
fhir:value [ fhir:v "r + '-' + ext" ]                       ] )                     ] [
fhir:context [ fhir:v "e1" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "fullUrl" ] ;
fhir:transform [ fhir:v "append" ] ;
                      ( fhir:parameter [
fhir:value [ fhir:v "https://example/Practitioner/" ]                       ] [
fhir:value [ fhir:v "uuid2" ]                       ] )                     ] [
fhir:context [ fhir:v "request" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "url" ] ;
fhir:transform [ fhir:v "append" ] ;
                      ( fhir:parameter [
fhir:value [ fhir:v "Practitioner/" ]                       ] [
fhir:value [ fhir:v "uuid1" ]                       ] )                     ] [
fhir:context [ fhir:v "medicationRq" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "requester" ] ;
fhir:variable [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "create" ] ;
                      ( fhir:parameter [
fhir:value [ fhir:v "Reference" ]                       ] )                     ] [
fhir:context [ fhir:v "reference" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
                      ( fhir:parameter [
fhir:value [ fhir:v "'https://example/Practitioner/' + %practitioner.id" ]                       ] )                     ] )                   ] )                 ] )               ] [
fhir:name [ fhir:v "2.16.840.1.113883.2.9.4.3.2" ] ;
                ( fhir:source [
fhir:context [ fhir:v "participantR" ] ;
fhir:element [ fhir:v "id" ] ;
fhir:variable [ fhir:v "id" ] ;
fhir:condition [ fhir:v "(root = '2.16.840.1.113883.2.9.4.3.2')" ]                 ] ) ;
                ( fhir:rule [
fhir:name [ fhir:v "UUID" ] ;
                  ( fhir:source [
fhir:context [ fhir:v "id" ] ;
fhir:element [ fhir:v "extension" ] ;
fhir:variable [ fhir:v "ext" ]                   ] ) ;
                  ( fhir:target [
fhir:context [ fhir:v "request" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "url" ] ;
fhir:transform [ fhir:v "append" ] ;
                    ( fhir:parameter [
fhir:value [ fhir:v "Practitioner?identifier=" ]                     ] [
fhir:value [ fhir:v "ext" ]                     ] )                   ] )                 ] )               ] [
fhir:name [ fhir:v "assi" ] ;
                ( fhir:source [
fhir:context [ fhir:v "participantR" ] ;
fhir:element [ fhir:v "playingEntity" ] ;
fhir:variable [ fhir:v "assi" ]                 ] ) ;
                ( fhir:rule [
fhir:name [ fhir:v "name" ] ;
                  ( fhir:source [
fhir:context [ fhir:v "assi" ] ;
fhir:element [ fhir:v "name" ] ;
fhir:variable [ fhir:v "vvv" ]                   ] ) ;
                  ( fhir:target [
fhir:context [ fhir:v "practitioner" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "name" ] ;
fhir:variable [ fhir:v "vvv" ] ;
fhir:transform [ fhir:v "create" ]                   ] )                 ] )               ] )             ] [
fhir:name [ fhir:v "period" ] ;
              ( fhir:source [
fhir:context [ fhir:v "sa" ] ;
fhir:type [ fhir:v "EIVL" ] ;
fhir:element [ fhir:v "effectiveTime" ] ;
fhir:variable [ fhir:v "eff" ]               ] ) ;
              ( fhir:target [
fhir:context [ fhir:v "medicationRq" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "dosageInstruction" ] ;
fhir:variable [ fhir:v "dosage" ] ;
fhir:transform [ fhir:v "create" ] ;
                ( fhir:parameter [
fhir:value [ fhir:v "Dosage" ]                 ] )               ] ) ;
              ( fhir:rule [
fhir:name [ fhir:v "timing" ] ;
                ( fhir:source [
fhir:context [ fhir:v "eff" ]                 ] ) ;
                ( fhir:target [
fhir:context [ fhir:v "dosage" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "timing" ] ;
fhir:variable [ fhir:v "timing" ] ;
fhir:transform [ fhir:v "create" ] ;
                  ( fhir:parameter [
fhir:value [ fhir:v "Timing" ]                   ] )                 ] ) ;
                ( fhir:rule [
fhir:name [ fhir:v "rep" ] ;
                  ( fhir:source [
fhir:context [ fhir:v "eff" ]                   ] ) ;
                  ( fhir:target [
fhir:context [ fhir:v "timing" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "repeat" ] ;
fhir:variable [ fhir:v "rep" ]                   ] ) ;
                  ( fhir:rule [
fhir:name [ fhir:v "event" ] ;
                    ( fhir:source [
fhir:context [ fhir:v "eff" ] ;
fhir:element [ fhir:v "event" ] ;
fhir:variable [ fhir:v "ev" ]                     ] ) ;
                    ( fhir:target [
fhir:context [ fhir:v "rep" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "where" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
                      ( fhir:parameter [
fhir:value [ fhir:v "ev.code" ]                       ] )                     ] )                   ] )                 ] )               ] )             ] [
fhir:name [ fhir:v "tim" ] ;
              ( fhir:source [
fhir:context [ fhir:v "sa" ] ;
fhir:type [ fhir:v "TS" ] ;
fhir:element [ fhir:v "effectiveTime" ] ;
fhir:variable [ fhir:v "eff" ]               ] ) ;
              ( fhir:target [
fhir:context [ fhir:v "medicationRq" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "dosageInstruction" ] ;
fhir:variable [ fhir:v "dosage" ] ;
fhir:transform [ fhir:v "create" ] ;
                ( fhir:parameter [
fhir:value [ fhir:v "Dosage" ]                 ] )               ] [
fhir:context [ fhir:v "dosage" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "timing" ] ;
fhir:variable [ fhir:v "timing" ] ;
fhir:transform [ fhir:v "create" ] ;
                ( fhir:parameter [
fhir:value [ fhir:v "Timing" ]                 ] )               ] [
fhir:context [ fhir:v "timing" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "event" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
                ( fhir:parameter [
fhir:value [ fhir:v "eff.value" ]                 ] )               ] )             ] [
fhir:name [ fhir:v "eff" ] ;
              ( fhir:source [
fhir:context [ fhir:v "sa" ] ;
fhir:type [ fhir:v "PIVL_TS" ] ;
fhir:element [ fhir:v "effectiveTime" ] ;
fhir:variable [ fhir:v "eff" ]               ] ) ;
              ( fhir:target [
fhir:context [ fhir:v "medicationAdm" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "dosage" ] ;
fhir:variable [ fhir:v "dosage" ] ;
fhir:transform [ fhir:v "create" ] ;
                ( fhir:parameter [
fhir:value [ fhir:v "BackboneElement" ]                 ] )               ] ) ;
              ( fhir:rule [
fhir:name [ fhir:v "ratio" ] ;
                ( fhir:source [
fhir:context [ fhir:v "eff" ]                 ] ) ;
                ( fhir:target [
fhir:context [ fhir:v "dosage" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "rate" ] ;
fhir:variable [ fhir:v "ratio" ] ;
fhir:transform [ fhir:v "create" ] ;
                  ( fhir:parameter [
fhir:value [ fhir:v "Ratio" ]                   ] )                 ] ) ;
                ( fhir:rule [
fhir:name [ fhir:v "quanti" ] ;
                  ( fhir:source [
fhir:context [ fhir:v "eff" ]                   ] ) ;
                  ( fhir:target [
fhir:context [ fhir:v "ratio" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "numerator" ] ;
fhir:variable [ fhir:v "quan" ] ;
fhir:transform [ fhir:v "create" ] ;
                    ( fhir:parameter [
fhir:value [ fhir:v "Quantity" ]                     ] )                   ] ) ;
                  ( fhir:rule [
fhir:name [ fhir:v "period" ] ;
                    ( fhir:source [
fhir:context [ fhir:v "eff" ] ;
fhir:element [ fhir:v "period" ] ;
fhir:variable [ fhir:v "per" ]                     ] ) ;
                    ( fhir:target [
fhir:context [ fhir:v "quan" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
                      ( fhir:parameter [
fhir:value [ fhir:v "per.value" ]                       ] )                     ] )                   ] [
fhir:name [ fhir:v "period" ] ;
                    ( fhir:source [
fhir:context [ fhir:v "eff" ] ;
fhir:element [ fhir:v "period" ] ;
fhir:variable [ fhir:v "per" ]                     ] ) ;
                    ( fhir:target [
fhir:context [ fhir:v "quan" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "unit" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
                      ( fhir:parameter [
fhir:value [ fhir:v "per.unit" ]                       ] )                     ] )                   ] )                 ] [
fhir:name [ fhir:v "quanti" ] ;
                  ( fhir:source [
fhir:context [ fhir:v "eff" ]                   ] ) ;
                  ( fhir:target [
fhir:context [ fhir:v "ratio" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "denominator" ] ;
fhir:variable [ fhir:v "quan" ] ;
fhir:transform [ fhir:v "create" ] ;
                    ( fhir:parameter [
fhir:value [ fhir:v "Quantity" ]                     ] )                   ] ) ;
                  ( fhir:rule [
fhir:name [ fhir:v "period" ] ;
                    ( fhir:source [
fhir:context [ fhir:v "eff" ] ;
fhir:element [ fhir:v "period" ]                     ] ) ;
                    ( fhir:target [
fhir:context [ fhir:v "quan" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:transform [ fhir:v "copy" ] ;
                      ( fhir:parameter [
fhir:value [ fhir:v "1" ]                       ] )                     ] )                   ] [
fhir:name [ fhir:v "period" ] ;
                    ( fhir:source [
fhir:context [ fhir:v "eff" ] ;
fhir:element [ fhir:v "period" ] ;
fhir:variable [ fhir:v "per" ]                     ] ) ;
                    ( fhir:target [
fhir:context [ fhir:v "quan" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "unit" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
                      ( fhir:parameter [
fhir:value [ fhir:v "per.unit" ]                       ] )                     ] )                   ] )                 ] )               ] )             ] )           ] )         ] )       ] )     ] )
  ] [
fhir:name [ fhir:v "ClinicalDocumentSottoSectionOBS" ] ;
fhir:typeMode [ fhir:v "none" ] ;
    ( fhir:input [
fhir:name [ fhir:v "src" ] ;
fhir:type [ fhir:v "Section" ] ;
fhir:mode [ fhir:v "source" ]     ] [
fhir:name [ fhir:v "tgt" ] ;
fhir:mode [ fhir:v "target" ]     ] [
fhir:name [ fhir:v "bundle" ] ;
fhir:type [ fhir:v "Bundle" ] ;
fhir:mode [ fhir:v "target" ]     ] [
fhir:name [ fhir:v "enc" ] ;
fhir:type [ fhir:v "Encounter" ] ;
fhir:mode [ fhir:v "target" ]     ] [
fhir:name [ fhir:v "patient" ] ;
fhir:type [ fhir:v "Patient" ] ;
fhir:mode [ fhir:v "target" ]     ] ) ;
    ( fhir:rule [
fhir:name [ fhir:v "title" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "title" ] ;
fhir:variable [ fhir:v "t" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "title" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "t.dataString" ]         ] )       ] )     ] [
fhir:name [ fhir:v "code" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "vvv" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "vvv" ] ;
fhir:transform [ fhir:v "create" ]       ] )     ] [
fhir:name [ fhir:v "cdaText" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "text" ] ;
fhir:variable [ fhir:v "cdaText" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "bundle" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "entry" ] ;
fhir:variable [ fhir:v "e1" ]       ] [
fhir:context [ fhir:v "e1" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "request" ] ;
fhir:variable [ fhir:v "request" ] ;
fhir:transform [ fhir:v "create" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "BackboneElement" ]         ] )       ] [
fhir:context [ fhir:v "request" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "method" ] ;
fhir:transform [ fhir:v "copy" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "POST" ]         ] )       ] [
fhir:context [ fhir:v "e1" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "resource" ] ;
fhir:variable [ fhir:v "observation" ] ;
fhir:transform [ fhir:v "create" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "Observation" ]         ] )       ] [
fhir:context [ fhir:v "observation" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "id" ] ;
fhir:variable [ fhir:v "uuid1" ] ;
fhir:transform [ fhir:v "uuid" ]       ] [
fhir:context [ fhir:v "e1" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "fullUrl" ] ;
fhir:transform [ fhir:v "append" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "https://example/Observation/" ]         ] [
fhir:value [ fhir:v "uuid1" ]         ] )       ] [
fhir:context [ fhir:v "request" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "url" ] ;
fhir:transform [ fhir:v "copy" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "Observation" ]         ] )       ] [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "entry" ] ;
fhir:variable [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "create" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "Reference" ]         ] )       ] [
fhir:context [ fhir:v "reference" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "'https://example/Observation/' + %observation.id" ]         ] )       ] [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "text" ] ;
fhir:variable [ fhir:v "fhirText" ]       ] ) ;
      ( fhir:rule [
fhir:name [ fhir:v "narrativeStatus" ] ;
        ( fhir:source [
fhir:context [ fhir:v "cdaText" ]         ] ) ;
        ( fhir:target [
fhir:context [ fhir:v "fhirText" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "status" ] ;
fhir:transform [ fhir:v "copy" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "generated" ]           ] )         ] )       ] [
fhir:name [ fhir:v "narrativeText" ] ;
        ( fhir:source [
fhir:context [ fhir:v "cdaText" ] ;
fhir:variable [ fhir:v "t" ]         ] ) ;
        ( fhir:target [
fhir:context [ fhir:v "fhirText" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "div" ] ;
fhir:transform [ fhir:v "copy" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "t" ]           ] )         ] )       ] [
fhir:name [ fhir:v "code" ] ;
        ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "vvv" ]         ] ) ;
        ( fhir:target [
fhir:context [ fhir:v "observation" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "vvv" ] ;
fhir:transform [ fhir:v "create" ]         ] )       ] [
fhir:name [ fhir:v "reference" ] ;
        ( fhir:source [
fhir:context [ fhir:v "src" ]         ] ) ;
        ( fhir:target [
fhir:context [ fhir:v "observation" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "subject" ] ;
fhir:variable [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "create" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "Reference" ]           ] )         ] [
fhir:context [ fhir:v "reference" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "'https://example/Patient/' + %patient.id" ]           ] )         ] )       ] [
fhir:name [ fhir:v "reference" ] ;
        ( fhir:source [
fhir:context [ fhir:v "src" ]         ] ) ;
        ( fhir:target [
fhir:context [ fhir:v "observation" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "encounter" ] ;
fhir:variable [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "create" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "Reference" ]           ] )         ] [
fhir:context [ fhir:v "reference" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "'https://example/Encounter/' + %enc.id" ]           ] )         ] )       ] [
fhir:name [ fhir:v "statuscode" ] ;
        ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:condition [ fhir:v "observation.statusCode.exists().not()" ]         ] ) ;
        ( fhir:rule [
fhir:name [ fhir:v "status" ] ;
          ( fhir:source [
fhir:context [ fhir:v "src" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "observation" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "status" ] ;
fhir:transform [ fhir:v "copy" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "final" ]             ] )           ] )         ] )       ] [
fhir:name [ fhir:v "reference" ] ;
        ( fhir:source [
fhir:context [ fhir:v "cdaText" ]         ] ) ;
        ( fhir:target [
fhir:context [ fhir:v "observation" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "note" ] ;
fhir:variable [ fhir:v "note" ]         ] ) ;
        ( fhir:rule [
fhir:name [ fhir:v "reference" ] ;
          ( fhir:source [
fhir:context [ fhir:v "cdaText" ] ;
fhir:variable [ fhir:v "t" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "note" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "text" ] ;
fhir:transform [ fhir:v "copy" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "t" ]             ] )           ] )         ] )       ] )     ] )
  ] [
fhir:name [ fhir:v "ClinicalDocumentSottoSectionMS" ] ;
fhir:typeMode [ fhir:v "none" ] ;
    ( fhir:input [
fhir:name [ fhir:v "src" ] ;
fhir:type [ fhir:v "Section" ] ;
fhir:mode [ fhir:v "source" ]     ] [
fhir:name [ fhir:v "tgt" ] ;
fhir:mode [ fhir:v "target" ]     ] [
fhir:name [ fhir:v "bundle" ] ;
fhir:type [ fhir:v "Bundle" ] ;
fhir:mode [ fhir:v "target" ]     ] [
fhir:name [ fhir:v "patient" ] ;
fhir:type [ fhir:v "Patient" ] ;
fhir:mode [ fhir:v "target" ]     ] [
fhir:name [ fhir:v "enc" ] ;
fhir:type [ fhir:v "Encounter" ] ;
fhir:mode [ fhir:v "target" ]     ] ) ;
    ( fhir:rule [
fhir:name [ fhir:v "title" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "title" ] ;
fhir:variable [ fhir:v "t" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "title" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "t.dataString" ]         ] )       ] )     ] [
fhir:name [ fhir:v "code" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "vvv" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "vvv" ] ;
fhir:transform [ fhir:v "create" ]       ] )     ] [
fhir:name [ fhir:v "cdaText" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "text" ] ;
fhir:variable [ fhir:v "cdaText" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "bundle" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "entry" ] ;
fhir:variable [ fhir:v "e1" ]       ] [
fhir:context [ fhir:v "e1" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "request" ] ;
fhir:variable [ fhir:v "request" ] ;
fhir:transform [ fhir:v "create" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "BackboneElement" ]         ] )       ] [
fhir:context [ fhir:v "request" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "method" ] ;
fhir:transform [ fhir:v "copy" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "POST" ]         ] )       ] [
fhir:context [ fhir:v "e1" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "resource" ] ;
fhir:variable [ fhir:v "Medicationstatement" ] ;
fhir:transform [ fhir:v "create" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "MedicationStatement" ]         ] )       ] [
fhir:context [ fhir:v "Medicationstatement" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "id" ] ;
fhir:variable [ fhir:v "uuid1" ] ;
fhir:transform [ fhir:v "uuid" ]       ] [
fhir:context [ fhir:v "e1" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "fullUrl" ] ;
fhir:transform [ fhir:v "append" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "https://example/MedicationStatement/" ]         ] [
fhir:value [ fhir:v "uuid1" ]         ] )       ] [
fhir:context [ fhir:v "request" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "url" ] ;
fhir:transform [ fhir:v "copy" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "MedicationStatement" ]         ] )       ] [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "entry" ] ;
fhir:variable [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "create" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "Reference" ]         ] )       ] [
fhir:context [ fhir:v "reference" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "'https://example/MedicationStatement/' + %Medicationstatement.id" ]         ] )       ] [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "text" ] ;
fhir:variable [ fhir:v "fhirText" ]       ] ) ;
      ( fhir:rule [
fhir:name [ fhir:v "reference" ] ;
        ( fhir:source [
fhir:context [ fhir:v "cdaText" ]         ] ) ;
        ( fhir:target [
fhir:context [ fhir:v "Medicationstatement" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "note" ] ;
fhir:variable [ fhir:v "note" ]         ] ) ;
        ( fhir:rule [
fhir:name [ fhir:v "reference" ] ;
          ( fhir:source [
fhir:context [ fhir:v "cdaText" ] ;
fhir:variable [ fhir:v "t" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "note" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "text" ] ;
fhir:transform [ fhir:v "copy" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "t" ]             ] )           ] )         ] [
fhir:name [ fhir:v "text" ] ;
          ( fhir:source [
fhir:context [ fhir:v "cdaText" ] ;
fhir:variable [ fhir:v "t" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "Medicationstatement" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "medication" ] ;
fhir:variable [ fhir:v "medication" ] ;
fhir:transform [ fhir:v "create" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "CodeableConcept" ]             ] )           ] [
fhir:context [ fhir:v "medication" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "text" ] ;
fhir:transform [ fhir:v "copy" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "t" ]             ] )           ] )         ] )       ] [
fhir:name [ fhir:v "reference" ] ;
        ( fhir:source [
fhir:context [ fhir:v "src" ]         ] ) ;
        ( fhir:target [
fhir:context [ fhir:v "Medicationstatement" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "subject" ] ;
fhir:variable [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "create" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "Reference" ]           ] )         ] [
fhir:context [ fhir:v "reference" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "'https://example/Patient/' + %patient.id" ]           ] )         ] )       ] [
fhir:name [ fhir:v "status" ] ;
        ( fhir:source [
fhir:context [ fhir:v "src" ]         ] ) ;
        ( fhir:target [
fhir:context [ fhir:v "Medicationstatement" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "status" ] ;
fhir:transform [ fhir:v "copy" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "unknown" ]           ] )         ] )       ] )     ] )
  ] [
fhir:name [ fhir:v "Observation" ] ;
fhir:typeMode [ fhir:v "none" ] ;
    ( fhir:input [
fhir:name [ fhir:v "obs" ] ;
fhir:type [ fhir:v "Observation" ] ;
fhir:mode [ fhir:v "source" ]     ] [
fhir:name [ fhir:v "patient" ] ;
fhir:type [ fhir:v "Patient" ] ;
fhir:mode [ fhir:v "target" ]     ] [
fhir:name [ fhir:v "encounter" ] ;
fhir:type [ fhir:v "Encounter" ] ;
fhir:mode [ fhir:v "target" ]     ] [
fhir:name [ fhir:v "ob" ] ;
fhir:type [ fhir:v "Observation" ] ;
fhir:mode [ fhir:v "target" ]     ] [
fhir:name [ fhir:v "bundle" ] ;
fhir:type [ fhir:v "Bundle" ] ;
fhir:mode [ fhir:v "target" ]     ] ) ;
    ( fhir:rule [
fhir:name [ fhir:v "reference" ] ;
      ( fhir:source [
fhir:context [ fhir:v "obs" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "ob" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "subject" ] ;
fhir:variable [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "create" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "Reference" ]         ] )       ] [
fhir:context [ fhir:v "reference" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "'https://example/Patient/' + %patient.id" ]         ] )       ] )     ] [
fhir:name [ fhir:v "reference" ] ;
      ( fhir:source [
fhir:context [ fhir:v "obs" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "ob" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "encounter" ] ;
fhir:variable [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "create" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "Reference" ]         ] )       ] [
fhir:context [ fhir:v "reference" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "'https://example/Encounter/' + %encounter.id" ]         ] )       ] )     ] [
fhir:name [ fhir:v "code" ] ;
      ( fhir:source [
fhir:context [ fhir:v "obs" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "vvv" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "ob" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "vvv" ] ;
fhir:transform [ fhir:v "create" ]       ] )     ] [
fhir:name [ fhir:v "statusCode" ] ;
      ( fhir:source [
fhir:context [ fhir:v "obs" ] ;
fhir:element [ fhir:v "statusCode" ] ;
fhir:variable [ fhir:v "statusc" ] ;
fhir:condition [ fhir:v "(code = 'completed')" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "ob" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "status" ] ;
fhir:transform [ fhir:v "copy" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "final" ]         ] )       ] )     ] [
fhir:name [ fhir:v "statusCode" ] ;
      ( fhir:source [
fhir:context [ fhir:v "obs" ] ;
fhir:element [ fhir:v "statusCode" ] ;
fhir:variable [ fhir:v "statusc" ] ;
fhir:condition [ fhir:v "(code = 'active')" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "ob" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "status" ] ;
fhir:transform [ fhir:v "copy" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "registered" ]         ] )       ] )     ] [
fhir:name [ fhir:v "statusCode" ] ;
      ( fhir:source [
fhir:context [ fhir:v "obs" ] ;
fhir:element [ fhir:v "statusCode" ] ;
fhir:variable [ fhir:v "statusc" ] ;
fhir:condition [ fhir:v "(code = 'aborted')" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "ob" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "status" ] ;
fhir:transform [ fhir:v "copy" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "cancelled" ]         ] )       ] )     ] [
fhir:name [ fhir:v "statusCode" ] ;
      ( fhir:source [
fhir:context [ fhir:v "obs" ] ;
fhir:element [ fhir:v "statusCode" ] ;
fhir:variable [ fhir:v "statusc" ] ;
fhir:condition [ fhir:v "(code = 'suspended')" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "ob" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "status" ] ;
fhir:transform [ fhir:v "copy" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "partial" ]         ] )       ] )     ] [
fhir:name [ fhir:v "statuscode" ] ;
      ( fhir:source [
fhir:context [ fhir:v "obs" ] ;
fhir:condition [ fhir:v "obs.statusCode.exists().not()" ]       ] ) ;
      ( fhir:rule [
fhir:name [ fhir:v "status" ] ;
        ( fhir:source [
fhir:context [ fhir:v "obs" ]         ] ) ;
        ( fhir:target [
fhir:context [ fhir:v "ob" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "status" ] ;
fhir:transform [ fhir:v "copy" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "final" ]           ] )         ] )       ] )     ] [
fhir:name [ fhir:v "value2" ] ;
      ( fhir:source [
fhir:context [ fhir:v "obs" ] ;
fhir:element [ fhir:v "effectiveTime" ] ;
fhir:variable [ fhir:v "effectiveTime" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "ob" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "effective" ] ;
fhir:variable [ fhir:v "value" ] ;
fhir:transform [ fhir:v "create" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "dateTime" ]         ] )       ] ) ;
      ( fhir:dependent [
fhir:name [ fhir:v "TSDateTime" ] ;
        ( fhir:variable [ fhir:v "effectiveTime" ] [ fhir:v "value" ] )       ] )     ] [
fhir:name [ fhir:v "where" ] ;
      ( fhir:source [
fhir:context [ fhir:v "obs" ] ;
fhir:condition [ fhir:v "effectiveTime.low.exists() or effectiveTime.high.exists()" ]       ] ) ;
      ( fhir:rule [
fhir:name [ fhir:v "value3" ] ;
        ( fhir:source [
fhir:context [ fhir:v "obs" ] ;
fhir:element [ fhir:v "effectiveTime" ] ;
fhir:variable [ fhir:v "eff" ]         ] ) ;
        ( fhir:target [
fhir:context [ fhir:v "ob" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "effective" ] ;
fhir:variable [ fhir:v "period" ] ;
fhir:transform [ fhir:v "create" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "Period" ]           ] )         ] ) ;
        ( fhir:dependent [
fhir:name [ fhir:v "IVLTSPeriod" ] ;
          ( fhir:variable [ fhir:v "eff" ] [ fhir:v "period" ] )         ] )       ] )     ] [
fhir:name [ fhir:v "value" ] ;
      ( fhir:source [
fhir:context [ fhir:v "obs" ] ;
fhir:type [ fhir:v "INT" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:variable [ fhir:v "int" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "ob" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "int.value" ]         ] )       ] )     ] [
fhir:name [ fhir:v "boolean" ] ;
      ( fhir:source [
fhir:context [ fhir:v "obs" ] ;
fhir:type [ fhir:v "BL" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:variable [ fhir:v "boolean" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "ob" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "boolean.value" ]         ] )       ] )     ] [
fhir:name [ fhir:v "val" ] ;
      ( fhir:source [
fhir:context [ fhir:v "obs" ] ;
fhir:type [ fhir:v "CD" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:variable [ fhir:v "val" ]       ] ) ;
      ( fhir:rule [
fhir:name [ fhir:v "coding" ] ;
        ( fhir:source [
fhir:context [ fhir:v "val" ]         ] ) ;
        ( fhir:target [
fhir:context [ fhir:v "ob" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:variable [ fhir:v "ce" ] ;
fhir:transform [ fhir:v "create" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "CodeableConcept" ]           ] )         ] ) ;
        ( fhir:rule [
fhir:name [ fhir:v "originalText" ] ;
          ( fhir:source [
fhir:context [ fhir:v "val" ] ;
fhir:element [ fhir:v "originalText" ] ;
fhir:variable [ fhir:v "vvv" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "ce" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "text" ] ;
fhir:variable [ fhir:v "vvv" ] ;
fhir:transform [ fhir:v "create" ]           ] )         ] [
fhir:name [ fhir:v "code" ] ;
          ( fhir:source [
fhir:context [ fhir:v "val" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "ce" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "coding" ] ;
fhir:variable [ fhir:v "coding" ]           ] ) ;
          ( fhir:rule [
fhir:name [ fhir:v "code" ] ;
            ( fhir:source [
fhir:context [ fhir:v "val" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "code" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "coding" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:transform [ fhir:v "cast" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "code" ]               ] [
fhir:value [ fhir:v "string" ]               ] )             ] )           ] [
fhir:name [ fhir:v "codeSystem" ] ;
            ( fhir:source [
fhir:context [ fhir:v "val" ] ;
fhir:element [ fhir:v "codeSystem" ] ;
fhir:variable [ fhir:v "system" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "coding" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "system" ] ;
fhir:transform [ fhir:v "translate" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "system" ]               ] [
fhir:value [ fhir:v "http://hl7.org/fhir/ConceptMap/special-oid2uri" ]               ] [
fhir:value [ fhir:v "uri" ]               ] )             ] )           ] [
fhir:name [ fhir:v "displayName" ] ;
            ( fhir:source [
fhir:context [ fhir:v "val" ] ;
fhir:element [ fhir:v "displayName" ] ;
fhir:variable [ fhir:v "display" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "coding" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "display" ] ;
fhir:transform [ fhir:v "cast" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "display" ]               ] [
fhir:value [ fhir:v "string" ]               ] )             ] )           ] )         ] [
fhir:name [ fhir:v "translation" ] ;
          ( fhir:source [
fhir:context [ fhir:v "val" ] ;
fhir:element [ fhir:v "translation" ] ;
fhir:variable [ fhir:v "translation" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "ce" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "coding" ] ;
fhir:variable [ fhir:v "coding" ]           ] ) ;
          ( fhir:rule [
fhir:name [ fhir:v "code" ] ;
            ( fhir:source [
fhir:context [ fhir:v "translation" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "code" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "coding" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:transform [ fhir:v "cast" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "code" ]               ] [
fhir:value [ fhir:v "string" ]               ] )             ] )           ] [
fhir:name [ fhir:v "codeSystem" ] ;
            ( fhir:source [
fhir:context [ fhir:v "translation" ] ;
fhir:element [ fhir:v "codeSystem" ] ;
fhir:variable [ fhir:v "system" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "coding" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "system" ] ;
fhir:transform [ fhir:v "translate" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "system" ]               ] [
fhir:value [ fhir:v "http://hl7.org/fhir/ConceptMap/special-oid2uri" ]               ] [
fhir:value [ fhir:v "uri" ]               ] )             ] )           ] [
fhir:name [ fhir:v "displayName" ] ;
            ( fhir:source [
fhir:context [ fhir:v "translation" ] ;
fhir:element [ fhir:v "displayName" ] ;
fhir:variable [ fhir:v "display" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "coding" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "display" ] ;
fhir:transform [ fhir:v "cast" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "display" ]               ] [
fhir:value [ fhir:v "string" ]               ] )             ] )           ] [
fhir:name [ fhir:v "qualifier" ] ;
            ( fhir:source [
fhir:context [ fhir:v "translation" ] ;
fhir:element [ fhir:v "qualifier" ] ;
fhir:variable [ fhir:v "qualifier" ]             ] ) ;
            ( fhir:rule [
fhir:name [ fhir:v "value" ] ;
              ( fhir:source [
fhir:context [ fhir:v "qualifier" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:variable [ fhir:v "value" ]               ] ) ;
              ( fhir:target [
fhir:context [ fhir:v "ce" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "coding" ] ;
fhir:variable [ fhir:v "coding" ]               ] ) ;
              ( fhir:rule [
fhir:name [ fhir:v "code" ] ;
                ( fhir:source [
fhir:context [ fhir:v "value" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "code" ]                 ] ) ;
                ( fhir:target [
fhir:context [ fhir:v "coding" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:transform [ fhir:v "cast" ] ;
                  ( fhir:parameter [
fhir:value [ fhir:v "code" ]                   ] [
fhir:value [ fhir:v "string" ]                   ] )                 ] )               ] [
fhir:name [ fhir:v "codeSystem" ] ;
                ( fhir:source [
fhir:context [ fhir:v "value" ] ;
fhir:element [ fhir:v "codeSystem" ] ;
fhir:variable [ fhir:v "system" ]                 ] ) ;
                ( fhir:target [
fhir:context [ fhir:v "coding" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "system" ] ;
fhir:transform [ fhir:v "translate" ] ;
                  ( fhir:parameter [
fhir:value [ fhir:v "system" ]                   ] [
fhir:value [ fhir:v "http://hl7.org/fhir/ConceptMap/special-oid2uri" ]                   ] [
fhir:value [ fhir:v "uri" ]                   ] )                 ] )               ] [
fhir:name [ fhir:v "displayName" ] ;
                ( fhir:source [
fhir:context [ fhir:v "value" ] ;
fhir:element [ fhir:v "displayName" ] ;
fhir:variable [ fhir:v "display" ]                 ] ) ;
                ( fhir:target [
fhir:context [ fhir:v "coding" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "display" ] ;
fhir:transform [ fhir:v "cast" ] ;
                  ( fhir:parameter [
fhir:value [ fhir:v "display" ]                   ] [
fhir:value [ fhir:v "string" ]                   ] )                 ] )               ] )             ] )           ] )         ] )       ] )     ] [
fhir:name [ fhir:v "val" ] ;
      ( fhir:source [
fhir:context [ fhir:v "obs" ] ;
fhir:type [ fhir:v "CE" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:variable [ fhir:v "val" ]       ] ) ;
      ( fhir:rule [
fhir:name [ fhir:v "coding" ] ;
        ( fhir:source [
fhir:context [ fhir:v "val" ]         ] ) ;
        ( fhir:target [
fhir:context [ fhir:v "ob" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:variable [ fhir:v "ce" ] ;
fhir:transform [ fhir:v "create" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "CodeableConcept" ]           ] )         ] ) ;
        ( fhir:rule [
fhir:name [ fhir:v "originalText" ] ;
          ( fhir:source [
fhir:context [ fhir:v "val" ] ;
fhir:element [ fhir:v "originalText" ] ;
fhir:variable [ fhir:v "vvv" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "ce" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "text" ] ;
fhir:variable [ fhir:v "vvv" ] ;
fhir:transform [ fhir:v "create" ]           ] )         ] [
fhir:name [ fhir:v "code" ] ;
          ( fhir:source [
fhir:context [ fhir:v "val" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "ce" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "coding" ] ;
fhir:variable [ fhir:v "coding" ]           ] ) ;
          ( fhir:rule [
fhir:name [ fhir:v "code" ] ;
            ( fhir:source [
fhir:context [ fhir:v "val" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "code" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "coding" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:transform [ fhir:v "cast" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "code" ]               ] [
fhir:value [ fhir:v "string" ]               ] )             ] )           ] [
fhir:name [ fhir:v "codeSystem" ] ;
            ( fhir:source [
fhir:context [ fhir:v "val" ] ;
fhir:element [ fhir:v "codeSystem" ] ;
fhir:variable [ fhir:v "system" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "coding" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "system" ] ;
fhir:transform [ fhir:v "translate" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "system" ]               ] [
fhir:value [ fhir:v "http://hl7.org/fhir/ConceptMap/special-oid2uri" ]               ] [
fhir:value [ fhir:v "uri" ]               ] )             ] )           ] [
fhir:name [ fhir:v "displayName" ] ;
            ( fhir:source [
fhir:context [ fhir:v "val" ] ;
fhir:element [ fhir:v "displayName" ] ;
fhir:variable [ fhir:v "display" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "coding" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "display" ] ;
fhir:transform [ fhir:v "cast" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "display" ]               ] [
fhir:value [ fhir:v "string" ]               ] )             ] )           ] )         ] [
fhir:name [ fhir:v "translation" ] ;
          ( fhir:source [
fhir:context [ fhir:v "val" ] ;
fhir:element [ fhir:v "translation" ] ;
fhir:variable [ fhir:v "translation" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "ce" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "coding" ] ;
fhir:variable [ fhir:v "coding" ]           ] ) ;
          ( fhir:rule [
fhir:name [ fhir:v "code" ] ;
            ( fhir:source [
fhir:context [ fhir:v "translation" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "code" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "coding" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:transform [ fhir:v "cast" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "code" ]               ] [
fhir:value [ fhir:v "string" ]               ] )             ] )           ] [
fhir:name [ fhir:v "codeSystem" ] ;
            ( fhir:source [
fhir:context [ fhir:v "translation" ] ;
fhir:element [ fhir:v "codeSystem" ] ;
fhir:variable [ fhir:v "system" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "coding" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "system" ] ;
fhir:transform [ fhir:v "translate" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "system" ]               ] [
fhir:value [ fhir:v "http://hl7.org/fhir/ConceptMap/special-oid2uri" ]               ] [
fhir:value [ fhir:v "uri" ]               ] )             ] )           ] [
fhir:name [ fhir:v "displayName" ] ;
            ( fhir:source [
fhir:context [ fhir:v "translation" ] ;
fhir:element [ fhir:v "displayName" ] ;
fhir:variable [ fhir:v "display" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "coding" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "display" ] ;
fhir:transform [ fhir:v "cast" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "display" ]               ] [
fhir:value [ fhir:v "string" ]               ] )             ] )           ] [
fhir:name [ fhir:v "qualifier" ] ;
            ( fhir:source [
fhir:context [ fhir:v "translation" ] ;
fhir:element [ fhir:v "qualifier" ] ;
fhir:variable [ fhir:v "qualifier" ]             ] ) ;
            ( fhir:rule [
fhir:name [ fhir:v "value" ] ;
              ( fhir:source [
fhir:context [ fhir:v "qualifier" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:variable [ fhir:v "value" ]               ] ) ;
              ( fhir:target [
fhir:context [ fhir:v "ce" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "coding" ] ;
fhir:variable [ fhir:v "coding" ]               ] ) ;
              ( fhir:rule [
fhir:name [ fhir:v "code" ] ;
                ( fhir:source [
fhir:context [ fhir:v "value" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "code" ]                 ] ) ;
                ( fhir:target [
fhir:context [ fhir:v "coding" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:transform [ fhir:v "cast" ] ;
                  ( fhir:parameter [
fhir:value [ fhir:v "code" ]                   ] [
fhir:value [ fhir:v "string" ]                   ] )                 ] )               ] [
fhir:name [ fhir:v "codeSystem" ] ;
                ( fhir:source [
fhir:context [ fhir:v "value" ] ;
fhir:element [ fhir:v "codeSystem" ] ;
fhir:variable [ fhir:v "system" ]                 ] ) ;
                ( fhir:target [
fhir:context [ fhir:v "coding" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "system" ] ;
fhir:transform [ fhir:v "translate" ] ;
                  ( fhir:parameter [
fhir:value [ fhir:v "system" ]                   ] [
fhir:value [ fhir:v "http://hl7.org/fhir/ConceptMap/special-oid2uri" ]                   ] [
fhir:value [ fhir:v "uri" ]                   ] )                 ] )               ] [
fhir:name [ fhir:v "displayName" ] ;
                ( fhir:source [
fhir:context [ fhir:v "value" ] ;
fhir:element [ fhir:v "displayName" ] ;
fhir:variable [ fhir:v "display" ]                 ] ) ;
                ( fhir:target [
fhir:context [ fhir:v "coding" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "display" ] ;
fhir:transform [ fhir:v "cast" ] ;
                  ( fhir:parameter [
fhir:value [ fhir:v "display" ]                   ] [
fhir:value [ fhir:v "string" ]                   ] )                 ] )               ] )             ] )           ] )         ] )       ] )     ] [
fhir:name [ fhir:v "valueQuantity" ] ;
      ( fhir:source [
fhir:context [ fhir:v "obs" ] ;
fhir:type [ fhir:v "PQ" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:variable [ fhir:v "val" ]       ] ) ;
      ( fhir:rule [
fhir:name [ fhir:v "quantity" ] ;
        ( fhir:source [
fhir:context [ fhir:v "val" ]         ] ) ;
        ( fhir:target [
fhir:context [ fhir:v "ob" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:variable [ fhir:v "quantity" ] ;
fhir:transform [ fhir:v "create" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "Quantity" ]           ] )         ] ) ;
        ( fhir:rule [
fhir:name [ fhir:v "value" ] ;
          ( fhir:source [
fhir:context [ fhir:v "val" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:variable [ fhir:v "value" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "quantity" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:transform [ fhir:v "copy" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "value" ]             ] )           ] )         ] [
fhir:name [ fhir:v "unit" ] ;
          ( fhir:source [
fhir:context [ fhir:v "val" ] ;
fhir:element [ fhir:v "unit" ] ;
fhir:variable [ fhir:v "unit" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "quantity" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "unit" ] ;
fhir:transform [ fhir:v "copy" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "unit" ]             ] )           ] )         ] )       ] )     ] [
fhir:name [ fhir:v "value" ] ;
      ( fhir:source [
fhir:context [ fhir:v "obs" ] ;
fhir:type [ fhir:v "ST" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:variable [ fhir:v "value" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "ob" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:transform [ fhir:v "create" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "string" ]         ] )       ] [
fhir:context [ fhir:v "ob" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "value.dataString" ]         ] )       ] )     ] [
fhir:name [ fhir:v "interpretationCode" ] ;
      ( fhir:source [
fhir:context [ fhir:v "obs" ] ;
fhir:element [ fhir:v "interpretationCode" ] ;
fhir:variable [ fhir:v "vvv" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "ob" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "interpretation" ] ;
fhir:variable [ fhir:v "vvv" ] ;
fhir:transform [ fhir:v "create" ]       ] )     ] [
fhir:name [ fhir:v "methodCode" ] ;
      ( fhir:source [
fhir:context [ fhir:v "obs" ] ;
fhir:element [ fhir:v "methodCode" ] ;
fhir:variable [ fhir:v "vvv" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "ob" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "method" ] ;
fhir:variable [ fhir:v "vvv" ] ;
fhir:transform [ fhir:v "create" ]       ] )     ] [
fhir:name [ fhir:v "refRange" ] ;
      ( fhir:source [
fhir:context [ fhir:v "obs" ] ;
fhir:element [ fhir:v "referenceRange" ] ;
fhir:variable [ fhir:v "refRange" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "ob" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "referenceRange" ] ;
fhir:variable [ fhir:v "ref" ] ;
fhir:transform [ fhir:v "create" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "BackboneElement" ]         ] )       ] ) ;
      ( fhir:rule [
fhir:name [ fhir:v "obsRange" ] ;
        ( fhir:source [
fhir:context [ fhir:v "refRange" ] ;
fhir:element [ fhir:v "observationRange" ] ;
fhir:variable [ fhir:v "obsRange" ]         ] ) ;
        ( fhir:target [
fhir:context [ fhir:v "ref" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "low" ] ;
fhir:variable [ fhir:v "Low" ] ;
fhir:transform [ fhir:v "create" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "SimpleQuantity" ]           ] )         ] ) ;
        ( fhir:rule [
fhir:name [ fhir:v "IVLPQ" ] ;
          ( fhir:source [
fhir:context [ fhir:v "obsRange" ] ;
fhir:type [ fhir:v "IVL_PQ" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:variable [ fhir:v "v" ]           ] ) ;
          ( fhir:rule [
fhir:name [ fhir:v "decValue" ] ;
            ( fhir:source [
fhir:context [ fhir:v "v" ] ;
fhir:element [ fhir:v "low" ] ;
fhir:variable [ fhir:v "l1" ]             ] ) ;
            ( fhir:rule [
fhir:name [ fhir:v "value" ] ;
              ( fhir:source [
fhir:context [ fhir:v "l1" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:variable [ fhir:v "decValue" ]               ] ) ;
              ( fhir:target [
fhir:context [ fhir:v "Low" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:transform [ fhir:v "copy" ] ;
                ( fhir:parameter [
fhir:value [ fhir:v "decValue" ]                 ] )               ] )             ] [
fhir:name [ fhir:v "unit" ] ;
              ( fhir:source [
fhir:context [ fhir:v "l1" ] ;
fhir:element [ fhir:v "unit" ] ;
fhir:variable [ fhir:v "Unit" ]               ] ) ;
              ( fhir:target [
fhir:context [ fhir:v "Low" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "unit" ] ;
fhir:transform [ fhir:v "copy" ] ;
                ( fhir:parameter [
fhir:value [ fhir:v "Unit" ]                 ] )               ] )             ] )           ] )         ] )       ] )     ] )
  ] [
fhir:name [ fhir:v "ObservationConsulenza" ] ;
fhir:typeMode [ fhir:v "none" ] ;
    ( fhir:input [
fhir:name [ fhir:v "obs" ] ;
fhir:type [ fhir:v "Observation" ] ;
fhir:mode [ fhir:v "source" ]     ] [
fhir:name [ fhir:v "patient" ] ;
fhir:type [ fhir:v "Patient" ] ;
fhir:mode [ fhir:v "target" ]     ] [
fhir:name [ fhir:v "encounter" ] ;
fhir:type [ fhir:v "Encounter" ] ;
fhir:mode [ fhir:v "target" ]     ] [
fhir:name [ fhir:v "ob" ] ;
fhir:type [ fhir:v "Observation" ] ;
fhir:mode [ fhir:v "target" ]     ] [
fhir:name [ fhir:v "bundle" ] ;
fhir:type [ fhir:v "Bundle" ] ;
fhir:mode [ fhir:v "target" ]     ] ) ;
    ( fhir:rule [
fhir:name [ fhir:v "reference" ] ;
      ( fhir:source [
fhir:context [ fhir:v "obs" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "ob" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "subject" ] ;
fhir:variable [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "create" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "Reference" ]         ] )       ] [
fhir:context [ fhir:v "reference" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "'https://example/Patient/' + %patient.id" ]         ] )       ] )     ] [
fhir:name [ fhir:v "reference" ] ;
      ( fhir:source [
fhir:context [ fhir:v "obs" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "ob" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "encounter" ] ;
fhir:variable [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "create" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "Reference" ]         ] )       ] [
fhir:context [ fhir:v "reference" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "'https://example/Encounter/' + %encounter.id" ]         ] )       ] )     ] [
fhir:name [ fhir:v "code" ] ;
      ( fhir:source [
fhir:context [ fhir:v "obs" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "vvv" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "ob" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "vvv" ] ;
fhir:transform [ fhir:v "create" ]       ] )     ] [
fhir:name [ fhir:v "statusCode" ] ;
      ( fhir:source [
fhir:context [ fhir:v "obs" ] ;
fhir:element [ fhir:v "statusCode" ] ;
fhir:variable [ fhir:v "statusc" ] ;
fhir:condition [ fhir:v "(code = 'completed')" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "ob" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "status" ] ;
fhir:transform [ fhir:v "copy" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "final" ]         ] )       ] )     ] [
fhir:name [ fhir:v "statusCode" ] ;
      ( fhir:source [
fhir:context [ fhir:v "obs" ] ;
fhir:element [ fhir:v "statusCode" ] ;
fhir:variable [ fhir:v "statusc" ] ;
fhir:condition [ fhir:v "(code = 'active')" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "ob" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "status" ] ;
fhir:transform [ fhir:v "copy" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "registered" ]         ] )       ] )     ] [
fhir:name [ fhir:v "statusCode" ] ;
      ( fhir:source [
fhir:context [ fhir:v "obs" ] ;
fhir:element [ fhir:v "statusCode" ] ;
fhir:variable [ fhir:v "statusc" ] ;
fhir:condition [ fhir:v "(code = 'aborted')" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "ob" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "status" ] ;
fhir:transform [ fhir:v "copy" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "cancelled" ]         ] )       ] )     ] [
fhir:name [ fhir:v "statusCode" ] ;
      ( fhir:source [
fhir:context [ fhir:v "obs" ] ;
fhir:element [ fhir:v "statusCode" ] ;
fhir:variable [ fhir:v "statusc" ] ;
fhir:condition [ fhir:v "(code = 'suspended')" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "ob" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "status" ] ;
fhir:transform [ fhir:v "copy" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "partial" ]         ] )       ] )     ] [
fhir:name [ fhir:v "statuscode" ] ;
      ( fhir:source [
fhir:context [ fhir:v "obs" ] ;
fhir:condition [ fhir:v "obs.statusCode.exists().not()" ]       ] ) ;
      ( fhir:rule [
fhir:name [ fhir:v "status" ] ;
        ( fhir:source [
fhir:context [ fhir:v "obs" ]         ] ) ;
        ( fhir:target [
fhir:context [ fhir:v "ob" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "status" ] ;
fhir:transform [ fhir:v "copy" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "final" ]           ] )         ] )       ] )     ] [
fhir:name [ fhir:v "value2c" ] ;
      ( fhir:source [
fhir:context [ fhir:v "obs" ] ;
fhir:element [ fhir:v "effectiveTime" ] ;
fhir:variable [ fhir:v "effectiveTime" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "ob" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "effective" ] ;
fhir:variable [ fhir:v "value" ] ;
fhir:transform [ fhir:v "create" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "dateTime" ]         ] )       ] ) ;
      ( fhir:dependent [
fhir:name [ fhir:v "TSDateTime" ] ;
        ( fhir:variable [ fhir:v "effectiveTime" ] [ fhir:v "value" ] )       ] )     ] [
fhir:name [ fhir:v "where" ] ;
      ( fhir:source [
fhir:context [ fhir:v "obs" ] ;
fhir:condition [ fhir:v "effectiveTime.low.exists() or effectiveTime.high.exists()" ]       ] ) ;
      ( fhir:rule [
fhir:name [ fhir:v "value3c" ] ;
        ( fhir:source [
fhir:context [ fhir:v "obs" ] ;
fhir:element [ fhir:v "effectiveTime" ] ;
fhir:variable [ fhir:v "eff" ]         ] ) ;
        ( fhir:target [
fhir:context [ fhir:v "ob" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "effective" ] ;
fhir:variable [ fhir:v "period" ] ;
fhir:transform [ fhir:v "create" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "Period" ]           ] )         ] ) ;
        ( fhir:dependent [
fhir:name [ fhir:v "IVLTSPeriod" ] ;
          ( fhir:variable [ fhir:v "eff" ] [ fhir:v "period" ] )         ] )       ] )     ] [
fhir:name [ fhir:v "value" ] ;
      ( fhir:source [
fhir:context [ fhir:v "obs" ] ;
fhir:type [ fhir:v "INT" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:variable [ fhir:v "int" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "ob" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "int.value" ]         ] )       ] )     ] [
fhir:name [ fhir:v "boolean" ] ;
      ( fhir:source [
fhir:context [ fhir:v "obs" ] ;
fhir:type [ fhir:v "BL" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:variable [ fhir:v "boolean" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "ob" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "boolean.value" ]         ] )       ] )     ] [
fhir:name [ fhir:v "val" ] ;
      ( fhir:source [
fhir:context [ fhir:v "obs" ] ;
fhir:type [ fhir:v "CE" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:variable [ fhir:v "val" ]       ] ) ;
      ( fhir:rule [
fhir:name [ fhir:v "coding" ] ;
        ( fhir:source [
fhir:context [ fhir:v "val" ]         ] ) ;
        ( fhir:target [
fhir:context [ fhir:v "ob" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:variable [ fhir:v "ce" ] ;
fhir:transform [ fhir:v "create" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "CodeableConcept" ]           ] )         ] ) ;
        ( fhir:rule [
fhir:name [ fhir:v "originltext" ] ;
          ( fhir:source [
fhir:context [ fhir:v "val" ] ;
fhir:element [ fhir:v "originalText" ] ;
fhir:variable [ fhir:v "originalText" ]           ] ) ;
          ( fhir:rule [
fhir:name [ fhir:v "reference" ] ;
            ( fhir:source [
fhir:context [ fhir:v "originalText" ] ;
fhir:element [ fhir:v "reference" ] ;
fhir:variable [ fhir:v "reference" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "ce" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "text" ] ;
fhir:transform [ fhir:v "copy" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "reference" ]               ] )             ] )           ] )         ] [
fhir:name [ fhir:v "code" ] ;
          ( fhir:source [
fhir:context [ fhir:v "val" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "ce" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "coding" ] ;
fhir:variable [ fhir:v "coding" ]           ] ) ;
          ( fhir:rule [
fhir:name [ fhir:v "code" ] ;
            ( fhir:source [
fhir:context [ fhir:v "val" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "code" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "coding" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:transform [ fhir:v "cast" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "code" ]               ] [
fhir:value [ fhir:v "string" ]               ] )             ] )           ] [
fhir:name [ fhir:v "codeSystem" ] ;
            ( fhir:source [
fhir:context [ fhir:v "val" ] ;
fhir:element [ fhir:v "codeSystem" ] ;
fhir:variable [ fhir:v "system" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "coding" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "system" ] ;
fhir:transform [ fhir:v "translate" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "system" ]               ] [
fhir:value [ fhir:v "http://hl7.org/fhir/ConceptMap/special-oid2uri" ]               ] [
fhir:value [ fhir:v "uri" ]               ] )             ] )           ] [
fhir:name [ fhir:v "displayName" ] ;
            ( fhir:source [
fhir:context [ fhir:v "val" ] ;
fhir:element [ fhir:v "displayName" ] ;
fhir:variable [ fhir:v "display" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "coding" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "display" ] ;
fhir:transform [ fhir:v "cast" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "display" ]               ] [
fhir:value [ fhir:v "string" ]               ] )             ] )           ] [
fhir:name [ fhir:v "codeSystemVersion" ] ;
            ( fhir:source [
fhir:context [ fhir:v "val" ] ;
fhir:element [ fhir:v "codeSystemVersion" ] ;
fhir:variable [ fhir:v "version" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "coding" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "version" ] ;
fhir:transform [ fhir:v "cast" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "version" ]               ] [
fhir:value [ fhir:v "string" ]               ] )             ] )           ] )         ] [
fhir:name [ fhir:v "translation" ] ;
          ( fhir:source [
fhir:context [ fhir:v "val" ] ;
fhir:element [ fhir:v "translation" ] ;
fhir:variable [ fhir:v "translation" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "ce" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "coding" ] ;
fhir:variable [ fhir:v "coding" ]           ] ) ;
          ( fhir:rule [
fhir:name [ fhir:v "code" ] ;
            ( fhir:source [
fhir:context [ fhir:v "translation" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "code" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "coding" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:transform [ fhir:v "cast" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "code" ]               ] [
fhir:value [ fhir:v "string" ]               ] )             ] )           ] [
fhir:name [ fhir:v "codeSystem" ] ;
            ( fhir:source [
fhir:context [ fhir:v "translation" ] ;
fhir:element [ fhir:v "codeSystem" ] ;
fhir:variable [ fhir:v "system" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "coding" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "system" ] ;
fhir:transform [ fhir:v "translate" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "system" ]               ] [
fhir:value [ fhir:v "http://hl7.org/fhir/ConceptMap/special-oid2uri" ]               ] [
fhir:value [ fhir:v "uri" ]               ] )             ] )           ] [
fhir:name [ fhir:v "displayName" ] ;
            ( fhir:source [
fhir:context [ fhir:v "translation" ] ;
fhir:element [ fhir:v "displayName" ] ;
fhir:variable [ fhir:v "display" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "coding" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "display" ] ;
fhir:transform [ fhir:v "cast" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "display" ]               ] [
fhir:value [ fhir:v "string" ]               ] )             ] )           ] [
fhir:name [ fhir:v "codeSystemVersion" ] ;
            ( fhir:source [
fhir:context [ fhir:v "translation" ] ;
fhir:element [ fhir:v "codeSystemVersion" ] ;
fhir:variable [ fhir:v "version" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "coding" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "version" ] ;
fhir:transform [ fhir:v "cast" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "version" ]               ] [
fhir:value [ fhir:v "string" ]               ] )             ] )           ] [
fhir:name [ fhir:v "qualifier" ] ;
            ( fhir:source [
fhir:context [ fhir:v "translation" ] ;
fhir:element [ fhir:v "qualifier" ] ;
fhir:variable [ fhir:v "qualifier" ]             ] ) ;
            ( fhir:rule [
fhir:name [ fhir:v "value" ] ;
              ( fhir:source [
fhir:context [ fhir:v "qualifier" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:variable [ fhir:v "value" ]               ] ) ;
              ( fhir:target [
fhir:context [ fhir:v "ce" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "coding" ] ;
fhir:variable [ fhir:v "coding" ]               ] ) ;
              ( fhir:rule [
fhir:name [ fhir:v "code" ] ;
                ( fhir:source [
fhir:context [ fhir:v "value" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "code" ]                 ] ) ;
                ( fhir:target [
fhir:context [ fhir:v "coding" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:transform [ fhir:v "cast" ] ;
                  ( fhir:parameter [
fhir:value [ fhir:v "code" ]                   ] [
fhir:value [ fhir:v "string" ]                   ] )                 ] )               ] [
fhir:name [ fhir:v "codeSystem" ] ;
                ( fhir:source [
fhir:context [ fhir:v "value" ] ;
fhir:element [ fhir:v "codeSystem" ] ;
fhir:variable [ fhir:v "system" ]                 ] ) ;
                ( fhir:target [
fhir:context [ fhir:v "coding" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "system" ] ;
fhir:transform [ fhir:v "translate" ] ;
                  ( fhir:parameter [
fhir:value [ fhir:v "system" ]                   ] [
fhir:value [ fhir:v "http://hl7.org/fhir/ConceptMap/special-oid2uri" ]                   ] [
fhir:value [ fhir:v "uri" ]                   ] )                 ] )               ] [
fhir:name [ fhir:v "displayName" ] ;
                ( fhir:source [
fhir:context [ fhir:v "value" ] ;
fhir:element [ fhir:v "displayName" ] ;
fhir:variable [ fhir:v "display" ]                 ] ) ;
                ( fhir:target [
fhir:context [ fhir:v "coding" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "display" ] ;
fhir:transform [ fhir:v "cast" ] ;
                  ( fhir:parameter [
fhir:value [ fhir:v "display" ]                   ] [
fhir:value [ fhir:v "string" ]                   ] )                 ] )               ] [
fhir:name [ fhir:v "codeSystemVersion" ] ;
                ( fhir:source [
fhir:context [ fhir:v "value" ] ;
fhir:element [ fhir:v "codeSystemVersion" ] ;
fhir:variable [ fhir:v "version" ]                 ] ) ;
                ( fhir:target [
fhir:context [ fhir:v "coding" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "version" ] ;
fhir:transform [ fhir:v "cast" ] ;
                  ( fhir:parameter [
fhir:value [ fhir:v "version" ]                   ] [
fhir:value [ fhir:v "string" ]                   ] )                 ] )               ] )             ] )           ] )         ] )       ] )     ] [
fhir:name [ fhir:v "val" ] ;
      ( fhir:source [
fhir:context [ fhir:v "obs" ] ;
fhir:type [ fhir:v "CD" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:variable [ fhir:v "val" ]       ] ) ;
      ( fhir:rule [
fhir:name [ fhir:v "coding" ] ;
        ( fhir:source [
fhir:context [ fhir:v "val" ]         ] ) ;
        ( fhir:target [
fhir:context [ fhir:v "ob" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:variable [ fhir:v "ce" ] ;
fhir:transform [ fhir:v "create" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "CodeableConcept" ]           ] )         ] ) ;
        ( fhir:rule [
fhir:name [ fhir:v "originalText" ] ;
          ( fhir:source [
fhir:context [ fhir:v "val" ] ;
fhir:element [ fhir:v "originalText" ] ;
fhir:variable [ fhir:v "vvv" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "ce" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "text" ] ;
fhir:variable [ fhir:v "vvv" ] ;
fhir:transform [ fhir:v "create" ]           ] )         ] [
fhir:name [ fhir:v "code" ] ;
          ( fhir:source [
fhir:context [ fhir:v "val" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "ce" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "coding" ] ;
fhir:variable [ fhir:v "coding" ]           ] ) ;
          ( fhir:rule [
fhir:name [ fhir:v "code" ] ;
            ( fhir:source [
fhir:context [ fhir:v "val" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "code" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "coding" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:transform [ fhir:v "cast" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "code" ]               ] [
fhir:value [ fhir:v "string" ]               ] )             ] )           ] [
fhir:name [ fhir:v "codeSystem" ] ;
            ( fhir:source [
fhir:context [ fhir:v "val" ] ;
fhir:element [ fhir:v "codeSystem" ] ;
fhir:variable [ fhir:v "system" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "coding" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "system" ] ;
fhir:transform [ fhir:v "translate" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "system" ]               ] [
fhir:value [ fhir:v "http://hl7.org/fhir/ConceptMap/special-oid2uri" ]               ] [
fhir:value [ fhir:v "uri" ]               ] )             ] )           ] [
fhir:name [ fhir:v "displayName" ] ;
            ( fhir:source [
fhir:context [ fhir:v "val" ] ;
fhir:element [ fhir:v "displayName" ] ;
fhir:variable [ fhir:v "display" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "coding" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "display" ] ;
fhir:transform [ fhir:v "cast" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "display" ]               ] [
fhir:value [ fhir:v "string" ]               ] )             ] )           ] )         ] [
fhir:name [ fhir:v "translation" ] ;
          ( fhir:source [
fhir:context [ fhir:v "val" ] ;
fhir:element [ fhir:v "translation" ] ;
fhir:variable [ fhir:v "translation" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "ce" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "coding" ] ;
fhir:variable [ fhir:v "coding" ]           ] ) ;
          ( fhir:rule [
fhir:name [ fhir:v "code" ] ;
            ( fhir:source [
fhir:context [ fhir:v "translation" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "code" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "coding" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:transform [ fhir:v "cast" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "code" ]               ] [
fhir:value [ fhir:v "string" ]               ] )             ] )           ] [
fhir:name [ fhir:v "codeSystem" ] ;
            ( fhir:source [
fhir:context [ fhir:v "translation" ] ;
fhir:element [ fhir:v "codeSystem" ] ;
fhir:variable [ fhir:v "system" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "coding" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "system" ] ;
fhir:transform [ fhir:v "translate" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "system" ]               ] [
fhir:value [ fhir:v "http://hl7.org/fhir/ConceptMap/special-oid2uri" ]               ] [
fhir:value [ fhir:v "uri" ]               ] )             ] )           ] [
fhir:name [ fhir:v "displayName" ] ;
            ( fhir:source [
fhir:context [ fhir:v "translation" ] ;
fhir:element [ fhir:v "displayName" ] ;
fhir:variable [ fhir:v "display" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "coding" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "display" ] ;
fhir:transform [ fhir:v "cast" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "display" ]               ] [
fhir:value [ fhir:v "string" ]               ] )             ] )           ] [
fhir:name [ fhir:v "qualifier" ] ;
            ( fhir:source [
fhir:context [ fhir:v "translation" ] ;
fhir:element [ fhir:v "qualifier" ] ;
fhir:variable [ fhir:v "qualifier" ]             ] ) ;
            ( fhir:rule [
fhir:name [ fhir:v "value" ] ;
              ( fhir:source [
fhir:context [ fhir:v "qualifier" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:variable [ fhir:v "value" ]               ] ) ;
              ( fhir:target [
fhir:context [ fhir:v "ce" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "coding" ] ;
fhir:variable [ fhir:v "coding" ]               ] ) ;
              ( fhir:rule [
fhir:name [ fhir:v "code" ] ;
                ( fhir:source [
fhir:context [ fhir:v "value" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "code" ]                 ] ) ;
                ( fhir:target [
fhir:context [ fhir:v "coding" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:transform [ fhir:v "cast" ] ;
                  ( fhir:parameter [
fhir:value [ fhir:v "code" ]                   ] [
fhir:value [ fhir:v "string" ]                   ] )                 ] )               ] [
fhir:name [ fhir:v "codeSystem" ] ;
                ( fhir:source [
fhir:context [ fhir:v "value" ] ;
fhir:element [ fhir:v "codeSystem" ] ;
fhir:variable [ fhir:v "system" ]                 ] ) ;
                ( fhir:target [
fhir:context [ fhir:v "coding" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "system" ] ;
fhir:transform [ fhir:v "translate" ] ;
                  ( fhir:parameter [
fhir:value [ fhir:v "system" ]                   ] [
fhir:value [ fhir:v "http://hl7.org/fhir/ConceptMap/special-oid2uri" ]                   ] [
fhir:value [ fhir:v "uri" ]                   ] )                 ] )               ] [
fhir:name [ fhir:v "displayName" ] ;
                ( fhir:source [
fhir:context [ fhir:v "value" ] ;
fhir:element [ fhir:v "displayName" ] ;
fhir:variable [ fhir:v "display" ]                 ] ) ;
                ( fhir:target [
fhir:context [ fhir:v "coding" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "display" ] ;
fhir:transform [ fhir:v "cast" ] ;
                  ( fhir:parameter [
fhir:value [ fhir:v "display" ]                   ] [
fhir:value [ fhir:v "string" ]                   ] )                 ] )               ] )             ] )           ] )         ] )       ] )     ] [
fhir:name [ fhir:v "valueQuantity" ] ;
      ( fhir:source [
fhir:context [ fhir:v "obs" ] ;
fhir:type [ fhir:v "PQ" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:variable [ fhir:v "val" ]       ] ) ;
      ( fhir:rule [
fhir:name [ fhir:v "quantity" ] ;
        ( fhir:source [
fhir:context [ fhir:v "val" ]         ] ) ;
        ( fhir:target [
fhir:context [ fhir:v "ob" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:variable [ fhir:v "quantity" ] ;
fhir:transform [ fhir:v "create" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "Quantity" ]           ] )         ] ) ;
        ( fhir:rule [
fhir:name [ fhir:v "value" ] ;
          ( fhir:source [
fhir:context [ fhir:v "val" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:variable [ fhir:v "value" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "quantity" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:transform [ fhir:v "copy" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "value" ]             ] )           ] )         ] [
fhir:name [ fhir:v "unit" ] ;
          ( fhir:source [
fhir:context [ fhir:v "val" ] ;
fhir:element [ fhir:v "unit" ] ;
fhir:variable [ fhir:v "unit" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "quantity" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "unit" ] ;
fhir:transform [ fhir:v "copy" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "unit" ]             ] )           ] )         ] )       ] )     ] [
fhir:name [ fhir:v "value" ] ;
      ( fhir:source [
fhir:context [ fhir:v "obs" ] ;
fhir:type [ fhir:v "ST" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:variable [ fhir:v "value" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "ob" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:transform [ fhir:v "create" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "string" ]         ] )       ] [
fhir:context [ fhir:v "ob" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "value.dataString" ]         ] )       ] )     ] [
fhir:name [ fhir:v "reference" ] ;
      ( fhir:source [
fhir:context [ fhir:v "obs" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "ob" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "subject" ] ;
fhir:variable [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "create" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "Reference" ]         ] )       ] [
fhir:context [ fhir:v "reference" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "'https://example/Patient/' + %patient.id" ]         ] )       ] )     ] [
fhir:name [ fhir:v "reference" ] ;
      ( fhir:source [
fhir:context [ fhir:v "obs" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "ob" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "encounter" ] ;
fhir:variable [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "create" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "Reference" ]         ] )       ] [
fhir:context [ fhir:v "reference" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "'https://example/Encounter/' + %encounter.id" ]         ] )       ] )     ] [
fhir:name [ fhir:v "interpretationCode" ] ;
      ( fhir:source [
fhir:context [ fhir:v "obs" ] ;
fhir:element [ fhir:v "interpretationCode" ] ;
fhir:variable [ fhir:v "vvv" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "ob" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "interpretation" ] ;
fhir:variable [ fhir:v "vvv" ] ;
fhir:transform [ fhir:v "create" ]       ] )     ] [
fhir:name [ fhir:v "methodCode" ] ;
      ( fhir:source [
fhir:context [ fhir:v "obs" ] ;
fhir:element [ fhir:v "methodCode" ] ;
fhir:variable [ fhir:v "vvv" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "ob" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "method" ] ;
fhir:variable [ fhir:v "vvv" ] ;
fhir:transform [ fhir:v "create" ]       ] )     ] [
fhir:name [ fhir:v "refRange" ] ;
      ( fhir:source [
fhir:context [ fhir:v "obs" ] ;
fhir:element [ fhir:v "referenceRange" ] ;
fhir:variable [ fhir:v "refRange" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "ob" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "referenceRange" ] ;
fhir:variable [ fhir:v "ref" ] ;
fhir:transform [ fhir:v "create" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "BackboneElement" ]         ] )       ] ) ;
      ( fhir:rule [
fhir:name [ fhir:v "obsRange" ] ;
        ( fhir:source [
fhir:context [ fhir:v "refRange" ] ;
fhir:element [ fhir:v "observationRange" ] ;
fhir:variable [ fhir:v "obsRange" ]         ] ) ;
        ( fhir:target [
fhir:context [ fhir:v "ref" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "low" ] ;
fhir:variable [ fhir:v "Low" ] ;
fhir:transform [ fhir:v "create" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "SimpleQuantity" ]           ] )         ] ) ;
        ( fhir:rule [
fhir:name [ fhir:v "IVLPQ" ] ;
          ( fhir:source [
fhir:context [ fhir:v "obsRange" ] ;
fhir:type [ fhir:v "IVL_PQ" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:variable [ fhir:v "v" ]           ] ) ;
          ( fhir:rule [
fhir:name [ fhir:v "decValue" ] ;
            ( fhir:source [
fhir:context [ fhir:v "v" ] ;
fhir:element [ fhir:v "low" ] ;
fhir:variable [ fhir:v "l1" ]             ] ) ;
            ( fhir:rule [
fhir:name [ fhir:v "value" ] ;
              ( fhir:source [
fhir:context [ fhir:v "l1" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:variable [ fhir:v "decValue" ]               ] ) ;
              ( fhir:target [
fhir:context [ fhir:v "Low" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:transform [ fhir:v "copy" ] ;
                ( fhir:parameter [
fhir:value [ fhir:v "decValue" ]                 ] )               ] )             ] [
fhir:name [ fhir:v "unit" ] ;
              ( fhir:source [
fhir:context [ fhir:v "l1" ] ;
fhir:element [ fhir:v "unit" ] ;
fhir:variable [ fhir:v "Unit" ]               ] ) ;
              ( fhir:target [
fhir:context [ fhir:v "Low" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "unit" ] ;
fhir:transform [ fhir:v "copy" ] ;
                ( fhir:parameter [
fhir:value [ fhir:v "Unit" ]                 ] )               ] )             ] )           ] )         ] )       ] )     ] [
fhir:name [ fhir:v "perf" ] ;
      ( fhir:source [
fhir:context [ fhir:v "obs" ] ;
fhir:element [ fhir:v "performer" ] ;
fhir:variable [ fhir:v "performer" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "bundle" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "entry" ] ;
fhir:variable [ fhir:v "e1" ]       ] [
fhir:context [ fhir:v "e1" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "request" ] ;
fhir:variable [ fhir:v "request" ] ;
fhir:transform [ fhir:v "create" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "BackboneElement" ]         ] )       ] [
fhir:context [ fhir:v "request" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "method" ] ;
fhir:transform [ fhir:v "copy" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "PUT" ]         ] )       ] [
fhir:context [ fhir:v "e1" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "resource" ] ;
fhir:variable [ fhir:v "practitioner" ] ;
fhir:transform [ fhir:v "create" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "Practitioner" ]         ] )       ] [
fhir:context [ fhir:v "practitioner" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "id" ] ;
fhir:variable [ fhir:v "uuid1" ] ;
fhir:transform [ fhir:v "uuid" ]       ] ) ;
      ( fhir:rule [
fhir:name [ fhir:v "assEntity" ] ;
        ( fhir:source [
fhir:context [ fhir:v "performer" ] ;
fhir:element [ fhir:v "assignedEntity" ] ;
fhir:variable [ fhir:v "assEntity" ]         ] ) ;
        ( fhir:rule [
fhir:name [ fhir:v "meta" ] ;
          ( fhir:source [
fhir:context [ fhir:v "assEntity" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "practitioner" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "meta" ] ;
fhir:variable [ fhir:v "meta" ]           ] ) ;
          ( fhir:rule [
fhir:name [ fhir:v "coding" ] ;
            ( fhir:source [
fhir:context [ fhir:v "assEntity" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "meta" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "tag" ] ;
fhir:variable [ fhir:v "coding" ] ;
fhir:transform [ fhir:v "create" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "Coding" ]               ] )             ] ) ;
            ( fhir:rule [
fhir:name [ fhir:v "system" ] ;
              ( fhir:source [
fhir:context [ fhir:v "assEntity" ]               ] ) ;
              ( fhir:target [
fhir:context [ fhir:v "coding" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "system" ] ;
fhir:transform [ fhir:v "copy" ] ;
                ( fhir:parameter [
fhir:value [ fhir:v "http://algoritmodiscoring" ]                 ] )               ] )             ] [
fhir:name [ fhir:v "code" ] ;
              ( fhir:source [
fhir:context [ fhir:v "assEntity" ]               ] ) ;
              ( fhir:target [
fhir:context [ fhir:v "coding" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:transform [ fhir:v "copy" ] ;
                ( fhir:parameter [
fhir:value [ fhir:v "ClinicalDocument/body/Consulenza/performer" ]                 ] )               ] )             ] )           ] )         ] [
fhir:name [ fhir:v "identifier" ] ;
          ( fhir:source [
fhir:context [ fhir:v "assEntity" ] ;
fhir:element [ fhir:v "id" ] ;
fhir:variable [ fhir:v "id" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "practitioner" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "identifier" ] ;
fhir:variable [ fhir:v "identifier" ]           ] ) ;
          ( fhir:rule [
fhir:name [ fhir:v "root1" ] ;
            ( fhir:source [
fhir:context [ fhir:v "id" ] ;
fhir:element [ fhir:v "root" ] ;
fhir:variable [ fhir:v "r" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "identifier" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "system" ] ;
fhir:transform [ fhir:v "translate" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "r" ]               ] [
fhir:value [ fhir:v "http://hl7.org/fhir/ConceptMap/special-oid2uri" ]               ] [
fhir:value [ fhir:v "uri" ]               ] )             ] )           ] [
fhir:name [ fhir:v "extension" ] ;
            ( fhir:source [
fhir:context [ fhir:v "id" ] ;
fhir:element [ fhir:v "extension" ] ;
fhir:variable [ fhir:v "ext" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "identifier" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:transform [ fhir:v "copy" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "ext" ]               ] )             ] )           ] [
fhir:name [ fhir:v "assigningAuthorityName" ] ;
            ( fhir:source [
fhir:context [ fhir:v "id" ] ;
fhir:element [ fhir:v "assigningAuthorityName" ] ;
fhir:variable [ fhir:v "s" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "identifier" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "assigner" ] ;
fhir:variable [ fhir:v "a" ]             ] [
fhir:context [ fhir:v "a" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "display" ] ;
fhir:transform [ fhir:v "copy" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "s" ]               ] )             ] )           ] [
fhir:name [ fhir:v "r" ] ;
            ( fhir:source [
fhir:context [ fhir:v "id" ] ;
fhir:element [ fhir:v "root" ] ;
fhir:variable [ fhir:v "r" ]             ] ) ;
            ( fhir:rule [
fhir:name [ fhir:v "aut" ] ;
              ( fhir:source [
fhir:context [ fhir:v "id" ] ;
fhir:element [ fhir:v "extension" ] ;
fhir:variable [ fhir:v "ext" ]               ] ) ;
              ( fhir:target [
fhir:context [ fhir:v "practitioner" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "id" ] ;
fhir:variable [ fhir:v "uuid2" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
                ( fhir:parameter [
fhir:value [ fhir:v "r + '-' + ext" ]                 ] )               ] [
fhir:context [ fhir:v "e1" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "fullUrl" ] ;
fhir:transform [ fhir:v "append" ] ;
                ( fhir:parameter [
fhir:value [ fhir:v "https://example/Practitioner/" ]                 ] [
fhir:value [ fhir:v "uuid2" ]                 ] )               ] [
fhir:context [ fhir:v "ob" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "performer" ] ;
fhir:variable [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "create" ] ;
                ( fhir:parameter [
fhir:value [ fhir:v "Reference" ]                 ] )               ] [
fhir:context [ fhir:v "reference" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
                ( fhir:parameter [
fhir:value [ fhir:v "'https://example/Practitioner/' + %practitioner.id" ]                 ] )               ] )             ] )           ] )         ] [
fhir:name [ fhir:v "2.16.840.1.113883.2.9.4.3.2" ] ;
          ( fhir:source [
fhir:context [ fhir:v "assEntity" ] ;
fhir:element [ fhir:v "id" ] ;
fhir:variable [ fhir:v "id" ] ;
fhir:condition [ fhir:v "(root = '2.16.840.1.113883.2.9.4.3.2')" ]           ] ) ;
          ( fhir:rule [
fhir:name [ fhir:v "UUID" ] ;
            ( fhir:source [
fhir:context [ fhir:v "id" ] ;
fhir:element [ fhir:v "extension" ] ;
fhir:variable [ fhir:v "ext" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "request" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "url" ] ;
fhir:transform [ fhir:v "append" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "Practitioner?identifier=" ]               ] [
fhir:value [ fhir:v "ext" ]               ] )             ] )           ] )         ] [
fhir:name [ fhir:v "assi" ] ;
          ( fhir:source [
fhir:context [ fhir:v "assEntity" ] ;
fhir:element [ fhir:v "assignedPerson" ] ;
fhir:variable [ fhir:v "assi" ]           ] ) ;
          ( fhir:rule [
fhir:name [ fhir:v "name" ] ;
            ( fhir:source [
fhir:context [ fhir:v "assi" ] ;
fhir:element [ fhir:v "name" ] ;
fhir:variable [ fhir:v "vvv" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "practitioner" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "name" ] ;
fhir:variable [ fhir:v "vvv" ] ;
fhir:transform [ fhir:v "create" ]             ] )           ] )         ] )       ] )     ] [
fhir:name [ fhir:v "participant" ] ;
      ( fhir:source [
fhir:context [ fhir:v "obs" ] ;
fhir:element [ fhir:v "participant" ] ;
fhir:variable [ fhir:v "participant" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "bundle" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "entry" ] ;
fhir:variable [ fhir:v "e1" ]       ] [
fhir:context [ fhir:v "e1" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "request" ] ;
fhir:variable [ fhir:v "request" ] ;
fhir:transform [ fhir:v "create" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "BackboneElement" ]         ] )       ] [
fhir:context [ fhir:v "request" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "method" ] ;
fhir:transform [ fhir:v "copy" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "POST" ]         ] )       ] [
fhir:context [ fhir:v "e1" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "resource" ] ;
fhir:variable [ fhir:v "serviceRequest" ] ;
fhir:transform [ fhir:v "create" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "ServiceRequest" ]         ] )       ] [
fhir:context [ fhir:v "serviceRequest" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "id" ] ;
fhir:variable [ fhir:v "uuid1" ] ;
fhir:transform [ fhir:v "uuid" ]       ] [
fhir:context [ fhir:v "e1" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "fullUrl" ] ;
fhir:transform [ fhir:v "append" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "https://example/ServiceRequest/" ]         ] [
fhir:value [ fhir:v "uuid1" ]         ] )       ] [
fhir:context [ fhir:v "request" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "url" ] ;
fhir:transform [ fhir:v "copy" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "ServiceRequest" ]         ] )       ] [
fhir:context [ fhir:v "ob" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "basedOn" ] ;
fhir:variable [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "create" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "Reference" ]         ] )       ] [
fhir:context [ fhir:v "reference" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "'https://example/ServiceRequest/' + %serviceRequest.id" ]         ] )       ] ) ;
      ( fhir:rule [
fhir:name [ fhir:v "time" ] ;
        ( fhir:source [
fhir:context [ fhir:v "participant" ] ;
fhir:element [ fhir:v "time" ] ;
fhir:variable [ fhir:v "t" ]         ] ) ;
        ( fhir:target [
fhir:context [ fhir:v "serviceRequest" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "authoredOn" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "t.value" ]           ] )         ] )       ] [
fhir:name [ fhir:v "reference" ] ;
        ( fhir:source [
fhir:context [ fhir:v "obs" ]         ] ) ;
        ( fhir:target [
fhir:context [ fhir:v "serviceRequest" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "subject" ] ;
fhir:variable [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "create" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "Reference" ]           ] )         ] [
fhir:context [ fhir:v "reference" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "'https://example/Patient/' + %patient.id" ]           ] )         ] )       ] [
fhir:name [ fhir:v "reference" ] ;
        ( fhir:source [
fhir:context [ fhir:v "obs" ]         ] ) ;
        ( fhir:target [
fhir:context [ fhir:v "serviceRequest" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "encounter" ] ;
fhir:variable [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "create" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "Reference" ]           ] )         ] [
fhir:context [ fhir:v "reference" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "'https://example/Encounter/' + %encounter.id" ]           ] )         ] )       ] [
fhir:name [ fhir:v "status" ] ;
        ( fhir:source [
fhir:context [ fhir:v "obs" ]         ] ) ;
        ( fhir:target [
fhir:context [ fhir:v "serviceRequest" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "status" ] ;
fhir:transform [ fhir:v "copy" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "active" ]           ] )         ] )       ] [
fhir:name [ fhir:v "intent" ] ;
        ( fhir:source [
fhir:context [ fhir:v "obs" ]         ] ) ;
        ( fhir:target [
fhir:context [ fhir:v "serviceRequest" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "intent" ] ;
fhir:transform [ fhir:v "copy" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "order" ]           ] )         ] )       ] [
fhir:name [ fhir:v "participantRole" ] ;
        ( fhir:source [
fhir:context [ fhir:v "participant" ] ;
fhir:element [ fhir:v "participantRole" ] ;
fhir:variable [ fhir:v "participantRole" ]         ] ) ;
        ( fhir:target [
fhir:context [ fhir:v "bundle" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "entry" ] ;
fhir:variable [ fhir:v "e1" ]         ] [
fhir:context [ fhir:v "e1" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "request" ] ;
fhir:variable [ fhir:v "request" ] ;
fhir:transform [ fhir:v "create" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "BackboneElement" ]           ] )         ] [
fhir:context [ fhir:v "request" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "method" ] ;
fhir:transform [ fhir:v "copy" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "PUT" ]           ] )         ] [
fhir:context [ fhir:v "e1" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "resource" ] ;
fhir:variable [ fhir:v "practitioner" ] ;
fhir:transform [ fhir:v "create" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "Practitioner" ]           ] )         ] ) ;
        ( fhir:rule [
fhir:name [ fhir:v "meta" ] ;
          ( fhir:source [
fhir:context [ fhir:v "participantRole" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "practitioner" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "meta" ] ;
fhir:variable [ fhir:v "meta" ]           ] ) ;
          ( fhir:rule [
fhir:name [ fhir:v "coding" ] ;
            ( fhir:source [
fhir:context [ fhir:v "participantRole" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "meta" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "tag" ] ;
fhir:variable [ fhir:v "coding" ] ;
fhir:transform [ fhir:v "create" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "Coding" ]               ] )             ] ) ;
            ( fhir:rule [
fhir:name [ fhir:v "system" ] ;
              ( fhir:source [
fhir:context [ fhir:v "participantRole" ]               ] ) ;
              ( fhir:target [
fhir:context [ fhir:v "coding" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "system" ] ;
fhir:transform [ fhir:v "copy" ] ;
                ( fhir:parameter [
fhir:value [ fhir:v "http://algoritmodiscoring" ]                 ] )               ] )             ] [
fhir:name [ fhir:v "code" ] ;
              ( fhir:source [
fhir:context [ fhir:v "participantRole" ]               ] ) ;
              ( fhir:target [
fhir:context [ fhir:v "coding" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:transform [ fhir:v "copy" ] ;
                ( fhir:parameter [
fhir:value [ fhir:v "ClinicalDocument/body/Consulenza/participant" ]                 ] )               ] )             ] )           ] )         ] [
fhir:name [ fhir:v "identifier" ] ;
          ( fhir:source [
fhir:context [ fhir:v "participantRole" ] ;
fhir:element [ fhir:v "id" ] ;
fhir:variable [ fhir:v "id" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "practitioner" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "identifier" ] ;
fhir:variable [ fhir:v "identifier" ]           ] ) ;
          ( fhir:rule [
fhir:name [ fhir:v "root1" ] ;
            ( fhir:source [
fhir:context [ fhir:v "id" ] ;
fhir:element [ fhir:v "root" ] ;
fhir:variable [ fhir:v "r" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "identifier" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "system" ] ;
fhir:transform [ fhir:v "translate" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "r" ]               ] [
fhir:value [ fhir:v "http://hl7.org/fhir/ConceptMap/special-oid2uri" ]               ] [
fhir:value [ fhir:v "uri" ]               ] )             ] )           ] [
fhir:name [ fhir:v "extension" ] ;
            ( fhir:source [
fhir:context [ fhir:v "id" ] ;
fhir:element [ fhir:v "extension" ] ;
fhir:variable [ fhir:v "ext" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "identifier" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:transform [ fhir:v "copy" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "ext" ]               ] )             ] )           ] [
fhir:name [ fhir:v "assigningAuthorityName" ] ;
            ( fhir:source [
fhir:context [ fhir:v "id" ] ;
fhir:element [ fhir:v "assigningAuthorityName" ] ;
fhir:variable [ fhir:v "s" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "identifier" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "assigner" ] ;
fhir:variable [ fhir:v "a" ]             ] [
fhir:context [ fhir:v "a" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "display" ] ;
fhir:transform [ fhir:v "copy" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "s" ]               ] )             ] )           ] [
fhir:name [ fhir:v "r" ] ;
            ( fhir:source [
fhir:context [ fhir:v "id" ] ;
fhir:element [ fhir:v "root" ] ;
fhir:variable [ fhir:v "r" ]             ] ) ;
            ( fhir:rule [
fhir:name [ fhir:v "aut" ] ;
              ( fhir:source [
fhir:context [ fhir:v "id" ] ;
fhir:element [ fhir:v "extension" ] ;
fhir:variable [ fhir:v "ext" ]               ] ) ;
              ( fhir:target [
fhir:context [ fhir:v "practitioner" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "id" ] ;
fhir:variable [ fhir:v "uuid3" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
                ( fhir:parameter [
fhir:value [ fhir:v "r + '-' + ext" ]                 ] )               ] [
fhir:context [ fhir:v "e1" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "fullUrl" ] ;
fhir:transform [ fhir:v "append" ] ;
                ( fhir:parameter [
fhir:value [ fhir:v "https://example/Practitioner/" ]                 ] [
fhir:value [ fhir:v "uuid3" ]                 ] )               ] [
fhir:context [ fhir:v "serviceRequest" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "performer" ] ;
fhir:variable [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "create" ] ;
                ( fhir:parameter [
fhir:value [ fhir:v "Reference" ]                 ] )               ] [
fhir:context [ fhir:v "reference" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
                ( fhir:parameter [
fhir:value [ fhir:v "'https://example/Practitioner/' + %practitioner.id" ]                 ] )               ] )             ] )           ] )         ] [
fhir:name [ fhir:v "2.16.840.1.113883.2.9.4.3.2" ] ;
          ( fhir:source [
fhir:context [ fhir:v "participantRole" ] ;
fhir:element [ fhir:v "id" ] ;
fhir:variable [ fhir:v "id" ] ;
fhir:condition [ fhir:v "(root = '2.16.840.1.113883.2.9.4.3.2')" ]           ] ) ;
          ( fhir:rule [
fhir:name [ fhir:v "UUID" ] ;
            ( fhir:source [
fhir:context [ fhir:v "id" ] ;
fhir:element [ fhir:v "extension" ] ;
fhir:variable [ fhir:v "ext" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "request" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "url" ] ;
fhir:transform [ fhir:v "append" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "Practitioner?identifier=" ]               ] [
fhir:value [ fhir:v "ext" ]               ] )             ] )           ] )         ] [
fhir:name [ fhir:v "pe" ] ;
          ( fhir:source [
fhir:context [ fhir:v "participantRole" ] ;
fhir:element [ fhir:v "playingEntity" ] ;
fhir:variable [ fhir:v "pe" ]           ] ) ;
          ( fhir:rule [
fhir:name [ fhir:v "name" ] ;
            ( fhir:source [
fhir:context [ fhir:v "pe" ] ;
fhir:element [ fhir:v "name" ] ;
fhir:variable [ fhir:v "vvv" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "practitioner" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "name" ] ;
fhir:variable [ fhir:v "vvv" ] ;
fhir:transform [ fhir:v "create" ]             ] )           ] )         ] )       ] )     ] )
  ] [
fhir:name [ fhir:v "ObservationEsamiDuranteRicovero" ] ;
fhir:typeMode [ fhir:v "none" ] ;
    ( fhir:input [
fhir:name [ fhir:v "obs" ] ;
fhir:type [ fhir:v "Observation" ] ;
fhir:mode [ fhir:v "source" ]     ] [
fhir:name [ fhir:v "patient" ] ;
fhir:type [ fhir:v "Patient" ] ;
fhir:mode [ fhir:v "target" ]     ] [
fhir:name [ fhir:v "encounter" ] ;
fhir:type [ fhir:v "Encounter" ] ;
fhir:mode [ fhir:v "target" ]     ] [
fhir:name [ fhir:v "ob" ] ;
fhir:type [ fhir:v "Observation" ] ;
fhir:mode [ fhir:v "target" ]     ] [
fhir:name [ fhir:v "bundle" ] ;
fhir:type [ fhir:v "Bundle" ] ;
fhir:mode [ fhir:v "target" ]     ] ) ;
    ( fhir:rule [
fhir:name [ fhir:v "reference" ] ;
      ( fhir:source [
fhir:context [ fhir:v "obs" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "ob" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "subject" ] ;
fhir:variable [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "create" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "Reference" ]         ] )       ] [
fhir:context [ fhir:v "reference" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "'https://example/Patient/' + %patient.id" ]         ] )       ] )     ] [
fhir:name [ fhir:v "reference" ] ;
      ( fhir:source [
fhir:context [ fhir:v "obs" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "ob" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "encounter" ] ;
fhir:variable [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "create" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "Reference" ]         ] )       ] [
fhir:context [ fhir:v "reference" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "'https://example/Encounter/' + %encounter.id" ]         ] )       ] )     ] [
fhir:name [ fhir:v "code" ] ;
      ( fhir:source [
fhir:context [ fhir:v "obs" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "vvv" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "ob" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "vvv" ] ;
fhir:transform [ fhir:v "create" ]       ] )     ] [
fhir:name [ fhir:v "statusCode" ] ;
      ( fhir:source [
fhir:context [ fhir:v "obs" ] ;
fhir:element [ fhir:v "statusCode" ] ;
fhir:variable [ fhir:v "statusc" ] ;
fhir:condition [ fhir:v "(code = 'completed')" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "ob" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "status" ] ;
fhir:transform [ fhir:v "copy" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "final" ]         ] )       ] )     ] [
fhir:name [ fhir:v "statusCode" ] ;
      ( fhir:source [
fhir:context [ fhir:v "obs" ] ;
fhir:element [ fhir:v "statusCode" ] ;
fhir:variable [ fhir:v "statusc" ] ;
fhir:condition [ fhir:v "(code = 'active')" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "ob" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "status" ] ;
fhir:transform [ fhir:v "copy" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "registered" ]         ] )       ] )     ] [
fhir:name [ fhir:v "statusCode" ] ;
      ( fhir:source [
fhir:context [ fhir:v "obs" ] ;
fhir:element [ fhir:v "statusCode" ] ;
fhir:variable [ fhir:v "statusc" ] ;
fhir:condition [ fhir:v "(code = 'aborted')" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "ob" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "status" ] ;
fhir:transform [ fhir:v "copy" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "cancelled" ]         ] )       ] )     ] [
fhir:name [ fhir:v "statusCode" ] ;
      ( fhir:source [
fhir:context [ fhir:v "obs" ] ;
fhir:element [ fhir:v "statusCode" ] ;
fhir:variable [ fhir:v "statusc" ] ;
fhir:condition [ fhir:v "(code = 'suspended')" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "ob" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "status" ] ;
fhir:transform [ fhir:v "copy" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "partial" ]         ] )       ] )     ] [
fhir:name [ fhir:v "statuscode" ] ;
      ( fhir:source [
fhir:context [ fhir:v "obs" ] ;
fhir:condition [ fhir:v "obs.statusCode.exists().not()" ]       ] ) ;
      ( fhir:rule [
fhir:name [ fhir:v "status" ] ;
        ( fhir:source [
fhir:context [ fhir:v "obs" ]         ] ) ;
        ( fhir:target [
fhir:context [ fhir:v "ob" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "status" ] ;
fhir:transform [ fhir:v "copy" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "final" ]           ] )         ] )       ] )     ] [
fhir:name [ fhir:v "value2r" ] ;
      ( fhir:source [
fhir:context [ fhir:v "obs" ] ;
fhir:element [ fhir:v "effectiveTime" ] ;
fhir:variable [ fhir:v "effectiveTime" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "ob" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "effective" ] ;
fhir:variable [ fhir:v "value" ] ;
fhir:transform [ fhir:v "create" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "dateTime" ]         ] )       ] ) ;
      ( fhir:dependent [
fhir:name [ fhir:v "TSDateTime" ] ;
        ( fhir:variable [ fhir:v "effectiveTime" ] [ fhir:v "value" ] )       ] )     ] [
fhir:name [ fhir:v "where" ] ;
      ( fhir:source [
fhir:context [ fhir:v "obs" ] ;
fhir:condition [ fhir:v "effectiveTime.low.exists() or effectiveTime.high.exists()" ]       ] ) ;
      ( fhir:rule [
fhir:name [ fhir:v "value3r" ] ;
        ( fhir:source [
fhir:context [ fhir:v "obs" ] ;
fhir:element [ fhir:v "effectiveTime" ] ;
fhir:variable [ fhir:v "eff" ]         ] ) ;
        ( fhir:target [
fhir:context [ fhir:v "ob" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "effective" ] ;
fhir:variable [ fhir:v "period" ] ;
fhir:transform [ fhir:v "create" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "Period" ]           ] )         ] ) ;
        ( fhir:dependent [
fhir:name [ fhir:v "IVLTSPeriod" ] ;
          ( fhir:variable [ fhir:v "eff" ] [ fhir:v "period" ] )         ] )       ] )     ] [
fhir:name [ fhir:v "value" ] ;
      ( fhir:source [
fhir:context [ fhir:v "obs" ] ;
fhir:type [ fhir:v "INT" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:variable [ fhir:v "int" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "ob" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "int.value" ]         ] )       ] )     ] [
fhir:name [ fhir:v "boolean" ] ;
      ( fhir:source [
fhir:context [ fhir:v "obs" ] ;
fhir:type [ fhir:v "BL" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:variable [ fhir:v "boolean" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "ob" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "boolean.value" ]         ] )       ] )     ] [
fhir:name [ fhir:v "val" ] ;
      ( fhir:source [
fhir:context [ fhir:v "obs" ] ;
fhir:type [ fhir:v "CE" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:variable [ fhir:v "val" ]       ] ) ;
      ( fhir:rule [
fhir:name [ fhir:v "coding" ] ;
        ( fhir:source [
fhir:context [ fhir:v "val" ]         ] ) ;
        ( fhir:target [
fhir:context [ fhir:v "ob" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:variable [ fhir:v "ce" ] ;
fhir:transform [ fhir:v "create" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "CodeableConcept" ]           ] )         ] ) ;
        ( fhir:rule [
fhir:name [ fhir:v "originltext" ] ;
          ( fhir:source [
fhir:context [ fhir:v "val" ] ;
fhir:element [ fhir:v "originalText" ] ;
fhir:variable [ fhir:v "originalText" ]           ] ) ;
          ( fhir:rule [
fhir:name [ fhir:v "reference" ] ;
            ( fhir:source [
fhir:context [ fhir:v "originalText" ] ;
fhir:element [ fhir:v "reference" ] ;
fhir:variable [ fhir:v "reference" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "ce" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "text" ] ;
fhir:transform [ fhir:v "copy" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "reference" ]               ] )             ] )           ] )         ] [
fhir:name [ fhir:v "code" ] ;
          ( fhir:source [
fhir:context [ fhir:v "val" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "ce" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "coding" ] ;
fhir:variable [ fhir:v "coding" ]           ] ) ;
          ( fhir:rule [
fhir:name [ fhir:v "code" ] ;
            ( fhir:source [
fhir:context [ fhir:v "val" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "code" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "coding" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:transform [ fhir:v "cast" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "code" ]               ] [
fhir:value [ fhir:v "string" ]               ] )             ] )           ] [
fhir:name [ fhir:v "codeSystem" ] ;
            ( fhir:source [
fhir:context [ fhir:v "val" ] ;
fhir:element [ fhir:v "codeSystem" ] ;
fhir:variable [ fhir:v "system" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "coding" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "system" ] ;
fhir:transform [ fhir:v "translate" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "system" ]               ] [
fhir:value [ fhir:v "http://hl7.org/fhir/ConceptMap/special-oid2uri" ]               ] [
fhir:value [ fhir:v "uri" ]               ] )             ] )           ] [
fhir:name [ fhir:v "displayName" ] ;
            ( fhir:source [
fhir:context [ fhir:v "val" ] ;
fhir:element [ fhir:v "displayName" ] ;
fhir:variable [ fhir:v "display" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "coding" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "display" ] ;
fhir:transform [ fhir:v "cast" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "display" ]               ] [
fhir:value [ fhir:v "string" ]               ] )             ] )           ] [
fhir:name [ fhir:v "codeSystemVersion" ] ;
            ( fhir:source [
fhir:context [ fhir:v "val" ] ;
fhir:element [ fhir:v "codeSystemVersion" ] ;
fhir:variable [ fhir:v "version" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "coding" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "version" ] ;
fhir:transform [ fhir:v "cast" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "version" ]               ] [
fhir:value [ fhir:v "string" ]               ] )             ] )           ] )         ] [
fhir:name [ fhir:v "translation" ] ;
          ( fhir:source [
fhir:context [ fhir:v "val" ] ;
fhir:element [ fhir:v "translation" ] ;
fhir:variable [ fhir:v "translation" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "ce" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "coding" ] ;
fhir:variable [ fhir:v "coding" ]           ] ) ;
          ( fhir:rule [
fhir:name [ fhir:v "code" ] ;
            ( fhir:source [
fhir:context [ fhir:v "translation" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "code" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "coding" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:transform [ fhir:v "cast" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "code" ]               ] [
fhir:value [ fhir:v "string" ]               ] )             ] )           ] [
fhir:name [ fhir:v "codeSystem" ] ;
            ( fhir:source [
fhir:context [ fhir:v "translation" ] ;
fhir:element [ fhir:v "codeSystem" ] ;
fhir:variable [ fhir:v "system" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "coding" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "system" ] ;
fhir:transform [ fhir:v "translate" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "system" ]               ] [
fhir:value [ fhir:v "http://hl7.org/fhir/ConceptMap/special-oid2uri" ]               ] [
fhir:value [ fhir:v "uri" ]               ] )             ] )           ] [
fhir:name [ fhir:v "displayName" ] ;
            ( fhir:source [
fhir:context [ fhir:v "translation" ] ;
fhir:element [ fhir:v "displayName" ] ;
fhir:variable [ fhir:v "display" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "coding" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "display" ] ;
fhir:transform [ fhir:v "cast" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "display" ]               ] [
fhir:value [ fhir:v "string" ]               ] )             ] )           ] [
fhir:name [ fhir:v "codeSystemVersion" ] ;
            ( fhir:source [
fhir:context [ fhir:v "translation" ] ;
fhir:element [ fhir:v "codeSystemVersion" ] ;
fhir:variable [ fhir:v "version" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "coding" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "version" ] ;
fhir:transform [ fhir:v "cast" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "version" ]               ] [
fhir:value [ fhir:v "string" ]               ] )             ] )           ] [
fhir:name [ fhir:v "qualifier" ] ;
            ( fhir:source [
fhir:context [ fhir:v "translation" ] ;
fhir:element [ fhir:v "qualifier" ] ;
fhir:variable [ fhir:v "qualifier" ]             ] ) ;
            ( fhir:rule [
fhir:name [ fhir:v "value" ] ;
              ( fhir:source [
fhir:context [ fhir:v "qualifier" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:variable [ fhir:v "value" ]               ] ) ;
              ( fhir:target [
fhir:context [ fhir:v "ce" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "coding" ] ;
fhir:variable [ fhir:v "coding" ]               ] ) ;
              ( fhir:rule [
fhir:name [ fhir:v "code" ] ;
                ( fhir:source [
fhir:context [ fhir:v "value" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "code" ]                 ] ) ;
                ( fhir:target [
fhir:context [ fhir:v "coding" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:transform [ fhir:v "cast" ] ;
                  ( fhir:parameter [
fhir:value [ fhir:v "code" ]                   ] [
fhir:value [ fhir:v "string" ]                   ] )                 ] )               ] [
fhir:name [ fhir:v "codeSystem" ] ;
                ( fhir:source [
fhir:context [ fhir:v "value" ] ;
fhir:element [ fhir:v "codeSystem" ] ;
fhir:variable [ fhir:v "system" ]                 ] ) ;
                ( fhir:target [
fhir:context [ fhir:v "coding" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "system" ] ;
fhir:transform [ fhir:v "translate" ] ;
                  ( fhir:parameter [
fhir:value [ fhir:v "system" ]                   ] [
fhir:value [ fhir:v "http://hl7.org/fhir/ConceptMap/special-oid2uri" ]                   ] [
fhir:value [ fhir:v "uri" ]                   ] )                 ] )               ] [
fhir:name [ fhir:v "displayName" ] ;
                ( fhir:source [
fhir:context [ fhir:v "value" ] ;
fhir:element [ fhir:v "displayName" ] ;
fhir:variable [ fhir:v "display" ]                 ] ) ;
                ( fhir:target [
fhir:context [ fhir:v "coding" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "display" ] ;
fhir:transform [ fhir:v "cast" ] ;
                  ( fhir:parameter [
fhir:value [ fhir:v "display" ]                   ] [
fhir:value [ fhir:v "string" ]                   ] )                 ] )               ] [
fhir:name [ fhir:v "codeSystemVersion" ] ;
                ( fhir:source [
fhir:context [ fhir:v "value" ] ;
fhir:element [ fhir:v "codeSystemVersion" ] ;
fhir:variable [ fhir:v "version" ]                 ] ) ;
                ( fhir:target [
fhir:context [ fhir:v "coding" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "version" ] ;
fhir:transform [ fhir:v "cast" ] ;
                  ( fhir:parameter [
fhir:value [ fhir:v "version" ]                   ] [
fhir:value [ fhir:v "string" ]                   ] )                 ] )               ] )             ] )           ] )         ] )       ] )     ] [
fhir:name [ fhir:v "val" ] ;
      ( fhir:source [
fhir:context [ fhir:v "obs" ] ;
fhir:type [ fhir:v "CD" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:variable [ fhir:v "val" ]       ] ) ;
      ( fhir:rule [
fhir:name [ fhir:v "coding" ] ;
        ( fhir:source [
fhir:context [ fhir:v "val" ]         ] ) ;
        ( fhir:target [
fhir:context [ fhir:v "ob" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:variable [ fhir:v "ce" ] ;
fhir:transform [ fhir:v "create" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "CodeableConcept" ]           ] )         ] ) ;
        ( fhir:rule [
fhir:name [ fhir:v "originalText" ] ;
          ( fhir:source [
fhir:context [ fhir:v "val" ] ;
fhir:element [ fhir:v "originalText" ] ;
fhir:variable [ fhir:v "vvv" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "ce" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "text" ] ;
fhir:variable [ fhir:v "vvv" ] ;
fhir:transform [ fhir:v "create" ]           ] )         ] [
fhir:name [ fhir:v "code" ] ;
          ( fhir:source [
fhir:context [ fhir:v "val" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "ce" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "coding" ] ;
fhir:variable [ fhir:v "coding" ]           ] ) ;
          ( fhir:rule [
fhir:name [ fhir:v "code" ] ;
            ( fhir:source [
fhir:context [ fhir:v "val" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "code" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "coding" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:transform [ fhir:v "cast" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "code" ]               ] [
fhir:value [ fhir:v "string" ]               ] )             ] )           ] [
fhir:name [ fhir:v "codeSystem" ] ;
            ( fhir:source [
fhir:context [ fhir:v "val" ] ;
fhir:element [ fhir:v "codeSystem" ] ;
fhir:variable [ fhir:v "system" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "coding" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "system" ] ;
fhir:transform [ fhir:v "translate" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "system" ]               ] [
fhir:value [ fhir:v "http://hl7.org/fhir/ConceptMap/special-oid2uri" ]               ] [
fhir:value [ fhir:v "uri" ]               ] )             ] )           ] [
fhir:name [ fhir:v "displayName" ] ;
            ( fhir:source [
fhir:context [ fhir:v "val" ] ;
fhir:element [ fhir:v "displayName" ] ;
fhir:variable [ fhir:v "display" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "coding" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "display" ] ;
fhir:transform [ fhir:v "cast" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "display" ]               ] [
fhir:value [ fhir:v "string" ]               ] )             ] )           ] )         ] [
fhir:name [ fhir:v "translation" ] ;
          ( fhir:source [
fhir:context [ fhir:v "val" ] ;
fhir:element [ fhir:v "translation" ] ;
fhir:variable [ fhir:v "translation" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "ce" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "coding" ] ;
fhir:variable [ fhir:v "coding" ]           ] ) ;
          ( fhir:rule [
fhir:name [ fhir:v "code" ] ;
            ( fhir:source [
fhir:context [ fhir:v "translation" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "code" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "coding" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:transform [ fhir:v "cast" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "code" ]               ] [
fhir:value [ fhir:v "string" ]               ] )             ] )           ] [
fhir:name [ fhir:v "codeSystem" ] ;
            ( fhir:source [
fhir:context [ fhir:v "translation" ] ;
fhir:element [ fhir:v "codeSystem" ] ;
fhir:variable [ fhir:v "system" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "coding" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "system" ] ;
fhir:transform [ fhir:v "translate" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "system" ]               ] [
fhir:value [ fhir:v "http://hl7.org/fhir/ConceptMap/special-oid2uri" ]               ] [
fhir:value [ fhir:v "uri" ]               ] )             ] )           ] [
fhir:name [ fhir:v "displayName" ] ;
            ( fhir:source [
fhir:context [ fhir:v "translation" ] ;
fhir:element [ fhir:v "displayName" ] ;
fhir:variable [ fhir:v "display" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "coding" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "display" ] ;
fhir:transform [ fhir:v "cast" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "display" ]               ] [
fhir:value [ fhir:v "string" ]               ] )             ] )           ] [
fhir:name [ fhir:v "qualifier" ] ;
            ( fhir:source [
fhir:context [ fhir:v "translation" ] ;
fhir:element [ fhir:v "qualifier" ] ;
fhir:variable [ fhir:v "qualifier" ]             ] ) ;
            ( fhir:rule [
fhir:name [ fhir:v "value" ] ;
              ( fhir:source [
fhir:context [ fhir:v "qualifier" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:variable [ fhir:v "value" ]               ] ) ;
              ( fhir:target [
fhir:context [ fhir:v "ce" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "coding" ] ;
fhir:variable [ fhir:v "coding" ]               ] ) ;
              ( fhir:rule [
fhir:name [ fhir:v "code" ] ;
                ( fhir:source [
fhir:context [ fhir:v "value" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "code" ]                 ] ) ;
                ( fhir:target [
fhir:context [ fhir:v "coding" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:transform [ fhir:v "cast" ] ;
                  ( fhir:parameter [
fhir:value [ fhir:v "code" ]                   ] [
fhir:value [ fhir:v "string" ]                   ] )                 ] )               ] [
fhir:name [ fhir:v "codeSystem" ] ;
                ( fhir:source [
fhir:context [ fhir:v "value" ] ;
fhir:element [ fhir:v "codeSystem" ] ;
fhir:variable [ fhir:v "system" ]                 ] ) ;
                ( fhir:target [
fhir:context [ fhir:v "coding" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "system" ] ;
fhir:transform [ fhir:v "translate" ] ;
                  ( fhir:parameter [
fhir:value [ fhir:v "system" ]                   ] [
fhir:value [ fhir:v "http://hl7.org/fhir/ConceptMap/special-oid2uri" ]                   ] [
fhir:value [ fhir:v "uri" ]                   ] )                 ] )               ] [
fhir:name [ fhir:v "displayName" ] ;
                ( fhir:source [
fhir:context [ fhir:v "value" ] ;
fhir:element [ fhir:v "displayName" ] ;
fhir:variable [ fhir:v "display" ]                 ] ) ;
                ( fhir:target [
fhir:context [ fhir:v "coding" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "display" ] ;
fhir:transform [ fhir:v "cast" ] ;
                  ( fhir:parameter [
fhir:value [ fhir:v "display" ]                   ] [
fhir:value [ fhir:v "string" ]                   ] )                 ] )               ] )             ] )           ] )         ] )       ] )     ] [
fhir:name [ fhir:v "valueQuantity" ] ;
      ( fhir:source [
fhir:context [ fhir:v "obs" ] ;
fhir:type [ fhir:v "PQ" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:variable [ fhir:v "val" ]       ] ) ;
      ( fhir:rule [
fhir:name [ fhir:v "quantity" ] ;
        ( fhir:source [
fhir:context [ fhir:v "val" ]         ] ) ;
        ( fhir:target [
fhir:context [ fhir:v "ob" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:variable [ fhir:v "quantity" ] ;
fhir:transform [ fhir:v "create" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "Quantity" ]           ] )         ] ) ;
        ( fhir:rule [
fhir:name [ fhir:v "value" ] ;
          ( fhir:source [
fhir:context [ fhir:v "val" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:variable [ fhir:v "value" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "quantity" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:transform [ fhir:v "copy" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "value" ]             ] )           ] )         ] [
fhir:name [ fhir:v "unit" ] ;
          ( fhir:source [
fhir:context [ fhir:v "val" ] ;
fhir:element [ fhir:v "unit" ] ;
fhir:variable [ fhir:v "unit" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "quantity" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "unit" ] ;
fhir:transform [ fhir:v "copy" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "unit" ]             ] )           ] )         ] )       ] )     ] [
fhir:name [ fhir:v "value" ] ;
      ( fhir:source [
fhir:context [ fhir:v "obs" ] ;
fhir:type [ fhir:v "ST" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:variable [ fhir:v "value" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "ob" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:transform [ fhir:v "create" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "string" ]         ] )       ] [
fhir:context [ fhir:v "ob" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "value.dataString" ]         ] )       ] )     ] [
fhir:name [ fhir:v "reference" ] ;
      ( fhir:source [
fhir:context [ fhir:v "obs" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "ob" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "subject" ] ;
fhir:variable [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "create" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "Reference" ]         ] )       ] [
fhir:context [ fhir:v "reference" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "'https://example/Patient/' + %patient.id" ]         ] )       ] )     ] [
fhir:name [ fhir:v "reference" ] ;
      ( fhir:source [
fhir:context [ fhir:v "obs" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "ob" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "encounter" ] ;
fhir:variable [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "create" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "Reference" ]         ] )       ] [
fhir:context [ fhir:v "reference" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "'https://example/Encounter/' + %encounter.id" ]         ] )       ] )     ] [
fhir:name [ fhir:v "interpretationCode" ] ;
      ( fhir:source [
fhir:context [ fhir:v "obs" ] ;
fhir:element [ fhir:v "interpretationCode" ] ;
fhir:variable [ fhir:v "vvv" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "ob" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "interpretation" ] ;
fhir:variable [ fhir:v "vvv" ] ;
fhir:transform [ fhir:v "create" ]       ] )     ] [
fhir:name [ fhir:v "methodCode" ] ;
      ( fhir:source [
fhir:context [ fhir:v "obs" ] ;
fhir:element [ fhir:v "methodCode" ] ;
fhir:variable [ fhir:v "vvv" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "ob" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "method" ] ;
fhir:variable [ fhir:v "vvv" ] ;
fhir:transform [ fhir:v "create" ]       ] )     ] [
fhir:name [ fhir:v "effectiveTime" ] ;
      ( fhir:source [
fhir:context [ fhir:v "obs" ] ;
fhir:element [ fhir:v "effectiveTime" ] ;
fhir:variable [ fhir:v "eff" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "ob" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "effective" ] ;
fhir:variable [ fhir:v "per" ] ;
fhir:transform [ fhir:v "create" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "Period" ]         ] )       ] ) ;
      ( fhir:dependent [
fhir:name [ fhir:v "IVLTSPeriod" ] ;
        ( fhir:variable [ fhir:v "eff" ] [ fhir:v "per" ] )       ] )     ] [
fhir:name [ fhir:v "refRange" ] ;
      ( fhir:source [
fhir:context [ fhir:v "obs" ] ;
fhir:element [ fhir:v "referenceRange" ] ;
fhir:variable [ fhir:v "refRange" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "ob" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "referenceRange" ] ;
fhir:variable [ fhir:v "ref" ] ;
fhir:transform [ fhir:v "create" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "BackboneElement" ]         ] )       ] ) ;
      ( fhir:rule [
fhir:name [ fhir:v "obsRange" ] ;
        ( fhir:source [
fhir:context [ fhir:v "refRange" ] ;
fhir:element [ fhir:v "observationRange" ] ;
fhir:variable [ fhir:v "obsRange" ]         ] ) ;
        ( fhir:target [
fhir:context [ fhir:v "ref" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "low" ] ;
fhir:variable [ fhir:v "Low" ] ;
fhir:transform [ fhir:v "create" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "SimpleQuantity" ]           ] )         ] ) ;
        ( fhir:rule [
fhir:name [ fhir:v "IVLPQ" ] ;
          ( fhir:source [
fhir:context [ fhir:v "obsRange" ] ;
fhir:type [ fhir:v "IVL_PQ" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:variable [ fhir:v "v" ]           ] ) ;
          ( fhir:rule [
fhir:name [ fhir:v "decValue" ] ;
            ( fhir:source [
fhir:context [ fhir:v "v" ] ;
fhir:element [ fhir:v "low" ] ;
fhir:variable [ fhir:v "l1" ]             ] ) ;
            ( fhir:rule [
fhir:name [ fhir:v "value" ] ;
              ( fhir:source [
fhir:context [ fhir:v "l1" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:variable [ fhir:v "decValue" ]               ] ) ;
              ( fhir:target [
fhir:context [ fhir:v "Low" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:transform [ fhir:v "copy" ] ;
                ( fhir:parameter [
fhir:value [ fhir:v "decValue" ]                 ] )               ] )             ] [
fhir:name [ fhir:v "unit" ] ;
              ( fhir:source [
fhir:context [ fhir:v "l1" ] ;
fhir:element [ fhir:v "unit" ] ;
fhir:variable [ fhir:v "Unit" ]               ] ) ;
              ( fhir:target [
fhir:context [ fhir:v "Low" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "unit" ] ;
fhir:transform [ fhir:v "copy" ] ;
                ( fhir:parameter [
fhir:value [ fhir:v "Unit" ]                 ] )               ] )             ] )           ] )         ] )       ] )     ] [
fhir:name [ fhir:v "perf" ] ;
      ( fhir:source [
fhir:context [ fhir:v "obs" ] ;
fhir:element [ fhir:v "performer" ] ;
fhir:variable [ fhir:v "performer" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "bundle" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "entry" ] ;
fhir:variable [ fhir:v "e1" ]       ] [
fhir:context [ fhir:v "e1" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "request" ] ;
fhir:variable [ fhir:v "request" ] ;
fhir:transform [ fhir:v "create" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "BackboneElement" ]         ] )       ] [
fhir:context [ fhir:v "request" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "method" ] ;
fhir:transform [ fhir:v "copy" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "PUT" ]         ] )       ] [
fhir:context [ fhir:v "e1" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "resource" ] ;
fhir:variable [ fhir:v "practitioner" ] ;
fhir:transform [ fhir:v "create" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "Practitioner" ]         ] )       ] [
fhir:context [ fhir:v "practitioner" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "id" ] ;
fhir:variable [ fhir:v "uuid1" ] ;
fhir:transform [ fhir:v "uuid" ]       ] ) ;
      ( fhir:rule [
fhir:name [ fhir:v "assEntity" ] ;
        ( fhir:source [
fhir:context [ fhir:v "performer" ] ;
fhir:element [ fhir:v "assignedEntity" ] ;
fhir:variable [ fhir:v "assEntity" ]         ] ) ;
        ( fhir:rule [
fhir:name [ fhir:v "meta" ] ;
          ( fhir:source [
fhir:context [ fhir:v "assEntity" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "practitioner" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "meta" ] ;
fhir:variable [ fhir:v "meta" ]           ] ) ;
          ( fhir:rule [
fhir:name [ fhir:v "coding" ] ;
            ( fhir:source [
fhir:context [ fhir:v "assEntity" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "meta" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "tag" ] ;
fhir:variable [ fhir:v "coding" ] ;
fhir:transform [ fhir:v "create" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "Coding" ]               ] )             ] ) ;
            ( fhir:rule [
fhir:name [ fhir:v "system" ] ;
              ( fhir:source [
fhir:context [ fhir:v "assEntity" ]               ] ) ;
              ( fhir:target [
fhir:context [ fhir:v "coding" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "system" ] ;
fhir:transform [ fhir:v "copy" ] ;
                ( fhir:parameter [
fhir:value [ fhir:v "http://algoritmodiscoring" ]                 ] )               ] )             ] [
fhir:name [ fhir:v "code" ] ;
              ( fhir:source [
fhir:context [ fhir:v "assEntity" ]               ] ) ;
              ( fhir:target [
fhir:context [ fhir:v "coding" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:transform [ fhir:v "copy" ] ;
                ( fhir:parameter [
fhir:value [ fhir:v "ClinicalDocument/body/EsamiDuranteRicovero/performer" ]                 ] )               ] )             ] )           ] )         ] [
fhir:name [ fhir:v "identifier" ] ;
          ( fhir:source [
fhir:context [ fhir:v "assEntity" ] ;
fhir:element [ fhir:v "id" ] ;
fhir:variable [ fhir:v "id" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "practitioner" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "identifier" ] ;
fhir:variable [ fhir:v "identifier" ]           ] ) ;
          ( fhir:rule [
fhir:name [ fhir:v "root1" ] ;
            ( fhir:source [
fhir:context [ fhir:v "id" ] ;
fhir:element [ fhir:v "root" ] ;
fhir:variable [ fhir:v "r" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "identifier" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "system" ] ;
fhir:transform [ fhir:v "translate" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "r" ]               ] [
fhir:value [ fhir:v "http://hl7.org/fhir/ConceptMap/special-oid2uri" ]               ] [
fhir:value [ fhir:v "uri" ]               ] )             ] )           ] [
fhir:name [ fhir:v "extension" ] ;
            ( fhir:source [
fhir:context [ fhir:v "id" ] ;
fhir:element [ fhir:v "extension" ] ;
fhir:variable [ fhir:v "ext" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "identifier" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:transform [ fhir:v "copy" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "ext" ]               ] )             ] )           ] [
fhir:name [ fhir:v "assigningAuthorityName" ] ;
            ( fhir:source [
fhir:context [ fhir:v "id" ] ;
fhir:element [ fhir:v "assigningAuthorityName" ] ;
fhir:variable [ fhir:v "s" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "identifier" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "assigner" ] ;
fhir:variable [ fhir:v "a" ]             ] [
fhir:context [ fhir:v "a" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "display" ] ;
fhir:transform [ fhir:v "copy" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "s" ]               ] )             ] )           ] [
fhir:name [ fhir:v "r" ] ;
            ( fhir:source [
fhir:context [ fhir:v "id" ] ;
fhir:element [ fhir:v "root" ] ;
fhir:variable [ fhir:v "r" ]             ] ) ;
            ( fhir:rule [
fhir:name [ fhir:v "aut" ] ;
              ( fhir:source [
fhir:context [ fhir:v "id" ] ;
fhir:element [ fhir:v "extension" ] ;
fhir:variable [ fhir:v "ext" ]               ] ) ;
              ( fhir:target [
fhir:context [ fhir:v "practitioner" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "id" ] ;
fhir:variable [ fhir:v "uuid2" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
                ( fhir:parameter [
fhir:value [ fhir:v "r + '-' + ext" ]                 ] )               ] [
fhir:context [ fhir:v "e1" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "fullUrl" ] ;
fhir:transform [ fhir:v "append" ] ;
                ( fhir:parameter [
fhir:value [ fhir:v "https://example/Practitioner/" ]                 ] [
fhir:value [ fhir:v "uuid2" ]                 ] )               ] [
fhir:context [ fhir:v "ob" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "performer" ] ;
fhir:variable [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "create" ] ;
                ( fhir:parameter [
fhir:value [ fhir:v "Reference" ]                 ] )               ] [
fhir:context [ fhir:v "reference" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
                ( fhir:parameter [
fhir:value [ fhir:v "'https://example/Practitioner/' + %practitioner.id" ]                 ] )               ] )             ] )           ] )         ] [
fhir:name [ fhir:v "2.16.840.1.113883.2.9.4.3.2" ] ;
          ( fhir:source [
fhir:context [ fhir:v "assEntity" ] ;
fhir:element [ fhir:v "id" ] ;
fhir:variable [ fhir:v "id" ] ;
fhir:condition [ fhir:v "(root = '2.16.840.1.113883.2.9.4.3.2')" ]           ] ) ;
          ( fhir:rule [
fhir:name [ fhir:v "UUID" ] ;
            ( fhir:source [
fhir:context [ fhir:v "id" ] ;
fhir:element [ fhir:v "extension" ] ;
fhir:variable [ fhir:v "ext" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "request" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "url" ] ;
fhir:transform [ fhir:v "append" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "Practitioner?identifier=" ]               ] [
fhir:value [ fhir:v "ext" ]               ] )             ] )           ] )         ] [
fhir:name [ fhir:v "assi" ] ;
          ( fhir:source [
fhir:context [ fhir:v "assEntity" ] ;
fhir:element [ fhir:v "assignedPerson" ] ;
fhir:variable [ fhir:v "assi" ]           ] ) ;
          ( fhir:rule [
fhir:name [ fhir:v "name" ] ;
            ( fhir:source [
fhir:context [ fhir:v "assi" ] ;
fhir:element [ fhir:v "name" ] ;
fhir:variable [ fhir:v "vvv" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "practitioner" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "name" ] ;
fhir:variable [ fhir:v "vvv" ] ;
fhir:transform [ fhir:v "create" ]             ] )           ] )         ] )       ] )     ] [
fhir:name [ fhir:v "participant" ] ;
      ( fhir:source [
fhir:context [ fhir:v "obs" ] ;
fhir:element [ fhir:v "participant" ] ;
fhir:variable [ fhir:v "participant" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "bundle" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "entry" ] ;
fhir:variable [ fhir:v "e1" ]       ] [
fhir:context [ fhir:v "e1" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "request" ] ;
fhir:variable [ fhir:v "request" ] ;
fhir:transform [ fhir:v "create" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "BackboneElement" ]         ] )       ] [
fhir:context [ fhir:v "request" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "method" ] ;
fhir:transform [ fhir:v "copy" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "POST" ]         ] )       ] [
fhir:context [ fhir:v "e1" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "resource" ] ;
fhir:variable [ fhir:v "serviceRequest" ] ;
fhir:transform [ fhir:v "create" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "ServiceRequest" ]         ] )       ] [
fhir:context [ fhir:v "serviceRequest" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "id" ] ;
fhir:variable [ fhir:v "uuid1" ] ;
fhir:transform [ fhir:v "uuid" ]       ] [
fhir:context [ fhir:v "e1" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "fullUrl" ] ;
fhir:transform [ fhir:v "append" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "https://example/ServiceRequest/" ]         ] [
fhir:value [ fhir:v "uuid1" ]         ] )       ] [
fhir:context [ fhir:v "request" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "url" ] ;
fhir:transform [ fhir:v "copy" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "ServiceRequest" ]         ] )       ] [
fhir:context [ fhir:v "ob" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "basedOn" ] ;
fhir:variable [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "create" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "Reference" ]         ] )       ] [
fhir:context [ fhir:v "reference" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "'https://example/ServiceRequest/' + %serviceRequest.id" ]         ] )       ] ) ;
      ( fhir:rule [
fhir:name [ fhir:v "time" ] ;
        ( fhir:source [
fhir:context [ fhir:v "participant" ] ;
fhir:element [ fhir:v "time" ] ;
fhir:variable [ fhir:v "t" ]         ] ) ;
        ( fhir:target [
fhir:context [ fhir:v "serviceRequest" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "authoredOn" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "t.value" ]           ] )         ] )       ] [
fhir:name [ fhir:v "reference" ] ;
        ( fhir:source [
fhir:context [ fhir:v "obs" ]         ] ) ;
        ( fhir:target [
fhir:context [ fhir:v "serviceRequest" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "subject" ] ;
fhir:variable [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "create" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "Reference" ]           ] )         ] [
fhir:context [ fhir:v "reference" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "'https://example/Patient/' + %patient.id" ]           ] )         ] )       ] [
fhir:name [ fhir:v "reference" ] ;
        ( fhir:source [
fhir:context [ fhir:v "obs" ]         ] ) ;
        ( fhir:target [
fhir:context [ fhir:v "serviceRequest" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "encounter" ] ;
fhir:variable [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "create" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "Reference" ]           ] )         ] [
fhir:context [ fhir:v "reference" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "'https://example/Encounter/' + %encounter.id" ]           ] )         ] )       ] [
fhir:name [ fhir:v "status" ] ;
        ( fhir:source [
fhir:context [ fhir:v "obs" ]         ] ) ;
        ( fhir:target [
fhir:context [ fhir:v "serviceRequest" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "status" ] ;
fhir:transform [ fhir:v "copy" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "active" ]           ] )         ] )       ] [
fhir:name [ fhir:v "intent" ] ;
        ( fhir:source [
fhir:context [ fhir:v "obs" ]         ] ) ;
        ( fhir:target [
fhir:context [ fhir:v "serviceRequest" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "intent" ] ;
fhir:transform [ fhir:v "copy" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "order" ]           ] )         ] )       ] [
fhir:name [ fhir:v "participantRole" ] ;
        ( fhir:source [
fhir:context [ fhir:v "participant" ] ;
fhir:element [ fhir:v "participantRole" ] ;
fhir:variable [ fhir:v "participantRole" ]         ] ) ;
        ( fhir:target [
fhir:context [ fhir:v "bundle" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "entry" ] ;
fhir:variable [ fhir:v "e1" ]         ] [
fhir:context [ fhir:v "e1" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "request" ] ;
fhir:variable [ fhir:v "request" ] ;
fhir:transform [ fhir:v "create" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "BackboneElement" ]           ] )         ] [
fhir:context [ fhir:v "request" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "method" ] ;
fhir:transform [ fhir:v "copy" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "PUT" ]           ] )         ] [
fhir:context [ fhir:v "e1" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "resource" ] ;
fhir:variable [ fhir:v "practitioner" ] ;
fhir:transform [ fhir:v "create" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "Practitioner" ]           ] )         ] ) ;
        ( fhir:rule [
fhir:name [ fhir:v "meta" ] ;
          ( fhir:source [
fhir:context [ fhir:v "participantRole" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "practitioner" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "meta" ] ;
fhir:variable [ fhir:v "meta" ]           ] ) ;
          ( fhir:rule [
fhir:name [ fhir:v "coding" ] ;
            ( fhir:source [
fhir:context [ fhir:v "participantRole" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "meta" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "tag" ] ;
fhir:variable [ fhir:v "coding" ] ;
fhir:transform [ fhir:v "create" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "Coding" ]               ] )             ] ) ;
            ( fhir:rule [
fhir:name [ fhir:v "system" ] ;
              ( fhir:source [
fhir:context [ fhir:v "participantRole" ]               ] ) ;
              ( fhir:target [
fhir:context [ fhir:v "coding" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "system" ] ;
fhir:transform [ fhir:v "copy" ] ;
                ( fhir:parameter [
fhir:value [ fhir:v "http://algoritmodiscoring" ]                 ] )               ] )             ] [
fhir:name [ fhir:v "code" ] ;
              ( fhir:source [
fhir:context [ fhir:v "participantRole" ]               ] ) ;
              ( fhir:target [
fhir:context [ fhir:v "coding" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:transform [ fhir:v "copy" ] ;
                ( fhir:parameter [
fhir:value [ fhir:v "ClinicalDocument/body/EsamiDuranteRicovero/participant" ]                 ] )               ] )             ] )           ] )         ] [
fhir:name [ fhir:v "identifier" ] ;
          ( fhir:source [
fhir:context [ fhir:v "participantRole" ] ;
fhir:element [ fhir:v "id" ] ;
fhir:variable [ fhir:v "id" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "practitioner" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "identifier" ] ;
fhir:variable [ fhir:v "identifier" ]           ] ) ;
          ( fhir:rule [
fhir:name [ fhir:v "root1" ] ;
            ( fhir:source [
fhir:context [ fhir:v "id" ] ;
fhir:element [ fhir:v "root" ] ;
fhir:variable [ fhir:v "r" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "identifier" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "system" ] ;
fhir:transform [ fhir:v "translate" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "r" ]               ] [
fhir:value [ fhir:v "http://hl7.org/fhir/ConceptMap/special-oid2uri" ]               ] [
fhir:value [ fhir:v "uri" ]               ] )             ] )           ] [
fhir:name [ fhir:v "extension" ] ;
            ( fhir:source [
fhir:context [ fhir:v "id" ] ;
fhir:element [ fhir:v "extension" ] ;
fhir:variable [ fhir:v "ext" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "identifier" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:transform [ fhir:v "copy" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "ext" ]               ] )             ] )           ] [
fhir:name [ fhir:v "assigningAuthorityName" ] ;
            ( fhir:source [
fhir:context [ fhir:v "id" ] ;
fhir:element [ fhir:v "assigningAuthorityName" ] ;
fhir:variable [ fhir:v "s" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "identifier" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "assigner" ] ;
fhir:variable [ fhir:v "a" ]             ] [
fhir:context [ fhir:v "a" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "display" ] ;
fhir:transform [ fhir:v "copy" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "s" ]               ] )             ] )           ] [
fhir:name [ fhir:v "r" ] ;
            ( fhir:source [
fhir:context [ fhir:v "id" ] ;
fhir:element [ fhir:v "root" ] ;
fhir:variable [ fhir:v "r" ]             ] ) ;
            ( fhir:rule [
fhir:name [ fhir:v "aut" ] ;
              ( fhir:source [
fhir:context [ fhir:v "id" ] ;
fhir:element [ fhir:v "extension" ] ;
fhir:variable [ fhir:v "ext" ]               ] ) ;
              ( fhir:target [
fhir:context [ fhir:v "practitioner" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "id" ] ;
fhir:variable [ fhir:v "uuid3" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
                ( fhir:parameter [
fhir:value [ fhir:v "r + '-' + ext" ]                 ] )               ] [
fhir:context [ fhir:v "e1" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "fullUrl" ] ;
fhir:transform [ fhir:v "append" ] ;
                ( fhir:parameter [
fhir:value [ fhir:v "https://example/Practitioner/" ]                 ] [
fhir:value [ fhir:v "uuid3" ]                 ] )               ] [
fhir:context [ fhir:v "serviceRequest" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "performer" ] ;
fhir:variable [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "create" ] ;
                ( fhir:parameter [
fhir:value [ fhir:v "Reference" ]                 ] )               ] [
fhir:context [ fhir:v "reference" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
                ( fhir:parameter [
fhir:value [ fhir:v "'https://example/Practitioner/' + %practitioner.id" ]                 ] )               ] )             ] )           ] )         ] [
fhir:name [ fhir:v "2.16.840.1.113883.2.9.4.3.2" ] ;
          ( fhir:source [
fhir:context [ fhir:v "participantRole" ] ;
fhir:element [ fhir:v "id" ] ;
fhir:variable [ fhir:v "id" ] ;
fhir:condition [ fhir:v "(root = '2.16.840.1.113883.2.9.4.3.2')" ]           ] ) ;
          ( fhir:rule [
fhir:name [ fhir:v "UUID" ] ;
            ( fhir:source [
fhir:context [ fhir:v "id" ] ;
fhir:element [ fhir:v "extension" ] ;
fhir:variable [ fhir:v "ext" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "request" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "url" ] ;
fhir:transform [ fhir:v "append" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "Practitioner?identifier=" ]               ] [
fhir:value [ fhir:v "ext" ]               ] )             ] )           ] )         ] [
fhir:name [ fhir:v "pe" ] ;
          ( fhir:source [
fhir:context [ fhir:v "participantRole" ] ;
fhir:element [ fhir:v "playingEntity" ] ;
fhir:variable [ fhir:v "pe" ]           ] ) ;
          ( fhir:rule [
fhir:name [ fhir:v "name" ] ;
            ( fhir:source [
fhir:context [ fhir:v "pe" ] ;
fhir:element [ fhir:v "name" ] ;
fhir:variable [ fhir:v "vvv" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "practitioner" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "name" ] ;
fhir:variable [ fhir:v "vvv" ] ;
fhir:transform [ fhir:v "create" ]             ] )           ] )         ] )       ] )     ] )
  ] [
fhir:name [ fhir:v "periodTiming" ] ;
fhir:typeMode [ fhir:v "none" ] ;
    ( fhir:input [
fhir:name [ fhir:v "effectiveTime" ] ;
fhir:type [ fhir:v "PIVL_TS" ] ;
fhir:mode [ fhir:v "source" ]     ] [
fhir:name [ fhir:v "timing" ] ;
fhir:type [ fhir:v "Timing" ] ;
fhir:mode [ fhir:v "target" ]     ] ) ;
    ( fhir:rule [
fhir:name [ fhir:v "repeat" ] ;
      ( fhir:source [
fhir:context [ fhir:v "effectiveTime" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "timing" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "repeat" ] ;
fhir:variable [ fhir:v "r" ]       ] ) ;
      ( fhir:rule [
fhir:name [ fhir:v "period" ] ;
        ( fhir:source [
fhir:context [ fhir:v "effectiveTime" ] ;
fhir:element [ fhir:v "period" ] ;
fhir:variable [ fhir:v "p" ]         ] ) ;
        ( fhir:target [
fhir:context [ fhir:v "r" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "period" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "p.value" ]           ] )         ] )       ] [
fhir:name [ fhir:v "period" ] ;
        ( fhir:source [
fhir:context [ fhir:v "effectiveTime" ] ;
fhir:element [ fhir:v "period" ] ;
fhir:variable [ fhir:v "p" ]         ] ) ;
        ( fhir:target [
fhir:context [ fhir:v "r" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "periodUnit" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "p.unit" ]           ] )         ] )       ] )     ] )
  ] [
fhir:name [ fhir:v "Act" ] ;
fhir:typeMode [ fhir:v "none" ] ;
fhir:documentation [ fhir:v "---------------------------------------------------------------------------------------" ] ;
    ( fhir:input [
fhir:name [ fhir:v "cda" ] ;
fhir:type [ fhir:v "Act" ] ;
fhir:mode [ fhir:v "source" ]     ] [
fhir:name [ fhir:v "pat" ] ;
fhir:type [ fhir:v "Patient" ] ;
fhir:mode [ fhir:v "target" ]     ] [
fhir:name [ fhir:v "ac" ] ;
fhir:type [ fhir:v "DiagnosticReport" ] ;
fhir:mode [ fhir:v "target" ]     ] [
fhir:name [ fhir:v "enc" ] ;
fhir:type [ fhir:v "Encounter" ] ;
fhir:mode [ fhir:v "target" ]     ] [
fhir:name [ fhir:v "bundle" ] ;
fhir:type [ fhir:v "Bundle" ] ;
fhir:mode [ fhir:v "target" ]     ] ) ;
    ( fhir:rule [
fhir:name [ fhir:v "code" ] ;
      ( fhir:source [
fhir:context [ fhir:v "cda" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "vvv" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "ac" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "vvv" ] ;
fhir:transform [ fhir:v "create" ]       ] )     ] [
fhir:name [ fhir:v "statusCode" ] ;
      ( fhir:source [
fhir:context [ fhir:v "cda" ] ;
fhir:element [ fhir:v "statusCode" ] ;
fhir:variable [ fhir:v "statusc" ] ;
fhir:condition [ fhir:v "(code = 'completed')" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "ob" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "status" ] ;
fhir:transform [ fhir:v "copy" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "final" ]         ] )       ] )     ] [
fhir:name [ fhir:v "statusCode" ] ;
      ( fhir:source [
fhir:context [ fhir:v "cda" ] ;
fhir:element [ fhir:v "statusCode" ] ;
fhir:variable [ fhir:v "statusc" ] ;
fhir:condition [ fhir:v "(code = 'active')" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "ob" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "status" ] ;
fhir:transform [ fhir:v "copy" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "registered" ]         ] )       ] )     ] [
fhir:name [ fhir:v "statusCode" ] ;
      ( fhir:source [
fhir:context [ fhir:v "cda" ] ;
fhir:element [ fhir:v "statusCode" ] ;
fhir:variable [ fhir:v "statusc" ] ;
fhir:condition [ fhir:v "(code = 'aborted')" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "ob" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "status" ] ;
fhir:transform [ fhir:v "copy" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "cancelled" ]         ] )       ] )     ] [
fhir:name [ fhir:v "statusCode" ] ;
      ( fhir:source [
fhir:context [ fhir:v "cda" ] ;
fhir:element [ fhir:v "statusCode" ] ;
fhir:variable [ fhir:v "statusc" ] ;
fhir:condition [ fhir:v "(code = 'suspended')" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "ob" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "status" ] ;
fhir:transform [ fhir:v "copy" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "partial" ]         ] )       ] )     ] [
fhir:name [ fhir:v "value2a" ] ;
      ( fhir:source [
fhir:context [ fhir:v "cda" ] ;
fhir:element [ fhir:v "effectiveTime" ] ;
fhir:variable [ fhir:v "effectiveTime" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "ac" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "effective" ] ;
fhir:variable [ fhir:v "value" ] ;
fhir:transform [ fhir:v "create" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "dateTime" ]         ] )       ] ) ;
      ( fhir:dependent [
fhir:name [ fhir:v "TSDateTime" ] ;
        ( fhir:variable [ fhir:v "effectiveTime" ] [ fhir:v "value" ] )       ] )     ] [
fhir:name [ fhir:v "where" ] ;
      ( fhir:source [
fhir:context [ fhir:v "obs" ] ;
fhir:condition [ fhir:v "effectiveTime.low.exists() or effectiveTime.high.exists()" ]       ] ) ;
      ( fhir:rule [
fhir:name [ fhir:v "value3a" ] ;
        ( fhir:source [
fhir:context [ fhir:v "cda" ] ;
fhir:element [ fhir:v "effectiveTime" ] ;
fhir:variable [ fhir:v "eff" ]         ] ) ;
        ( fhir:target [
fhir:context [ fhir:v "ac" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "effective" ] ;
fhir:variable [ fhir:v "period" ] ;
fhir:transform [ fhir:v "create" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "Period" ]           ] )         ] ) ;
        ( fhir:dependent [
fhir:name [ fhir:v "IVLTSPeriod" ] ;
          ( fhir:variable [ fhir:v "eff" ] [ fhir:v "period" ] )         ] )       ] )     ] [
fhir:name [ fhir:v "reference" ] ;
      ( fhir:source [
fhir:context [ fhir:v "cda" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "ac" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "subject" ] ;
fhir:variable [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "create" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "Reference" ]         ] )       ] [
fhir:context [ fhir:v "reference" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "'https://example/' + %pat.id" ]         ] )       ] )     ] [
fhir:name [ fhir:v "reference" ] ;
      ( fhir:source [
fhir:context [ fhir:v "cda" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "ac" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "encounter" ] ;
fhir:variable [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "create" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "Reference" ]         ] )       ] [
fhir:context [ fhir:v "reference" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "'https://example/' + %enc.id" ]         ] )       ] )     ] [
fhir:name [ fhir:v "participant" ] ;
      ( fhir:source [
fhir:context [ fhir:v "cda" ] ;
fhir:element [ fhir:v "participant" ] ;
fhir:variable [ fhir:v "part" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "enc" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "participant" ] ;
fhir:variable [ fhir:v "participant" ]       ] ) ;
      ( fhir:rule [
fhir:name [ fhir:v "type" ] ;
        ( fhir:source [
fhir:context [ fhir:v "part" ]         ] ) ;
        ( fhir:target [
fhir:context [ fhir:v "participant" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "type" ] ;
fhir:variable [ fhir:v "type" ]         ] ) ;
        ( fhir:rule [
fhir:name [ fhir:v "codeType" ] ;
          ( fhir:source [
fhir:context [ fhir:v "part" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "type" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "coding" ] ;
fhir:variable [ fhir:v "coding" ]           ] ) ;
          ( fhir:rule [
fhir:name [ fhir:v "codice" ] ;
            ( fhir:source [
fhir:context [ fhir:v "part" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "coding" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "part.typeCode" ]               ] )             ] )           ] [
fhir:name [ fhir:v "system" ] ;
            ( fhir:source [
fhir:context [ fhir:v "part" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "coding" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "system" ] ;
fhir:transform [ fhir:v "copy" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "http://terminology.hl7.org/CodeSystem/v3-ParticipationType" ]               ] )             ] )           ] )         ] )       ] [
fhir:name [ fhir:v "participantRole" ] ;
        ( fhir:source [
fhir:context [ fhir:v "part" ] ;
fhir:element [ fhir:v "participantRole" ] ;
fhir:variable [ fhir:v "participantRole" ]         ] ) ;
        ( fhir:target [
fhir:context [ fhir:v "participant" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "individual" ] ;
fhir:variable [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "create" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "Reference" ]           ] )         ] ) ;
        ( fhir:rule [
fhir:name [ fhir:v "participanRoleBund" ] ;
          ( fhir:source [
fhir:context [ fhir:v "participantRole" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "bundle" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "entry" ] ;
fhir:variable [ fhir:v "e" ]           ] [
fhir:context [ fhir:v "e" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "request" ] ;
fhir:variable [ fhir:v "request" ] ;
fhir:transform [ fhir:v "create" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "BackboneElement" ]             ] )           ] [
fhir:context [ fhir:v "request" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "method" ] ;
fhir:transform [ fhir:v "copy" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "PUT" ]             ] )           ] [
fhir:context [ fhir:v "e" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "resource" ] ;
fhir:variable [ fhir:v "practitioner" ] ;
fhir:transform [ fhir:v "create" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "Practitioner" ]             ] )           ] [
fhir:context [ fhir:v "practitioner" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "id" ] ;
fhir:variable [ fhir:v "uuid1" ] ;
fhir:transform [ fhir:v "uuid" ]           ] [
fhir:context [ fhir:v "e" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "fullUrl" ] ;
fhir:transform [ fhir:v "append" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "https://example/Practitioner/" ]             ] [
fhir:value [ fhir:v "uuid1" ]             ] )           ] [
fhir:context [ fhir:v "reference" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "'https://example/Practitioner/' + %practitioner.id" ]             ] )           ] ) ;
          ( fhir:rule [
fhir:name [ fhir:v "meta" ] ;
            ( fhir:source [
fhir:context [ fhir:v "participantRole" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "practitioner" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "meta" ] ;
fhir:variable [ fhir:v "meta" ]             ] ) ;
            ( fhir:rule [
fhir:name [ fhir:v "coding" ] ;
              ( fhir:source [
fhir:context [ fhir:v "participantRole" ]               ] ) ;
              ( fhir:target [
fhir:context [ fhir:v "meta" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "tag" ] ;
fhir:variable [ fhir:v "coding" ] ;
fhir:transform [ fhir:v "create" ] ;
                ( fhir:parameter [
fhir:value [ fhir:v "Coding" ]                 ] )               ] ) ;
              ( fhir:rule [
fhir:name [ fhir:v "system" ] ;
                ( fhir:source [
fhir:context [ fhir:v "participantRole" ]                 ] ) ;
                ( fhir:target [
fhir:context [ fhir:v "coding" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "system" ] ;
fhir:transform [ fhir:v "copy" ] ;
                  ( fhir:parameter [
fhir:value [ fhir:v "http://algoritmodiscoring" ]                   ] )                 ] )               ] [
fhir:name [ fhir:v "code" ] ;
                ( fhir:source [
fhir:context [ fhir:v "participantRole" ]                 ] ) ;
                ( fhir:target [
fhir:context [ fhir:v "coding" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:transform [ fhir:v "copy" ] ;
                  ( fhir:parameter [
fhir:value [ fhir:v "ClinicalDocument/body/Act/participant" ]                   ] )                 ] )               ] )             ] )           ] [
fhir:name [ fhir:v "identifier" ] ;
            ( fhir:source [
fhir:context [ fhir:v "participantRole" ] ;
fhir:element [ fhir:v "id" ] ;
fhir:variable [ fhir:v "id" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "practitioner" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "identifier" ] ;
fhir:variable [ fhir:v "identifier" ]             ] ) ;
            ( fhir:rule [
fhir:name [ fhir:v "root1" ] ;
              ( fhir:source [
fhir:context [ fhir:v "id" ] ;
fhir:element [ fhir:v "root" ] ;
fhir:variable [ fhir:v "r" ]               ] ) ;
              ( fhir:target [
fhir:context [ fhir:v "identifier" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "system" ] ;
fhir:transform [ fhir:v "translate" ] ;
                ( fhir:parameter [
fhir:value [ fhir:v "r" ]                 ] [
fhir:value [ fhir:v "http://hl7.org/fhir/ConceptMap/special-oid2uri" ]                 ] [
fhir:value [ fhir:v "uri" ]                 ] )               ] )             ] [
fhir:name [ fhir:v "ext" ] ;
              ( fhir:source [
fhir:context [ fhir:v "id" ] ;
fhir:element [ fhir:v "extension" ] ;
fhir:variable [ fhir:v "ext" ]               ] ) ;
              ( fhir:target [
fhir:context [ fhir:v "identifier" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:transform [ fhir:v "copy" ] ;
                ( fhir:parameter [
fhir:value [ fhir:v "ext" ]                 ] )               ] ) ;
              ( fhir:rule [
fhir:name [ fhir:v "UUID" ] ;
                ( fhir:source [
fhir:context [ fhir:v "participantRole" ]                 ] ) ;
                ( fhir:target [
fhir:context [ fhir:v "request" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "url" ] ;
fhir:transform [ fhir:v "append" ] ;
                  ( fhir:parameter [
fhir:value [ fhir:v "Practitioner?identifier=" ]                   ] [
fhir:value [ fhir:v "ext" ]                   ] )                 ] )               ] )             ] [
fhir:name [ fhir:v "assigningAuthorityName" ] ;
              ( fhir:source [
fhir:context [ fhir:v "id" ] ;
fhir:element [ fhir:v "assigningAuthorityName" ] ;
fhir:variable [ fhir:v "s" ]               ] ) ;
              ( fhir:target [
fhir:context [ fhir:v "identifier" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "assigner" ] ;
fhir:variable [ fhir:v "a" ]               ] [
fhir:context [ fhir:v "a" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "display" ] ;
fhir:transform [ fhir:v "copy" ] ;
                ( fhir:parameter [
fhir:value [ fhir:v "s" ]                 ] )               ] )             ] )           ] [
fhir:name [ fhir:v "playingEntity" ] ;
            ( fhir:source [
fhir:context [ fhir:v "participantRole" ] ;
fhir:element [ fhir:v "playingEntity" ] ;
fhir:variable [ fhir:v "playingEntity" ]             ] ) ;
            ( fhir:rule [
fhir:name [ fhir:v "name" ] ;
              ( fhir:source [
fhir:context [ fhir:v "playingEntity" ] ;
fhir:element [ fhir:v "name" ] ;
fhir:variable [ fhir:v "vvv" ]               ] ) ;
              ( fhir:target [
fhir:context [ fhir:v "practitioner" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "name" ] ;
fhir:variable [ fhir:v "vvv" ] ;
fhir:transform [ fhir:v "create" ]               ] )             ] )           ] )         ] )       ] )     ] [
fhir:name [ fhir:v "entryRelationship" ] ;
      ( fhir:source [
fhir:context [ fhir:v "cda" ] ;
fhir:element [ fhir:v "entryRelationship" ] ;
fhir:variable [ fhir:v "entryRelationship" ]       ] ) ;
      ( fhir:rule [
fhir:name [ fhir:v "OBS" ] ;
        ( fhir:source [
fhir:context [ fhir:v "entryRelationship" ] ;
fhir:element [ fhir:v "observation" ] ;
fhir:variable [ fhir:v "observation" ]         ] ) ;
        ( fhir:target [
fhir:context [ fhir:v "bundle" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "entry" ] ;
fhir:variable [ fhir:v "e" ]         ] [
fhir:context [ fhir:v "e" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "request" ] ;
fhir:variable [ fhir:v "request" ] ;
fhir:transform [ fhir:v "create" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "BackboneElement" ]           ] )         ] [
fhir:context [ fhir:v "request" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "method" ] ;
fhir:transform [ fhir:v "copy" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "POST" ]           ] )         ] [
fhir:context [ fhir:v "e" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "resource" ] ;
fhir:variable [ fhir:v "obs" ] ;
fhir:transform [ fhir:v "create" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "Observation" ]           ] )         ] [
fhir:context [ fhir:v "obs" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "id" ] ;
fhir:variable [ fhir:v "uuid2" ] ;
fhir:transform [ fhir:v "uuid" ]         ] [
fhir:context [ fhir:v "e" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "fullUrl" ] ;
fhir:transform [ fhir:v "append" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "https://example/Observation/" ]           ] [
fhir:value [ fhir:v "uuid2" ]           ] )         ] [
fhir:context [ fhir:v "request" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "url" ] ;
fhir:transform [ fhir:v "append" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "Observation/" ]           ] [
fhir:value [ fhir:v "uuid2" ]           ] )         ] [
fhir:context [ fhir:v "ac" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "result" ] ;
fhir:variable [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "create" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "Reference" ]           ] )         ] [
fhir:context [ fhir:v "reference" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "'https://example/Observation/' + %obs.id" ]           ] )         ] ) ;
        ( fhir:dependent [
fhir:name [ fhir:v "Observation" ] ;
          ( fhir:variable [ fhir:v "observation" ] [ fhir:v "pat" ] [ fhir:v "enc" ] [ fhir:v "obs" ] [ fhir:v "bundle" ] )         ] )       ] )     ] )
  ] [
fhir:name [ fhir:v "ClinicalDocumentSectionTerapiaDimissione" ] ;
fhir:typeMode [ fhir:v "none" ] ;
    ( fhir:input [
fhir:name [ fhir:v "cda" ] ;
fhir:type [ fhir:v "ClinicalDocument" ] ;
fhir:mode [ fhir:v "source" ]     ] [
fhir:name [ fhir:v "src" ] ;
fhir:type [ fhir:v "Section" ] ;
fhir:mode [ fhir:v "source" ]     ] [
fhir:name [ fhir:v "patient" ] ;
fhir:type [ fhir:v "Patient" ] ;
fhir:mode [ fhir:v "target" ]     ] [
fhir:name [ fhir:v "tgt" ] ;
fhir:mode [ fhir:v "target" ]     ] [
fhir:name [ fhir:v "bundle" ] ;
fhir:type [ fhir:v "Bundle" ] ;
fhir:mode [ fhir:v "target" ]     ] [
fhir:name [ fhir:v "enc" ] ;
fhir:type [ fhir:v "Encounter" ] ;
fhir:mode [ fhir:v "target" ]     ] ) ;
    ( fhir:rule [
fhir:name [ fhir:v "title" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "title" ] ;
fhir:variable [ fhir:v "t" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "title" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "t.dataString" ]         ] )       ] )     ] [
fhir:name [ fhir:v "code" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "vvv" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "vvv" ] ;
fhir:transform [ fhir:v "create" ]       ] )     ] [
fhir:name [ fhir:v "exist" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:condition [ fhir:v "src.entry.exists()" ]       ] ) ;
      ( fhir:rule [
fhir:name [ fhir:v "cdaText" ] ;
        ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "text" ] ;
fhir:variable [ fhir:v "cdaText" ]         ] ) ;
        ( fhir:target [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "text" ] ;
fhir:variable [ fhir:v "fhirText" ]         ] ) ;
        ( fhir:rule [
fhir:name [ fhir:v "narrativeStatus" ] ;
          ( fhir:source [
fhir:context [ fhir:v "cdaText" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "fhirText" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "status" ] ;
fhir:transform [ fhir:v "copy" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "generated" ]             ] )           ] )         ] [
fhir:name [ fhir:v "narrativeText" ] ;
          ( fhir:source [
fhir:context [ fhir:v "cdaText" ] ;
fhir:variable [ fhir:v "t" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "fhirText" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "div" ] ;
fhir:transform [ fhir:v "copy" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "t" ]             ] )           ] )         ] )       ] )     ] [
fhir:name [ fhir:v "where" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:condition [ fhir:v "src.entry.exists().not()" ]       ] ) ;
      ( fhir:rule [
fhir:name [ fhir:v "cdaText" ] ;
        ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "text" ] ;
fhir:variable [ fhir:v "cdaText" ]         ] ) ;
        ( fhir:target [
fhir:context [ fhir:v "bundle" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "entry" ] ;
fhir:variable [ fhir:v "e1" ]         ] [
fhir:context [ fhir:v "e1" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "request" ] ;
fhir:variable [ fhir:v "request" ] ;
fhir:transform [ fhir:v "create" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "BackboneElement" ]           ] )         ] [
fhir:context [ fhir:v "request" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "method" ] ;
fhir:transform [ fhir:v "copy" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "POST" ]           ] )         ] [
fhir:context [ fhir:v "e1" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "resource" ] ;
fhir:variable [ fhir:v "medicationRq" ] ;
fhir:transform [ fhir:v "create" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "MedicationRequest" ]           ] )         ] [
fhir:context [ fhir:v "medicationRq" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "id" ] ;
fhir:variable [ fhir:v "uuid1" ] ;
fhir:transform [ fhir:v "uuid" ]         ] [
fhir:context [ fhir:v "e1" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "fullUrl" ] ;
fhir:transform [ fhir:v "append" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "https://example/MedicationRequest/" ]           ] [
fhir:value [ fhir:v "uuid1" ]           ] )         ] [
fhir:context [ fhir:v "request" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "url" ] ;
fhir:transform [ fhir:v "copy" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "MedicationRequest" ]           ] )         ] [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "entry" ] ;
fhir:variable [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "create" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "Reference" ]           ] )         ] [
fhir:context [ fhir:v "reference" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "'https://example/MedicationRequest/' + %medicationRq.id" ]           ] )         ] ) ;
        ( fhir:rule [
fhir:name [ fhir:v "reference" ] ;
          ( fhir:source [
fhir:context [ fhir:v "src" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "medicationRq" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "subject" ] ;
fhir:variable [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "create" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "Reference" ]             ] )           ] [
fhir:context [ fhir:v "reference" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "'https://example/Patient/' + %patient.id" ]             ] )           ] )         ] [
fhir:name [ fhir:v "reference" ] ;
          ( fhir:source [
fhir:context [ fhir:v "src" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "medicationRq" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "encounter" ] ;
fhir:variable [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "create" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "Reference" ]             ] )           ] [
fhir:context [ fhir:v "reference" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "'https://example/Encounter/' + %enc.id" ]             ] )           ] )         ] [
fhir:name [ fhir:v "status" ] ;
          ( fhir:source [
fhir:context [ fhir:v "src" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "medicationRq" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "status" ] ;
fhir:transform [ fhir:v "copy" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "active" ]             ] )           ] )         ] [
fhir:name [ fhir:v "intent" ] ;
          ( fhir:source [
fhir:context [ fhir:v "src" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "medicationRq" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "intent" ] ;
fhir:transform [ fhir:v "copy" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "order" ]             ] )           ] )         ] [
fhir:name [ fhir:v "code" ] ;
          ( fhir:source [
fhir:context [ fhir:v "cdaText" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "medicationRq" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "medication" ] ;
fhir:variable [ fhir:v "codecon" ] ;
fhir:transform [ fhir:v "create" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "CodeableConcept" ]             ] )           ] ) ;
          ( fhir:rule [
fhir:name [ fhir:v "text" ] ;
            ( fhir:source [
fhir:context [ fhir:v "cdaText" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "codecon" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "text" ] ;
fhir:transform [ fhir:v "copy" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "string" ]               ] )             ] )           ] )         ] [
fhir:name [ fhir:v "reference" ] ;
          ( fhir:source [
fhir:context [ fhir:v "cdaText" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "medicationRq" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "note" ] ;
fhir:variable [ fhir:v "note" ]           ] ) ;
          ( fhir:rule [
fhir:name [ fhir:v "reference" ] ;
            ( fhir:source [
fhir:context [ fhir:v "cdaText" ] ;
fhir:variable [ fhir:v "t" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "note" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "text" ] ;
fhir:transform [ fhir:v "copy" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "t" ]               ] )             ] )           ] )         ] )       ] )     ] [
fhir:name [ fhir:v "substract" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "entry" ] ;
fhir:variable [ fhir:v "entry1" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "bundle" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "entry" ] ;
fhir:variable [ fhir:v "e1" ]       ] [
fhir:context [ fhir:v "e1" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "request" ] ;
fhir:variable [ fhir:v "request" ] ;
fhir:transform [ fhir:v "create" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "BackboneElement" ]         ] )       ] [
fhir:context [ fhir:v "request" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "method" ] ;
fhir:transform [ fhir:v "copy" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "POST" ]         ] )       ] [
fhir:context [ fhir:v "e1" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "resource" ] ;
fhir:variable [ fhir:v "medicationRq" ] ;
fhir:transform [ fhir:v "create" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "MedicationRequest" ]         ] )       ] [
fhir:context [ fhir:v "medicationRq" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "id" ] ;
fhir:variable [ fhir:v "uuid1" ] ;
fhir:transform [ fhir:v "uuid" ]       ] [
fhir:context [ fhir:v "e1" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "fullUrl" ] ;
fhir:transform [ fhir:v "append" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "https://example/MedicationRequest/" ]         ] [
fhir:value [ fhir:v "uuid1" ]         ] )       ] [
fhir:context [ fhir:v "request" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "url" ] ;
fhir:transform [ fhir:v "copy" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "MedicationRequest" ]         ] )       ] [
fhir:context [ fhir:v "tgt" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "entry" ] ;
fhir:variable [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "create" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "Reference" ]         ] )       ] [
fhir:context [ fhir:v "reference" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "'https://example/MedicationRequest/' + %medicationRq.id" ]         ] )       ] ) ;
      ( fhir:rule [
fhir:name [ fhir:v "reference" ] ;
        ( fhir:source [
fhir:context [ fhir:v "src" ]         ] ) ;
        ( fhir:target [
fhir:context [ fhir:v "medicationRq" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "subject" ] ;
fhir:variable [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "create" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "Reference" ]           ] )         ] [
fhir:context [ fhir:v "reference" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "'https://example/Patient/' + %patient.id" ]           ] )         ] )       ] [
fhir:name [ fhir:v "reference" ] ;
        ( fhir:source [
fhir:context [ fhir:v "src" ]         ] ) ;
        ( fhir:target [
fhir:context [ fhir:v "medicationRq" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "encounter" ] ;
fhir:variable [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "create" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "Reference" ]           ] )         ] [
fhir:context [ fhir:v "reference" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "'https://example/Encounter/' + %enc.id" ]           ] )         ] )       ] [
fhir:name [ fhir:v "status" ] ;
        ( fhir:source [
fhir:context [ fhir:v "src" ]         ] ) ;
        ( fhir:target [
fhir:context [ fhir:v "medicationRq" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "status" ] ;
fhir:transform [ fhir:v "copy" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "active" ]           ] )         ] )       ] [
fhir:name [ fhir:v "intent" ] ;
        ( fhir:source [
fhir:context [ fhir:v "src" ]         ] ) ;
        ( fhir:target [
fhir:context [ fhir:v "medicationRq" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "intent" ] ;
fhir:transform [ fhir:v "copy" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "order" ]           ] )         ] )       ] [
fhir:name [ fhir:v "participant" ] ;
        ( fhir:source [
fhir:context [ fhir:v "entry1" ] ;
fhir:element [ fhir:v "substanceAdministration" ] ;
fhir:variable [ fhir:v "substract" ]         ] ) ;
        ( fhir:rule [
fhir:name [ fhir:v "cons" ] ;
          ( fhir:source [
fhir:context [ fhir:v "substract" ] ;
fhir:element [ fhir:v "consumable" ] ;
fhir:variable [ fhir:v "cons" ]           ] ) ;
          ( fhir:rule [
fhir:name [ fhir:v "man1" ] ;
            ( fhir:source [
fhir:context [ fhir:v "cons" ] ;
fhir:element [ fhir:v "manufacturedProduct" ] ;
fhir:variable [ fhir:v "man1" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "bundle" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "entry" ] ;
fhir:variable [ fhir:v "e1" ]             ] [
fhir:context [ fhir:v "e1" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "request" ] ;
fhir:variable [ fhir:v "request" ] ;
fhir:transform [ fhir:v "create" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "BackboneElement" ]               ] )             ] [
fhir:context [ fhir:v "request" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "method" ] ;
fhir:transform [ fhir:v "copy" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "POST" ]               ] )             ] [
fhir:context [ fhir:v "e1" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "resource" ] ;
fhir:variable [ fhir:v "medication" ] ;
fhir:transform [ fhir:v "create" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "Medication" ]               ] )             ] [
fhir:context [ fhir:v "medication" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "id" ] ;
fhir:variable [ fhir:v "uuid1" ] ;
fhir:transform [ fhir:v "uuid" ]             ] [
fhir:context [ fhir:v "e1" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "fullUrl" ] ;
fhir:transform [ fhir:v "append" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "https://example/Medication/" ]               ] [
fhir:value [ fhir:v "uuid1" ]               ] )             ] [
fhir:context [ fhir:v "request" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "url" ] ;
fhir:transform [ fhir:v "copy" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "Medication" ]               ] )             ] [
fhir:context [ fhir:v "medicationRq" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "medication" ] ;
fhir:variable [ fhir:v "medref" ] ;
fhir:transform [ fhir:v "create" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "Reference" ]               ] )             ] [
fhir:context [ fhir:v "medref" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "'https://example/Medication/' + %medication.id" ]               ] )             ] ) ;
            ( fhir:rule [
fhir:name [ fhir:v "mm" ] ;
              ( fhir:source [
fhir:context [ fhir:v "man1" ] ;
fhir:element [ fhir:v "manufacturedMaterial" ] ;
fhir:variable [ fhir:v "mm" ]               ] ) ;
              ( fhir:rule [
fhir:name [ fhir:v "code" ] ;
                ( fhir:source [
fhir:context [ fhir:v "mm" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "vvv" ]                 ] ) ;
                ( fhir:target [
fhir:context [ fhir:v "medication" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "vvv" ] ;
fhir:transform [ fhir:v "create" ]                 ] )               ] )             ] [
fhir:name [ fhir:v "administrationUnitCode" ] ;
              ( fhir:source [
fhir:context [ fhir:v "substract" ] ;
fhir:element [ fhir:v "administrationUnitCode" ] ;
fhir:variable [ fhir:v "vvv" ]               ] ) ;
              ( fhir:target [
fhir:context [ fhir:v "medication" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "form" ] ;
fhir:variable [ fhir:v "vvv" ] ;
fhir:transform [ fhir:v "create" ]               ] )             ] [
fhir:name [ fhir:v "entryR" ] ;
              ( fhir:source [
fhir:context [ fhir:v "substract" ] ;
fhir:element [ fhir:v "entryRelationship" ] ;
fhir:variable [ fhir:v "entryR" ]               ] ) ;
              ( fhir:rule [
fhir:name [ fhir:v "obs" ] ;
                ( fhir:source [
fhir:context [ fhir:v "entryR" ] ;
fhir:element [ fhir:v "observation" ] ;
fhir:variable [ fhir:v "observation" ]                 ] ) ;
                ( fhir:rule [
fhir:name [ fhir:v "ingredient" ] ;
                  ( fhir:source [
fhir:context [ fhir:v "observation" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:condition [ fhir:v "displayName = 'Grammatura'" ]                   ] ) ;
                  ( fhir:target [
fhir:context [ fhir:v "medication" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "ingredient" ] ;
fhir:variable [ fhir:v "ingredient" ]                   ] ) ;
                  ( fhir:rule [
fhir:name [ fhir:v "consumable" ] ;
                    ( fhir:source [
fhir:context [ fhir:v "substract" ] ;
fhir:element [ fhir:v "consumable" ] ;
fhir:variable [ fhir:v "consumable" ]                     ] ) ;
                    ( fhir:rule [
fhir:name [ fhir:v "product" ] ;
                      ( fhir:source [
fhir:context [ fhir:v "consumable" ] ;
fhir:element [ fhir:v "manufacturedProduct" ] ;
fhir:variable [ fhir:v "manufacturedProduct" ]                       ] ) ;
                      ( fhir:rule [
fhir:name [ fhir:v "material" ] ;
                        ( fhir:source [
fhir:context [ fhir:v "manufacturedProduct" ] ;
fhir:element [ fhir:v "manufacturedMaterial" ] ;
fhir:variable [ fhir:v "manufacturedMaterial" ]                         ] ) ;
                        ( fhir:rule [
fhir:name [ fhir:v "CE" ] ;
                          ( fhir:source [
fhir:context [ fhir:v "manufacturedMaterial" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "code" ]                           ] ) ;
                          ( fhir:target [
fhir:context [ fhir:v "ingredient" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "item" ] ;
fhir:variable [ fhir:v "value" ] ;
fhir:transform [ fhir:v "create" ] ;
                            ( fhir:parameter [
fhir:value [ fhir:v "CodeableConcept" ]                             ] )                           ] ) ;
                          ( fhir:dependent [
fhir:name [ fhir:v "CECodeableConcept" ] ;
                            ( fhir:variable [ fhir:v "code" ] [ fhir:v "value" ] )                           ] )                         ] )                       ] )                     ] )                   ] [
fhir:name [ fhir:v "strenght" ] ;
                    ( fhir:source [
fhir:context [ fhir:v "observation" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:variable [ fhir:v "value" ]                     ] ) ;
                    ( fhir:target [
fhir:context [ fhir:v "ingredient" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "strength" ] ;
fhir:variable [ fhir:v "strength" ]                     ] ) ;
                    ( fhir:rule [
fhir:name [ fhir:v "numerator" ] ;
                      ( fhir:source [
fhir:context [ fhir:v "value" ]                       ] ) ;
                      ( fhir:target [
fhir:context [ fhir:v "strength" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "numerator" ] ;
fhir:variable [ fhir:v "numerator" ]                       ] ) ;
                      ( fhir:rule [
fhir:name [ fhir:v "valueN" ] ;
                        ( fhir:source [
fhir:context [ fhir:v "value" ]                         ] ) ;
                        ( fhir:target [
fhir:context [ fhir:v "numerator" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
                          ( fhir:parameter [
fhir:value [ fhir:v "value.value" ]                           ] )                         ] )                       ] )                     ] [
fhir:name [ fhir:v "denominator" ] ;
                      ( fhir:source [
fhir:context [ fhir:v "value" ]                       ] ) ;
                      ( fhir:target [
fhir:context [ fhir:v "strength" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "denominator" ] ;
fhir:variable [ fhir:v "denominator" ]                       ] ) ;
                      ( fhir:rule [
fhir:name [ fhir:v "valueD" ] ;
                        ( fhir:source [
fhir:context [ fhir:v "value" ]                         ] ) ;
                        ( fhir:target [
fhir:context [ fhir:v "denominator" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:transform [ fhir:v "copy" ] ;
                          ( fhir:parameter [
fhir:value [ fhir:v "1"^^xsd:integer ]                           ] )                         ] )                       ] )                     ] )                   ] )                 ] [
fhir:name [ fhir:v "quantita" ] ;
                  ( fhir:source [
fhir:context [ fhir:v "observation" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:condition [ fhir:v "displayName = 'Quantità nella Confezione'" ]                   ] ) ;
                  ( fhir:rule [
fhir:name [ fhir:v "amount" ] ;
                    ( fhir:source [
fhir:context [ fhir:v "observation" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:variable [ fhir:v "value" ]                     ] ) ;
                    ( fhir:target [
fhir:context [ fhir:v "medication" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "amount" ] ;
fhir:variable [ fhir:v "amount" ]                     ] ) ;
                    ( fhir:rule [
fhir:name [ fhir:v "numerator" ] ;
                      ( fhir:source [
fhir:context [ fhir:v "value" ]                       ] ) ;
                      ( fhir:target [
fhir:context [ fhir:v "amount" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "numerator" ] ;
fhir:variable [ fhir:v "numerator" ]                       ] ) ;
                      ( fhir:rule [
fhir:name [ fhir:v "valueN" ] ;
                        ( fhir:source [
fhir:context [ fhir:v "value" ]                         ] ) ;
                        ( fhir:target [
fhir:context [ fhir:v "numerator" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
                          ( fhir:parameter [
fhir:value [ fhir:v "value.value" ]                           ] )                         ] )                       ] )                     ] [
fhir:name [ fhir:v "denominator" ] ;
                      ( fhir:source [
fhir:context [ fhir:v "value" ]                       ] ) ;
                      ( fhir:target [
fhir:context [ fhir:v "amount" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "denominator" ] ;
fhir:variable [ fhir:v "denominator" ]                       ] ) ;
                      ( fhir:rule [
fhir:name [ fhir:v "valueD" ] ;
                        ( fhir:source [
fhir:context [ fhir:v "value" ]                         ] ) ;
                        ( fhir:target [
fhir:context [ fhir:v "denominator" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:transform [ fhir:v "copy" ] ;
                          ( fhir:parameter [
fhir:value [ fhir:v "1"^^xsd:integer ]                           ] )                         ] )                       ] )                     ] )                   ] )                 ] )               ] )             ] [
fhir:name [ fhir:v "entry" ] ;
              ( fhir:source [
fhir:context [ fhir:v "substract" ] ;
fhir:element [ fhir:v "entryRelationship" ] ;
fhir:variable [ fhir:v "entryRelationship" ]               ] ) ;
              ( fhir:rule [
fhir:name [ fhir:v "sub" ] ;
                ( fhir:source [
fhir:context [ fhir:v "entryRelationship" ] ;
fhir:element [ fhir:v "supply" ] ;
fhir:variable [ fhir:v "sup" ]                 ] ) ;
                ( fhir:target [
fhir:context [ fhir:v "medicationRq" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "dispenseRequest" ] ;
fhir:variable [ fhir:v "dispreq" ]                 ] ) ;
                ( fhir:rule [
fhir:name [ fhir:v "quantity" ] ;
                  ( fhir:source [
fhir:context [ fhir:v "sup" ]                   ] ) ;
                  ( fhir:target [
fhir:context [ fhir:v "dispreq" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "quantity" ] ;
fhir:variable [ fhir:v "quantity" ] ;
fhir:transform [ fhir:v "create" ] ;
                    ( fhir:parameter [
fhir:value [ fhir:v "SimpleQuantity" ]                     ] )                   ] ) ;
                  ( fhir:rule [
fhir:name [ fhir:v "quantity" ] ;
                    ( fhir:source [
fhir:context [ fhir:v "sup" ] ;
fhir:element [ fhir:v "quantity" ] ;
fhir:variable [ fhir:v "q" ]                     ] ) ;
                    ( fhir:target [
fhir:context [ fhir:v "quantity" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
                      ( fhir:parameter [
fhir:value [ fhir:v "q.value" ]                       ] )                     ] )                   ] )                 ] )               ] )             ] )           ] )         ] [
fhir:name [ fhir:v "tx" ] ;
          ( fhir:source [
fhir:context [ fhir:v "substract" ] ;
fhir:element [ fhir:v "text" ] ;
fhir:variable [ fhir:v "tx" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "medicationRq" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "note" ] ;
fhir:variable [ fhir:v "note" ]           ] ) ;
          ( fhir:rule [
fhir:name [ fhir:v "reference" ] ;
            ( fhir:source [
fhir:context [ fhir:v "tx" ] ;
fhir:element [ fhir:v "reference" ] ;
fhir:variable [ fhir:v "ref" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "note" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "text" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "ref.value" ]               ] )             ] )           ] )         ] [
fhir:name [ fhir:v "statusCode" ] ;
          ( fhir:source [
fhir:context [ fhir:v "substract" ] ;
fhir:element [ fhir:v "statusCode" ] ;
fhir:variable [ fhir:v "st" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "medicationRq" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "status" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "st.code" ]             ] )           ] )         ] [
fhir:name [ fhir:v "period" ] ;
          ( fhir:source [
fhir:context [ fhir:v "substract" ] ;
fhir:type [ fhir:v "IVL_TS" ] ;
fhir:element [ fhir:v "effectiveTime" ] ;
fhir:variable [ fhir:v "eff" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "medicationRq" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "dosageInstruction" ] ;
fhir:variable [ fhir:v "dosage" ] ;
fhir:transform [ fhir:v "create" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "Dosage" ]             ] )           ] ) ;
          ( fhir:rule [
fhir:name [ fhir:v "timing" ] ;
            ( fhir:source [
fhir:context [ fhir:v "eff" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "dosage" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "timing" ] ;
fhir:variable [ fhir:v "timing" ] ;
fhir:transform [ fhir:v "create" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "Timing" ]               ] )             ] ) ;
            ( fhir:rule [
fhir:name [ fhir:v "rep" ] ;
              ( fhir:source [
fhir:context [ fhir:v "eff" ]               ] ) ;
              ( fhir:target [
fhir:context [ fhir:v "timing" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "repeat" ] ;
fhir:variable [ fhir:v "rep" ]               ] ) ;
              ( fhir:rule [
fhir:name [ fhir:v "period" ] ;
                ( fhir:source [
fhir:context [ fhir:v "eff" ]                 ] ) ;
                ( fhir:target [
fhir:context [ fhir:v "rep" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "bounds" ] ;
fhir:variable [ fhir:v "period" ] ;
fhir:transform [ fhir:v "create" ] ;
                  ( fhir:parameter [
fhir:value [ fhir:v "Period" ]                   ] )                 ] ) ;
                ( fhir:dependent [
fhir:name [ fhir:v "IVLTSPeriod" ] ;
                  ( fhir:variable [ fhir:v "eff" ] [ fhir:v "period" ] )                 ] )               ] )             ] )           ] )         ] [
fhir:name [ fhir:v "period" ] ;
          ( fhir:source [
fhir:context [ fhir:v "substract" ] ;
fhir:type [ fhir:v "EIVL_TS" ] ;
fhir:element [ fhir:v "effectiveTime" ] ;
fhir:variable [ fhir:v "eff" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "medicationRq" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "dosageInstruction" ] ;
fhir:variable [ fhir:v "dosage" ] ;
fhir:transform [ fhir:v "create" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "Dosage" ]             ] )           ] ) ;
          ( fhir:rule [
fhir:name [ fhir:v "timing" ] ;
            ( fhir:source [
fhir:context [ fhir:v "eff" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "dosage" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "timing" ] ;
fhir:variable [ fhir:v "timing" ] ;
fhir:transform [ fhir:v "create" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "Timing" ]               ] )             ] ) ;
            ( fhir:rule [
fhir:name [ fhir:v "rep" ] ;
              ( fhir:source [
fhir:context [ fhir:v "eff" ]               ] ) ;
              ( fhir:target [
fhir:context [ fhir:v "timing" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "repeat" ] ;
fhir:variable [ fhir:v "rep" ]               ] ) ;
              ( fhir:rule [
fhir:name [ fhir:v "event" ] ;
                ( fhir:source [
fhir:context [ fhir:v "eff" ] ;
fhir:element [ fhir:v "event" ] ;
fhir:variable [ fhir:v "ev" ]                 ] ) ;
                ( fhir:target [
fhir:context [ fhir:v "rep" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "when" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
                  ( fhir:parameter [
fhir:value [ fhir:v "ev.code" ]                   ] )                 ] )               ] )             ] )           ] )         ] [
fhir:name [ fhir:v "tim" ] ;
          ( fhir:source [
fhir:context [ fhir:v "substract" ] ;
fhir:type [ fhir:v "IVL_TS" ] ;
fhir:element [ fhir:v "effectiveTime" ] ;
fhir:variable [ fhir:v "eff" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "medicationRq" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "dosageInstruction" ] ;
fhir:variable [ fhir:v "dosage" ] ;
fhir:transform [ fhir:v "create" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "Dosage" ]             ] )           ] [
fhir:context [ fhir:v "dosage" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "timing" ] ;
fhir:variable [ fhir:v "timing" ] ;
fhir:transform [ fhir:v "create" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "Timing" ]             ] )           ] [
fhir:context [ fhir:v "timing" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "event" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "eff.value" ]             ] )           ] )         ] [
fhir:name [ fhir:v "eff" ] ;
          ( fhir:source [
fhir:context [ fhir:v "substract" ] ;
fhir:type [ fhir:v "PIVL_TS" ] ;
fhir:element [ fhir:v "effectiveTime" ] ;
fhir:variable [ fhir:v "eff" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "medicationRq" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "dosageInstruction" ] ;
fhir:variable [ fhir:v "dosage" ] ;
fhir:transform [ fhir:v "create" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "Dosage" ]             ] )           ] ) ;
          ( fhir:rule [
fhir:name [ fhir:v "cod" ] ;
            ( fhir:source [
fhir:context [ fhir:v "eff" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "dosage" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "timing" ] ;
fhir:variable [ fhir:v "timing" ] ;
fhir:transform [ fhir:v "create" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "Timing" ]               ] )             ] ) ;
            ( fhir:dependent [
fhir:name [ fhir:v "periodTiming" ] ;
              ( fhir:variable [ fhir:v "eff" ] [ fhir:v "timing" ] )             ] )           ] )         ] [
fhir:name [ fhir:v "dosage" ] ;
          ( fhir:source [
fhir:context [ fhir:v "substract" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "medicationRq" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "dosageInstruction" ] ;
fhir:variable [ fhir:v "dosage" ] ;
fhir:transform [ fhir:v "create" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "Dosage" ]             ] )           ] ) ;
          ( fhir:rule [
fhir:name [ fhir:v "routeCode" ] ;
            ( fhir:source [
fhir:context [ fhir:v "substract" ] ;
fhir:element [ fhir:v "routeCode" ] ;
fhir:variable [ fhir:v "vvv" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "dosage" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "route" ] ;
fhir:variable [ fhir:v "vvv" ] ;
fhir:transform [ fhir:v "create" ]             ] )           ] )         ] [
fhir:name [ fhir:v "dosage" ] ;
          ( fhir:source [
fhir:context [ fhir:v "substract" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "medicationRq" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "dosageInstruction" ] ;
fhir:variable [ fhir:v "dosage" ] ;
fhir:transform [ fhir:v "create" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "Dosage" ]             ] )           ] ) ;
          ( fhir:rule [
fhir:name [ fhir:v "approachSiteCode" ] ;
            ( fhir:source [
fhir:context [ fhir:v "substract" ] ;
fhir:element [ fhir:v "approachSiteCode" ] ;
fhir:variable [ fhir:v "vvv" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "dosage" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "site" ] ;
fhir:variable [ fhir:v "vvv" ] ;
fhir:transform [ fhir:v "create" ]             ] )           ] )         ] [
fhir:name [ fhir:v "Dosage" ] ;
          ( fhir:source [
fhir:context [ fhir:v "substract" ] ;
fhir:element [ fhir:v "doseQuantity" ] ;
fhir:variable [ fhir:v "doseQuant" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "medicationRq" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "dosageInstruction" ] ;
fhir:variable [ fhir:v "dosageInstruction" ] ;
fhir:transform [ fhir:v "create" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "Dosage" ]             ] )           ] ) ;
          ( fhir:rule [
fhir:name [ fhir:v "ot" ] ;
            ( fhir:source [
fhir:context [ fhir:v "doseQuant" ] ;
fhir:element [ fhir:v "originalText" ] ;
fhir:variable [ fhir:v "ot" ]             ] ) ;
            ( fhir:rule [
fhir:name [ fhir:v "reference" ] ;
              ( fhir:source [
fhir:context [ fhir:v "ot" ] ;
fhir:element [ fhir:v "reference" ] ;
fhir:variable [ fhir:v "vvv" ]               ] ) ;
              ( fhir:target [
fhir:context [ fhir:v "dosageInstruction" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "text" ] ;
fhir:variable [ fhir:v "vvv" ] ;
fhir:transform [ fhir:v "create" ]               ] )             ] )           ] [
fhir:name [ fhir:v "dosageRate" ] ;
            ( fhir:source [
fhir:context [ fhir:v "doseQuant" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "dosageInstruction" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "doseAndRate" ] ;
fhir:variable [ fhir:v "dosageRate" ]             ] ) ;
            ( fhir:rule [
fhir:name [ fhir:v "d" ] ;
              ( fhir:source [
fhir:context [ fhir:v "doseQuant" ]               ] ) ;
              ( fhir:target [
fhir:context [ fhir:v "dosageRate" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "dose" ] ;
fhir:variable [ fhir:v "d" ] ;
fhir:transform [ fhir:v "create" ] ;
                ( fhir:parameter [
fhir:value [ fhir:v "Range" ]                 ] )               ] ) ;
              ( fhir:rule [
fhir:name [ fhir:v "low" ] ;
                ( fhir:source [
fhir:context [ fhir:v "doseQuant" ]                 ] ) ;
                ( fhir:target [
fhir:context [ fhir:v "d" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "low" ] ;
fhir:variable [ fhir:v "l" ] ;
fhir:transform [ fhir:v "create" ] ;
                  ( fhir:parameter [
fhir:value [ fhir:v "SimpleQuantity" ]                   ] )                 ] ) ;
                ( fhir:rule [
fhir:name [ fhir:v "low" ] ;
                  ( fhir:source [
fhir:context [ fhir:v "doseQuant" ] ;
fhir:element [ fhir:v "low" ] ;
fhir:variable [ fhir:v "lo" ]                   ] ) ;
                  ( fhir:target [
fhir:context [ fhir:v "l" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
                    ( fhir:parameter [
fhir:value [ fhir:v "lo.value" ]                     ] )                   ] )                 ] [
fhir:name [ fhir:v "low" ] ;
                  ( fhir:source [
fhir:context [ fhir:v "doseQuant" ] ;
fhir:element [ fhir:v "low" ] ;
fhir:variable [ fhir:v "lo" ]                   ] ) ;
                  ( fhir:target [
fhir:context [ fhir:v "l" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "unit" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
                    ( fhir:parameter [
fhir:value [ fhir:v "lo.unit" ]                     ] )                   ] )                 ] )               ] [
fhir:name [ fhir:v "low" ] ;
                ( fhir:source [
fhir:context [ fhir:v "doseQuant" ]                 ] ) ;
                ( fhir:target [
fhir:context [ fhir:v "d" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "high" ] ;
fhir:variable [ fhir:v "h" ] ;
fhir:transform [ fhir:v "create" ] ;
                  ( fhir:parameter [
fhir:value [ fhir:v "SimpleQuantity" ]                   ] )                 ] ) ;
                ( fhir:rule [
fhir:name [ fhir:v "high" ] ;
                  ( fhir:source [
fhir:context [ fhir:v "doseQuant" ] ;
fhir:element [ fhir:v "high" ] ;
fhir:variable [ fhir:v "hi" ]                   ] ) ;
                  ( fhir:target [
fhir:context [ fhir:v "h" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
                    ( fhir:parameter [
fhir:value [ fhir:v "hi.value" ]                     ] )                   ] )                 ] [
fhir:name [ fhir:v "high" ] ;
                  ( fhir:source [
fhir:context [ fhir:v "doseQuant" ] ;
fhir:element [ fhir:v "high" ] ;
fhir:variable [ fhir:v "hi" ]                   ] ) ;
                  ( fhir:target [
fhir:context [ fhir:v "h" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "unit" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
                    ( fhir:parameter [
fhir:value [ fhir:v "hi.unit" ]                     ] )                   ] )                 ] )               ] )             ] )           ] )         ] [
fhir:name [ fhir:v "rateq" ] ;
          ( fhir:source [
fhir:context [ fhir:v "substract" ] ;
fhir:element [ fhir:v "rateQuantity" ] ;
fhir:variable [ fhir:v "rateQuantity" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "medicationRq" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "dosageInstruction" ] ;
fhir:variable [ fhir:v "dosageInstruction1" ] ;
fhir:transform [ fhir:v "create" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "Dosage" ]             ] )           ] ) ;
          ( fhir:rule [
fhir:name [ fhir:v "ot" ] ;
            ( fhir:source [
fhir:context [ fhir:v "rateQuantity" ] ;
fhir:element [ fhir:v "originalText" ] ;
fhir:variable [ fhir:v "ot" ]             ] ) ;
            ( fhir:rule [
fhir:name [ fhir:v "reference" ] ;
              ( fhir:source [
fhir:context [ fhir:v "ot" ] ;
fhir:element [ fhir:v "reference" ] ;
fhir:variable [ fhir:v "vvv" ]               ] ) ;
              ( fhir:target [
fhir:context [ fhir:v "dosageInstruction1" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "text" ] ;
fhir:variable [ fhir:v "vvv" ] ;
fhir:transform [ fhir:v "create" ]               ] )             ] )           ] [
fhir:name [ fhir:v "dosageRate" ] ;
            ( fhir:source [
fhir:context [ fhir:v "rateQuantity" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "dosageInstruction1" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "doseAndRate" ] ;
fhir:variable [ fhir:v "dosageRate" ]             ] ) ;
            ( fhir:rule [
fhir:name [ fhir:v "d" ] ;
              ( fhir:source [
fhir:context [ fhir:v "rateQuantity" ]               ] ) ;
              ( fhir:target [
fhir:context [ fhir:v "dosageRate" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "rate" ] ;
fhir:variable [ fhir:v "d" ] ;
fhir:transform [ fhir:v "create" ] ;
                ( fhir:parameter [
fhir:value [ fhir:v "Range" ]                 ] )               ] ) ;
              ( fhir:rule [
fhir:name [ fhir:v "low" ] ;
                ( fhir:source [
fhir:context [ fhir:v "rateQuantity" ]                 ] ) ;
                ( fhir:target [
fhir:context [ fhir:v "d" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "low" ] ;
fhir:variable [ fhir:v "l" ] ;
fhir:transform [ fhir:v "create" ] ;
                  ( fhir:parameter [
fhir:value [ fhir:v "SimpleQuantity" ]                   ] )                 ] ) ;
                ( fhir:rule [
fhir:name [ fhir:v "low" ] ;
                  ( fhir:source [
fhir:context [ fhir:v "rateQuantity" ] ;
fhir:element [ fhir:v "low" ] ;
fhir:variable [ fhir:v "lo" ]                   ] ) ;
                  ( fhir:target [
fhir:context [ fhir:v "l" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
                    ( fhir:parameter [
fhir:value [ fhir:v "lo.value" ]                     ] )                   ] )                 ] [
fhir:name [ fhir:v "low" ] ;
                  ( fhir:source [
fhir:context [ fhir:v "rateQuantity" ] ;
fhir:element [ fhir:v "low" ] ;
fhir:variable [ fhir:v "lo" ]                   ] ) ;
                  ( fhir:target [
fhir:context [ fhir:v "l" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "unit" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
                    ( fhir:parameter [
fhir:value [ fhir:v "lo.unit" ]                     ] )                   ] )                 ] )               ] [
fhir:name [ fhir:v "low" ] ;
                ( fhir:source [
fhir:context [ fhir:v "rateQuantity" ]                 ] ) ;
                ( fhir:target [
fhir:context [ fhir:v "d" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "high" ] ;
fhir:variable [ fhir:v "h" ] ;
fhir:transform [ fhir:v "create" ] ;
                  ( fhir:parameter [
fhir:value [ fhir:v "SimpleQuantity" ]                   ] )                 ] ) ;
                ( fhir:rule [
fhir:name [ fhir:v "high" ] ;
                  ( fhir:source [
fhir:context [ fhir:v "rateQuantity" ] ;
fhir:element [ fhir:v "high" ] ;
fhir:variable [ fhir:v "hi" ]                   ] ) ;
                  ( fhir:target [
fhir:context [ fhir:v "h" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
                    ( fhir:parameter [
fhir:value [ fhir:v "hi.value" ]                     ] )                   ] )                 ] [
fhir:name [ fhir:v "high" ] ;
                  ( fhir:source [
fhir:context [ fhir:v "rateQuantity" ] ;
fhir:element [ fhir:v "high" ] ;
fhir:variable [ fhir:v "hi" ]                   ] ) ;
                  ( fhir:target [
fhir:context [ fhir:v "h" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "unit" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
                    ( fhir:parameter [
fhir:value [ fhir:v "hi.unit" ]                     ] )                   ] )                 ] )               ] )             ] )           ] )         ] [
fhir:name [ fhir:v "partRole" ] ;
          ( fhir:source [
fhir:context [ fhir:v "substract" ] ;
fhir:element [ fhir:v "participant" ] ;
fhir:variable [ fhir:v "part" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "bundle" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "entry" ] ;
fhir:variable [ fhir:v "e1" ]           ] [
fhir:context [ fhir:v "e1" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "request" ] ;
fhir:variable [ fhir:v "request" ] ;
fhir:transform [ fhir:v "create" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "BackboneElement" ]             ] )           ] [
fhir:context [ fhir:v "request" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "method" ] ;
fhir:transform [ fhir:v "copy" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "PUT" ]             ] )           ] [
fhir:context [ fhir:v "e1" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "resource" ] ;
fhir:variable [ fhir:v "practitioner" ] ;
fhir:transform [ fhir:v "create" ] ;
            ( fhir:parameter [
fhir:value [ fhir:v "Practitioner" ]             ] )           ] ) ;
          ( fhir:rule [
fhir:name [ fhir:v "time" ] ;
            ( fhir:source [
fhir:context [ fhir:v "part" ] ;
fhir:element [ fhir:v "time" ] ;
fhir:variable [ fhir:v "time" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "medicationRq" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "authoredOn" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
              ( fhir:parameter [
fhir:value [ fhir:v "time.value" ]               ] )             ] )           ] [
fhir:name [ fhir:v "perf" ] ;
            ( fhir:source [
fhir:context [ fhir:v "part" ] ;
fhir:element [ fhir:v "participantRole" ] ;
fhir:variable [ fhir:v "partRole" ]             ] ) ;
            ( fhir:rule [
fhir:name [ fhir:v "meta" ] ;
              ( fhir:source [
fhir:context [ fhir:v "partRole" ]               ] ) ;
              ( fhir:target [
fhir:context [ fhir:v "practitioner" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "meta" ] ;
fhir:variable [ fhir:v "meta" ]               ] ) ;
              ( fhir:rule [
fhir:name [ fhir:v "coding" ] ;
                ( fhir:source [
fhir:context [ fhir:v "partRole" ]                 ] ) ;
                ( fhir:target [
fhir:context [ fhir:v "meta" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "tag" ] ;
fhir:variable [ fhir:v "coding" ] ;
fhir:transform [ fhir:v "create" ] ;
                  ( fhir:parameter [
fhir:value [ fhir:v "Coding" ]                   ] )                 ] ) ;
                ( fhir:rule [
fhir:name [ fhir:v "system" ] ;
                  ( fhir:source [
fhir:context [ fhir:v "partRole" ]                   ] ) ;
                  ( fhir:target [
fhir:context [ fhir:v "coding" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "system" ] ;
fhir:transform [ fhir:v "copy" ] ;
                    ( fhir:parameter [
fhir:value [ fhir:v "http://algoritmodiscoring" ]                     ] )                   ] )                 ] [
fhir:name [ fhir:v "code" ] ;
                  ( fhir:source [
fhir:context [ fhir:v "partRole" ]                   ] ) ;
                  ( fhir:target [
fhir:context [ fhir:v "coding" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:transform [ fhir:v "copy" ] ;
                    ( fhir:parameter [
fhir:value [ fhir:v "ClinicalDocument/body/TerapiaFarmacologicaRicovero/participant" ]                     ] )                   ] )                 ] )               ] )             ] [
fhir:name [ fhir:v "identifier" ] ;
              ( fhir:source [
fhir:context [ fhir:v "partRole" ] ;
fhir:element [ fhir:v "id" ] ;
fhir:variable [ fhir:v "id" ]               ] ) ;
              ( fhir:target [
fhir:context [ fhir:v "practitioner" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "identifier" ] ;
fhir:variable [ fhir:v "identifier" ]               ] ) ;
              ( fhir:rule [
fhir:name [ fhir:v "root1" ] ;
                ( fhir:source [
fhir:context [ fhir:v "id" ] ;
fhir:element [ fhir:v "root" ] ;
fhir:variable [ fhir:v "r" ]                 ] ) ;
                ( fhir:target [
fhir:context [ fhir:v "identifier" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "system" ] ;
fhir:transform [ fhir:v "translate" ] ;
                  ( fhir:parameter [
fhir:value [ fhir:v "r" ]                   ] [
fhir:value [ fhir:v "http://hl7.org/fhir/ConceptMap/special-oid2uri" ]                   ] [
fhir:value [ fhir:v "uri" ]                   ] )                 ] )               ] [
fhir:name [ fhir:v "extension" ] ;
                ( fhir:source [
fhir:context [ fhir:v "id" ] ;
fhir:element [ fhir:v "extension" ] ;
fhir:variable [ fhir:v "ext" ]                 ] ) ;
                ( fhir:target [
fhir:context [ fhir:v "identifier" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:transform [ fhir:v "copy" ] ;
                  ( fhir:parameter [
fhir:value [ fhir:v "ext" ]                   ] )                 ] )               ] [
fhir:name [ fhir:v "assigningAuthorityName" ] ;
                ( fhir:source [
fhir:context [ fhir:v "id" ] ;
fhir:element [ fhir:v "assigningAuthorityName" ] ;
fhir:variable [ fhir:v "s" ]                 ] ) ;
                ( fhir:target [
fhir:context [ fhir:v "identifier" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "assigner" ] ;
fhir:variable [ fhir:v "a" ]                 ] [
fhir:context [ fhir:v "a" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "display" ] ;
fhir:transform [ fhir:v "copy" ] ;
                  ( fhir:parameter [
fhir:value [ fhir:v "s" ]                   ] )                 ] )               ] [
fhir:name [ fhir:v "r" ] ;
                ( fhir:source [
fhir:context [ fhir:v "id" ] ;
fhir:element [ fhir:v "root" ] ;
fhir:variable [ fhir:v "r" ]                 ] ) ;
                ( fhir:rule [
fhir:name [ fhir:v "aut" ] ;
                  ( fhir:source [
fhir:context [ fhir:v "id" ] ;
fhir:element [ fhir:v "extension" ] ;
fhir:variable [ fhir:v "ext" ]                   ] ) ;
                  ( fhir:target [
fhir:context [ fhir:v "practitioner" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "id" ] ;
fhir:variable [ fhir:v "uuid2" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
                    ( fhir:parameter [
fhir:value [ fhir:v "r + '-' + ext" ]                     ] )                   ] [
fhir:context [ fhir:v "e1" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "fullUrl" ] ;
fhir:transform [ fhir:v "append" ] ;
                    ( fhir:parameter [
fhir:value [ fhir:v "https://example/Practitioner/" ]                     ] [
fhir:value [ fhir:v "uuid2" ]                     ] )                   ] [
fhir:context [ fhir:v "request" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "url" ] ;
fhir:transform [ fhir:v "append" ] ;
                    ( fhir:parameter [
fhir:value [ fhir:v "Practitioner/" ]                     ] [
fhir:value [ fhir:v "uuid1" ]                     ] )                   ] [
fhir:context [ fhir:v "medicationRq" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "performer" ] ;
fhir:variable [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "create" ] ;
                    ( fhir:parameter [
fhir:value [ fhir:v "Reference" ]                     ] )                   ] [
fhir:context [ fhir:v "reference" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "reference" ] ;
fhir:transform [ fhir:v "evaluate" ] ;
                    ( fhir:parameter [
fhir:value [ fhir:v "'https://example/Practitioner/' + %practitioner.id" ]                     ] )                   ] )                 ] )               ] )             ] [
fhir:name [ fhir:v "2.16.840.1.113883.2.9.4.3.2" ] ;
              ( fhir:source [
fhir:context [ fhir:v "partRole" ] ;
fhir:element [ fhir:v "id" ] ;
fhir:variable [ fhir:v "id" ] ;
fhir:condition [ fhir:v "(root = '2.16.840.1.113883.2.9.4.3.2')" ]               ] ) ;
              ( fhir:rule [
fhir:name [ fhir:v "UUID" ] ;
                ( fhir:source [
fhir:context [ fhir:v "id" ] ;
fhir:element [ fhir:v "extension" ] ;
fhir:variable [ fhir:v "ext" ]                 ] ) ;
                ( fhir:target [
fhir:context [ fhir:v "request" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "url" ] ;
fhir:transform [ fhir:v "append" ] ;
                  ( fhir:parameter [
fhir:value [ fhir:v "Practitioner?identifier=" ]                   ] [
fhir:value [ fhir:v "ext" ]                   ] )                 ] )               ] )             ] [
fhir:name [ fhir:v "assi" ] ;
              ( fhir:source [
fhir:context [ fhir:v "partRole" ] ;
fhir:element [ fhir:v "playingEntity" ] ;
fhir:variable [ fhir:v "assi" ]               ] ) ;
              ( fhir:rule [
fhir:name [ fhir:v "name" ] ;
                ( fhir:source [
fhir:context [ fhir:v "assi" ] ;
fhir:element [ fhir:v "name" ] ;
fhir:variable [ fhir:v "vvv" ]                 ] ) ;
                ( fhir:target [
fhir:context [ fhir:v "practitioner" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "name" ] ;
fhir:variable [ fhir:v "vvv" ] ;
fhir:transform [ fhir:v "create" ]                 ] )               ] )             ] )           ] )         ] )       ] )     ] )
  ] ) . #