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" : "cda2fhirLdo",
"text" : {
"status" : "generated",
"div" : "<div xmlns=\"http://www.w3.org/1999/xhtml\">\n <pre>map "http://hl7.it/fhir/cda2fhir/StructureMap/cda2fhirLdo" = "cda2fhirLdo"\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.component as component then {\n // discretizzi il primo livello di component\n component.section as srcSection then {\n srcSection.code where (code = '46241-6') -> composition.section as tgtSection then ClinicalDocumentSectionMotivoRicovero(cda, srcSection, patient, tgtSection, bundle, encounter) "motivoRicovero";\n srcSection.code where (code = '47039-3') -> composition.section as tgtSection then ClinicalDocumentSectionInquadramentoClinico(cda, srcSection, patient, tgtSection, bundle, encounter) "inquadramentoClinico";\n srcSection.code where (code = '8648-8') -> composition.section as tgtSection then ClinicalDocumentSectionDecorsoOspedaliero(cda, srcSection, patient, tgtSection, bundle, encounter) "DecorsoOspedaliero";\n srcSection.code where (code = '55109-3') -> composition.section as tgtSection then ClinicalDocumentSectionComplicanze(cda, srcSection, patient, tgtSection, bundle, encounter) "Complicazioni";\n srcSection.code where (code = '11493-4') -> composition.section as tgtSection then ClinicalDocumentSectionRiscontri(cda, srcSection, patient, tgtSection, bundle, encounter) "HospitalDischargeStudiesSummary";\n srcSection.code where (code = '34104-0') -> composition.section as tgtSection then ClinicalDocumentSectionConsulenza(cda, srcSection, patient, tgtSection, bundle, encounter) "HospitalDischargeStudiesSummary";\n srcSection.code where (code = '30954-2') -> composition.section as tgtSection then ClinicalDocumentSectionEsamiEseguitiRicovero(cda, srcSection, patient, tgtSection, bundle, encounter) "EsamiEseguitiDuranteilRicovero";\n srcSection.code where (code = '47519-4') -> composition.section as tgtSection then ClinicalDocumentSectionProcedureEseguiteRicovero(cda, srcSection, patient, tgtSection, bundle, encounter) "HistoryOfProceduresDocument";\n srcSection.code where (code = '48765-2') -> composition.section as tgtSection then ClinicalDocumentSectionAllergie(cda, srcSection, patient, tgtSection, bundle, encounter) "EsamiEseguitiDuranteIlRicovero";\n srcSection.code where (code = '10160-0') -> composition.section as tgtSection then ClinicalDocumentSectionTerapiaFarmacologicaDuranteRicovero(cda, srcSection, patient, tgtSection, bundle, encounter) "TerapiaFarmacologicaAllaDimissione";\n srcSection.code where (code = '11535-2') -> composition.section as tgtSection then ClinicalDocumentSectionDiagnosiDimissione(cda, srcSection, patient, tgtSection, bundle, encounter) "DiagnosiDiDimissione";\n srcSection.code where (code = '18776-5') -> composition.section as tgtSection then ClinicalDocumentSectionIstruzioniFollowUp(cda, srcSection, patient, tgtSection, bundle, encounter) "DiagnosiDiDimissione";\n srcSection.code where (code = '10183-2') -> composition.section as tgtSection then ClinicalDocumentSectionTerapiaDimissione(cda, srcSection, patient, tgtSection, bundle, encounter) "TerapiaFarmacologicaAllaDimissione";\n };\n };\n } "body";\n };\n}\n\n// -------------------------------------------------------------------------------------------------------------------\ngroup ClinicalDocumentSectionMotivoRicovero(source cda : ClinicalDocument, source src : Section, target patient : Patient, target tgt, target bundle : Bundle, target enc : Encounter) {\n src.title as t -> tgt.title = (t.dataString);\n src.code -> tgt.code;\n src where src.entry.exists() then {\n src.text as cdaText -> tgt.text as fhirText then {\n cdaText -> fhirText.status = 'generated' "narrativeStatus";\n cdaText as t -> fhirText.div = t "narrativeText";\n } "cdaText";\n } "cText";\n src.entry as entry1 -> bundle.entry as e1, e1.request = create('BackboneElement') as request, request.method = 'POST', e1.resource = create('Observation') as observation, observation.id = uuid() as uuid1, e1.fullUrl = append('https://example/Observation/', uuid1), request.url = 'Observation', tgt.entry = create('Reference') as reference, reference.reference = ('https://example/Observation/' + %observation.id) then {\n entry1.observation as obs then Observation(obs, patient, enc, observation, bundle) "act";\n };\n src where src.entry.exists().not() then {\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 } "cdaText";\n } "where";\n}\n\ngroup ClinicalDocumentSectionInquadramentoClinico(source cda : ClinicalDocument, source src : Section, target patient : Patient, target tgt, target bundle : Bundle, target enc : Encounter) {\n src.title as t -> tgt.title = (t.dataString);\n src.code -> tgt.code;\n src.text as cdaText -> bundle.entry as e1, e1.request = create('BackboneElement') as request, request.method = 'POST', e1.resource = create('Observation') as observation, observation.id = uuid() as uuid1, e1.fullUrl = append('https://example/Observation/', uuid1), request.url = 'Observation', tgt.entry = create('Reference') as reference, reference.reference = ('https://example/Observation/' + %observation.id), tgt.text as fhirText then {\n cdaText -> observation.subject = create('Reference') as reference, reference.reference = ('https://example/Patient/' + %patient.id) "reference";\n cdaText -> observation.encounter = create('Reference') as reference, reference.reference = ('https://example/Encounter/' + %enc.id) "reference";\n cdaText -> fhirText.status = 'generated' "narrativeStatus";\n cdaText as t -> fhirText.div = t "narrativeText";\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 } "cdaText";\n src.component as component then {\n component.section as section2 then {\n // ANAMNESI\n section2 -> tgt.section as sec2 then {\n section2.code where (code = '11329-0') -> sec2.code;\n section2.title as t -> sec2.title = (t.dataString);\n // section2.code -> sec2.code;\n src where src.entry.exists() then {\n section2.text as cdaText -> sec2.text as fhirText then {\n cdaText -> fhirText.status = 'generated' "narrativeStatus";\n cdaText as t -> fhirText.div = t "narrativeText";\n } "cdaText";\n } "exist";\n src where src.entry.exists().not() then {\n section2.text as cdaText -> bundle.entry as e1, e1.request = create('BackboneElement') as request, request.method = 'POST', e1.resource = create('Observation') as condition, condition.id = uuid() as uuid1, e1.fullUrl = append('https://example/Observation/', uuid1), request.url = 'Observation', sec2.entry = create('Reference') as reference, reference.reference = ('https://example/Observation/' + %condition.id) then {\n section2.code -> condition.code;\n src where condition.statusCode.exists().not() then {\n src -> condition.status = 'final' "status";\n } "statuscode";\n cdaText -> condition.note as note then {\n cdaText -> condition.subject = create('Reference') as reference, reference.reference = ('https://example/Patient/' + %patient.id) "reference";\n cdaText -> condition.encounter = create('Reference') as reference, reference.reference = ('https://example/Encounter/' + %enc.id) "reference";\n cdaText as t -> note.text = t "reference";\n } "reference";\n } "cdaText";\n } "where";\n section2.entry as entry1 then {\n entry1.observation as obs then {\n // EntryRelationship per il Problem\n obs.code where (code = '75326-9') then {\n obs -> bundle.entry as e1, e1.request = create('BackboneElement') as request, request.method = 'POST', e1.resource = create('Condition') as condition, condition.id = uuid() as uuid1, e1.fullUrl = append('https://example/Condition/', uuid1), request.url = 'Condition', sec2.entry = create('Reference') as reference, reference.reference = ('https://example/Condition/' + %condition.id) then {\n obs.code -> condition.category;\n obs -> condition.subject = create('Reference') as reference, reference.reference = ('https://example/Patient/' + %patient.id) "reference";\n obs -> condition.encounter = create('Reference') as reference, reference.reference = ('https://example/Encounter/' + %enc.id) "reference";\n obs.statusCode as status where (code = 'completed') -> condition.verificationStatus as status2 then {\n status -> status2.coding as status3 then {\n status -> status3.code = 'confirmed' "finald";\n status -> status3.system = 'http://terminology.hl7.org/CodeSystem/condition-ver-status' "system";\n } "st3";\n } "status";\n obs.effectiveTime as effective1 then {\n effective1 where effective1.low.exists() or effective1.high.exists() then {\n effective1 -> condition.onset = create('Period') as periodonset then IVLTSPeriod(effective1, periodonset) "onsetperiod";\n } "ef";\n } "effectivetime1";\n obs.value : CD as val then {\n val -> condition.code = create('CodeableConcept') as ce then {\n val.originalText -> ce.text;\n val -> ce.coding as coding then {\n val.code as code -> coding.code = cast(code, 'string');\n val.codeSystem as system -> coding.system = translate(system, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri');\n val.displayName as display -> coding.display = cast(display, 'string');\n } "coding";\n } "Ce";\n } "Value";\n obs.entryRelationship as entriRel then {\n entriRel -> condition.evidence = create('BackboneElement') as evidence then {\n entriRel.observation as observation2 then {\n observation2.code as code then {\n code.code where (code.code = '89261-2') then {\n obs -> bundle.entry as e1, e1.request = create('BackboneElement') as request, request.method = 'POST', e1.resource = create('Observation') as observation, observation.id = uuid() as uuid1, e1.fullUrl = append('https://example/Observation/', uuid1), request.url = 'Observation' then {\n entriRel -> evidence.detail = create('Reference') as reference, reference.reference = ('https://example/Observation/' + %observation.id) "ref";\n observation2.code -> observation.code;\n observation2 where observation.statusCode.exists().not() then {\n observation2 -> observation.status = 'final' "status";\n } "statuscode";\n observation2.text as text -> observation.note = create('Annotation') as note then {\n text.reference as ref -> note.text = (ref.value) "val";\n } "Annontation";\n obs -> observation.subject = create('Reference') as reference, reference.reference = ('https://example/Patient/' + %patient.id) "reference";\n obs -> observation.encounter = create('Reference') as reference, reference.reference = ('https://example/Encounter/' + %enc.id) "reference";\n observation2.statusCode as statusc where (code = 'completed') -> ob.status = 'final';\n observation2.statusCode as statusc where (code = 'active') -> ob.status = 'registered';\n observation2.statusCode as statusc where (code = 'aborted') -> ob.status = 'cancelled';\n observation2.statusCode as statusc where (code = 'suspended') -> ob.status = 'partial';\n observation2.value : INT as int -> ob.value = (int.value);\n observation2.value : BL as boolean -> ob.value = (boolean.value) "boolean";\n observation2.value : CD as val then {\n val -> ob.value = create('CodeableConcept') as ce then {\n val.originalText as originalText then {\n originalText.reference as reference -> ce.text = reference;\n } "originltext";\n val -> ce.coding as coding then {\n val.code as code -> coding.code = cast(code, 'string');\n val.codeSystem as system -> coding.system = translate(system, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri');\n val.displayName as display -> coding.display = cast(display, 'string');\n val.codeSystemVersion as version -> coding.version = cast(version, 'string');\n } "code";\n val.translation as translation -> ce.coding as coding then {\n translation.code as code -> coding.code = cast(code, 'string');\n translation.codeSystem as system -> coding.system = translate(system, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri');\n translation.displayName as display -> coding.display = cast(display, 'string');\n translation.codeSystemVersion as version -> coding.version = cast(version, 'string');\n translation.qualifier as qualifier then {\n qualifier.value as value -> ce.coding as coding then {\n value.code as code -> coding.code = cast(code, 'string');\n value.codeSystem as system -> coding.system = translate(system, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri');\n value.displayName as display -> coding.display = cast(display, 'string');\n value.codeSystemVersion as version -> coding.version = cast(version, 'string');\n };\n };\n };\n } "coding";\n } "val";\n observation2.value : PQ as val then {\n val -> ob.value = create('Quantity') as quantity then {\n val.value as value -> quantity.value = value;\n val.unit as unit -> quantity.unit = unit;\n } "quantity";\n } "valueQuantity";\n observation2.value : ST as value -> ob.value = create('string'), ob.value = (value.dataString);\n observation2.value : CE as val then {\n val -> observation.value = create('CodeableConcept') as ce then {\n val.originalText -> ce.text;\n val -> ce.coding as coding then {\n val.code as code -> coding.code = cast(code, 'string');\n val.codeSystem as system -> coding.system = translate(system, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri');\n val.displayName as display -> coding.display = cast(display, 'string');\n } "coding";\n } "Ce";\n } "Value";\n } "obser";\n } "whereDecorsoClinico";\n };\n } "Observation2";\n } "evidence";\n } "EntryRelationship1";\n obs.entryRelationship as entriRel then {\n entriRel.observation as observation2 then {\n observation2.code as code then {\n code.code where (code.code = '33999-4') then {\n observation2 -> condition.clinicalStatus = create('CodeableConcept') as status then {\n observation2.text as text then {\n text.reference as refstat -> status.text = (refstat.value) "statref";\n } "textstat";\n observation2 -> status.coding = create('Coding') as coding then {\n observation2.value as value then {\n value.code where (value.code = 'LA16666-2') -> coding.code = 'active' "active";\n value.code where (value.code = 'LA18632-2') -> coding.code = 'inactive' "inactive";\n value.codeSystem as system -> coding.system = 'http://terminology.hl7.org/CodeSystem/condition-clinical' "system";\n value.displayName as display -> coding.display = cast(display, 'string');\n } "value1";\n } "coding";\n } "code";\n } "whereDecorsoClinico";\n } "codestatus";\n } "observationstatus";\n } "entryrelationshipstatus";\n } "whereEntryPatologicaProssima";\n } "observationcondition";\n } "entry";\n } "subsection1";\n // ESAME PBIETTIVO\n section2.code where (code = '29545-1') then ClinicalDocumentSottoSectionOBS(section2, sec2, bundle, enc, patient) "esameObiettivo";\n // TETAPIA FARMACOLOGICA\n section2.code where (code = '42346-7') then ClinicalDocumentSottoSectionMS(section2, sec2, bundle, patient, enc) "TerapiaFarmacologicaAllIngresso";\n } "sec2fhir";\n } "componentSec";\n };\n}\n\ngroup ClinicalDocumentSectionDecorsoOspedaliero(source cda : ClinicalDocument, source src : Section, target patient : Patient, target tgt, target bundle : Bundle, target enc : Encounter) {\n src.title as t -> tgt.title = (t.dataString);\n src.code -> tgt.code;\n src.text as cdaText -> bundle.entry as e1, e1.request = create('BackboneElement') as request, request.method = 'POST', e1.resource = create('Observation') as observation, observation.id = uuid() as uuid1, e1.fullUrl = append('https://example/Observation/', uuid1), request.url = 'Observation', tgt.entry = create('Reference') as reference, reference.reference = ('https://example/Observation/' + %observation.id), tgt.text as fhirText then {\n cdaText -> fhirText.status = 'generated' "narrativeStatus";\n cdaText as t -> fhirText.div = t "narrativeText";\n src.code -> observation.code;\n src where observation.statusCode.exists().not() then {\n src -> observation.status = 'final' "status";\n } "statuscode";\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 cdaText -> observation.note as note then {\n cdaText as t -> note.text = t "reference";\n } "reference";\n } "cdaText";\n src.component as component then {\n component.section as section2 then {\n src then ClinicalDocumentSottoSectionOBS(section2, tgt, bundle, enc, patient) "Decorso";\n } "1";\n } "2";\n}\n\ngroup ClinicalDocumentSectionComplicanze(source cda : ClinicalDocument, source src : Section, target patient : Patient, target tgt, target bundle : Bundle, target enc : Encounter) {\n src.title as t -> tgt.title = (t.dataString);\n src.code -> tgt.code;\n src where src.entry.exists() then {\n src.text as cdaText -> tgt.text as fhirText then {\n cdaText -> fhirText.status = 'generated' "narrativeStatus";\n cdaText as t -> fhirText.div = t "narrativeText";\n } "cdaText";\n } "exist";\n src where src.entry.exists().not() then {\n src.text as cdaText -> bundle.entry as e1, e1.request = create('BackboneElement') as request, request.method = 'POST', e1.resource = create('Observation') as observation, observation.id = uuid() as uuid1, e1.fullUrl = append('https://example/Observation/', uuid1), request.url = 'Observation', tgt.entry = create('Reference') as reference, reference.reference = ('https://example/Observation/' + %observation.id) then {\n src -> 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 } "cdaText";\n } "where";\n src.entry as entry1 -> bundle.entry as e1, e1.request = create('BackboneElement') as request, request.method = 'POST', e1.resource = create('Observation') as observation, observation.id = uuid() as uuid1, e1.fullUrl = append('https://example/Observation/', uuid1), request.url = 'Observation', tgt.entry = create('Reference') as reference, reference.reference = ('https://example/Observation/' + %observation.id) then {\n entry1.observation as obs then Observation(obs, patient, enc, observation, bundle) "act";\n };\n}\n\ngroup ClinicalDocumentSectionRiscontri(source cda : ClinicalDocument, source src : Section, target patient : Patient, target tgt, target bundle : Bundle, target enc : Encounter) {\n src.title as t -> tgt.title = (t.dataString);\n src.code -> tgt.code;\n src.text as cdaText -> bundle.entry as e1, e1.request = create('BackboneElement') as request, request.method = 'POST', e1.resource = create('Observation') as observation, observation.id = uuid() as uuid1, e1.fullUrl = append('https://example/Observation/', uuid1), request.url = 'Observation', tgt.entry = create('Reference') as reference, reference.reference = ('https://example/Observation/' + %observation.id), tgt.text as fhirText then {\n cdaText -> fhirText.status = 'generated' "narrativeStatus";\n cdaText as t -> fhirText.div = t "narrativeText";\n src.code -> observation.code;\n src where observation.statusCode.exists().not() then {\n src -> observation.status = 'final' "status";\n } "statuscode";\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 cdaText -> observation.note as note then {\n cdaText as t -> note.text = t "reference";\n } "reference";\n } "cdaText";\n src.component as component then {\n component.section as section2 then {\n src then ClinicalDocumentSottoSectionOBS(section2, tgt, bundle, enc, patient) "Decorso";\n } "1";\n } "2";\n}\n\ngroup ClinicalDocumentSectionConsulenza(source cda : ClinicalDocument, source src : Section, target patient : Patient, target tgt, target bundle : Bundle, target enc : Encounter) {\n src.title as t -> tgt.title = (t.dataString);\n src.code -> tgt.code;\n src where src.entry.exists() then {\n src.text as cdaText -> tgt.text as fhirText then {\n cdaText -> fhirText.status = 'generated' "narrativeStatus";\n cdaText as t -> fhirText.div = t "narrativeText";\n } "cdaText";\n } "exist";\n src where src.entry.exists().not() then {\n src.text as cdaText -> bundle.entry as e1, e1.request = create('BackboneElement') as request, request.method = 'POST', e1.resource = create('Observation') as observation, observation.id = uuid() as uuid1, e1.fullUrl = append('https://example/Observation/', uuid1), request.url = 'Observation', tgt.entry = create('Reference') as reference, reference.reference = ('https://example/Observation/' + %observation.id) then {\n src -> 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 } "cdaText";\n } "where";\n src.entry as entry1 -> bundle.entry as e1, e1.request = create('BackboneElement') as request, request.method = 'POST', e1.resource = create('Observation') as observation, observation.id = uuid() as uuid1, e1.fullUrl = append('https://example/Observation/', uuid1), request.url = 'Observation', tgt.entry = create('Reference') as reference, reference.reference = ('https://example/Observation/' + %observation.id) then {\n entry1.observation as obs then ObservationConsulenza(obs, patient, enc, observation, bundle) "act";\n };\n}\n\ngroup ClinicalDocumentSectionEsamiEseguitiRicovero(source cda : ClinicalDocument, source src : Section, target patient : Patient, target tgt, target bundle : Bundle, target enc : Encounter) {\n src.title as t -> tgt.title = (t.dataString);\n src.code -> tgt.code;\n src where src.entry.exists() then {\n src.text as cdaText -> tgt.text as fhirText then {\n cdaText -> fhirText.status = 'generated' "narrativeStatus";\n cdaText as t -> fhirText.div = t "narrativeText";\n } "cdaText";\n } "exists";\n src where src.entry.exists().not() then {\n src.text as cdaText -> bundle.entry as e1, e1.request = create('BackboneElement') as request, request.method = 'POST', e1.resource = create('Observation') as observation, observation.id = uuid() as uuid1, e1.fullUrl = append('https://example/Observation/', uuid1), request.url = 'Observation', tgt.entry = create('Reference') as reference, reference.reference = ('https://example/Observation/' + %observation.id) then {\n src -> 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 } "cdaText";\n } "where";\n src.entry as entry1 -> bundle.entry as e1, e1.request = create('BackboneElement') as request, request.method = 'POST', e1.resource = create('Observation') as observation, observation.id = uuid() as uuid1, e1.fullUrl = append('https://example/Observation/', uuid1), request.url = 'Observation', tgt.entry = create('Reference') as reference, reference.reference = ('https://example/Observation/' + %observation.id) then {\n entry1.observation as obs then ObservationEsamiDuranteRicovero(obs, patient, enc, observation, bundle) "act";\n };\n}\n\ngroup ClinicalDocumentSectionProcedureEseguiteRicovero(source cda : ClinicalDocument, source src : Section, target patient : Patient, target tgt, target bundle : Bundle, target enc : Encounter) {\n src.title as t -> tgt.title = (t.dataString);\n src.code -> tgt.code;\n src where src.entry.exists() then {\n src.text as cdaText -> tgt.text as fhirText then {\n cdaText -> fhirText.status = 'generated' "narrativeStatus";\n cdaText as t -> fhirText.div = t "narrativeText";\n } "cdaText";\n } "exists";\n src where src.entry.exists().not() then {\n src.text as cdaText -> bundle.entry as e1, e1.request = create('BackboneElement') as request, request.method = 'POST', e1.resource = create('Procedure') as procedure, procedure.id = uuid() as uuid1, e1.fullUrl = append('https://example/Procedure/', uuid1), request.url = 'Procedure', tgt.entry = create('Reference') as reference, reference.reference = ('https://example/Procedure/' + %procedure.id) then {\n src -> procedure.subject = create('Reference') as reference, reference.reference = ('https://example/Patient/' + %patient.id) "reference";\n src -> procedure.encounter = create('Reference') as reference, reference.reference = ('https://example/Encounter/' + %enc.id) "reference";\n src -> procedure.status = 'unknown' "statuscode";\n cdaText -> procedure.note as note then {\n cdaText as t -> note.text = t "reference";\n } "reference";\n } "cdaText";\n } "where";\n src.entry as entry1 -> bundle.entry as e1, e1.request = create('BackboneElement') as request, request.method = 'POST', e1.resource = create('Procedure') as procedure, procedure.id = uuid() as uuid1, e1.fullUrl = append('https://example/Procedure/', uuid1), request.url = 'Procedure', tgt.entry = create('Reference') as reference, reference.reference = ('https://example/Procedure/' + %procedure.id) then {\n src -> procedure.subject = create('Reference') as reference, reference.reference = ('https://example/Patient/' + %patient.id) "reference";\n src -> procedure.encounter = create('Reference') as reference, reference.reference = ('https://example/Encounter/' + %enc.id) "reference";\n entry1.procedure as proceduresrc then {\n proceduresrc.code -> procedure.code;\n proceduresrc.text as txt -> procedure.note as note then {\n txt.reference as ref -> note.text = (ref.value);\n };\n proceduresrc where proc.statusCode.exists().not() then {\n proceduresrc -> procedure.status = 'unknown' "statuscode";\n } "status";\n proceduresrc.statusCode as statusc where (code = 'completed') -> procedure.status = 'completed';\n proceduresrc.statusCode as statusc where (code = 'active') -> procedure.status = 'in-progress';\n proceduresrc.statusCode as statusc where (code = 'aborted') -> procedure.status = 'stopped';\n proceduresrc.statusCode as statusc where (code = 'suspended') -> procedure.status = 'on-hold';\n proceduresrc.statusCode as statusc where (code = 'cancelled') -> procedure.status = 'not-done';\n proceduresrc.statusCode as statusc where (code = 'held') -> procedure.status = 'on-hold';\n proceduresrc.statusCode as statusc where (code = 'new') -> procedure.status = 'preparation';\n proceduresrc.statusCode as statusc where (code = 'obsolete') -> procedure.status = 'entered-in-error';\n proceduresrc.statusCode as statusc where (code = 'nullified') -> procedure.status = 'unknown';\n proceduresrc.effectiveTime as efft -> procedure.performed = create('Period') as period then IVLTSPeriod(efft, period);\n proceduresrc.entryRelationship as entriRel -> bundle.entry as e1, e1.request = create('BackboneElement') as request, request.method = 'POST', e1.resource = create('Observation') as observation, observation.id = uuid() as uuid1, e1.fullUrl = append('https://example/Observation/', uuid1), request.url = 'Observation', procedure.reasonReference = create('Reference') as reference, reference.reference = ('https://example/Observation/' + %observation.id) then {\n entriRel -> observation.subject = create('Reference') as reference, reference.reference = ('https://example/Patient/' + %patient.id) "reference";\n entriRel -> observation.encounter = create('Reference') as reference, reference.reference = ('https://example/Encounter/' + %enc.id) "reference";\n entriRel.observation as obs then {\n obs.code -> observation.code;\n obs where observation.statusCode.exists().not() then {\n obs -> observation.status = 'final' "status";\n } "statuscode";\n } "ObservationValue";\n } "Observation";\n } "Procedure";\n } "Entry";\n}\n\ngroup ClinicalDocumentSectionAllergie(source cda : ClinicalDocument, source src : Section, target patient : Patient, target tgt, target bundle : Bundle, target enc : Encounter) {\n src.title as t -> tgt.title = (t.dataString);\n src.code -> tgt.code;\n src where src.entry.exists() then {\n src.text as cdaText -> tgt.text as fhirText then {\n cdaText -> fhirText.status = 'generated' "narrativeStatus";\n cdaText as t -> fhirText.div = t "narrativeText";\n } "cdaText";\n } "exists";\n src where src.entry.exists().not() then {\n src.text as cdaText -> bundle.entry as e1, e1.request = create('BackboneElement') as request, request.method = 'POST', e1.resource = create('AllergyIntolerance') as allergy, allergy.id = uuid() as uuid1, e1.fullUrl = append('https://example/AllergyIntolerance/', uuid1), request.url = 'AllergyIntolerance', tgt.entry = create('Reference') as reference, reference.reference = ('https://example/AllergyIntolerance/' + %allergy.id) then {\n src -> allergy.patient = create('Reference') as reference, reference.reference = ('https://example/Patient/' + %patient.id) "reference";\n src -> allergy.encounter = create('Reference') as reference, reference.reference = ('https://example/Encounter/' + %enc.id) "reference";\n src -> allergy.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.code -> allergy.code;\n cdaText -> allergy.note as note then {\n cdaText as t -> note.text = t "reference";\n } "reference";\n } "cdaText";\n } "where";\n src.entry as entry1 -> bundle.entry as e1, e1.request = create('BackboneElement') as request, request.method = 'POST', e1.resource = create('AllergyIntolerance') as allergy, allergy.id = uuid() as uuid1, e1.fullUrl = append('https://example/AllergyIntolerance/', uuid1), request.url = 'AllergyIntolerance', tgt.entry = create('Reference') as reference, reference.reference = ('https://example/AllergyIntolerance/' + %allergy.id) then {\n src -> allergy.patient = create('Reference') as reference, reference.reference = ('https://example/Patient/' + %patient.id) "reference";\n src -> allergy.encounter = create('Reference') as reference, reference.reference = ('https://example/Encounter/' + %enc.id) "reference";\n entry1.act as actallint then {\n actallint.effectiveTime as eff -> allergy.onset = create('Period') as per then IVLTSPeriod(eff, per);\n actallint.entryRelationship as entryact then {\n entryact.observation as entryobs then {\n entryobs.value as code then {\n code.code as code1 -> allergy.type = translate(code1, '#AllergyTypeMap', 'code') "type";\n code.code as code2 -> allergy.category = translate(code2, '#AllergyCategoryMap', 'code') "category";\n } "code";\n entryobs.participant as partic then {\n partic.participantRole as pratRole then {\n pratRole.playingEntity as pratent then {\n pratent -> allergy.reaction = create('BackboneElement') as reaction then {\n pratent.code -> reaction.substance "subs";\n entryobs.entryRelationship as entryobs1 where (typeCode = 'MFST') then {\n entryobs1.observation as entobs then {\n entobs.effectiveTime as eff then {\n eff.low as l -> reaction.onset = create('dateTime') as start then TSDateTime(l, start) "val";\n } "eff";\n entobs.value -> reaction.manifestation "manifest";\n } "observ";\n } "entry";\n } "cod";\n } "react";\n } "pratentit";\n } "PratRole";\n entryobs.entryRelationship as entryobs2 then {\n entryobs2.observation as entobs then {\n entobs.code as code where (code = 'SEV') then {\n entobs.value as value then {\n value.code where (value.code = 'M') -> allergy.criticality = 'unable-to-assess' "active";\n value.code where (value.code = 'L') -> allergy.criticality = 'low' "active";\n value.code where (value.code = 'H') -> allergy.criticality = 'high' "active";\n } "entobs";\n } "sev";\n } "severity";\n } "observ";\n entryobs.entryRelationship as entryobs3 then {\n entryobs3.observation as entobs then {\n entobs.code as code where (code = '33999-4') then {\n entobs -> allergy.clinicalStatus = create('CodeableConcept') as status then {\n entobs -> status.coding = create('Coding') as coding then {\n entobs.value as value then {\n value.code where (value.code = 'LA16666-2') -> coding.code = 'active' "active";\n value.code where (value.code = 'LA18632-2') -> coding.code = 'inactive' "active";\n value.codeSystem as system -> coding.system = 'http://terminology.hl7.org/CodeSystem/allergyintolerance-clinical' "system";\n value.displayName as display -> coding.display = cast(display, 'string');\n } "value1";\n } "coding";\n } "clinicalStatus";\n } "stat";\n } "obobs3serv";\n } "entry3";\n entryobs.entryRelationship as entryobs4 then {\n entryobs4.act as entact then {\n entact.text as actext then {\n actext.reference as reftxt -> allergy.note = create('BackboneElement') as note then {\n reftxt as ref -> note.text = (ref.value) "notxt";\n } "notetxt";\n } "txtact";\n } "obobs4serv";\n } "entry4";\n } "partic";\n };\n };\n } "allergy";\n}\n\ngroup ClinicalDocumentSectionDiagnosiDimissione(source cda : ClinicalDocument, source src : Section, target patient : Patient, target tgt, target bundle : Bundle, target enc : Encounter) {\n src.title as t -> tgt.title = (t.dataString);\n src.code -> tgt.code;\n src where src.entry.exists() then {\n src.text as cdaText -> tgt.text as fhirText then {\n cdaText -> fhirText.status = 'generated' "narrativeStatus";\n cdaText as t -> fhirText.div = t "narrativeText";\n } "cdaText";\n } "exists";\n src where src.entry.exists().not() then {\n src.text as cdaText -> bundle.entry as e1, e1.request = create('BackboneElement') as request, request.method = 'POST', e1.resource = create('Observation') as observation, observation.id = uuid() as uuid1, e1.fullUrl = append('https://example/Observation/', uuid1), request.url = 'Observation', tgt.entry = create('Reference') as reference, reference.reference = ('https://example/Observation/' + %observation.id) then {\n src -> 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 } "cdaText";\n } "where";\n src.entry as entry1 -> bundle.entry as e1, e1.request = create('BackboneElement') as request, request.method = 'POST', e1.resource = create('Observation') as observation, observation.id = uuid() as uuid1, e1.fullUrl = append('https://example/Observation/', uuid1), request.url = 'Observation', tgt.entry = create('Reference') as reference, reference.reference = ('https://example/Observation/' + %observation.id) then {\n entry1.observation as obs then Observation(obs, patient, enc, observation, bundle) "act";\n };\n}\n\ngroup ClinicalDocumentSectionIstruzioniFollowUp(source cda : ClinicalDocument, source src : Section, target patient : Patient, target tgt, target bundle : Bundle, target enc : Encounter) {\n src.title as t -> tgt.title = (t.dataString);\n src.code -> tgt.code;\n src.text as cdaText -> tgt.text as fhirText then {\n cdaText -> fhirText.status = 'generated' "narrativeStatus";\n cdaText as t -> fhirText.div = t "narrativeText";\n } "cdaText";\n src.text as cdaText -> bundle.entry as e1, e1.request = create('BackboneElement') as request, request.method = 'POST', e1.resource = create('CarePlan') as carePlan, carePlan.id = uuid() as uuid1, e1.fullUrl = append('https://example/CarePlan/', uuid1), request.url = 'CarePlan', tgt.entry = create('Reference') as reference, reference.reference = ('https://example/CarePlan/' + %carePlan.id) then {\n cdaText -> carePlan.note as note then {\n cdaText as t -> note.text = t "reference";\n } "reference";\n src -> carePlan.subject = create('Reference') as reference, reference.reference = ('https://example/Patient/' + %patient.id) "reference";\n src -> carePlan.encounter = create('Reference') as reference, reference.reference = ('https://example/Encounter/' + %enc.id) "reference";\n src -> carePlan.status = 'active' "status";\n src -> carePlan.intent = 'order' "intent";\n } "entry";\n}\n\ngroup ClinicalDocumentSectionTerapiaFarmacologicaDuranteRicovero(source cda : ClinicalDocument, source src : Section, target patient : Patient, target tgt, target bundle : Bundle, target enc : Encounter) {\n src.title as t -> tgt.title = (t.dataString);\n src.code -> tgt.code;\n src where src.entry.exists() then {\n src.text as cdaText -> tgt.text as fhirText then {\n cdaText -> fhirText.status = 'generated' "narrativeStatus";\n cdaText as t -> fhirText.div = t "narrativeText";\n } "cdaText";\n } "exists";\n src where src.entry.exists().not() then {\n src.text as cdaText -> bundle.entry as e1, e1.request = create('BackboneElement') as request, request.method = 'POST', e1.resource = create('MedicationAdministration') as medicationAdm, medicationAdm.id = uuid() as uuid1, e1.fullUrl = append('https://example/MedicationAdministration/', uuid1), request.url = 'MedicationAdministration', tgt.entry = create('Reference') as reference, reference.reference = ('https://example/MedicationAdministration/' + %medicationAdm.id) then {\n cdaText -> medicationAdm.subject = create('Reference') as reference, reference.reference = ('https://example/Patient/' + %patient.id) "reference";\n cdaText -> medicationAdm.context = create('Reference') as reference, reference.reference = ('https://example/Encounter/' + %enc.id) "reference";\n cdaText -> medicationAdm.medication = create('CodeableConcept') as codecon then {\n cdaText -> codecon.text = 'string' "text";\n } "code";\n src -> medicationAdm.effective = create('Period') as period then {\n src -> period.start = (start.now()) "low";\n src -> period.end = (end.now()) "high";\n } "Period";\n src where sub.statusCode.exists().not() then {\n src -> medicationAdm.status = 'completed' "status";\n } "statuscode";\n cdaText -> medicationAdm.note as note then {\n cdaText as t -> note.text = t "reference";\n } "reference";\n } "cdaText";\n } "where";\n src.entry as entry1 -> bundle.entry as e1, e1.request = create('BackboneElement') as request, request.method = 'POST', e1.resource = create('MedicationAdministration') as medicationAdm, medicationAdm.id = uuid() as uuid1, e1.fullUrl = append('https://example/MedicationAdministration/', uuid1), request.url = 'MedicationAdministration', tgt.entry = create('Reference') as reference, reference.reference = ('https://example/MedicationAdministration/' + %medicationAdm.id) then {\n entry1 -> medicationAdm.subject = create('Reference') as reference, reference.reference = ('https://example/Patient/' + %patient.id) "reference";\n entry1 -> medicationAdm.context = create('Reference') as reference, reference.reference = ('https://example/Encounter/' + %enc.id) "reference";\n entry1.substanceAdministration as sa then {\n sa.text as tx -> medicationAdm.note as note then {\n sa.performer as performer -> bundle.entry as e1, e1.request = create('BackboneElement') as request, request.method = 'PUT', e1.resource = create('Practitioner') as practitioner then {\n performer.time as ti -> note.time = (ti.value);\n performer.assignedEntity as assEnty then {\n assEnty -> practitioner.meta as meta then {\n assEnty -> meta.tag = create('Coding') as coding then {\n assEnty -> coding.system = 'http://algoritmodiscoring' "system";\n assEnty -> coding.code = 'ClinicalDocument/body/TerapiaFarmacologicaRicovero/performer' "code";\n } "coding";\n } "meta";\n assEnty.id as id -> practitioner.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 id.root as r then {\n id.extension as ext -> practitioner.id = (r + '-' + ext) as uuid2, e1.fullUrl = append('https://example/Practitioner/', uuid2), request.url = 'Practitioner', medicationAdm.performer as perf, perf.actor = create('Reference') as reference, reference.reference = ('https://example/Practitioner/' + %practitioner.id) "aut";\n } "r";\n } "identifier";\n assEnty.id as id where (root = '2.16.840.1.113883.2.9.4.3.2') then {\n id.extension as ext -> request.url = append('Practitioner?identifier=', ext) "UUID";\n } "2";\n assEnty.id as id where (root != '2.16.840.1.113883.2.9.4.3.2') then {\n id.extension as ext -> request.url = append('Practitioner?identifier=', ext) "UUID";\n } "diverso";\n assEnty.assignedPerson as assi then {\n assi.name -> practitioner.name;\n } "assi";\n } "assEntity";\n } "perf";\n tx.reference as ref -> note.text = (ref.value);\n } "tx";\n sa.statusCode as st -> medicationAdm.status = (st.code);\n sa.effectiveTime as eff -> medicationAdm.effective = create('Period') as period then IVLTSPeriod(eff, period) "period";\n sa -> medicationAdm.dosage as dos then {\n sa.routeCode -> dos.route;\n } "dos";\n sa -> medicationAdm.dosage as dos then {\n sa.approachSiteCode -> dos.site;\n } "dos";\n sa.doseQuantity as doseQuant -> bundle.entry as e1, e1.request = create('BackboneElement') as request, request.method = 'POST', e1.resource = create('MedicationRequest') as medicationRq, medicationRq.id = uuid() as uuid1, e1.fullUrl = append('https://example/MedicationRequest/', uuid1), request.url = 'MedicationRequest', medicationAdm.request = create('Reference') as reference, reference.reference = ('https://example/MedicationRequest/' + %medicationRq.id) then {\n doseQuant -> medicationRq.dosageInstruction = create('Dosage') as dosageInstruction then {\n doseQuant.originalText as ot then {\n ot.reference -> dosageInstruction.text;\n } "ot";\n doseQuant -> dosageInstruction.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 } "Dosage";\n sa -> medicationRq.subject = create('Reference') as reference, reference.reference = ('https://example/Patient/' + %patient.id) "reference";\n sa -> medicationRq.encounter = create('Reference') as reference, reference.reference = ('https://example/Encounter/' + %enc.id) "reference";\n sa -> medicationRq.status = 'active' "status";\n sa -> medicationRq.intent = 'order' "intent";\n sa.rateQuantity as rateQuantity -> medicationRq.dosageInstruction = create('Dosage') as dosageInstruction1 then {\n rateQuantity.originalText as ot then {\n ot.reference -> dosageInstruction1.text;\n } "ot";\n rateQuantity -> dosageInstruction1.doseAndRate as dosageRate then {\n rateQuantity -> dosageRate.rate = create('Range') as d then {\n rateQuantity -> d.low = create('SimpleQuantity') as l then {\n rateQuantity.low as lo -> l.value = (lo.value);\n rateQuantity.low as lo -> l.unit = (lo.unit);\n } "low";\n rateQuantity -> d.high = create('SimpleQuantity') as h then {\n rateQuantity.high as hi -> h.value = (hi.value);\n rateQuantity.high as hi -> h.unit = (hi.unit);\n } "low";\n } "d";\n } "dosageRate";\n } "Dosage";\n sa -> bundle.entry as e1, e1.request = create('BackboneElement') as request, request.method = 'POST', e1.resource = create('Medication') as medication, medication.id = uuid() as uuid1, e1.fullUrl = append('https://example/Medication/', uuid1), request.url = 'Medication', medicationAdm.medication = create('Reference') as reference, reference.reference = ('https://example/Medication/' + %medication.id) then {\n sa -> medicationRq.medication = create('Reference') as reference, reference.reference = ('https://example/Medication/' + %medication.id) "reference";\n sa.administrationUnitCode -> medication.form;\n sa.consumable as consumable then {\n consumable.manufacturedProduct as manufac then {\n manufac.manufacturedMaterial as manuprod then {\n manuprod.code -> medication.code;\n } "manufactproduct";\n } "manufac";\n };\n sa.entryRelationship as entryRR then {\n entryRR.observation as observation then {\n observation.code where displayName = 'Grammatura' -> medication.ingredient as ingredient then {\n sa.consumable as consumable then {\n consumable.manufacturedProduct as manufacturedProduct then {\n manufacturedProduct.manufacturedMaterial as manufacturedMaterial then {\n manufacturedMaterial.code as code -> ingredient.item = create('CodeableConcept') as value then CECodeableConcept(code, value) "CE";\n } "material";\n } "product";\n };\n observation.value as value -> ingredient.strength as strength then {\n value -> strength.numerator as numerator then {\n value -> numerator.value = (value.value) "valueN";\n } "numerator";\n value -> strength.denominator as denominator then {\n value -> denominator.value = 1 "valueD";\n } "denominator";\n } "strenght";\n } "ingredient";\n observation.code where displayName = 'Quantità nella Confezione' then {\n observation.value as value -> medication.amount as amount then {\n value -> amount.numerator as numerator then {\n value -> numerator.value = (value.value) "valueN";\n } "numerator";\n value -> amount.denominator as denominator then {\n value -> denominator.value = 1 "valueD";\n } "denominator";\n } "amount";\n } "quantita";\n } "obs";\n } "entryRr";\n } "medication";\n sa.entryRelationship as entryRelationship then {\n entryRelationship.supply as sup -> medicationRq.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 } "sub";\n } "entryR";\n sa.participant as participant then {\n participant.time as t -> medicationRq.authoredOn = (t.value);\n participant.participantRole as participantR -> bundle.entry as e1, e1.request = create('BackboneElement') as request, request.method = 'PUT', e1.resource = create('Practitioner') as practitioner then {\n participantR -> practitioner.meta as meta then {\n participantR -> meta.tag = create('Coding') as coding then {\n participantR -> coding.system = 'http://algoritmodiscoring' "system";\n participantR -> coding.code = 'ClinicalDocument/body/TerapiaFarmacologicaRicovero/participant' "code";\n } "coding";\n } "meta";\n participantR.id as id -> practitioner.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 id.root as r then {\n id.extension as ext -> practitioner.id = (r + '-' + ext) as uuid2, e1.fullUrl = append('https://example/Practitioner/', uuid2), request.url = append('Practitioner/', uuid1), medicationRq.requester = create('Reference') as reference, reference.reference = ('https://example/Practitioner/' + %practitioner.id) "aut";\n } "r";\n } "identifier";\n participantR.id as id where (root = '2.16.840.1.113883.2.9.4.3.2') then {\n id.extension as ext -> request.url = append('Practitioner?identifier=', ext) "UUID";\n } "2";\n participantR.playingEntity as assi then {\n assi.name -> practitioner.name;\n } "assi";\n } "perf";\n sa.effectiveTime : EIVL as eff -> medicationRq.dosageInstruction = create('Dosage') as dosage then {\n eff -> dosage.timing = create('Timing') as timing then {\n eff -> timing.repeat as rep then {\n eff.event as ev -> rep.where = (ev.code);\n } "rep";\n } "timing";\n } "period";\n sa.effectiveTime : TS as eff -> medicationRq.dosageInstruction = create('Dosage') as dosage, dosage.timing = create('Timing') as timing, timing.event = (eff.value) "tim";\n sa.effectiveTime : PIVL_TS as eff -> medicationAdm.dosage = create('BackboneElement') as dosage then {\n eff -> dosage.rate = create('Ratio') as ratio then {\n eff -> ratio.numerator = create('Quantity') as quan then {\n eff.period as per -> quan.value = (per.value);\n eff.period as per -> quan.unit = (per.unit);\n } "quanti";\n eff -> ratio.denominator = create('Quantity') as quan then {\n eff.period -> quan.value = '1';\n eff.period as per -> quan.unit = (per.unit);\n } "quanti";\n } "ratio";\n } "eff";\n } "Medicationrequest";\n } "sa";\n } "entry";\n } "sa";\n}\n\ngroup ClinicalDocumentSottoSectionOBS(source src : Section, target tgt, target bundle : Bundle, target enc : Encounter, target patient : Patient) {\n src.title as t -> tgt.title = (t.dataString);\n src.code -> tgt.code;\n src.text as cdaText -> bundle.entry as e1, e1.request = create('BackboneElement') as request, request.method = 'POST', e1.resource = create('Observation') as observation, observation.id = uuid() as uuid1, e1.fullUrl = append('https://example/Observation/', uuid1), request.url = 'Observation', tgt.entry = create('Reference') as reference, reference.reference = ('https://example/Observation/' + %observation.id), tgt.text as fhirText then {\n cdaText -> fhirText.status = 'generated' "narrativeStatus";\n cdaText as t -> fhirText.div = t "narrativeText";\n src.code -> observation.code;\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 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 } "cdaText";\n}\n\ngroup ClinicalDocumentSottoSectionMS(source src : Section, target tgt, target bundle : Bundle, target patient : Patient, 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 e1, e1.request = create('BackboneElement') as request, request.method = 'POST', e1.resource = create('MedicationStatement') as Medicationstatement, Medicationstatement.id = uuid() as uuid1, e1.fullUrl = append('https://example/MedicationStatement/', uuid1), request.url = 'MedicationStatement', tgt.entry = create('Reference') as reference, reference.reference = ('https://example/MedicationStatement/' + %Medicationstatement.id), tgt.text as fhirText then {\n cdaText -> Medicationstatement.note as note then {\n cdaText as t -> note.text = t "reference";\n cdaText as t -> Medicationstatement.medication = create('CodeableConcept') as medication, medication.text = t "text";\n } "reference";\n src -> Medicationstatement.subject = create('Reference') as reference, reference.reference = ('https://example/Patient/' + %patient.id) "reference";\n src -> Medicationstatement.status = 'unknown' "status";\n } "cdaText";\n}\n\ngroup Observation(source obs : Observation, target patient : Patient, target encounter : Encounter, target ob : Observation, target bundle : Bundle) {\n obs -> ob.subject = create('Reference') as reference, reference.reference = ('https://example/Patient/' + %patient.id) "reference";\n obs -> ob.encounter = create('Reference') as reference, reference.reference = ('https://example/Encounter/' + %encounter.id) "reference";\n obs.code -> ob.code;\n obs.statusCode as statusc where (code = 'completed') -> ob.status = 'final';\n obs.statusCode as statusc where (code = 'active') -> ob.status = 'registered';\n obs.statusCode as statusc where (code = 'aborted') -> ob.status = 'cancelled';\n obs.statusCode as statusc where (code = 'suspended') -> ob.status = 'partial';\n obs where obs.statusCode.exists().not() then {\n obs -> ob.status = 'final' "status";\n } "statuscode";\n obs.effectiveTime as effectiveTime -> ob.effective = create('dateTime') as value then TSDateTime(effectiveTime, value) "value2";\n obs where effectiveTime.low.exists() or effectiveTime.high.exists() then {\n obs.effectiveTime as eff -> ob.effective = create('Period') as period then IVLTSPeriod(eff, period) "value3";\n } "where";\n obs.value : INT as int -> ob.value = (int.value);\n obs.value : BL as boolean -> ob.value = (boolean.value) "boolean";\n obs.value : CD as val then {\n val -> ob.value = create('CodeableConcept') as ce then {\n val.originalText -> ce.text;\n val -> ce.coding as coding then {\n val.code as code -> coding.code = cast(code, 'string');\n val.codeSystem as system -> coding.system = translate(system, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri');\n val.displayName as display -> coding.display = cast(display, 'string');\n } "code";\n val.translation as translation -> ce.coding as coding then {\n translation.code as code -> coding.code = cast(code, 'string');\n translation.codeSystem as system -> coding.system = translate(system, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri');\n translation.displayName as display -> coding.display = cast(display, 'string');\n translation.qualifier as qualifier then {\n qualifier.value as value -> ce.coding as coding then {\n value.code as code -> coding.code = cast(code, 'string');\n value.codeSystem as system -> coding.system = translate(system, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri');\n value.displayName as display -> coding.display = cast(display, 'string');\n };\n };\n };\n } "coding";\n } "val";\n obs.value : CE as val then {\n val -> ob.value = create('CodeableConcept') as ce then {\n val.originalText -> ce.text;\n val -> ce.coding as coding then {\n val.code as code -> coding.code = cast(code, 'string');\n val.codeSystem as system -> coding.system = translate(system, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri');\n val.displayName as display -> coding.display = cast(display, 'string');\n } "code";\n val.translation as translation -> ce.coding as coding then {\n translation.code as code -> coding.code = cast(code, 'string');\n translation.codeSystem as system -> coding.system = translate(system, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri');\n translation.displayName as display -> coding.display = cast(display, 'string');\n translation.qualifier as qualifier then {\n qualifier.value as value -> ce.coding as coding then {\n value.code as code -> coding.code = cast(code, 'string');\n value.codeSystem as system -> coding.system = translate(system, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri');\n value.displayName as display -> coding.display = cast(display, 'string');\n };\n };\n };\n } "coding";\n } "val";\n obs.value : PQ as val then {\n val -> ob.value = create('Quantity') as quantity then {\n val.value as value -> quantity.value = value;\n val.unit as unit -> quantity.unit = unit;\n } "quantity";\n } "valueQuantity";\n obs.value : ST as value -> ob.value = create('string'), ob.value = (value.dataString);\n obs.interpretationCode -> ob.interpretation;\n obs.methodCode -> ob.method;\n obs.referenceRange as refRange -> ob.referenceRange = create('BackboneElement') as ref then {\n refRange.observationRange as obsRange -> ref.low = create('SimpleQuantity') as Low then {\n obsRange.value : IVL_PQ as v then {\n v.low as l1 then {\n l1.value as decValue -> Low.value = decValue;\n l1.unit as Unit -> Low.unit = Unit;\n } "decValue";\n } "IVLPQ";\n } "obsRange";\n } "refRange";\n}\n\ngroup ObservationConsulenza(source obs : Observation, target patient : Patient, target encounter : Encounter, target ob : Observation, target bundle : Bundle) {\n obs -> ob.subject = create('Reference') as reference, reference.reference = ('https://example/Patient/' + %patient.id) "reference";\n obs -> ob.encounter = create('Reference') as reference, reference.reference = ('https://example/Encounter/' + %encounter.id) "reference";\n obs.code -> ob.code;\n obs.statusCode as statusc where (code = 'completed') -> ob.status = 'final';\n obs.statusCode as statusc where (code = 'active') -> ob.status = 'registered';\n obs.statusCode as statusc where (code = 'aborted') -> ob.status = 'cancelled';\n obs.statusCode as statusc where (code = 'suspended') -> ob.status = 'partial';\n obs where obs.statusCode.exists().not() then {\n obs -> ob.status = 'final' "status";\n } "statuscode";\n obs.effectiveTime as effectiveTime -> ob.effective = create('dateTime') as value then TSDateTime(effectiveTime, value) "value2c";\n obs where effectiveTime.low.exists() or effectiveTime.high.exists() then {\n obs.effectiveTime as eff -> ob.effective = create('Period') as period then IVLTSPeriod(eff, period) "value3c";\n } "where";\n obs.value : INT as int -> ob.value = (int.value);\n obs.value : BL as boolean -> ob.value = (boolean.value) "boolean";\n obs.value : CE as val then {\n val -> ob.value = create('CodeableConcept') as ce then {\n val.originalText as originalText then {\n originalText.reference as reference -> ce.text = reference;\n } "originltext";\n val -> ce.coding as coding then {\n val.code as code -> coding.code = cast(code, 'string');\n val.codeSystem as system -> coding.system = translate(system, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri');\n val.displayName as display -> coding.display = cast(display, 'string');\n val.codeSystemVersion as version -> coding.version = cast(version, 'string');\n } "code";\n val.translation as translation -> ce.coding as coding then {\n translation.code as code -> coding.code = cast(code, 'string');\n translation.codeSystem as system -> coding.system = translate(system, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri');\n translation.displayName as display -> coding.display = cast(display, 'string');\n translation.codeSystemVersion as version -> coding.version = cast(version, 'string');\n translation.qualifier as qualifier then {\n qualifier.value as value -> ce.coding as coding then {\n value.code as code -> coding.code = cast(code, 'string');\n value.codeSystem as system -> coding.system = translate(system, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri');\n value.displayName as display -> coding.display = cast(display, 'string');\n value.codeSystemVersion as version -> coding.version = cast(version, 'string');\n };\n };\n };\n } "coding";\n } "val";\n obs.value : CD as val then {\n val -> ob.value = create('CodeableConcept') as ce then {\n val.originalText -> ce.text;\n val -> ce.coding as coding then {\n val.code as code -> coding.code = cast(code, 'string');\n val.codeSystem as system -> coding.system = translate(system, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri');\n val.displayName as display -> coding.display = cast(display, 'string');\n } "code";\n val.translation as translation -> ce.coding as coding then {\n translation.code as code -> coding.code = cast(code, 'string');\n translation.codeSystem as system -> coding.system = translate(system, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri');\n translation.displayName as display -> coding.display = cast(display, 'string');\n translation.qualifier as qualifier then {\n qualifier.value as value -> ce.coding as coding then {\n value.code as code -> coding.code = cast(code, 'string');\n value.codeSystem as system -> coding.system = translate(system, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri');\n value.displayName as display -> coding.display = cast(display, 'string');\n };\n };\n };\n } "coding";\n } "val";\n obs.value : PQ as val then {\n val -> ob.value = create('Quantity') as quantity then {\n val.value as value -> quantity.value = value;\n val.unit as unit -> quantity.unit = unit;\n } "quantity";\n } "valueQuantity";\n obs.value : ST as value -> ob.value = create('string'), ob.value = (value.dataString);\n obs -> ob.subject = create('Reference') as reference, reference.reference = ('https://example/Patient/' + %patient.id) "reference";\n obs -> ob.encounter = create('Reference') as reference, reference.reference = ('https://example/Encounter/' + %encounter.id) "reference";\n obs.interpretationCode -> ob.interpretation;\n obs.methodCode -> ob.method;\n obs.referenceRange as refRange -> ob.referenceRange = create('BackboneElement') as ref then {\n refRange.observationRange as obsRange -> ref.low = create('SimpleQuantity') as Low then {\n obsRange.value : IVL_PQ as v then {\n v.low as l1 then {\n l1.value as decValue -> Low.value = decValue;\n l1.unit as Unit -> Low.unit = Unit;\n } "decValue";\n } "IVLPQ";\n } "obsRange";\n } "refRange";\n obs.performer as performer -> bundle.entry as e1, e1.request = create('BackboneElement') as request, request.method = 'PUT', e1.resource = create('Practitioner') as practitioner, practitioner.id = uuid() as uuid1 then {\n performer.assignedEntity as assEntity then {\n assEntity -> practitioner.meta as meta then {\n assEntity -> meta.tag = create('Coding') as coding then {\n assEntity -> coding.system = 'http://algoritmodiscoring' "system";\n assEntity -> coding.code = 'ClinicalDocument/body/Consulenza/performer' "code";\n } "coding";\n } "meta";\n assEntity.id as id -> practitioner.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 id.root as r then {\n id.extension as ext -> practitioner.id = (r + '-' + ext) as uuid2, e1.fullUrl = append('https://example/Practitioner/', uuid2), ob.performer = create('Reference') as reference, reference.reference = ('https://example/Practitioner/' + %practitioner.id) "aut";\n } "r";\n } "identifier";\n assEntity.id as id where (root = '2.16.840.1.113883.2.9.4.3.2') then {\n id.extension as ext -> request.url = append('Practitioner?identifier=', ext) "UUID";\n } "2";\n assEntity.assignedPerson as assi then {\n assi.name -> practitioner.name;\n } "assi";\n } "assEntity";\n } "perf";\n obs.participant as participant -> bundle.entry as e1, e1.request = create('BackboneElement') as request, request.method = 'POST', e1.resource = create('ServiceRequest') as serviceRequest, serviceRequest.id = uuid() as uuid1, e1.fullUrl = append('https://example/ServiceRequest/', uuid1), request.url = 'ServiceRequest', ob.basedOn = create('Reference') as reference, reference.reference = ('https://example/ServiceRequest/' + %serviceRequest.id) then {\n participant.time as t -> serviceRequest.authoredOn = (t.value);\n obs -> serviceRequest.subject = create('Reference') as reference, reference.reference = ('https://example/Patient/' + %patient.id) "reference";\n obs -> serviceRequest.encounter = create('Reference') as reference, reference.reference = ('https://example/Encounter/' + %encounter.id) "reference";\n obs -> serviceRequest.status = 'active' "status";\n obs -> serviceRequest.intent = 'order' "intent";\n participant.participantRole as participantRole -> bundle.entry as e1, e1.request = create('BackboneElement') as request, request.method = 'PUT', e1.resource = create('Practitioner') as practitioner then {\n participantRole -> practitioner.meta as meta then {\n participantRole -> meta.tag = create('Coding') as coding then {\n participantRole -> coding.system = 'http://algoritmodiscoring' "system";\n participantRole -> coding.code = 'ClinicalDocument/body/Consulenza/participant' "code";\n } "coding";\n } "meta";\n participantRole.id as id -> practitioner.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 id.root as r then {\n id.extension as ext -> practitioner.id = (r + '-' + ext) as uuid3, e1.fullUrl = append('https://example/Practitioner/', uuid3), serviceRequest.performer = create('Reference') as reference, reference.reference = ('https://example/Practitioner/' + %practitioner.id) "aut";\n } "r";\n } "identifier";\n participantRole.id as id where (root = '2.16.840.1.113883.2.9.4.3.2') then {\n id.extension as ext -> request.url = append('Practitioner?identifier=', ext) "UUID";\n } "2";\n participantRole.playingEntity as pe then {\n pe.name -> practitioner.name;\n } "pe";\n };\n };\n}\n\ngroup ObservationEsamiDuranteRicovero(source obs : Observation, target patient : Patient, target encounter : Encounter, target ob : Observation, target bundle : Bundle) {\n obs -> ob.subject = create('Reference') as reference, reference.reference = ('https://example/Patient/' + %patient.id) "reference";\n obs -> ob.encounter = create('Reference') as reference, reference.reference = ('https://example/Encounter/' + %encounter.id) "reference";\n obs.code -> ob.code;\n obs.statusCode as statusc where (code = 'completed') -> ob.status = 'final';\n obs.statusCode as statusc where (code = 'active') -> ob.status = 'registered';\n obs.statusCode as statusc where (code = 'aborted') -> ob.status = 'cancelled';\n obs.statusCode as statusc where (code = 'suspended') -> ob.status = 'partial';\n obs where obs.statusCode.exists().not() then {\n obs -> ob.status = 'final' "status";\n } "statuscode";\n obs.effectiveTime as effectiveTime -> ob.effective = create('dateTime') as value then TSDateTime(effectiveTime, value) "value2r";\n obs where effectiveTime.low.exists() or effectiveTime.high.exists() then {\n obs.effectiveTime as eff -> ob.effective = create('Period') as period then IVLTSPeriod(eff, period) "value3r";\n } "where";\n obs.value : INT as int -> ob.value = (int.value);\n obs.value : BL as boolean -> ob.value = (boolean.value) "boolean";\n obs.value : CE as val then {\n val -> ob.value = create('CodeableConcept') as ce then {\n val.originalText as originalText then {\n originalText.reference as reference -> ce.text = reference;\n } "originltext";\n val -> ce.coding as coding then {\n val.code as code -> coding.code = cast(code, 'string');\n val.codeSystem as system -> coding.system = translate(system, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri');\n val.displayName as display -> coding.display = cast(display, 'string');\n val.codeSystemVersion as version -> coding.version = cast(version, 'string');\n } "code";\n val.translation as translation -> ce.coding as coding then {\n translation.code as code -> coding.code = cast(code, 'string');\n translation.codeSystem as system -> coding.system = translate(system, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri');\n translation.displayName as display -> coding.display = cast(display, 'string');\n translation.codeSystemVersion as version -> coding.version = cast(version, 'string');\n translation.qualifier as qualifier then {\n qualifier.value as value -> ce.coding as coding then {\n value.code as code -> coding.code = cast(code, 'string');\n value.codeSystem as system -> coding.system = translate(system, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri');\n value.displayName as display -> coding.display = cast(display, 'string');\n value.codeSystemVersion as version -> coding.version = cast(version, 'string');\n };\n };\n };\n } "coding";\n } "val";\n obs.value : CD as val then {\n val -> ob.value = create('CodeableConcept') as ce then {\n val.originalText -> ce.text;\n val -> ce.coding as coding then {\n val.code as code -> coding.code = cast(code, 'string');\n val.codeSystem as system -> coding.system = translate(system, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri');\n val.displayName as display -> coding.display = cast(display, 'string');\n } "code";\n val.translation as translation -> ce.coding as coding then {\n translation.code as code -> coding.code = cast(code, 'string');\n translation.codeSystem as system -> coding.system = translate(system, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri');\n translation.displayName as display -> coding.display = cast(display, 'string');\n translation.qualifier as qualifier then {\n qualifier.value as value -> ce.coding as coding then {\n value.code as code -> coding.code = cast(code, 'string');\n value.codeSystem as system -> coding.system = translate(system, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri');\n value.displayName as display -> coding.display = cast(display, 'string');\n };\n };\n };\n } "coding";\n } "val";\n obs.value : PQ as val then {\n val -> ob.value = create('Quantity') as quantity then {\n val.value as value -> quantity.value = value;\n val.unit as unit -> quantity.unit = unit;\n } "quantity";\n } "valueQuantity";\n obs.value : ST as value -> ob.value = create('string'), ob.value = (value.dataString);\n obs -> ob.subject = create('Reference') as reference, reference.reference = ('https://example/Patient/' + %patient.id) "reference";\n obs -> ob.encounter = create('Reference') as reference, reference.reference = ('https://example/Encounter/' + %encounter.id) "reference";\n obs.interpretationCode -> ob.interpretation;\n obs.methodCode -> ob.method;\n obs.effectiveTime as eff -> ob.effective = create('Period') as per then IVLTSPeriod(eff, per);\n obs.referenceRange as refRange -> ob.referenceRange = create('BackboneElement') as ref then {\n refRange.observationRange as obsRange -> ref.low = create('SimpleQuantity') as Low then {\n obsRange.value : IVL_PQ as v then {\n v.low as l1 then {\n l1.value as decValue -> Low.value = decValue;\n l1.unit as Unit -> Low.unit = Unit;\n } "decValue";\n } "IVLPQ";\n } "obsRange";\n } "refRange";\n obs.performer as performer -> bundle.entry as e1, e1.request = create('BackboneElement') as request, request.method = 'PUT', e1.resource = create('Practitioner') as practitioner, practitioner.id = uuid() as uuid1 then {\n performer.assignedEntity as assEntity then {\n assEntity -> practitioner.meta as meta then {\n assEntity -> meta.tag = create('Coding') as coding then {\n assEntity -> coding.system = 'http://algoritmodiscoring' "system";\n assEntity -> coding.code = 'ClinicalDocument/body/EsamiDuranteRicovero/performer' "code";\n } "coding";\n } "meta";\n assEntity.id as id -> practitioner.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 id.root as r then {\n id.extension as ext -> practitioner.id = (r + '-' + ext) as uuid2, e1.fullUrl = append('https://example/Practitioner/', uuid2), ob.performer = create('Reference') as reference, reference.reference = ('https://example/Practitioner/' + %practitioner.id) "aut";\n } "r";\n } "identifier";\n assEntity.id as id where (root = '2.16.840.1.113883.2.9.4.3.2') then {\n id.extension as ext -> request.url = append('Practitioner?identifier=', ext) "UUID";\n } "2";\n assEntity.assignedPerson as assi then {\n assi.name -> practitioner.name;\n } "assi";\n } "assEntity";\n } "perf";\n obs.participant as participant -> bundle.entry as e1, e1.request = create('BackboneElement') as request, request.method = 'POST', e1.resource = create('ServiceRequest') as serviceRequest, serviceRequest.id = uuid() as uuid1, e1.fullUrl = append('https://example/ServiceRequest/', uuid1), request.url = 'ServiceRequest', ob.basedOn = create('Reference') as reference, reference.reference = ('https://example/ServiceRequest/' + %serviceRequest.id) then {\n participant.time as t -> serviceRequest.authoredOn = (t.value);\n obs -> serviceRequest.subject = create('Reference') as reference, reference.reference = ('https://example/Patient/' + %patient.id) "reference";\n obs -> serviceRequest.encounter = create('Reference') as reference, reference.reference = ('https://example/Encounter/' + %encounter.id) "reference";\n obs -> serviceRequest.status = 'active' "status";\n obs -> serviceRequest.intent = 'order' "intent";\n participant.participantRole as participantRole -> bundle.entry as e1, e1.request = create('BackboneElement') as request, request.method = 'PUT', e1.resource = create('Practitioner') as practitioner then {\n participantRole -> practitioner.meta as meta then {\n participantRole -> meta.tag = create('Coding') as coding then {\n participantRole -> coding.system = 'http://algoritmodiscoring' "system";\n participantRole -> coding.code = 'ClinicalDocument/body/EsamiDuranteRicovero/participant' "code";\n } "coding";\n } "meta";\n participantRole.id as id -> practitioner.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 id.root as r then {\n id.extension as ext -> practitioner.id = (r + '-' + ext) as uuid3, e1.fullUrl = append('https://example/Practitioner/', uuid3), serviceRequest.performer = create('Reference') as reference, reference.reference = ('https://example/Practitioner/' + %practitioner.id) "aut";\n } "r";\n } "identifier";\n participantRole.id as id where (root = '2.16.840.1.113883.2.9.4.3.2') then {\n id.extension as ext -> request.url = append('Practitioner?identifier=', ext) "UUID";\n } "2";\n participantRole.playingEntity as pe then {\n pe.name -> practitioner.name;\n } "pe";\n };\n };\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\n// ---------------------------------------------------------------------------------------\ngroup Act(source cda : Act, target pat : Patient, target ac : DiagnosticReport, target enc : Encounter, target bundle : Bundle) {\n cda.code -> ac.code;\n cda.statusCode as statusc where (code = 'completed') -> ob.status = 'final';\n cda.statusCode as statusc where (code = 'active') -> ob.status = 'registered';\n cda.statusCode as statusc where (code = 'aborted') -> ob.status = 'cancelled';\n cda.statusCode as statusc where (code = 'suspended') -> ob.status = 'partial';\n cda.effectiveTime as effectiveTime -> ac.effective = create('dateTime') as value then TSDateTime(effectiveTime, value) "value2a";\n obs where effectiveTime.low.exists() or effectiveTime.high.exists() then {\n cda.effectiveTime as eff -> ac.effective = create('Period') as period then IVLTSPeriod(eff, period) "value3a";\n } "where";\n cda -> ac.subject = create('Reference') as reference, reference.reference = ('https://example/' + %pat.id) "reference";\n cda -> ac.encounter = create('Reference') as reference, reference.reference = ('https://example/' + %enc.id) "reference";\n cda.participant as part -> enc.participant as participant then {\n part -> participant.type as type then {\n part -> type.coding as coding then {\n part -> coding.code = (part.typeCode) "codice";\n part -> coding.system = 'http://terminology.hl7.org/CodeSystem/v3-ParticipationType' "system";\n } "codeType";\n } "type";\n part.participantRole as participantRole -> participant.individual = create('Reference') as reference then {\n participantRole -> bundle.entry as e, e.request = create('BackboneElement') as request, request.method = 'PUT', e.resource = create('Practitioner') as practitioner, practitioner.id = uuid() as uuid1, e.fullUrl = append('https://example/Practitioner/', uuid1), reference.reference = ('https://example/Practitioner/' + %practitioner.id) then {\n participantRole -> practitioner.meta as meta then {\n participantRole -> meta.tag = create('Coding') as coding then {\n participantRole -> coding.system = 'http://algoritmodiscoring' "system";\n participantRole -> coding.code = 'ClinicalDocument/body/Act/participant' "code";\n } "coding";\n } "meta";\n participantRole.id as id -> practitioner.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 then {\n participantRole -> request.url = append('Practitioner?identifier=', ext) "UUID";\n } "ext";\n id.assigningAuthorityName as s -> identifier.assigner as a, a.display = s;\n } "identifier";\n participantRole.playingEntity as playingEntity then {\n playingEntity.name -> practitioner.name;\n };\n } "participanRoleBund";\n };\n };\n cda.entryRelationship as entryRelationship then {\n entryRelationship.observation as observation -> bundle.entry as e, e.request = create('BackboneElement') as request, request.method = 'POST', e.resource = create('Observation') as obs, obs.id = uuid() as uuid2, e.fullUrl = append('https://example/Observation/', uuid2), request.url = append('Observation/', uuid2), ac.result = create('Reference') as reference, reference.reference = ('https://example/Observation/' + %obs.id) then Observation(observation, pat, enc, obs, bundle) "OBS";\n };\n}\n\ngroup ClinicalDocumentSectionTerapiaDimissione(source cda : ClinicalDocument, source src : Section, target patient : Patient, target tgt, target bundle : Bundle, target enc : Encounter) {\n src.title as t -> tgt.title = (t.dataString);\n src.code -> tgt.code;\n src where src.entry.exists() then {\n src.text as cdaText -> tgt.text as fhirText then {\n cdaText -> fhirText.status = 'generated' "narrativeStatus";\n cdaText as t -> fhirText.div = t "narrativeText";\n } "cdaText";\n } "exist";\n src where src.entry.exists().not() then {\n src.text as cdaText -> bundle.entry as e1, e1.request = create('BackboneElement') as request, request.method = 'POST', e1.resource = create('MedicationRequest') as medicationRq, medicationRq.id = uuid() as uuid1, e1.fullUrl = append('https://example/MedicationRequest/', uuid1), request.url = 'MedicationRequest', tgt.entry = create('Reference') as reference, reference.reference = ('https://example/MedicationRequest/' + %medicationRq.id) then {\n src -> medicationRq.subject = create('Reference') as reference, reference.reference = ('https://example/Patient/' + %patient.id) "reference";\n src -> medicationRq.encounter = create('Reference') as reference, reference.reference = ('https://example/Encounter/' + %enc.id) "reference";\n src -> medicationRq.status = 'active' "status";\n src -> medicationRq.intent = 'order' "intent";\n cdaText -> medicationRq.medication = create('CodeableConcept') as codecon then {\n cdaText -> codecon.text = 'string' "text";\n } "code";\n cdaText -> medicationRq.note as note then {\n cdaText as t -> note.text = t "reference";\n } "reference";\n } "cdaText";\n } "where";\n src.entry as entry1 -> bundle.entry as e1, e1.request = create('BackboneElement') as request, request.method = 'POST', e1.resource = create('MedicationRequest') as medicationRq, medicationRq.id = uuid() as uuid1, e1.fullUrl = append('https://example/MedicationRequest/', uuid1), request.url = 'MedicationRequest', tgt.entry = create('Reference') as reference, reference.reference = ('https://example/MedicationRequest/' + %medicationRq.id) then {\n src -> medicationRq.subject = create('Reference') as reference, reference.reference = ('https://example/Patient/' + %patient.id) "reference";\n src -> medicationRq.encounter = create('Reference') as reference, reference.reference = ('https://example/Encounter/' + %enc.id) "reference";\n src -> medicationRq.status = 'active' "status";\n src -> medicationRq.intent = 'order' "intent";\n entry1.substanceAdministration as substract then {\n substract.consumable as cons then {\n cons.manufacturedProduct as man1 -> bundle.entry as e1, e1.request = create('BackboneElement') as request, request.method = 'POST', e1.resource = create('Medication') as medication, medication.id = uuid() as uuid1, e1.fullUrl = append('https://example/Medication/', uuid1), request.url = 'Medication', medicationRq.medication = create('Reference') as medref, medref.reference = ('https://example/Medication/' + %medication.id) then {\n man1.manufacturedMaterial as mm then {\n mm.code -> medication.code;\n } "mm";\n substract.administrationUnitCode -> medication.form;\n substract.entryRelationship as entryR then {\n entryR.observation as observation then {\n observation.code where displayName = 'Grammatura' -> medication.ingredient as ingredient then {\n substract.consumable as consumable then {\n consumable.manufacturedProduct as manufacturedProduct then {\n manufacturedProduct.manufacturedMaterial as manufacturedMaterial then {\n manufacturedMaterial.code as code -> ingredient.item = create('CodeableConcept') as value then CECodeableConcept(code, value) "CE";\n } "material";\n } "product";\n };\n observation.value as value -> ingredient.strength as strength then {\n value -> strength.numerator as numerator then {\n value -> numerator.value = (value.value) "valueN";\n } "numerator";\n value -> strength.denominator as denominator then {\n value -> denominator.value = 1 "valueD";\n } "denominator";\n } "strenght";\n } "ingredient";\n observation.code where displayName = 'Quantità nella Confezione' then {\n observation.value as value -> medication.amount as amount then {\n value -> amount.numerator as numerator then {\n value -> numerator.value = (value.value) "valueN";\n } "numerator";\n value -> amount.denominator as denominator then {\n value -> denominator.value = 1 "valueD";\n } "denominator";\n } "amount";\n } "quantita";\n } "obs";\n } "entryR";\n substract.entryRelationship as entryRelationship then {\n entryRelationship.supply as sup -> medicationRq.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 } "sub";\n } "entry";\n } "man1";\n } "cons";\n substract.text as tx -> medicationRq.note as note then {\n tx.reference as ref -> note.text = (ref.value);\n } "tx";\n substract.statusCode as st -> medicationRq.status = (st.code);\n substract.effectiveTime : IVL_TS as eff -> medicationRq.dosageInstruction = create('Dosage') as dosage then {\n eff -> dosage.timing = create('Timing') as timing then {\n eff -> timing.repeat as rep then {\n eff -> rep.bounds = create('Period') as period then IVLTSPeriod(eff, period) "period";\n } "rep";\n } "timing";\n } "period";\n substract.effectiveTime : EIVL_TS as eff -> medicationRq.dosageInstruction = create('Dosage') as dosage then {\n eff -> dosage.timing = create('Timing') as timing then {\n eff -> timing.repeat as rep then {\n eff.event as ev -> rep.when = (ev.code);\n } "rep";\n } "timing";\n } "period";\n substract.effectiveTime : IVL_TS as eff -> medicationRq.dosageInstruction = create('Dosage') as dosage, dosage.timing = create('Timing') as timing, timing.event = (eff.value) "tim";\n substract.effectiveTime : PIVL_TS as eff -> medicationRq.dosageInstruction = create('Dosage') as dosage then {\n eff -> dosage.timing = create('Timing') as timing then periodTiming(eff, timing) "cod";\n } "eff";\n substract -> medicationRq.dosageInstruction = create('Dosage') as dosage then {\n substract.routeCode -> dosage.route;\n } "dosage";\n substract -> medicationRq.dosageInstruction = create('Dosage') as dosage then {\n substract.approachSiteCode -> dosage.site;\n } "dosage";\n substract.doseQuantity as doseQuant -> medicationRq.dosageInstruction = create('Dosage') as dosageInstruction then {\n doseQuant.originalText as ot then {\n ot.reference -> dosageInstruction.text;\n } "ot";\n doseQuant -> dosageInstruction.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 } "Dosage";\n substract.rateQuantity as rateQuantity -> medicationRq.dosageInstruction = create('Dosage') as dosageInstruction1 then {\n rateQuantity.originalText as ot then {\n ot.reference -> dosageInstruction1.text;\n } "ot";\n rateQuantity -> dosageInstruction1.doseAndRate as dosageRate then {\n rateQuantity -> dosageRate.rate = create('Range') as d then {\n rateQuantity -> d.low = create('SimpleQuantity') as l then {\n rateQuantity.low as lo -> l.value = (lo.value);\n rateQuantity.low as lo -> l.unit = (lo.unit);\n } "low";\n rateQuantity -> d.high = create('SimpleQuantity') as h then {\n rateQuantity.high as hi -> h.value = (hi.value);\n rateQuantity.high as hi -> h.unit = (hi.unit);\n } "low";\n } "d";\n } "dosageRate";\n } "rateq";\n substract.participant as part -> bundle.entry as e1, e1.request = create('BackboneElement') as request, request.method = 'PUT', e1.resource = create('Practitioner') as practitioner then {\n part.time as time -> medicationRq.authoredOn = (time.value);\n part.participantRole as partRole then {\n partRole -> practitioner.meta as meta then {\n partRole -> meta.tag = create('Coding') as coding then {\n partRole -> coding.system = 'http://algoritmodiscoring' "system";\n partRole -> coding.code = 'ClinicalDocument/body/TerapiaFarmacologicaRicovero/participant' "code";\n } "coding";\n } "meta";\n partRole.id as id -> practitioner.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 id.root as r then {\n id.extension as ext -> practitioner.id = (r + '-' + ext) as uuid2, e1.fullUrl = append('https://example/Practitioner/', uuid2), request.url = append('Practitioner/', uuid1), medicationRq.performer = create('Reference') as reference, reference.reference = ('https://example/Practitioner/' + %practitioner.id) "aut";\n } "r";\n } "identifier";\n partRole.id as id where (root = '2.16.840.1.113883.2.9.4.3.2') then {\n id.extension as ext -> request.url = append('Practitioner?identifier=', ext) "UUID";\n } "2";\n partRole.playingEntity as assi then {\n assi.name -> practitioner.name;\n } "assi";\n } "perf";\n } "partRole";\n } "participant";\n } "substract";\n}\n\n</pre>\n </div>"
},
"url" : "http://hl7.it/fhir/cda2fhir/StructureMap/cda2fhirLdo",
"version" : "0.1.0",
"name" : "cda2fhirLdo",
"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" : "component",
"source" : [
{
"context" : "body",
"element" : "component",
"variable" : "component"
}
],
"rule" : [
{
"name" : "section",
"source" : [
{
"context" : "component",
"element" : "section",
"variable" : "srcSection"
}
],
"rule" : [
{
"name" : "motivoRicovero",
"source" : [
{
"context" : "srcSection",
"element" : "code",
"condition" : "(code = '46241-6')"
}
],
"target" : [
{
"context" : "composition",
"contextType" : "variable",
"element" : "section",
"variable" : "tgtSection"
}
],
"dependent" : [
{
"name" : "ClinicalDocumentSectionMotivoRicovero",
"variable" : [
"cda",
"srcSection",
"patient",
"tgtSection",
"bundle",
"encounter"
]
}
]
},
{
"name" : "inquadramentoClinico",
"source" : [
{
"context" : "srcSection",
"element" : "code",
"condition" : "(code = '47039-3')"
}
],
"target" : [
{
"context" : "composition",
"contextType" : "variable",
"element" : "section",
"variable" : "tgtSection"
}
],
"dependent" : [
{
"name" : "ClinicalDocumentSectionInquadramentoClinico",
"variable" : [
"cda",
"srcSection",
"patient",
"tgtSection",
"bundle",
"encounter"
]
}
]
},
{
"name" : "DecorsoOspedaliero",
"source" : [
{
"context" : "srcSection",
"element" : "code",
"condition" : "(code = '8648-8')"
}
],
"target" : [
{
"context" : "composition",
"contextType" : "variable",
"element" : "section",
"variable" : "tgtSection"
}
],
"dependent" : [
{
"name" : "ClinicalDocumentSectionDecorsoOspedaliero",
"variable" : [
"cda",
"srcSection",
"patient",
"tgtSection",
"bundle",
"encounter"
]
}
]
},
{
"name" : "Complicazioni",
"source" : [
{
"context" : "srcSection",
"element" : "code",
"condition" : "(code = '55109-3')"
}
],
"target" : [
{
"context" : "composition",
"contextType" : "variable",
"element" : "section",
"variable" : "tgtSection"
}
],
"dependent" : [
{
"name" : "ClinicalDocumentSectionComplicanze",
"variable" : [
"cda",
"srcSection",
"patient",
"tgtSection",
"bundle",
"encounter"
]
}
]
},
{
"name" : "HospitalDischargeStudiesSummary",
"source" : [
{
"context" : "srcSection",
"element" : "code",
"condition" : "(code = '11493-4')"
}
],
"target" : [
{
"context" : "composition",
"contextType" : "variable",
"element" : "section",
"variable" : "tgtSection"
}
],
"dependent" : [
{
"name" : "ClinicalDocumentSectionRiscontri",
"variable" : [
"cda",
"srcSection",
"patient",
"tgtSection",
"bundle",
"encounter"
]
}
]
},
{
"name" : "HospitalDischargeStudiesSummary",
"source" : [
{
"context" : "srcSection",
"element" : "code",
"condition" : "(code = '34104-0')"
}
],
"target" : [
{
"context" : "composition",
"contextType" : "variable",
"element" : "section",
"variable" : "tgtSection"
}
],
"dependent" : [
{
"name" : "ClinicalDocumentSectionConsulenza",
"variable" : [
"cda",
"srcSection",
"patient",
"tgtSection",
"bundle",
"encounter"
]
}
]
},
{
"name" : "EsamiEseguitiDuranteilRicovero",
"source" : [
{
"context" : "srcSection",
"element" : "code",
"condition" : "(code = '30954-2')"
}
],
"target" : [
{
"context" : "composition",
"contextType" : "variable",
"element" : "section",
"variable" : "tgtSection"
}
],
"dependent" : [
{
"name" : "ClinicalDocumentSectionEsamiEseguitiRicovero",
"variable" : [
"cda",
"srcSection",
"patient",
"tgtSection",
"bundle",
"encounter"
]
}
]
},
{
"name" : "HistoryOfProceduresDocument",
"source" : [
{
"context" : "srcSection",
"element" : "code",
"condition" : "(code = '47519-4')"
}
],
"target" : [
{
"context" : "composition",
"contextType" : "variable",
"element" : "section",
"variable" : "tgtSection"
}
],
"dependent" : [
{
"name" : "ClinicalDocumentSectionProcedureEseguiteRicovero",
"variable" : [
"cda",
"srcSection",
"patient",
"tgtSection",
"bundle",
"encounter"
]
}
]
},
{
"name" : "EsamiEseguitiDuranteIlRicovero",
"source" : [
{
"context" : "srcSection",
"element" : "code",
"condition" : "(code = '48765-2')"
}
],
"target" : [
{
"context" : "composition",
"contextType" : "variable",
"element" : "section",
"variable" : "tgtSection"
}
],
"dependent" : [
{
"name" : "ClinicalDocumentSectionAllergie",
"variable" : [
"cda",
"srcSection",
"patient",
"tgtSection",
"bundle",
"encounter"
]
}
]
},
{
"name" : "TerapiaFarmacologicaAllaDimissione",
"source" : [
{
"context" : "srcSection",
"element" : "code",
"condition" : "(code = '10160-0')"
}
],
"target" : [
{
"context" : "composition",
"contextType" : "variable",
"element" : "section",
"variable" : "tgtSection"
}
],
"dependent" : [
{
"name" : "ClinicalDocumentSectionTerapiaFarmacologicaDuranteRicovero",
"variable" : [
"cda",
"srcSection",
"patient",
"tgtSection",
"bundle",
"encounter"
]
}
]
},
{
"name" : "DiagnosiDiDimissione",
"source" : [
{
"context" : "srcSection",
"element" : "code",
"condition" : "(code = '11535-2')"
}
],
"target" : [
{
"context" : "composition",
"contextType" : "variable",
"element" : "section",
"variable" : "tgtSection"
}
],
"dependent" : [
{
"name" : "ClinicalDocumentSectionDiagnosiDimissione",
"variable" : [
"cda",
"srcSection",
"patient",
"tgtSection",
"bundle",
"encounter"
]
}
]
},
{
"name" : "DiagnosiDiDimissione",
"source" : [
{
"context" : "srcSection",
"element" : "code",
"condition" : "(code = '18776-5')"
}
],
"target" : [
{
"context" : "composition",
"contextType" : "variable",
"element" : "section",
"variable" : "tgtSection"
}
],
"dependent" : [
{
"name" : "ClinicalDocumentSectionIstruzioniFollowUp",
"variable" : [
"cda",
"srcSection",
"patient",
"tgtSection",
"bundle",
"encounter"
]
}
]
},
{
"name" : "TerapiaFarmacologicaAllaDimissione",
"source" : [
{
"context" : "srcSection",
"element" : "code",
"condition" : "(code = '10183-2')"
}
],
"target" : [
{
"context" : "composition",
"contextType" : "variable",
"element" : "section",
"variable" : "tgtSection"
}
],
"dependent" : [
{
"name" : "ClinicalDocumentSectionTerapiaDimissione",
"variable" : [
"cda",
"srcSection",
"patient",
"tgtSection",
"bundle",
"encounter"
]
}
]
}
],
"documentation" : "discretizzi il primo livello di component"
}
]
}
]
}
]
}
]
},
{
"name" : "ClinicalDocumentSectionMotivoRicovero",
"typeMode" : "none",
"documentation" : "-------------------------------------------------------------------------------------------------------------------",
"input" : [
{
"name" : "cda",
"type" : "ClinicalDocument",
"mode" : "source"
},
{
"name" : "src",
"type" : "Section",
"mode" : "source"
},
{
"name" : "patient",
"type" : "Patient",
"mode" : "target"
},
{
"name" : "tgt",
"mode" : "target"
},
{
"name" : "bundle",
"type" : "Bundle",
"mode" : "target"
},
{
"name" : "enc",
"type" : "Encounter",
"mode" : "target"
}
],
"rule" : [
{
"name" : "title",
"source" : [
{
"context" : "src",
"element" : "title",
"variable" : "t"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "title",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "t.dataString"
}
]
}
]
},
{
"name" : "code",
"source" : [
{
"context" : "src",
"element" : "code",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "code",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "cText",
"source" : [
{
"context" : "src",
"condition" : "src.entry.exists()"
}
],
"rule" : [
{
"name" : "cdaText",
"source" : [
{
"context" : "src",
"element" : "text",
"variable" : "cdaText"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "text",
"variable" : "fhirText"
}
],
"rule" : [
{
"name" : "narrativeStatus",
"source" : [
{
"context" : "cdaText"
}
],
"target" : [
{
"context" : "fhirText",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "generated"
}
]
}
]
},
{
"name" : "narrativeText",
"source" : [
{
"context" : "cdaText",
"variable" : "t"
}
],
"target" : [
{
"context" : "fhirText",
"contextType" : "variable",
"element" : "div",
"transform" : "copy",
"parameter" : [
{
"valueId" : "t"
}
]
}
]
}
]
}
]
},
{
"name" : "entry",
"source" : [
{
"context" : "src",
"element" : "entry",
"variable" : "entry1"
}
],
"target" : [
{
"context" : "bundle",
"contextType" : "variable",
"element" : "entry",
"variable" : "e1"
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "request",
"variable" : "request",
"transform" : "create",
"parameter" : [
{
"valueString" : "BackboneElement"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "method",
"transform" : "copy",
"parameter" : [
{
"valueString" : "POST"
}
]
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "resource",
"variable" : "observation",
"transform" : "create",
"parameter" : [
{
"valueString" : "Observation"
}
]
},
{
"context" : "observation",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid1",
"transform" : "uuid"
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "https://example/Observation/"
},
{
"valueId" : "uuid1"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "url",
"transform" : "copy",
"parameter" : [
{
"valueString" : "Observation"
}
]
},
{
"context" : "tgt",
"contextType" : "variable",
"element" : "entry",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Observation/' + %observation.id"
}
]
}
],
"rule" : [
{
"name" : "act",
"source" : [
{
"context" : "entry1",
"element" : "observation",
"variable" : "obs"
}
],
"dependent" : [
{
"name" : "Observation",
"variable" : [
"obs",
"patient",
"enc",
"observation",
"bundle"
]
}
]
}
]
},
{
"name" : "where",
"source" : [
{
"context" : "src",
"condition" : "src.entry.exists().not()"
}
],
"rule" : [
{
"name" : "cdaText",
"source" : [
{
"context" : "src",
"element" : "text",
"variable" : "cdaText"
}
],
"target" : [
{
"context" : "bundle",
"contextType" : "variable",
"element" : "entry",
"variable" : "e8"
},
{
"context" : "e8",
"contextType" : "variable",
"element" : "request",
"variable" : "request",
"transform" : "create",
"parameter" : [
{
"valueString" : "BackboneElement"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "method",
"transform" : "copy",
"parameter" : [
{
"valueString" : "POST"
}
]
},
{
"context" : "e8",
"contextType" : "variable",
"element" : "resource",
"variable" : "Observation",
"transform" : "create",
"parameter" : [
{
"valueString" : "Observation"
}
]
},
{
"context" : "Observation",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid8",
"transform" : "uuid"
},
{
"context" : "e8",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "https://example/Observation/"
},
{
"valueId" : "uuid8"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "url",
"transform" : "copy",
"parameter" : [
{
"valueString" : "Observation"
}
]
},
{
"context" : "tgt",
"contextType" : "variable",
"element" : "entry",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Observation/' + %Observation.id"
}
]
}
],
"rule" : [
{
"name" : "reference",
"source" : [
{
"context" : "src"
}
],
"target" : [
{
"context" : "Observation",
"contextType" : "variable",
"element" : "subject",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Patient/' + %patient.id"
}
]
}
]
},
{
"name" : "reference",
"source" : [
{
"context" : "src"
}
],
"target" : [
{
"context" : "Observation",
"contextType" : "variable",
"element" : "encounter",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Encounter/' + %enc.id"
}
]
}
]
},
{
"name" : "code",
"source" : [
{
"context" : "src",
"element" : "code",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "Observation",
"contextType" : "variable",
"element" : "code",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "statuscode",
"source" : [
{
"context" : "src",
"condition" : "observation.statusCode.exists().not()"
}
],
"rule" : [
{
"name" : "status",
"source" : [
{
"context" : "src"
}
],
"target" : [
{
"context" : "Observation",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "final"
}
]
}
]
}
]
},
{
"name" : "reference",
"source" : [
{
"context" : "cdaText"
}
],
"target" : [
{
"context" : "Observation",
"contextType" : "variable",
"element" : "note",
"variable" : "note"
}
],
"rule" : [
{
"name" : "reference",
"source" : [
{
"context" : "cdaText",
"variable" : "t"
}
],
"target" : [
{
"context" : "note",
"contextType" : "variable",
"element" : "text",
"transform" : "copy",
"parameter" : [
{
"valueId" : "t"
}
]
}
]
}
]
}
]
}
]
}
]
},
{
"name" : "ClinicalDocumentSectionInquadramentoClinico",
"typeMode" : "none",
"input" : [
{
"name" : "cda",
"type" : "ClinicalDocument",
"mode" : "source"
},
{
"name" : "src",
"type" : "Section",
"mode" : "source"
},
{
"name" : "patient",
"type" : "Patient",
"mode" : "target"
},
{
"name" : "tgt",
"mode" : "target"
},
{
"name" : "bundle",
"type" : "Bundle",
"mode" : "target"
},
{
"name" : "enc",
"type" : "Encounter",
"mode" : "target"
}
],
"rule" : [
{
"name" : "title",
"source" : [
{
"context" : "src",
"element" : "title",
"variable" : "t"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "title",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "t.dataString"
}
]
}
]
},
{
"name" : "code",
"source" : [
{
"context" : "src",
"element" : "code",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "code",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "cdaText",
"source" : [
{
"context" : "src",
"element" : "text",
"variable" : "cdaText"
}
],
"target" : [
{
"context" : "bundle",
"contextType" : "variable",
"element" : "entry",
"variable" : "e1"
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "request",
"variable" : "request",
"transform" : "create",
"parameter" : [
{
"valueString" : "BackboneElement"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "method",
"transform" : "copy",
"parameter" : [
{
"valueString" : "POST"
}
]
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "resource",
"variable" : "observation",
"transform" : "create",
"parameter" : [
{
"valueString" : "Observation"
}
]
},
{
"context" : "observation",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid1",
"transform" : "uuid"
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "https://example/Observation/"
},
{
"valueId" : "uuid1"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "url",
"transform" : "copy",
"parameter" : [
{
"valueString" : "Observation"
}
]
},
{
"context" : "tgt",
"contextType" : "variable",
"element" : "entry",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Observation/' + %observation.id"
}
]
},
{
"context" : "tgt",
"contextType" : "variable",
"element" : "text",
"variable" : "fhirText"
}
],
"rule" : [
{
"name" : "reference",
"source" : [
{
"context" : "cdaText"
}
],
"target" : [
{
"context" : "observation",
"contextType" : "variable",
"element" : "subject",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Patient/' + %patient.id"
}
]
}
]
},
{
"name" : "reference",
"source" : [
{
"context" : "cdaText"
}
],
"target" : [
{
"context" : "observation",
"contextType" : "variable",
"element" : "encounter",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Encounter/' + %enc.id"
}
]
}
]
},
{
"name" : "narrativeStatus",
"source" : [
{
"context" : "cdaText"
}
],
"target" : [
{
"context" : "fhirText",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "generated"
}
]
}
]
},
{
"name" : "narrativeText",
"source" : [
{
"context" : "cdaText",
"variable" : "t"
}
],
"target" : [
{
"context" : "fhirText",
"contextType" : "variable",
"element" : "div",
"transform" : "copy",
"parameter" : [
{
"valueId" : "t"
}
]
}
]
},
{
"name" : "code",
"source" : [
{
"context" : "src",
"element" : "code",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "observation",
"contextType" : "variable",
"element" : "code",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "statuscode",
"source" : [
{
"context" : "src",
"condition" : "observation.statusCode.exists().not()"
}
],
"rule" : [
{
"name" : "status",
"source" : [
{
"context" : "src"
}
],
"target" : [
{
"context" : "observation",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "final"
}
]
}
]
}
]
},
{
"name" : "reference",
"source" : [
{
"context" : "cdaText"
}
],
"target" : [
{
"context" : "observation",
"contextType" : "variable",
"element" : "note",
"variable" : "note"
}
],
"rule" : [
{
"name" : "reference",
"source" : [
{
"context" : "cdaText",
"variable" : "t"
}
],
"target" : [
{
"context" : "note",
"contextType" : "variable",
"element" : "text",
"transform" : "copy",
"parameter" : [
{
"valueId" : "t"
}
]
}
]
}
]
}
]
},
{
"name" : "component",
"source" : [
{
"context" : "src",
"element" : "component",
"variable" : "component"
}
],
"rule" : [
{
"name" : "componentSec",
"source" : [
{
"context" : "component",
"element" : "section",
"variable" : "section2"
}
],
"rule" : [
{
"name" : "sec2fhir",
"source" : [
{
"context" : "section2"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "section",
"variable" : "sec2"
}
],
"rule" : [
{
"name" : "code",
"source" : [
{
"context" : "section2",
"element" : "code",
"variable" : "vvv",
"condition" : "(code = '11329-0')"
}
],
"target" : [
{
"context" : "sec2",
"contextType" : "variable",
"element" : "code",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "title",
"source" : [
{
"context" : "section2",
"element" : "title",
"variable" : "t"
}
],
"target" : [
{
"context" : "sec2",
"contextType" : "variable",
"element" : "title",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "t.dataString"
}
]
}
]
},
{
"name" : "exist",
"source" : [
{
"context" : "src",
"condition" : "src.entry.exists()"
}
],
"rule" : [
{
"name" : "cdaText",
"source" : [
{
"context" : "section2",
"element" : "text",
"variable" : "cdaText"
}
],
"target" : [
{
"context" : "sec2",
"contextType" : "variable",
"element" : "text",
"variable" : "fhirText"
}
],
"rule" : [
{
"name" : "narrativeStatus",
"source" : [
{
"context" : "cdaText"
}
],
"target" : [
{
"context" : "fhirText",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "generated"
}
]
}
]
},
{
"name" : "narrativeText",
"source" : [
{
"context" : "cdaText",
"variable" : "t"
}
],
"target" : [
{
"context" : "fhirText",
"contextType" : "variable",
"element" : "div",
"transform" : "copy",
"parameter" : [
{
"valueId" : "t"
}
]
}
]
}
]
}
],
"documentation" : "section2.code -> sec2.code;"
},
{
"name" : "where",
"source" : [
{
"context" : "src",
"condition" : "src.entry.exists().not()"
}
],
"rule" : [
{
"name" : "cdaText",
"source" : [
{
"context" : "section2",
"element" : "text",
"variable" : "cdaText"
}
],
"target" : [
{
"context" : "bundle",
"contextType" : "variable",
"element" : "entry",
"variable" : "e1"
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "request",
"variable" : "request",
"transform" : "create",
"parameter" : [
{
"valueString" : "BackboneElement"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "method",
"transform" : "copy",
"parameter" : [
{
"valueString" : "POST"
}
]
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "resource",
"variable" : "condition",
"transform" : "create",
"parameter" : [
{
"valueString" : "Observation"
}
]
},
{
"context" : "condition",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid1",
"transform" : "uuid"
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "https://example/Observation/"
},
{
"valueId" : "uuid1"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "url",
"transform" : "copy",
"parameter" : [
{
"valueString" : "Observation"
}
]
},
{
"context" : "sec2",
"contextType" : "variable",
"element" : "entry",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Observation/' + %condition.id"
}
]
}
],
"rule" : [
{
"name" : "code",
"source" : [
{
"context" : "section2",
"element" : "code",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "condition",
"contextType" : "variable",
"element" : "code",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "statuscode",
"source" : [
{
"context" : "src",
"condition" : "condition.statusCode.exists().not()"
}
],
"rule" : [
{
"name" : "status",
"source" : [
{
"context" : "src"
}
],
"target" : [
{
"context" : "condition",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "final"
}
]
}
]
}
]
},
{
"name" : "reference",
"source" : [
{
"context" : "cdaText"
}
],
"target" : [
{
"context" : "condition",
"contextType" : "variable",
"element" : "note",
"variable" : "note"
}
],
"rule" : [
{
"name" : "reference",
"source" : [
{
"context" : "cdaText"
}
],
"target" : [
{
"context" : "condition",
"contextType" : "variable",
"element" : "subject",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Patient/' + %patient.id"
}
]
}
]
},
{
"name" : "reference",
"source" : [
{
"context" : "cdaText"
}
],
"target" : [
{
"context" : "condition",
"contextType" : "variable",
"element" : "encounter",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Encounter/' + %enc.id"
}
]
}
]
},
{
"name" : "reference",
"source" : [
{
"context" : "cdaText",
"variable" : "t"
}
],
"target" : [
{
"context" : "note",
"contextType" : "variable",
"element" : "text",
"transform" : "copy",
"parameter" : [
{
"valueId" : "t"
}
]
}
]
}
]
}
]
}
]
},
{
"name" : "subsection1",
"source" : [
{
"context" : "section2",
"element" : "entry",
"variable" : "entry1"
}
],
"rule" : [
{
"name" : "entry",
"source" : [
{
"context" : "entry1",
"element" : "observation",
"variable" : "obs"
}
],
"rule" : [
{
"name" : "observationcondition",
"source" : [
{
"context" : "obs",
"element" : "code",
"condition" : "(code = '75326-9')"
}
],
"rule" : [
{
"name" : "whereEntryPatologicaProssima",
"source" : [
{
"context" : "obs"
}
],
"target" : [
{
"context" : "bundle",
"contextType" : "variable",
"element" : "entry",
"variable" : "e1"
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "request",
"variable" : "request",
"transform" : "create",
"parameter" : [
{
"valueString" : "BackboneElement"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "method",
"transform" : "copy",
"parameter" : [
{
"valueString" : "POST"
}
]
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "resource",
"variable" : "condition",
"transform" : "create",
"parameter" : [
{
"valueString" : "Condition"
}
]
},
{
"context" : "condition",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid1",
"transform" : "uuid"
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "https://example/Condition/"
},
{
"valueId" : "uuid1"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "url",
"transform" : "copy",
"parameter" : [
{
"valueString" : "Condition"
}
]
},
{
"context" : "sec2",
"contextType" : "variable",
"element" : "entry",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Condition/' + %condition.id"
}
]
}
],
"rule" : [
{
"name" : "code",
"source" : [
{
"context" : "obs",
"element" : "code",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "condition",
"contextType" : "variable",
"element" : "category",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "reference",
"source" : [
{
"context" : "obs"
}
],
"target" : [
{
"context" : "condition",
"contextType" : "variable",
"element" : "subject",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Patient/' + %patient.id"
}
]
}
]
},
{
"name" : "reference",
"source" : [
{
"context" : "obs"
}
],
"target" : [
{
"context" : "condition",
"contextType" : "variable",
"element" : "encounter",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Encounter/' + %enc.id"
}
]
}
]
},
{
"name" : "status",
"source" : [
{
"context" : "obs",
"element" : "statusCode",
"variable" : "status",
"condition" : "(code = 'completed')"
}
],
"target" : [
{
"context" : "condition",
"contextType" : "variable",
"element" : "verificationStatus",
"variable" : "status2"
}
],
"rule" : [
{
"name" : "st3",
"source" : [
{
"context" : "status"
}
],
"target" : [
{
"context" : "status2",
"contextType" : "variable",
"element" : "coding",
"variable" : "status3"
}
],
"rule" : [
{
"name" : "finald",
"source" : [
{
"context" : "status"
}
],
"target" : [
{
"context" : "status3",
"contextType" : "variable",
"element" : "code",
"transform" : "copy",
"parameter" : [
{
"valueString" : "confirmed"
}
]
}
]
},
{
"name" : "system",
"source" : [
{
"context" : "status"
}
],
"target" : [
{
"context" : "status3",
"contextType" : "variable",
"element" : "system",
"transform" : "copy",
"parameter" : [
{
"valueString" : "http://terminology.hl7.org/CodeSystem/condition-ver-status"
}
]
}
]
}
]
}
]
},
{
"name" : "effectivetime1",
"source" : [
{
"context" : "obs",
"element" : "effectiveTime",
"variable" : "effective1"
}
],
"rule" : [
{
"name" : "ef",
"source" : [
{
"context" : "effective1",
"condition" : "effective1.low.exists() or effective1.high.exists()"
}
],
"rule" : [
{
"name" : "onsetperiod",
"source" : [
{
"context" : "effective1"
}
],
"target" : [
{
"context" : "condition",
"contextType" : "variable",
"element" : "onset",
"variable" : "periodonset",
"transform" : "create",
"parameter" : [
{
"valueString" : "Period"
}
]
}
],
"dependent" : [
{
"name" : "IVLTSPeriod",
"variable" : [
"effective1",
"periodonset"
]
}
]
}
]
}
]
},
{
"name" : "Value",
"source" : [
{
"context" : "obs",
"type" : "CD",
"element" : "value",
"variable" : "val"
}
],
"rule" : [
{
"name" : "Ce",
"source" : [
{
"context" : "val"
}
],
"target" : [
{
"context" : "condition",
"contextType" : "variable",
"element" : "code",
"variable" : "ce",
"transform" : "create",
"parameter" : [
{
"valueString" : "CodeableConcept"
}
]
}
],
"rule" : [
{
"name" : "originalText",
"source" : [
{
"context" : "val",
"element" : "originalText",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "ce",
"contextType" : "variable",
"element" : "text",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "coding",
"source" : [
{
"context" : "val"
}
],
"target" : [
{
"context" : "ce",
"contextType" : "variable",
"element" : "coding",
"variable" : "coding"
}
],
"rule" : [
{
"name" : "code",
"source" : [
{
"context" : "val",
"element" : "code",
"variable" : "code"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "code",
"transform" : "cast",
"parameter" : [
{
"valueId" : "code"
},
{
"valueString" : "string"
}
]
}
]
},
{
"name" : "codeSystem",
"source" : [
{
"context" : "val",
"element" : "codeSystem",
"variable" : "system"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "system",
"transform" : "translate",
"parameter" : [
{
"valueId" : "system"
},
{
"valueString" : "http://hl7.org/fhir/ConceptMap/special-oid2uri"
},
{
"valueString" : "uri"
}
]
}
]
},
{
"name" : "displayName",
"source" : [
{
"context" : "val",
"element" : "displayName",
"variable" : "display"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "display",
"transform" : "cast",
"parameter" : [
{
"valueId" : "display"
},
{
"valueString" : "string"
}
]
}
]
}
]
}
]
}
]
},
{
"name" : "EntryRelationship1",
"source" : [
{
"context" : "obs",
"element" : "entryRelationship",
"variable" : "entriRel"
}
],
"rule" : [
{
"name" : "evidence",
"source" : [
{
"context" : "entriRel"
}
],
"target" : [
{
"context" : "condition",
"contextType" : "variable",
"element" : "evidence",
"variable" : "evidence",
"transform" : "create",
"parameter" : [
{
"valueString" : "BackboneElement"
}
]
}
],
"rule" : [
{
"name" : "Observation2",
"source" : [
{
"context" : "entriRel",
"element" : "observation",
"variable" : "observation2"
}
],
"rule" : [
{
"name" : "code",
"source" : [
{
"context" : "observation2",
"element" : "code",
"variable" : "code"
}
],
"rule" : [
{
"name" : "whereDecorsoClinico",
"source" : [
{
"context" : "code",
"element" : "code",
"condition" : "(code.code = '89261-2')"
}
],
"rule" : [
{
"name" : "obser",
"source" : [
{
"context" : "obs"
}
],
"target" : [
{
"context" : "bundle",
"contextType" : "variable",
"element" : "entry",
"variable" : "e1"
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "request",
"variable" : "request",
"transform" : "create",
"parameter" : [
{
"valueString" : "BackboneElement"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "method",
"transform" : "copy",
"parameter" : [
{
"valueString" : "POST"
}
]
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "resource",
"variable" : "observation",
"transform" : "create",
"parameter" : [
{
"valueString" : "Observation"
}
]
},
{
"context" : "observation",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid1",
"transform" : "uuid"
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "https://example/Observation/"
},
{
"valueId" : "uuid1"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "url",
"transform" : "copy",
"parameter" : [
{
"valueString" : "Observation"
}
]
}
],
"rule" : [
{
"name" : "ref",
"source" : [
{
"context" : "entriRel"
}
],
"target" : [
{
"context" : "evidence",
"contextType" : "variable",
"element" : "detail",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Observation/' + %observation.id"
}
]
}
]
},
{
"name" : "code",
"source" : [
{
"context" : "observation2",
"element" : "code",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "observation",
"contextType" : "variable",
"element" : "code",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "statuscode",
"source" : [
{
"context" : "observation2",
"condition" : "observation.statusCode.exists().not()"
}
],
"rule" : [
{
"name" : "status",
"source" : [
{
"context" : "observation2"
}
],
"target" : [
{
"context" : "observation",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "final"
}
]
}
]
}
]
},
{
"name" : "Annontation",
"source" : [
{
"context" : "observation2",
"element" : "text",
"variable" : "text"
}
],
"target" : [
{
"context" : "observation",
"contextType" : "variable",
"element" : "note",
"variable" : "note",
"transform" : "create",
"parameter" : [
{
"valueString" : "Annotation"
}
]
}
],
"rule" : [
{
"name" : "val",
"source" : [
{
"context" : "text",
"element" : "reference",
"variable" : "ref"
}
],
"target" : [
{
"context" : "note",
"contextType" : "variable",
"element" : "text",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "ref.value"
}
]
}
]
}
]
},
{
"name" : "reference",
"source" : [
{
"context" : "obs"
}
],
"target" : [
{
"context" : "observation",
"contextType" : "variable",
"element" : "subject",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Patient/' + %patient.id"
}
]
}
]
},
{
"name" : "reference",
"source" : [
{
"context" : "obs"
}
],
"target" : [
{
"context" : "observation",
"contextType" : "variable",
"element" : "encounter",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Encounter/' + %enc.id"
}
]
}
]
},
{
"name" : "statusCode",
"source" : [
{
"context" : "observation2",
"element" : "statusCode",
"variable" : "statusc",
"condition" : "(code = 'completed')"
}
],
"target" : [
{
"context" : "ob",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "final"
}
]
}
]
},
{
"name" : "statusCode",
"source" : [
{
"context" : "observation2",
"element" : "statusCode",
"variable" : "statusc",
"condition" : "(code = 'active')"
}
],
"target" : [
{
"context" : "ob",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "registered"
}
]
}
]
},
{
"name" : "statusCode",
"source" : [
{
"context" : "observation2",
"element" : "statusCode",
"variable" : "statusc",
"condition" : "(code = 'aborted')"
}
],
"target" : [
{
"context" : "ob",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "cancelled"
}
]
}
]
},
{
"name" : "statusCode",
"source" : [
{
"context" : "observation2",
"element" : "statusCode",
"variable" : "statusc",
"condition" : "(code = 'suspended')"
}
],
"target" : [
{
"context" : "ob",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "partial"
}
]
}
]
},
{
"name" : "value",
"source" : [
{
"context" : "observation2",
"type" : "INT",
"element" : "value",
"variable" : "int"
}
],
"target" : [
{
"context" : "ob",
"contextType" : "variable",
"element" : "value",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "int.value"
}
]
}
]
},
{
"name" : "boolean",
"source" : [
{
"context" : "observation2",
"type" : "BL",
"element" : "value",
"variable" : "boolean"
}
],
"target" : [
{
"context" : "ob",
"contextType" : "variable",
"element" : "value",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "boolean.value"
}
]
}
]
},
{
"name" : "val",
"source" : [
{
"context" : "observation2",
"type" : "CD",
"element" : "value",
"variable" : "val"
}
],
"rule" : [
{
"name" : "coding",
"source" : [
{
"context" : "val"
}
],
"target" : [
{
"context" : "ob",
"contextType" : "variable",
"element" : "value",
"variable" : "ce",
"transform" : "create",
"parameter" : [
{
"valueString" : "CodeableConcept"
}
]
}
],
"rule" : [
{
"name" : "originltext",
"source" : [
{
"context" : "val",
"element" : "originalText",
"variable" : "originalText"
}
],
"rule" : [
{
"name" : "reference",
"source" : [
{
"context" : "originalText",
"element" : "reference",
"variable" : "reference"
}
],
"target" : [
{
"context" : "ce",
"contextType" : "variable",
"element" : "text",
"transform" : "copy",
"parameter" : [
{
"valueId" : "reference"
}
]
}
]
}
]
},
{
"name" : "code",
"source" : [
{
"context" : "val"
}
],
"target" : [
{
"context" : "ce",
"contextType" : "variable",
"element" : "coding",
"variable" : "coding"
}
],
"rule" : [
{
"name" : "code",
"source" : [
{
"context" : "val",
"element" : "code",
"variable" : "code"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "code",
"transform" : "cast",
"parameter" : [
{
"valueId" : "code"
},
{
"valueString" : "string"
}
]
}
]
},
{
"name" : "codeSystem",
"source" : [
{
"context" : "val",
"element" : "codeSystem",
"variable" : "system"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "system",
"transform" : "translate",
"parameter" : [
{
"valueId" : "system"
},
{
"valueString" : "http://hl7.org/fhir/ConceptMap/special-oid2uri"
},
{
"valueString" : "uri"
}
]
}
]
},
{
"name" : "displayName",
"source" : [
{
"context" : "val",
"element" : "displayName",
"variable" : "display"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "display",
"transform" : "cast",
"parameter" : [
{
"valueId" : "display"
},
{
"valueString" : "string"
}
]
}
]
},
{
"name" : "codeSystemVersion",
"source" : [
{
"context" : "val",
"element" : "codeSystemVersion",
"variable" : "version"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "version",
"transform" : "cast",
"parameter" : [
{
"valueId" : "version"
},
{
"valueString" : "string"
}
]
}
]
}
]
},
{
"name" : "translation",
"source" : [
{
"context" : "val",
"element" : "translation",
"variable" : "translation"
}
],
"target" : [
{
"context" : "ce",
"contextType" : "variable",
"element" : "coding",
"variable" : "coding"
}
],
"rule" : [
{
"name" : "code",
"source" : [
{
"context" : "translation",
"element" : "code",
"variable" : "code"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "code",
"transform" : "cast",
"parameter" : [
{
"valueId" : "code"
},
{
"valueString" : "string"
}
]
}
]
},
{
"name" : "codeSystem",
"source" : [
{
"context" : "translation",
"element" : "codeSystem",
"variable" : "system"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "system",
"transform" : "translate",
"parameter" : [
{
"valueId" : "system"
},
{
"valueString" : "http://hl7.org/fhir/ConceptMap/special-oid2uri"
},
{
"valueString" : "uri"
}
]
}
]
},
{
"name" : "displayName",
"source" : [
{
"context" : "translation",
"element" : "displayName",
"variable" : "display"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "display",
"transform" : "cast",
"parameter" : [
{
"valueId" : "display"
},
{
"valueString" : "string"
}
]
}
]
},
{
"name" : "codeSystemVersion",
"source" : [
{
"context" : "translation",
"element" : "codeSystemVersion",
"variable" : "version"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "version",
"transform" : "cast",
"parameter" : [
{
"valueId" : "version"
},
{
"valueString" : "string"
}
]
}
]
},
{
"name" : "qualifier",
"source" : [
{
"context" : "translation",
"element" : "qualifier",
"variable" : "qualifier"
}
],
"rule" : [
{
"name" : "value",
"source" : [
{
"context" : "qualifier",
"element" : "value",
"variable" : "value"
}
],
"target" : [
{
"context" : "ce",
"contextType" : "variable",
"element" : "coding",
"variable" : "coding"
}
],
"rule" : [
{
"name" : "code",
"source" : [
{
"context" : "value",
"element" : "code",
"variable" : "code"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "code",
"transform" : "cast",
"parameter" : [
{
"valueId" : "code"
},
{
"valueString" : "string"
}
]
}
]
},
{
"name" : "codeSystem",
"source" : [
{
"context" : "value",
"element" : "codeSystem",
"variable" : "system"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "system",
"transform" : "translate",
"parameter" : [
{
"valueId" : "system"
},
{
"valueString" : "http://hl7.org/fhir/ConceptMap/special-oid2uri"
},
{
"valueString" : "uri"
}
]
}
]
},
{
"name" : "displayName",
"source" : [
{
"context" : "value",
"element" : "displayName",
"variable" : "display"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "display",
"transform" : "cast",
"parameter" : [
{
"valueId" : "display"
},
{
"valueString" : "string"
}
]
}
]
},
{
"name" : "codeSystemVersion",
"source" : [
{
"context" : "value",
"element" : "codeSystemVersion",
"variable" : "version"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "version",
"transform" : "cast",
"parameter" : [
{
"valueId" : "version"
},
{
"valueString" : "string"
}
]
}
]
}
]
}
]
}
]
}
]
}
]
},
{
"name" : "valueQuantity",
"source" : [
{
"context" : "observation2",
"type" : "PQ",
"element" : "value",
"variable" : "val"
}
],
"rule" : [
{
"name" : "quantity",
"source" : [
{
"context" : "val"
}
],
"target" : [
{
"context" : "ob",
"contextType" : "variable",
"element" : "value",
"variable" : "quantity",
"transform" : "create",
"parameter" : [
{
"valueString" : "Quantity"
}
]
}
],
"rule" : [
{
"name" : "value",
"source" : [
{
"context" : "val",
"element" : "value",
"variable" : "value"
}
],
"target" : [
{
"context" : "quantity",
"contextType" : "variable",
"element" : "value",
"transform" : "copy",
"parameter" : [
{
"valueId" : "value"
}
]
}
]
},
{
"name" : "unit",
"source" : [
{
"context" : "val",
"element" : "unit",
"variable" : "unit"
}
],
"target" : [
{
"context" : "quantity",
"contextType" : "variable",
"element" : "unit",
"transform" : "copy",
"parameter" : [
{
"valueId" : "unit"
}
]
}
]
}
]
}
]
},
{
"name" : "value",
"source" : [
{
"context" : "observation2",
"type" : "ST",
"element" : "value",
"variable" : "value"
}
],
"target" : [
{
"context" : "ob",
"contextType" : "variable",
"element" : "value",
"transform" : "create",
"parameter" : [
{
"valueString" : "string"
}
]
},
{
"context" : "ob",
"contextType" : "variable",
"element" : "value",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "value.dataString"
}
]
}
]
},
{
"name" : "Value",
"source" : [
{
"context" : "observation2",
"type" : "CE",
"element" : "value",
"variable" : "val"
}
],
"rule" : [
{
"name" : "Ce",
"source" : [
{
"context" : "val"
}
],
"target" : [
{
"context" : "observation",
"contextType" : "variable",
"element" : "value",
"variable" : "ce",
"transform" : "create",
"parameter" : [
{
"valueString" : "CodeableConcept"
}
]
}
],
"rule" : [
{
"name" : "originalText",
"source" : [
{
"context" : "val",
"element" : "originalText",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "ce",
"contextType" : "variable",
"element" : "text",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "coding",
"source" : [
{
"context" : "val"
}
],
"target" : [
{
"context" : "ce",
"contextType" : "variable",
"element" : "coding",
"variable" : "coding"
}
],
"rule" : [
{
"name" : "code",
"source" : [
{
"context" : "val",
"element" : "code",
"variable" : "code"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "code",
"transform" : "cast",
"parameter" : [
{
"valueId" : "code"
},
{
"valueString" : "string"
}
]
}
]
},
{
"name" : "codeSystem",
"source" : [
{
"context" : "val",
"element" : "codeSystem",
"variable" : "system"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "system",
"transform" : "translate",
"parameter" : [
{
"valueId" : "system"
},
{
"valueString" : "http://hl7.org/fhir/ConceptMap/special-oid2uri"
},
{
"valueString" : "uri"
}
]
}
]
},
{
"name" : "displayName",
"source" : [
{
"context" : "val",
"element" : "displayName",
"variable" : "display"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "display",
"transform" : "cast",
"parameter" : [
{
"valueId" : "display"
},
{
"valueString" : "string"
}
]
}
]
}
]
}
]
}
]
}
]
}
]
}
]
}
]
}
]
}
]
},
{
"name" : "entryrelationshipstatus",
"source" : [
{
"context" : "obs",
"element" : "entryRelationship",
"variable" : "entriRel"
}
],
"rule" : [
{
"name" : "observationstatus",
"source" : [
{
"context" : "entriRel",
"element" : "observation",
"variable" : "observation2"
}
],
"rule" : [
{
"name" : "codestatus",
"source" : [
{
"context" : "observation2",
"element" : "code",
"variable" : "code"
}
],
"rule" : [
{
"name" : "whereDecorsoClinico",
"source" : [
{
"context" : "code",
"element" : "code",
"condition" : "(code.code = '33999-4')"
}
],
"rule" : [
{
"name" : "code",
"source" : [
{
"context" : "observation2"
}
],
"target" : [
{
"context" : "condition",
"contextType" : "variable",
"element" : "clinicalStatus",
"variable" : "status",
"transform" : "create",
"parameter" : [
{
"valueString" : "CodeableConcept"
}
]
}
],
"rule" : [
{
"name" : "textstat",
"source" : [
{
"context" : "observation2",
"element" : "text",
"variable" : "text"
}
],
"rule" : [
{
"name" : "statref",
"source" : [
{
"context" : "text",
"element" : "reference",
"variable" : "refstat"
}
],
"target" : [
{
"context" : "status",
"contextType" : "variable",
"element" : "text",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "refstat.value"
}
]
}
]
}
]
},
{
"name" : "coding",
"source" : [
{
"context" : "observation2"
}
],
"target" : [
{
"context" : "status",
"contextType" : "variable",
"element" : "coding",
"variable" : "coding",
"transform" : "create",
"parameter" : [
{
"valueString" : "Coding"
}
]
}
],
"rule" : [
{
"name" : "value1",
"source" : [
{
"context" : "observation2",
"element" : "value",
"variable" : "value"
}
],
"rule" : [
{
"name" : "active",
"source" : [
{
"context" : "value",
"element" : "code",
"condition" : "(value.code = 'LA16666-2')"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "code",
"transform" : "copy",
"parameter" : [
{
"valueString" : "active"
}
]
}
]
},
{
"name" : "inactive",
"source" : [
{
"context" : "value",
"element" : "code",
"condition" : "(value.code = 'LA18632-2')"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "code",
"transform" : "copy",
"parameter" : [
{
"valueString" : "inactive"
}
]
}
]
},
{
"name" : "system",
"source" : [
{
"context" : "value",
"element" : "codeSystem",
"variable" : "system"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "system",
"transform" : "copy",
"parameter" : [
{
"valueString" : "http://terminology.hl7.org/CodeSystem/condition-clinical"
}
]
}
]
},
{
"name" : "displayName",
"source" : [
{
"context" : "value",
"element" : "displayName",
"variable" : "display"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "display",
"transform" : "cast",
"parameter" : [
{
"valueId" : "display"
},
{
"valueString" : "string"
}
]
}
]
}
]
}
]
}
]
}
]
}
]
}
]
}
]
}
]
}
],
"documentation" : "EntryRelationship per il Problem"
}
]
}
]
},
{
"name" : "esameObiettivo",
"source" : [
{
"context" : "section2",
"element" : "code",
"condition" : "(code = '29545-1')"
}
],
"dependent" : [
{
"name" : "ClinicalDocumentSottoSectionOBS",
"variable" : [
"section2",
"sec2",
"bundle",
"enc",
"patient"
]
}
],
"documentation" : "ESAME PBIETTIVO"
},
{
"name" : "TerapiaFarmacologicaAllIngresso",
"source" : [
{
"context" : "section2",
"element" : "code",
"condition" : "(code = '42346-7')"
}
],
"dependent" : [
{
"name" : "ClinicalDocumentSottoSectionMS",
"variable" : [
"section2",
"sec2",
"bundle",
"patient",
"enc"
]
}
],
"documentation" : "TETAPIA FARMACOLOGICA"
}
],
"documentation" : "ANAMNESI"
}
]
}
]
}
]
},
{
"name" : "ClinicalDocumentSectionDecorsoOspedaliero",
"typeMode" : "none",
"input" : [
{
"name" : "cda",
"type" : "ClinicalDocument",
"mode" : "source"
},
{
"name" : "src",
"type" : "Section",
"mode" : "source"
},
{
"name" : "patient",
"type" : "Patient",
"mode" : "target"
},
{
"name" : "tgt",
"mode" : "target"
},
{
"name" : "bundle",
"type" : "Bundle",
"mode" : "target"
},
{
"name" : "enc",
"type" : "Encounter",
"mode" : "target"
}
],
"rule" : [
{
"name" : "title",
"source" : [
{
"context" : "src",
"element" : "title",
"variable" : "t"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "title",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "t.dataString"
}
]
}
]
},
{
"name" : "code",
"source" : [
{
"context" : "src",
"element" : "code",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "code",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "cdaText",
"source" : [
{
"context" : "src",
"element" : "text",
"variable" : "cdaText"
}
],
"target" : [
{
"context" : "bundle",
"contextType" : "variable",
"element" : "entry",
"variable" : "e1"
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "request",
"variable" : "request",
"transform" : "create",
"parameter" : [
{
"valueString" : "BackboneElement"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "method",
"transform" : "copy",
"parameter" : [
{
"valueString" : "POST"
}
]
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "resource",
"variable" : "observation",
"transform" : "create",
"parameter" : [
{
"valueString" : "Observation"
}
]
},
{
"context" : "observation",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid1",
"transform" : "uuid"
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "https://example/Observation/"
},
{
"valueId" : "uuid1"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "url",
"transform" : "copy",
"parameter" : [
{
"valueString" : "Observation"
}
]
},
{
"context" : "tgt",
"contextType" : "variable",
"element" : "entry",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Observation/' + %observation.id"
}
]
},
{
"context" : "tgt",
"contextType" : "variable",
"element" : "text",
"variable" : "fhirText"
}
],
"rule" : [
{
"name" : "narrativeStatus",
"source" : [
{
"context" : "cdaText"
}
],
"target" : [
{
"context" : "fhirText",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "generated"
}
]
}
]
},
{
"name" : "narrativeText",
"source" : [
{
"context" : "cdaText",
"variable" : "t"
}
],
"target" : [
{
"context" : "fhirText",
"contextType" : "variable",
"element" : "div",
"transform" : "copy",
"parameter" : [
{
"valueId" : "t"
}
]
}
]
},
{
"name" : "code",
"source" : [
{
"context" : "src",
"element" : "code",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "observation",
"contextType" : "variable",
"element" : "code",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "statuscode",
"source" : [
{
"context" : "src",
"condition" : "observation.statusCode.exists().not()"
}
],
"rule" : [
{
"name" : "status",
"source" : [
{
"context" : "src"
}
],
"target" : [
{
"context" : "observation",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "final"
}
]
}
]
}
]
},
{
"name" : "reference",
"source" : [
{
"context" : "src"
}
],
"target" : [
{
"context" : "observation",
"contextType" : "variable",
"element" : "subject",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Patient/' + %patient.id"
}
]
}
]
},
{
"name" : "reference",
"source" : [
{
"context" : "src"
}
],
"target" : [
{
"context" : "observation",
"contextType" : "variable",
"element" : "encounter",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Encounter/' + %enc.id"
}
]
}
]
},
{
"name" : "reference",
"source" : [
{
"context" : "cdaText"
}
],
"target" : [
{
"context" : "observation",
"contextType" : "variable",
"element" : "note",
"variable" : "note"
}
],
"rule" : [
{
"name" : "reference",
"source" : [
{
"context" : "cdaText",
"variable" : "t"
}
],
"target" : [
{
"context" : "note",
"contextType" : "variable",
"element" : "text",
"transform" : "copy",
"parameter" : [
{
"valueId" : "t"
}
]
}
]
}
]
}
]
},
{
"name" : "2",
"source" : [
{
"context" : "src",
"element" : "component",
"variable" : "component"
}
],
"rule" : [
{
"name" : "1",
"source" : [
{
"context" : "component",
"element" : "section",
"variable" : "section2"
}
],
"rule" : [
{
"name" : "Decorso",
"source" : [
{
"context" : "src"
}
],
"dependent" : [
{
"name" : "ClinicalDocumentSottoSectionOBS",
"variable" : [
"section2",
"tgt",
"bundle",
"enc",
"patient"
]
}
]
}
]
}
]
}
]
},
{
"name" : "ClinicalDocumentSectionComplicanze",
"typeMode" : "none",
"input" : [
{
"name" : "cda",
"type" : "ClinicalDocument",
"mode" : "source"
},
{
"name" : "src",
"type" : "Section",
"mode" : "source"
},
{
"name" : "patient",
"type" : "Patient",
"mode" : "target"
},
{
"name" : "tgt",
"mode" : "target"
},
{
"name" : "bundle",
"type" : "Bundle",
"mode" : "target"
},
{
"name" : "enc",
"type" : "Encounter",
"mode" : "target"
}
],
"rule" : [
{
"name" : "title",
"source" : [
{
"context" : "src",
"element" : "title",
"variable" : "t"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "title",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "t.dataString"
}
]
}
]
},
{
"name" : "code",
"source" : [
{
"context" : "src",
"element" : "code",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "code",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "exist",
"source" : [
{
"context" : "src",
"condition" : "src.entry.exists()"
}
],
"rule" : [
{
"name" : "cdaText",
"source" : [
{
"context" : "src",
"element" : "text",
"variable" : "cdaText"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "text",
"variable" : "fhirText"
}
],
"rule" : [
{
"name" : "narrativeStatus",
"source" : [
{
"context" : "cdaText"
}
],
"target" : [
{
"context" : "fhirText",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "generated"
}
]
}
]
},
{
"name" : "narrativeText",
"source" : [
{
"context" : "cdaText",
"variable" : "t"
}
],
"target" : [
{
"context" : "fhirText",
"contextType" : "variable",
"element" : "div",
"transform" : "copy",
"parameter" : [
{
"valueId" : "t"
}
]
}
]
}
]
}
]
},
{
"name" : "where",
"source" : [
{
"context" : "src",
"condition" : "src.entry.exists().not()"
}
],
"rule" : [
{
"name" : "cdaText",
"source" : [
{
"context" : "src",
"element" : "text",
"variable" : "cdaText"
}
],
"target" : [
{
"context" : "bundle",
"contextType" : "variable",
"element" : "entry",
"variable" : "e1"
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "request",
"variable" : "request",
"transform" : "create",
"parameter" : [
{
"valueString" : "BackboneElement"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "method",
"transform" : "copy",
"parameter" : [
{
"valueString" : "POST"
}
]
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "resource",
"variable" : "observation",
"transform" : "create",
"parameter" : [
{
"valueString" : "Observation"
}
]
},
{
"context" : "observation",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid1",
"transform" : "uuid"
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "https://example/Observation/"
},
{
"valueId" : "uuid1"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "url",
"transform" : "copy",
"parameter" : [
{
"valueString" : "Observation"
}
]
},
{
"context" : "tgt",
"contextType" : "variable",
"element" : "entry",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Observation/' + %observation.id"
}
]
}
],
"rule" : [
{
"name" : "reference",
"source" : [
{
"context" : "src"
}
],
"target" : [
{
"context" : "observation",
"contextType" : "variable",
"element" : "subject",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Patient/' + %patient.id"
}
]
}
]
},
{
"name" : "reference",
"source" : [
{
"context" : "src"
}
],
"target" : [
{
"context" : "observation",
"contextType" : "variable",
"element" : "encounter",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Encounter/' + %enc.id"
}
]
}
]
},
{
"name" : "code",
"source" : [
{
"context" : "src",
"element" : "code",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "observation",
"contextType" : "variable",
"element" : "code",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "statuscode",
"source" : [
{
"context" : "src",
"condition" : "observation.statusCode.exists().not()"
}
],
"rule" : [
{
"name" : "status",
"source" : [
{
"context" : "src"
}
],
"target" : [
{
"context" : "observation",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "final"
}
]
}
]
}
]
},
{
"name" : "reference",
"source" : [
{
"context" : "cdaText"
}
],
"target" : [
{
"context" : "observation",
"contextType" : "variable",
"element" : "note",
"variable" : "note"
}
],
"rule" : [
{
"name" : "reference",
"source" : [
{
"context" : "cdaText",
"variable" : "t"
}
],
"target" : [
{
"context" : "note",
"contextType" : "variable",
"element" : "text",
"transform" : "copy",
"parameter" : [
{
"valueId" : "t"
}
]
}
]
}
]
}
]
}
]
},
{
"name" : "entry",
"source" : [
{
"context" : "src",
"element" : "entry",
"variable" : "entry1"
}
],
"target" : [
{
"context" : "bundle",
"contextType" : "variable",
"element" : "entry",
"variable" : "e1"
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "request",
"variable" : "request",
"transform" : "create",
"parameter" : [
{
"valueString" : "BackboneElement"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "method",
"transform" : "copy",
"parameter" : [
{
"valueString" : "POST"
}
]
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "resource",
"variable" : "observation",
"transform" : "create",
"parameter" : [
{
"valueString" : "Observation"
}
]
},
{
"context" : "observation",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid1",
"transform" : "uuid"
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "https://example/Observation/"
},
{
"valueId" : "uuid1"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "url",
"transform" : "copy",
"parameter" : [
{
"valueString" : "Observation"
}
]
},
{
"context" : "tgt",
"contextType" : "variable",
"element" : "entry",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Observation/' + %observation.id"
}
]
}
],
"rule" : [
{
"name" : "act",
"source" : [
{
"context" : "entry1",
"element" : "observation",
"variable" : "obs"
}
],
"dependent" : [
{
"name" : "Observation",
"variable" : [
"obs",
"patient",
"enc",
"observation",
"bundle"
]
}
]
}
]
}
]
},
{
"name" : "ClinicalDocumentSectionRiscontri",
"typeMode" : "none",
"input" : [
{
"name" : "cda",
"type" : "ClinicalDocument",
"mode" : "source"
},
{
"name" : "src",
"type" : "Section",
"mode" : "source"
},
{
"name" : "patient",
"type" : "Patient",
"mode" : "target"
},
{
"name" : "tgt",
"mode" : "target"
},
{
"name" : "bundle",
"type" : "Bundle",
"mode" : "target"
},
{
"name" : "enc",
"type" : "Encounter",
"mode" : "target"
}
],
"rule" : [
{
"name" : "title",
"source" : [
{
"context" : "src",
"element" : "title",
"variable" : "t"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "title",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "t.dataString"
}
]
}
]
},
{
"name" : "code",
"source" : [
{
"context" : "src",
"element" : "code",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "code",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "cdaText",
"source" : [
{
"context" : "src",
"element" : "text",
"variable" : "cdaText"
}
],
"target" : [
{
"context" : "bundle",
"contextType" : "variable",
"element" : "entry",
"variable" : "e1"
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "request",
"variable" : "request",
"transform" : "create",
"parameter" : [
{
"valueString" : "BackboneElement"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "method",
"transform" : "copy",
"parameter" : [
{
"valueString" : "POST"
}
]
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "resource",
"variable" : "observation",
"transform" : "create",
"parameter" : [
{
"valueString" : "Observation"
}
]
},
{
"context" : "observation",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid1",
"transform" : "uuid"
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "https://example/Observation/"
},
{
"valueId" : "uuid1"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "url",
"transform" : "copy",
"parameter" : [
{
"valueString" : "Observation"
}
]
},
{
"context" : "tgt",
"contextType" : "variable",
"element" : "entry",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Observation/' + %observation.id"
}
]
},
{
"context" : "tgt",
"contextType" : "variable",
"element" : "text",
"variable" : "fhirText"
}
],
"rule" : [
{
"name" : "narrativeStatus",
"source" : [
{
"context" : "cdaText"
}
],
"target" : [
{
"context" : "fhirText",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "generated"
}
]
}
]
},
{
"name" : "narrativeText",
"source" : [
{
"context" : "cdaText",
"variable" : "t"
}
],
"target" : [
{
"context" : "fhirText",
"contextType" : "variable",
"element" : "div",
"transform" : "copy",
"parameter" : [
{
"valueId" : "t"
}
]
}
]
},
{
"name" : "code",
"source" : [
{
"context" : "src",
"element" : "code",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "observation",
"contextType" : "variable",
"element" : "code",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "statuscode",
"source" : [
{
"context" : "src",
"condition" : "observation.statusCode.exists().not()"
}
],
"rule" : [
{
"name" : "status",
"source" : [
{
"context" : "src"
}
],
"target" : [
{
"context" : "observation",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "final"
}
]
}
]
}
]
},
{
"name" : "reference",
"source" : [
{
"context" : "src"
}
],
"target" : [
{
"context" : "observation",
"contextType" : "variable",
"element" : "subject",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Patient/' + %patient.id"
}
]
}
]
},
{
"name" : "reference",
"source" : [
{
"context" : "src"
}
],
"target" : [
{
"context" : "observation",
"contextType" : "variable",
"element" : "encounter",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Encounter/' + %enc.id"
}
]
}
]
},
{
"name" : "reference",
"source" : [
{
"context" : "cdaText"
}
],
"target" : [
{
"context" : "observation",
"contextType" : "variable",
"element" : "note",
"variable" : "note"
}
],
"rule" : [
{
"name" : "reference",
"source" : [
{
"context" : "cdaText",
"variable" : "t"
}
],
"target" : [
{
"context" : "note",
"contextType" : "variable",
"element" : "text",
"transform" : "copy",
"parameter" : [
{
"valueId" : "t"
}
]
}
]
}
]
}
]
},
{
"name" : "2",
"source" : [
{
"context" : "src",
"element" : "component",
"variable" : "component"
}
],
"rule" : [
{
"name" : "1",
"source" : [
{
"context" : "component",
"element" : "section",
"variable" : "section2"
}
],
"rule" : [
{
"name" : "Decorso",
"source" : [
{
"context" : "src"
}
],
"dependent" : [
{
"name" : "ClinicalDocumentSottoSectionOBS",
"variable" : [
"section2",
"tgt",
"bundle",
"enc",
"patient"
]
}
]
}
]
}
]
}
]
},
{
"name" : "ClinicalDocumentSectionConsulenza",
"typeMode" : "none",
"input" : [
{
"name" : "cda",
"type" : "ClinicalDocument",
"mode" : "source"
},
{
"name" : "src",
"type" : "Section",
"mode" : "source"
},
{
"name" : "patient",
"type" : "Patient",
"mode" : "target"
},
{
"name" : "tgt",
"mode" : "target"
},
{
"name" : "bundle",
"type" : "Bundle",
"mode" : "target"
},
{
"name" : "enc",
"type" : "Encounter",
"mode" : "target"
}
],
"rule" : [
{
"name" : "title",
"source" : [
{
"context" : "src",
"element" : "title",
"variable" : "t"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "title",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "t.dataString"
}
]
}
]
},
{
"name" : "code",
"source" : [
{
"context" : "src",
"element" : "code",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "code",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "exist",
"source" : [
{
"context" : "src",
"condition" : "src.entry.exists()"
}
],
"rule" : [
{
"name" : "cdaText",
"source" : [
{
"context" : "src",
"element" : "text",
"variable" : "cdaText"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "text",
"variable" : "fhirText"
}
],
"rule" : [
{
"name" : "narrativeStatus",
"source" : [
{
"context" : "cdaText"
}
],
"target" : [
{
"context" : "fhirText",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "generated"
}
]
}
]
},
{
"name" : "narrativeText",
"source" : [
{
"context" : "cdaText",
"variable" : "t"
}
],
"target" : [
{
"context" : "fhirText",
"contextType" : "variable",
"element" : "div",
"transform" : "copy",
"parameter" : [
{
"valueId" : "t"
}
]
}
]
}
]
}
]
},
{
"name" : "where",
"source" : [
{
"context" : "src",
"condition" : "src.entry.exists().not()"
}
],
"rule" : [
{
"name" : "cdaText",
"source" : [
{
"context" : "src",
"element" : "text",
"variable" : "cdaText"
}
],
"target" : [
{
"context" : "bundle",
"contextType" : "variable",
"element" : "entry",
"variable" : "e1"
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "request",
"variable" : "request",
"transform" : "create",
"parameter" : [
{
"valueString" : "BackboneElement"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "method",
"transform" : "copy",
"parameter" : [
{
"valueString" : "POST"
}
]
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "resource",
"variable" : "observation",
"transform" : "create",
"parameter" : [
{
"valueString" : "Observation"
}
]
},
{
"context" : "observation",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid1",
"transform" : "uuid"
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "https://example/Observation/"
},
{
"valueId" : "uuid1"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "url",
"transform" : "copy",
"parameter" : [
{
"valueString" : "Observation"
}
]
},
{
"context" : "tgt",
"contextType" : "variable",
"element" : "entry",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Observation/' + %observation.id"
}
]
}
],
"rule" : [
{
"name" : "reference",
"source" : [
{
"context" : "src"
}
],
"target" : [
{
"context" : "observation",
"contextType" : "variable",
"element" : "subject",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Patient/' + %patient.id"
}
]
}
]
},
{
"name" : "reference",
"source" : [
{
"context" : "src"
}
],
"target" : [
{
"context" : "observation",
"contextType" : "variable",
"element" : "encounter",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Encounter/' + %enc.id"
}
]
}
]
},
{
"name" : "code",
"source" : [
{
"context" : "src",
"element" : "code",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "observation",
"contextType" : "variable",
"element" : "code",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "statuscode",
"source" : [
{
"context" : "src",
"condition" : "observation.statusCode.exists().not()"
}
],
"rule" : [
{
"name" : "status",
"source" : [
{
"context" : "src"
}
],
"target" : [
{
"context" : "observation",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "final"
}
]
}
]
}
]
},
{
"name" : "reference",
"source" : [
{
"context" : "cdaText"
}
],
"target" : [
{
"context" : "observation",
"contextType" : "variable",
"element" : "note",
"variable" : "note"
}
],
"rule" : [
{
"name" : "reference",
"source" : [
{
"context" : "cdaText",
"variable" : "t"
}
],
"target" : [
{
"context" : "note",
"contextType" : "variable",
"element" : "text",
"transform" : "copy",
"parameter" : [
{
"valueId" : "t"
}
]
}
]
}
]
}
]
}
]
},
{
"name" : "entry",
"source" : [
{
"context" : "src",
"element" : "entry",
"variable" : "entry1"
}
],
"target" : [
{
"context" : "bundle",
"contextType" : "variable",
"element" : "entry",
"variable" : "e1"
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "request",
"variable" : "request",
"transform" : "create",
"parameter" : [
{
"valueString" : "BackboneElement"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "method",
"transform" : "copy",
"parameter" : [
{
"valueString" : "POST"
}
]
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "resource",
"variable" : "observation",
"transform" : "create",
"parameter" : [
{
"valueString" : "Observation"
}
]
},
{
"context" : "observation",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid1",
"transform" : "uuid"
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "https://example/Observation/"
},
{
"valueId" : "uuid1"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "url",
"transform" : "copy",
"parameter" : [
{
"valueString" : "Observation"
}
]
},
{
"context" : "tgt",
"contextType" : "variable",
"element" : "entry",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Observation/' + %observation.id"
}
]
}
],
"rule" : [
{
"name" : "act",
"source" : [
{
"context" : "entry1",
"element" : "observation",
"variable" : "obs"
}
],
"dependent" : [
{
"name" : "ObservationConsulenza",
"variable" : [
"obs",
"patient",
"enc",
"observation",
"bundle"
]
}
]
}
]
}
]
},
{
"name" : "ClinicalDocumentSectionEsamiEseguitiRicovero",
"typeMode" : "none",
"input" : [
{
"name" : "cda",
"type" : "ClinicalDocument",
"mode" : "source"
},
{
"name" : "src",
"type" : "Section",
"mode" : "source"
},
{
"name" : "patient",
"type" : "Patient",
"mode" : "target"
},
{
"name" : "tgt",
"mode" : "target"
},
{
"name" : "bundle",
"type" : "Bundle",
"mode" : "target"
},
{
"name" : "enc",
"type" : "Encounter",
"mode" : "target"
}
],
"rule" : [
{
"name" : "title",
"source" : [
{
"context" : "src",
"element" : "title",
"variable" : "t"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "title",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "t.dataString"
}
]
}
]
},
{
"name" : "code",
"source" : [
{
"context" : "src",
"element" : "code",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "code",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "exists",
"source" : [
{
"context" : "src",
"condition" : "src.entry.exists()"
}
],
"rule" : [
{
"name" : "cdaText",
"source" : [
{
"context" : "src",
"element" : "text",
"variable" : "cdaText"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "text",
"variable" : "fhirText"
}
],
"rule" : [
{
"name" : "narrativeStatus",
"source" : [
{
"context" : "cdaText"
}
],
"target" : [
{
"context" : "fhirText",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "generated"
}
]
}
]
},
{
"name" : "narrativeText",
"source" : [
{
"context" : "cdaText",
"variable" : "t"
}
],
"target" : [
{
"context" : "fhirText",
"contextType" : "variable",
"element" : "div",
"transform" : "copy",
"parameter" : [
{
"valueId" : "t"
}
]
}
]
}
]
}
]
},
{
"name" : "where",
"source" : [
{
"context" : "src",
"condition" : "src.entry.exists().not()"
}
],
"rule" : [
{
"name" : "cdaText",
"source" : [
{
"context" : "src",
"element" : "text",
"variable" : "cdaText"
}
],
"target" : [
{
"context" : "bundle",
"contextType" : "variable",
"element" : "entry",
"variable" : "e1"
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "request",
"variable" : "request",
"transform" : "create",
"parameter" : [
{
"valueString" : "BackboneElement"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "method",
"transform" : "copy",
"parameter" : [
{
"valueString" : "POST"
}
]
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "resource",
"variable" : "observation",
"transform" : "create",
"parameter" : [
{
"valueString" : "Observation"
}
]
},
{
"context" : "observation",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid1",
"transform" : "uuid"
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "https://example/Observation/"
},
{
"valueId" : "uuid1"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "url",
"transform" : "copy",
"parameter" : [
{
"valueString" : "Observation"
}
]
},
{
"context" : "tgt",
"contextType" : "variable",
"element" : "entry",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Observation/' + %observation.id"
}
]
}
],
"rule" : [
{
"name" : "reference",
"source" : [
{
"context" : "src"
}
],
"target" : [
{
"context" : "observation",
"contextType" : "variable",
"element" : "subject",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Patient/' + %patient.id"
}
]
}
]
},
{
"name" : "reference",
"source" : [
{
"context" : "src"
}
],
"target" : [
{
"context" : "observation",
"contextType" : "variable",
"element" : "encounter",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Encounter/' + %enc.id"
}
]
}
]
},
{
"name" : "code",
"source" : [
{
"context" : "src",
"element" : "code",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "observation",
"contextType" : "variable",
"element" : "code",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "statuscode",
"source" : [
{
"context" : "src",
"condition" : "observation.statusCode.exists().not()"
}
],
"rule" : [
{
"name" : "status",
"source" : [
{
"context" : "src"
}
],
"target" : [
{
"context" : "observation",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "final"
}
]
}
]
}
]
},
{
"name" : "reference",
"source" : [
{
"context" : "cdaText"
}
],
"target" : [
{
"context" : "observation",
"contextType" : "variable",
"element" : "note",
"variable" : "note"
}
],
"rule" : [
{
"name" : "reference",
"source" : [
{
"context" : "cdaText",
"variable" : "t"
}
],
"target" : [
{
"context" : "note",
"contextType" : "variable",
"element" : "text",
"transform" : "copy",
"parameter" : [
{
"valueId" : "t"
}
]
}
]
}
]
}
]
}
]
},
{
"name" : "entry",
"source" : [
{
"context" : "src",
"element" : "entry",
"variable" : "entry1"
}
],
"target" : [
{
"context" : "bundle",
"contextType" : "variable",
"element" : "entry",
"variable" : "e1"
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "request",
"variable" : "request",
"transform" : "create",
"parameter" : [
{
"valueString" : "BackboneElement"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "method",
"transform" : "copy",
"parameter" : [
{
"valueString" : "POST"
}
]
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "resource",
"variable" : "observation",
"transform" : "create",
"parameter" : [
{
"valueString" : "Observation"
}
]
},
{
"context" : "observation",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid1",
"transform" : "uuid"
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "https://example/Observation/"
},
{
"valueId" : "uuid1"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "url",
"transform" : "copy",
"parameter" : [
{
"valueString" : "Observation"
}
]
},
{
"context" : "tgt",
"contextType" : "variable",
"element" : "entry",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Observation/' + %observation.id"
}
]
}
],
"rule" : [
{
"name" : "act",
"source" : [
{
"context" : "entry1",
"element" : "observation",
"variable" : "obs"
}
],
"dependent" : [
{
"name" : "ObservationEsamiDuranteRicovero",
"variable" : [
"obs",
"patient",
"enc",
"observation",
"bundle"
]
}
]
}
]
}
]
},
{
"name" : "ClinicalDocumentSectionProcedureEseguiteRicovero",
"typeMode" : "none",
"input" : [
{
"name" : "cda",
"type" : "ClinicalDocument",
"mode" : "source"
},
{
"name" : "src",
"type" : "Section",
"mode" : "source"
},
{
"name" : "patient",
"type" : "Patient",
"mode" : "target"
},
{
"name" : "tgt",
"mode" : "target"
},
{
"name" : "bundle",
"type" : "Bundle",
"mode" : "target"
},
{
"name" : "enc",
"type" : "Encounter",
"mode" : "target"
}
],
"rule" : [
{
"name" : "title",
"source" : [
{
"context" : "src",
"element" : "title",
"variable" : "t"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "title",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "t.dataString"
}
]
}
]
},
{
"name" : "code",
"source" : [
{
"context" : "src",
"element" : "code",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "code",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "exists",
"source" : [
{
"context" : "src",
"condition" : "src.entry.exists()"
}
],
"rule" : [
{
"name" : "cdaText",
"source" : [
{
"context" : "src",
"element" : "text",
"variable" : "cdaText"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "text",
"variable" : "fhirText"
}
],
"rule" : [
{
"name" : "narrativeStatus",
"source" : [
{
"context" : "cdaText"
}
],
"target" : [
{
"context" : "fhirText",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "generated"
}
]
}
]
},
{
"name" : "narrativeText",
"source" : [
{
"context" : "cdaText",
"variable" : "t"
}
],
"target" : [
{
"context" : "fhirText",
"contextType" : "variable",
"element" : "div",
"transform" : "copy",
"parameter" : [
{
"valueId" : "t"
}
]
}
]
}
]
}
]
},
{
"name" : "where",
"source" : [
{
"context" : "src",
"condition" : "src.entry.exists().not()"
}
],
"rule" : [
{
"name" : "cdaText",
"source" : [
{
"context" : "src",
"element" : "text",
"variable" : "cdaText"
}
],
"target" : [
{
"context" : "bundle",
"contextType" : "variable",
"element" : "entry",
"variable" : "e1"
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "request",
"variable" : "request",
"transform" : "create",
"parameter" : [
{
"valueString" : "BackboneElement"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "method",
"transform" : "copy",
"parameter" : [
{
"valueString" : "POST"
}
]
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "resource",
"variable" : "procedure",
"transform" : "create",
"parameter" : [
{
"valueString" : "Procedure"
}
]
},
{
"context" : "procedure",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid1",
"transform" : "uuid"
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "https://example/Procedure/"
},
{
"valueId" : "uuid1"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "url",
"transform" : "copy",
"parameter" : [
{
"valueString" : "Procedure"
}
]
},
{
"context" : "tgt",
"contextType" : "variable",
"element" : "entry",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Procedure/' + %procedure.id"
}
]
}
],
"rule" : [
{
"name" : "reference",
"source" : [
{
"context" : "src"
}
],
"target" : [
{
"context" : "procedure",
"contextType" : "variable",
"element" : "subject",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Patient/' + %patient.id"
}
]
}
]
},
{
"name" : "reference",
"source" : [
{
"context" : "src"
}
],
"target" : [
{
"context" : "procedure",
"contextType" : "variable",
"element" : "encounter",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Encounter/' + %enc.id"
}
]
}
]
},
{
"name" : "statuscode",
"source" : [
{
"context" : "src"
}
],
"target" : [
{
"context" : "procedure",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "unknown"
}
]
}
]
},
{
"name" : "reference",
"source" : [
{
"context" : "cdaText"
}
],
"target" : [
{
"context" : "procedure",
"contextType" : "variable",
"element" : "note",
"variable" : "note"
}
],
"rule" : [
{
"name" : "reference",
"source" : [
{
"context" : "cdaText",
"variable" : "t"
}
],
"target" : [
{
"context" : "note",
"contextType" : "variable",
"element" : "text",
"transform" : "copy",
"parameter" : [
{
"valueId" : "t"
}
]
}
]
}
]
}
]
}
]
},
{
"name" : "Entry",
"source" : [
{
"context" : "src",
"element" : "entry",
"variable" : "entry1"
}
],
"target" : [
{
"context" : "bundle",
"contextType" : "variable",
"element" : "entry",
"variable" : "e1"
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "request",
"variable" : "request",
"transform" : "create",
"parameter" : [
{
"valueString" : "BackboneElement"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "method",
"transform" : "copy",
"parameter" : [
{
"valueString" : "POST"
}
]
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "resource",
"variable" : "procedure",
"transform" : "create",
"parameter" : [
{
"valueString" : "Procedure"
}
]
},
{
"context" : "procedure",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid1",
"transform" : "uuid"
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "https://example/Procedure/"
},
{
"valueId" : "uuid1"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "url",
"transform" : "copy",
"parameter" : [
{
"valueString" : "Procedure"
}
]
},
{
"context" : "tgt",
"contextType" : "variable",
"element" : "entry",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Procedure/' + %procedure.id"
}
]
}
],
"rule" : [
{
"name" : "reference",
"source" : [
{
"context" : "src"
}
],
"target" : [
{
"context" : "procedure",
"contextType" : "variable",
"element" : "subject",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Patient/' + %patient.id"
}
]
}
]
},
{
"name" : "reference",
"source" : [
{
"context" : "src"
}
],
"target" : [
{
"context" : "procedure",
"contextType" : "variable",
"element" : "encounter",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Encounter/' + %enc.id"
}
]
}
]
},
{
"name" : "Procedure",
"source" : [
{
"context" : "entry1",
"element" : "procedure",
"variable" : "proceduresrc"
}
],
"rule" : [
{
"name" : "code",
"source" : [
{
"context" : "proceduresrc",
"element" : "code",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "procedure",
"contextType" : "variable",
"element" : "code",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "text",
"source" : [
{
"context" : "proceduresrc",
"element" : "text",
"variable" : "txt"
}
],
"target" : [
{
"context" : "procedure",
"contextType" : "variable",
"element" : "note",
"variable" : "note"
}
],
"rule" : [
{
"name" : "reference",
"source" : [
{
"context" : "txt",
"element" : "reference",
"variable" : "ref"
}
],
"target" : [
{
"context" : "note",
"contextType" : "variable",
"element" : "text",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "ref.value"
}
]
}
]
}
]
},
{
"name" : "status",
"source" : [
{
"context" : "proceduresrc",
"condition" : "proc.statusCode.exists().not()"
}
],
"rule" : [
{
"name" : "statuscode",
"source" : [
{
"context" : "proceduresrc"
}
],
"target" : [
{
"context" : "procedure",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "unknown"
}
]
}
]
}
]
},
{
"name" : "statusCode",
"source" : [
{
"context" : "proceduresrc",
"element" : "statusCode",
"variable" : "statusc",
"condition" : "(code = 'completed')"
}
],
"target" : [
{
"context" : "procedure",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "completed"
}
]
}
]
},
{
"name" : "statusCode",
"source" : [
{
"context" : "proceduresrc",
"element" : "statusCode",
"variable" : "statusc",
"condition" : "(code = 'active')"
}
],
"target" : [
{
"context" : "procedure",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "in-progress"
}
]
}
]
},
{
"name" : "statusCode",
"source" : [
{
"context" : "proceduresrc",
"element" : "statusCode",
"variable" : "statusc",
"condition" : "(code = 'aborted')"
}
],
"target" : [
{
"context" : "procedure",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "stopped"
}
]
}
]
},
{
"name" : "statusCode",
"source" : [
{
"context" : "proceduresrc",
"element" : "statusCode",
"variable" : "statusc",
"condition" : "(code = 'suspended')"
}
],
"target" : [
{
"context" : "procedure",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "on-hold"
}
]
}
]
},
{
"name" : "statusCode",
"source" : [
{
"context" : "proceduresrc",
"element" : "statusCode",
"variable" : "statusc",
"condition" : "(code = 'cancelled')"
}
],
"target" : [
{
"context" : "procedure",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "not-done"
}
]
}
]
},
{
"name" : "statusCode",
"source" : [
{
"context" : "proceduresrc",
"element" : "statusCode",
"variable" : "statusc",
"condition" : "(code = 'held')"
}
],
"target" : [
{
"context" : "procedure",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "on-hold"
}
]
}
]
},
{
"name" : "statusCode",
"source" : [
{
"context" : "proceduresrc",
"element" : "statusCode",
"variable" : "statusc",
"condition" : "(code = 'new')"
}
],
"target" : [
{
"context" : "procedure",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "preparation"
}
]
}
]
},
{
"name" : "statusCode",
"source" : [
{
"context" : "proceduresrc",
"element" : "statusCode",
"variable" : "statusc",
"condition" : "(code = 'obsolete')"
}
],
"target" : [
{
"context" : "procedure",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "entered-in-error"
}
]
}
]
},
{
"name" : "statusCode",
"source" : [
{
"context" : "proceduresrc",
"element" : "statusCode",
"variable" : "statusc",
"condition" : "(code = 'nullified')"
}
],
"target" : [
{
"context" : "procedure",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "unknown"
}
]
}
]
},
{
"name" : "effectiveTime",
"source" : [
{
"context" : "proceduresrc",
"element" : "effectiveTime",
"variable" : "efft"
}
],
"target" : [
{
"context" : "procedure",
"contextType" : "variable",
"element" : "performed",
"variable" : "period",
"transform" : "create",
"parameter" : [
{
"valueString" : "Period"
}
]
}
],
"dependent" : [
{
"name" : "IVLTSPeriod",
"variable" : [
"efft",
"period"
]
}
]
},
{
"name" : "Observation",
"source" : [
{
"context" : "proceduresrc",
"element" : "entryRelationship",
"variable" : "entriRel"
}
],
"target" : [
{
"context" : "bundle",
"contextType" : "variable",
"element" : "entry",
"variable" : "e1"
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "request",
"variable" : "request",
"transform" : "create",
"parameter" : [
{
"valueString" : "BackboneElement"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "method",
"transform" : "copy",
"parameter" : [
{
"valueString" : "POST"
}
]
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "resource",
"variable" : "observation",
"transform" : "create",
"parameter" : [
{
"valueString" : "Observation"
}
]
},
{
"context" : "observation",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid1",
"transform" : "uuid"
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "https://example/Observation/"
},
{
"valueId" : "uuid1"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "url",
"transform" : "copy",
"parameter" : [
{
"valueString" : "Observation"
}
]
},
{
"context" : "procedure",
"contextType" : "variable",
"element" : "reasonReference",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Observation/' + %observation.id"
}
]
}
],
"rule" : [
{
"name" : "reference",
"source" : [
{
"context" : "entriRel"
}
],
"target" : [
{
"context" : "observation",
"contextType" : "variable",
"element" : "subject",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Patient/' + %patient.id"
}
]
}
]
},
{
"name" : "reference",
"source" : [
{
"context" : "entriRel"
}
],
"target" : [
{
"context" : "observation",
"contextType" : "variable",
"element" : "encounter",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Encounter/' + %enc.id"
}
]
}
]
},
{
"name" : "ObservationValue",
"source" : [
{
"context" : "entriRel",
"element" : "observation",
"variable" : "obs"
}
],
"rule" : [
{
"name" : "code",
"source" : [
{
"context" : "obs",
"element" : "code",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "observation",
"contextType" : "variable",
"element" : "code",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "statuscode",
"source" : [
{
"context" : "obs",
"condition" : "observation.statusCode.exists().not()"
}
],
"rule" : [
{
"name" : "status",
"source" : [
{
"context" : "obs"
}
],
"target" : [
{
"context" : "observation",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "final"
}
]
}
]
}
]
}
]
}
]
}
]
}
]
}
]
},
{
"name" : "ClinicalDocumentSectionAllergie",
"typeMode" : "none",
"input" : [
{
"name" : "cda",
"type" : "ClinicalDocument",
"mode" : "source"
},
{
"name" : "src",
"type" : "Section",
"mode" : "source"
},
{
"name" : "patient",
"type" : "Patient",
"mode" : "target"
},
{
"name" : "tgt",
"mode" : "target"
},
{
"name" : "bundle",
"type" : "Bundle",
"mode" : "target"
},
{
"name" : "enc",
"type" : "Encounter",
"mode" : "target"
}
],
"rule" : [
{
"name" : "title",
"source" : [
{
"context" : "src",
"element" : "title",
"variable" : "t"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "title",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "t.dataString"
}
]
}
]
},
{
"name" : "code",
"source" : [
{
"context" : "src",
"element" : "code",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "code",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "exists",
"source" : [
{
"context" : "src",
"condition" : "src.entry.exists()"
}
],
"rule" : [
{
"name" : "cdaText",
"source" : [
{
"context" : "src",
"element" : "text",
"variable" : "cdaText"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "text",
"variable" : "fhirText"
}
],
"rule" : [
{
"name" : "narrativeStatus",
"source" : [
{
"context" : "cdaText"
}
],
"target" : [
{
"context" : "fhirText",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "generated"
}
]
}
]
},
{
"name" : "narrativeText",
"source" : [
{
"context" : "cdaText",
"variable" : "t"
}
],
"target" : [
{
"context" : "fhirText",
"contextType" : "variable",
"element" : "div",
"transform" : "copy",
"parameter" : [
{
"valueId" : "t"
}
]
}
]
}
]
}
]
},
{
"name" : "where",
"source" : [
{
"context" : "src",
"condition" : "src.entry.exists().not()"
}
],
"rule" : [
{
"name" : "cdaText",
"source" : [
{
"context" : "src",
"element" : "text",
"variable" : "cdaText"
}
],
"target" : [
{
"context" : "bundle",
"contextType" : "variable",
"element" : "entry",
"variable" : "e1"
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "request",
"variable" : "request",
"transform" : "create",
"parameter" : [
{
"valueString" : "BackboneElement"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "method",
"transform" : "copy",
"parameter" : [
{
"valueString" : "POST"
}
]
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "resource",
"variable" : "allergy",
"transform" : "create",
"parameter" : [
{
"valueString" : "AllergyIntolerance"
}
]
},
{
"context" : "allergy",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid1",
"transform" : "uuid"
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "https://example/AllergyIntolerance/"
},
{
"valueId" : "uuid1"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "url",
"transform" : "copy",
"parameter" : [
{
"valueString" : "AllergyIntolerance"
}
]
},
{
"context" : "tgt",
"contextType" : "variable",
"element" : "entry",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/AllergyIntolerance/' + %allergy.id"
}
]
}
],
"rule" : [
{
"name" : "reference",
"source" : [
{
"context" : "src"
}
],
"target" : [
{
"context" : "allergy",
"contextType" : "variable",
"element" : "patient",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Patient/' + %patient.id"
}
]
}
]
},
{
"name" : "reference",
"source" : [
{
"context" : "src"
}
],
"target" : [
{
"context" : "allergy",
"contextType" : "variable",
"element" : "encounter",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Encounter/' + %enc.id"
}
]
}
]
},
{
"name" : "allergy",
"source" : [
{
"context" : "src"
}
],
"target" : [
{
"context" : "allergy",
"contextType" : "variable",
"element" : "clinicalStatus",
"variable" : "status",
"transform" : "create",
"parameter" : [
{
"valueString" : "CodeableConcept"
}
]
}
],
"rule" : [
{
"name" : "text",
"source" : [
{
"context" : "src"
}
],
"target" : [
{
"context" : "status",
"contextType" : "variable",
"element" : "text",
"transform" : "copy",
"parameter" : [
{
"valueString" : "string"
}
]
}
]
},
{
"name" : "coding",
"source" : [
{
"context" : "src"
}
],
"target" : [
{
"context" : "status",
"contextType" : "variable",
"element" : "coding",
"variable" : "coding",
"transform" : "create",
"parameter" : [
{
"valueString" : "Coding"
}
]
}
],
"rule" : [
{
"name" : "active",
"source" : [
{
"context" : "src"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "code",
"transform" : "copy",
"parameter" : [
{
"valueString" : "active"
}
]
}
]
},
{
"name" : "system",
"source" : [
{
"context" : "src"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "system",
"transform" : "copy",
"parameter" : [
{
"valueString" : "http://terminology.hl7.org/CodeSystem/allergyintolerance-clinical"
}
]
}
]
}
]
}
]
},
{
"name" : "code",
"source" : [
{
"context" : "src",
"element" : "code",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "allergy",
"contextType" : "variable",
"element" : "code",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "reference",
"source" : [
{
"context" : "cdaText"
}
],
"target" : [
{
"context" : "allergy",
"contextType" : "variable",
"element" : "note",
"variable" : "note"
}
],
"rule" : [
{
"name" : "reference",
"source" : [
{
"context" : "cdaText",
"variable" : "t"
}
],
"target" : [
{
"context" : "note",
"contextType" : "variable",
"element" : "text",
"transform" : "copy",
"parameter" : [
{
"valueId" : "t"
}
]
}
]
}
]
}
]
}
]
},
{
"name" : "allergy",
"source" : [
{
"context" : "src",
"element" : "entry",
"variable" : "entry1"
}
],
"target" : [
{
"context" : "bundle",
"contextType" : "variable",
"element" : "entry",
"variable" : "e1"
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "request",
"variable" : "request",
"transform" : "create",
"parameter" : [
{
"valueString" : "BackboneElement"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "method",
"transform" : "copy",
"parameter" : [
{
"valueString" : "POST"
}
]
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "resource",
"variable" : "allergy",
"transform" : "create",
"parameter" : [
{
"valueString" : "AllergyIntolerance"
}
]
},
{
"context" : "allergy",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid1",
"transform" : "uuid"
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "https://example/AllergyIntolerance/"
},
{
"valueId" : "uuid1"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "url",
"transform" : "copy",
"parameter" : [
{
"valueString" : "AllergyIntolerance"
}
]
},
{
"context" : "tgt",
"contextType" : "variable",
"element" : "entry",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/AllergyIntolerance/' + %allergy.id"
}
]
}
],
"rule" : [
{
"name" : "reference",
"source" : [
{
"context" : "src"
}
],
"target" : [
{
"context" : "allergy",
"contextType" : "variable",
"element" : "patient",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Patient/' + %patient.id"
}
]
}
]
},
{
"name" : "reference",
"source" : [
{
"context" : "src"
}
],
"target" : [
{
"context" : "allergy",
"contextType" : "variable",
"element" : "encounter",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Encounter/' + %enc.id"
}
]
}
]
},
{
"name" : "act",
"source" : [
{
"context" : "entry1",
"element" : "act",
"variable" : "actallint"
}
],
"rule" : [
{
"name" : "effectiveTime",
"source" : [
{
"context" : "actallint",
"element" : "effectiveTime",
"variable" : "eff"
}
],
"target" : [
{
"context" : "allergy",
"contextType" : "variable",
"element" : "onset",
"variable" : "per",
"transform" : "create",
"parameter" : [
{
"valueString" : "Period"
}
]
}
],
"dependent" : [
{
"name" : "IVLTSPeriod",
"variable" : [
"eff",
"per"
]
}
]
},
{
"name" : "entryRelationship",
"source" : [
{
"context" : "actallint",
"element" : "entryRelationship",
"variable" : "entryact"
}
],
"rule" : [
{
"name" : "partic",
"source" : [
{
"context" : "entryact",
"element" : "observation",
"variable" : "entryobs"
}
],
"rule" : [
{
"name" : "code",
"source" : [
{
"context" : "entryobs",
"element" : "value",
"variable" : "code"
}
],
"rule" : [
{
"name" : "type",
"source" : [
{
"context" : "code",
"element" : "code",
"variable" : "code1"
}
],
"target" : [
{
"context" : "allergy",
"contextType" : "variable",
"element" : "type",
"transform" : "translate",
"parameter" : [
{
"valueId" : "code1"
},
{
"valueString" : "#AllergyTypeMap"
},
{
"valueString" : "code"
}
]
}
]
},
{
"name" : "category",
"source" : [
{
"context" : "code",
"element" : "code",
"variable" : "code2"
}
],
"target" : [
{
"context" : "allergy",
"contextType" : "variable",
"element" : "category",
"transform" : "translate",
"parameter" : [
{
"valueId" : "code2"
},
{
"valueString" : "#AllergyCategoryMap"
},
{
"valueString" : "code"
}
]
}
]
}
]
},
{
"name" : "PratRole",
"source" : [
{
"context" : "entryobs",
"element" : "participant",
"variable" : "partic"
}
],
"rule" : [
{
"name" : "pratentit",
"source" : [
{
"context" : "partic",
"element" : "participantRole",
"variable" : "pratRole"
}
],
"rule" : [
{
"name" : "react",
"source" : [
{
"context" : "pratRole",
"element" : "playingEntity",
"variable" : "pratent"
}
],
"rule" : [
{
"name" : "cod",
"source" : [
{
"context" : "pratent"
}
],
"target" : [
{
"context" : "allergy",
"contextType" : "variable",
"element" : "reaction",
"variable" : "reaction",
"transform" : "create",
"parameter" : [
{
"valueString" : "BackboneElement"
}
]
}
],
"rule" : [
{
"name" : "subs",
"source" : [
{
"context" : "pratent",
"element" : "code",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "reaction",
"contextType" : "variable",
"element" : "substance",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "entry",
"source" : [
{
"context" : "entryobs",
"element" : "entryRelationship",
"variable" : "entryobs1",
"condition" : "(typeCode = 'MFST')"
}
],
"rule" : [
{
"name" : "observ",
"source" : [
{
"context" : "entryobs1",
"element" : "observation",
"variable" : "entobs"
}
],
"rule" : [
{
"name" : "eff",
"source" : [
{
"context" : "entobs",
"element" : "effectiveTime",
"variable" : "eff"
}
],
"rule" : [
{
"name" : "val",
"source" : [
{
"context" : "eff",
"element" : "low",
"variable" : "l"
}
],
"target" : [
{
"context" : "reaction",
"contextType" : "variable",
"element" : "onset",
"variable" : "start",
"transform" : "create",
"parameter" : [
{
"valueString" : "dateTime"
}
]
}
],
"dependent" : [
{
"name" : "TSDateTime",
"variable" : [
"l",
"start"
]
}
]
}
]
},
{
"name" : "manifest",
"source" : [
{
"context" : "entobs",
"element" : "value",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "reaction",
"contextType" : "variable",
"element" : "manifestation",
"variable" : "vvv",
"transform" : "create"
}
]
}
]
}
]
}
]
}
]
}
]
}
]
},
{
"name" : "observ",
"source" : [
{
"context" : "entryobs",
"element" : "entryRelationship",
"variable" : "entryobs2"
}
],
"rule" : [
{
"name" : "severity",
"source" : [
{
"context" : "entryobs2",
"element" : "observation",
"variable" : "entobs"
}
],
"rule" : [
{
"name" : "sev",
"source" : [
{
"context" : "entobs",
"element" : "code",
"variable" : "code",
"condition" : "(code = 'SEV')"
}
],
"rule" : [
{
"name" : "entobs",
"source" : [
{
"context" : "entobs",
"element" : "value",
"variable" : "value"
}
],
"rule" : [
{
"name" : "active",
"source" : [
{
"context" : "value",
"element" : "code",
"condition" : "(value.code = 'M')"
}
],
"target" : [
{
"context" : "allergy",
"contextType" : "variable",
"element" : "criticality",
"transform" : "copy",
"parameter" : [
{
"valueString" : "unable-to-assess"
}
]
}
]
},
{
"name" : "active",
"source" : [
{
"context" : "value",
"element" : "code",
"condition" : "(value.code = 'L')"
}
],
"target" : [
{
"context" : "allergy",
"contextType" : "variable",
"element" : "criticality",
"transform" : "copy",
"parameter" : [
{
"valueString" : "low"
}
]
}
]
},
{
"name" : "active",
"source" : [
{
"context" : "value",
"element" : "code",
"condition" : "(value.code = 'H')"
}
],
"target" : [
{
"context" : "allergy",
"contextType" : "variable",
"element" : "criticality",
"transform" : "copy",
"parameter" : [
{
"valueString" : "high"
}
]
}
]
}
]
}
]
}
]
}
]
},
{
"name" : "entry3",
"source" : [
{
"context" : "entryobs",
"element" : "entryRelationship",
"variable" : "entryobs3"
}
],
"rule" : [
{
"name" : "obobs3serv",
"source" : [
{
"context" : "entryobs3",
"element" : "observation",
"variable" : "entobs"
}
],
"rule" : [
{
"name" : "stat",
"source" : [
{
"context" : "entobs",
"element" : "code",
"variable" : "code",
"condition" : "(code = '33999-4')"
}
],
"rule" : [
{
"name" : "clinicalStatus",
"source" : [
{
"context" : "entobs"
}
],
"target" : [
{
"context" : "allergy",
"contextType" : "variable",
"element" : "clinicalStatus",
"variable" : "status",
"transform" : "create",
"parameter" : [
{
"valueString" : "CodeableConcept"
}
]
}
],
"rule" : [
{
"name" : "coding",
"source" : [
{
"context" : "entobs"
}
],
"target" : [
{
"context" : "status",
"contextType" : "variable",
"element" : "coding",
"variable" : "coding",
"transform" : "create",
"parameter" : [
{
"valueString" : "Coding"
}
]
}
],
"rule" : [
{
"name" : "value1",
"source" : [
{
"context" : "entobs",
"element" : "value",
"variable" : "value"
}
],
"rule" : [
{
"name" : "active",
"source" : [
{
"context" : "value",
"element" : "code",
"condition" : "(value.code = 'LA16666-2')"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "code",
"transform" : "copy",
"parameter" : [
{
"valueString" : "active"
}
]
}
]
},
{
"name" : "active",
"source" : [
{
"context" : "value",
"element" : "code",
"condition" : "(value.code = 'LA18632-2')"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "code",
"transform" : "copy",
"parameter" : [
{
"valueString" : "inactive"
}
]
}
]
},
{
"name" : "system",
"source" : [
{
"context" : "value",
"element" : "codeSystem",
"variable" : "system"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "system",
"transform" : "copy",
"parameter" : [
{
"valueString" : "http://terminology.hl7.org/CodeSystem/allergyintolerance-clinical"
}
]
}
]
},
{
"name" : "displayName",
"source" : [
{
"context" : "value",
"element" : "displayName",
"variable" : "display"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "display",
"transform" : "cast",
"parameter" : [
{
"valueId" : "display"
},
{
"valueString" : "string"
}
]
}
]
}
]
}
]
}
]
}
]
}
]
}
]
},
{
"name" : "entry4",
"source" : [
{
"context" : "entryobs",
"element" : "entryRelationship",
"variable" : "entryobs4"
}
],
"rule" : [
{
"name" : "obobs4serv",
"source" : [
{
"context" : "entryobs4",
"element" : "act",
"variable" : "entact"
}
],
"rule" : [
{
"name" : "txtact",
"source" : [
{
"context" : "entact",
"element" : "text",
"variable" : "actext"
}
],
"rule" : [
{
"name" : "notetxt",
"source" : [
{
"context" : "actext",
"element" : "reference",
"variable" : "reftxt"
}
],
"target" : [
{
"context" : "allergy",
"contextType" : "variable",
"element" : "note",
"variable" : "note",
"transform" : "create",
"parameter" : [
{
"valueString" : "BackboneElement"
}
]
}
],
"rule" : [
{
"name" : "notxt",
"source" : [
{
"context" : "reftxt",
"variable" : "ref"
}
],
"target" : [
{
"context" : "note",
"contextType" : "variable",
"element" : "text",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "ref.value"
}
]
}
]
}
]
}
]
}
]
}
]
}
]
}
]
}
]
}
]
}
]
},
{
"name" : "ClinicalDocumentSectionDiagnosiDimissione",
"typeMode" : "none",
"input" : [
{
"name" : "cda",
"type" : "ClinicalDocument",
"mode" : "source"
},
{
"name" : "src",
"type" : "Section",
"mode" : "source"
},
{
"name" : "patient",
"type" : "Patient",
"mode" : "target"
},
{
"name" : "tgt",
"mode" : "target"
},
{
"name" : "bundle",
"type" : "Bundle",
"mode" : "target"
},
{
"name" : "enc",
"type" : "Encounter",
"mode" : "target"
}
],
"rule" : [
{
"name" : "title",
"source" : [
{
"context" : "src",
"element" : "title",
"variable" : "t"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "title",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "t.dataString"
}
]
}
]
},
{
"name" : "code",
"source" : [
{
"context" : "src",
"element" : "code",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "code",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "exists",
"source" : [
{
"context" : "src",
"condition" : "src.entry.exists()"
}
],
"rule" : [
{
"name" : "cdaText",
"source" : [
{
"context" : "src",
"element" : "text",
"variable" : "cdaText"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "text",
"variable" : "fhirText"
}
],
"rule" : [
{
"name" : "narrativeStatus",
"source" : [
{
"context" : "cdaText"
}
],
"target" : [
{
"context" : "fhirText",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "generated"
}
]
}
]
},
{
"name" : "narrativeText",
"source" : [
{
"context" : "cdaText",
"variable" : "t"
}
],
"target" : [
{
"context" : "fhirText",
"contextType" : "variable",
"element" : "div",
"transform" : "copy",
"parameter" : [
{
"valueId" : "t"
}
]
}
]
}
]
}
]
},
{
"name" : "where",
"source" : [
{
"context" : "src",
"condition" : "src.entry.exists().not()"
}
],
"rule" : [
{
"name" : "cdaText",
"source" : [
{
"context" : "src",
"element" : "text",
"variable" : "cdaText"
}
],
"target" : [
{
"context" : "bundle",
"contextType" : "variable",
"element" : "entry",
"variable" : "e1"
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "request",
"variable" : "request",
"transform" : "create",
"parameter" : [
{
"valueString" : "BackboneElement"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "method",
"transform" : "copy",
"parameter" : [
{
"valueString" : "POST"
}
]
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "resource",
"variable" : "observation",
"transform" : "create",
"parameter" : [
{
"valueString" : "Observation"
}
]
},
{
"context" : "observation",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid1",
"transform" : "uuid"
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "https://example/Observation/"
},
{
"valueId" : "uuid1"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "url",
"transform" : "copy",
"parameter" : [
{
"valueString" : "Observation"
}
]
},
{
"context" : "tgt",
"contextType" : "variable",
"element" : "entry",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Observation/' + %observation.id"
}
]
}
],
"rule" : [
{
"name" : "reference",
"source" : [
{
"context" : "src"
}
],
"target" : [
{
"context" : "observation",
"contextType" : "variable",
"element" : "subject",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Patient/' + %patient.id"
}
]
}
]
},
{
"name" : "reference",
"source" : [
{
"context" : "src"
}
],
"target" : [
{
"context" : "observation",
"contextType" : "variable",
"element" : "encounter",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Encounter/' + %enc.id"
}
]
}
]
},
{
"name" : "code",
"source" : [
{
"context" : "src",
"element" : "code",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "observation",
"contextType" : "variable",
"element" : "code",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "statuscode",
"source" : [
{
"context" : "src",
"condition" : "observation.statusCode.exists().not()"
}
],
"rule" : [
{
"name" : "status",
"source" : [
{
"context" : "src"
}
],
"target" : [
{
"context" : "observation",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "final"
}
]
}
]
}
]
},
{
"name" : "reference",
"source" : [
{
"context" : "cdaText"
}
],
"target" : [
{
"context" : "observation",
"contextType" : "variable",
"element" : "note",
"variable" : "note"
}
],
"rule" : [
{
"name" : "reference",
"source" : [
{
"context" : "cdaText",
"variable" : "t"
}
],
"target" : [
{
"context" : "note",
"contextType" : "variable",
"element" : "text",
"transform" : "copy",
"parameter" : [
{
"valueId" : "t"
}
]
}
]
}
]
}
]
}
]
},
{
"name" : "entry",
"source" : [
{
"context" : "src",
"element" : "entry",
"variable" : "entry1"
}
],
"target" : [
{
"context" : "bundle",
"contextType" : "variable",
"element" : "entry",
"variable" : "e1"
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "request",
"variable" : "request",
"transform" : "create",
"parameter" : [
{
"valueString" : "BackboneElement"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "method",
"transform" : "copy",
"parameter" : [
{
"valueString" : "POST"
}
]
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "resource",
"variable" : "observation",
"transform" : "create",
"parameter" : [
{
"valueString" : "Observation"
}
]
},
{
"context" : "observation",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid1",
"transform" : "uuid"
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "https://example/Observation/"
},
{
"valueId" : "uuid1"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "url",
"transform" : "copy",
"parameter" : [
{
"valueString" : "Observation"
}
]
},
{
"context" : "tgt",
"contextType" : "variable",
"element" : "entry",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Observation/' + %observation.id"
}
]
}
],
"rule" : [
{
"name" : "act",
"source" : [
{
"context" : "entry1",
"element" : "observation",
"variable" : "obs"
}
],
"dependent" : [
{
"name" : "Observation",
"variable" : [
"obs",
"patient",
"enc",
"observation",
"bundle"
]
}
]
}
]
}
]
},
{
"name" : "ClinicalDocumentSectionIstruzioniFollowUp",
"typeMode" : "none",
"input" : [
{
"name" : "cda",
"type" : "ClinicalDocument",
"mode" : "source"
},
{
"name" : "src",
"type" : "Section",
"mode" : "source"
},
{
"name" : "patient",
"type" : "Patient",
"mode" : "target"
},
{
"name" : "tgt",
"mode" : "target"
},
{
"name" : "bundle",
"type" : "Bundle",
"mode" : "target"
},
{
"name" : "enc",
"type" : "Encounter",
"mode" : "target"
}
],
"rule" : [
{
"name" : "title",
"source" : [
{
"context" : "src",
"element" : "title",
"variable" : "t"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "title",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "t.dataString"
}
]
}
]
},
{
"name" : "code",
"source" : [
{
"context" : "src",
"element" : "code",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "code",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "cdaText",
"source" : [
{
"context" : "src",
"element" : "text",
"variable" : "cdaText"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "text",
"variable" : "fhirText"
}
],
"rule" : [
{
"name" : "narrativeStatus",
"source" : [
{
"context" : "cdaText"
}
],
"target" : [
{
"context" : "fhirText",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "generated"
}
]
}
]
},
{
"name" : "narrativeText",
"source" : [
{
"context" : "cdaText",
"variable" : "t"
}
],
"target" : [
{
"context" : "fhirText",
"contextType" : "variable",
"element" : "div",
"transform" : "copy",
"parameter" : [
{
"valueId" : "t"
}
]
}
]
}
]
},
{
"name" : "entry",
"source" : [
{
"context" : "src",
"element" : "text",
"variable" : "cdaText"
}
],
"target" : [
{
"context" : "bundle",
"contextType" : "variable",
"element" : "entry",
"variable" : "e1"
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "request",
"variable" : "request",
"transform" : "create",
"parameter" : [
{
"valueString" : "BackboneElement"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "method",
"transform" : "copy",
"parameter" : [
{
"valueString" : "POST"
}
]
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "resource",
"variable" : "carePlan",
"transform" : "create",
"parameter" : [
{
"valueString" : "CarePlan"
}
]
},
{
"context" : "carePlan",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid1",
"transform" : "uuid"
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "https://example/CarePlan/"
},
{
"valueId" : "uuid1"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "url",
"transform" : "copy",
"parameter" : [
{
"valueString" : "CarePlan"
}
]
},
{
"context" : "tgt",
"contextType" : "variable",
"element" : "entry",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/CarePlan/' + %carePlan.id"
}
]
}
],
"rule" : [
{
"name" : "reference",
"source" : [
{
"context" : "cdaText"
}
],
"target" : [
{
"context" : "carePlan",
"contextType" : "variable",
"element" : "note",
"variable" : "note"
}
],
"rule" : [
{
"name" : "reference",
"source" : [
{
"context" : "cdaText",
"variable" : "t"
}
],
"target" : [
{
"context" : "note",
"contextType" : "variable",
"element" : "text",
"transform" : "copy",
"parameter" : [
{
"valueId" : "t"
}
]
}
]
}
]
},
{
"name" : "reference",
"source" : [
{
"context" : "src"
}
],
"target" : [
{
"context" : "carePlan",
"contextType" : "variable",
"element" : "subject",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Patient/' + %patient.id"
}
]
}
]
},
{
"name" : "reference",
"source" : [
{
"context" : "src"
}
],
"target" : [
{
"context" : "carePlan",
"contextType" : "variable",
"element" : "encounter",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Encounter/' + %enc.id"
}
]
}
]
},
{
"name" : "status",
"source" : [
{
"context" : "src"
}
],
"target" : [
{
"context" : "carePlan",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "active"
}
]
}
]
},
{
"name" : "intent",
"source" : [
{
"context" : "src"
}
],
"target" : [
{
"context" : "carePlan",
"contextType" : "variable",
"element" : "intent",
"transform" : "copy",
"parameter" : [
{
"valueString" : "order"
}
]
}
]
}
]
}
]
},
{
"name" : "ClinicalDocumentSectionTerapiaFarmacologicaDuranteRicovero",
"typeMode" : "none",
"input" : [
{
"name" : "cda",
"type" : "ClinicalDocument",
"mode" : "source"
},
{
"name" : "src",
"type" : "Section",
"mode" : "source"
},
{
"name" : "patient",
"type" : "Patient",
"mode" : "target"
},
{
"name" : "tgt",
"mode" : "target"
},
{
"name" : "bundle",
"type" : "Bundle",
"mode" : "target"
},
{
"name" : "enc",
"type" : "Encounter",
"mode" : "target"
}
],
"rule" : [
{
"name" : "title",
"source" : [
{
"context" : "src",
"element" : "title",
"variable" : "t"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "title",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "t.dataString"
}
]
}
]
},
{
"name" : "code",
"source" : [
{
"context" : "src",
"element" : "code",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "code",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "exists",
"source" : [
{
"context" : "src",
"condition" : "src.entry.exists()"
}
],
"rule" : [
{
"name" : "cdaText",
"source" : [
{
"context" : "src",
"element" : "text",
"variable" : "cdaText"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "text",
"variable" : "fhirText"
}
],
"rule" : [
{
"name" : "narrativeStatus",
"source" : [
{
"context" : "cdaText"
}
],
"target" : [
{
"context" : "fhirText",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "generated"
}
]
}
]
},
{
"name" : "narrativeText",
"source" : [
{
"context" : "cdaText",
"variable" : "t"
}
],
"target" : [
{
"context" : "fhirText",
"contextType" : "variable",
"element" : "div",
"transform" : "copy",
"parameter" : [
{
"valueId" : "t"
}
]
}
]
}
]
}
]
},
{
"name" : "where",
"source" : [
{
"context" : "src",
"condition" : "src.entry.exists().not()"
}
],
"rule" : [
{
"name" : "cdaText",
"source" : [
{
"context" : "src",
"element" : "text",
"variable" : "cdaText"
}
],
"target" : [
{
"context" : "bundle",
"contextType" : "variable",
"element" : "entry",
"variable" : "e1"
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "request",
"variable" : "request",
"transform" : "create",
"parameter" : [
{
"valueString" : "BackboneElement"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "method",
"transform" : "copy",
"parameter" : [
{
"valueString" : "POST"
}
]
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "resource",
"variable" : "medicationAdm",
"transform" : "create",
"parameter" : [
{
"valueString" : "MedicationAdministration"
}
]
},
{
"context" : "medicationAdm",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid1",
"transform" : "uuid"
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "https://example/MedicationAdministration/"
},
{
"valueId" : "uuid1"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "url",
"transform" : "copy",
"parameter" : [
{
"valueString" : "MedicationAdministration"
}
]
},
{
"context" : "tgt",
"contextType" : "variable",
"element" : "entry",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/MedicationAdministration/' + %medicationAdm.id"
}
]
}
],
"rule" : [
{
"name" : "reference",
"source" : [
{
"context" : "cdaText"
}
],
"target" : [
{
"context" : "medicationAdm",
"contextType" : "variable",
"element" : "subject",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Patient/' + %patient.id"
}
]
}
]
},
{
"name" : "reference",
"source" : [
{
"context" : "cdaText"
}
],
"target" : [
{
"context" : "medicationAdm",
"contextType" : "variable",
"element" : "context",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Encounter/' + %enc.id"
}
]
}
]
},
{
"name" : "code",
"source" : [
{
"context" : "cdaText"
}
],
"target" : [
{
"context" : "medicationAdm",
"contextType" : "variable",
"element" : "medication",
"variable" : "codecon",
"transform" : "create",
"parameter" : [
{
"valueString" : "CodeableConcept"
}
]
}
],
"rule" : [
{
"name" : "text",
"source" : [
{
"context" : "cdaText"
}
],
"target" : [
{
"context" : "codecon",
"contextType" : "variable",
"element" : "text",
"transform" : "copy",
"parameter" : [
{
"valueString" : "string"
}
]
}
]
}
]
},
{
"name" : "Period",
"source" : [
{
"context" : "src"
}
],
"target" : [
{
"context" : "medicationAdm",
"contextType" : "variable",
"element" : "effective",
"variable" : "period",
"transform" : "create",
"parameter" : [
{
"valueString" : "Period"
}
]
}
],
"rule" : [
{
"name" : "low",
"source" : [
{
"context" : "src"
}
],
"target" : [
{
"context" : "period",
"contextType" : "variable",
"element" : "start",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "start.now()"
}
]
}
]
},
{
"name" : "high",
"source" : [
{
"context" : "src"
}
],
"target" : [
{
"context" : "period",
"contextType" : "variable",
"element" : "end",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "end.now()"
}
]
}
]
}
]
},
{
"name" : "statuscode",
"source" : [
{
"context" : "src",
"condition" : "sub.statusCode.exists().not()"
}
],
"rule" : [
{
"name" : "status",
"source" : [
{
"context" : "src"
}
],
"target" : [
{
"context" : "medicationAdm",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "completed"
}
]
}
]
}
]
},
{
"name" : "reference",
"source" : [
{
"context" : "cdaText"
}
],
"target" : [
{
"context" : "medicationAdm",
"contextType" : "variable",
"element" : "note",
"variable" : "note"
}
],
"rule" : [
{
"name" : "reference",
"source" : [
{
"context" : "cdaText",
"variable" : "t"
}
],
"target" : [
{
"context" : "note",
"contextType" : "variable",
"element" : "text",
"transform" : "copy",
"parameter" : [
{
"valueId" : "t"
}
]
}
]
}
]
}
]
}
]
},
{
"name" : "sa",
"source" : [
{
"context" : "src",
"element" : "entry",
"variable" : "entry1"
}
],
"target" : [
{
"context" : "bundle",
"contextType" : "variable",
"element" : "entry",
"variable" : "e1"
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "request",
"variable" : "request",
"transform" : "create",
"parameter" : [
{
"valueString" : "BackboneElement"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "method",
"transform" : "copy",
"parameter" : [
{
"valueString" : "POST"
}
]
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "resource",
"variable" : "medicationAdm",
"transform" : "create",
"parameter" : [
{
"valueString" : "MedicationAdministration"
}
]
},
{
"context" : "medicationAdm",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid1",
"transform" : "uuid"
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "https://example/MedicationAdministration/"
},
{
"valueId" : "uuid1"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "url",
"transform" : "copy",
"parameter" : [
{
"valueString" : "MedicationAdministration"
}
]
},
{
"context" : "tgt",
"contextType" : "variable",
"element" : "entry",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/MedicationAdministration/' + %medicationAdm.id"
}
]
}
],
"rule" : [
{
"name" : "reference",
"source" : [
{
"context" : "entry1"
}
],
"target" : [
{
"context" : "medicationAdm",
"contextType" : "variable",
"element" : "subject",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Patient/' + %patient.id"
}
]
}
]
},
{
"name" : "reference",
"source" : [
{
"context" : "entry1"
}
],
"target" : [
{
"context" : "medicationAdm",
"contextType" : "variable",
"element" : "context",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Encounter/' + %enc.id"
}
]
}
]
},
{
"name" : "entry",
"source" : [
{
"context" : "entry1",
"element" : "substanceAdministration",
"variable" : "sa"
}
],
"rule" : [
{
"name" : "tx",
"source" : [
{
"context" : "sa",
"element" : "text",
"variable" : "tx"
}
],
"target" : [
{
"context" : "medicationAdm",
"contextType" : "variable",
"element" : "note",
"variable" : "note"
}
],
"rule" : [
{
"name" : "perf",
"source" : [
{
"context" : "sa",
"element" : "performer",
"variable" : "performer"
}
],
"target" : [
{
"context" : "bundle",
"contextType" : "variable",
"element" : "entry",
"variable" : "e1"
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "request",
"variable" : "request",
"transform" : "create",
"parameter" : [
{
"valueString" : "BackboneElement"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "method",
"transform" : "copy",
"parameter" : [
{
"valueString" : "PUT"
}
]
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "resource",
"variable" : "practitioner",
"transform" : "create",
"parameter" : [
{
"valueString" : "Practitioner"
}
]
}
],
"rule" : [
{
"name" : "time",
"source" : [
{
"context" : "performer",
"element" : "time",
"variable" : "ti"
}
],
"target" : [
{
"context" : "note",
"contextType" : "variable",
"element" : "time",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "ti.value"
}
]
}
]
},
{
"name" : "assEntity",
"source" : [
{
"context" : "performer",
"element" : "assignedEntity",
"variable" : "assEnty"
}
],
"rule" : [
{
"name" : "meta",
"source" : [
{
"context" : "assEnty"
}
],
"target" : [
{
"context" : "practitioner",
"contextType" : "variable",
"element" : "meta",
"variable" : "meta"
}
],
"rule" : [
{
"name" : "coding",
"source" : [
{
"context" : "assEnty"
}
],
"target" : [
{
"context" : "meta",
"contextType" : "variable",
"element" : "tag",
"variable" : "coding",
"transform" : "create",
"parameter" : [
{
"valueString" : "Coding"
}
]
}
],
"rule" : [
{
"name" : "system",
"source" : [
{
"context" : "assEnty"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "system",
"transform" : "copy",
"parameter" : [
{
"valueString" : "http://algoritmodiscoring"
}
]
}
]
},
{
"name" : "code",
"source" : [
{
"context" : "assEnty"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "code",
"transform" : "copy",
"parameter" : [
{
"valueString" : "ClinicalDocument/body/TerapiaFarmacologicaRicovero/performer"
}
]
}
]
}
]
}
]
},
{
"name" : "identifier",
"source" : [
{
"context" : "assEnty",
"element" : "id",
"variable" : "id"
}
],
"target" : [
{
"context" : "practitioner",
"contextType" : "variable",
"element" : "identifier",
"variable" : "identifier"
}
],
"rule" : [
{
"name" : "root1",
"source" : [
{
"context" : "id",
"element" : "root",
"variable" : "r"
}
],
"target" : [
{
"context" : "identifier",
"contextType" : "variable",
"element" : "system",
"transform" : "translate",
"parameter" : [
{
"valueId" : "r"
},
{
"valueString" : "http://hl7.org/fhir/ConceptMap/special-oid2uri"
},
{
"valueString" : "uri"
}
]
}
]
},
{
"name" : "extension",
"source" : [
{
"context" : "id",
"element" : "extension",
"variable" : "ext"
}
],
"target" : [
{
"context" : "identifier",
"contextType" : "variable",
"element" : "value",
"transform" : "copy",
"parameter" : [
{
"valueId" : "ext"
}
]
}
]
},
{
"name" : "assigningAuthorityName",
"source" : [
{
"context" : "id",
"element" : "assigningAuthorityName",
"variable" : "s"
}
],
"target" : [
{
"context" : "identifier",
"contextType" : "variable",
"element" : "assigner",
"variable" : "a"
},
{
"context" : "a",
"contextType" : "variable",
"element" : "display",
"transform" : "copy",
"parameter" : [
{
"valueId" : "s"
}
]
}
]
},
{
"name" : "r",
"source" : [
{
"context" : "id",
"element" : "root",
"variable" : "r"
}
],
"rule" : [
{
"name" : "aut",
"source" : [
{
"context" : "id",
"element" : "extension",
"variable" : "ext"
}
],
"target" : [
{
"context" : "practitioner",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid2",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "r + '-' + ext"
}
]
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "https://example/Practitioner/"
},
{
"valueId" : "uuid2"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "url",
"transform" : "copy",
"parameter" : [
{
"valueString" : "Practitioner"
}
]
},
{
"context" : "medicationAdm",
"contextType" : "variable",
"element" : "performer",
"variable" : "perf"
},
{
"context" : "perf",
"contextType" : "variable",
"element" : "actor",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Practitioner/' + %practitioner.id"
}
]
}
]
}
]
}
]
},
{
"name" : "2.16.840.1.113883.2.9.4.3.2",
"source" : [
{
"context" : "assEnty",
"element" : "id",
"variable" : "id",
"condition" : "(root = '2.16.840.1.113883.2.9.4.3.2')"
}
],
"rule" : [
{
"name" : "UUID",
"source" : [
{
"context" : "id",
"element" : "extension",
"variable" : "ext"
}
],
"target" : [
{
"context" : "request",
"contextType" : "variable",
"element" : "url",
"transform" : "append",
"parameter" : [
{
"valueString" : "Practitioner?identifier="
},
{
"valueId" : "ext"
}
]
}
]
}
]
},
{
"name" : "diverso",
"source" : [
{
"context" : "assEnty",
"element" : "id",
"variable" : "id",
"condition" : "(root != '2.16.840.1.113883.2.9.4.3.2')"
}
],
"rule" : [
{
"name" : "UUID",
"source" : [
{
"context" : "id",
"element" : "extension",
"variable" : "ext"
}
],
"target" : [
{
"context" : "request",
"contextType" : "variable",
"element" : "url",
"transform" : "append",
"parameter" : [
{
"valueString" : "Practitioner?identifier="
},
{
"valueId" : "ext"
}
]
}
]
}
]
},
{
"name" : "assi",
"source" : [
{
"context" : "assEnty",
"element" : "assignedPerson",
"variable" : "assi"
}
],
"rule" : [
{
"name" : "name",
"source" : [
{
"context" : "assi",
"element" : "name",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "practitioner",
"contextType" : "variable",
"element" : "name",
"variable" : "vvv",
"transform" : "create"
}
]
}
]
}
]
}
]
},
{
"name" : "reference",
"source" : [
{
"context" : "tx",
"element" : "reference",
"variable" : "ref"
}
],
"target" : [
{
"context" : "note",
"contextType" : "variable",
"element" : "text",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "ref.value"
}
]
}
]
}
]
},
{
"name" : "statusCode",
"source" : [
{
"context" : "sa",
"element" : "statusCode",
"variable" : "st"
}
],
"target" : [
{
"context" : "medicationAdm",
"contextType" : "variable",
"element" : "status",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "st.code"
}
]
}
]
},
{
"name" : "period",
"source" : [
{
"context" : "sa",
"element" : "effectiveTime",
"variable" : "eff"
}
],
"target" : [
{
"context" : "medicationAdm",
"contextType" : "variable",
"element" : "effective",
"variable" : "period",
"transform" : "create",
"parameter" : [
{
"valueString" : "Period"
}
]
}
],
"dependent" : [
{
"name" : "IVLTSPeriod",
"variable" : [
"eff",
"period"
]
}
]
},
{
"name" : "dos",
"source" : [
{
"context" : "sa"
}
],
"target" : [
{
"context" : "medicationAdm",
"contextType" : "variable",
"element" : "dosage",
"variable" : "dos"
}
],
"rule" : [
{
"name" : "routeCode",
"source" : [
{
"context" : "sa",
"element" : "routeCode",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "dos",
"contextType" : "variable",
"element" : "route",
"variable" : "vvv",
"transform" : "create"
}
]
}
]
},
{
"name" : "dos",
"source" : [
{
"context" : "sa"
}
],
"target" : [
{
"context" : "medicationAdm",
"contextType" : "variable",
"element" : "dosage",
"variable" : "dos"
}
],
"rule" : [
{
"name" : "approachSiteCode",
"source" : [
{
"context" : "sa",
"element" : "approachSiteCode",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "dos",
"contextType" : "variable",
"element" : "site",
"variable" : "vvv",
"transform" : "create"
}
]
}
]
},
{
"name" : "sa",
"source" : [
{
"context" : "sa",
"element" : "doseQuantity",
"variable" : "doseQuant"
}
],
"target" : [
{
"context" : "bundle",
"contextType" : "variable",
"element" : "entry",
"variable" : "e1"
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "request",
"variable" : "request",
"transform" : "create",
"parameter" : [
{
"valueString" : "BackboneElement"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "method",
"transform" : "copy",
"parameter" : [
{
"valueString" : "POST"
}
]
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "resource",
"variable" : "medicationRq",
"transform" : "create",
"parameter" : [
{
"valueString" : "MedicationRequest"
}
]
},
{
"context" : "medicationRq",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid1",
"transform" : "uuid"
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "https://example/MedicationRequest/"
},
{
"valueId" : "uuid1"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "url",
"transform" : "copy",
"parameter" : [
{
"valueString" : "MedicationRequest"
}
]
},
{
"context" : "medicationAdm",
"contextType" : "variable",
"element" : "request",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/MedicationRequest/' + %medicationRq.id"
}
]
}
],
"rule" : [
{
"name" : "Dosage",
"source" : [
{
"context" : "doseQuant"
}
],
"target" : [
{
"context" : "medicationRq",
"contextType" : "variable",
"element" : "dosageInstruction",
"variable" : "dosageInstruction",
"transform" : "create",
"parameter" : [
{
"valueString" : "Dosage"
}
]
}
],
"rule" : [
{
"name" : "ot",
"source" : [
{
"context" : "doseQuant",
"element" : "originalText",
"variable" : "ot"
}
],
"rule" : [
{
"name" : "reference",
"source" : [
{
"context" : "ot",
"element" : "reference",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "dosageInstruction",
"contextType" : "variable",
"element" : "text",
"variable" : "vvv",
"transform" : "create"
}
]
}
]
},
{
"name" : "dosageRate",
"source" : [
{
"context" : "doseQuant"
}
],
"target" : [
{
"context" : "dosageInstruction",
"contextType" : "variable",
"element" : "doseAndRate",
"variable" : "dosageRate"
}
],
"rule" : [
{
"name" : "d",
"source" : [
{
"context" : "doseQuant"
}
],
"target" : [
{
"context" : "dosageRate",
"contextType" : "variable",
"element" : "dose",
"variable" : "d",
"transform" : "create",
"parameter" : [
{
"valueString" : "Range"
}
]
}
],
"rule" : [
{
"name" : "low",
"source" : [
{
"context" : "doseQuant"
}
],
"target" : [
{
"context" : "d",
"contextType" : "variable",
"element" : "low",
"variable" : "l",
"transform" : "create",
"parameter" : [
{
"valueString" : "SimpleQuantity"
}
]
}
],
"rule" : [
{
"name" : "low",
"source" : [
{
"context" : "doseQuant",
"element" : "low",
"variable" : "lo"
}
],
"target" : [
{
"context" : "l",
"contextType" : "variable",
"element" : "value",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "lo.value"
}
]
}
]
},
{
"name" : "low",
"source" : [
{
"context" : "doseQuant",
"element" : "low",
"variable" : "lo"
}
],
"target" : [
{
"context" : "l",
"contextType" : "variable",
"element" : "unit",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "lo.unit"
}
]
}
]
}
]
},
{
"name" : "low",
"source" : [
{
"context" : "doseQuant"
}
],
"target" : [
{
"context" : "d",
"contextType" : "variable",
"element" : "high",
"variable" : "h",
"transform" : "create",
"parameter" : [
{
"valueString" : "SimpleQuantity"
}
]
}
],
"rule" : [
{
"name" : "high",
"source" : [
{
"context" : "doseQuant",
"element" : "high",
"variable" : "hi"
}
],
"target" : [
{
"context" : "h",
"contextType" : "variable",
"element" : "value",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "hi.value"
}
]
}
]
},
{
"name" : "high",
"source" : [
{
"context" : "doseQuant",
"element" : "high",
"variable" : "hi"
}
],
"target" : [
{
"context" : "h",
"contextType" : "variable",
"element" : "unit",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "hi.unit"
}
]
}
]
}
]
}
]
}
]
}
]
},
{
"name" : "reference",
"source" : [
{
"context" : "sa"
}
],
"target" : [
{
"context" : "medicationRq",
"contextType" : "variable",
"element" : "subject",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Patient/' + %patient.id"
}
]
}
]
},
{
"name" : "reference",
"source" : [
{
"context" : "sa"
}
],
"target" : [
{
"context" : "medicationRq",
"contextType" : "variable",
"element" : "encounter",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Encounter/' + %enc.id"
}
]
}
]
},
{
"name" : "status",
"source" : [
{
"context" : "sa"
}
],
"target" : [
{
"context" : "medicationRq",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "active"
}
]
}
]
},
{
"name" : "intent",
"source" : [
{
"context" : "sa"
}
],
"target" : [
{
"context" : "medicationRq",
"contextType" : "variable",
"element" : "intent",
"transform" : "copy",
"parameter" : [
{
"valueString" : "order"
}
]
}
]
},
{
"name" : "Dosage",
"source" : [
{
"context" : "sa",
"element" : "rateQuantity",
"variable" : "rateQuantity"
}
],
"target" : [
{
"context" : "medicationRq",
"contextType" : "variable",
"element" : "dosageInstruction",
"variable" : "dosageInstruction1",
"transform" : "create",
"parameter" : [
{
"valueString" : "Dosage"
}
]
}
],
"rule" : [
{
"name" : "ot",
"source" : [
{
"context" : "rateQuantity",
"element" : "originalText",
"variable" : "ot"
}
],
"rule" : [
{
"name" : "reference",
"source" : [
{
"context" : "ot",
"element" : "reference",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "dosageInstruction1",
"contextType" : "variable",
"element" : "text",
"variable" : "vvv",
"transform" : "create"
}
]
}
]
},
{
"name" : "dosageRate",
"source" : [
{
"context" : "rateQuantity"
}
],
"target" : [
{
"context" : "dosageInstruction1",
"contextType" : "variable",
"element" : "doseAndRate",
"variable" : "dosageRate"
}
],
"rule" : [
{
"name" : "d",
"source" : [
{
"context" : "rateQuantity"
}
],
"target" : [
{
"context" : "dosageRate",
"contextType" : "variable",
"element" : "rate",
"variable" : "d",
"transform" : "create",
"parameter" : [
{
"valueString" : "Range"
}
]
}
],
"rule" : [
{
"name" : "low",
"source" : [
{
"context" : "rateQuantity"
}
],
"target" : [
{
"context" : "d",
"contextType" : "variable",
"element" : "low",
"variable" : "l",
"transform" : "create",
"parameter" : [
{
"valueString" : "SimpleQuantity"
}
]
}
],
"rule" : [
{
"name" : "low",
"source" : [
{
"context" : "rateQuantity",
"element" : "low",
"variable" : "lo"
}
],
"target" : [
{
"context" : "l",
"contextType" : "variable",
"element" : "value",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "lo.value"
}
]
}
]
},
{
"name" : "low",
"source" : [
{
"context" : "rateQuantity",
"element" : "low",
"variable" : "lo"
}
],
"target" : [
{
"context" : "l",
"contextType" : "variable",
"element" : "unit",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "lo.unit"
}
]
}
]
}
]
},
{
"name" : "low",
"source" : [
{
"context" : "rateQuantity"
}
],
"target" : [
{
"context" : "d",
"contextType" : "variable",
"element" : "high",
"variable" : "h",
"transform" : "create",
"parameter" : [
{
"valueString" : "SimpleQuantity"
}
]
}
],
"rule" : [
{
"name" : "high",
"source" : [
{
"context" : "rateQuantity",
"element" : "high",
"variable" : "hi"
}
],
"target" : [
{
"context" : "h",
"contextType" : "variable",
"element" : "value",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "hi.value"
}
]
}
]
},
{
"name" : "high",
"source" : [
{
"context" : "rateQuantity",
"element" : "high",
"variable" : "hi"
}
],
"target" : [
{
"context" : "h",
"contextType" : "variable",
"element" : "unit",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "hi.unit"
}
]
}
]
}
]
}
]
}
]
}
]
},
{
"name" : "medication",
"source" : [
{
"context" : "sa"
}
],
"target" : [
{
"context" : "bundle",
"contextType" : "variable",
"element" : "entry",
"variable" : "e1"
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "request",
"variable" : "request",
"transform" : "create",
"parameter" : [
{
"valueString" : "BackboneElement"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "method",
"transform" : "copy",
"parameter" : [
{
"valueString" : "POST"
}
]
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "resource",
"variable" : "medication",
"transform" : "create",
"parameter" : [
{
"valueString" : "Medication"
}
]
},
{
"context" : "medication",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid1",
"transform" : "uuid"
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "https://example/Medication/"
},
{
"valueId" : "uuid1"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "url",
"transform" : "copy",
"parameter" : [
{
"valueString" : "Medication"
}
]
},
{
"context" : "medicationAdm",
"contextType" : "variable",
"element" : "medication",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Medication/' + %medication.id"
}
]
}
],
"rule" : [
{
"name" : "reference",
"source" : [
{
"context" : "sa"
}
],
"target" : [
{
"context" : "medicationRq",
"contextType" : "variable",
"element" : "medication",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Medication/' + %medication.id"
}
]
}
]
},
{
"name" : "administrationUnitCode",
"source" : [
{
"context" : "sa",
"element" : "administrationUnitCode",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "medication",
"contextType" : "variable",
"element" : "form",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "consumable",
"source" : [
{
"context" : "sa",
"element" : "consumable",
"variable" : "consumable"
}
],
"rule" : [
{
"name" : "manufac",
"source" : [
{
"context" : "consumable",
"element" : "manufacturedProduct",
"variable" : "manufac"
}
],
"rule" : [
{
"name" : "manufactproduct",
"source" : [
{
"context" : "manufac",
"element" : "manufacturedMaterial",
"variable" : "manuprod"
}
],
"rule" : [
{
"name" : "code",
"source" : [
{
"context" : "manuprod",
"element" : "code",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "medication",
"contextType" : "variable",
"element" : "code",
"variable" : "vvv",
"transform" : "create"
}
]
}
]
}
]
}
]
},
{
"name" : "entryRr",
"source" : [
{
"context" : "sa",
"element" : "entryRelationship",
"variable" : "entryRR"
}
],
"rule" : [
{
"name" : "obs",
"source" : [
{
"context" : "entryRR",
"element" : "observation",
"variable" : "observation"
}
],
"rule" : [
{
"name" : "ingredient",
"source" : [
{
"context" : "observation",
"element" : "code",
"condition" : "displayName = 'Grammatura'"
}
],
"target" : [
{
"context" : "medication",
"contextType" : "variable",
"element" : "ingredient",
"variable" : "ingredient"
}
],
"rule" : [
{
"name" : "consumable",
"source" : [
{
"context" : "sa",
"element" : "consumable",
"variable" : "consumable"
}
],
"rule" : [
{
"name" : "product",
"source" : [
{
"context" : "consumable",
"element" : "manufacturedProduct",
"variable" : "manufacturedProduct"
}
],
"rule" : [
{
"name" : "material",
"source" : [
{
"context" : "manufacturedProduct",
"element" : "manufacturedMaterial",
"variable" : "manufacturedMaterial"
}
],
"rule" : [
{
"name" : "CE",
"source" : [
{
"context" : "manufacturedMaterial",
"element" : "code",
"variable" : "code"
}
],
"target" : [
{
"context" : "ingredient",
"contextType" : "variable",
"element" : "item",
"variable" : "value",
"transform" : "create",
"parameter" : [
{
"valueString" : "CodeableConcept"
}
]
}
],
"dependent" : [
{
"name" : "CECodeableConcept",
"variable" : [
"code",
"value"
]
}
]
}
]
}
]
}
]
},
{
"name" : "strenght",
"source" : [
{
"context" : "observation",
"element" : "value",
"variable" : "value"
}
],
"target" : [
{
"context" : "ingredient",
"contextType" : "variable",
"element" : "strength",
"variable" : "strength"
}
],
"rule" : [
{
"name" : "numerator",
"source" : [
{
"context" : "value"
}
],
"target" : [
{
"context" : "strength",
"contextType" : "variable",
"element" : "numerator",
"variable" : "numerator"
}
],
"rule" : [
{
"name" : "valueN",
"source" : [
{
"context" : "value"
}
],
"target" : [
{
"context" : "numerator",
"contextType" : "variable",
"element" : "value",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "value.value"
}
]
}
]
}
]
},
{
"name" : "denominator",
"source" : [
{
"context" : "value"
}
],
"target" : [
{
"context" : "strength",
"contextType" : "variable",
"element" : "denominator",
"variable" : "denominator"
}
],
"rule" : [
{
"name" : "valueD",
"source" : [
{
"context" : "value"
}
],
"target" : [
{
"context" : "denominator",
"contextType" : "variable",
"element" : "value",
"transform" : "copy",
"parameter" : [
{
"valueInteger" : 1
}
]
}
]
}
]
}
]
}
]
},
{
"name" : "quantita",
"source" : [
{
"context" : "observation",
"element" : "code",
"condition" : "displayName = 'Quantità nella Confezione'"
}
],
"rule" : [
{
"name" : "amount",
"source" : [
{
"context" : "observation",
"element" : "value",
"variable" : "value"
}
],
"target" : [
{
"context" : "medication",
"contextType" : "variable",
"element" : "amount",
"variable" : "amount"
}
],
"rule" : [
{
"name" : "numerator",
"source" : [
{
"context" : "value"
}
],
"target" : [
{
"context" : "amount",
"contextType" : "variable",
"element" : "numerator",
"variable" : "numerator"
}
],
"rule" : [
{
"name" : "valueN",
"source" : [
{
"context" : "value"
}
],
"target" : [
{
"context" : "numerator",
"contextType" : "variable",
"element" : "value",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "value.value"
}
]
}
]
}
]
},
{
"name" : "denominator",
"source" : [
{
"context" : "value"
}
],
"target" : [
{
"context" : "amount",
"contextType" : "variable",
"element" : "denominator",
"variable" : "denominator"
}
],
"rule" : [
{
"name" : "valueD",
"source" : [
{
"context" : "value"
}
],
"target" : [
{
"context" : "denominator",
"contextType" : "variable",
"element" : "value",
"transform" : "copy",
"parameter" : [
{
"valueInteger" : 1
}
]
}
]
}
]
}
]
}
]
}
]
}
]
}
]
},
{
"name" : "entryR",
"source" : [
{
"context" : "sa",
"element" : "entryRelationship",
"variable" : "entryRelationship"
}
],
"rule" : [
{
"name" : "sub",
"source" : [
{
"context" : "entryRelationship",
"element" : "supply",
"variable" : "sup"
}
],
"target" : [
{
"context" : "medicationRq",
"contextType" : "variable",
"element" : "dispenseRequest",
"variable" : "dispreq"
}
],
"rule" : [
{
"name" : "quantity",
"source" : [
{
"context" : "sup"
}
],
"target" : [
{
"context" : "dispreq",
"contextType" : "variable",
"element" : "quantity",
"variable" : "quantity",
"transform" : "create",
"parameter" : [
{
"valueString" : "SimpleQuantity"
}
]
}
],
"rule" : [
{
"name" : "quantity",
"source" : [
{
"context" : "sup",
"element" : "quantity",
"variable" : "q"
}
],
"target" : [
{
"context" : "quantity",
"contextType" : "variable",
"element" : "value",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "q.value"
}
]
}
]
}
]
}
]
}
]
},
{
"name" : "Medicationrequest",
"source" : [
{
"context" : "sa",
"element" : "participant",
"variable" : "participant"
}
],
"rule" : [
{
"name" : "time",
"source" : [
{
"context" : "participant",
"element" : "time",
"variable" : "t"
}
],
"target" : [
{
"context" : "medicationRq",
"contextType" : "variable",
"element" : "authoredOn",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "t.value"
}
]
}
]
},
{
"name" : "perf",
"source" : [
{
"context" : "participant",
"element" : "participantRole",
"variable" : "participantR"
}
],
"target" : [
{
"context" : "bundle",
"contextType" : "variable",
"element" : "entry",
"variable" : "e1"
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "request",
"variable" : "request",
"transform" : "create",
"parameter" : [
{
"valueString" : "BackboneElement"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "method",
"transform" : "copy",
"parameter" : [
{
"valueString" : "PUT"
}
]
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "resource",
"variable" : "practitioner",
"transform" : "create",
"parameter" : [
{
"valueString" : "Practitioner"
}
]
}
],
"rule" : [
{
"name" : "meta",
"source" : [
{
"context" : "participantR"
}
],
"target" : [
{
"context" : "practitioner",
"contextType" : "variable",
"element" : "meta",
"variable" : "meta"
}
],
"rule" : [
{
"name" : "coding",
"source" : [
{
"context" : "participantR"
}
],
"target" : [
{
"context" : "meta",
"contextType" : "variable",
"element" : "tag",
"variable" : "coding",
"transform" : "create",
"parameter" : [
{
"valueString" : "Coding"
}
]
}
],
"rule" : [
{
"name" : "system",
"source" : [
{
"context" : "participantR"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "system",
"transform" : "copy",
"parameter" : [
{
"valueString" : "http://algoritmodiscoring"
}
]
}
]
},
{
"name" : "code",
"source" : [
{
"context" : "participantR"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "code",
"transform" : "copy",
"parameter" : [
{
"valueString" : "ClinicalDocument/body/TerapiaFarmacologicaRicovero/participant"
}
]
}
]
}
]
}
]
},
{
"name" : "identifier",
"source" : [
{
"context" : "participantR",
"element" : "id",
"variable" : "id"
}
],
"target" : [
{
"context" : "practitioner",
"contextType" : "variable",
"element" : "identifier",
"variable" : "identifier"
}
],
"rule" : [
{
"name" : "root1",
"source" : [
{
"context" : "id",
"element" : "root",
"variable" : "r"
}
],
"target" : [
{
"context" : "identifier",
"contextType" : "variable",
"element" : "system",
"transform" : "translate",
"parameter" : [
{
"valueId" : "r"
},
{
"valueString" : "http://hl7.org/fhir/ConceptMap/special-oid2uri"
},
{
"valueString" : "uri"
}
]
}
]
},
{
"name" : "extension",
"source" : [
{
"context" : "id",
"element" : "extension",
"variable" : "ext"
}
],
"target" : [
{
"context" : "identifier",
"contextType" : "variable",
"element" : "value",
"transform" : "copy",
"parameter" : [
{
"valueId" : "ext"
}
]
}
]
},
{
"name" : "assigningAuthorityName",
"source" : [
{
"context" : "id",
"element" : "assigningAuthorityName",
"variable" : "s"
}
],
"target" : [
{
"context" : "identifier",
"contextType" : "variable",
"element" : "assigner",
"variable" : "a"
},
{
"context" : "a",
"contextType" : "variable",
"element" : "display",
"transform" : "copy",
"parameter" : [
{
"valueId" : "s"
}
]
}
]
},
{
"name" : "r",
"source" : [
{
"context" : "id",
"element" : "root",
"variable" : "r"
}
],
"rule" : [
{
"name" : "aut",
"source" : [
{
"context" : "id",
"element" : "extension",
"variable" : "ext"
}
],
"target" : [
{
"context" : "practitioner",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid2",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "r + '-' + ext"
}
]
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "https://example/Practitioner/"
},
{
"valueId" : "uuid2"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "url",
"transform" : "append",
"parameter" : [
{
"valueString" : "Practitioner/"
},
{
"valueId" : "uuid1"
}
]
},
{
"context" : "medicationRq",
"contextType" : "variable",
"element" : "requester",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Practitioner/' + %practitioner.id"
}
]
}
]
}
]
}
]
},
{
"name" : "2.16.840.1.113883.2.9.4.3.2",
"source" : [
{
"context" : "participantR",
"element" : "id",
"variable" : "id",
"condition" : "(root = '2.16.840.1.113883.2.9.4.3.2')"
}
],
"rule" : [
{
"name" : "UUID",
"source" : [
{
"context" : "id",
"element" : "extension",
"variable" : "ext"
}
],
"target" : [
{
"context" : "request",
"contextType" : "variable",
"element" : "url",
"transform" : "append",
"parameter" : [
{
"valueString" : "Practitioner?identifier="
},
{
"valueId" : "ext"
}
]
}
]
}
]
},
{
"name" : "assi",
"source" : [
{
"context" : "participantR",
"element" : "playingEntity",
"variable" : "assi"
}
],
"rule" : [
{
"name" : "name",
"source" : [
{
"context" : "assi",
"element" : "name",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "practitioner",
"contextType" : "variable",
"element" : "name",
"variable" : "vvv",
"transform" : "create"
}
]
}
]
}
]
},
{
"name" : "period",
"source" : [
{
"context" : "sa",
"type" : "EIVL",
"element" : "effectiveTime",
"variable" : "eff"
}
],
"target" : [
{
"context" : "medicationRq",
"contextType" : "variable",
"element" : "dosageInstruction",
"variable" : "dosage",
"transform" : "create",
"parameter" : [
{
"valueString" : "Dosage"
}
]
}
],
"rule" : [
{
"name" : "timing",
"source" : [
{
"context" : "eff"
}
],
"target" : [
{
"context" : "dosage",
"contextType" : "variable",
"element" : "timing",
"variable" : "timing",
"transform" : "create",
"parameter" : [
{
"valueString" : "Timing"
}
]
}
],
"rule" : [
{
"name" : "rep",
"source" : [
{
"context" : "eff"
}
],
"target" : [
{
"context" : "timing",
"contextType" : "variable",
"element" : "repeat",
"variable" : "rep"
}
],
"rule" : [
{
"name" : "event",
"source" : [
{
"context" : "eff",
"element" : "event",
"variable" : "ev"
}
],
"target" : [
{
"context" : "rep",
"contextType" : "variable",
"element" : "where",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "ev.code"
}
]
}
]
}
]
}
]
}
]
},
{
"name" : "tim",
"source" : [
{
"context" : "sa",
"type" : "TS",
"element" : "effectiveTime",
"variable" : "eff"
}
],
"target" : [
{
"context" : "medicationRq",
"contextType" : "variable",
"element" : "dosageInstruction",
"variable" : "dosage",
"transform" : "create",
"parameter" : [
{
"valueString" : "Dosage"
}
]
},
{
"context" : "dosage",
"contextType" : "variable",
"element" : "timing",
"variable" : "timing",
"transform" : "create",
"parameter" : [
{
"valueString" : "Timing"
}
]
},
{
"context" : "timing",
"contextType" : "variable",
"element" : "event",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "eff.value"
}
]
}
]
},
{
"name" : "eff",
"source" : [
{
"context" : "sa",
"type" : "PIVL_TS",
"element" : "effectiveTime",
"variable" : "eff"
}
],
"target" : [
{
"context" : "medicationAdm",
"contextType" : "variable",
"element" : "dosage",
"variable" : "dosage",
"transform" : "create",
"parameter" : [
{
"valueString" : "BackboneElement"
}
]
}
],
"rule" : [
{
"name" : "ratio",
"source" : [
{
"context" : "eff"
}
],
"target" : [
{
"context" : "dosage",
"contextType" : "variable",
"element" : "rate",
"variable" : "ratio",
"transform" : "create",
"parameter" : [
{
"valueString" : "Ratio"
}
]
}
],
"rule" : [
{
"name" : "quanti",
"source" : [
{
"context" : "eff"
}
],
"target" : [
{
"context" : "ratio",
"contextType" : "variable",
"element" : "numerator",
"variable" : "quan",
"transform" : "create",
"parameter" : [
{
"valueString" : "Quantity"
}
]
}
],
"rule" : [
{
"name" : "period",
"source" : [
{
"context" : "eff",
"element" : "period",
"variable" : "per"
}
],
"target" : [
{
"context" : "quan",
"contextType" : "variable",
"element" : "value",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "per.value"
}
]
}
]
},
{
"name" : "period",
"source" : [
{
"context" : "eff",
"element" : "period",
"variable" : "per"
}
],
"target" : [
{
"context" : "quan",
"contextType" : "variable",
"element" : "unit",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "per.unit"
}
]
}
]
}
]
},
{
"name" : "quanti",
"source" : [
{
"context" : "eff"
}
],
"target" : [
{
"context" : "ratio",
"contextType" : "variable",
"element" : "denominator",
"variable" : "quan",
"transform" : "create",
"parameter" : [
{
"valueString" : "Quantity"
}
]
}
],
"rule" : [
{
"name" : "period",
"source" : [
{
"context" : "eff",
"element" : "period"
}
],
"target" : [
{
"context" : "quan",
"contextType" : "variable",
"element" : "value",
"transform" : "copy",
"parameter" : [
{
"valueString" : "1"
}
]
}
]
},
{
"name" : "period",
"source" : [
{
"context" : "eff",
"element" : "period",
"variable" : "per"
}
],
"target" : [
{
"context" : "quan",
"contextType" : "variable",
"element" : "unit",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "per.unit"
}
]
}
]
}
]
}
]
}
]
}
]
}
]
}
]
}
]
}
]
},
{
"name" : "ClinicalDocumentSottoSectionOBS",
"typeMode" : "none",
"input" : [
{
"name" : "src",
"type" : "Section",
"mode" : "source"
},
{
"name" : "tgt",
"mode" : "target"
},
{
"name" : "bundle",
"type" : "Bundle",
"mode" : "target"
},
{
"name" : "enc",
"type" : "Encounter",
"mode" : "target"
},
{
"name" : "patient",
"type" : "Patient",
"mode" : "target"
}
],
"rule" : [
{
"name" : "title",
"source" : [
{
"context" : "src",
"element" : "title",
"variable" : "t"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "title",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "t.dataString"
}
]
}
]
},
{
"name" : "code",
"source" : [
{
"context" : "src",
"element" : "code",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "code",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "cdaText",
"source" : [
{
"context" : "src",
"element" : "text",
"variable" : "cdaText"
}
],
"target" : [
{
"context" : "bundle",
"contextType" : "variable",
"element" : "entry",
"variable" : "e1"
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "request",
"variable" : "request",
"transform" : "create",
"parameter" : [
{
"valueString" : "BackboneElement"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "method",
"transform" : "copy",
"parameter" : [
{
"valueString" : "POST"
}
]
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "resource",
"variable" : "observation",
"transform" : "create",
"parameter" : [
{
"valueString" : "Observation"
}
]
},
{
"context" : "observation",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid1",
"transform" : "uuid"
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "https://example/Observation/"
},
{
"valueId" : "uuid1"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "url",
"transform" : "copy",
"parameter" : [
{
"valueString" : "Observation"
}
]
},
{
"context" : "tgt",
"contextType" : "variable",
"element" : "entry",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Observation/' + %observation.id"
}
]
},
{
"context" : "tgt",
"contextType" : "variable",
"element" : "text",
"variable" : "fhirText"
}
],
"rule" : [
{
"name" : "narrativeStatus",
"source" : [
{
"context" : "cdaText"
}
],
"target" : [
{
"context" : "fhirText",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "generated"
}
]
}
]
},
{
"name" : "narrativeText",
"source" : [
{
"context" : "cdaText",
"variable" : "t"
}
],
"target" : [
{
"context" : "fhirText",
"contextType" : "variable",
"element" : "div",
"transform" : "copy",
"parameter" : [
{
"valueId" : "t"
}
]
}
]
},
{
"name" : "code",
"source" : [
{
"context" : "src",
"element" : "code",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "observation",
"contextType" : "variable",
"element" : "code",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "reference",
"source" : [
{
"context" : "src"
}
],
"target" : [
{
"context" : "observation",
"contextType" : "variable",
"element" : "subject",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Patient/' + %patient.id"
}
]
}
]
},
{
"name" : "reference",
"source" : [
{
"context" : "src"
}
],
"target" : [
{
"context" : "observation",
"contextType" : "variable",
"element" : "encounter",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Encounter/' + %enc.id"
}
]
}
]
},
{
"name" : "statuscode",
"source" : [
{
"context" : "src",
"condition" : "observation.statusCode.exists().not()"
}
],
"rule" : [
{
"name" : "status",
"source" : [
{
"context" : "src"
}
],
"target" : [
{
"context" : "observation",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "final"
}
]
}
]
}
]
},
{
"name" : "reference",
"source" : [
{
"context" : "cdaText"
}
],
"target" : [
{
"context" : "observation",
"contextType" : "variable",
"element" : "note",
"variable" : "note"
}
],
"rule" : [
{
"name" : "reference",
"source" : [
{
"context" : "cdaText",
"variable" : "t"
}
],
"target" : [
{
"context" : "note",
"contextType" : "variable",
"element" : "text",
"transform" : "copy",
"parameter" : [
{
"valueId" : "t"
}
]
}
]
}
]
}
]
}
]
},
{
"name" : "ClinicalDocumentSottoSectionMS",
"typeMode" : "none",
"input" : [
{
"name" : "src",
"type" : "Section",
"mode" : "source"
},
{
"name" : "tgt",
"mode" : "target"
},
{
"name" : "bundle",
"type" : "Bundle",
"mode" : "target"
},
{
"name" : "patient",
"type" : "Patient",
"mode" : "target"
},
{
"name" : "enc",
"type" : "Encounter",
"mode" : "target"
}
],
"rule" : [
{
"name" : "title",
"source" : [
{
"context" : "src",
"element" : "title",
"variable" : "t"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "title",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "t.dataString"
}
]
}
]
},
{
"name" : "code",
"source" : [
{
"context" : "src",
"element" : "code",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "code",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "cdaText",
"source" : [
{
"context" : "src",
"element" : "text",
"variable" : "cdaText"
}
],
"target" : [
{
"context" : "bundle",
"contextType" : "variable",
"element" : "entry",
"variable" : "e1"
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "request",
"variable" : "request",
"transform" : "create",
"parameter" : [
{
"valueString" : "BackboneElement"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "method",
"transform" : "copy",
"parameter" : [
{
"valueString" : "POST"
}
]
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "resource",
"variable" : "Medicationstatement",
"transform" : "create",
"parameter" : [
{
"valueString" : "MedicationStatement"
}
]
},
{
"context" : "Medicationstatement",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid1",
"transform" : "uuid"
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "https://example/MedicationStatement/"
},
{
"valueId" : "uuid1"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "url",
"transform" : "copy",
"parameter" : [
{
"valueString" : "MedicationStatement"
}
]
},
{
"context" : "tgt",
"contextType" : "variable",
"element" : "entry",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/MedicationStatement/' + %Medicationstatement.id"
}
]
},
{
"context" : "tgt",
"contextType" : "variable",
"element" : "text",
"variable" : "fhirText"
}
],
"rule" : [
{
"name" : "reference",
"source" : [
{
"context" : "cdaText"
}
],
"target" : [
{
"context" : "Medicationstatement",
"contextType" : "variable",
"element" : "note",
"variable" : "note"
}
],
"rule" : [
{
"name" : "reference",
"source" : [
{
"context" : "cdaText",
"variable" : "t"
}
],
"target" : [
{
"context" : "note",
"contextType" : "variable",
"element" : "text",
"transform" : "copy",
"parameter" : [
{
"valueId" : "t"
}
]
}
]
},
{
"name" : "text",
"source" : [
{
"context" : "cdaText",
"variable" : "t"
}
],
"target" : [
{
"context" : "Medicationstatement",
"contextType" : "variable",
"element" : "medication",
"variable" : "medication",
"transform" : "create",
"parameter" : [
{
"valueString" : "CodeableConcept"
}
]
},
{
"context" : "medication",
"contextType" : "variable",
"element" : "text",
"transform" : "copy",
"parameter" : [
{
"valueId" : "t"
}
]
}
]
}
]
},
{
"name" : "reference",
"source" : [
{
"context" : "src"
}
],
"target" : [
{
"context" : "Medicationstatement",
"contextType" : "variable",
"element" : "subject",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Patient/' + %patient.id"
}
]
}
]
},
{
"name" : "status",
"source" : [
{
"context" : "src"
}
],
"target" : [
{
"context" : "Medicationstatement",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "unknown"
}
]
}
]
}
]
}
]
},
{
"name" : "Observation",
"typeMode" : "none",
"input" : [
{
"name" : "obs",
"type" : "Observation",
"mode" : "source"
},
{
"name" : "patient",
"type" : "Patient",
"mode" : "target"
},
{
"name" : "encounter",
"type" : "Encounter",
"mode" : "target"
},
{
"name" : "ob",
"type" : "Observation",
"mode" : "target"
},
{
"name" : "bundle",
"type" : "Bundle",
"mode" : "target"
}
],
"rule" : [
{
"name" : "reference",
"source" : [
{
"context" : "obs"
}
],
"target" : [
{
"context" : "ob",
"contextType" : "variable",
"element" : "subject",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Patient/' + %patient.id"
}
]
}
]
},
{
"name" : "reference",
"source" : [
{
"context" : "obs"
}
],
"target" : [
{
"context" : "ob",
"contextType" : "variable",
"element" : "encounter",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Encounter/' + %encounter.id"
}
]
}
]
},
{
"name" : "code",
"source" : [
{
"context" : "obs",
"element" : "code",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "ob",
"contextType" : "variable",
"element" : "code",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "statusCode",
"source" : [
{
"context" : "obs",
"element" : "statusCode",
"variable" : "statusc",
"condition" : "(code = 'completed')"
}
],
"target" : [
{
"context" : "ob",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "final"
}
]
}
]
},
{
"name" : "statusCode",
"source" : [
{
"context" : "obs",
"element" : "statusCode",
"variable" : "statusc",
"condition" : "(code = 'active')"
}
],
"target" : [
{
"context" : "ob",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "registered"
}
]
}
]
},
{
"name" : "statusCode",
"source" : [
{
"context" : "obs",
"element" : "statusCode",
"variable" : "statusc",
"condition" : "(code = 'aborted')"
}
],
"target" : [
{
"context" : "ob",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "cancelled"
}
]
}
]
},
{
"name" : "statusCode",
"source" : [
{
"context" : "obs",
"element" : "statusCode",
"variable" : "statusc",
"condition" : "(code = 'suspended')"
}
],
"target" : [
{
"context" : "ob",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "partial"
}
]
}
]
},
{
"name" : "statuscode",
"source" : [
{
"context" : "obs",
"condition" : "obs.statusCode.exists().not()"
}
],
"rule" : [
{
"name" : "status",
"source" : [
{
"context" : "obs"
}
],
"target" : [
{
"context" : "ob",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "final"
}
]
}
]
}
]
},
{
"name" : "value2",
"source" : [
{
"context" : "obs",
"element" : "effectiveTime",
"variable" : "effectiveTime"
}
],
"target" : [
{
"context" : "ob",
"contextType" : "variable",
"element" : "effective",
"variable" : "value",
"transform" : "create",
"parameter" : [
{
"valueString" : "dateTime"
}
]
}
],
"dependent" : [
{
"name" : "TSDateTime",
"variable" : [
"effectiveTime",
"value"
]
}
]
},
{
"name" : "where",
"source" : [
{
"context" : "obs",
"condition" : "effectiveTime.low.exists() or effectiveTime.high.exists()"
}
],
"rule" : [
{
"name" : "value3",
"source" : [
{
"context" : "obs",
"element" : "effectiveTime",
"variable" : "eff"
}
],
"target" : [
{
"context" : "ob",
"contextType" : "variable",
"element" : "effective",
"variable" : "period",
"transform" : "create",
"parameter" : [
{
"valueString" : "Period"
}
]
}
],
"dependent" : [
{
"name" : "IVLTSPeriod",
"variable" : [
"eff",
"period"
]
}
]
}
]
},
{
"name" : "value",
"source" : [
{
"context" : "obs",
"type" : "INT",
"element" : "value",
"variable" : "int"
}
],
"target" : [
{
"context" : "ob",
"contextType" : "variable",
"element" : "value",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "int.value"
}
]
}
]
},
{
"name" : "boolean",
"source" : [
{
"context" : "obs",
"type" : "BL",
"element" : "value",
"variable" : "boolean"
}
],
"target" : [
{
"context" : "ob",
"contextType" : "variable",
"element" : "value",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "boolean.value"
}
]
}
]
},
{
"name" : "val",
"source" : [
{
"context" : "obs",
"type" : "CD",
"element" : "value",
"variable" : "val"
}
],
"rule" : [
{
"name" : "coding",
"source" : [
{
"context" : "val"
}
],
"target" : [
{
"context" : "ob",
"contextType" : "variable",
"element" : "value",
"variable" : "ce",
"transform" : "create",
"parameter" : [
{
"valueString" : "CodeableConcept"
}
]
}
],
"rule" : [
{
"name" : "originalText",
"source" : [
{
"context" : "val",
"element" : "originalText",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "ce",
"contextType" : "variable",
"element" : "text",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "code",
"source" : [
{
"context" : "val"
}
],
"target" : [
{
"context" : "ce",
"contextType" : "variable",
"element" : "coding",
"variable" : "coding"
}
],
"rule" : [
{
"name" : "code",
"source" : [
{
"context" : "val",
"element" : "code",
"variable" : "code"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "code",
"transform" : "cast",
"parameter" : [
{
"valueId" : "code"
},
{
"valueString" : "string"
}
]
}
]
},
{
"name" : "codeSystem",
"source" : [
{
"context" : "val",
"element" : "codeSystem",
"variable" : "system"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "system",
"transform" : "translate",
"parameter" : [
{
"valueId" : "system"
},
{
"valueString" : "http://hl7.org/fhir/ConceptMap/special-oid2uri"
},
{
"valueString" : "uri"
}
]
}
]
},
{
"name" : "displayName",
"source" : [
{
"context" : "val",
"element" : "displayName",
"variable" : "display"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "display",
"transform" : "cast",
"parameter" : [
{
"valueId" : "display"
},
{
"valueString" : "string"
}
]
}
]
}
]
},
{
"name" : "translation",
"source" : [
{
"context" : "val",
"element" : "translation",
"variable" : "translation"
}
],
"target" : [
{
"context" : "ce",
"contextType" : "variable",
"element" : "coding",
"variable" : "coding"
}
],
"rule" : [
{
"name" : "code",
"source" : [
{
"context" : "translation",
"element" : "code",
"variable" : "code"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "code",
"transform" : "cast",
"parameter" : [
{
"valueId" : "code"
},
{
"valueString" : "string"
}
]
}
]
},
{
"name" : "codeSystem",
"source" : [
{
"context" : "translation",
"element" : "codeSystem",
"variable" : "system"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "system",
"transform" : "translate",
"parameter" : [
{
"valueId" : "system"
},
{
"valueString" : "http://hl7.org/fhir/ConceptMap/special-oid2uri"
},
{
"valueString" : "uri"
}
]
}
]
},
{
"name" : "displayName",
"source" : [
{
"context" : "translation",
"element" : "displayName",
"variable" : "display"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "display",
"transform" : "cast",
"parameter" : [
{
"valueId" : "display"
},
{
"valueString" : "string"
}
]
}
]
},
{
"name" : "qualifier",
"source" : [
{
"context" : "translation",
"element" : "qualifier",
"variable" : "qualifier"
}
],
"rule" : [
{
"name" : "value",
"source" : [
{
"context" : "qualifier",
"element" : "value",
"variable" : "value"
}
],
"target" : [
{
"context" : "ce",
"contextType" : "variable",
"element" : "coding",
"variable" : "coding"
}
],
"rule" : [
{
"name" : "code",
"source" : [
{
"context" : "value",
"element" : "code",
"variable" : "code"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "code",
"transform" : "cast",
"parameter" : [
{
"valueId" : "code"
},
{
"valueString" : "string"
}
]
}
]
},
{
"name" : "codeSystem",
"source" : [
{
"context" : "value",
"element" : "codeSystem",
"variable" : "system"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "system",
"transform" : "translate",
"parameter" : [
{
"valueId" : "system"
},
{
"valueString" : "http://hl7.org/fhir/ConceptMap/special-oid2uri"
},
{
"valueString" : "uri"
}
]
}
]
},
{
"name" : "displayName",
"source" : [
{
"context" : "value",
"element" : "displayName",
"variable" : "display"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "display",
"transform" : "cast",
"parameter" : [
{
"valueId" : "display"
},
{
"valueString" : "string"
}
]
}
]
}
]
}
]
}
]
}
]
}
]
},
{
"name" : "val",
"source" : [
{
"context" : "obs",
"type" : "CE",
"element" : "value",
"variable" : "val"
}
],
"rule" : [
{
"name" : "coding",
"source" : [
{
"context" : "val"
}
],
"target" : [
{
"context" : "ob",
"contextType" : "variable",
"element" : "value",
"variable" : "ce",
"transform" : "create",
"parameter" : [
{
"valueString" : "CodeableConcept"
}
]
}
],
"rule" : [
{
"name" : "originalText",
"source" : [
{
"context" : "val",
"element" : "originalText",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "ce",
"contextType" : "variable",
"element" : "text",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "code",
"source" : [
{
"context" : "val"
}
],
"target" : [
{
"context" : "ce",
"contextType" : "variable",
"element" : "coding",
"variable" : "coding"
}
],
"rule" : [
{
"name" : "code",
"source" : [
{
"context" : "val",
"element" : "code",
"variable" : "code"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "code",
"transform" : "cast",
"parameter" : [
{
"valueId" : "code"
},
{
"valueString" : "string"
}
]
}
]
},
{
"name" : "codeSystem",
"source" : [
{
"context" : "val",
"element" : "codeSystem",
"variable" : "system"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "system",
"transform" : "translate",
"parameter" : [
{
"valueId" : "system"
},
{
"valueString" : "http://hl7.org/fhir/ConceptMap/special-oid2uri"
},
{
"valueString" : "uri"
}
]
}
]
},
{
"name" : "displayName",
"source" : [
{
"context" : "val",
"element" : "displayName",
"variable" : "display"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "display",
"transform" : "cast",
"parameter" : [
{
"valueId" : "display"
},
{
"valueString" : "string"
}
]
}
]
}
]
},
{
"name" : "translation",
"source" : [
{
"context" : "val",
"element" : "translation",
"variable" : "translation"
}
],
"target" : [
{
"context" : "ce",
"contextType" : "variable",
"element" : "coding",
"variable" : "coding"
}
],
"rule" : [
{
"name" : "code",
"source" : [
{
"context" : "translation",
"element" : "code",
"variable" : "code"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "code",
"transform" : "cast",
"parameter" : [
{
"valueId" : "code"
},
{
"valueString" : "string"
}
]
}
]
},
{
"name" : "codeSystem",
"source" : [
{
"context" : "translation",
"element" : "codeSystem",
"variable" : "system"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "system",
"transform" : "translate",
"parameter" : [
{
"valueId" : "system"
},
{
"valueString" : "http://hl7.org/fhir/ConceptMap/special-oid2uri"
},
{
"valueString" : "uri"
}
]
}
]
},
{
"name" : "displayName",
"source" : [
{
"context" : "translation",
"element" : "displayName",
"variable" : "display"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "display",
"transform" : "cast",
"parameter" : [
{
"valueId" : "display"
},
{
"valueString" : "string"
}
]
}
]
},
{
"name" : "qualifier",
"source" : [
{
"context" : "translation",
"element" : "qualifier",
"variable" : "qualifier"
}
],
"rule" : [
{
"name" : "value",
"source" : [
{
"context" : "qualifier",
"element" : "value",
"variable" : "value"
}
],
"target" : [
{
"context" : "ce",
"contextType" : "variable",
"element" : "coding",
"variable" : "coding"
}
],
"rule" : [
{
"name" : "code",
"source" : [
{
"context" : "value",
"element" : "code",
"variable" : "code"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "code",
"transform" : "cast",
"parameter" : [
{
"valueId" : "code"
},
{
"valueString" : "string"
}
]
}
]
},
{
"name" : "codeSystem",
"source" : [
{
"context" : "value",
"element" : "codeSystem",
"variable" : "system"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "system",
"transform" : "translate",
"parameter" : [
{
"valueId" : "system"
},
{
"valueString" : "http://hl7.org/fhir/ConceptMap/special-oid2uri"
},
{
"valueString" : "uri"
}
]
}
]
},
{
"name" : "displayName",
"source" : [
{
"context" : "value",
"element" : "displayName",
"variable" : "display"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "display",
"transform" : "cast",
"parameter" : [
{
"valueId" : "display"
},
{
"valueString" : "string"
}
]
}
]
}
]
}
]
}
]
}
]
}
]
},
{
"name" : "valueQuantity",
"source" : [
{
"context" : "obs",
"type" : "PQ",
"element" : "value",
"variable" : "val"
}
],
"rule" : [
{
"name" : "quantity",
"source" : [
{
"context" : "val"
}
],
"target" : [
{
"context" : "ob",
"contextType" : "variable",
"element" : "value",
"variable" : "quantity",
"transform" : "create",
"parameter" : [
{
"valueString" : "Quantity"
}
]
}
],
"rule" : [
{
"name" : "value",
"source" : [
{
"context" : "val",
"element" : "value",
"variable" : "value"
}
],
"target" : [
{
"context" : "quantity",
"contextType" : "variable",
"element" : "value",
"transform" : "copy",
"parameter" : [
{
"valueId" : "value"
}
]
}
]
},
{
"name" : "unit",
"source" : [
{
"context" : "val",
"element" : "unit",
"variable" : "unit"
}
],
"target" : [
{
"context" : "quantity",
"contextType" : "variable",
"element" : "unit",
"transform" : "copy",
"parameter" : [
{
"valueId" : "unit"
}
]
}
]
}
]
}
]
},
{
"name" : "value",
"source" : [
{
"context" : "obs",
"type" : "ST",
"element" : "value",
"variable" : "value"
}
],
"target" : [
{
"context" : "ob",
"contextType" : "variable",
"element" : "value",
"transform" : "create",
"parameter" : [
{
"valueString" : "string"
}
]
},
{
"context" : "ob",
"contextType" : "variable",
"element" : "value",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "value.dataString"
}
]
}
]
},
{
"name" : "interpretationCode",
"source" : [
{
"context" : "obs",
"element" : "interpretationCode",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "ob",
"contextType" : "variable",
"element" : "interpretation",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "methodCode",
"source" : [
{
"context" : "obs",
"element" : "methodCode",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "ob",
"contextType" : "variable",
"element" : "method",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "refRange",
"source" : [
{
"context" : "obs",
"element" : "referenceRange",
"variable" : "refRange"
}
],
"target" : [
{
"context" : "ob",
"contextType" : "variable",
"element" : "referenceRange",
"variable" : "ref",
"transform" : "create",
"parameter" : [
{
"valueString" : "BackboneElement"
}
]
}
],
"rule" : [
{
"name" : "obsRange",
"source" : [
{
"context" : "refRange",
"element" : "observationRange",
"variable" : "obsRange"
}
],
"target" : [
{
"context" : "ref",
"contextType" : "variable",
"element" : "low",
"variable" : "Low",
"transform" : "create",
"parameter" : [
{
"valueString" : "SimpleQuantity"
}
]
}
],
"rule" : [
{
"name" : "IVLPQ",
"source" : [
{
"context" : "obsRange",
"type" : "IVL_PQ",
"element" : "value",
"variable" : "v"
}
],
"rule" : [
{
"name" : "decValue",
"source" : [
{
"context" : "v",
"element" : "low",
"variable" : "l1"
}
],
"rule" : [
{
"name" : "value",
"source" : [
{
"context" : "l1",
"element" : "value",
"variable" : "decValue"
}
],
"target" : [
{
"context" : "Low",
"contextType" : "variable",
"element" : "value",
"transform" : "copy",
"parameter" : [
{
"valueId" : "decValue"
}
]
}
]
},
{
"name" : "unit",
"source" : [
{
"context" : "l1",
"element" : "unit",
"variable" : "Unit"
}
],
"target" : [
{
"context" : "Low",
"contextType" : "variable",
"element" : "unit",
"transform" : "copy",
"parameter" : [
{
"valueId" : "Unit"
}
]
}
]
}
]
}
]
}
]
}
]
}
]
},
{
"name" : "ObservationConsulenza",
"typeMode" : "none",
"input" : [
{
"name" : "obs",
"type" : "Observation",
"mode" : "source"
},
{
"name" : "patient",
"type" : "Patient",
"mode" : "target"
},
{
"name" : "encounter",
"type" : "Encounter",
"mode" : "target"
},
{
"name" : "ob",
"type" : "Observation",
"mode" : "target"
},
{
"name" : "bundle",
"type" : "Bundle",
"mode" : "target"
}
],
"rule" : [
{
"name" : "reference",
"source" : [
{
"context" : "obs"
}
],
"target" : [
{
"context" : "ob",
"contextType" : "variable",
"element" : "subject",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Patient/' + %patient.id"
}
]
}
]
},
{
"name" : "reference",
"source" : [
{
"context" : "obs"
}
],
"target" : [
{
"context" : "ob",
"contextType" : "variable",
"element" : "encounter",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Encounter/' + %encounter.id"
}
]
}
]
},
{
"name" : "code",
"source" : [
{
"context" : "obs",
"element" : "code",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "ob",
"contextType" : "variable",
"element" : "code",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "statusCode",
"source" : [
{
"context" : "obs",
"element" : "statusCode",
"variable" : "statusc",
"condition" : "(code = 'completed')"
}
],
"target" : [
{
"context" : "ob",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "final"
}
]
}
]
},
{
"name" : "statusCode",
"source" : [
{
"context" : "obs",
"element" : "statusCode",
"variable" : "statusc",
"condition" : "(code = 'active')"
}
],
"target" : [
{
"context" : "ob",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "registered"
}
]
}
]
},
{
"name" : "statusCode",
"source" : [
{
"context" : "obs",
"element" : "statusCode",
"variable" : "statusc",
"condition" : "(code = 'aborted')"
}
],
"target" : [
{
"context" : "ob",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "cancelled"
}
]
}
]
},
{
"name" : "statusCode",
"source" : [
{
"context" : "obs",
"element" : "statusCode",
"variable" : "statusc",
"condition" : "(code = 'suspended')"
}
],
"target" : [
{
"context" : "ob",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "partial"
}
]
}
]
},
{
"name" : "statuscode",
"source" : [
{
"context" : "obs",
"condition" : "obs.statusCode.exists().not()"
}
],
"rule" : [
{
"name" : "status",
"source" : [
{
"context" : "obs"
}
],
"target" : [
{
"context" : "ob",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "final"
}
]
}
]
}
]
},
{
"name" : "value2c",
"source" : [
{
"context" : "obs",
"element" : "effectiveTime",
"variable" : "effectiveTime"
}
],
"target" : [
{
"context" : "ob",
"contextType" : "variable",
"element" : "effective",
"variable" : "value",
"transform" : "create",
"parameter" : [
{
"valueString" : "dateTime"
}
]
}
],
"dependent" : [
{
"name" : "TSDateTime",
"variable" : [
"effectiveTime",
"value"
]
}
]
},
{
"name" : "where",
"source" : [
{
"context" : "obs",
"condition" : "effectiveTime.low.exists() or effectiveTime.high.exists()"
}
],
"rule" : [
{
"name" : "value3c",
"source" : [
{
"context" : "obs",
"element" : "effectiveTime",
"variable" : "eff"
}
],
"target" : [
{
"context" : "ob",
"contextType" : "variable",
"element" : "effective",
"variable" : "period",
"transform" : "create",
"parameter" : [
{
"valueString" : "Period"
}
]
}
],
"dependent" : [
{
"name" : "IVLTSPeriod",
"variable" : [
"eff",
"period"
]
}
]
}
]
},
{
"name" : "value",
"source" : [
{
"context" : "obs",
"type" : "INT",
"element" : "value",
"variable" : "int"
}
],
"target" : [
{
"context" : "ob",
"contextType" : "variable",
"element" : "value",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "int.value"
}
]
}
]
},
{
"name" : "boolean",
"source" : [
{
"context" : "obs",
"type" : "BL",
"element" : "value",
"variable" : "boolean"
}
],
"target" : [
{
"context" : "ob",
"contextType" : "variable",
"element" : "value",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "boolean.value"
}
]
}
]
},
{
"name" : "val",
"source" : [
{
"context" : "obs",
"type" : "CE",
"element" : "value",
"variable" : "val"
}
],
"rule" : [
{
"name" : "coding",
"source" : [
{
"context" : "val"
}
],
"target" : [
{
"context" : "ob",
"contextType" : "variable",
"element" : "value",
"variable" : "ce",
"transform" : "create",
"parameter" : [
{
"valueString" : "CodeableConcept"
}
]
}
],
"rule" : [
{
"name" : "originltext",
"source" : [
{
"context" : "val",
"element" : "originalText",
"variable" : "originalText"
}
],
"rule" : [
{
"name" : "reference",
"source" : [
{
"context" : "originalText",
"element" : "reference",
"variable" : "reference"
}
],
"target" : [
{
"context" : "ce",
"contextType" : "variable",
"element" : "text",
"transform" : "copy",
"parameter" : [
{
"valueId" : "reference"
}
]
}
]
}
]
},
{
"name" : "code",
"source" : [
{
"context" : "val"
}
],
"target" : [
{
"context" : "ce",
"contextType" : "variable",
"element" : "coding",
"variable" : "coding"
}
],
"rule" : [
{
"name" : "code",
"source" : [
{
"context" : "val",
"element" : "code",
"variable" : "code"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "code",
"transform" : "cast",
"parameter" : [
{
"valueId" : "code"
},
{
"valueString" : "string"
}
]
}
]
},
{
"name" : "codeSystem",
"source" : [
{
"context" : "val",
"element" : "codeSystem",
"variable" : "system"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "system",
"transform" : "translate",
"parameter" : [
{
"valueId" : "system"
},
{
"valueString" : "http://hl7.org/fhir/ConceptMap/special-oid2uri"
},
{
"valueString" : "uri"
}
]
}
]
},
{
"name" : "displayName",
"source" : [
{
"context" : "val",
"element" : "displayName",
"variable" : "display"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "display",
"transform" : "cast",
"parameter" : [
{
"valueId" : "display"
},
{
"valueString" : "string"
}
]
}
]
},
{
"name" : "codeSystemVersion",
"source" : [
{
"context" : "val",
"element" : "codeSystemVersion",
"variable" : "version"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "version",
"transform" : "cast",
"parameter" : [
{
"valueId" : "version"
},
{
"valueString" : "string"
}
]
}
]
}
]
},
{
"name" : "translation",
"source" : [
{
"context" : "val",
"element" : "translation",
"variable" : "translation"
}
],
"target" : [
{
"context" : "ce",
"contextType" : "variable",
"element" : "coding",
"variable" : "coding"
}
],
"rule" : [
{
"name" : "code",
"source" : [
{
"context" : "translation",
"element" : "code",
"variable" : "code"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "code",
"transform" : "cast",
"parameter" : [
{
"valueId" : "code"
},
{
"valueString" : "string"
}
]
}
]
},
{
"name" : "codeSystem",
"source" : [
{
"context" : "translation",
"element" : "codeSystem",
"variable" : "system"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "system",
"transform" : "translate",
"parameter" : [
{
"valueId" : "system"
},
{
"valueString" : "http://hl7.org/fhir/ConceptMap/special-oid2uri"
},
{
"valueString" : "uri"
}
]
}
]
},
{
"name" : "displayName",
"source" : [
{
"context" : "translation",
"element" : "displayName",
"variable" : "display"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "display",
"transform" : "cast",
"parameter" : [
{
"valueId" : "display"
},
{
"valueString" : "string"
}
]
}
]
},
{
"name" : "codeSystemVersion",
"source" : [
{
"context" : "translation",
"element" : "codeSystemVersion",
"variable" : "version"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "version",
"transform" : "cast",
"parameter" : [
{
"valueId" : "version"
},
{
"valueString" : "string"
}
]
}
]
},
{
"name" : "qualifier",
"source" : [
{
"context" : "translation",
"element" : "qualifier",
"variable" : "qualifier"
}
],
"rule" : [
{
"name" : "value",
"source" : [
{
"context" : "qualifier",
"element" : "value",
"variable" : "value"
}
],
"target" : [
{
"context" : "ce",
"contextType" : "variable",
"element" : "coding",
"variable" : "coding"
}
],
"rule" : [
{
"name" : "code",
"source" : [
{
"context" : "value",
"element" : "code",
"variable" : "code"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "code",
"transform" : "cast",
"parameter" : [
{
"valueId" : "code"
},
{
"valueString" : "string"
}
]
}
]
},
{
"name" : "codeSystem",
"source" : [
{
"context" : "value",
"element" : "codeSystem",
"variable" : "system"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "system",
"transform" : "translate",
"parameter" : [
{
"valueId" : "system"
},
{
"valueString" : "http://hl7.org/fhir/ConceptMap/special-oid2uri"
},
{
"valueString" : "uri"
}
]
}
]
},
{
"name" : "displayName",
"source" : [
{
"context" : "value",
"element" : "displayName",
"variable" : "display"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "display",
"transform" : "cast",
"parameter" : [
{
"valueId" : "display"
},
{
"valueString" : "string"
}
]
}
]
},
{
"name" : "codeSystemVersion",
"source" : [
{
"context" : "value",
"element" : "codeSystemVersion",
"variable" : "version"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "version",
"transform" : "cast",
"parameter" : [
{
"valueId" : "version"
},
{
"valueString" : "string"
}
]
}
]
}
]
}
]
}
]
}
]
}
]
},
{
"name" : "val",
"source" : [
{
"context" : "obs",
"type" : "CD",
"element" : "value",
"variable" : "val"
}
],
"rule" : [
{
"name" : "coding",
"source" : [
{
"context" : "val"
}
],
"target" : [
{
"context" : "ob",
"contextType" : "variable",
"element" : "value",
"variable" : "ce",
"transform" : "create",
"parameter" : [
{
"valueString" : "CodeableConcept"
}
]
}
],
"rule" : [
{
"name" : "originalText",
"source" : [
{
"context" : "val",
"element" : "originalText",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "ce",
"contextType" : "variable",
"element" : "text",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "code",
"source" : [
{
"context" : "val"
}
],
"target" : [
{
"context" : "ce",
"contextType" : "variable",
"element" : "coding",
"variable" : "coding"
}
],
"rule" : [
{
"name" : "code",
"source" : [
{
"context" : "val",
"element" : "code",
"variable" : "code"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "code",
"transform" : "cast",
"parameter" : [
{
"valueId" : "code"
},
{
"valueString" : "string"
}
]
}
]
},
{
"name" : "codeSystem",
"source" : [
{
"context" : "val",
"element" : "codeSystem",
"variable" : "system"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "system",
"transform" : "translate",
"parameter" : [
{
"valueId" : "system"
},
{
"valueString" : "http://hl7.org/fhir/ConceptMap/special-oid2uri"
},
{
"valueString" : "uri"
}
]
}
]
},
{
"name" : "displayName",
"source" : [
{
"context" : "val",
"element" : "displayName",
"variable" : "display"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "display",
"transform" : "cast",
"parameter" : [
{
"valueId" : "display"
},
{
"valueString" : "string"
}
]
}
]
}
]
},
{
"name" : "translation",
"source" : [
{
"context" : "val",
"element" : "translation",
"variable" : "translation"
}
],
"target" : [
{
"context" : "ce",
"contextType" : "variable",
"element" : "coding",
"variable" : "coding"
}
],
"rule" : [
{
"name" : "code",
"source" : [
{
"context" : "translation",
"element" : "code",
"variable" : "code"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "code",
"transform" : "cast",
"parameter" : [
{
"valueId" : "code"
},
{
"valueString" : "string"
}
]
}
]
},
{
"name" : "codeSystem",
"source" : [
{
"context" : "translation",
"element" : "codeSystem",
"variable" : "system"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "system",
"transform" : "translate",
"parameter" : [
{
"valueId" : "system"
},
{
"valueString" : "http://hl7.org/fhir/ConceptMap/special-oid2uri"
},
{
"valueString" : "uri"
}
]
}
]
},
{
"name" : "displayName",
"source" : [
{
"context" : "translation",
"element" : "displayName",
"variable" : "display"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "display",
"transform" : "cast",
"parameter" : [
{
"valueId" : "display"
},
{
"valueString" : "string"
}
]
}
]
},
{
"name" : "qualifier",
"source" : [
{
"context" : "translation",
"element" : "qualifier",
"variable" : "qualifier"
}
],
"rule" : [
{
"name" : "value",
"source" : [
{
"context" : "qualifier",
"element" : "value",
"variable" : "value"
}
],
"target" : [
{
"context" : "ce",
"contextType" : "variable",
"element" : "coding",
"variable" : "coding"
}
],
"rule" : [
{
"name" : "code",
"source" : [
{
"context" : "value",
"element" : "code",
"variable" : "code"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "code",
"transform" : "cast",
"parameter" : [
{
"valueId" : "code"
},
{
"valueString" : "string"
}
]
}
]
},
{
"name" : "codeSystem",
"source" : [
{
"context" : "value",
"element" : "codeSystem",
"variable" : "system"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "system",
"transform" : "translate",
"parameter" : [
{
"valueId" : "system"
},
{
"valueString" : "http://hl7.org/fhir/ConceptMap/special-oid2uri"
},
{
"valueString" : "uri"
}
]
}
]
},
{
"name" : "displayName",
"source" : [
{
"context" : "value",
"element" : "displayName",
"variable" : "display"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "display",
"transform" : "cast",
"parameter" : [
{
"valueId" : "display"
},
{
"valueString" : "string"
}
]
}
]
}
]
}
]
}
]
}
]
}
]
},
{
"name" : "valueQuantity",
"source" : [
{
"context" : "obs",
"type" : "PQ",
"element" : "value",
"variable" : "val"
}
],
"rule" : [
{
"name" : "quantity",
"source" : [
{
"context" : "val"
}
],
"target" : [
{
"context" : "ob",
"contextType" : "variable",
"element" : "value",
"variable" : "quantity",
"transform" : "create",
"parameter" : [
{
"valueString" : "Quantity"
}
]
}
],
"rule" : [
{
"name" : "value",
"source" : [
{
"context" : "val",
"element" : "value",
"variable" : "value"
}
],
"target" : [
{
"context" : "quantity",
"contextType" : "variable",
"element" : "value",
"transform" : "copy",
"parameter" : [
{
"valueId" : "value"
}
]
}
]
},
{
"name" : "unit",
"source" : [
{
"context" : "val",
"element" : "unit",
"variable" : "unit"
}
],
"target" : [
{
"context" : "quantity",
"contextType" : "variable",
"element" : "unit",
"transform" : "copy",
"parameter" : [
{
"valueId" : "unit"
}
]
}
]
}
]
}
]
},
{
"name" : "value",
"source" : [
{
"context" : "obs",
"type" : "ST",
"element" : "value",
"variable" : "value"
}
],
"target" : [
{
"context" : "ob",
"contextType" : "variable",
"element" : "value",
"transform" : "create",
"parameter" : [
{
"valueString" : "string"
}
]
},
{
"context" : "ob",
"contextType" : "variable",
"element" : "value",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "value.dataString"
}
]
}
]
},
{
"name" : "reference",
"source" : [
{
"context" : "obs"
}
],
"target" : [
{
"context" : "ob",
"contextType" : "variable",
"element" : "subject",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Patient/' + %patient.id"
}
]
}
]
},
{
"name" : "reference",
"source" : [
{
"context" : "obs"
}
],
"target" : [
{
"context" : "ob",
"contextType" : "variable",
"element" : "encounter",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Encounter/' + %encounter.id"
}
]
}
]
},
{
"name" : "interpretationCode",
"source" : [
{
"context" : "obs",
"element" : "interpretationCode",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "ob",
"contextType" : "variable",
"element" : "interpretation",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "methodCode",
"source" : [
{
"context" : "obs",
"element" : "methodCode",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "ob",
"contextType" : "variable",
"element" : "method",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "refRange",
"source" : [
{
"context" : "obs",
"element" : "referenceRange",
"variable" : "refRange"
}
],
"target" : [
{
"context" : "ob",
"contextType" : "variable",
"element" : "referenceRange",
"variable" : "ref",
"transform" : "create",
"parameter" : [
{
"valueString" : "BackboneElement"
}
]
}
],
"rule" : [
{
"name" : "obsRange",
"source" : [
{
"context" : "refRange",
"element" : "observationRange",
"variable" : "obsRange"
}
],
"target" : [
{
"context" : "ref",
"contextType" : "variable",
"element" : "low",
"variable" : "Low",
"transform" : "create",
"parameter" : [
{
"valueString" : "SimpleQuantity"
}
]
}
],
"rule" : [
{
"name" : "IVLPQ",
"source" : [
{
"context" : "obsRange",
"type" : "IVL_PQ",
"element" : "value",
"variable" : "v"
}
],
"rule" : [
{
"name" : "decValue",
"source" : [
{
"context" : "v",
"element" : "low",
"variable" : "l1"
}
],
"rule" : [
{
"name" : "value",
"source" : [
{
"context" : "l1",
"element" : "value",
"variable" : "decValue"
}
],
"target" : [
{
"context" : "Low",
"contextType" : "variable",
"element" : "value",
"transform" : "copy",
"parameter" : [
{
"valueId" : "decValue"
}
]
}
]
},
{
"name" : "unit",
"source" : [
{
"context" : "l1",
"element" : "unit",
"variable" : "Unit"
}
],
"target" : [
{
"context" : "Low",
"contextType" : "variable",
"element" : "unit",
"transform" : "copy",
"parameter" : [
{
"valueId" : "Unit"
}
]
}
]
}
]
}
]
}
]
}
]
},
{
"name" : "perf",
"source" : [
{
"context" : "obs",
"element" : "performer",
"variable" : "performer"
}
],
"target" : [
{
"context" : "bundle",
"contextType" : "variable",
"element" : "entry",
"variable" : "e1"
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "request",
"variable" : "request",
"transform" : "create",
"parameter" : [
{
"valueString" : "BackboneElement"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "method",
"transform" : "copy",
"parameter" : [
{
"valueString" : "PUT"
}
]
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "resource",
"variable" : "practitioner",
"transform" : "create",
"parameter" : [
{
"valueString" : "Practitioner"
}
]
},
{
"context" : "practitioner",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid1",
"transform" : "uuid"
}
],
"rule" : [
{
"name" : "assEntity",
"source" : [
{
"context" : "performer",
"element" : "assignedEntity",
"variable" : "assEntity"
}
],
"rule" : [
{
"name" : "meta",
"source" : [
{
"context" : "assEntity"
}
],
"target" : [
{
"context" : "practitioner",
"contextType" : "variable",
"element" : "meta",
"variable" : "meta"
}
],
"rule" : [
{
"name" : "coding",
"source" : [
{
"context" : "assEntity"
}
],
"target" : [
{
"context" : "meta",
"contextType" : "variable",
"element" : "tag",
"variable" : "coding",
"transform" : "create",
"parameter" : [
{
"valueString" : "Coding"
}
]
}
],
"rule" : [
{
"name" : "system",
"source" : [
{
"context" : "assEntity"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "system",
"transform" : "copy",
"parameter" : [
{
"valueString" : "http://algoritmodiscoring"
}
]
}
]
},
{
"name" : "code",
"source" : [
{
"context" : "assEntity"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "code",
"transform" : "copy",
"parameter" : [
{
"valueString" : "ClinicalDocument/body/Consulenza/performer"
}
]
}
]
}
]
}
]
},
{
"name" : "identifier",
"source" : [
{
"context" : "assEntity",
"element" : "id",
"variable" : "id"
}
],
"target" : [
{
"context" : "practitioner",
"contextType" : "variable",
"element" : "identifier",
"variable" : "identifier"
}
],
"rule" : [
{
"name" : "root1",
"source" : [
{
"context" : "id",
"element" : "root",
"variable" : "r"
}
],
"target" : [
{
"context" : "identifier",
"contextType" : "variable",
"element" : "system",
"transform" : "translate",
"parameter" : [
{
"valueId" : "r"
},
{
"valueString" : "http://hl7.org/fhir/ConceptMap/special-oid2uri"
},
{
"valueString" : "uri"
}
]
}
]
},
{
"name" : "extension",
"source" : [
{
"context" : "id",
"element" : "extension",
"variable" : "ext"
}
],
"target" : [
{
"context" : "identifier",
"contextType" : "variable",
"element" : "value",
"transform" : "copy",
"parameter" : [
{
"valueId" : "ext"
}
]
}
]
},
{
"name" : "assigningAuthorityName",
"source" : [
{
"context" : "id",
"element" : "assigningAuthorityName",
"variable" : "s"
}
],
"target" : [
{
"context" : "identifier",
"contextType" : "variable",
"element" : "assigner",
"variable" : "a"
},
{
"context" : "a",
"contextType" : "variable",
"element" : "display",
"transform" : "copy",
"parameter" : [
{
"valueId" : "s"
}
]
}
]
},
{
"name" : "r",
"source" : [
{
"context" : "id",
"element" : "root",
"variable" : "r"
}
],
"rule" : [
{
"name" : "aut",
"source" : [
{
"context" : "id",
"element" : "extension",
"variable" : "ext"
}
],
"target" : [
{
"context" : "practitioner",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid2",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "r + '-' + ext"
}
]
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "https://example/Practitioner/"
},
{
"valueId" : "uuid2"
}
]
},
{
"context" : "ob",
"contextType" : "variable",
"element" : "performer",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Practitioner/' + %practitioner.id"
}
]
}
]
}
]
}
]
},
{
"name" : "2.16.840.1.113883.2.9.4.3.2",
"source" : [
{
"context" : "assEntity",
"element" : "id",
"variable" : "id",
"condition" : "(root = '2.16.840.1.113883.2.9.4.3.2')"
}
],
"rule" : [
{
"name" : "UUID",
"source" : [
{
"context" : "id",
"element" : "extension",
"variable" : "ext"
}
],
"target" : [
{
"context" : "request",
"contextType" : "variable",
"element" : "url",
"transform" : "append",
"parameter" : [
{
"valueString" : "Practitioner?identifier="
},
{
"valueId" : "ext"
}
]
}
]
}
]
},
{
"name" : "assi",
"source" : [
{
"context" : "assEntity",
"element" : "assignedPerson",
"variable" : "assi"
}
],
"rule" : [
{
"name" : "name",
"source" : [
{
"context" : "assi",
"element" : "name",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "practitioner",
"contextType" : "variable",
"element" : "name",
"variable" : "vvv",
"transform" : "create"
}
]
}
]
}
]
}
]
},
{
"name" : "participant",
"source" : [
{
"context" : "obs",
"element" : "participant",
"variable" : "participant"
}
],
"target" : [
{
"context" : "bundle",
"contextType" : "variable",
"element" : "entry",
"variable" : "e1"
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "request",
"variable" : "request",
"transform" : "create",
"parameter" : [
{
"valueString" : "BackboneElement"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "method",
"transform" : "copy",
"parameter" : [
{
"valueString" : "POST"
}
]
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "resource",
"variable" : "serviceRequest",
"transform" : "create",
"parameter" : [
{
"valueString" : "ServiceRequest"
}
]
},
{
"context" : "serviceRequest",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid1",
"transform" : "uuid"
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "https://example/ServiceRequest/"
},
{
"valueId" : "uuid1"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "url",
"transform" : "copy",
"parameter" : [
{
"valueString" : "ServiceRequest"
}
]
},
{
"context" : "ob",
"contextType" : "variable",
"element" : "basedOn",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/ServiceRequest/' + %serviceRequest.id"
}
]
}
],
"rule" : [
{
"name" : "time",
"source" : [
{
"context" : "participant",
"element" : "time",
"variable" : "t"
}
],
"target" : [
{
"context" : "serviceRequest",
"contextType" : "variable",
"element" : "authoredOn",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "t.value"
}
]
}
]
},
{
"name" : "reference",
"source" : [
{
"context" : "obs"
}
],
"target" : [
{
"context" : "serviceRequest",
"contextType" : "variable",
"element" : "subject",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Patient/' + %patient.id"
}
]
}
]
},
{
"name" : "reference",
"source" : [
{
"context" : "obs"
}
],
"target" : [
{
"context" : "serviceRequest",
"contextType" : "variable",
"element" : "encounter",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Encounter/' + %encounter.id"
}
]
}
]
},
{
"name" : "status",
"source" : [
{
"context" : "obs"
}
],
"target" : [
{
"context" : "serviceRequest",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "active"
}
]
}
]
},
{
"name" : "intent",
"source" : [
{
"context" : "obs"
}
],
"target" : [
{
"context" : "serviceRequest",
"contextType" : "variable",
"element" : "intent",
"transform" : "copy",
"parameter" : [
{
"valueString" : "order"
}
]
}
]
},
{
"name" : "participantRole",
"source" : [
{
"context" : "participant",
"element" : "participantRole",
"variable" : "participantRole"
}
],
"target" : [
{
"context" : "bundle",
"contextType" : "variable",
"element" : "entry",
"variable" : "e1"
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "request",
"variable" : "request",
"transform" : "create",
"parameter" : [
{
"valueString" : "BackboneElement"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "method",
"transform" : "copy",
"parameter" : [
{
"valueString" : "PUT"
}
]
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "resource",
"variable" : "practitioner",
"transform" : "create",
"parameter" : [
{
"valueString" : "Practitioner"
}
]
}
],
"rule" : [
{
"name" : "meta",
"source" : [
{
"context" : "participantRole"
}
],
"target" : [
{
"context" : "practitioner",
"contextType" : "variable",
"element" : "meta",
"variable" : "meta"
}
],
"rule" : [
{
"name" : "coding",
"source" : [
{
"context" : "participantRole"
}
],
"target" : [
{
"context" : "meta",
"contextType" : "variable",
"element" : "tag",
"variable" : "coding",
"transform" : "create",
"parameter" : [
{
"valueString" : "Coding"
}
]
}
],
"rule" : [
{
"name" : "system",
"source" : [
{
"context" : "participantRole"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "system",
"transform" : "copy",
"parameter" : [
{
"valueString" : "http://algoritmodiscoring"
}
]
}
]
},
{
"name" : "code",
"source" : [
{
"context" : "participantRole"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "code",
"transform" : "copy",
"parameter" : [
{
"valueString" : "ClinicalDocument/body/Consulenza/participant"
}
]
}
]
}
]
}
]
},
{
"name" : "identifier",
"source" : [
{
"context" : "participantRole",
"element" : "id",
"variable" : "id"
}
],
"target" : [
{
"context" : "practitioner",
"contextType" : "variable",
"element" : "identifier",
"variable" : "identifier"
}
],
"rule" : [
{
"name" : "root1",
"source" : [
{
"context" : "id",
"element" : "root",
"variable" : "r"
}
],
"target" : [
{
"context" : "identifier",
"contextType" : "variable",
"element" : "system",
"transform" : "translate",
"parameter" : [
{
"valueId" : "r"
},
{
"valueString" : "http://hl7.org/fhir/ConceptMap/special-oid2uri"
},
{
"valueString" : "uri"
}
]
}
]
},
{
"name" : "extension",
"source" : [
{
"context" : "id",
"element" : "extension",
"variable" : "ext"
}
],
"target" : [
{
"context" : "identifier",
"contextType" : "variable",
"element" : "value",
"transform" : "copy",
"parameter" : [
{
"valueId" : "ext"
}
]
}
]
},
{
"name" : "assigningAuthorityName",
"source" : [
{
"context" : "id",
"element" : "assigningAuthorityName",
"variable" : "s"
}
],
"target" : [
{
"context" : "identifier",
"contextType" : "variable",
"element" : "assigner",
"variable" : "a"
},
{
"context" : "a",
"contextType" : "variable",
"element" : "display",
"transform" : "copy",
"parameter" : [
{
"valueId" : "s"
}
]
}
]
},
{
"name" : "r",
"source" : [
{
"context" : "id",
"element" : "root",
"variable" : "r"
}
],
"rule" : [
{
"name" : "aut",
"source" : [
{
"context" : "id",
"element" : "extension",
"variable" : "ext"
}
],
"target" : [
{
"context" : "practitioner",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid3",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "r + '-' + ext"
}
]
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "https://example/Practitioner/"
},
{
"valueId" : "uuid3"
}
]
},
{
"context" : "serviceRequest",
"contextType" : "variable",
"element" : "performer",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Practitioner/' + %practitioner.id"
}
]
}
]
}
]
}
]
},
{
"name" : "2.16.840.1.113883.2.9.4.3.2",
"source" : [
{
"context" : "participantRole",
"element" : "id",
"variable" : "id",
"condition" : "(root = '2.16.840.1.113883.2.9.4.3.2')"
}
],
"rule" : [
{
"name" : "UUID",
"source" : [
{
"context" : "id",
"element" : "extension",
"variable" : "ext"
}
],
"target" : [
{
"context" : "request",
"contextType" : "variable",
"element" : "url",
"transform" : "append",
"parameter" : [
{
"valueString" : "Practitioner?identifier="
},
{
"valueId" : "ext"
}
]
}
]
}
]
},
{
"name" : "pe",
"source" : [
{
"context" : "participantRole",
"element" : "playingEntity",
"variable" : "pe"
}
],
"rule" : [
{
"name" : "name",
"source" : [
{
"context" : "pe",
"element" : "name",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "practitioner",
"contextType" : "variable",
"element" : "name",
"variable" : "vvv",
"transform" : "create"
}
]
}
]
}
]
}
]
}
]
},
{
"name" : "ObservationEsamiDuranteRicovero",
"typeMode" : "none",
"input" : [
{
"name" : "obs",
"type" : "Observation",
"mode" : "source"
},
{
"name" : "patient",
"type" : "Patient",
"mode" : "target"
},
{
"name" : "encounter",
"type" : "Encounter",
"mode" : "target"
},
{
"name" : "ob",
"type" : "Observation",
"mode" : "target"
},
{
"name" : "bundle",
"type" : "Bundle",
"mode" : "target"
}
],
"rule" : [
{
"name" : "reference",
"source" : [
{
"context" : "obs"
}
],
"target" : [
{
"context" : "ob",
"contextType" : "variable",
"element" : "subject",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Patient/' + %patient.id"
}
]
}
]
},
{
"name" : "reference",
"source" : [
{
"context" : "obs"
}
],
"target" : [
{
"context" : "ob",
"contextType" : "variable",
"element" : "encounter",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Encounter/' + %encounter.id"
}
]
}
]
},
{
"name" : "code",
"source" : [
{
"context" : "obs",
"element" : "code",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "ob",
"contextType" : "variable",
"element" : "code",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "statusCode",
"source" : [
{
"context" : "obs",
"element" : "statusCode",
"variable" : "statusc",
"condition" : "(code = 'completed')"
}
],
"target" : [
{
"context" : "ob",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "final"
}
]
}
]
},
{
"name" : "statusCode",
"source" : [
{
"context" : "obs",
"element" : "statusCode",
"variable" : "statusc",
"condition" : "(code = 'active')"
}
],
"target" : [
{
"context" : "ob",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "registered"
}
]
}
]
},
{
"name" : "statusCode",
"source" : [
{
"context" : "obs",
"element" : "statusCode",
"variable" : "statusc",
"condition" : "(code = 'aborted')"
}
],
"target" : [
{
"context" : "ob",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "cancelled"
}
]
}
]
},
{
"name" : "statusCode",
"source" : [
{
"context" : "obs",
"element" : "statusCode",
"variable" : "statusc",
"condition" : "(code = 'suspended')"
}
],
"target" : [
{
"context" : "ob",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "partial"
}
]
}
]
},
{
"name" : "statuscode",
"source" : [
{
"context" : "obs",
"condition" : "obs.statusCode.exists().not()"
}
],
"rule" : [
{
"name" : "status",
"source" : [
{
"context" : "obs"
}
],
"target" : [
{
"context" : "ob",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "final"
}
]
}
]
}
]
},
{
"name" : "value2r",
"source" : [
{
"context" : "obs",
"element" : "effectiveTime",
"variable" : "effectiveTime"
}
],
"target" : [
{
"context" : "ob",
"contextType" : "variable",
"element" : "effective",
"variable" : "value",
"transform" : "create",
"parameter" : [
{
"valueString" : "dateTime"
}
]
}
],
"dependent" : [
{
"name" : "TSDateTime",
"variable" : [
"effectiveTime",
"value"
]
}
]
},
{
"name" : "where",
"source" : [
{
"context" : "obs",
"condition" : "effectiveTime.low.exists() or effectiveTime.high.exists()"
}
],
"rule" : [
{
"name" : "value3r",
"source" : [
{
"context" : "obs",
"element" : "effectiveTime",
"variable" : "eff"
}
],
"target" : [
{
"context" : "ob",
"contextType" : "variable",
"element" : "effective",
"variable" : "period",
"transform" : "create",
"parameter" : [
{
"valueString" : "Period"
}
]
}
],
"dependent" : [
{
"name" : "IVLTSPeriod",
"variable" : [
"eff",
"period"
]
}
]
}
]
},
{
"name" : "value",
"source" : [
{
"context" : "obs",
"type" : "INT",
"element" : "value",
"variable" : "int"
}
],
"target" : [
{
"context" : "ob",
"contextType" : "variable",
"element" : "value",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "int.value"
}
]
}
]
},
{
"name" : "boolean",
"source" : [
{
"context" : "obs",
"type" : "BL",
"element" : "value",
"variable" : "boolean"
}
],
"target" : [
{
"context" : "ob",
"contextType" : "variable",
"element" : "value",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "boolean.value"
}
]
}
]
},
{
"name" : "val",
"source" : [
{
"context" : "obs",
"type" : "CE",
"element" : "value",
"variable" : "val"
}
],
"rule" : [
{
"name" : "coding",
"source" : [
{
"context" : "val"
}
],
"target" : [
{
"context" : "ob",
"contextType" : "variable",
"element" : "value",
"variable" : "ce",
"transform" : "create",
"parameter" : [
{
"valueString" : "CodeableConcept"
}
]
}
],
"rule" : [
{
"name" : "originltext",
"source" : [
{
"context" : "val",
"element" : "originalText",
"variable" : "originalText"
}
],
"rule" : [
{
"name" : "reference",
"source" : [
{
"context" : "originalText",
"element" : "reference",
"variable" : "reference"
}
],
"target" : [
{
"context" : "ce",
"contextType" : "variable",
"element" : "text",
"transform" : "copy",
"parameter" : [
{
"valueId" : "reference"
}
]
}
]
}
]
},
{
"name" : "code",
"source" : [
{
"context" : "val"
}
],
"target" : [
{
"context" : "ce",
"contextType" : "variable",
"element" : "coding",
"variable" : "coding"
}
],
"rule" : [
{
"name" : "code",
"source" : [
{
"context" : "val",
"element" : "code",
"variable" : "code"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "code",
"transform" : "cast",
"parameter" : [
{
"valueId" : "code"
},
{
"valueString" : "string"
}
]
}
]
},
{
"name" : "codeSystem",
"source" : [
{
"context" : "val",
"element" : "codeSystem",
"variable" : "system"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "system",
"transform" : "translate",
"parameter" : [
{
"valueId" : "system"
},
{
"valueString" : "http://hl7.org/fhir/ConceptMap/special-oid2uri"
},
{
"valueString" : "uri"
}
]
}
]
},
{
"name" : "displayName",
"source" : [
{
"context" : "val",
"element" : "displayName",
"variable" : "display"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "display",
"transform" : "cast",
"parameter" : [
{
"valueId" : "display"
},
{
"valueString" : "string"
}
]
}
]
},
{
"name" : "codeSystemVersion",
"source" : [
{
"context" : "val",
"element" : "codeSystemVersion",
"variable" : "version"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "version",
"transform" : "cast",
"parameter" : [
{
"valueId" : "version"
},
{
"valueString" : "string"
}
]
}
]
}
]
},
{
"name" : "translation",
"source" : [
{
"context" : "val",
"element" : "translation",
"variable" : "translation"
}
],
"target" : [
{
"context" : "ce",
"contextType" : "variable",
"element" : "coding",
"variable" : "coding"
}
],
"rule" : [
{
"name" : "code",
"source" : [
{
"context" : "translation",
"element" : "code",
"variable" : "code"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "code",
"transform" : "cast",
"parameter" : [
{
"valueId" : "code"
},
{
"valueString" : "string"
}
]
}
]
},
{
"name" : "codeSystem",
"source" : [
{
"context" : "translation",
"element" : "codeSystem",
"variable" : "system"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "system",
"transform" : "translate",
"parameter" : [
{
"valueId" : "system"
},
{
"valueString" : "http://hl7.org/fhir/ConceptMap/special-oid2uri"
},
{
"valueString" : "uri"
}
]
}
]
},
{
"name" : "displayName",
"source" : [
{
"context" : "translation",
"element" : "displayName",
"variable" : "display"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "display",
"transform" : "cast",
"parameter" : [
{
"valueId" : "display"
},
{
"valueString" : "string"
}
]
}
]
},
{
"name" : "codeSystemVersion",
"source" : [
{
"context" : "translation",
"element" : "codeSystemVersion",
"variable" : "version"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "version",
"transform" : "cast",
"parameter" : [
{
"valueId" : "version"
},
{
"valueString" : "string"
}
]
}
]
},
{
"name" : "qualifier",
"source" : [
{
"context" : "translation",
"element" : "qualifier",
"variable" : "qualifier"
}
],
"rule" : [
{
"name" : "value",
"source" : [
{
"context" : "qualifier",
"element" : "value",
"variable" : "value"
}
],
"target" : [
{
"context" : "ce",
"contextType" : "variable",
"element" : "coding",
"variable" : "coding"
}
],
"rule" : [
{
"name" : "code",
"source" : [
{
"context" : "value",
"element" : "code",
"variable" : "code"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "code",
"transform" : "cast",
"parameter" : [
{
"valueId" : "code"
},
{
"valueString" : "string"
}
]
}
]
},
{
"name" : "codeSystem",
"source" : [
{
"context" : "value",
"element" : "codeSystem",
"variable" : "system"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "system",
"transform" : "translate",
"parameter" : [
{
"valueId" : "system"
},
{
"valueString" : "http://hl7.org/fhir/ConceptMap/special-oid2uri"
},
{
"valueString" : "uri"
}
]
}
]
},
{
"name" : "displayName",
"source" : [
{
"context" : "value",
"element" : "displayName",
"variable" : "display"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "display",
"transform" : "cast",
"parameter" : [
{
"valueId" : "display"
},
{
"valueString" : "string"
}
]
}
]
},
{
"name" : "codeSystemVersion",
"source" : [
{
"context" : "value",
"element" : "codeSystemVersion",
"variable" : "version"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "version",
"transform" : "cast",
"parameter" : [
{
"valueId" : "version"
},
{
"valueString" : "string"
}
]
}
]
}
]
}
]
}
]
}
]
}
]
},
{
"name" : "val",
"source" : [
{
"context" : "obs",
"type" : "CD",
"element" : "value",
"variable" : "val"
}
],
"rule" : [
{
"name" : "coding",
"source" : [
{
"context" : "val"
}
],
"target" : [
{
"context" : "ob",
"contextType" : "variable",
"element" : "value",
"variable" : "ce",
"transform" : "create",
"parameter" : [
{
"valueString" : "CodeableConcept"
}
]
}
],
"rule" : [
{
"name" : "originalText",
"source" : [
{
"context" : "val",
"element" : "originalText",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "ce",
"contextType" : "variable",
"element" : "text",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "code",
"source" : [
{
"context" : "val"
}
],
"target" : [
{
"context" : "ce",
"contextType" : "variable",
"element" : "coding",
"variable" : "coding"
}
],
"rule" : [
{
"name" : "code",
"source" : [
{
"context" : "val",
"element" : "code",
"variable" : "code"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "code",
"transform" : "cast",
"parameter" : [
{
"valueId" : "code"
},
{
"valueString" : "string"
}
]
}
]
},
{
"name" : "codeSystem",
"source" : [
{
"context" : "val",
"element" : "codeSystem",
"variable" : "system"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "system",
"transform" : "translate",
"parameter" : [
{
"valueId" : "system"
},
{
"valueString" : "http://hl7.org/fhir/ConceptMap/special-oid2uri"
},
{
"valueString" : "uri"
}
]
}
]
},
{
"name" : "displayName",
"source" : [
{
"context" : "val",
"element" : "displayName",
"variable" : "display"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "display",
"transform" : "cast",
"parameter" : [
{
"valueId" : "display"
},
{
"valueString" : "string"
}
]
}
]
}
]
},
{
"name" : "translation",
"source" : [
{
"context" : "val",
"element" : "translation",
"variable" : "translation"
}
],
"target" : [
{
"context" : "ce",
"contextType" : "variable",
"element" : "coding",
"variable" : "coding"
}
],
"rule" : [
{
"name" : "code",
"source" : [
{
"context" : "translation",
"element" : "code",
"variable" : "code"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "code",
"transform" : "cast",
"parameter" : [
{
"valueId" : "code"
},
{
"valueString" : "string"
}
]
}
]
},
{
"name" : "codeSystem",
"source" : [
{
"context" : "translation",
"element" : "codeSystem",
"variable" : "system"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "system",
"transform" : "translate",
"parameter" : [
{
"valueId" : "system"
},
{
"valueString" : "http://hl7.org/fhir/ConceptMap/special-oid2uri"
},
{
"valueString" : "uri"
}
]
}
]
},
{
"name" : "displayName",
"source" : [
{
"context" : "translation",
"element" : "displayName",
"variable" : "display"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "display",
"transform" : "cast",
"parameter" : [
{
"valueId" : "display"
},
{
"valueString" : "string"
}
]
}
]
},
{
"name" : "qualifier",
"source" : [
{
"context" : "translation",
"element" : "qualifier",
"variable" : "qualifier"
}
],
"rule" : [
{
"name" : "value",
"source" : [
{
"context" : "qualifier",
"element" : "value",
"variable" : "value"
}
],
"target" : [
{
"context" : "ce",
"contextType" : "variable",
"element" : "coding",
"variable" : "coding"
}
],
"rule" : [
{
"name" : "code",
"source" : [
{
"context" : "value",
"element" : "code",
"variable" : "code"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "code",
"transform" : "cast",
"parameter" : [
{
"valueId" : "code"
},
{
"valueString" : "string"
}
]
}
]
},
{
"name" : "codeSystem",
"source" : [
{
"context" : "value",
"element" : "codeSystem",
"variable" : "system"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "system",
"transform" : "translate",
"parameter" : [
{
"valueId" : "system"
},
{
"valueString" : "http://hl7.org/fhir/ConceptMap/special-oid2uri"
},
{
"valueString" : "uri"
}
]
}
]
},
{
"name" : "displayName",
"source" : [
{
"context" : "value",
"element" : "displayName",
"variable" : "display"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "display",
"transform" : "cast",
"parameter" : [
{
"valueId" : "display"
},
{
"valueString" : "string"
}
]
}
]
}
]
}
]
}
]
}
]
}
]
},
{
"name" : "valueQuantity",
"source" : [
{
"context" : "obs",
"type" : "PQ",
"element" : "value",
"variable" : "val"
}
],
"rule" : [
{
"name" : "quantity",
"source" : [
{
"context" : "val"
}
],
"target" : [
{
"context" : "ob",
"contextType" : "variable",
"element" : "value",
"variable" : "quantity",
"transform" : "create",
"parameter" : [
{
"valueString" : "Quantity"
}
]
}
],
"rule" : [
{
"name" : "value",
"source" : [
{
"context" : "val",
"element" : "value",
"variable" : "value"
}
],
"target" : [
{
"context" : "quantity",
"contextType" : "variable",
"element" : "value",
"transform" : "copy",
"parameter" : [
{
"valueId" : "value"
}
]
}
]
},
{
"name" : "unit",
"source" : [
{
"context" : "val",
"element" : "unit",
"variable" : "unit"
}
],
"target" : [
{
"context" : "quantity",
"contextType" : "variable",
"element" : "unit",
"transform" : "copy",
"parameter" : [
{
"valueId" : "unit"
}
]
}
]
}
]
}
]
},
{
"name" : "value",
"source" : [
{
"context" : "obs",
"type" : "ST",
"element" : "value",
"variable" : "value"
}
],
"target" : [
{
"context" : "ob",
"contextType" : "variable",
"element" : "value",
"transform" : "create",
"parameter" : [
{
"valueString" : "string"
}
]
},
{
"context" : "ob",
"contextType" : "variable",
"element" : "value",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "value.dataString"
}
]
}
]
},
{
"name" : "reference",
"source" : [
{
"context" : "obs"
}
],
"target" : [
{
"context" : "ob",
"contextType" : "variable",
"element" : "subject",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Patient/' + %patient.id"
}
]
}
]
},
{
"name" : "reference",
"source" : [
{
"context" : "obs"
}
],
"target" : [
{
"context" : "ob",
"contextType" : "variable",
"element" : "encounter",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Encounter/' + %encounter.id"
}
]
}
]
},
{
"name" : "interpretationCode",
"source" : [
{
"context" : "obs",
"element" : "interpretationCode",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "ob",
"contextType" : "variable",
"element" : "interpretation",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "methodCode",
"source" : [
{
"context" : "obs",
"element" : "methodCode",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "ob",
"contextType" : "variable",
"element" : "method",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "effectiveTime",
"source" : [
{
"context" : "obs",
"element" : "effectiveTime",
"variable" : "eff"
}
],
"target" : [
{
"context" : "ob",
"contextType" : "variable",
"element" : "effective",
"variable" : "per",
"transform" : "create",
"parameter" : [
{
"valueString" : "Period"
}
]
}
],
"dependent" : [
{
"name" : "IVLTSPeriod",
"variable" : [
"eff",
"per"
]
}
]
},
{
"name" : "refRange",
"source" : [
{
"context" : "obs",
"element" : "referenceRange",
"variable" : "refRange"
}
],
"target" : [
{
"context" : "ob",
"contextType" : "variable",
"element" : "referenceRange",
"variable" : "ref",
"transform" : "create",
"parameter" : [
{
"valueString" : "BackboneElement"
}
]
}
],
"rule" : [
{
"name" : "obsRange",
"source" : [
{
"context" : "refRange",
"element" : "observationRange",
"variable" : "obsRange"
}
],
"target" : [
{
"context" : "ref",
"contextType" : "variable",
"element" : "low",
"variable" : "Low",
"transform" : "create",
"parameter" : [
{
"valueString" : "SimpleQuantity"
}
]
}
],
"rule" : [
{
"name" : "IVLPQ",
"source" : [
{
"context" : "obsRange",
"type" : "IVL_PQ",
"element" : "value",
"variable" : "v"
}
],
"rule" : [
{
"name" : "decValue",
"source" : [
{
"context" : "v",
"element" : "low",
"variable" : "l1"
}
],
"rule" : [
{
"name" : "value",
"source" : [
{
"context" : "l1",
"element" : "value",
"variable" : "decValue"
}
],
"target" : [
{
"context" : "Low",
"contextType" : "variable",
"element" : "value",
"transform" : "copy",
"parameter" : [
{
"valueId" : "decValue"
}
]
}
]
},
{
"name" : "unit",
"source" : [
{
"context" : "l1",
"element" : "unit",
"variable" : "Unit"
}
],
"target" : [
{
"context" : "Low",
"contextType" : "variable",
"element" : "unit",
"transform" : "copy",
"parameter" : [
{
"valueId" : "Unit"
}
]
}
]
}
]
}
]
}
]
}
]
},
{
"name" : "perf",
"source" : [
{
"context" : "obs",
"element" : "performer",
"variable" : "performer"
}
],
"target" : [
{
"context" : "bundle",
"contextType" : "variable",
"element" : "entry",
"variable" : "e1"
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "request",
"variable" : "request",
"transform" : "create",
"parameter" : [
{
"valueString" : "BackboneElement"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "method",
"transform" : "copy",
"parameter" : [
{
"valueString" : "PUT"
}
]
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "resource",
"variable" : "practitioner",
"transform" : "create",
"parameter" : [
{
"valueString" : "Practitioner"
}
]
},
{
"context" : "practitioner",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid1",
"transform" : "uuid"
}
],
"rule" : [
{
"name" : "assEntity",
"source" : [
{
"context" : "performer",
"element" : "assignedEntity",
"variable" : "assEntity"
}
],
"rule" : [
{
"name" : "meta",
"source" : [
{
"context" : "assEntity"
}
],
"target" : [
{
"context" : "practitioner",
"contextType" : "variable",
"element" : "meta",
"variable" : "meta"
}
],
"rule" : [
{
"name" : "coding",
"source" : [
{
"context" : "assEntity"
}
],
"target" : [
{
"context" : "meta",
"contextType" : "variable",
"element" : "tag",
"variable" : "coding",
"transform" : "create",
"parameter" : [
{
"valueString" : "Coding"
}
]
}
],
"rule" : [
{
"name" : "system",
"source" : [
{
"context" : "assEntity"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "system",
"transform" : "copy",
"parameter" : [
{
"valueString" : "http://algoritmodiscoring"
}
]
}
]
},
{
"name" : "code",
"source" : [
{
"context" : "assEntity"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "code",
"transform" : "copy",
"parameter" : [
{
"valueString" : "ClinicalDocument/body/EsamiDuranteRicovero/performer"
}
]
}
]
}
]
}
]
},
{
"name" : "identifier",
"source" : [
{
"context" : "assEntity",
"element" : "id",
"variable" : "id"
}
],
"target" : [
{
"context" : "practitioner",
"contextType" : "variable",
"element" : "identifier",
"variable" : "identifier"
}
],
"rule" : [
{
"name" : "root1",
"source" : [
{
"context" : "id",
"element" : "root",
"variable" : "r"
}
],
"target" : [
{
"context" : "identifier",
"contextType" : "variable",
"element" : "system",
"transform" : "translate",
"parameter" : [
{
"valueId" : "r"
},
{
"valueString" : "http://hl7.org/fhir/ConceptMap/special-oid2uri"
},
{
"valueString" : "uri"
}
]
}
]
},
{
"name" : "extension",
"source" : [
{
"context" : "id",
"element" : "extension",
"variable" : "ext"
}
],
"target" : [
{
"context" : "identifier",
"contextType" : "variable",
"element" : "value",
"transform" : "copy",
"parameter" : [
{
"valueId" : "ext"
}
]
}
]
},
{
"name" : "assigningAuthorityName",
"source" : [
{
"context" : "id",
"element" : "assigningAuthorityName",
"variable" : "s"
}
],
"target" : [
{
"context" : "identifier",
"contextType" : "variable",
"element" : "assigner",
"variable" : "a"
},
{
"context" : "a",
"contextType" : "variable",
"element" : "display",
"transform" : "copy",
"parameter" : [
{
"valueId" : "s"
}
]
}
]
},
{
"name" : "r",
"source" : [
{
"context" : "id",
"element" : "root",
"variable" : "r"
}
],
"rule" : [
{
"name" : "aut",
"source" : [
{
"context" : "id",
"element" : "extension",
"variable" : "ext"
}
],
"target" : [
{
"context" : "practitioner",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid2",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "r + '-' + ext"
}
]
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "https://example/Practitioner/"
},
{
"valueId" : "uuid2"
}
]
},
{
"context" : "ob",
"contextType" : "variable",
"element" : "performer",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Practitioner/' + %practitioner.id"
}
]
}
]
}
]
}
]
},
{
"name" : "2.16.840.1.113883.2.9.4.3.2",
"source" : [
{
"context" : "assEntity",
"element" : "id",
"variable" : "id",
"condition" : "(root = '2.16.840.1.113883.2.9.4.3.2')"
}
],
"rule" : [
{
"name" : "UUID",
"source" : [
{
"context" : "id",
"element" : "extension",
"variable" : "ext"
}
],
"target" : [
{
"context" : "request",
"contextType" : "variable",
"element" : "url",
"transform" : "append",
"parameter" : [
{
"valueString" : "Practitioner?identifier="
},
{
"valueId" : "ext"
}
]
}
]
}
]
},
{
"name" : "assi",
"source" : [
{
"context" : "assEntity",
"element" : "assignedPerson",
"variable" : "assi"
}
],
"rule" : [
{
"name" : "name",
"source" : [
{
"context" : "assi",
"element" : "name",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "practitioner",
"contextType" : "variable",
"element" : "name",
"variable" : "vvv",
"transform" : "create"
}
]
}
]
}
]
}
]
},
{
"name" : "participant",
"source" : [
{
"context" : "obs",
"element" : "participant",
"variable" : "participant"
}
],
"target" : [
{
"context" : "bundle",
"contextType" : "variable",
"element" : "entry",
"variable" : "e1"
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "request",
"variable" : "request",
"transform" : "create",
"parameter" : [
{
"valueString" : "BackboneElement"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "method",
"transform" : "copy",
"parameter" : [
{
"valueString" : "POST"
}
]
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "resource",
"variable" : "serviceRequest",
"transform" : "create",
"parameter" : [
{
"valueString" : "ServiceRequest"
}
]
},
{
"context" : "serviceRequest",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid1",
"transform" : "uuid"
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "https://example/ServiceRequest/"
},
{
"valueId" : "uuid1"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "url",
"transform" : "copy",
"parameter" : [
{
"valueString" : "ServiceRequest"
}
]
},
{
"context" : "ob",
"contextType" : "variable",
"element" : "basedOn",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/ServiceRequest/' + %serviceRequest.id"
}
]
}
],
"rule" : [
{
"name" : "time",
"source" : [
{
"context" : "participant",
"element" : "time",
"variable" : "t"
}
],
"target" : [
{
"context" : "serviceRequest",
"contextType" : "variable",
"element" : "authoredOn",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "t.value"
}
]
}
]
},
{
"name" : "reference",
"source" : [
{
"context" : "obs"
}
],
"target" : [
{
"context" : "serviceRequest",
"contextType" : "variable",
"element" : "subject",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Patient/' + %patient.id"
}
]
}
]
},
{
"name" : "reference",
"source" : [
{
"context" : "obs"
}
],
"target" : [
{
"context" : "serviceRequest",
"contextType" : "variable",
"element" : "encounter",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Encounter/' + %encounter.id"
}
]
}
]
},
{
"name" : "status",
"source" : [
{
"context" : "obs"
}
],
"target" : [
{
"context" : "serviceRequest",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "active"
}
]
}
]
},
{
"name" : "intent",
"source" : [
{
"context" : "obs"
}
],
"target" : [
{
"context" : "serviceRequest",
"contextType" : "variable",
"element" : "intent",
"transform" : "copy",
"parameter" : [
{
"valueString" : "order"
}
]
}
]
},
{
"name" : "participantRole",
"source" : [
{
"context" : "participant",
"element" : "participantRole",
"variable" : "participantRole"
}
],
"target" : [
{
"context" : "bundle",
"contextType" : "variable",
"element" : "entry",
"variable" : "e1"
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "request",
"variable" : "request",
"transform" : "create",
"parameter" : [
{
"valueString" : "BackboneElement"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "method",
"transform" : "copy",
"parameter" : [
{
"valueString" : "PUT"
}
]
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "resource",
"variable" : "practitioner",
"transform" : "create",
"parameter" : [
{
"valueString" : "Practitioner"
}
]
}
],
"rule" : [
{
"name" : "meta",
"source" : [
{
"context" : "participantRole"
}
],
"target" : [
{
"context" : "practitioner",
"contextType" : "variable",
"element" : "meta",
"variable" : "meta"
}
],
"rule" : [
{
"name" : "coding",
"source" : [
{
"context" : "participantRole"
}
],
"target" : [
{
"context" : "meta",
"contextType" : "variable",
"element" : "tag",
"variable" : "coding",
"transform" : "create",
"parameter" : [
{
"valueString" : "Coding"
}
]
}
],
"rule" : [
{
"name" : "system",
"source" : [
{
"context" : "participantRole"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "system",
"transform" : "copy",
"parameter" : [
{
"valueString" : "http://algoritmodiscoring"
}
]
}
]
},
{
"name" : "code",
"source" : [
{
"context" : "participantRole"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "code",
"transform" : "copy",
"parameter" : [
{
"valueString" : "ClinicalDocument/body/EsamiDuranteRicovero/participant"
}
]
}
]
}
]
}
]
},
{
"name" : "identifier",
"source" : [
{
"context" : "participantRole",
"element" : "id",
"variable" : "id"
}
],
"target" : [
{
"context" : "practitioner",
"contextType" : "variable",
"element" : "identifier",
"variable" : "identifier"
}
],
"rule" : [
{
"name" : "root1",
"source" : [
{
"context" : "id",
"element" : "root",
"variable" : "r"
}
],
"target" : [
{
"context" : "identifier",
"contextType" : "variable",
"element" : "system",
"transform" : "translate",
"parameter" : [
{
"valueId" : "r"
},
{
"valueString" : "http://hl7.org/fhir/ConceptMap/special-oid2uri"
},
{
"valueString" : "uri"
}
]
}
]
},
{
"name" : "extension",
"source" : [
{
"context" : "id",
"element" : "extension",
"variable" : "ext"
}
],
"target" : [
{
"context" : "identifier",
"contextType" : "variable",
"element" : "value",
"transform" : "copy",
"parameter" : [
{
"valueId" : "ext"
}
]
}
]
},
{
"name" : "assigningAuthorityName",
"source" : [
{
"context" : "id",
"element" : "assigningAuthorityName",
"variable" : "s"
}
],
"target" : [
{
"context" : "identifier",
"contextType" : "variable",
"element" : "assigner",
"variable" : "a"
},
{
"context" : "a",
"contextType" : "variable",
"element" : "display",
"transform" : "copy",
"parameter" : [
{
"valueId" : "s"
}
]
}
]
},
{
"name" : "r",
"source" : [
{
"context" : "id",
"element" : "root",
"variable" : "r"
}
],
"rule" : [
{
"name" : "aut",
"source" : [
{
"context" : "id",
"element" : "extension",
"variable" : "ext"
}
],
"target" : [
{
"context" : "practitioner",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid3",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "r + '-' + ext"
}
]
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "https://example/Practitioner/"
},
{
"valueId" : "uuid3"
}
]
},
{
"context" : "serviceRequest",
"contextType" : "variable",
"element" : "performer",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Practitioner/' + %practitioner.id"
}
]
}
]
}
]
}
]
},
{
"name" : "2.16.840.1.113883.2.9.4.3.2",
"source" : [
{
"context" : "participantRole",
"element" : "id",
"variable" : "id",
"condition" : "(root = '2.16.840.1.113883.2.9.4.3.2')"
}
],
"rule" : [
{
"name" : "UUID",
"source" : [
{
"context" : "id",
"element" : "extension",
"variable" : "ext"
}
],
"target" : [
{
"context" : "request",
"contextType" : "variable",
"element" : "url",
"transform" : "append",
"parameter" : [
{
"valueString" : "Practitioner?identifier="
},
{
"valueId" : "ext"
}
]
}
]
}
]
},
{
"name" : "pe",
"source" : [
{
"context" : "participantRole",
"element" : "playingEntity",
"variable" : "pe"
}
],
"rule" : [
{
"name" : "name",
"source" : [
{
"context" : "pe",
"element" : "name",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "practitioner",
"contextType" : "variable",
"element" : "name",
"variable" : "vvv",
"transform" : "create"
}
]
}
]
}
]
}
]
}
]
},
{
"name" : "periodTiming",
"typeMode" : "none",
"input" : [
{
"name" : "effectiveTime",
"type" : "PIVL_TS",
"mode" : "source"
},
{
"name" : "timing",
"type" : "Timing",
"mode" : "target"
}
],
"rule" : [
{
"name" : "repeat",
"source" : [
{
"context" : "effectiveTime"
}
],
"target" : [
{
"context" : "timing",
"contextType" : "variable",
"element" : "repeat",
"variable" : "r"
}
],
"rule" : [
{
"name" : "period",
"source" : [
{
"context" : "effectiveTime",
"element" : "period",
"variable" : "p"
}
],
"target" : [
{
"context" : "r",
"contextType" : "variable",
"element" : "period",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "p.value"
}
]
}
]
},
{
"name" : "period",
"source" : [
{
"context" : "effectiveTime",
"element" : "period",
"variable" : "p"
}
],
"target" : [
{
"context" : "r",
"contextType" : "variable",
"element" : "periodUnit",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "p.unit"
}
]
}
]
}
]
}
]
},
{
"name" : "Act",
"typeMode" : "none",
"documentation" : "---------------------------------------------------------------------------------------",
"input" : [
{
"name" : "cda",
"type" : "Act",
"mode" : "source"
},
{
"name" : "pat",
"type" : "Patient",
"mode" : "target"
},
{
"name" : "ac",
"type" : "DiagnosticReport",
"mode" : "target"
},
{
"name" : "enc",
"type" : "Encounter",
"mode" : "target"
},
{
"name" : "bundle",
"type" : "Bundle",
"mode" : "target"
}
],
"rule" : [
{
"name" : "code",
"source" : [
{
"context" : "cda",
"element" : "code",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "ac",
"contextType" : "variable",
"element" : "code",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "statusCode",
"source" : [
{
"context" : "cda",
"element" : "statusCode",
"variable" : "statusc",
"condition" : "(code = 'completed')"
}
],
"target" : [
{
"context" : "ob",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "final"
}
]
}
]
},
{
"name" : "statusCode",
"source" : [
{
"context" : "cda",
"element" : "statusCode",
"variable" : "statusc",
"condition" : "(code = 'active')"
}
],
"target" : [
{
"context" : "ob",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "registered"
}
]
}
]
},
{
"name" : "statusCode",
"source" : [
{
"context" : "cda",
"element" : "statusCode",
"variable" : "statusc",
"condition" : "(code = 'aborted')"
}
],
"target" : [
{
"context" : "ob",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "cancelled"
}
]
}
]
},
{
"name" : "statusCode",
"source" : [
{
"context" : "cda",
"element" : "statusCode",
"variable" : "statusc",
"condition" : "(code = 'suspended')"
}
],
"target" : [
{
"context" : "ob",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "partial"
}
]
}
]
},
{
"name" : "value2a",
"source" : [
{
"context" : "cda",
"element" : "effectiveTime",
"variable" : "effectiveTime"
}
],
"target" : [
{
"context" : "ac",
"contextType" : "variable",
"element" : "effective",
"variable" : "value",
"transform" : "create",
"parameter" : [
{
"valueString" : "dateTime"
}
]
}
],
"dependent" : [
{
"name" : "TSDateTime",
"variable" : [
"effectiveTime",
"value"
]
}
]
},
{
"name" : "where",
"source" : [
{
"context" : "obs",
"condition" : "effectiveTime.low.exists() or effectiveTime.high.exists()"
}
],
"rule" : [
{
"name" : "value3a",
"source" : [
{
"context" : "cda",
"element" : "effectiveTime",
"variable" : "eff"
}
],
"target" : [
{
"context" : "ac",
"contextType" : "variable",
"element" : "effective",
"variable" : "period",
"transform" : "create",
"parameter" : [
{
"valueString" : "Period"
}
]
}
],
"dependent" : [
{
"name" : "IVLTSPeriod",
"variable" : [
"eff",
"period"
]
}
]
}
]
},
{
"name" : "reference",
"source" : [
{
"context" : "cda"
}
],
"target" : [
{
"context" : "ac",
"contextType" : "variable",
"element" : "subject",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/' + %pat.id"
}
]
}
]
},
{
"name" : "reference",
"source" : [
{
"context" : "cda"
}
],
"target" : [
{
"context" : "ac",
"contextType" : "variable",
"element" : "encounter",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/' + %enc.id"
}
]
}
]
},
{
"name" : "participant",
"source" : [
{
"context" : "cda",
"element" : "participant",
"variable" : "part"
}
],
"target" : [
{
"context" : "enc",
"contextType" : "variable",
"element" : "participant",
"variable" : "participant"
}
],
"rule" : [
{
"name" : "type",
"source" : [
{
"context" : "part"
}
],
"target" : [
{
"context" : "participant",
"contextType" : "variable",
"element" : "type",
"variable" : "type"
}
],
"rule" : [
{
"name" : "codeType",
"source" : [
{
"context" : "part"
}
],
"target" : [
{
"context" : "type",
"contextType" : "variable",
"element" : "coding",
"variable" : "coding"
}
],
"rule" : [
{
"name" : "codice",
"source" : [
{
"context" : "part"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "code",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "part.typeCode"
}
]
}
]
},
{
"name" : "system",
"source" : [
{
"context" : "part"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "system",
"transform" : "copy",
"parameter" : [
{
"valueString" : "http://terminology.hl7.org/CodeSystem/v3-ParticipationType"
}
]
}
]
}
]
}
]
},
{
"name" : "participantRole",
"source" : [
{
"context" : "part",
"element" : "participantRole",
"variable" : "participantRole"
}
],
"target" : [
{
"context" : "participant",
"contextType" : "variable",
"element" : "individual",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
}
],
"rule" : [
{
"name" : "participanRoleBund",
"source" : [
{
"context" : "participantRole"
}
],
"target" : [
{
"context" : "bundle",
"contextType" : "variable",
"element" : "entry",
"variable" : "e"
},
{
"context" : "e",
"contextType" : "variable",
"element" : "request",
"variable" : "request",
"transform" : "create",
"parameter" : [
{
"valueString" : "BackboneElement"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "method",
"transform" : "copy",
"parameter" : [
{
"valueString" : "PUT"
}
]
},
{
"context" : "e",
"contextType" : "variable",
"element" : "resource",
"variable" : "practitioner",
"transform" : "create",
"parameter" : [
{
"valueString" : "Practitioner"
}
]
},
{
"context" : "practitioner",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid1",
"transform" : "uuid"
},
{
"context" : "e",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "https://example/Practitioner/"
},
{
"valueId" : "uuid1"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Practitioner/' + %practitioner.id"
}
]
}
],
"rule" : [
{
"name" : "meta",
"source" : [
{
"context" : "participantRole"
}
],
"target" : [
{
"context" : "practitioner",
"contextType" : "variable",
"element" : "meta",
"variable" : "meta"
}
],
"rule" : [
{
"name" : "coding",
"source" : [
{
"context" : "participantRole"
}
],
"target" : [
{
"context" : "meta",
"contextType" : "variable",
"element" : "tag",
"variable" : "coding",
"transform" : "create",
"parameter" : [
{
"valueString" : "Coding"
}
]
}
],
"rule" : [
{
"name" : "system",
"source" : [
{
"context" : "participantRole"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "system",
"transform" : "copy",
"parameter" : [
{
"valueString" : "http://algoritmodiscoring"
}
]
}
]
},
{
"name" : "code",
"source" : [
{
"context" : "participantRole"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "code",
"transform" : "copy",
"parameter" : [
{
"valueString" : "ClinicalDocument/body/Act/participant"
}
]
}
]
}
]
}
]
},
{
"name" : "identifier",
"source" : [
{
"context" : "participantRole",
"element" : "id",
"variable" : "id"
}
],
"target" : [
{
"context" : "practitioner",
"contextType" : "variable",
"element" : "identifier",
"variable" : "identifier"
}
],
"rule" : [
{
"name" : "root1",
"source" : [
{
"context" : "id",
"element" : "root",
"variable" : "r"
}
],
"target" : [
{
"context" : "identifier",
"contextType" : "variable",
"element" : "system",
"transform" : "translate",
"parameter" : [
{
"valueId" : "r"
},
{
"valueString" : "http://hl7.org/fhir/ConceptMap/special-oid2uri"
},
{
"valueString" : "uri"
}
]
}
]
},
{
"name" : "ext",
"source" : [
{
"context" : "id",
"element" : "extension",
"variable" : "ext"
}
],
"target" : [
{
"context" : "identifier",
"contextType" : "variable",
"element" : "value",
"transform" : "copy",
"parameter" : [
{
"valueId" : "ext"
}
]
}
],
"rule" : [
{
"name" : "UUID",
"source" : [
{
"context" : "participantRole"
}
],
"target" : [
{
"context" : "request",
"contextType" : "variable",
"element" : "url",
"transform" : "append",
"parameter" : [
{
"valueString" : "Practitioner?identifier="
},
{
"valueId" : "ext"
}
]
}
]
}
]
},
{
"name" : "assigningAuthorityName",
"source" : [
{
"context" : "id",
"element" : "assigningAuthorityName",
"variable" : "s"
}
],
"target" : [
{
"context" : "identifier",
"contextType" : "variable",
"element" : "assigner",
"variable" : "a"
},
{
"context" : "a",
"contextType" : "variable",
"element" : "display",
"transform" : "copy",
"parameter" : [
{
"valueId" : "s"
}
]
}
]
}
]
},
{
"name" : "playingEntity",
"source" : [
{
"context" : "participantRole",
"element" : "playingEntity",
"variable" : "playingEntity"
}
],
"rule" : [
{
"name" : "name",
"source" : [
{
"context" : "playingEntity",
"element" : "name",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "practitioner",
"contextType" : "variable",
"element" : "name",
"variable" : "vvv",
"transform" : "create"
}
]
}
]
}
]
}
]
}
]
},
{
"name" : "entryRelationship",
"source" : [
{
"context" : "cda",
"element" : "entryRelationship",
"variable" : "entryRelationship"
}
],
"rule" : [
{
"name" : "OBS",
"source" : [
{
"context" : "entryRelationship",
"element" : "observation",
"variable" : "observation"
}
],
"target" : [
{
"context" : "bundle",
"contextType" : "variable",
"element" : "entry",
"variable" : "e"
},
{
"context" : "e",
"contextType" : "variable",
"element" : "request",
"variable" : "request",
"transform" : "create",
"parameter" : [
{
"valueString" : "BackboneElement"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "method",
"transform" : "copy",
"parameter" : [
{
"valueString" : "POST"
}
]
},
{
"context" : "e",
"contextType" : "variable",
"element" : "resource",
"variable" : "obs",
"transform" : "create",
"parameter" : [
{
"valueString" : "Observation"
}
]
},
{
"context" : "obs",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid2",
"transform" : "uuid"
},
{
"context" : "e",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "https://example/Observation/"
},
{
"valueId" : "uuid2"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "url",
"transform" : "append",
"parameter" : [
{
"valueString" : "Observation/"
},
{
"valueId" : "uuid2"
}
]
},
{
"context" : "ac",
"contextType" : "variable",
"element" : "result",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Observation/' + %obs.id"
}
]
}
],
"dependent" : [
{
"name" : "Observation",
"variable" : [
"observation",
"pat",
"enc",
"obs",
"bundle"
]
}
]
}
]
}
]
},
{
"name" : "ClinicalDocumentSectionTerapiaDimissione",
"typeMode" : "none",
"input" : [
{
"name" : "cda",
"type" : "ClinicalDocument",
"mode" : "source"
},
{
"name" : "src",
"type" : "Section",
"mode" : "source"
},
{
"name" : "patient",
"type" : "Patient",
"mode" : "target"
},
{
"name" : "tgt",
"mode" : "target"
},
{
"name" : "bundle",
"type" : "Bundle",
"mode" : "target"
},
{
"name" : "enc",
"type" : "Encounter",
"mode" : "target"
}
],
"rule" : [
{
"name" : "title",
"source" : [
{
"context" : "src",
"element" : "title",
"variable" : "t"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "title",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "t.dataString"
}
]
}
]
},
{
"name" : "code",
"source" : [
{
"context" : "src",
"element" : "code",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "code",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "exist",
"source" : [
{
"context" : "src",
"condition" : "src.entry.exists()"
}
],
"rule" : [
{
"name" : "cdaText",
"source" : [
{
"context" : "src",
"element" : "text",
"variable" : "cdaText"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "text",
"variable" : "fhirText"
}
],
"rule" : [
{
"name" : "narrativeStatus",
"source" : [
{
"context" : "cdaText"
}
],
"target" : [
{
"context" : "fhirText",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "generated"
}
]
}
]
},
{
"name" : "narrativeText",
"source" : [
{
"context" : "cdaText",
"variable" : "t"
}
],
"target" : [
{
"context" : "fhirText",
"contextType" : "variable",
"element" : "div",
"transform" : "copy",
"parameter" : [
{
"valueId" : "t"
}
]
}
]
}
]
}
]
},
{
"name" : "where",
"source" : [
{
"context" : "src",
"condition" : "src.entry.exists().not()"
}
],
"rule" : [
{
"name" : "cdaText",
"source" : [
{
"context" : "src",
"element" : "text",
"variable" : "cdaText"
}
],
"target" : [
{
"context" : "bundle",
"contextType" : "variable",
"element" : "entry",
"variable" : "e1"
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "request",
"variable" : "request",
"transform" : "create",
"parameter" : [
{
"valueString" : "BackboneElement"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "method",
"transform" : "copy",
"parameter" : [
{
"valueString" : "POST"
}
]
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "resource",
"variable" : "medicationRq",
"transform" : "create",
"parameter" : [
{
"valueString" : "MedicationRequest"
}
]
},
{
"context" : "medicationRq",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid1",
"transform" : "uuid"
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "https://example/MedicationRequest/"
},
{
"valueId" : "uuid1"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "url",
"transform" : "copy",
"parameter" : [
{
"valueString" : "MedicationRequest"
}
]
},
{
"context" : "tgt",
"contextType" : "variable",
"element" : "entry",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/MedicationRequest/' + %medicationRq.id"
}
]
}
],
"rule" : [
{
"name" : "reference",
"source" : [
{
"context" : "src"
}
],
"target" : [
{
"context" : "medicationRq",
"contextType" : "variable",
"element" : "subject",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Patient/' + %patient.id"
}
]
}
]
},
{
"name" : "reference",
"source" : [
{
"context" : "src"
}
],
"target" : [
{
"context" : "medicationRq",
"contextType" : "variable",
"element" : "encounter",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Encounter/' + %enc.id"
}
]
}
]
},
{
"name" : "status",
"source" : [
{
"context" : "src"
}
],
"target" : [
{
"context" : "medicationRq",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "active"
}
]
}
]
},
{
"name" : "intent",
"source" : [
{
"context" : "src"
}
],
"target" : [
{
"context" : "medicationRq",
"contextType" : "variable",
"element" : "intent",
"transform" : "copy",
"parameter" : [
{
"valueString" : "order"
}
]
}
]
},
{
"name" : "code",
"source" : [
{
"context" : "cdaText"
}
],
"target" : [
{
"context" : "medicationRq",
"contextType" : "variable",
"element" : "medication",
"variable" : "codecon",
"transform" : "create",
"parameter" : [
{
"valueString" : "CodeableConcept"
}
]
}
],
"rule" : [
{
"name" : "text",
"source" : [
{
"context" : "cdaText"
}
],
"target" : [
{
"context" : "codecon",
"contextType" : "variable",
"element" : "text",
"transform" : "copy",
"parameter" : [
{
"valueString" : "string"
}
]
}
]
}
]
},
{
"name" : "reference",
"source" : [
{
"context" : "cdaText"
}
],
"target" : [
{
"context" : "medicationRq",
"contextType" : "variable",
"element" : "note",
"variable" : "note"
}
],
"rule" : [
{
"name" : "reference",
"source" : [
{
"context" : "cdaText",
"variable" : "t"
}
],
"target" : [
{
"context" : "note",
"contextType" : "variable",
"element" : "text",
"transform" : "copy",
"parameter" : [
{
"valueId" : "t"
}
]
}
]
}
]
}
]
}
]
},
{
"name" : "substract",
"source" : [
{
"context" : "src",
"element" : "entry",
"variable" : "entry1"
}
],
"target" : [
{
"context" : "bundle",
"contextType" : "variable",
"element" : "entry",
"variable" : "e1"
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "request",
"variable" : "request",
"transform" : "create",
"parameter" : [
{
"valueString" : "BackboneElement"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "method",
"transform" : "copy",
"parameter" : [
{
"valueString" : "POST"
}
]
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "resource",
"variable" : "medicationRq",
"transform" : "create",
"parameter" : [
{
"valueString" : "MedicationRequest"
}
]
},
{
"context" : "medicationRq",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid1",
"transform" : "uuid"
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "https://example/MedicationRequest/"
},
{
"valueId" : "uuid1"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "url",
"transform" : "copy",
"parameter" : [
{
"valueString" : "MedicationRequest"
}
]
},
{
"context" : "tgt",
"contextType" : "variable",
"element" : "entry",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/MedicationRequest/' + %medicationRq.id"
}
]
}
],
"rule" : [
{
"name" : "reference",
"source" : [
{
"context" : "src"
}
],
"target" : [
{
"context" : "medicationRq",
"contextType" : "variable",
"element" : "subject",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Patient/' + %patient.id"
}
]
}
]
},
{
"name" : "reference",
"source" : [
{
"context" : "src"
}
],
"target" : [
{
"context" : "medicationRq",
"contextType" : "variable",
"element" : "encounter",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Encounter/' + %enc.id"
}
]
}
]
},
{
"name" : "status",
"source" : [
{
"context" : "src"
}
],
"target" : [
{
"context" : "medicationRq",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "active"
}
]
}
]
},
{
"name" : "intent",
"source" : [
{
"context" : "src"
}
],
"target" : [
{
"context" : "medicationRq",
"contextType" : "variable",
"element" : "intent",
"transform" : "copy",
"parameter" : [
{
"valueString" : "order"
}
]
}
]
},
{
"name" : "participant",
"source" : [
{
"context" : "entry1",
"element" : "substanceAdministration",
"variable" : "substract"
}
],
"rule" : [
{
"name" : "cons",
"source" : [
{
"context" : "substract",
"element" : "consumable",
"variable" : "cons"
}
],
"rule" : [
{
"name" : "man1",
"source" : [
{
"context" : "cons",
"element" : "manufacturedProduct",
"variable" : "man1"
}
],
"target" : [
{
"context" : "bundle",
"contextType" : "variable",
"element" : "entry",
"variable" : "e1"
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "request",
"variable" : "request",
"transform" : "create",
"parameter" : [
{
"valueString" : "BackboneElement"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "method",
"transform" : "copy",
"parameter" : [
{
"valueString" : "POST"
}
]
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "resource",
"variable" : "medication",
"transform" : "create",
"parameter" : [
{
"valueString" : "Medication"
}
]
},
{
"context" : "medication",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid1",
"transform" : "uuid"
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "https://example/Medication/"
},
{
"valueId" : "uuid1"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "url",
"transform" : "copy",
"parameter" : [
{
"valueString" : "Medication"
}
]
},
{
"context" : "medicationRq",
"contextType" : "variable",
"element" : "medication",
"variable" : "medref",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "medref",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Medication/' + %medication.id"
}
]
}
],
"rule" : [
{
"name" : "mm",
"source" : [
{
"context" : "man1",
"element" : "manufacturedMaterial",
"variable" : "mm"
}
],
"rule" : [
{
"name" : "code",
"source" : [
{
"context" : "mm",
"element" : "code",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "medication",
"contextType" : "variable",
"element" : "code",
"variable" : "vvv",
"transform" : "create"
}
]
}
]
},
{
"name" : "administrationUnitCode",
"source" : [
{
"context" : "substract",
"element" : "administrationUnitCode",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "medication",
"contextType" : "variable",
"element" : "form",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "entryR",
"source" : [
{
"context" : "substract",
"element" : "entryRelationship",
"variable" : "entryR"
}
],
"rule" : [
{
"name" : "obs",
"source" : [
{
"context" : "entryR",
"element" : "observation",
"variable" : "observation"
}
],
"rule" : [
{
"name" : "ingredient",
"source" : [
{
"context" : "observation",
"element" : "code",
"condition" : "displayName = 'Grammatura'"
}
],
"target" : [
{
"context" : "medication",
"contextType" : "variable",
"element" : "ingredient",
"variable" : "ingredient"
}
],
"rule" : [
{
"name" : "consumable",
"source" : [
{
"context" : "substract",
"element" : "consumable",
"variable" : "consumable"
}
],
"rule" : [
{
"name" : "product",
"source" : [
{
"context" : "consumable",
"element" : "manufacturedProduct",
"variable" : "manufacturedProduct"
}
],
"rule" : [
{
"name" : "material",
"source" : [
{
"context" : "manufacturedProduct",
"element" : "manufacturedMaterial",
"variable" : "manufacturedMaterial"
}
],
"rule" : [
{
"name" : "CE",
"source" : [
{
"context" : "manufacturedMaterial",
"element" : "code",
"variable" : "code"
}
],
"target" : [
{
"context" : "ingredient",
"contextType" : "variable",
"element" : "item",
"variable" : "value",
"transform" : "create",
"parameter" : [
{
"valueString" : "CodeableConcept"
}
]
}
],
"dependent" : [
{
"name" : "CECodeableConcept",
"variable" : [
"code",
"value"
]
}
]
}
]
}
]
}
]
},
{
"name" : "strenght",
"source" : [
{
"context" : "observation",
"element" : "value",
"variable" : "value"
}
],
"target" : [
{
"context" : "ingredient",
"contextType" : "variable",
"element" : "strength",
"variable" : "strength"
}
],
"rule" : [
{
"name" : "numerator",
"source" : [
{
"context" : "value"
}
],
"target" : [
{
"context" : "strength",
"contextType" : "variable",
"element" : "numerator",
"variable" : "numerator"
}
],
"rule" : [
{
"name" : "valueN",
"source" : [
{
"context" : "value"
}
],
"target" : [
{
"context" : "numerator",
"contextType" : "variable",
"element" : "value",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "value.value"
}
]
}
]
}
]
},
{
"name" : "denominator",
"source" : [
{
"context" : "value"
}
],
"target" : [
{
"context" : "strength",
"contextType" : "variable",
"element" : "denominator",
"variable" : "denominator"
}
],
"rule" : [
{
"name" : "valueD",
"source" : [
{
"context" : "value"
}
],
"target" : [
{
"context" : "denominator",
"contextType" : "variable",
"element" : "value",
"transform" : "copy",
"parameter" : [
{
"valueInteger" : 1
}
]
}
]
}
]
}
]
}
]
},
{
"name" : "quantita",
"source" : [
{
"context" : "observation",
"element" : "code",
"condition" : "displayName = 'Quantità nella Confezione'"
}
],
"rule" : [
{
"name" : "amount",
"source" : [
{
"context" : "observation",
"element" : "value",
"variable" : "value"
}
],
"target" : [
{
"context" : "medication",
"contextType" : "variable",
"element" : "amount",
"variable" : "amount"
}
],
"rule" : [
{
"name" : "numerator",
"source" : [
{
"context" : "value"
}
],
"target" : [
{
"context" : "amount",
"contextType" : "variable",
"element" : "numerator",
"variable" : "numerator"
}
],
"rule" : [
{
"name" : "valueN",
"source" : [
{
"context" : "value"
}
],
"target" : [
{
"context" : "numerator",
"contextType" : "variable",
"element" : "value",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "value.value"
}
]
}
]
}
]
},
{
"name" : "denominator",
"source" : [
{
"context" : "value"
}
],
"target" : [
{
"context" : "amount",
"contextType" : "variable",
"element" : "denominator",
"variable" : "denominator"
}
],
"rule" : [
{
"name" : "valueD",
"source" : [
{
"context" : "value"
}
],
"target" : [
{
"context" : "denominator",
"contextType" : "variable",
"element" : "value",
"transform" : "copy",
"parameter" : [
{
"valueInteger" : 1
}
]
}
]
}
]
}
]
}
]
}
]
}
]
},
{
"name" : "entry",
"source" : [
{
"context" : "substract",
"element" : "entryRelationship",
"variable" : "entryRelationship"
}
],
"rule" : [
{
"name" : "sub",
"source" : [
{
"context" : "entryRelationship",
"element" : "supply",
"variable" : "sup"
}
],
"target" : [
{
"context" : "medicationRq",
"contextType" : "variable",
"element" : "dispenseRequest",
"variable" : "dispreq"
}
],
"rule" : [
{
"name" : "quantity",
"source" : [
{
"context" : "sup"
}
],
"target" : [
{
"context" : "dispreq",
"contextType" : "variable",
"element" : "quantity",
"variable" : "quantity",
"transform" : "create",
"parameter" : [
{
"valueString" : "SimpleQuantity"
}
]
}
],
"rule" : [
{
"name" : "quantity",
"source" : [
{
"context" : "sup",
"element" : "quantity",
"variable" : "q"
}
],
"target" : [
{
"context" : "quantity",
"contextType" : "variable",
"element" : "value",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "q.value"
}
]
}
]
}
]
}
]
}
]
}
]
}
]
},
{
"name" : "tx",
"source" : [
{
"context" : "substract",
"element" : "text",
"variable" : "tx"
}
],
"target" : [
{
"context" : "medicationRq",
"contextType" : "variable",
"element" : "note",
"variable" : "note"
}
],
"rule" : [
{
"name" : "reference",
"source" : [
{
"context" : "tx",
"element" : "reference",
"variable" : "ref"
}
],
"target" : [
{
"context" : "note",
"contextType" : "variable",
"element" : "text",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "ref.value"
}
]
}
]
}
]
},
{
"name" : "statusCode",
"source" : [
{
"context" : "substract",
"element" : "statusCode",
"variable" : "st"
}
],
"target" : [
{
"context" : "medicationRq",
"contextType" : "variable",
"element" : "status",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "st.code"
}
]
}
]
},
{
"name" : "period",
"source" : [
{
"context" : "substract",
"type" : "IVL_TS",
"element" : "effectiveTime",
"variable" : "eff"
}
],
"target" : [
{
"context" : "medicationRq",
"contextType" : "variable",
"element" : "dosageInstruction",
"variable" : "dosage",
"transform" : "create",
"parameter" : [
{
"valueString" : "Dosage"
}
]
}
],
"rule" : [
{
"name" : "timing",
"source" : [
{
"context" : "eff"
}
],
"target" : [
{
"context" : "dosage",
"contextType" : "variable",
"element" : "timing",
"variable" : "timing",
"transform" : "create",
"parameter" : [
{
"valueString" : "Timing"
}
]
}
],
"rule" : [
{
"name" : "rep",
"source" : [
{
"context" : "eff"
}
],
"target" : [
{
"context" : "timing",
"contextType" : "variable",
"element" : "repeat",
"variable" : "rep"
}
],
"rule" : [
{
"name" : "period",
"source" : [
{
"context" : "eff"
}
],
"target" : [
{
"context" : "rep",
"contextType" : "variable",
"element" : "bounds",
"variable" : "period",
"transform" : "create",
"parameter" : [
{
"valueString" : "Period"
}
]
}
],
"dependent" : [
{
"name" : "IVLTSPeriod",
"variable" : [
"eff",
"period"
]
}
]
}
]
}
]
}
]
},
{
"name" : "period",
"source" : [
{
"context" : "substract",
"type" : "EIVL_TS",
"element" : "effectiveTime",
"variable" : "eff"
}
],
"target" : [
{
"context" : "medicationRq",
"contextType" : "variable",
"element" : "dosageInstruction",
"variable" : "dosage",
"transform" : "create",
"parameter" : [
{
"valueString" : "Dosage"
}
]
}
],
"rule" : [
{
"name" : "timing",
"source" : [
{
"context" : "eff"
}
],
"target" : [
{
"context" : "dosage",
"contextType" : "variable",
"element" : "timing",
"variable" : "timing",
"transform" : "create",
"parameter" : [
{
"valueString" : "Timing"
}
]
}
],
"rule" : [
{
"name" : "rep",
"source" : [
{
"context" : "eff"
}
],
"target" : [
{
"context" : "timing",
"contextType" : "variable",
"element" : "repeat",
"variable" : "rep"
}
],
"rule" : [
{
"name" : "event",
"source" : [
{
"context" : "eff",
"element" : "event",
"variable" : "ev"
}
],
"target" : [
{
"context" : "rep",
"contextType" : "variable",
"element" : "when",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "ev.code"
}
]
}
]
}
]
}
]
}
]
},
{
"name" : "tim",
"source" : [
{
"context" : "substract",
"type" : "IVL_TS",
"element" : "effectiveTime",
"variable" : "eff"
}
],
"target" : [
{
"context" : "medicationRq",
"contextType" : "variable",
"element" : "dosageInstruction",
"variable" : "dosage",
"transform" : "create",
"parameter" : [
{
"valueString" : "Dosage"
}
]
},
{
"context" : "dosage",
"contextType" : "variable",
"element" : "timing",
"variable" : "timing",
"transform" : "create",
"parameter" : [
{
"valueString" : "Timing"
}
]
},
{
"context" : "timing",
"contextType" : "variable",
"element" : "event",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "eff.value"
}
]
}
]
},
{
"name" : "eff",
"source" : [
{
"context" : "substract",
"type" : "PIVL_TS",
"element" : "effectiveTime",
"variable" : "eff"
}
],
"target" : [
{
"context" : "medicationRq",
"contextType" : "variable",
"element" : "dosageInstruction",
"variable" : "dosage",
"transform" : "create",
"parameter" : [
{
"valueString" : "Dosage"
}
]
}
],
"rule" : [
{
"name" : "cod",
"source" : [
{
"context" : "eff"
}
],
"target" : [
{
"context" : "dosage",
"contextType" : "variable",
"element" : "timing",
"variable" : "timing",
"transform" : "create",
"parameter" : [
{
"valueString" : "Timing"
}
]
}
],
"dependent" : [
{
"name" : "periodTiming",
"variable" : [
"eff",
"timing"
]
}
]
}
]
},
{
"name" : "dosage",
"source" : [
{
"context" : "substract"
}
],
"target" : [
{
"context" : "medicationRq",
"contextType" : "variable",
"element" : "dosageInstruction",
"variable" : "dosage",
"transform" : "create",
"parameter" : [
{
"valueString" : "Dosage"
}
]
}
],
"rule" : [
{
"name" : "routeCode",
"source" : [
{
"context" : "substract",
"element" : "routeCode",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "dosage",
"contextType" : "variable",
"element" : "route",
"variable" : "vvv",
"transform" : "create"
}
]
}
]
},
{
"name" : "dosage",
"source" : [
{
"context" : "substract"
}
],
"target" : [
{
"context" : "medicationRq",
"contextType" : "variable",
"element" : "dosageInstruction",
"variable" : "dosage",
"transform" : "create",
"parameter" : [
{
"valueString" : "Dosage"
}
]
}
],
"rule" : [
{
"name" : "approachSiteCode",
"source" : [
{
"context" : "substract",
"element" : "approachSiteCode",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "dosage",
"contextType" : "variable",
"element" : "site",
"variable" : "vvv",
"transform" : "create"
}
]
}
]
},
{
"name" : "Dosage",
"source" : [
{
"context" : "substract",
"element" : "doseQuantity",
"variable" : "doseQuant"
}
],
"target" : [
{
"context" : "medicationRq",
"contextType" : "variable",
"element" : "dosageInstruction",
"variable" : "dosageInstruction",
"transform" : "create",
"parameter" : [
{
"valueString" : "Dosage"
}
]
}
],
"rule" : [
{
"name" : "ot",
"source" : [
{
"context" : "doseQuant",
"element" : "originalText",
"variable" : "ot"
}
],
"rule" : [
{
"name" : "reference",
"source" : [
{
"context" : "ot",
"element" : "reference",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "dosageInstruction",
"contextType" : "variable",
"element" : "text",
"variable" : "vvv",
"transform" : "create"
}
]
}
]
},
{
"name" : "dosageRate",
"source" : [
{
"context" : "doseQuant"
}
],
"target" : [
{
"context" : "dosageInstruction",
"contextType" : "variable",
"element" : "doseAndRate",
"variable" : "dosageRate"
}
],
"rule" : [
{
"name" : "d",
"source" : [
{
"context" : "doseQuant"
}
],
"target" : [
{
"context" : "dosageRate",
"contextType" : "variable",
"element" : "dose",
"variable" : "d",
"transform" : "create",
"parameter" : [
{
"valueString" : "Range"
}
]
}
],
"rule" : [
{
"name" : "low",
"source" : [
{
"context" : "doseQuant"
}
],
"target" : [
{
"context" : "d",
"contextType" : "variable",
"element" : "low",
"variable" : "l",
"transform" : "create",
"parameter" : [
{
"valueString" : "SimpleQuantity"
}
]
}
],
"rule" : [
{
"name" : "low",
"source" : [
{
"context" : "doseQuant",
"element" : "low",
"variable" : "lo"
}
],
"target" : [
{
"context" : "l",
"contextType" : "variable",
"element" : "value",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "lo.value"
}
]
}
]
},
{
"name" : "low",
"source" : [
{
"context" : "doseQuant",
"element" : "low",
"variable" : "lo"
}
],
"target" : [
{
"context" : "l",
"contextType" : "variable",
"element" : "unit",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "lo.unit"
}
]
}
]
}
]
},
{
"name" : "low",
"source" : [
{
"context" : "doseQuant"
}
],
"target" : [
{
"context" : "d",
"contextType" : "variable",
"element" : "high",
"variable" : "h",
"transform" : "create",
"parameter" : [
{
"valueString" : "SimpleQuantity"
}
]
}
],
"rule" : [
{
"name" : "high",
"source" : [
{
"context" : "doseQuant",
"element" : "high",
"variable" : "hi"
}
],
"target" : [
{
"context" : "h",
"contextType" : "variable",
"element" : "value",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "hi.value"
}
]
}
]
},
{
"name" : "high",
"source" : [
{
"context" : "doseQuant",
"element" : "high",
"variable" : "hi"
}
],
"target" : [
{
"context" : "h",
"contextType" : "variable",
"element" : "unit",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "hi.unit"
}
]
}
]
}
]
}
]
}
]
}
]
},
{
"name" : "rateq",
"source" : [
{
"context" : "substract",
"element" : "rateQuantity",
"variable" : "rateQuantity"
}
],
"target" : [
{
"context" : "medicationRq",
"contextType" : "variable",
"element" : "dosageInstruction",
"variable" : "dosageInstruction1",
"transform" : "create",
"parameter" : [
{
"valueString" : "Dosage"
}
]
}
],
"rule" : [
{
"name" : "ot",
"source" : [
{
"context" : "rateQuantity",
"element" : "originalText",
"variable" : "ot"
}
],
"rule" : [
{
"name" : "reference",
"source" : [
{
"context" : "ot",
"element" : "reference",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "dosageInstruction1",
"contextType" : "variable",
"element" : "text",
"variable" : "vvv",
"transform" : "create"
}
]
}
]
},
{
"name" : "dosageRate",
"source" : [
{
"context" : "rateQuantity"
}
],
"target" : [
{
"context" : "dosageInstruction1",
"contextType" : "variable",
"element" : "doseAndRate",
"variable" : "dosageRate"
}
],
"rule" : [
{
"name" : "d",
"source" : [
{
"context" : "rateQuantity"
}
],
"target" : [
{
"context" : "dosageRate",
"contextType" : "variable",
"element" : "rate",
"variable" : "d",
"transform" : "create",
"parameter" : [
{
"valueString" : "Range"
}
]
}
],
"rule" : [
{
"name" : "low",
"source" : [
{
"context" : "rateQuantity"
}
],
"target" : [
{
"context" : "d",
"contextType" : "variable",
"element" : "low",
"variable" : "l",
"transform" : "create",
"parameter" : [
{
"valueString" : "SimpleQuantity"
}
]
}
],
"rule" : [
{
"name" : "low",
"source" : [
{
"context" : "rateQuantity",
"element" : "low",
"variable" : "lo"
}
],
"target" : [
{
"context" : "l",
"contextType" : "variable",
"element" : "value",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "lo.value"
}
]
}
]
},
{
"name" : "low",
"source" : [
{
"context" : "rateQuantity",
"element" : "low",
"variable" : "lo"
}
],
"target" : [
{
"context" : "l",
"contextType" : "variable",
"element" : "unit",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "lo.unit"
}
]
}
]
}
]
},
{
"name" : "low",
"source" : [
{
"context" : "rateQuantity"
}
],
"target" : [
{
"context" : "d",
"contextType" : "variable",
"element" : "high",
"variable" : "h",
"transform" : "create",
"parameter" : [
{
"valueString" : "SimpleQuantity"
}
]
}
],
"rule" : [
{
"name" : "high",
"source" : [
{
"context" : "rateQuantity",
"element" : "high",
"variable" : "hi"
}
],
"target" : [
{
"context" : "h",
"contextType" : "variable",
"element" : "value",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "hi.value"
}
]
}
]
},
{
"name" : "high",
"source" : [
{
"context" : "rateQuantity",
"element" : "high",
"variable" : "hi"
}
],
"target" : [
{
"context" : "h",
"contextType" : "variable",
"element" : "unit",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "hi.unit"
}
]
}
]
}
]
}
]
}
]
}
]
},
{
"name" : "partRole",
"source" : [
{
"context" : "substract",
"element" : "participant",
"variable" : "part"
}
],
"target" : [
{
"context" : "bundle",
"contextType" : "variable",
"element" : "entry",
"variable" : "e1"
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "request",
"variable" : "request",
"transform" : "create",
"parameter" : [
{
"valueString" : "BackboneElement"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "method",
"transform" : "copy",
"parameter" : [
{
"valueString" : "PUT"
}
]
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "resource",
"variable" : "practitioner",
"transform" : "create",
"parameter" : [
{
"valueString" : "Practitioner"
}
]
}
],
"rule" : [
{
"name" : "time",
"source" : [
{
"context" : "part",
"element" : "time",
"variable" : "time"
}
],
"target" : [
{
"context" : "medicationRq",
"contextType" : "variable",
"element" : "authoredOn",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "time.value"
}
]
}
]
},
{
"name" : "perf",
"source" : [
{
"context" : "part",
"element" : "participantRole",
"variable" : "partRole"
}
],
"rule" : [
{
"name" : "meta",
"source" : [
{
"context" : "partRole"
}
],
"target" : [
{
"context" : "practitioner",
"contextType" : "variable",
"element" : "meta",
"variable" : "meta"
}
],
"rule" : [
{
"name" : "coding",
"source" : [
{
"context" : "partRole"
}
],
"target" : [
{
"context" : "meta",
"contextType" : "variable",
"element" : "tag",
"variable" : "coding",
"transform" : "create",
"parameter" : [
{
"valueString" : "Coding"
}
]
}
],
"rule" : [
{
"name" : "system",
"source" : [
{
"context" : "partRole"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "system",
"transform" : "copy",
"parameter" : [
{
"valueString" : "http://algoritmodiscoring"
}
]
}
]
},
{
"name" : "code",
"source" : [
{
"context" : "partRole"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "code",
"transform" : "copy",
"parameter" : [
{
"valueString" : "ClinicalDocument/body/TerapiaFarmacologicaRicovero/participant"
}
]
}
]
}
]
}
]
},
{
"name" : "identifier",
"source" : [
{
"context" : "partRole",
"element" : "id",
"variable" : "id"
}
],
"target" : [
{
"context" : "practitioner",
"contextType" : "variable",
"element" : "identifier",
"variable" : "identifier"
}
],
"rule" : [
{
"name" : "root1",
"source" : [
{
"context" : "id",
"element" : "root",
"variable" : "r"
}
],
"target" : [
{
"context" : "identifier",
"contextType" : "variable",
"element" : "system",
"transform" : "translate",
"parameter" : [
{
"valueId" : "r"
},
{
"valueString" : "http://hl7.org/fhir/ConceptMap/special-oid2uri"
},
{
"valueString" : "uri"
}
]
}
]
},
{
"name" : "extension",
"source" : [
{
"context" : "id",
"element" : "extension",
"variable" : "ext"
}
],
"target" : [
{
"context" : "identifier",
"contextType" : "variable",
"element" : "value",
"transform" : "copy",
"parameter" : [
{
"valueId" : "ext"
}
]
}
]
},
{
"name" : "assigningAuthorityName",
"source" : [
{
"context" : "id",
"element" : "assigningAuthorityName",
"variable" : "s"
}
],
"target" : [
{
"context" : "identifier",
"contextType" : "variable",
"element" : "assigner",
"variable" : "a"
},
{
"context" : "a",
"contextType" : "variable",
"element" : "display",
"transform" : "copy",
"parameter" : [
{
"valueId" : "s"
}
]
}
]
},
{
"name" : "r",
"source" : [
{
"context" : "id",
"element" : "root",
"variable" : "r"
}
],
"rule" : [
{
"name" : "aut",
"source" : [
{
"context" : "id",
"element" : "extension",
"variable" : "ext"
}
],
"target" : [
{
"context" : "practitioner",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid2",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "r + '-' + ext"
}
]
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "https://example/Practitioner/"
},
{
"valueId" : "uuid2"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "url",
"transform" : "append",
"parameter" : [
{
"valueString" : "Practitioner/"
},
{
"valueId" : "uuid1"
}
]
},
{
"context" : "medicationRq",
"contextType" : "variable",
"element" : "performer",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Practitioner/' + %practitioner.id"
}
]
}
]
}
]
}
]
},
{
"name" : "2.16.840.1.113883.2.9.4.3.2",
"source" : [
{
"context" : "partRole",
"element" : "id",
"variable" : "id",
"condition" : "(root = '2.16.840.1.113883.2.9.4.3.2')"
}
],
"rule" : [
{
"name" : "UUID",
"source" : [
{
"context" : "id",
"element" : "extension",
"variable" : "ext"
}
],
"target" : [
{
"context" : "request",
"contextType" : "variable",
"element" : "url",
"transform" : "append",
"parameter" : [
{
"valueString" : "Practitioner?identifier="
},
{
"valueId" : "ext"
}
]
}
]
}
]
},
{
"name" : "assi",
"source" : [
{
"context" : "partRole",
"element" : "playingEntity",
"variable" : "assi"
}
],
"rule" : [
{
"name" : "name",
"source" : [
{
"context" : "assi",
"element" : "name",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "practitioner",
"contextType" : "variable",
"element" : "name",
"variable" : "vvv",
"transform" : "create"
}
]
}
]
}
]
}
]
}
]
}
]
}
]
}
]
}