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 - PRESCRIZIONE SPECIALISTICA - 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 "cda2fhirSpecPrescription"] ; # 
  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/cda2fhirSpecPrescription&quot; = &quot;cda2fhirSpecPrescription&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/List&quot; alias List 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 e4,  e4.request = create('BackboneElement') as request,  request.method = 'POST',  e4.resource = create('DocumentReference') as DocumentReference,  DocumentReference.id = uuid() as uuid4,  e4.fullUrl = append('https://example/DocumentReference/', uuid4),  request.url = 'DocumentReference' then {\n    cda then ClinicalDocumentToBundle(cda, patient, composition, encounter, bundle, DocumentReference) &quot;cdatobundle&quot;;\n    cda.recordTarget as recordTarget then {\n      recordTarget.patientRole as patient then {\n        patient.id as id -&gt; patient.identifier as identifier then {\n          id.root as r -&gt; identifier.system = translate(r, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri') &quot;root1&quot;;\n          id.extension as ext1 -&gt; identifier.value = ext1 &quot;value&quot;;\n          id.assigningAuthorityName as s -&gt;  identifier.assigner as a,  a.display = s;\n        } &quot;idfr&quot;;\n        patient.id as id where (root = '2.16.840.1.113883.2.9.4.3.2') or (root = '2.16.840.1.113883.2.9.4.3.7') or (root = '2.16.840.1.113883.2.9.4.3.3') or (root = '2.16.840.1.113883.2.9.4.3.17') or (root = '2.16.840.1.113883.2.9.4.3.18') or (root = '2.16.840.1.113883.2.9.2.10.4.1.1') or (root = '2.16.840.1.113883.2.9.2.20.4.1.1') or (root = '2.16.840.1.113883.2.9.2.30.4.1.1') or (root = '2.16.840.1.113883.2.9.2.41.4.1.1') or (root = '2.16.840.1.113883.2.9.2.42.4.1.1') or (root = '2.16.840.1.113883.2.9.2.50.4.1.1') or (root = '2.16.840.1.113883.2.9.2.60.4.1.1') or (root = '2.16.840.1.113883.2.9.2.70.4.1.1') or (root = '2.16.840.1.113883.2.9.2.80.4.1.1') or (root = '2.16.840.1.113883.2.9.2.90.4.1.1') or (root = '2.16.840.1.113883.2.9.2.100.4.1.1') or (root = '2.16.840.1.113883.2.9.2.110.4.1.1') or (root = '2.16.840.1.113883.2.9.2.120.4.1.1') or (root = '2.16.840.1.113883.2.9.2.130.4.1.1') or (root = '2.16.840.1.113883.2.9.2.140.4.1.1') or (root = '2.16.840.1.113883.2.9.2.150.4.1.1') or (root = '2.16.840.1.113883.2.9.2.160.4.1.1') or (root = '2.16.840.1.113883.2.9.2.170.4.1.1') or (root = '2.16.840.1.113883.2.9.2.180.4.1.1') or (root = '2.16.840.1.113883.2.9.2.190.4.1.1') or (root = '2.16.840.1.113883.2.9.2.200.4.1.1') or (root = '2.16.840.1.113883.2.9.2.10.4.1') or (root = '2.16.840.1.113883.2.9.2.20.4.1') or (root = '2.16.840.1.113883.2.9.2.30.4.1') or (root = '2.16.840.1.113883.2.9.2.41.4.1') or (root = '2.16.840.1.113883.2.9.2.42.4.1') or (root = '2.16.840.1.113883.2.9.2.50.4.1') or (root = '2.16.840.1.113883.2.9.2.60.4.1') or (root = '2.16.840.1.113883.2.9.2.70.4.1') or (root = '2.16.840.1.113883.2.9.2.80.4.1') or (root = '2.16.840.1.113883.2.9.2.90.4.1') or (root = '2.16.840.1.113883.2.9.2.100.4.1') or (root = '2.16.840.1.113883.2.9.2.110.4.1') or (root = '2.16.840.1.113883.2.9.2.120.4.1') or (root = '2.16.840.1.113883.2.9.2.130.4.1') or (root = '2.16.840.1.113883.2.9.2.140.4.1') or (root = '2.16.840.1.113883.2.9.2.150.4.1') or (root = '2.16.840.1.113883.2.9.2.160.4.1') or (root = '2.16.840.1.113883.2.9.2.170.4.1') or (root = '2.16.840.1.113883.2.9.2.180.4.1') or (root = '2.16.840.1.113883.2.9.2.190.4.1') or (root = '2.16.840.1.113883.2.9.2.200.4.1') or (root = '2.16.840.1.113883.2.9.4.3.15') then {\n          id.extension as ext -&gt; requestPAT.url = append('Patient?identifier=', ext) &quot;UUID&quot;;\n        } &quot;ext&quot;;\n      } &quot;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 -&gt;  bundle.entry as e,  e.request = create('BackboneElement') as request,  request.method = 'POST',  e.resource = create('ServiceRequest') as ServiceRequest,  ServiceRequest.id = uuid() as uuid1,  e.fullUrl = append('https://example/ServiceRequest/', uuid1),  request.url = 'ServiceRequest' then {\n    cda -&gt; ServiceRequest.intent = 'order' &quot;intent&quot;;\n    cda -&gt; ServiceRequest.status = 'unknown' &quot;stats&quot;;\n    cda -&gt;  ServiceRequest.subject = create('Reference') as reference,  reference.reference = ('https://example/Patient/' + %patient.id) &quot;reference&quot;;\n    cda.component as component then {\n      component.structuredBody as body then {\n        body.component as component then {\n          component.section as srcSection then {\n            srcSection.code -&gt; composition.section as tgtSection then ClinicalDocumentSection(cda, srcSection, patient, tgtSection, bundle, encounter, ServiceRequest);\n          };\n        };\n      } &quot;body&quot;;\n    };\n  } &quot;ServiceRequest&quot;;\n}\n\ngroup ClinicalDocumentSection(source cda : ClinicalDocument, source src : Section, target patient : Patient, target tgt, target bundle : Bundle, target enc : Encounter, target ServiceRequest : ServiceRequest) {\n  src.title as t -&gt; tgt.title = (t.dataString);\n  src.code -&gt; tgt.code;\n  src.code as code where (code = '48767-8') or (code = '51851-4') or (code = '57827-8') or (code = '57828-6') then {\n    src -&gt;  tgt.entry = create('Reference') as reference,  reference.reference = ('https://example/ServiceRequest/' + %ServiceRequest.id) &quot;reference&quot;;\n  } &quot;Note&quot;;\n  // src.entry as entry 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  // --------------Sezione Esenzioni------------------------------------------------------------------------------------------------------------------------------------\n  src.code as code where (code = '57827-8') then {\n    src.id -&gt; ServiceRequest.identifier;\n    src.entry as entry -&gt;  bundle.entry as e11,  e11.request = create('BackboneElement') as request,  request.method = 'POST',  e11.resource = create('Coverage') as Coverage,  Coverage.id = uuid() as uuid11,  e11.fullUrl = append('https://example/Coverage/', uuid11),  request.url = 'Coverage',  ServiceRequest.insurance = create('Reference') as reference,  reference.reference = ('https://example/Coverage/' + %Coverage.id) then {\n      src -&gt;  Coverage.beneficiary = create('Reference') as reference,  reference.reference = ('https://example/Patient/' + %patient.id) &quot;reference&quot;;\n      src -&gt;  Coverage.payor = create('Reference') as reference,  reference.reference = ('https://example/Patient/' + %patient.id) &quot;reference&quot;;\n      src where statusCode.exists().not() -&gt; Coverage.status = 'active' &quot;statusAbsent&quot;;\n      entry.act as act then {\n        act.code -&gt; Coverage.type;\n      };\n    };\n  } &quot;Esenzioni&quot;;\n  // -------------Sezione Prescrizioni-------------------------------------------------------------------------------------------------------------------------------------\n  src.code as code where (code = '57828-6') then {\n    src.entry as entry then {\n      entry.observation as observation then {\n        observation.code -&gt; ServiceRequest.code;\n        // observation.priorityCode-&gt;ServiceRequest.priority&quot;priority&quot;;\n        observation.priorityCode as priorityCode then {\n          priorityCode.code as v -&gt; ServiceRequest.priority = translate(v, '#priority', 'code') &quot;priority&quot;;\n        };\n        observation.repeatNumber as repeatNumber -&gt; ServiceRequest.quantity = create('Quantity') as Ratio then {\n          repeatNumber.value as value -&gt; Ratio.value = value;\n        } &quot;value&quot;;\n        observation.participant as participant then {\n          participant.participantRole as partRol then {\n            partRol.scopingEntity as scopingEntity then {\n              scopingEntity.code -&gt; ServiceRequest.locationCode;\n            } &quot;ScopingEntity&quot;;\n          } &quot;PartROle&quot;;\n        } &quot;Location&quot;;\n        // ----------------codice Patologia------------------------------------------------------------------------------------------------------------------------------------\n        observation.entryRelationship as entryRelationship then {\n          entryRelationship.act as act then {\n            act.templateId as temid where (root = '2.16.840.1.113883.3.1937.777.63.10.275') -&gt;  bundle.entry as e11,  e11.request = create('BackboneElement') as request,  request.method = 'POST',  e11.resource = create('Condition') as Condition,  Condition.id = uuid() as uuid11,  e11.fullUrl = append('https://example/Condition/', uuid11),  request.url = 'Condition',  ServiceRequest.reasonReference = create('Reference') as reference,  reference.reference = ('https://example/Condition/' + %Condition.id) then {\n              act -&gt;  Condition.subject = create('Reference') as reference,  reference.reference = ('https://example/Patient/' + %patient.id) &quot;reference&quot;;\n              act -&gt;  Condition.encounter = create('Reference') as reference,  reference.reference = ('https://example/Encounter/' + %enc.id) &quot;reference&quot;;\n              act -&gt; Condition.clinicalStatus as status2 then {\n                act -&gt; status2.coding as status3 then {\n                  act -&gt; status3.code = 'unknown' &quot;finald&quot;;\n                  act -&gt; status3.system = 'http://terminology.hl7.org/CodeSystem/condition-clinical' &quot;system&quot;;\n                } &quot;st3&quot;;\n              } &quot;status&quot;;\n              act.code -&gt; Condition.code;\n            } &quot;Condition&quot;;\n          };\n        } &quot;entryrelationshipCondition&quot;;\n        // ---------Tipo di Visita---------------------------------------------------------------------------------------------------------------------------------\n        observation.entryRelationship as entryRelationship then {\n          entryRelationship.encounter as encounter then {\n            encounter.templateId as temid where (root = '2.16.840.1.113883.3.1937.777.63.10.276') then {\n              encounter -&gt;  ServiceRequest.encounter = create('Reference') as reference,  reference.reference = ('https://example/Encounter/' + %enc.id) then {\n                observation.entryRelationship as entryRelationship then {\n                  entryRelationship.encounter as encounter1 then {\n                    encounter1.templateId as temid where (root = '2.16.840.1.113883.3.1937.777.63.10.281') then {\n                      // encounter1.code -&gt; enc.class;\n                      encounter1.code as code1 -&gt; enc.class = create('Coding') as coding then {\n                        code1.code as code -&gt; coding.code = cast(code, 'string');\n                        code1.codeSystem as system -&gt; coding.system = translate(system, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri');\n                        code1.displayName as display -&gt; coding.display = cast(display, 'string');\n                      } &quot;class&quot;;\n                    } &quot;reference&quot;;\n                  } &quot;templateId&quot;;\n                } &quot;Act&quot;;\n              } &quot;encounter&quot;;\n            };\n          } &quot;Act&quot;;\n        };\n        // ------------Nota esplicita--------------------------------------------------------------------------------------------------------------------------------------------\n        observation.entryRelationship as entryRelationship then {\n          entryRelationship.act as act then {\n            act.templateId as temid where (root = '2.16.840.1.113883.3.1937.777.63.10.274') then {\n              act.text as text -&gt; ServiceRequest.note as note then {\n                text.reference as t then {\n                  t.value as l -&gt; note.text = l &quot;reference&quot;;\n                } &quot;tcx&quot;;\n              } &quot;reference&quot;;\n            };\n          } &quot;Act&quot;;\n        };\n        observation.entryRelationship as entryRelationship then {\n          entryRelationship.act as act then {\n            act.templateId as temid where (root = '2.16.840.1.113883.3.1937.777.63.10.278') then {\n              act.code -&gt; ServiceRequest.reasonCode;\n            } &quot;reference&quot;;\n          } &quot;templateId&quot;;\n        } &quot;Act&quot;;\n        // -----Sedute-----------------------------------------------------------------------------------------------------------------------------------------------\n        observation.entryRelationship as entryRelationship then {\n          entryRelationship.observation as observation then {\n            observation.templateId as temid where (root = '2.16.840.1.113883.3.1937.777.63.10.277') then {\n              observation.repeatNumber as repeatNumber -&gt; ServiceRequest.occurrence = create('Timing') as Timing then {\n                repeatNumber -&gt; Timing.repeat as repeat then {\n                  repeatNumber.value as value -&gt; repeat.count = value &quot;count&quot;;\n                } &quot;event&quot;;\n              } &quot;Count&quot;;\n            } &quot;Timing&quot;;\n          } &quot;templateId&quot;;\n        } &quot;Act&quot;;\n      } &quot;Observation&quot;;\n    };\n  } &quot;Esenzioni&quot;;\n  // ------------Sezione Annotazioni-----------------------------------------------------------------------------------------------------------------------------------------\n  src.code as code where (code = '48767-8') then {\n    src.entry as entry then {\n      entry.act as act then {\n        act.text as text -&gt; ServiceRequest.note as note then {\n          text.reference as t then {\n            t.value as l -&gt; note.text = l &quot;reference&quot;;\n          } &quot;tcx&quot;;\n        } &quot;reference&quot;;\n      };\n    };\n  } &quot;Annotazioni&quot;;\n  // ----------Sezione Messaggio Regionale-----------------------------------------------------------------------------------------------------------------------------------\n  src.code as code where (code = '51851-4') then {\n    src.text as cdaText -&gt; ServiceRequest.note as note then {\n      cdaText as text then {\n        text as l -&gt; note.text = l &quot;reference&quot;;\n      } &quot;tcx&quot;;\n    } &quot;reference&quot;;\n  } &quot;MessaggioRegionale&quot;;\n  // -------Sezione Parametri Vitali---------------------------------------------------------------------------------------------------------------------------------------\n  src.code as code where (code = '8716-3') -&gt;  bundle.entry as e11,  e11.request = create('BackboneElement') as request,  request.method = 'POST',  e11.resource = create('Observation') as Observation,  Observation.id = uuid() as uuid11,  e11.fullUrl = append('https://example/Observation/', uuid11),  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    src.text as cdaText -&gt; Observation.note as note then {\n      cdaText as t -&gt; note.text = t &quot;reference&quot;;\n    } &quot;reference&quot;;\n  } &quot;ParametriVitali&quot;;\n  // -------Sezione Allergie------------------------------------------------------------------------------------------------------------------------------------------------\n  src.code as code where (code = '48765-2') -&gt;  bundle.entry as e11,  e11.request = create('BackboneElement') as request,  request.method = 'POST',  e11.resource = create('AllergyIntolerance') as AllergyIntolerance,  AllergyIntolerance.id = uuid() as uuid11,  e11.fullUrl = append('https://example/AllergyIntolerance/', uuid11),  request.url = 'AllergyIntolerance',  tgt.entry = create('Reference') as reference,  reference.reference = ('https://example/AllergyIntolerance/' + %AllergyIntolerance.id) then {\n    src -&gt;  AllergyIntolerance.patient = create('Reference') as reference,  reference.reference = ('https://example/Patient/' + %patient.id) &quot;reference&quot;;\n    src -&gt; AllergyIntolerance.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.text as cdaText -&gt; AllergyIntolerance.note as note then {\n      cdaText as t -&gt; note.text = t &quot;reference&quot;;\n    } &quot;reference&quot;;\n  } &quot;Allergie&quot;;\n  // ------Sezione Stato Funzionale------------------------------------------------------------------------------------------------------------------------------------------\n  src.code as code where (code = '47420-5') -&gt;  bundle.entry as e11,  e11.request = create('BackboneElement') as request,  request.method = 'POST',  e11.resource = create('Observation') as Observation,  Observation.id = uuid() as uuid11,  e11.fullUrl = append('https://example/Observation/', uuid11),  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    src.text as cdaText -&gt; Observation.note as note then {\n      cdaText as t -&gt; note.text = t &quot;reference&quot;;\n    } &quot;reference&quot;;\n  } &quot;StatoFunzionale&quot;;\n}\n\n</pre>\n      </div>"
  ] ; # 
  fhir:url [ fhir:v "http://hl7.it/fhir/cda2fhir/StructureMap/cda2fhirSpecPrescription"^^xsd:anyURI] ; # 
  fhir:version [ fhir:v "0.1.0"] ; # 
  fhir:name [ fhir:v "cda2fhirSpecPrescription"] ; # 
  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/List"^^xsd:anyURI ;
fhir:link <http://hl7.org/fhir/StructureDefinition/List>     ] ;
fhir:mode [ fhir:v "produced" ] ;
fhir:alias [ fhir:v "List" ]
  ] [
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 "e4" ]       ] [
fhir:context [ fhir:v "e4" ] ;
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 "e4" ] ;
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 "uuid4" ] ;
fhir:transform [ fhir:v "uuid" ]       ] [
fhir:context [ fhir:v "e4" ] ;
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 "uuid4" ]         ] )       ] [
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 "idfr" ] ;
            ( 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 "value" ] ;
              ( fhir:source [
fhir:context [ fhir:v "id" ] ;
fhir:element [ fhir:v "extension" ] ;
fhir:variable [ fhir:v "ext1" ]               ] ) ;
              ( 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 "ext1" ]                 ] )               ] )             ] [
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 "ServiceRequest" ] ;
      ( 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 "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 "e" ] ;
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:rule [
fhir:name [ fhir:v "intent" ] ;
        ( fhir:source [
fhir:context [ fhir:v "cda" ]         ] ) ;
        ( 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 "stats" ] ;
        ( fhir:source [
fhir:context [ fhir:v "cda" ]         ] ) ;
        ( 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 "unknown" ]           ] )         ] )       ] [
fhir:name [ fhir:v "reference" ] ;
        ( fhir:source [
fhir:context [ fhir:v "cda" ]         ] ) ;
        ( 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 "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 "code" ] ;
                ( fhir:source [
fhir:context [ fhir:v "srcSection" ] ;
fhir:element [ fhir:v "code" ]                 ] ) ;
                ( 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 "ClinicalDocumentSection" ] ;
                  ( fhir:variable [ fhir:v "cda" ] [ fhir:v "srcSection" ] [ fhir:v "patient" ] [ fhir:v "tgtSection" ] [ fhir:v "bundle" ] [ fhir:v "encounter" ] [ fhir:v "ServiceRequest" ] )                 ] )               ] )             ] )           ] )         ] )       ] )     ] )
  ] [
fhir:name [ fhir:v "ClinicalDocumentSection" ] ;
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:name [ fhir:v "ServiceRequest" ] ;
fhir:type [ fhir:v "ServiceRequest" ] ;
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 "Note" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "code" ] ;
fhir:condition [ fhir:v "(code = '48767-8') or (code = '51851-4') or (code = '57827-8') or (code = '57828-6')" ]       ] ) ;
      ( fhir:rule [
fhir:name [ fhir:v "reference" ] ;
        ( fhir:source [
fhir:context [ fhir:v "src" ]         ] ) ;
        ( fhir:target [
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/ServiceRequest/' + %ServiceRequest.id" ]           ] )         ] )       ] )     ] [
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:documentation [ fhir:v "src.entry as entry then{" ]     ] [
fhir:name [ fhir:v "Esenzioni" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "code" ] ;
fhir:condition [ fhir:v "(code = '57827-8')" ]       ] ) ;
      ( fhir:rule [
fhir:name [ fhir:v "id" ] ;
        ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "id" ] ;
fhir:variable [ fhir:v "vvv" ]         ] ) ;
        ( fhir:target [
fhir:context [ fhir:v "ServiceRequest" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "identifier" ] ;
fhir:variable [ fhir:v "vvv" ] ;
fhir:transform [ fhir:v "create" ]         ] )       ] [
fhir:name [ fhir:v "entry" ] ;
        ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "entry" ] ;
fhir:variable [ fhir:v "entry" ]         ] ) ;
        ( fhir:target [
fhir:context [ fhir:v "bundle" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "entry" ] ;
fhir:variable [ fhir:v "e11" ]         ] [
fhir:context [ fhir:v "e11" ] ;
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 "e11" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "resource" ] ;
fhir:variable [ fhir:v "Coverage" ] ;
fhir:transform [ fhir:v "create" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "Coverage" ]           ] )         ] [
fhir:context [ fhir:v "Coverage" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "id" ] ;
fhir:variable [ fhir:v "uuid11" ] ;
fhir:transform [ fhir:v "uuid" ]         ] [
fhir:context [ fhir:v "e11" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "fullUrl" ] ;
fhir:transform [ fhir:v "append" ] ;
          ( fhir:parameter [
fhir:value [ fhir:v "https://example/Coverage/" ]           ] [
fhir:value [ fhir:v "uuid11" ]           ] )         ] [
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 "Coverage" ]           ] )         ] [
fhir:context [ fhir:v "ServiceRequest" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "insurance" ] ;
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/Coverage/' + %Coverage.id" ]           ] )         ] ) ;
        ( fhir:rule [
fhir:name [ fhir:v "reference" ] ;
          ( fhir:source [
fhir:context [ fhir:v "src" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "Coverage" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "beneficiary" ] ;
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 "Coverage" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "payor" ] ;
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 "statusAbsent" ] ;
          ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:condition [ fhir:v "statusCode.exists().not()" ]           ] ) ;
          ( fhir:target [
fhir:context [ fhir:v "Coverage" ] ;
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 "act" ] ;
          ( fhir:source [
fhir:context [ fhir:v "entry" ] ;
fhir:element [ fhir:v "act" ] ;
fhir:variable [ fhir:v "act" ]           ] ) ;
          ( fhir:rule [
fhir:name [ fhir:v "code" ] ;
            ( fhir:source [
fhir:context [ fhir:v "act" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "vvv" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "Coverage" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "type" ] ;
fhir:variable [ fhir:v "vvv" ] ;
fhir:transform [ fhir:v "create" ]             ] )           ] )         ] )       ] ) ;
fhir:documentation [ fhir:v "--------------Sezione Esenzioni------------------------------------------------------------------------------------------------------------------------------------" ]     ] [
fhir:name [ fhir:v "Esenzioni" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "code" ] ;
fhir:condition [ fhir:v "(code = '57828-6')" ]       ] ) ;
      ( fhir:rule [
fhir:name [ fhir:v "entry" ] ;
        ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "entry" ] ;
fhir:variable [ fhir:v "entry" ]         ] ) ;
        ( fhir:rule [
fhir:name [ fhir:v "Observation" ] ;
          ( fhir:source [
fhir:context [ fhir:v "entry" ] ;
fhir:element [ fhir:v "observation" ] ;
fhir:variable [ fhir:v "observation" ]           ] ) ;
          ( fhir:rule [
fhir:name [ fhir:v "code" ] ;
            ( fhir:source [
fhir:context [ fhir:v "observation" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "vvv" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "ServiceRequest" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "vvv" ] ;
fhir:transform [ fhir:v "create" ]             ] )           ] [
fhir:name [ fhir:v "priorityCode" ] ;
            ( fhir:source [
fhir:context [ fhir:v "observation" ] ;
fhir:element [ fhir:v "priorityCode" ] ;
fhir:variable [ fhir:v "priorityCode" ]             ] ) ;
            ( fhir:rule [
fhir:name [ fhir:v "priority" ] ;
              ( fhir:source [
fhir:context [ fhir:v "priorityCode" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "v" ]               ] ) ;
              ( fhir:target [
fhir:context [ fhir:v "ServiceRequest" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "priority" ] ;
fhir:transform [ fhir:v "translate" ] ;
                ( fhir:parameter [
fhir:value [ fhir:v "v" ]                 ] [
fhir:value [ fhir:v "#priority" ]                 ] [
fhir:value [ fhir:v "code" ]                 ] )               ] )             ] ) ;
fhir:documentation [ fhir:v "observation.priorityCode->ServiceRequest.priority\"priority\";" ]           ] [
fhir:name [ fhir:v "value" ] ;
            ( fhir:source [
fhir:context [ fhir:v "observation" ] ;
fhir:element [ fhir:v "repeatNumber" ] ;
fhir:variable [ fhir:v "repeatNumber" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "ServiceRequest" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "quantity" ] ;
fhir:variable [ fhir:v "Ratio" ] ;
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 "repeatNumber" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:variable [ fhir:v "value" ]               ] ) ;
              ( fhir:target [
fhir:context [ fhir:v "Ratio" ] ;
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 "Location" ] ;
            ( fhir:source [
fhir:context [ fhir:v "observation" ] ;
fhir:element [ fhir:v "participant" ] ;
fhir:variable [ fhir:v "participant" ]             ] ) ;
            ( fhir:rule [
fhir:name [ fhir:v "PartROle" ] ;
              ( fhir:source [
fhir:context [ fhir:v "participant" ] ;
fhir:element [ fhir:v "participantRole" ] ;
fhir:variable [ fhir:v "partRol" ]               ] ) ;
              ( fhir:rule [
fhir:name [ fhir:v "ScopingEntity" ] ;
                ( fhir:source [
fhir:context [ fhir:v "partRol" ] ;
fhir:element [ fhir:v "scopingEntity" ] ;
fhir:variable [ fhir:v "scopingEntity" ]                 ] ) ;
                ( fhir:rule [
fhir:name [ fhir:v "code" ] ;
                  ( fhir:source [
fhir:context [ fhir:v "scopingEntity" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "vvv" ]                   ] ) ;
                  ( fhir:target [
fhir:context [ fhir:v "ServiceRequest" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "locationCode" ] ;
fhir:variable [ fhir:v "vvv" ] ;
fhir:transform [ fhir:v "create" ]                   ] )                 ] )               ] )             ] )           ] [
fhir:name [ fhir:v "entryrelationshipCondition" ] ;
            ( fhir:source [
fhir:context [ fhir:v "observation" ] ;
fhir:element [ fhir:v "entryRelationship" ] ;
fhir:variable [ fhir:v "entryRelationship" ]             ] ) ;
            ( fhir:rule [
fhir:name [ fhir:v "act" ] ;
              ( fhir:source [
fhir:context [ fhir:v "entryRelationship" ] ;
fhir:element [ fhir:v "act" ] ;
fhir:variable [ fhir:v "act" ]               ] ) ;
              ( fhir:rule [
fhir:name [ fhir:v "Condition" ] ;
                ( fhir:source [
fhir:context [ fhir:v "act" ] ;
fhir:element [ fhir:v "templateId" ] ;
fhir:variable [ fhir:v "temid" ] ;
fhir:condition [ fhir:v "(root = '2.16.840.1.113883.3.1937.777.63.10.275')" ]                 ] ) ;
                ( fhir:target [
fhir:context [ fhir:v "bundle" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "entry" ] ;
fhir:variable [ fhir:v "e11" ]                 ] [
fhir:context [ fhir:v "e11" ] ;
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 "e11" ] ;
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 "uuid11" ] ;
fhir:transform [ fhir:v "uuid" ]                 ] [
fhir:context [ fhir:v "e11" ] ;
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 "uuid11" ]                   ] )                 ] [
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 "ServiceRequest" ] ;
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/Condition/' + %Condition.id" ]                   ] )                 ] ) ;
                ( fhir:rule [
fhir:name [ fhir:v "reference" ] ;
                  ( fhir:source [
fhir:context [ fhir:v "act" ]                   ] ) ;
                  ( 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 "act" ]                   ] ) ;
                  ( 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 "act" ]                   ] ) ;
                  ( fhir:target [
fhir:context [ fhir:v "Condition" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "clinicalStatus" ] ;
fhir:variable [ fhir:v "status2" ]                   ] ) ;
                  ( fhir:rule [
fhir:name [ fhir:v "st3" ] ;
                    ( fhir:source [
fhir:context [ fhir:v "act" ]                     ] ) ;
                    ( 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 "act" ]                       ] ) ;
                      ( 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 "unknown" ]                         ] )                       ] )                     ] [
fhir:name [ fhir:v "system" ] ;
                      ( fhir:source [
fhir:context [ fhir:v "act" ]                       ] ) ;
                      ( 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-clinical" ]                         ] )                       ] )                     ] )                   ] )                 ] [
fhir:name [ fhir:v "code" ] ;
                  ( fhir:source [
fhir:context [ fhir:v "act" ] ;
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:documentation [ fhir:v "----------------codice Patologia------------------------------------------------------------------------------------------------------------------------------------" ]           ] [
fhir:name [ fhir:v "entryRelationship" ] ;
            ( fhir:source [
fhir:context [ fhir:v "observation" ] ;
fhir:element [ fhir:v "entryRelationship" ] ;
fhir:variable [ fhir:v "entryRelationship" ]             ] ) ;
            ( fhir:rule [
fhir:name [ fhir:v "Act" ] ;
              ( fhir:source [
fhir:context [ fhir:v "entryRelationship" ] ;
fhir:element [ fhir:v "encounter" ] ;
fhir:variable [ fhir:v "encounter" ]               ] ) ;
              ( fhir:rule [
fhir:name [ fhir:v "templateId" ] ;
                ( fhir:source [
fhir:context [ fhir:v "encounter" ] ;
fhir:element [ fhir:v "templateId" ] ;
fhir:variable [ fhir:v "temid" ] ;
fhir:condition [ fhir:v "(root = '2.16.840.1.113883.3.1937.777.63.10.276')" ]                 ] ) ;
                ( fhir:rule [
fhir:name [ fhir:v "encounter" ] ;
                  ( fhir:source [
fhir:context [ fhir:v "encounter" ]                   ] ) ;
                  ( 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/' + %enc.id" ]                     ] )                   ] ) ;
                  ( fhir:rule [
fhir:name [ fhir:v "Act" ] ;
                    ( fhir:source [
fhir:context [ fhir:v "observation" ] ;
fhir:element [ fhir:v "entryRelationship" ] ;
fhir:variable [ fhir:v "entryRelationship" ]                     ] ) ;
                    ( fhir:rule [
fhir:name [ fhir:v "templateId" ] ;
                      ( fhir:source [
fhir:context [ fhir:v "entryRelationship" ] ;
fhir:element [ fhir:v "encounter" ] ;
fhir:variable [ fhir:v "encounter1" ]                       ] ) ;
                      ( fhir:rule [
fhir:name [ fhir:v "reference" ] ;
                        ( fhir:source [
fhir:context [ fhir:v "encounter1" ] ;
fhir:element [ fhir:v "templateId" ] ;
fhir:variable [ fhir:v "temid" ] ;
fhir:condition [ fhir:v "(root = '2.16.840.1.113883.3.1937.777.63.10.281')" ]                         ] ) ;
                        ( fhir:rule [
fhir:name [ fhir:v "class" ] ;
                          ( fhir:source [
fhir:context [ fhir:v "encounter1" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "code1" ]                           ] ) ;
                          ( fhir:target [
fhir:context [ fhir:v "enc" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "class" ] ;
fhir:variable [ fhir:v "coding" ] ;
fhir:transform [ fhir:v "create" ] ;
                            ( fhir:parameter [
fhir:value [ fhir:v "Coding" ]                             ] )                           ] ) ;
                          ( fhir:rule [
fhir:name [ fhir:v "code" ] ;
                            ( fhir:source [
fhir:context [ fhir:v "code1" ] ;
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 "code1" ] ;
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 "code1" ] ;
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 "encounter1.code -> enc.class;" ]                         ] )                       ] )                     ] )                   ] )                 ] )               ] )             ] ) ;
fhir:documentation [ fhir:v "---------Tipo di Visita---------------------------------------------------------------------------------------------------------------------------------" ]           ] [
fhir:name [ fhir:v "entryRelationship" ] ;
            ( fhir:source [
fhir:context [ fhir:v "observation" ] ;
fhir:element [ fhir:v "entryRelationship" ] ;
fhir:variable [ fhir:v "entryRelationship" ]             ] ) ;
            ( fhir:rule [
fhir:name [ fhir:v "Act" ] ;
              ( fhir:source [
fhir:context [ fhir:v "entryRelationship" ] ;
fhir:element [ fhir:v "act" ] ;
fhir:variable [ fhir:v "act" ]               ] ) ;
              ( fhir:rule [
fhir:name [ fhir:v "templateId" ] ;
                ( fhir:source [
fhir:context [ fhir:v "act" ] ;
fhir:element [ fhir:v "templateId" ] ;
fhir:variable [ fhir:v "temid" ] ;
fhir:condition [ fhir:v "(root = '2.16.840.1.113883.3.1937.777.63.10.274')" ]                 ] ) ;
                ( fhir:rule [
fhir:name [ fhir:v "reference" ] ;
                  ( fhir:source [
fhir:context [ fhir:v "act" ] ;
fhir:element [ fhir:v "text" ] ;
fhir:variable [ fhir:v "text" ]                   ] ) ;
                  ( fhir:target [
fhir:context [ fhir:v "ServiceRequest" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "note" ] ;
fhir:variable [ fhir:v "note" ]                   ] ) ;
                  ( fhir:rule [
fhir:name [ fhir:v "tcx" ] ;
                    ( fhir:source [
fhir:context [ fhir:v "text" ] ;
fhir:element [ fhir:v "reference" ] ;
fhir:variable [ fhir:v "t" ]                     ] ) ;
                    ( fhir:rule [
fhir:name [ fhir:v "reference" ] ;
                      ( fhir:source [
fhir:context [ fhir:v "t" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:variable [ fhir:v "l" ]                       ] ) ;
                      ( 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 "l" ]                         ] )                       ] )                     ] )                   ] )                 ] )               ] )             ] ) ;
fhir:documentation [ fhir:v "------------Nota esplicita--------------------------------------------------------------------------------------------------------------------------------------------" ]           ] [
fhir:name [ fhir:v "Act" ] ;
            ( fhir:source [
fhir:context [ fhir:v "observation" ] ;
fhir:element [ fhir:v "entryRelationship" ] ;
fhir:variable [ fhir:v "entryRelationship" ]             ] ) ;
            ( fhir:rule [
fhir:name [ fhir:v "templateId" ] ;
              ( fhir:source [
fhir:context [ fhir:v "entryRelationship" ] ;
fhir:element [ fhir:v "act" ] ;
fhir:variable [ fhir:v "act" ]               ] ) ;
              ( fhir:rule [
fhir:name [ fhir:v "reference" ] ;
                ( fhir:source [
fhir:context [ fhir:v "act" ] ;
fhir:element [ fhir:v "templateId" ] ;
fhir:variable [ fhir:v "temid" ] ;
fhir:condition [ fhir:v "(root = '2.16.840.1.113883.3.1937.777.63.10.278')" ]                 ] ) ;
                ( fhir:rule [
fhir:name [ fhir:v "code" ] ;
                  ( fhir:source [
fhir:context [ fhir:v "act" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "vvv" ]                   ] ) ;
                  ( fhir:target [
fhir:context [ fhir:v "ServiceRequest" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "reasonCode" ] ;
fhir:variable [ fhir:v "vvv" ] ;
fhir:transform [ fhir:v "create" ]                   ] )                 ] )               ] )             ] )           ] [
fhir:name [ fhir:v "Act" ] ;
            ( fhir:source [
fhir:context [ fhir:v "observation" ] ;
fhir:element [ fhir:v "entryRelationship" ] ;
fhir:variable [ fhir:v "entryRelationship" ]             ] ) ;
            ( fhir:rule [
fhir:name [ fhir:v "templateId" ] ;
              ( fhir:source [
fhir:context [ fhir:v "entryRelationship" ] ;
fhir:element [ fhir:v "observation" ] ;
fhir:variable [ fhir:v "observation" ]               ] ) ;
              ( fhir:rule [
fhir:name [ fhir:v "Timing" ] ;
                ( fhir:source [
fhir:context [ fhir:v "observation" ] ;
fhir:element [ fhir:v "templateId" ] ;
fhir:variable [ fhir:v "temid" ] ;
fhir:condition [ fhir:v "(root = '2.16.840.1.113883.3.1937.777.63.10.277')" ]                 ] ) ;
                ( fhir:rule [
fhir:name [ fhir:v "Count" ] ;
                  ( fhir:source [
fhir:context [ fhir:v "observation" ] ;
fhir:element [ fhir:v "repeatNumber" ] ;
fhir:variable [ fhir:v "repeatNumber" ]                   ] ) ;
                  ( fhir:target [
fhir:context [ fhir:v "ServiceRequest" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "occurrence" ] ;
fhir:variable [ fhir:v "Timing" ] ;
fhir:transform [ fhir:v "create" ] ;
                    ( fhir:parameter [
fhir:value [ fhir:v "Timing" ]                     ] )                   ] ) ;
                  ( fhir:rule [
fhir:name [ fhir:v "event" ] ;
                    ( fhir:source [
fhir:context [ fhir:v "repeatNumber" ]                     ] ) ;
                    ( fhir:target [
fhir:context [ fhir:v "Timing" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "repeat" ] ;
fhir:variable [ fhir:v "repeat" ]                     ] ) ;
                    ( fhir:rule [
fhir:name [ fhir:v "count" ] ;
                      ( fhir:source [
fhir:context [ fhir:v "repeatNumber" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:variable [ fhir:v "value" ]                       ] ) ;
                      ( fhir:target [
fhir:context [ fhir:v "repeat" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "count" ] ;
fhir:transform [ fhir:v "copy" ] ;
                        ( fhir:parameter [
fhir:value [ fhir:v "value" ]                         ] )                       ] )                     ] )                   ] )                 ] )               ] )             ] ) ;
fhir:documentation [ fhir:v "-----Sedute-----------------------------------------------------------------------------------------------------------------------------------------------" ]           ] )         ] )       ] ) ;
fhir:documentation [ fhir:v "-------------Sezione Prescrizioni-------------------------------------------------------------------------------------------------------------------------------------" ]     ] [
fhir:name [ fhir:v "Annotazioni" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "code" ] ;
fhir:condition [ fhir:v "(code = '48767-8')" ]       ] ) ;
      ( fhir:rule [
fhir:name [ fhir:v "entry" ] ;
        ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "entry" ] ;
fhir:variable [ fhir:v "entry" ]         ] ) ;
        ( fhir:rule [
fhir:name [ fhir:v "act" ] ;
          ( fhir:source [
fhir:context [ fhir:v "entry" ] ;
fhir:element [ fhir:v "act" ] ;
fhir:variable [ fhir:v "act" ]           ] ) ;
          ( fhir:rule [
fhir:name [ fhir:v "reference" ] ;
            ( fhir:source [
fhir:context [ fhir:v "act" ] ;
fhir:element [ fhir:v "text" ] ;
fhir:variable [ fhir:v "text" ]             ] ) ;
            ( fhir:target [
fhir:context [ fhir:v "ServiceRequest" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "note" ] ;
fhir:variable [ fhir:v "note" ]             ] ) ;
            ( fhir:rule [
fhir:name [ fhir:v "tcx" ] ;
              ( fhir:source [
fhir:context [ fhir:v "text" ] ;
fhir:element [ fhir:v "reference" ] ;
fhir:variable [ fhir:v "t" ]               ] ) ;
              ( fhir:rule [
fhir:name [ fhir:v "reference" ] ;
                ( fhir:source [
fhir:context [ fhir:v "t" ] ;
fhir:element [ fhir:v "value" ] ;
fhir:variable [ fhir:v "l" ]                 ] ) ;
                ( 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 "l" ]                   ] )                 ] )               ] )             ] )           ] )         ] )       ] ) ;
fhir:documentation [ fhir:v "------------Sezione Annotazioni-----------------------------------------------------------------------------------------------------------------------------------------" ]     ] [
fhir:name [ fhir:v "MessaggioRegionale" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "code" ] ;
fhir:condition [ fhir:v "(code = '51851-4')" ]       ] ) ;
      ( fhir:rule [
fhir:name [ fhir:v "reference" ] ;
        ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "text" ] ;
fhir:variable [ fhir:v "cdaText" ]         ] ) ;
        ( fhir:target [
fhir:context [ fhir:v "ServiceRequest" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "note" ] ;
fhir:variable [ fhir:v "note" ]         ] ) ;
        ( fhir:rule [
fhir:name [ fhir:v "tcx" ] ;
          ( fhir:source [
fhir:context [ fhir:v "cdaText" ] ;
fhir:variable [ fhir:v "text" ]           ] ) ;
          ( fhir:rule [
fhir:name [ fhir:v "reference" ] ;
            ( fhir:source [
fhir:context [ fhir:v "text" ] ;
fhir:variable [ fhir:v "l" ]             ] ) ;
            ( 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 "l" ]               ] )             ] )           ] )         ] )       ] ) ;
fhir:documentation [ fhir:v "----------Sezione Messaggio Regionale-----------------------------------------------------------------------------------------------------------------------------------" ]     ] [
fhir:name [ fhir:v "ParametriVitali" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "code" ] ;
fhir:condition [ fhir:v "(code = '8716-3')" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "bundle" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "entry" ] ;
fhir:variable [ fhir:v "e11" ]       ] [
fhir:context [ fhir:v "e11" ] ;
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 "e11" ] ;
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 "uuid11" ] ;
fhir:transform [ fhir:v "uuid" ]       ] [
fhir:context [ fhir:v "e11" ] ;
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 "uuid11" ]         ] )       ] [
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 "src" ] ;
fhir:element [ fhir:v "text" ] ;
fhir:variable [ 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:documentation [ fhir:v "-------Sezione Parametri Vitali---------------------------------------------------------------------------------------------------------------------------------------" ]     ] [
fhir:name [ fhir:v "Allergie" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "code" ] ;
fhir:condition [ fhir:v "(code = '48765-2')" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "bundle" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "entry" ] ;
fhir:variable [ fhir:v "e11" ]       ] [
fhir:context [ fhir:v "e11" ] ;
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 "e11" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "resource" ] ;
fhir:variable [ fhir:v "AllergyIntolerance" ] ;
fhir:transform [ fhir:v "create" ] ;
        ( fhir:parameter [
fhir:value [ fhir:v "AllergyIntolerance" ]         ] )       ] [
fhir:context [ fhir:v "AllergyIntolerance" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "id" ] ;
fhir:variable [ fhir:v "uuid11" ] ;
fhir:transform [ fhir:v "uuid" ]       ] [
fhir:context [ fhir:v "e11" ] ;
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 "uuid11" ]         ] )       ] [
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/' + %AllergyIntolerance.id" ]         ] )       ] ) ;
      ( fhir:rule [
fhir:name [ fhir:v "reference" ] ;
        ( fhir:source [
fhir:context [ fhir:v "src" ]         ] ) ;
        ( fhir:target [
fhir:context [ fhir:v "AllergyIntolerance" ] ;
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 "allergy" ] ;
        ( fhir:source [
fhir:context [ fhir:v "src" ]         ] ) ;
        ( fhir:target [
fhir:context [ fhir:v "AllergyIntolerance" ] ;
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 "reference" ] ;
        ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "text" ] ;
fhir:variable [ fhir:v "cdaText" ]         ] ) ;
        ( fhir:target [
fhir:context [ fhir:v "AllergyIntolerance" ] ;
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:documentation [ fhir:v "-------Sezione Allergie------------------------------------------------------------------------------------------------------------------------------------------------" ]     ] [
fhir:name [ fhir:v "StatoFunzionale" ] ;
      ( fhir:source [
fhir:context [ fhir:v "src" ] ;
fhir:element [ fhir:v "code" ] ;
fhir:variable [ fhir:v "code" ] ;
fhir:condition [ fhir:v "(code = '47420-5')" ]       ] ) ;
      ( fhir:target [
fhir:context [ fhir:v "bundle" ] ;
fhir:contextType [ fhir:v "variable" ] ;
fhir:element [ fhir:v "entry" ] ;
fhir:variable [ fhir:v "e11" ]       ] [
fhir:context [ fhir:v "e11" ] ;
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 "e11" ] ;
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 "uuid11" ] ;
fhir:transform [ fhir:v "uuid" ]       ] [
fhir:context [ fhir:v "e11" ] ;
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 "uuid11" ]         ] )       ] [
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 "src" ] ;
fhir:element [ fhir:v "text" ] ;
fhir:variable [ 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:documentation [ fhir:v "------Sezione Stato Funzionale------------------------------------------------------------------------------------------------------------------------------------------" ]     ] )
  ] ) . #