CDA to FHIR Maps, published by HL7 Italy. This guide is not an authorized publication; it is the continuous build for version 0.1.0 built by the FHIR (HL7® FHIR® Standard) CI Build. This version is based on the current content of https://github.com/hl7-it/cda2fhir/ and changes regularly. See the Directory of published versions
Draft as of 2024-09-15 |
{
"resourceType" : "StructureMap",
"id" : "cda2fhirMedPrescription",
"text" : {
"status" : "generated",
"div" : "<div xmlns=\"http://www.w3.org/1999/xhtml\">\n <pre>map "http://hl7.it/fhir/cda2fhir/StructureMap/cda2fhirMedPrescription" = "cda2fhirMedPrescription"\n\nuses "http://hl7.org/fhir/cda/StructureDefinition/ClinicalDocument" alias ClinicalDocument as source\nuses "http://hl7.org/fhir/cda/StructureDefinition/AssignedAuthor" alias AssignedAuthor as queried\nuses "http://hl7.org/fhir/cda/StructureDefinition/AssignedEntity" alias AssignedEntity as queried\nuses "http://hl7.org/fhir/cda/StructureDefinition/AssociatedEntity" alias AssociatedEntity as queried\nuses "http://hl7.org/fhir/cda/StructureDefinition/CustodianOrganization" alias CustodianOrganization as queried\nuses "http://hl7.org/fhir/cda/StructureDefinition/OrganizationPartOf" alias OrganizationPartOf as queried\nuses "http://hl7.org/fhir/cda/StructureDefinition/Organization" alias rapresentedOrganization as queried\nuses "http://hl7.org/fhir/cda/StructureDefinition/Section" alias Section as queried\nuses "http://hl7.org/fhir/cda/StructureDefinition/PatientRole" alias PatientRole as queried\nuses "http://hl7.org/fhir/cda/StructureDefinition/AD" alias AD as source\nuses "http://hl7.org/fhir/StructureDefinition/Bundle" alias Bundle as target\nuses "http://hl7.org/fhir/StructureDefinition/Composition" alias Composition as produced\nuses "http://hl7.org/fhir/StructureDefinition/Patient" alias Patient as produced\nuses "http://hl7.org/fhir/StructureDefinition/Encounter" alias Encounter as produced\nuses "http://hl7.org/fhir/StructureDefinition/Person" alias Patient as produced\nuses "http://hl7.org/fhir/StructureDefinition/Practitioner" alias Practitioner as produced\nuses "http://hl7.org/fhir/StructureDefinition/Organization" alias Organization as produced\nuses "http://hl7.org/fhir/cda/StructureDefinition/Act" alias Act as produced\nuses "http://hl7.org/fhir/cda/StructureDefinition/IVL-PQ" alias IVL_PQ as source\nuses "http://hl7.org/fhir/cda/StructureDefinition/PQ" alias PQ as source\nuses "http://hl7.org/fhir/StructureDefinition/SimpleQuantity" alias SimpleQuantity as target\n\nimports "http://hl7.it/fhir/cda2fhir/StructureMap/cda2fhirDataTypes"\nimports "http://hl7.it/fhir/cda2fhir/StructureMap/cda2fhirHeader"\n\ngroup CdaToBundle(source cda : ClinicalDocument, target bundle : Bundle) {\n cda -> bundle.entry as e, e.request = create('BackboneElement') as request, request.method = 'POST', e.resource = create('Composition') as composition, composition.id = uuid() as uuid1, e.fullUrl = append('https://example/Composition/', uuid1), request.url = 'Composition', bundle.entry as e2, e2.request = create('BackboneElement') as requestPAT, requestPAT.method = 'PUT', e2.resource = create('Patient') as patient, patient.id = uuid() as uuid2, e2.fullUrl = append('https://example/Patient/', uuid2), bundle.entry as e3, e3.request = create('BackboneElement') as request, request.method = 'POST', e3.resource = create('Encounter') as encounter, encounter.id = uuid() as uuid3, e3.fullUrl = append('https://example/Encounter/', uuid3), request.url = 'Encounter', bundle.entry as e5, e5.request = create('BackboneElement') as request, request.method = 'POST', e5.resource = create('DocumentReference') as DocumentReference, DocumentReference.id = uuid() as uuid5, e5.fullUrl = append('https://example/DocumentReference/', uuid5), request.url = 'DocumentReference' then {\n cda then ClinicalDocumentToBundle(cda, patient, composition, encounter, bundle, DocumentReference) "cdatobundle";\n cda.recordTarget as recordTarget then {\n recordTarget.patientRole as patient then {\n patient.id as id -> patient.identifier as identifier then {\n id.root as r -> identifier.system = translate(r, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri') "root1";\n id.extension as ext -> identifier.value = ext;\n id.assigningAuthorityName as s -> identifier.assigner as a, a.display = s;\n } "record";\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 -> requestPAT.url = append('Patient?identifier=', ext) "UUID";\n } "ext";\n } "recPat";\n } "patient";\n } "ClinicalDocumentToBody";\n}\n\ngroup ClinicalDocumentToBundle(source cda : ClinicalDocument, target patient : Patient, target composition : Composition, target encounter : Encounter, target bundle : Bundle, target DocumentReference : DocumentReference) {\n cda -> bundle.id = uuid() "id";\n cda.id -> bundle.identifier "identifier";\n cda -> bundle.type = 'transaction' "type";\n cda -> bundle.timestamp = (timestamp.now()) "date";\n cda then ClinicalDocumentComposition(cda, composition, patient, encounter, bundle, DocumentReference) "composition";\n cda.component as component then {\n component.structuredBody as body then {\n body -> bundle.entry as e1, e1.request = create('BackboneElement') as request, request.method = 'POST', e1.resource = create('Coverage') as coverage, coverage.id = uuid() as uuid1, e1.fullUrl = append('https://example/Coverage/', uuid1), request.url = 'Coverage' then {\n body -> bundle.entry as e2, e2.request = create('BackboneElement') as request, request.method = 'POST', e2.resource = create('MedicationRequest') as medRq, medRq.id = uuid() as uuid1, e2.fullUrl = append('https://example/MedicationRequest/', uuid1), request.url = 'MedicationRequest' then {\n body.component as component then {\n // discretizzi il primo livello di component\n component.section as srcSection then {\n srcSection.code where (code = '57827-8') -> composition.section as tgtSection then ClinicalDocumentSectionEsenzioni(cda, srcSection, patient, tgtSection, bundle, encounter, coverage) "esenz";\n srcSection.code where (code = '57828-6') -> composition.section as tgtSection then ClinicalDocumentSectionPrescrizioneFarmaceutica(cda, srcSection, patient, tgtSection, bundle, encounter, coverage, medRq) "prescfarm";\n srcSection.code where (code = '48767-8') -> composition.section as tgtSection then ClinicalDocumentSectionAnnotazioni(cda, srcSection, patient, tgtSection, bundle, encounter, medRq) "annot";\n srcSection.code where (code = '51851-4') -> composition.section as tgtSection then ClinicalDocumentSectionMessaggioRegionale(cda, srcSection, patient, tgtSection, bundle, encounter, medRq) "messregg";\n srcSection.code where (code = '8716-3') -> composition.section as tgtSection then ClinicalDocumentSectionParametriVitali(cda, srcSection, patient, tgtSection, bundle, encounter) "paramvit";\n srcSection.code where (code = '48765-2') -> composition.section as tgtSection then ClinicalDocumentSectionAllergieaiFarmaci(cda, srcSection, patient, tgtSection, bundle, encounter) "allergfarm";\n srcSection.code where (code = '47420-5') -> composition.section as tgtSection then ClinicalDocumentSectionStatoClinicoPaziente(cda, srcSection, patient, tgtSection, bundle, encounter) "statclinpaz";\n } "cov";\n };\n } "medreq";\n } "coverage";\n } "body";\n };\n}\n\ngroup ClinicalDocumentSectionEsenzioni(source cda : ClinicalDocument, source src : Section, target patient : Patient, target tgt, target bundle : Bundle, target enc : Encounter, target coverage : Coverage) {\n src.title as t -> tgt.title = (t.dataString);\n src.code -> tgt.code;\n src.text as cdaText -> tgt.entry = create('Reference') as reference, reference.reference = ('https://example/Coverage/' + %coverage.id), tgt.text as fhirText then {\n cdaText -> fhirText.status = 'generated' "narrativeStatus";\n cdaText as t -> fhirText.div = t "narrativeText";\n src.entry as srcse then {\n srcse.act as srcsec then {\n srcsec.code -> coverage.type;\n srcsec.code as srctxt then {\n srctxt -> coverage.type as typetxt then {\n srctxt.originalText as ref then {\n ref.reference as t then {\n t.value as l -> typetxt.text = l "reference";\n } "tcf";\n } "rfde";\n } "reftxt";\n } "origtxt";\n srcsec where coverage.status.exists().not() then {\n srcsec -> coverage.status = 'active' "status";\n } "statuscode";\n srcsec -> coverage.beneficiary = create('Reference') as reference, reference.reference = ('https://example/Patient/' + %patient.id) "reference";\n srcsec -> coverage.payor = create('Reference') as reference, reference.reference = ('https://example/Patient/' + %patient.id) "reference";\n } "cdaText";\n } "secact";\n } "cff";\n}\n\ngroup ClinicalDocumentSectionPrescrizioneFarmaceutica(source cda : ClinicalDocument, source src : Section, target patient : Patient, target tgt, target bundle : Bundle, target enc : Encounter, target coverage : Coverage, target medRq : MedicationRequest) {\n src.title as t -> tgt.title = (t.dataString);\n src.code -> tgt.code;\n src.text as cdaText -> tgt.entry = create('Reference') as reference, reference.reference = ('https://example/MedicationRequest/' + %medRq.id), tgt.text as fhirText then {\n src.id -> medRq.identifier;\n cdaText -> fhirText.status = 'generated' "narrativeStatus";\n cdaText as t -> fhirText.div = t "narrativeText";\n cdaText -> medRq.subject = create('Reference') as reference, reference.reference = ('https://example/Patient/' + %patient.id) "reference";\n cdaText -> medRq.encounter = create('Reference') as reference, reference.reference = ('https://example/Encounter/' + %enc.id) "reference";\n cdaText -> medRq.status = 'active' "status";\n cdaText -> medRq.intent = 'order' "intent";\n src.entry as srcent then {\n srcent.substanceAdministration as subAdm then {\n subAdm.effectiveTime : IVL_TS as eff -> medRq.dosageInstruction = create('Dosage') as dosage then {\n subAdm -> dosage.timing = create('Timing') as tim then {\n subAdm -> tim.repeat as repeat then {\n eff -> repeat.bounds = create('Period') as period then IVLTSPeriod(eff, period) "boundsperiod";\n eff.width as width then {\n width.value as v -> repeat.duration = v;\n width.unit as u -> repeat.durationUnit = u;\n };\n } "repeat";\n } "timing";\n } "dosage";\n subAdm.effectiveTime as eff -> medRq.dosageInstruction = create('Dosage') as dosage then {\n subAdm -> dosage.timing = create('Timing') as tim then {\n eff where eff.low.exists().not() and eff.high.exists().not() then {\n eff.value as v -> tim.event = create('dateTime') as event then TSDateTime(v, event) "evnt";\n } "effct1";\n } "timing1";\n } "dosage1";\n subAdm.effectiveTime : PIVL_TS as effp -> medRq.dosageInstruction = create('Dosage') as dosage then {\n effp -> dosage.timing = create('Timing') as timing then {\n effp -> timing then periodTiming(effp, timing) "cod";\n effp where effp.phase.exists() then {\n effp.phase as phase -> timing.repeat as r then {\n phase.low -> r.bounds = create('Period') as period then {\n phase.low -> period.start "lo";\n };\n phase.width as wid then {\n wid.value as v -> r.duration = v "vals";\n wid.unit as u -> r.durationUnit = u;\n } "dur";\n } "rep";\n } "phase";\n } "timing";\n } "eff";\n subAdm.effectiveTime : EIVL_TS as effe -> medRq.dosageInstruction = create('Dosage') as dosage then {\n effe -> dosage.timing = create('Timing') as timing then {\n effe -> timing.repeat as r then {\n effe.event -> r.when;\n effe.offset as offset then {\n offset.low as v then {\n v.value as o -> r.offset = o "barabar";\n } "offs";\n } "poi";\n } "lkj";\n } "ghj";\n } "eff";\n subAdm.doseQuantity as doseQuant -> medRq.dosageInstruction = create('Dosage') as dosage then {\n doseQuant.originalText as ot then {\n ot.reference -> dosage.text;\n } "ot";\n doseQuant -> dosage.doseAndRate as dosageRate then {\n doseQuant -> dosageRate.dose = create('Range') as d then {\n doseQuant -> d.low = create('SimpleQuantity') as l then {\n doseQuant.low as lo -> l.value = (lo.value);\n doseQuant.low as lo -> l.unit = (lo.unit);\n } "low";\n doseQuant -> d.high = create('SimpleQuantity') as h then {\n doseQuant.high as hi -> h.value = (hi.value);\n doseQuant.high as hi -> h.unit = (hi.unit);\n } "low";\n } "d";\n } "dosageRate";\n } "doseQuant";\n subAdm -> bundle.entry as e1, e1.request = create('BackboneElement') as request, request.method = 'POST', e1.resource = create('Medication') as medication, medication.id = uuid() as uuid1, e1.fullUrl = append('https://example/Medication/', uuid1), request.url = 'Medication', medRq.medication = create('Reference') as reference, reference.reference = ('https://example/Medication/' + %medication.id) then {\n subAdm.consumable as cons then {\n cons.manufacturedProduct as manuprod then {\n manuprod.manufacturedLabeledDrug as manudrug then {\n manudrug.code -> medication.code;\n manudrug -> medication.identifier as medid then {\n manudrug.name -> medid.value;\n } "idmedname";\n manudrug.code as srctxt then {\n srctxt -> medication.code as typetxt then {\n srctxt.originalText as ref then {\n ref.reference as reference then {\n reference.value as l -> typetxt.text = l "reference";\n } "tcf";\n } "tcfg";\n } "reftxtd";\n } "origtxtd";\n } "manudrug";\n manuprod.manufacturedMaterial as manufact then {\n manufact.code -> medication.code;\n manufact.code as srctxt then {\n srctxt -> medication.code as typetxt then {\n srctxt.originalText as ref then {\n ref.reference as reference then {\n reference.value as l -> typetxt.text = l "reference";\n } "tcf";\n } "tcfg";\n } "reftxt";\n } "origtxt";\n manufact.ingredient as ingredient -> medication.ingredient as ing then {\n ingredient.quantity as quantity -> ing.strength = create('Ratio') as strength then EmedRTOPQPQRatio(quantity, strength) "strength";\n manufact -> ing.item = create('CodeableConcept') as ingcode, ingcode.text = (%manufact.name.other) "ingredientCode";\n } "ingr";\n manufact.formCode -> medication.form;\n manufact -> medication.identifier as medid "transl";\n } "manuFact";\n } "manumat";\n } "cons";\n subAdm.entryRelationship as entryrel1 then {\n entryrel1.supply as sup -> medRq.dispenseRequest as dispreq then {\n sup -> dispreq.quantity = create('SimpleQuantity') as quantity then {\n sup.quantity as q -> quantity.value = (q.value);\n } "quantity";\n };\n } "entry1";\n subAdm.entryRelationship as entryrel2 where (typeCode = 'REFR') then {\n subAdm -> medRq.insurance = create('Reference') as reference, reference.reference = ('https://example/Coverage/' + %coverage.id) then {\n entryrel2.act as act2 -> coverage.costToBeneficiary as cost then {\n act2 -> cost.value = create('SimpleQuantity') as val then {\n act2 -> val.value = '0' "bnm";\n } "beneficmoney";\n act2 -> cost.exception as except then {\n act2.code -> except.type;\n } "exept";\n } "act2";\n } "Cover";\n } "entry2";\n subAdm.entryRelationship as entryrel3 where (typeCode = 'RSON') then {\n entryrel3.observation as obs3 where (classCode = 'OBS') then {\n obs3.code -> medRq.reasonCode;\n obs3.text as text then {\n text -> medRq.reasonCode as ce then {\n // text.reference as reference-> ce.text=reference;\n text.reference as reference then {\n reference.value as l -> ce.text = l "reference";\n } "tcf";\n } "originltext";\n } "txt";\n } "obs3";\n } "entry2";\n subAdm.entryRelationship as entryrel4 where (typeCode = 'SUBJ') then {\n entryrel4.observation as obs3 -> medRq.substitution as sub then {\n obs3.code as Code -> sub.allowed = create('CodeableConcept') as allowed then CECodeableConcept(Code, allowed);\n obs3.entryRelationship as entry then {\n entry.observation as obs4 then {\n obs4.code -> sub.reason;\n } "obs4";\n } "entry";\n } "obs";\n } "code";\n subAdm.entryRelationship as entryrel2 where (typeCode = 'SUBJ') then {\n entryrel2.act as act2 where (classCode = 'ACT') then {\n act2.text as text -> medRq.note as note then {\n text.reference as t then {\n t.value as l -> note.text = l "reference";\n } "tcx";\n } "reference";\n } "obs3";\n } "entry2";\n } "subsadm";\n } "subadm";\n } "hnjh";\n } "xxx";\n}\n\n// ------------Sezione Annotazioni-----------------------------------------------------------------------------------------------------------------------------------------\ngroup ClinicalDocumentSectionAnnotazioni(source cda : ClinicalDocument, source src : Section, target patient : Patient, target tgt, target bundle : Bundle, target enc : Encounter, target medRq : MedicationRequest) {\n src.title as t -> tgt.title = (t.dataString);\n src.code -> tgt.code;\n src.text as cdaText -> tgt.entry = create('Reference') as reference, reference.reference = ('https://example/MedicationRequest/' + %medRq.id), tgt.text as fhirText then {\n cdaText -> fhirText.status = 'generated' "narrativeStatus";\n cdaText as t -> fhirText.div = t "narrativeText";\n src.entry as entry then {\n entry.act as act then {\n act.text as text -> medRq.note as note then {\n text.reference as t then {\n t.value as l -> note.text = l "reference";\n } "tcx";\n } "reference";\n };\n };\n } "entry";\n}\n\n// ------------Sezione Messaggio Regionale-----------------------------------------------------------------------------------------------------------------------------------------\ngroup ClinicalDocumentSectionMessaggioRegionale(source cda : ClinicalDocument, source src : Section, target patient : Patient, target tgt, target bundle : Bundle, target enc : Encounter, target medRq : MedicationRequest) {\n src.title as t -> tgt.title = (t.dataString);\n src.code -> tgt.code;\n src.text as cdaText -> tgt.entry = create('Reference') as reference, reference.reference = ('https://example/MedicationRequest/' + %medRq.id) then {\n cdaText as text -> medRq.note as note then {\n text as t -> note.text = t "reference";\n } "nota";\n } "entry";\n}\n\n// ------------Sezione Parametri Vitali-----------------------------------------------------------------------------------------------------------------------------------------\ngroup ClinicalDocumentSectionParametriVitali(source cda : ClinicalDocument, source src : Section, target patient : Patient, target tgt, target bundle : Bundle, target enc : Encounter) {\n src.title as t -> tgt.title = (t.dataString);\n src.code -> tgt.code;\n src.text as cdaText -> bundle.entry as e8, e8.request = create('BackboneElement') as request, request.method = 'POST', e8.resource = create('Observation') as Observation, Observation.id = uuid() as uuid8, e8.fullUrl = append('https://example/Observation/', uuid8), request.url = 'Observation', tgt.entry = create('Reference') as reference, reference.reference = ('https://example/Observation/' + %Observation.id) then {\n src -> Observation.subject = create('Reference') as reference, reference.reference = ('https://example/Patient/' + %patient.id) "reference";\n src -> Observation.encounter = create('Reference') as reference, reference.reference = ('https://example/Encounter/' + %enc.id) "reference";\n src.code -> Observation.code;\n src where Observation.statusCode.exists().not() then {\n src -> Observation.status = 'final' "status";\n } "statuscode";\n cdaText -> Observation.note as note then {\n cdaText as t -> note.text = t "reference";\n } "reference";\n } "nota";\n}\n\n// ------------Sezione Allergie_Intolleranze-----------------------------------------------------------------------------------------------------------------------------------------\ngroup ClinicalDocumentSectionAllergieaiFarmaci(source cda : ClinicalDocument, source src : Section, target patient : Patient, target tgt, target bundle : Bundle, target enc : Encounter) {\n src.title as t -> tgt.title = (t.dataString);\n src.code -> tgt.code;\n src -> bundle.entry as e9, e9.request = create('BackboneElement') as request, request.method = 'POST', e9.resource = create('AllergyIntolerance') as allergyIntolerance, allergyIntolerance.id = uuid() as uuid9, e9.fullUrl = append('https://example/AllergyIntolerance/', uuid9), request.url = 'AllergyIntolerance', tgt.entry = create('Reference') as reference, reference.reference = ('https://example/AllergyIntolerance/' + %allergyIntolerance.id) then {\n src -> allergyIntolerance.patient = create('Reference') as reference, reference.reference = ('https://example/Patient/' + %patient.id) "reference";\n src -> allergyIntolerance.clinicalStatus = create('CodeableConcept') as status then {\n src -> status.text = 'string' "text";\n src -> status.coding = create('Coding') as coding then {\n src -> coding.code = 'active' "active";\n src -> coding.system = 'http://terminology.hl7.org/CodeSystem/allergyintolerance-clinical' "system";\n } "coding";\n } "allergy";\n src.text as cdaText -> allergyIntolerance.note as note then {\n cdaText as t -> note.text = t "reference";\n } "reference";\n } "nota";\n}\n\n// ------------Sezione Stato Clinico del Paziente----------------------------------------------------------------------------------------------------------------------------------------\ngroup ClinicalDocumentSectionStatoClinicoPaziente(source cda : ClinicalDocument, source src : Section, target patient : Patient, target tgt, target bundle : Bundle, target enc : Encounter) {\n src.title as t -> tgt.title = (t.dataString);\n src.code -> tgt.code;\n src.text as cdaText -> bundle.entry as e7, e7.request = create('BackboneElement') as request, request.method = 'POST', e7.resource = create('Observation') as Observation, Observation.id = uuid() as uuid7, e7.fullUrl = append('https://example/Observation/', uuid7), request.url = 'Observation', tgt.entry = create('Reference') as reference, reference.reference = ('https://example/Observation/' + %Observation.id) then {\n src -> Observation.subject = create('Reference') as reference, reference.reference = ('https://example/Patient/' + %patient.id) "reference";\n src -> Observation.encounter = create('Reference') as reference, reference.reference = ('https://example/Encounter/' + %enc.id) "reference";\n src.code -> Observation.code;\n src where Observation.statusCode.exists().not() then {\n src -> Observation.status = 'final' "status";\n } "statuscode";\n cdaText -> Observation.note as note then {\n cdaText as t -> note.text = t "reference";\n } "reference";\n } "nota";\n}\n\ngroup periodTiming(source effectiveTime : PIVL_TS, target timing : Timing) {\n effectiveTime -> timing.repeat as r then {\n effectiveTime.period as p -> r.period = (p.value);\n effectiveTime.period as p -> r.periodUnit = (p.unit);\n } "repeat";\n}\n\ngroup EmedRTOPQPQRatio(source src : RTO_PQ_PQ, target tgt : Ratio) {\n src.numerator as numerator -> tgt.numerator as targetNumerator then EmedPQQuantity(numerator, targetNumerator);\n src.denominator as denominator -> tgt.denominator as targetDenominator then EmedPQQuantity(denominator, targetDenominator);\n}\n\ngroup EmedPQQuantity(source src : PQ, target tgt : Quantity) {\n src.value as value -> tgt.value = value;\n src.unit as unit -> tgt.code = unit;\n src.unit as unit -> tgt.system = ('http://fhir.ch/ig/ch-emed/ValueSet/UnitCode'.resolve().compose.include.where(concept.where(code = %unit)).system);\n src.unit as unit -> tgt.unit = ('http://fhir.ch/ig/ch-emed/ValueSet/UnitCode'.resolve().compose.include.concept.where(code = %unit).display);\n}\n\n</pre>\n </div>"
},
"url" : "http://hl7.it/fhir/cda2fhir/StructureMap/cda2fhirMedPrescription",
"version" : "0.1.0",
"name" : "cda2fhirMedPrescription",
"status" : "draft",
"date" : "2024-09-15T08:16:12+00:00",
"publisher" : "HL7 Italy",
"contact" : [
{
"name" : "HL7 Italy",
"telecom" : [
{
"system" : "url",
"value" : "http://hl7.it"
}
]
}
],
"jurisdiction" : [
{
"coding" : [
{
"system" : "urn:iso:std:iso:3166",
"code" : "IT",
"display" : "Italy"
}
]
}
],
"structure" : [
{
"url" : "http://hl7.org/fhir/cda/StructureDefinition/ClinicalDocument",
"mode" : "source",
"alias" : "ClinicalDocument"
},
{
"url" : "http://hl7.org/fhir/cda/StructureDefinition/AssignedAuthor",
"mode" : "queried",
"alias" : "AssignedAuthor"
},
{
"url" : "http://hl7.org/fhir/cda/StructureDefinition/AssignedEntity",
"mode" : "queried",
"alias" : "AssignedEntity"
},
{
"url" : "http://hl7.org/fhir/cda/StructureDefinition/AssociatedEntity",
"mode" : "queried",
"alias" : "AssociatedEntity"
},
{
"url" : "http://hl7.org/fhir/cda/StructureDefinition/CustodianOrganization",
"mode" : "queried",
"alias" : "CustodianOrganization"
},
{
"url" : "http://hl7.org/fhir/cda/StructureDefinition/OrganizationPartOf",
"mode" : "queried",
"alias" : "OrganizationPartOf"
},
{
"url" : "http://hl7.org/fhir/cda/StructureDefinition/Organization",
"mode" : "queried",
"alias" : "rapresentedOrganization"
},
{
"url" : "http://hl7.org/fhir/cda/StructureDefinition/Section",
"mode" : "queried",
"alias" : "Section"
},
{
"url" : "http://hl7.org/fhir/cda/StructureDefinition/PatientRole",
"mode" : "queried",
"alias" : "PatientRole"
},
{
"url" : "http://hl7.org/fhir/cda/StructureDefinition/AD",
"mode" : "source",
"alias" : "AD"
},
{
"url" : "http://hl7.org/fhir/StructureDefinition/Bundle",
"mode" : "target",
"alias" : "Bundle"
},
{
"url" : "http://hl7.org/fhir/StructureDefinition/Composition",
"mode" : "produced",
"alias" : "Composition"
},
{
"url" : "http://hl7.org/fhir/StructureDefinition/Patient",
"mode" : "produced",
"alias" : "Patient"
},
{
"url" : "http://hl7.org/fhir/StructureDefinition/Encounter",
"mode" : "produced",
"alias" : "Encounter"
},
{
"url" : "http://hl7.org/fhir/StructureDefinition/Person",
"mode" : "produced",
"alias" : "Patient"
},
{
"url" : "http://hl7.org/fhir/StructureDefinition/Practitioner",
"mode" : "produced",
"alias" : "Practitioner"
},
{
"url" : "http://hl7.org/fhir/StructureDefinition/Organization",
"mode" : "produced",
"alias" : "Organization"
},
{
"url" : "http://hl7.org/fhir/cda/StructureDefinition/Act",
"mode" : "produced",
"alias" : "Act"
},
{
"url" : "http://hl7.org/fhir/cda/StructureDefinition/IVL-PQ",
"mode" : "source",
"alias" : "IVL_PQ"
},
{
"url" : "http://hl7.org/fhir/cda/StructureDefinition/PQ",
"mode" : "source",
"alias" : "PQ"
},
{
"url" : "http://hl7.org/fhir/StructureDefinition/SimpleQuantity",
"mode" : "target",
"alias" : "SimpleQuantity"
}
],
"import" : [
🔗 "http://hl7.it/fhir/cda2fhir/StructureMap/cda2fhirDataTypes"🔗 ,
"http://hl7.it/fhir/cda2fhir/StructureMap/cda2fhirHeader"
],
"group" : [
{
"name" : "CdaToBundle",
"typeMode" : "none",
"input" : [
{
"name" : "cda",
"type" : "ClinicalDocument",
"mode" : "source"
},
{
"name" : "bundle",
"type" : "Bundle",
"mode" : "target"
}
],
"rule" : [
{
"name" : "ClinicalDocumentToBody",
"source" : [
{
"context" : "cda"
}
],
"target" : [
{
"context" : "bundle",
"contextType" : "variable",
"element" : "entry",
"variable" : "e"
},
{
"context" : "e",
"contextType" : "variable",
"element" : "request",
"variable" : "request",
"transform" : "create",
"parameter" : [
{
"valueString" : "BackboneElement"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "method",
"transform" : "copy",
"parameter" : [
{
"valueString" : "POST"
}
]
},
{
"context" : "e",
"contextType" : "variable",
"element" : "resource",
"variable" : "composition",
"transform" : "create",
"parameter" : [
{
"valueString" : "Composition"
}
]
},
{
"context" : "composition",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid1",
"transform" : "uuid"
},
{
"context" : "e",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "https://example/Composition/"
},
{
"valueId" : "uuid1"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "url",
"transform" : "copy",
"parameter" : [
{
"valueString" : "Composition"
}
]
},
{
"context" : "bundle",
"contextType" : "variable",
"element" : "entry",
"variable" : "e2"
},
{
"context" : "e2",
"contextType" : "variable",
"element" : "request",
"variable" : "requestPAT",
"transform" : "create",
"parameter" : [
{
"valueString" : "BackboneElement"
}
]
},
{
"context" : "requestPAT",
"contextType" : "variable",
"element" : "method",
"transform" : "copy",
"parameter" : [
{
"valueString" : "PUT"
}
]
},
{
"context" : "e2",
"contextType" : "variable",
"element" : "resource",
"variable" : "patient",
"transform" : "create",
"parameter" : [
{
"valueString" : "Patient"
}
]
},
{
"context" : "patient",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid2",
"transform" : "uuid"
},
{
"context" : "e2",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "https://example/Patient/"
},
{
"valueId" : "uuid2"
}
]
},
{
"context" : "bundle",
"contextType" : "variable",
"element" : "entry",
"variable" : "e3"
},
{
"context" : "e3",
"contextType" : "variable",
"element" : "request",
"variable" : "request",
"transform" : "create",
"parameter" : [
{
"valueString" : "BackboneElement"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "method",
"transform" : "copy",
"parameter" : [
{
"valueString" : "POST"
}
]
},
{
"context" : "e3",
"contextType" : "variable",
"element" : "resource",
"variable" : "encounter",
"transform" : "create",
"parameter" : [
{
"valueString" : "Encounter"
}
]
},
{
"context" : "encounter",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid3",
"transform" : "uuid"
},
{
"context" : "e3",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "https://example/Encounter/"
},
{
"valueId" : "uuid3"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "url",
"transform" : "copy",
"parameter" : [
{
"valueString" : "Encounter"
}
]
},
{
"context" : "bundle",
"contextType" : "variable",
"element" : "entry",
"variable" : "e5"
},
{
"context" : "e5",
"contextType" : "variable",
"element" : "request",
"variable" : "request",
"transform" : "create",
"parameter" : [
{
"valueString" : "BackboneElement"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "method",
"transform" : "copy",
"parameter" : [
{
"valueString" : "POST"
}
]
},
{
"context" : "e5",
"contextType" : "variable",
"element" : "resource",
"variable" : "DocumentReference",
"transform" : "create",
"parameter" : [
{
"valueString" : "DocumentReference"
}
]
},
{
"context" : "DocumentReference",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid5",
"transform" : "uuid"
},
{
"context" : "e5",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "https://example/DocumentReference/"
},
{
"valueId" : "uuid5"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "url",
"transform" : "copy",
"parameter" : [
{
"valueString" : "DocumentReference"
}
]
}
],
"rule" : [
{
"name" : "cdatobundle",
"source" : [
{
"context" : "cda"
}
],
"dependent" : [
{
"name" : "ClinicalDocumentToBundle",
"variable" : [
"cda",
"patient",
"composition",
"encounter",
"bundle",
"DocumentReference"
]
}
]
},
{
"name" : "patient",
"source" : [
{
"context" : "cda",
"element" : "recordTarget",
"variable" : "recordTarget"
}
],
"rule" : [
{
"name" : "recPat",
"source" : [
{
"context" : "recordTarget",
"element" : "patientRole",
"variable" : "patient"
}
],
"rule" : [
{
"name" : "record",
"source" : [
{
"context" : "patient",
"element" : "id",
"variable" : "id"
}
],
"target" : [
{
"context" : "patient",
"contextType" : "variable",
"element" : "identifier",
"variable" : "identifier"
}
],
"rule" : [
{
"name" : "root1",
"source" : [
{
"context" : "id",
"element" : "root",
"variable" : "r"
}
],
"target" : [
{
"context" : "identifier",
"contextType" : "variable",
"element" : "system",
"transform" : "translate",
"parameter" : [
{
"valueId" : "r"
},
{
"valueString" : "http://hl7.org/fhir/ConceptMap/special-oid2uri"
},
{
"valueString" : "uri"
}
]
}
]
},
{
"name" : "extension",
"source" : [
{
"context" : "id",
"element" : "extension",
"variable" : "ext"
}
],
"target" : [
{
"context" : "identifier",
"contextType" : "variable",
"element" : "value",
"transform" : "copy",
"parameter" : [
{
"valueId" : "ext"
}
]
}
]
},
{
"name" : "assigningAuthorityName",
"source" : [
{
"context" : "id",
"element" : "assigningAuthorityName",
"variable" : "s"
}
],
"target" : [
{
"context" : "identifier",
"contextType" : "variable",
"element" : "assigner",
"variable" : "a"
},
{
"context" : "a",
"contextType" : "variable",
"element" : "display",
"transform" : "copy",
"parameter" : [
{
"valueId" : "s"
}
]
}
]
}
]
},
{
"name" : "ext",
"source" : [
{
"context" : "patient",
"element" : "id",
"variable" : "id",
"condition" : "(root = '2.16.840.1.113883.2.9.4.3.2') or (root = '2.16.840.1.113883.2.9.4.3.7') or (root = '2.16.840.1.113883.2.9.4.3.3') or (root = '2.16.840.1.113883.2.9.4.3.17') or (root = '2.16.840.1.113883.2.9.4.3.18') or (root = '2.16.840.1.113883.2.9.2.10.4.1.1') or (root = '2.16.840.1.113883.2.9.2.20.4.1.1') or (root = '2.16.840.1.113883.2.9.2.30.4.1.1') or (root = '2.16.840.1.113883.2.9.2.41.4.1.1') or (root = '2.16.840.1.113883.2.9.2.42.4.1.1') or (root = '2.16.840.1.113883.2.9.2.50.4.1.1') or (root = '2.16.840.1.113883.2.9.2.60.4.1.1') or (root = '2.16.840.1.113883.2.9.2.70.4.1.1') or (root = '2.16.840.1.113883.2.9.2.80.4.1.1') or (root = '2.16.840.1.113883.2.9.2.90.4.1.1') or (root = '2.16.840.1.113883.2.9.2.100.4.1.1') or (root = '2.16.840.1.113883.2.9.2.110.4.1.1') or (root = '2.16.840.1.113883.2.9.2.120.4.1.1') or (root = '2.16.840.1.113883.2.9.2.130.4.1.1') or (root = '2.16.840.1.113883.2.9.2.140.4.1.1') or (root = '2.16.840.1.113883.2.9.2.150.4.1.1') or (root = '2.16.840.1.113883.2.9.2.160.4.1.1') or (root = '2.16.840.1.113883.2.9.2.170.4.1.1') or (root = '2.16.840.1.113883.2.9.2.180.4.1.1') or (root = '2.16.840.1.113883.2.9.2.190.4.1.1') or (root = '2.16.840.1.113883.2.9.2.200.4.1.1') or (root = '2.16.840.1.113883.2.9.2.10.4.1') or (root = '2.16.840.1.113883.2.9.2.20.4.1') or (root = '2.16.840.1.113883.2.9.2.30.4.1') or (root = '2.16.840.1.113883.2.9.2.41.4.1') or (root = '2.16.840.1.113883.2.9.2.42.4.1') or (root = '2.16.840.1.113883.2.9.2.50.4.1') or (root = '2.16.840.1.113883.2.9.2.60.4.1') or (root = '2.16.840.1.113883.2.9.2.70.4.1') or (root = '2.16.840.1.113883.2.9.2.80.4.1') or (root = '2.16.840.1.113883.2.9.2.90.4.1') or (root = '2.16.840.1.113883.2.9.2.100.4.1') or (root = '2.16.840.1.113883.2.9.2.110.4.1') or (root = '2.16.840.1.113883.2.9.2.120.4.1') or (root = '2.16.840.1.113883.2.9.2.130.4.1') or (root = '2.16.840.1.113883.2.9.2.140.4.1') or (root = '2.16.840.1.113883.2.9.2.150.4.1') or (root = '2.16.840.1.113883.2.9.2.160.4.1') or (root = '2.16.840.1.113883.2.9.2.170.4.1') or (root = '2.16.840.1.113883.2.9.2.180.4.1') or (root = '2.16.840.1.113883.2.9.2.190.4.1') or (root = '2.16.840.1.113883.2.9.2.200.4.1') or (root = '2.16.840.1.113883.2.9.4.3.15')"
}
],
"rule" : [
{
"name" : "UUID",
"source" : [
{
"context" : "id",
"element" : "extension",
"variable" : "ext"
}
],
"target" : [
{
"context" : "requestPAT",
"contextType" : "variable",
"element" : "url",
"transform" : "append",
"parameter" : [
{
"valueString" : "Patient?identifier="
},
{
"valueId" : "ext"
}
]
}
]
}
]
}
]
}
]
}
]
}
]
},
{
"name" : "ClinicalDocumentToBundle",
"typeMode" : "none",
"input" : [
{
"name" : "cda",
"type" : "ClinicalDocument",
"mode" : "source"
},
{
"name" : "patient",
"type" : "Patient",
"mode" : "target"
},
{
"name" : "composition",
"type" : "Composition",
"mode" : "target"
},
{
"name" : "encounter",
"type" : "Encounter",
"mode" : "target"
},
{
"name" : "bundle",
"type" : "Bundle",
"mode" : "target"
},
{
"name" : "DocumentReference",
"type" : "DocumentReference",
"mode" : "target"
}
],
"rule" : [
{
"name" : "id",
"source" : [
{
"context" : "cda"
}
],
"target" : [
{
"context" : "bundle",
"contextType" : "variable",
"element" : "id",
"transform" : "uuid"
}
]
},
{
"name" : "identifier",
"source" : [
{
"context" : "cda",
"element" : "id",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "bundle",
"contextType" : "variable",
"element" : "identifier",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "type",
"source" : [
{
"context" : "cda"
}
],
"target" : [
{
"context" : "bundle",
"contextType" : "variable",
"element" : "type",
"transform" : "copy",
"parameter" : [
{
"valueString" : "transaction"
}
]
}
]
},
{
"name" : "date",
"source" : [
{
"context" : "cda"
}
],
"target" : [
{
"context" : "bundle",
"contextType" : "variable",
"element" : "timestamp",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "timestamp.now()"
}
]
}
]
},
{
"name" : "composition",
"source" : [
{
"context" : "cda"
}
],
"dependent" : [
{
"name" : "ClinicalDocumentComposition",
"variable" : [
"cda",
"composition",
"patient",
"encounter",
"bundle",
"DocumentReference"
]
}
]
},
{
"name" : "component",
"source" : [
{
"context" : "cda",
"element" : "component",
"variable" : "component"
}
],
"rule" : [
{
"name" : "body",
"source" : [
{
"context" : "component",
"element" : "structuredBody",
"variable" : "body"
}
],
"rule" : [
{
"name" : "coverage",
"source" : [
{
"context" : "body"
}
],
"target" : [
{
"context" : "bundle",
"contextType" : "variable",
"element" : "entry",
"variable" : "e1"
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "request",
"variable" : "request",
"transform" : "create",
"parameter" : [
{
"valueString" : "BackboneElement"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "method",
"transform" : "copy",
"parameter" : [
{
"valueString" : "POST"
}
]
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "resource",
"variable" : "coverage",
"transform" : "create",
"parameter" : [
{
"valueString" : "Coverage"
}
]
},
{
"context" : "coverage",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid1",
"transform" : "uuid"
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "https://example/Coverage/"
},
{
"valueId" : "uuid1"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "url",
"transform" : "copy",
"parameter" : [
{
"valueString" : "Coverage"
}
]
}
],
"rule" : [
{
"name" : "medreq",
"source" : [
{
"context" : "body"
}
],
"target" : [
{
"context" : "bundle",
"contextType" : "variable",
"element" : "entry",
"variable" : "e2"
},
{
"context" : "e2",
"contextType" : "variable",
"element" : "request",
"variable" : "request",
"transform" : "create",
"parameter" : [
{
"valueString" : "BackboneElement"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "method",
"transform" : "copy",
"parameter" : [
{
"valueString" : "POST"
}
]
},
{
"context" : "e2",
"contextType" : "variable",
"element" : "resource",
"variable" : "medRq",
"transform" : "create",
"parameter" : [
{
"valueString" : "MedicationRequest"
}
]
},
{
"context" : "medRq",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid1",
"transform" : "uuid"
},
{
"context" : "e2",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "https://example/MedicationRequest/"
},
{
"valueId" : "uuid1"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "url",
"transform" : "copy",
"parameter" : [
{
"valueString" : "MedicationRequest"
}
]
}
],
"rule" : [
{
"name" : "component",
"source" : [
{
"context" : "body",
"element" : "component",
"variable" : "component"
}
],
"rule" : [
{
"name" : "cov",
"source" : [
{
"context" : "component",
"element" : "section",
"variable" : "srcSection"
}
],
"rule" : [
{
"name" : "esenz",
"source" : [
{
"context" : "srcSection",
"element" : "code",
"condition" : "(code = '57827-8')"
}
],
"target" : [
{
"context" : "composition",
"contextType" : "variable",
"element" : "section",
"variable" : "tgtSection"
}
],
"dependent" : [
{
"name" : "ClinicalDocumentSectionEsenzioni",
"variable" : [
"cda",
"srcSection",
"patient",
"tgtSection",
"bundle",
"encounter",
"coverage"
]
}
]
},
{
"name" : "prescfarm",
"source" : [
{
"context" : "srcSection",
"element" : "code",
"condition" : "(code = '57828-6')"
}
],
"target" : [
{
"context" : "composition",
"contextType" : "variable",
"element" : "section",
"variable" : "tgtSection"
}
],
"dependent" : [
{
"name" : "ClinicalDocumentSectionPrescrizioneFarmaceutica",
"variable" : [
"cda",
"srcSection",
"patient",
"tgtSection",
"bundle",
"encounter",
"coverage",
"medRq"
]
}
]
},
{
"name" : "annot",
"source" : [
{
"context" : "srcSection",
"element" : "code",
"condition" : "(code = '48767-8')"
}
],
"target" : [
{
"context" : "composition",
"contextType" : "variable",
"element" : "section",
"variable" : "tgtSection"
}
],
"dependent" : [
{
"name" : "ClinicalDocumentSectionAnnotazioni",
"variable" : [
"cda",
"srcSection",
"patient",
"tgtSection",
"bundle",
"encounter",
"medRq"
]
}
]
},
{
"name" : "messregg",
"source" : [
{
"context" : "srcSection",
"element" : "code",
"condition" : "(code = '51851-4')"
}
],
"target" : [
{
"context" : "composition",
"contextType" : "variable",
"element" : "section",
"variable" : "tgtSection"
}
],
"dependent" : [
{
"name" : "ClinicalDocumentSectionMessaggioRegionale",
"variable" : [
"cda",
"srcSection",
"patient",
"tgtSection",
"bundle",
"encounter",
"medRq"
]
}
]
},
{
"name" : "paramvit",
"source" : [
{
"context" : "srcSection",
"element" : "code",
"condition" : "(code = '8716-3')"
}
],
"target" : [
{
"context" : "composition",
"contextType" : "variable",
"element" : "section",
"variable" : "tgtSection"
}
],
"dependent" : [
{
"name" : "ClinicalDocumentSectionParametriVitali",
"variable" : [
"cda",
"srcSection",
"patient",
"tgtSection",
"bundle",
"encounter"
]
}
]
},
{
"name" : "allergfarm",
"source" : [
{
"context" : "srcSection",
"element" : "code",
"condition" : "(code = '48765-2')"
}
],
"target" : [
{
"context" : "composition",
"contextType" : "variable",
"element" : "section",
"variable" : "tgtSection"
}
],
"dependent" : [
{
"name" : "ClinicalDocumentSectionAllergieaiFarmaci",
"variable" : [
"cda",
"srcSection",
"patient",
"tgtSection",
"bundle",
"encounter"
]
}
]
},
{
"name" : "statclinpaz",
"source" : [
{
"context" : "srcSection",
"element" : "code",
"condition" : "(code = '47420-5')"
}
],
"target" : [
{
"context" : "composition",
"contextType" : "variable",
"element" : "section",
"variable" : "tgtSection"
}
],
"dependent" : [
{
"name" : "ClinicalDocumentSectionStatoClinicoPaziente",
"variable" : [
"cda",
"srcSection",
"patient",
"tgtSection",
"bundle",
"encounter"
]
}
]
}
],
"documentation" : "discretizzi il primo livello di component"
}
]
}
]
}
]
}
]
}
]
}
]
},
{
"name" : "ClinicalDocumentSectionEsenzioni",
"typeMode" : "none",
"input" : [
{
"name" : "cda",
"type" : "ClinicalDocument",
"mode" : "source"
},
{
"name" : "src",
"type" : "Section",
"mode" : "source"
},
{
"name" : "patient",
"type" : "Patient",
"mode" : "target"
},
{
"name" : "tgt",
"mode" : "target"
},
{
"name" : "bundle",
"type" : "Bundle",
"mode" : "target"
},
{
"name" : "enc",
"type" : "Encounter",
"mode" : "target"
},
{
"name" : "coverage",
"type" : "Coverage",
"mode" : "target"
}
],
"rule" : [
{
"name" : "title",
"source" : [
{
"context" : "src",
"element" : "title",
"variable" : "t"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "title",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "t.dataString"
}
]
}
]
},
{
"name" : "code",
"source" : [
{
"context" : "src",
"element" : "code",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "code",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "cff",
"source" : [
{
"context" : "src",
"element" : "text",
"variable" : "cdaText"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "entry",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Coverage/' + %coverage.id"
}
]
},
{
"context" : "tgt",
"contextType" : "variable",
"element" : "text",
"variable" : "fhirText"
}
],
"rule" : [
{
"name" : "narrativeStatus",
"source" : [
{
"context" : "cdaText"
}
],
"target" : [
{
"context" : "fhirText",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "generated"
}
]
}
]
},
{
"name" : "narrativeText",
"source" : [
{
"context" : "cdaText",
"variable" : "t"
}
],
"target" : [
{
"context" : "fhirText",
"contextType" : "variable",
"element" : "div",
"transform" : "copy",
"parameter" : [
{
"valueId" : "t"
}
]
}
]
},
{
"name" : "secact",
"source" : [
{
"context" : "src",
"element" : "entry",
"variable" : "srcse"
}
],
"rule" : [
{
"name" : "cdaText",
"source" : [
{
"context" : "srcse",
"element" : "act",
"variable" : "srcsec"
}
],
"rule" : [
{
"name" : "code",
"source" : [
{
"context" : "srcsec",
"element" : "code",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "coverage",
"contextType" : "variable",
"element" : "type",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "origtxt",
"source" : [
{
"context" : "srcsec",
"element" : "code",
"variable" : "srctxt"
}
],
"rule" : [
{
"name" : "reftxt",
"source" : [
{
"context" : "srctxt"
}
],
"target" : [
{
"context" : "coverage",
"contextType" : "variable",
"element" : "type",
"variable" : "typetxt"
}
],
"rule" : [
{
"name" : "rfde",
"source" : [
{
"context" : "srctxt",
"element" : "originalText",
"variable" : "ref"
}
],
"rule" : [
{
"name" : "tcf",
"source" : [
{
"context" : "ref",
"element" : "reference",
"variable" : "t"
}
],
"rule" : [
{
"name" : "reference",
"source" : [
{
"context" : "t",
"element" : "value",
"variable" : "l"
}
],
"target" : [
{
"context" : "typetxt",
"contextType" : "variable",
"element" : "text",
"transform" : "copy",
"parameter" : [
{
"valueId" : "l"
}
]
}
]
}
]
}
]
}
]
}
]
},
{
"name" : "statuscode",
"source" : [
{
"context" : "srcsec",
"condition" : "coverage.status.exists().not()"
}
],
"rule" : [
{
"name" : "status",
"source" : [
{
"context" : "srcsec"
}
],
"target" : [
{
"context" : "coverage",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "active"
}
]
}
]
}
]
},
{
"name" : "reference",
"source" : [
{
"context" : "srcsec"
}
],
"target" : [
{
"context" : "coverage",
"contextType" : "variable",
"element" : "beneficiary",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Patient/' + %patient.id"
}
]
}
]
},
{
"name" : "reference",
"source" : [
{
"context" : "srcsec"
}
],
"target" : [
{
"context" : "coverage",
"contextType" : "variable",
"element" : "payor",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Patient/' + %patient.id"
}
]
}
]
}
]
}
]
}
]
}
]
},
{
"name" : "ClinicalDocumentSectionPrescrizioneFarmaceutica",
"typeMode" : "none",
"input" : [
{
"name" : "cda",
"type" : "ClinicalDocument",
"mode" : "source"
},
{
"name" : "src",
"type" : "Section",
"mode" : "source"
},
{
"name" : "patient",
"type" : "Patient",
"mode" : "target"
},
{
"name" : "tgt",
"mode" : "target"
},
{
"name" : "bundle",
"type" : "Bundle",
"mode" : "target"
},
{
"name" : "enc",
"type" : "Encounter",
"mode" : "target"
},
{
"name" : "coverage",
"type" : "Coverage",
"mode" : "target"
},
{
"name" : "medRq",
"type" : "MedicationRequest",
"mode" : "target"
}
],
"rule" : [
{
"name" : "title",
"source" : [
{
"context" : "src",
"element" : "title",
"variable" : "t"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "title",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "t.dataString"
}
]
}
]
},
{
"name" : "code",
"source" : [
{
"context" : "src",
"element" : "code",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "code",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "xxx",
"source" : [
{
"context" : "src",
"element" : "text",
"variable" : "cdaText"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "entry",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/MedicationRequest/' + %medRq.id"
}
]
},
{
"context" : "tgt",
"contextType" : "variable",
"element" : "text",
"variable" : "fhirText"
}
],
"rule" : [
{
"name" : "id",
"source" : [
{
"context" : "src",
"element" : "id",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "medRq",
"contextType" : "variable",
"element" : "identifier",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "narrativeStatus",
"source" : [
{
"context" : "cdaText"
}
],
"target" : [
{
"context" : "fhirText",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "generated"
}
]
}
]
},
{
"name" : "narrativeText",
"source" : [
{
"context" : "cdaText",
"variable" : "t"
}
],
"target" : [
{
"context" : "fhirText",
"contextType" : "variable",
"element" : "div",
"transform" : "copy",
"parameter" : [
{
"valueId" : "t"
}
]
}
]
},
{
"name" : "reference",
"source" : [
{
"context" : "cdaText"
}
],
"target" : [
{
"context" : "medRq",
"contextType" : "variable",
"element" : "subject",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Patient/' + %patient.id"
}
]
}
]
},
{
"name" : "reference",
"source" : [
{
"context" : "cdaText"
}
],
"target" : [
{
"context" : "medRq",
"contextType" : "variable",
"element" : "encounter",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Encounter/' + %enc.id"
}
]
}
]
},
{
"name" : "status",
"source" : [
{
"context" : "cdaText"
}
],
"target" : [
{
"context" : "medRq",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "active"
}
]
}
]
},
{
"name" : "intent",
"source" : [
{
"context" : "cdaText"
}
],
"target" : [
{
"context" : "medRq",
"contextType" : "variable",
"element" : "intent",
"transform" : "copy",
"parameter" : [
{
"valueString" : "order"
}
]
}
]
},
{
"name" : "hnjh",
"source" : [
{
"context" : "src",
"element" : "entry",
"variable" : "srcent"
}
],
"rule" : [
{
"name" : "subadm",
"source" : [
{
"context" : "srcent",
"element" : "substanceAdministration",
"variable" : "subAdm"
}
],
"rule" : [
{
"name" : "dosage",
"source" : [
{
"context" : "subAdm",
"type" : "IVL_TS",
"element" : "effectiveTime",
"variable" : "eff"
}
],
"target" : [
{
"context" : "medRq",
"contextType" : "variable",
"element" : "dosageInstruction",
"variable" : "dosage",
"transform" : "create",
"parameter" : [
{
"valueString" : "Dosage"
}
]
}
],
"rule" : [
{
"name" : "timing",
"source" : [
{
"context" : "subAdm"
}
],
"target" : [
{
"context" : "dosage",
"contextType" : "variable",
"element" : "timing",
"variable" : "tim",
"transform" : "create",
"parameter" : [
{
"valueString" : "Timing"
}
]
}
],
"rule" : [
{
"name" : "repeat",
"source" : [
{
"context" : "subAdm"
}
],
"target" : [
{
"context" : "tim",
"contextType" : "variable",
"element" : "repeat",
"variable" : "repeat"
}
],
"rule" : [
{
"name" : "boundsperiod",
"source" : [
{
"context" : "eff"
}
],
"target" : [
{
"context" : "repeat",
"contextType" : "variable",
"element" : "bounds",
"variable" : "period",
"transform" : "create",
"parameter" : [
{
"valueString" : "Period"
}
]
}
],
"dependent" : [
{
"name" : "IVLTSPeriod",
"variable" : [
"eff",
"period"
]
}
]
},
{
"name" : "width",
"source" : [
{
"context" : "eff",
"element" : "width",
"variable" : "width"
}
],
"rule" : [
{
"name" : "value",
"source" : [
{
"context" : "width",
"element" : "value",
"variable" : "v"
}
],
"target" : [
{
"context" : "repeat",
"contextType" : "variable",
"element" : "duration",
"transform" : "copy",
"parameter" : [
{
"valueId" : "v"
}
]
}
]
},
{
"name" : "unit",
"source" : [
{
"context" : "width",
"element" : "unit",
"variable" : "u"
}
],
"target" : [
{
"context" : "repeat",
"contextType" : "variable",
"element" : "durationUnit",
"transform" : "copy",
"parameter" : [
{
"valueId" : "u"
}
]
}
]
}
]
}
]
}
]
}
]
},
{
"name" : "dosage1",
"source" : [
{
"context" : "subAdm",
"element" : "effectiveTime",
"variable" : "eff"
}
],
"target" : [
{
"context" : "medRq",
"contextType" : "variable",
"element" : "dosageInstruction",
"variable" : "dosage",
"transform" : "create",
"parameter" : [
{
"valueString" : "Dosage"
}
]
}
],
"rule" : [
{
"name" : "timing1",
"source" : [
{
"context" : "subAdm"
}
],
"target" : [
{
"context" : "dosage",
"contextType" : "variable",
"element" : "timing",
"variable" : "tim",
"transform" : "create",
"parameter" : [
{
"valueString" : "Timing"
}
]
}
],
"rule" : [
{
"name" : "effct1",
"source" : [
{
"context" : "eff",
"condition" : "eff.low.exists().not() and eff.high.exists().not()"
}
],
"rule" : [
{
"name" : "evnt",
"source" : [
{
"context" : "eff",
"element" : "value",
"variable" : "v"
}
],
"target" : [
{
"context" : "tim",
"contextType" : "variable",
"element" : "event",
"variable" : "event",
"transform" : "create",
"parameter" : [
{
"valueString" : "dateTime"
}
]
}
],
"dependent" : [
{
"name" : "TSDateTime",
"variable" : [
"v",
"event"
]
}
]
}
]
}
]
}
]
},
{
"name" : "eff",
"source" : [
{
"context" : "subAdm",
"type" : "PIVL_TS",
"element" : "effectiveTime",
"variable" : "effp"
}
],
"target" : [
{
"context" : "medRq",
"contextType" : "variable",
"element" : "dosageInstruction",
"variable" : "dosage",
"transform" : "create",
"parameter" : [
{
"valueString" : "Dosage"
}
]
}
],
"rule" : [
{
"name" : "timing",
"source" : [
{
"context" : "effp"
}
],
"target" : [
{
"context" : "dosage",
"contextType" : "variable",
"element" : "timing",
"variable" : "timing",
"transform" : "create",
"parameter" : [
{
"valueString" : "Timing"
}
]
}
],
"rule" : [
{
"name" : "cod",
"source" : [
{
"context" : "effp"
}
],
"target" : [
{
"contextType" : "variable",
"transform" : "copy",
"parameter" : [
{
"valueId" : "timing"
}
]
}
],
"dependent" : [
{
"name" : "periodTiming",
"variable" : [
"effp",
"timing"
]
}
]
},
{
"name" : "phase",
"source" : [
{
"context" : "effp",
"condition" : "effp.phase.exists()"
}
],
"rule" : [
{
"name" : "rep",
"source" : [
{
"context" : "effp",
"element" : "phase",
"variable" : "phase"
}
],
"target" : [
{
"context" : "timing",
"contextType" : "variable",
"element" : "repeat",
"variable" : "r"
}
],
"rule" : [
{
"name" : "low",
"source" : [
{
"context" : "phase",
"element" : "low"
}
],
"target" : [
{
"context" : "r",
"contextType" : "variable",
"element" : "bounds",
"variable" : "period",
"transform" : "create",
"parameter" : [
{
"valueString" : "Period"
}
]
}
],
"rule" : [
{
"name" : "lo",
"source" : [
{
"context" : "phase",
"element" : "low",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "period",
"contextType" : "variable",
"element" : "start",
"variable" : "vvv",
"transform" : "create"
}
]
}
]
},
{
"name" : "dur",
"source" : [
{
"context" : "phase",
"element" : "width",
"variable" : "wid"
}
],
"rule" : [
{
"name" : "vals",
"source" : [
{
"context" : "wid",
"element" : "value",
"variable" : "v"
}
],
"target" : [
{
"context" : "r",
"contextType" : "variable",
"element" : "duration",
"transform" : "copy",
"parameter" : [
{
"valueId" : "v"
}
]
}
]
},
{
"name" : "unit",
"source" : [
{
"context" : "wid",
"element" : "unit",
"variable" : "u"
}
],
"target" : [
{
"context" : "r",
"contextType" : "variable",
"element" : "durationUnit",
"transform" : "copy",
"parameter" : [
{
"valueId" : "u"
}
]
}
]
}
]
}
]
}
]
}
]
}
]
},
{
"name" : "eff",
"source" : [
{
"context" : "subAdm",
"type" : "EIVL_TS",
"element" : "effectiveTime",
"variable" : "effe"
}
],
"target" : [
{
"context" : "medRq",
"contextType" : "variable",
"element" : "dosageInstruction",
"variable" : "dosage",
"transform" : "create",
"parameter" : [
{
"valueString" : "Dosage"
}
]
}
],
"rule" : [
{
"name" : "ghj",
"source" : [
{
"context" : "effe"
}
],
"target" : [
{
"context" : "dosage",
"contextType" : "variable",
"element" : "timing",
"variable" : "timing",
"transform" : "create",
"parameter" : [
{
"valueString" : "Timing"
}
]
}
],
"rule" : [
{
"name" : "lkj",
"source" : [
{
"context" : "effe"
}
],
"target" : [
{
"context" : "timing",
"contextType" : "variable",
"element" : "repeat",
"variable" : "r"
}
],
"rule" : [
{
"name" : "event",
"source" : [
{
"context" : "effe",
"element" : "event",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "r",
"contextType" : "variable",
"element" : "when",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "poi",
"source" : [
{
"context" : "effe",
"element" : "offset",
"variable" : "offset"
}
],
"rule" : [
{
"name" : "offs",
"source" : [
{
"context" : "offset",
"element" : "low",
"variable" : "v"
}
],
"rule" : [
{
"name" : "barabar",
"source" : [
{
"context" : "v",
"element" : "value",
"variable" : "o"
}
],
"target" : [
{
"context" : "r",
"contextType" : "variable",
"element" : "offset",
"transform" : "copy",
"parameter" : [
{
"valueId" : "o"
}
]
}
]
}
]
}
]
}
]
}
]
}
]
},
{
"name" : "doseQuant",
"source" : [
{
"context" : "subAdm",
"element" : "doseQuantity",
"variable" : "doseQuant"
}
],
"target" : [
{
"context" : "medRq",
"contextType" : "variable",
"element" : "dosageInstruction",
"variable" : "dosage",
"transform" : "create",
"parameter" : [
{
"valueString" : "Dosage"
}
]
}
],
"rule" : [
{
"name" : "ot",
"source" : [
{
"context" : "doseQuant",
"element" : "originalText",
"variable" : "ot"
}
],
"rule" : [
{
"name" : "reference",
"source" : [
{
"context" : "ot",
"element" : "reference",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "dosage",
"contextType" : "variable",
"element" : "text",
"variable" : "vvv",
"transform" : "create"
}
]
}
]
},
{
"name" : "dosageRate",
"source" : [
{
"context" : "doseQuant"
}
],
"target" : [
{
"context" : "dosage",
"contextType" : "variable",
"element" : "doseAndRate",
"variable" : "dosageRate"
}
],
"rule" : [
{
"name" : "d",
"source" : [
{
"context" : "doseQuant"
}
],
"target" : [
{
"context" : "dosageRate",
"contextType" : "variable",
"element" : "dose",
"variable" : "d",
"transform" : "create",
"parameter" : [
{
"valueString" : "Range"
}
]
}
],
"rule" : [
{
"name" : "low",
"source" : [
{
"context" : "doseQuant"
}
],
"target" : [
{
"context" : "d",
"contextType" : "variable",
"element" : "low",
"variable" : "l",
"transform" : "create",
"parameter" : [
{
"valueString" : "SimpleQuantity"
}
]
}
],
"rule" : [
{
"name" : "low",
"source" : [
{
"context" : "doseQuant",
"element" : "low",
"variable" : "lo"
}
],
"target" : [
{
"context" : "l",
"contextType" : "variable",
"element" : "value",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "lo.value"
}
]
}
]
},
{
"name" : "low",
"source" : [
{
"context" : "doseQuant",
"element" : "low",
"variable" : "lo"
}
],
"target" : [
{
"context" : "l",
"contextType" : "variable",
"element" : "unit",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "lo.unit"
}
]
}
]
}
]
},
{
"name" : "low",
"source" : [
{
"context" : "doseQuant"
}
],
"target" : [
{
"context" : "d",
"contextType" : "variable",
"element" : "high",
"variable" : "h",
"transform" : "create",
"parameter" : [
{
"valueString" : "SimpleQuantity"
}
]
}
],
"rule" : [
{
"name" : "high",
"source" : [
{
"context" : "doseQuant",
"element" : "high",
"variable" : "hi"
}
],
"target" : [
{
"context" : "h",
"contextType" : "variable",
"element" : "value",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "hi.value"
}
]
}
]
},
{
"name" : "high",
"source" : [
{
"context" : "doseQuant",
"element" : "high",
"variable" : "hi"
}
],
"target" : [
{
"context" : "h",
"contextType" : "variable",
"element" : "unit",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "hi.unit"
}
]
}
]
}
]
}
]
}
]
}
]
},
{
"name" : "subsadm",
"source" : [
{
"context" : "subAdm"
}
],
"target" : [
{
"context" : "bundle",
"contextType" : "variable",
"element" : "entry",
"variable" : "e1"
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "request",
"variable" : "request",
"transform" : "create",
"parameter" : [
{
"valueString" : "BackboneElement"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "method",
"transform" : "copy",
"parameter" : [
{
"valueString" : "POST"
}
]
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "resource",
"variable" : "medication",
"transform" : "create",
"parameter" : [
{
"valueString" : "Medication"
}
]
},
{
"context" : "medication",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid1",
"transform" : "uuid"
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "https://example/Medication/"
},
{
"valueId" : "uuid1"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "url",
"transform" : "copy",
"parameter" : [
{
"valueString" : "Medication"
}
]
},
{
"context" : "medRq",
"contextType" : "variable",
"element" : "medication",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Medication/' + %medication.id"
}
]
}
],
"rule" : [
{
"name" : "cons",
"source" : [
{
"context" : "subAdm",
"element" : "consumable",
"variable" : "cons"
}
],
"rule" : [
{
"name" : "manumat",
"source" : [
{
"context" : "cons",
"element" : "manufacturedProduct",
"variable" : "manuprod"
}
],
"rule" : [
{
"name" : "manudrug",
"source" : [
{
"context" : "manuprod",
"element" : "manufacturedLabeledDrug",
"variable" : "manudrug"
}
],
"rule" : [
{
"name" : "code",
"source" : [
{
"context" : "manudrug",
"element" : "code",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "medication",
"contextType" : "variable",
"element" : "code",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "idmedname",
"source" : [
{
"context" : "manudrug"
}
],
"target" : [
{
"context" : "medication",
"contextType" : "variable",
"element" : "identifier",
"variable" : "medid"
}
],
"rule" : [
{
"name" : "name",
"source" : [
{
"context" : "manudrug",
"element" : "name",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "medid",
"contextType" : "variable",
"element" : "value",
"variable" : "vvv",
"transform" : "create"
}
]
}
]
},
{
"name" : "origtxtd",
"source" : [
{
"context" : "manudrug",
"element" : "code",
"variable" : "srctxt"
}
],
"rule" : [
{
"name" : "reftxtd",
"source" : [
{
"context" : "srctxt"
}
],
"target" : [
{
"context" : "medication",
"contextType" : "variable",
"element" : "code",
"variable" : "typetxt"
}
],
"rule" : [
{
"name" : "tcfg",
"source" : [
{
"context" : "srctxt",
"element" : "originalText",
"variable" : "ref"
}
],
"rule" : [
{
"name" : "tcf",
"source" : [
{
"context" : "ref",
"element" : "reference",
"variable" : "reference"
}
],
"rule" : [
{
"name" : "reference",
"source" : [
{
"context" : "reference",
"element" : "value",
"variable" : "l"
}
],
"target" : [
{
"context" : "typetxt",
"contextType" : "variable",
"element" : "text",
"transform" : "copy",
"parameter" : [
{
"valueId" : "l"
}
]
}
]
}
]
}
]
}
]
}
]
}
]
},
{
"name" : "manuFact",
"source" : [
{
"context" : "manuprod",
"element" : "manufacturedMaterial",
"variable" : "manufact"
}
],
"rule" : [
{
"name" : "code",
"source" : [
{
"context" : "manufact",
"element" : "code",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "medication",
"contextType" : "variable",
"element" : "code",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "origtxt",
"source" : [
{
"context" : "manufact",
"element" : "code",
"variable" : "srctxt"
}
],
"rule" : [
{
"name" : "reftxt",
"source" : [
{
"context" : "srctxt"
}
],
"target" : [
{
"context" : "medication",
"contextType" : "variable",
"element" : "code",
"variable" : "typetxt"
}
],
"rule" : [
{
"name" : "tcfg",
"source" : [
{
"context" : "srctxt",
"element" : "originalText",
"variable" : "ref"
}
],
"rule" : [
{
"name" : "tcf",
"source" : [
{
"context" : "ref",
"element" : "reference",
"variable" : "reference"
}
],
"rule" : [
{
"name" : "reference",
"source" : [
{
"context" : "reference",
"element" : "value",
"variable" : "l"
}
],
"target" : [
{
"context" : "typetxt",
"contextType" : "variable",
"element" : "text",
"transform" : "copy",
"parameter" : [
{
"valueId" : "l"
}
]
}
]
}
]
}
]
}
]
}
]
},
{
"name" : "ingr",
"source" : [
{
"context" : "manufact",
"element" : "ingredient",
"variable" : "ingredient"
}
],
"target" : [
{
"context" : "medication",
"contextType" : "variable",
"element" : "ingredient",
"variable" : "ing"
}
],
"rule" : [
{
"name" : "strength",
"source" : [
{
"context" : "ingredient",
"element" : "quantity",
"variable" : "quantity"
}
],
"target" : [
{
"context" : "ing",
"contextType" : "variable",
"element" : "strength",
"variable" : "strength",
"transform" : "create",
"parameter" : [
{
"valueString" : "Ratio"
}
]
}
],
"dependent" : [
{
"name" : "EmedRTOPQPQRatio",
"variable" : [
"quantity",
"strength"
]
}
]
},
{
"name" : "ingredientCode",
"source" : [
{
"context" : "manufact"
}
],
"target" : [
{
"context" : "ing",
"contextType" : "variable",
"element" : "item",
"variable" : "ingcode",
"transform" : "create",
"parameter" : [
{
"valueString" : "CodeableConcept"
}
]
},
{
"context" : "ingcode",
"contextType" : "variable",
"element" : "text",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "%manufact.name.other"
}
]
}
]
}
]
},
{
"name" : "formCode",
"source" : [
{
"context" : "manufact",
"element" : "formCode",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "medication",
"contextType" : "variable",
"element" : "form",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "transl",
"source" : [
{
"context" : "manufact"
}
],
"target" : [
{
"context" : "medication",
"contextType" : "variable",
"element" : "identifier",
"variable" : "medid"
}
]
}
]
}
]
}
]
},
{
"name" : "entry1",
"source" : [
{
"context" : "subAdm",
"element" : "entryRelationship",
"variable" : "entryrel1"
}
],
"rule" : [
{
"name" : "supply",
"source" : [
{
"context" : "entryrel1",
"element" : "supply",
"variable" : "sup"
}
],
"target" : [
{
"context" : "medRq",
"contextType" : "variable",
"element" : "dispenseRequest",
"variable" : "dispreq"
}
],
"rule" : [
{
"name" : "quantity",
"source" : [
{
"context" : "sup"
}
],
"target" : [
{
"context" : "dispreq",
"contextType" : "variable",
"element" : "quantity",
"variable" : "quantity",
"transform" : "create",
"parameter" : [
{
"valueString" : "SimpleQuantity"
}
]
}
],
"rule" : [
{
"name" : "quantity",
"source" : [
{
"context" : "sup",
"element" : "quantity",
"variable" : "q"
}
],
"target" : [
{
"context" : "quantity",
"contextType" : "variable",
"element" : "value",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "q.value"
}
]
}
]
}
]
}
]
}
]
},
{
"name" : "entry2",
"source" : [
{
"context" : "subAdm",
"element" : "entryRelationship",
"variable" : "entryrel2",
"condition" : "(typeCode = 'REFR')"
}
],
"rule" : [
{
"name" : "Cover",
"source" : [
{
"context" : "subAdm"
}
],
"target" : [
{
"context" : "medRq",
"contextType" : "variable",
"element" : "insurance",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Coverage/' + %coverage.id"
}
]
}
],
"rule" : [
{
"name" : "act2",
"source" : [
{
"context" : "entryrel2",
"element" : "act",
"variable" : "act2"
}
],
"target" : [
{
"context" : "coverage",
"contextType" : "variable",
"element" : "costToBeneficiary",
"variable" : "cost"
}
],
"rule" : [
{
"name" : "beneficmoney",
"source" : [
{
"context" : "act2"
}
],
"target" : [
{
"context" : "cost",
"contextType" : "variable",
"element" : "value",
"variable" : "val",
"transform" : "create",
"parameter" : [
{
"valueString" : "SimpleQuantity"
}
]
}
],
"rule" : [
{
"name" : "bnm",
"source" : [
{
"context" : "act2"
}
],
"target" : [
{
"context" : "val",
"contextType" : "variable",
"element" : "value",
"transform" : "copy",
"parameter" : [
{
"valueString" : "0"
}
]
}
]
}
]
},
{
"name" : "exept",
"source" : [
{
"context" : "act2"
}
],
"target" : [
{
"context" : "cost",
"contextType" : "variable",
"element" : "exception",
"variable" : "except"
}
],
"rule" : [
{
"name" : "code",
"source" : [
{
"context" : "act2",
"element" : "code",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "except",
"contextType" : "variable",
"element" : "type",
"variable" : "vvv",
"transform" : "create"
}
]
}
]
}
]
}
]
}
]
},
{
"name" : "entry2",
"source" : [
{
"context" : "subAdm",
"element" : "entryRelationship",
"variable" : "entryrel3",
"condition" : "(typeCode = 'RSON')"
}
],
"rule" : [
{
"name" : "obs3",
"source" : [
{
"context" : "entryrel3",
"element" : "observation",
"variable" : "obs3",
"condition" : "(classCode = 'OBS')"
}
],
"rule" : [
{
"name" : "code",
"source" : [
{
"context" : "obs3",
"element" : "code",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "medRq",
"contextType" : "variable",
"element" : "reasonCode",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "txt",
"source" : [
{
"context" : "obs3",
"element" : "text",
"variable" : "text"
}
],
"rule" : [
{
"name" : "originltext",
"source" : [
{
"context" : "text"
}
],
"target" : [
{
"context" : "medRq",
"contextType" : "variable",
"element" : "reasonCode",
"variable" : "ce"
}
],
"rule" : [
{
"name" : "tcf",
"source" : [
{
"context" : "text",
"element" : "reference",
"variable" : "reference"
}
],
"rule" : [
{
"name" : "reference",
"source" : [
{
"context" : "reference",
"element" : "value",
"variable" : "l"
}
],
"target" : [
{
"context" : "ce",
"contextType" : "variable",
"element" : "text",
"transform" : "copy",
"parameter" : [
{
"valueId" : "l"
}
]
}
]
}
],
"documentation" : "text.reference as reference-> ce.text=reference;"
}
]
}
]
}
]
}
]
},
{
"name" : "code",
"source" : [
{
"context" : "subAdm",
"element" : "entryRelationship",
"variable" : "entryrel4",
"condition" : "(typeCode = 'SUBJ')"
}
],
"rule" : [
{
"name" : "obs",
"source" : [
{
"context" : "entryrel4",
"element" : "observation",
"variable" : "obs3"
}
],
"target" : [
{
"context" : "medRq",
"contextType" : "variable",
"element" : "substitution",
"variable" : "sub"
}
],
"rule" : [
{
"name" : "code",
"source" : [
{
"context" : "obs3",
"element" : "code",
"variable" : "Code"
}
],
"target" : [
{
"context" : "sub",
"contextType" : "variable",
"element" : "allowed",
"variable" : "allowed",
"transform" : "create",
"parameter" : [
{
"valueString" : "CodeableConcept"
}
]
}
],
"dependent" : [
{
"name" : "CECodeableConcept",
"variable" : [
"Code",
"allowed"
]
}
]
},
{
"name" : "entry",
"source" : [
{
"context" : "obs3",
"element" : "entryRelationship",
"variable" : "entry"
}
],
"rule" : [
{
"name" : "obs4",
"source" : [
{
"context" : "entry",
"element" : "observation",
"variable" : "obs4"
}
],
"rule" : [
{
"name" : "code",
"source" : [
{
"context" : "obs4",
"element" : "code",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "sub",
"contextType" : "variable",
"element" : "reason",
"variable" : "vvv",
"transform" : "create"
}
]
}
]
}
]
}
]
}
]
},
{
"name" : "entry2",
"source" : [
{
"context" : "subAdm",
"element" : "entryRelationship",
"variable" : "entryrel2",
"condition" : "(typeCode = 'SUBJ')"
}
],
"rule" : [
{
"name" : "obs3",
"source" : [
{
"context" : "entryrel2",
"element" : "act",
"variable" : "act2",
"condition" : "(classCode = 'ACT')"
}
],
"rule" : [
{
"name" : "reference",
"source" : [
{
"context" : "act2",
"element" : "text",
"variable" : "text"
}
],
"target" : [
{
"context" : "medRq",
"contextType" : "variable",
"element" : "note",
"variable" : "note"
}
],
"rule" : [
{
"name" : "tcx",
"source" : [
{
"context" : "text",
"element" : "reference",
"variable" : "t"
}
],
"rule" : [
{
"name" : "reference",
"source" : [
{
"context" : "t",
"element" : "value",
"variable" : "l"
}
],
"target" : [
{
"context" : "note",
"contextType" : "variable",
"element" : "text",
"transform" : "copy",
"parameter" : [
{
"valueId" : "l"
}
]
}
]
}
]
}
]
}
]
}
]
}
]
}
]
}
]
}
]
}
]
},
{
"name" : "ClinicalDocumentSectionAnnotazioni",
"typeMode" : "none",
"documentation" : "------------Sezione Annotazioni-----------------------------------------------------------------------------------------------------------------------------------------",
"input" : [
{
"name" : "cda",
"type" : "ClinicalDocument",
"mode" : "source"
},
{
"name" : "src",
"type" : "Section",
"mode" : "source"
},
{
"name" : "patient",
"type" : "Patient",
"mode" : "target"
},
{
"name" : "tgt",
"mode" : "target"
},
{
"name" : "bundle",
"type" : "Bundle",
"mode" : "target"
},
{
"name" : "enc",
"type" : "Encounter",
"mode" : "target"
},
{
"name" : "medRq",
"type" : "MedicationRequest",
"mode" : "target"
}
],
"rule" : [
{
"name" : "title",
"source" : [
{
"context" : "src",
"element" : "title",
"variable" : "t"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "title",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "t.dataString"
}
]
}
]
},
{
"name" : "code",
"source" : [
{
"context" : "src",
"element" : "code",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "code",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "entry",
"source" : [
{
"context" : "src",
"element" : "text",
"variable" : "cdaText"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "entry",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/MedicationRequest/' + %medRq.id"
}
]
},
{
"context" : "tgt",
"contextType" : "variable",
"element" : "text",
"variable" : "fhirText"
}
],
"rule" : [
{
"name" : "narrativeStatus",
"source" : [
{
"context" : "cdaText"
}
],
"target" : [
{
"context" : "fhirText",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "generated"
}
]
}
]
},
{
"name" : "narrativeText",
"source" : [
{
"context" : "cdaText",
"variable" : "t"
}
],
"target" : [
{
"context" : "fhirText",
"contextType" : "variable",
"element" : "div",
"transform" : "copy",
"parameter" : [
{
"valueId" : "t"
}
]
}
]
},
{
"name" : "entry",
"source" : [
{
"context" : "src",
"element" : "entry",
"variable" : "entry"
}
],
"rule" : [
{
"name" : "act",
"source" : [
{
"context" : "entry",
"element" : "act",
"variable" : "act"
}
],
"rule" : [
{
"name" : "reference",
"source" : [
{
"context" : "act",
"element" : "text",
"variable" : "text"
}
],
"target" : [
{
"context" : "medRq",
"contextType" : "variable",
"element" : "note",
"variable" : "note"
}
],
"rule" : [
{
"name" : "tcx",
"source" : [
{
"context" : "text",
"element" : "reference",
"variable" : "t"
}
],
"rule" : [
{
"name" : "reference",
"source" : [
{
"context" : "t",
"element" : "value",
"variable" : "l"
}
],
"target" : [
{
"context" : "note",
"contextType" : "variable",
"element" : "text",
"transform" : "copy",
"parameter" : [
{
"valueId" : "l"
}
]
}
]
}
]
}
]
}
]
}
]
}
]
}
]
},
{
"name" : "ClinicalDocumentSectionMessaggioRegionale",
"typeMode" : "none",
"documentation" : "------------Sezione Messaggio Regionale-----------------------------------------------------------------------------------------------------------------------------------------",
"input" : [
{
"name" : "cda",
"type" : "ClinicalDocument",
"mode" : "source"
},
{
"name" : "src",
"type" : "Section",
"mode" : "source"
},
{
"name" : "patient",
"type" : "Patient",
"mode" : "target"
},
{
"name" : "tgt",
"mode" : "target"
},
{
"name" : "bundle",
"type" : "Bundle",
"mode" : "target"
},
{
"name" : "enc",
"type" : "Encounter",
"mode" : "target"
},
{
"name" : "medRq",
"type" : "MedicationRequest",
"mode" : "target"
}
],
"rule" : [
{
"name" : "title",
"source" : [
{
"context" : "src",
"element" : "title",
"variable" : "t"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "title",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "t.dataString"
}
]
}
]
},
{
"name" : "code",
"source" : [
{
"context" : "src",
"element" : "code",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "code",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "entry",
"source" : [
{
"context" : "src",
"element" : "text",
"variable" : "cdaText"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "entry",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/MedicationRequest/' + %medRq.id"
}
]
}
],
"rule" : [
{
"name" : "nota",
"source" : [
{
"context" : "cdaText",
"variable" : "text"
}
],
"target" : [
{
"context" : "medRq",
"contextType" : "variable",
"element" : "note",
"variable" : "note"
}
],
"rule" : [
{
"name" : "reference",
"source" : [
{
"context" : "text",
"variable" : "t"
}
],
"target" : [
{
"context" : "note",
"contextType" : "variable",
"element" : "text",
"transform" : "copy",
"parameter" : [
{
"valueId" : "t"
}
]
}
]
}
]
}
]
}
]
},
{
"name" : "ClinicalDocumentSectionParametriVitali",
"typeMode" : "none",
"documentation" : "------------Sezione Parametri Vitali-----------------------------------------------------------------------------------------------------------------------------------------",
"input" : [
{
"name" : "cda",
"type" : "ClinicalDocument",
"mode" : "source"
},
{
"name" : "src",
"type" : "Section",
"mode" : "source"
},
{
"name" : "patient",
"type" : "Patient",
"mode" : "target"
},
{
"name" : "tgt",
"mode" : "target"
},
{
"name" : "bundle",
"type" : "Bundle",
"mode" : "target"
},
{
"name" : "enc",
"type" : "Encounter",
"mode" : "target"
}
],
"rule" : [
{
"name" : "title",
"source" : [
{
"context" : "src",
"element" : "title",
"variable" : "t"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "title",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "t.dataString"
}
]
}
]
},
{
"name" : "code",
"source" : [
{
"context" : "src",
"element" : "code",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "code",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "nota",
"source" : [
{
"context" : "src",
"element" : "text",
"variable" : "cdaText"
}
],
"target" : [
{
"context" : "bundle",
"contextType" : "variable",
"element" : "entry",
"variable" : "e8"
},
{
"context" : "e8",
"contextType" : "variable",
"element" : "request",
"variable" : "request",
"transform" : "create",
"parameter" : [
{
"valueString" : "BackboneElement"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "method",
"transform" : "copy",
"parameter" : [
{
"valueString" : "POST"
}
]
},
{
"context" : "e8",
"contextType" : "variable",
"element" : "resource",
"variable" : "Observation",
"transform" : "create",
"parameter" : [
{
"valueString" : "Observation"
}
]
},
{
"context" : "Observation",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid8",
"transform" : "uuid"
},
{
"context" : "e8",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "https://example/Observation/"
},
{
"valueId" : "uuid8"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "url",
"transform" : "copy",
"parameter" : [
{
"valueString" : "Observation"
}
]
},
{
"context" : "tgt",
"contextType" : "variable",
"element" : "entry",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Observation/' + %Observation.id"
}
]
}
],
"rule" : [
{
"name" : "reference",
"source" : [
{
"context" : "src"
}
],
"target" : [
{
"context" : "Observation",
"contextType" : "variable",
"element" : "subject",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Patient/' + %patient.id"
}
]
}
]
},
{
"name" : "reference",
"source" : [
{
"context" : "src"
}
],
"target" : [
{
"context" : "Observation",
"contextType" : "variable",
"element" : "encounter",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Encounter/' + %enc.id"
}
]
}
]
},
{
"name" : "code",
"source" : [
{
"context" : "src",
"element" : "code",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "Observation",
"contextType" : "variable",
"element" : "code",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "statuscode",
"source" : [
{
"context" : "src",
"condition" : "Observation.statusCode.exists().not()"
}
],
"rule" : [
{
"name" : "status",
"source" : [
{
"context" : "src"
}
],
"target" : [
{
"context" : "Observation",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "final"
}
]
}
]
}
]
},
{
"name" : "reference",
"source" : [
{
"context" : "cdaText"
}
],
"target" : [
{
"context" : "Observation",
"contextType" : "variable",
"element" : "note",
"variable" : "note"
}
],
"rule" : [
{
"name" : "reference",
"source" : [
{
"context" : "cdaText",
"variable" : "t"
}
],
"target" : [
{
"context" : "note",
"contextType" : "variable",
"element" : "text",
"transform" : "copy",
"parameter" : [
{
"valueId" : "t"
}
]
}
]
}
]
}
]
}
]
},
{
"name" : "ClinicalDocumentSectionAllergieaiFarmaci",
"typeMode" : "none",
"documentation" : "------------Sezione Allergie_Intolleranze-----------------------------------------------------------------------------------------------------------------------------------------",
"input" : [
{
"name" : "cda",
"type" : "ClinicalDocument",
"mode" : "source"
},
{
"name" : "src",
"type" : "Section",
"mode" : "source"
},
{
"name" : "patient",
"type" : "Patient",
"mode" : "target"
},
{
"name" : "tgt",
"mode" : "target"
},
{
"name" : "bundle",
"type" : "Bundle",
"mode" : "target"
},
{
"name" : "enc",
"type" : "Encounter",
"mode" : "target"
}
],
"rule" : [
{
"name" : "title",
"source" : [
{
"context" : "src",
"element" : "title",
"variable" : "t"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "title",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "t.dataString"
}
]
}
]
},
{
"name" : "code",
"source" : [
{
"context" : "src",
"element" : "code",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "code",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "nota",
"source" : [
{
"context" : "src"
}
],
"target" : [
{
"context" : "bundle",
"contextType" : "variable",
"element" : "entry",
"variable" : "e9"
},
{
"context" : "e9",
"contextType" : "variable",
"element" : "request",
"variable" : "request",
"transform" : "create",
"parameter" : [
{
"valueString" : "BackboneElement"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "method",
"transform" : "copy",
"parameter" : [
{
"valueString" : "POST"
}
]
},
{
"context" : "e9",
"contextType" : "variable",
"element" : "resource",
"variable" : "allergyIntolerance",
"transform" : "create",
"parameter" : [
{
"valueString" : "AllergyIntolerance"
}
]
},
{
"context" : "allergyIntolerance",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid9",
"transform" : "uuid"
},
{
"context" : "e9",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "https://example/AllergyIntolerance/"
},
{
"valueId" : "uuid9"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "url",
"transform" : "copy",
"parameter" : [
{
"valueString" : "AllergyIntolerance"
}
]
},
{
"context" : "tgt",
"contextType" : "variable",
"element" : "entry",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/AllergyIntolerance/' + %allergyIntolerance.id"
}
]
}
],
"rule" : [
{
"name" : "reference",
"source" : [
{
"context" : "src"
}
],
"target" : [
{
"context" : "allergyIntolerance",
"contextType" : "variable",
"element" : "patient",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Patient/' + %patient.id"
}
]
}
]
},
{
"name" : "allergy",
"source" : [
{
"context" : "src"
}
],
"target" : [
{
"context" : "allergyIntolerance",
"contextType" : "variable",
"element" : "clinicalStatus",
"variable" : "status",
"transform" : "create",
"parameter" : [
{
"valueString" : "CodeableConcept"
}
]
}
],
"rule" : [
{
"name" : "text",
"source" : [
{
"context" : "src"
}
],
"target" : [
{
"context" : "status",
"contextType" : "variable",
"element" : "text",
"transform" : "copy",
"parameter" : [
{
"valueString" : "string"
}
]
}
]
},
{
"name" : "coding",
"source" : [
{
"context" : "src"
}
],
"target" : [
{
"context" : "status",
"contextType" : "variable",
"element" : "coding",
"variable" : "coding",
"transform" : "create",
"parameter" : [
{
"valueString" : "Coding"
}
]
}
],
"rule" : [
{
"name" : "active",
"source" : [
{
"context" : "src"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "code",
"transform" : "copy",
"parameter" : [
{
"valueString" : "active"
}
]
}
]
},
{
"name" : "system",
"source" : [
{
"context" : "src"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "system",
"transform" : "copy",
"parameter" : [
{
"valueString" : "http://terminology.hl7.org/CodeSystem/allergyintolerance-clinical"
}
]
}
]
}
]
}
]
},
{
"name" : "reference",
"source" : [
{
"context" : "src",
"element" : "text",
"variable" : "cdaText"
}
],
"target" : [
{
"context" : "allergyIntolerance",
"contextType" : "variable",
"element" : "note",
"variable" : "note"
}
],
"rule" : [
{
"name" : "reference",
"source" : [
{
"context" : "cdaText",
"variable" : "t"
}
],
"target" : [
{
"context" : "note",
"contextType" : "variable",
"element" : "text",
"transform" : "copy",
"parameter" : [
{
"valueId" : "t"
}
]
}
]
}
]
}
]
}
]
},
{
"name" : "ClinicalDocumentSectionStatoClinicoPaziente",
"typeMode" : "none",
"documentation" : "------------Sezione Stato Clinico del Paziente----------------------------------------------------------------------------------------------------------------------------------------",
"input" : [
{
"name" : "cda",
"type" : "ClinicalDocument",
"mode" : "source"
},
{
"name" : "src",
"type" : "Section",
"mode" : "source"
},
{
"name" : "patient",
"type" : "Patient",
"mode" : "target"
},
{
"name" : "tgt",
"mode" : "target"
},
{
"name" : "bundle",
"type" : "Bundle",
"mode" : "target"
},
{
"name" : "enc",
"type" : "Encounter",
"mode" : "target"
}
],
"rule" : [
{
"name" : "title",
"source" : [
{
"context" : "src",
"element" : "title",
"variable" : "t"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "title",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "t.dataString"
}
]
}
]
},
{
"name" : "code",
"source" : [
{
"context" : "src",
"element" : "code",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "code",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "nota",
"source" : [
{
"context" : "src",
"element" : "text",
"variable" : "cdaText"
}
],
"target" : [
{
"context" : "bundle",
"contextType" : "variable",
"element" : "entry",
"variable" : "e7"
},
{
"context" : "e7",
"contextType" : "variable",
"element" : "request",
"variable" : "request",
"transform" : "create",
"parameter" : [
{
"valueString" : "BackboneElement"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "method",
"transform" : "copy",
"parameter" : [
{
"valueString" : "POST"
}
]
},
{
"context" : "e7",
"contextType" : "variable",
"element" : "resource",
"variable" : "Observation",
"transform" : "create",
"parameter" : [
{
"valueString" : "Observation"
}
]
},
{
"context" : "Observation",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid7",
"transform" : "uuid"
},
{
"context" : "e7",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "https://example/Observation/"
},
{
"valueId" : "uuid7"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "url",
"transform" : "copy",
"parameter" : [
{
"valueString" : "Observation"
}
]
},
{
"context" : "tgt",
"contextType" : "variable",
"element" : "entry",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Observation/' + %Observation.id"
}
]
}
],
"rule" : [
{
"name" : "reference",
"source" : [
{
"context" : "src"
}
],
"target" : [
{
"context" : "Observation",
"contextType" : "variable",
"element" : "subject",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Patient/' + %patient.id"
}
]
}
]
},
{
"name" : "reference",
"source" : [
{
"context" : "src"
}
],
"target" : [
{
"context" : "Observation",
"contextType" : "variable",
"element" : "encounter",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Encounter/' + %enc.id"
}
]
}
]
},
{
"name" : "code",
"source" : [
{
"context" : "src",
"element" : "code",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "Observation",
"contextType" : "variable",
"element" : "code",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "statuscode",
"source" : [
{
"context" : "src",
"condition" : "Observation.statusCode.exists().not()"
}
],
"rule" : [
{
"name" : "status",
"source" : [
{
"context" : "src"
}
],
"target" : [
{
"context" : "Observation",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "final"
}
]
}
]
}
]
},
{
"name" : "reference",
"source" : [
{
"context" : "cdaText"
}
],
"target" : [
{
"context" : "Observation",
"contextType" : "variable",
"element" : "note",
"variable" : "note"
}
],
"rule" : [
{
"name" : "reference",
"source" : [
{
"context" : "cdaText",
"variable" : "t"
}
],
"target" : [
{
"context" : "note",
"contextType" : "variable",
"element" : "text",
"transform" : "copy",
"parameter" : [
{
"valueId" : "t"
}
]
}
]
}
]
}
]
}
]
},
{
"name" : "periodTiming",
"typeMode" : "none",
"input" : [
{
"name" : "effectiveTime",
"type" : "PIVL_TS",
"mode" : "source"
},
{
"name" : "timing",
"type" : "Timing",
"mode" : "target"
}
],
"rule" : [
{
"name" : "repeat",
"source" : [
{
"context" : "effectiveTime"
}
],
"target" : [
{
"context" : "timing",
"contextType" : "variable",
"element" : "repeat",
"variable" : "r"
}
],
"rule" : [
{
"name" : "period",
"source" : [
{
"context" : "effectiveTime",
"element" : "period",
"variable" : "p"
}
],
"target" : [
{
"context" : "r",
"contextType" : "variable",
"element" : "period",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "p.value"
}
]
}
]
},
{
"name" : "period",
"source" : [
{
"context" : "effectiveTime",
"element" : "period",
"variable" : "p"
}
],
"target" : [
{
"context" : "r",
"contextType" : "variable",
"element" : "periodUnit",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "p.unit"
}
]
}
]
}
]
}
]
},
{
"name" : "EmedRTOPQPQRatio",
"typeMode" : "none",
"input" : [
{
"name" : "src",
"type" : "RTO_PQ_PQ",
"mode" : "source"
},
{
"name" : "tgt",
"type" : "Ratio",
"mode" : "target"
}
],
"rule" : [
{
"name" : "numerator",
"source" : [
{
"context" : "src",
"element" : "numerator",
"variable" : "numerator"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "numerator",
"variable" : "targetNumerator"
}
],
"dependent" : [
{
"name" : "EmedPQQuantity",
"variable" : [
"numerator",
"targetNumerator"
]
}
]
},
{
"name" : "denominator",
"source" : [
{
"context" : "src",
"element" : "denominator",
"variable" : "denominator"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "denominator",
"variable" : "targetDenominator"
}
],
"dependent" : [
{
"name" : "EmedPQQuantity",
"variable" : [
"denominator",
"targetDenominator"
]
}
]
}
]
},
{
"name" : "EmedPQQuantity",
"typeMode" : "none",
"input" : [
{
"name" : "src",
"type" : "PQ",
"mode" : "source"
},
{
"name" : "tgt",
"type" : "Quantity",
"mode" : "target"
}
],
"rule" : [
{
"name" : "value",
"source" : [
{
"context" : "src",
"element" : "value",
"variable" : "value"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "value",
"transform" : "copy",
"parameter" : [
{
"valueId" : "value"
}
]
}
]
},
{
"name" : "unit",
"source" : [
{
"context" : "src",
"element" : "unit",
"variable" : "unit"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "code",
"transform" : "copy",
"parameter" : [
{
"valueId" : "unit"
}
]
}
]
},
{
"name" : "unit",
"source" : [
{
"context" : "src",
"element" : "unit",
"variable" : "unit"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "system",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'http://fhir.ch/ig/ch-emed/ValueSet/UnitCode'.resolve().compose.include.where(concept.where(code = %unit)).system"
}
]
}
]
},
{
"name" : "unit",
"source" : [
{
"context" : "src",
"element" : "unit",
"variable" : "unit"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "unit",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'http://fhir.ch/ig/ch-emed/ValueSet/UnitCode'.resolve().compose.include.concept.where(code = %unit).display"
}
]
}
]
}
]
}
]
}