CDA to FHIR Maps - Local Development build (v0.1.0) built by the FHIR (HL7® FHIR® Standard) Build Tools. See the Directory of published versions
Draft as of 2024-04-11 |
{
"resourceType" : "StructureMap",
"id" : "cda2fhirEdReport",
"text" : {
"status" : "generated",
"div" : "<div xmlns=\"http://www.w3.org/1999/xhtml\">\n <pre>map "http://hl7.it/fhir/cda2fhir/StructureMap/cda2fhirEdReport" = "cda2fhirEdReport"\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/IVL-TS" 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\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 e6, e6.request = create('BackboneElement') as request, request.method = 'POST', e6.resource = create('DocumentReference') as DocumentReference, DocumentReference.id = uuid() as uuid6, e6.fullUrl = append('https://example/DocumentReference/', uuid6), 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 ext1 -> identifier.value = ext1 "value";\n id.assigningAuthorityName as s -> identifier.assigner as a, a.display = s;\n } "idfr";\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 } "record";\n } "recPat";\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 component.section as srcSection then {\n srcSection.code where (code = '11459-5') -> composition.section as tgtSection then ModalitadiTrasposto(cda, srcSection, patient, tgtSection, bundle, encounter) "Modalitaditrasporto";\n srcSection.code where (code = '78337-3') -> composition.section as tgtSection then InquadramentoClinicoIniziale(cda, srcSection, patient, tgtSection, bundle, encounter) "Inquadramentoclinico";\n srcSection.code where (code = '46239-0') -> composition.section as tgtSection then MotivoDellaVisita(cda, srcSection, patient, tgtSection, bundle, encounter) "Inquadramentoclinico";\n srcSection.code where (code = '54094-8') -> composition.section as tgtSection then Triage(cda, srcSection, patient, tgtSection, bundle, encounter) "Triage";\n srcSection.code where (code = '46240-8') -> composition.section as tgtSection then ClinicalDocumentSectionEncounter(cda, srcSection, patient, tgtSection, bundle, encounter) "motivoricovero";\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 = '62387-6') -> 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 ClinicalDocumentSectionAccertamenti(cda, srcSection, patient, tgtSection, bundle, encounter) "Accertamenti";\n srcSection.code where (code = '8716-3') -> composition.section as tgtSection then ClinicalDocumentSectionParametriVitali(cda, srcSection, patient, tgtSection, bundle, encounter) "Accertamenti";\n srcSection.code where (code = '29549-3') -> composition.section as tgtSection then ClinicalDocumentSectionTerapiaFarmacoInPronto(cda, srcSection, patient, tgtSection, bundle, encounter) "Accertamenti";\n srcSection.code where (code = '18776-5') -> composition.section as tgtSection then ClinicalDocumentSectionPianoCuraDimissione(cda, srcSection, patient, tgtSection, bundle, encounter) "Pianodicuraalladimissione";\n srcSection.code where (code = '28574-2') -> composition.section as tgtSection then ClinicalDocumentSectionDimissione(cda, srcSection, patient, tgtSection, bundle, encounter) "Dimissione";\n srcSection.code where (code = '75311-1') -> composition.section as tgtSection then ClinicalDocumentSectionTerapiaFarmacologicaDimissione(cda, srcSection, patient, tgtSection, bundle, encounter) "TerapiaFarmacologicaDimissione";\n };\n };\n } "body";\n };\n}\n\n// Sezione complicanze--------------------------------------------------------------------------\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 } "entryexists";\n // Sezione Strutturata-----------------------------------------------------------------------------------------------------------------------------------------------\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 // Sezione Narrativa---------------------------------------------------------------------------------------------------------------------------------------------\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 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);\n } "where";\n obs.value : INT as int -> ob.value = (int.value);\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 } "translation1";\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 } "translation1";\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 : BL as value -> ob.value = create('boolean'), ob.value = (value.value);\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.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.assignedEntity as entity then {\n entity -> practitioner.meta as meta then {\n entity -> meta.tag = create('Coding') as coding then {\n entity -> coding.system = 'http://algoritmodiscoring' "system";\n entity -> coding.code = 'ClinicalDocument/body/observation/performer' "code";\n } "coding";\n } "meta";\n entity.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 entity -> request.url = append('Practitioner?identifier=', ext) "UUID";\n } "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 uuid1, e1.fullUrl = append('https://example/Practitioner/', uuid1), ob.performer = create('Reference') as reference, reference.reference = ('https://example/Practitioner/' + %practitioner.id) "performer";\n } "r";\n } "identifier";\n entity.assignedPerson as person then {\n person.name -> practitioner.name;\n person.birthTime as birthTime then {\n birthTime.value as date -> practitioner.birthDate = truncate(date, 10);\n } "birth";\n } "name";\n };\n };\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 } "IVL-PQ";\n } "obsRange";\n } "refRange";\n}\n\n// ------------------------------------------------------------------------------------------------------\n// Sezione Decorso Ospedaliero----------------------------------------------------------------------------\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 -> 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), observation.note as note then {\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 src.text as t -> note.text = t "reference";\n src.author as auth -> bundle.entry as e1, e1.request = create('BackboneElement') as request, request.method = 'PUT', e1.resource = create('Practitioner') as practitioner, practitioner.id = uuid() as uuid1, e1.fullUrl = append('https://example/Practitioner/', uuid1), request.url = append('Practitioner/', uuid1) then {\n auth.time as ti -> note.time = create('dateTime') as value then TSDateTime(ti, value);\n auth.assignedAuthor as assAuth then {\n // meta+identifier\n assAuth -> practitioner.meta as meta then {\n assAuth -> meta.tag = create('Coding') as coding then {\n assAuth -> coding.system = 'http://algoritmodiscoring' "system";\n assAuth -> coding.code = 'ClinicalDocument/body/DecorsoOspedaliero/author' "code";\n } "coding";\n } "meta";\n assAuth.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/', uuid2), note.author = create('Reference') as reference, reference.reference = ('https://example/Practitioner/' + %practitioner.id) "aut";\n } "r";\n } "identifier";\n assAuth.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 assAuth.assignedPerson as assPers then {\n assPers.name -> practitioner.name;\n } "assPers";\n } "assAuth";\n } "Auth";\n } "OB-note";\n}\n\n// --------------------------------------------------------------------------------------------------------\n// Sezione Encounter---------------------------------------------------------------------------------------\ngroup ClinicalDocumentSectionEncounter(source cda : ClinicalDocument, source src : Section, target patient : Patient, target tgt, target bundle : Bundle, target enc1 : 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.entry as entry1 -> bundle.entry as e1, e1.request = create('BackboneElement') as request, request.method = 'POST', e1.resource = create('Encounter') as encounter, encounter.id = uuid() as uuid1, e1.fullUrl = append('https://example/Encounter/', uuid1), request.url = 'Encounter', tgt.entry = create('Reference') as reference, reference.reference = ('https://example/Encounter/' + %encounter.id) then {\n entry1 -> encounter.partOf = create('Reference') as reference, reference.reference = ('https://example/Encounter/' + %enc1.id) "refer";\n entry1 -> encounter.subject = create('Reference') as reference, reference.reference = ('https://example/Patient/' + %patient.id) "refer";\n entry1 -> encounter.status = 'finished' "status";\n entry1 -> encounter.class = create('Coding') as cl then {\n entry1 -> cl.code = 'AMB' "code";\n entry1 -> cl.display = 'ambulatory' "code";\n } "class";\n entry1.encounter as enc then {\n enc.code -> encounter.type;\n // effectiveTime=period\n enc where effectiveTime.low.exists() or effectiveTime.high.exists() then {\n enc.effectiveTime as eff -> encounter.period = create('Period') as period then IVLTSPeriod(eff, period);\n } "where";\n // effectiveTime = time-stamp\n enc where effectiveTime.low.exists().not() or effectiveTime.high.exists().not() then {\n enc.effectiveTime as effectivetime1 -> encounter.period = create('Period') as period then {\n effectivetime1 -> period.start = create('dateTime') as start then TSDateTime(effectivetime1, start) "val";\n } "efft";\n } "where";\n // enc.effectiveTime as eff -> encounter.period = create('Period') as period then{\n enc.participant as part where (typeCode != 'LOC') -> encounter.participant = create('BackboneElement') as patarg then {\n part -> patarg.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.time as time1 -> patarg.period = create('Period') as period then {\n time1 -> period.start = create('dateTime') as start then TSDateTime(time1, start) "val";\n };\n part.time as ti -> patarg.period = create('Period') as period then IVLTSPeriod(ti, period);\n part.participantRole as partRole -> bundle.entry as e1, e1.request = create('BackboneElement') as request, request.method = 'PUT', e1.resource = create('Practitioner') as practitioner, practitioner.id = uuid() as uuid1, e1.fullUrl = append('https://example/Practitioner/', uuid1), request.url = append('Practitioner/', uuid1) then {\n // modifica meta+identifier\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/Encounter/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/', uuid2), patarg.individual = 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 playEnt then {\n playEnt.name -> practitioner.name;\n } "playEnt";\n } "partRole";\n } "participant-ADM";\n enc.participant as part where (typeCode = 'LOC') then {\n part.time as tim -> encounter.location as locat then {\n tim -> locat.period = create('Period') as period then IVLTSPeriod(tim, period) "time";\n part.time as tim -> locat.period = create('Period') as period then {\n tim -> period.start = create('dateTime') as start then TSDateTime(tim, start) "val";\n };\n part.participantRole as partRole -> bundle.entry as e1, e1.request = create('BackboneElement') as request, request.method = 'PUT', e1.resource = create('Location') as location, location.id = uuid() as uuid1, e1.fullUrl = append('https://example/Location/', uuid1) then {\n part -> location.meta as meta then {\n part -> meta.tag = create('Coding') as coding then {\n part -> coding.system = 'http://algoritmodiscoring' "system";\n part -> coding.code = 'ClinicalDocument/body/Encounter/participant' "code";\n } "coding";\n } "meta";\n partRole.id as id -> location.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 partRole -> request.url = append('Location?identifier=', ext) "UUID";\n } "ext";\n id.assigningAuthorityName as s -> identifier.assigner as a, a.display = s;\n id.root as r then {\n id.extension as ext -> location.id = (r + '-' + ext) as uuid, e1.fullUrl = append('https://example/Location/', uuid), locat.location = create('Reference') as reference, reference.reference = ('https://example/Location/' + %location.id) "idasi";\n } "r";\n } "identifier";\n partRole.code -> location.type;\n } "partRole";\n } "location";\n } "participant2";\n enc.entryRelationship as entr -> 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', encounter.reasonReference = create('Reference') as reference, reference.reference = ('https://example/Observation/' + %observation.id) then {\n entr.act as act then {\n act.code -> observation.code;\n act -> observation.subject = create('Reference') as reference, reference.reference = ('https://example/Patient/' + %patient.id) "reference";\n act -> observation.encounter = create('Reference') as reference, reference.reference = ('https://example/Encounter/' + %enc1.id) "reference";\n act where act.statusCode.exists().not() then {\n act -> observation.status = 'final' "status";\n } "statuscode";\n act -> observation.note = create('Annotation') as note then {\n act.text as text then {\n text.reference as reff -> note.text = (reff.value);\n };\n act.text as tx then {\n tx.reference as ref -> note.text = (ref.value) "val";\n } "String";\n act.author as auth -> bundle.entry as e1, e1.request = create('BackboneElement') as request, request.method = 'PUT', e1.resource = create('Practitioner') as practitioner, practitioner.id = uuid() as uuid1, e1.fullUrl = append('https://example/Practitioner/', uuid1), request.url = append('Practitioner/', uuid1) then {\n auth.time as ti -> note.time = create('dateTime') as value then TSDateTime(ti, value) "notetime";\n auth.assignedAuthor as assAuth then {\n assAuth -> practitioner.meta as meta then {\n assAuth -> meta.tag = create('Coding') as coding then {\n assAuth -> coding.system = 'http://algoritmodiscoring' "system";\n assAuth -> coding.code = 'ClinicalDocument/body/Encounter/author' "code";\n } "coding";\n } "meta";\n assAuth.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/', uuid2), note.author = create('Reference') as reference, reference.reference = ('https://example/Practitioner/' + %practitioner.id) "aut";\n } "r";\n } "identifier";\n assAuth.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 // fine modifica\n assAuth.time as t -> note.text = create('dateTime') as value then TSDateTime(t, value);\n assAuth.assignedPerson as assPers then {\n assPers.name -> practitioner.name;\n } "name";\n } "assAush";\n } "practitioner";\n } "note";\n };\n } "entryRel-SUBJ";\n };\n };\n}\n\n// --------------------------------------------------------------------------------------------------------\n// Sezione Consulenza--------------------------------------------------------------------------------------\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 } "entry-exists";\n // Sezione Narrativa--------------------------------------------------------------------------------------------------------------------------------------------------\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('ServiceRequest') as ServiceRequest, ServiceRequest.id = uuid() as uuid8, e8.fullUrl = append('https://example/ServiceRequest/', uuid8), request.url = 'ServiceRequest', tgt.entry = create('Reference') as reference, reference.reference = ('https://example/ServiceRequest/' + %ServiceRequest.id) then {\n src -> ServiceRequest.subject = create('Reference') as reference, reference.reference = ('https://example/Patient/' + %patient.id) "reference";\n src -> ServiceRequest.encounter = create('Reference') as reference, reference.reference = ('https://example/Encounter/' + %enc.id) "reference";\n src -> ServiceRequest.status = 'active' "status";\n src -> ServiceRequest.intent = 'order' "intent";\n cdaText -> ServiceRequest.note as note then {\n cdaText as t -> note.text = t "reference";\n } "reference";\n } "cdaText";\n } "where";\n // Sezione Strutturata--------------------------------------------------------------------------------------------------------------------------------------------\n src.entry as entry1 -> 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', tgt.entry = create('Reference') as reference, reference.reference = ('https://example/ServiceRequest/' + %serviceRequest.id), serviceRequest.note as note then {\n entry1 -> serviceRequest.subject = create('Reference') as reference, reference.reference = ('https://example/Patient/' + %patient.id) "reference";\n entry1 -> serviceRequest.encounter = create('Reference') as reference, reference.reference = ('https://example/Encounter/' + %enc.id) "reference";\n entry1 -> serviceRequest.status = 'active' "status";\n entry1 -> serviceRequest.intent = 'order' "intent";\n entry1.act as act then {\n act.code -> serviceRequest.code;\n act.text as t -> note.text = (t.dataString);\n act.statusCode as code -> serviceRequest.status = (code.code);\n act.performer as perf -> bundle.entry as e1, e1.request = create('BackboneElement') as request, request.method = 'PUT', e1.resource = create('Practitioner') as practitioner, practitioner.id = uuid() as uuid1, e1.fullUrl = append('https://example/Practitioner/', uuid1), request.url = append('Practitioner/', uuid1) then {\n perf.time as time -> serviceRequest.occurrence = create('dateTime') as t then TSDateTime(time, t);\n perf.assignedEntity as assEnt then {\n assEnt -> practitioner.meta as meta then {\n assEnt -> meta.tag = create('Coding') as coding then {\n assEnt -> coding.system = 'http://algoritmodiscoring' "system";\n assEnt -> coding.code = 'ClinicalDocument/body/Consulenze/performer' "code";\n } "coding";\n } "meta";\n assEnt.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/', uuid2), serviceRequest.performer = create('Reference') as reference, reference.reference = ('https://example/Practitioner/' + %practitioner.id) "aut";\n } "r";\n } "identifier";\n assEnt.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 assEnt.assignedPerson as assPer then {\n assPer.name -> practitioner.name;\n } "assPer";\n } "assEnt";\n };\n act.participant as parti -> bundle.entry as e1, e1.request = create('BackboneElement') as request, request.method = 'PUT', e1.resource = create('Practitioner') as practitioner, practitioner.id = uuid() as uuid1, e1.fullUrl = append('https://example/Practitioner/', uuid1), request.url = append('Practitioner/', uuid1) then {\n parti.time as time -> serviceRequest.authoredOn = create('dateTime') as t then TSDateTime(time, t);\n parti.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/Consulenze/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/', uuid2), serviceRequest.requester = 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 entity then {\n entity.name -> practitioner.name;\n } "entity";\n } "partRole";\n };\n } "ACT";\n };\n}\n\n// ---------------------------------------------------------------------------------------------------------\n// Sezione Accertamenti--------------------------------------------------------------------------------------\ngroup ClinicalDocumentSectionAccertamenti(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 } "entryExists";\n // Sezione Strutturata---------------------------------------------------------------------------------------------------------------------------------------------\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.organizer as obs then {\n src.code -> observation.code;\n obs then ObservationAccertamenti(obs, patient, enc, observation, bundle) "act";\n } "obs";\n };\n // Sezione Narrativa--------------------------------------------------------------------------------------------------------------------------------------------\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 ObservationAccertamenti(source obs : Observation, target patient : Patient, target encounter : Encounter, target ob : Observation, target bundle : Bundle) {\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);\n } "where";\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 } "qual";\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 } "qual";\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.value : INT as int -> ob.value = (int.value);\n obs.value : BL as boolean -> ob.value = (boolean.value) "boolean";\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 } "IVL-PQ";\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, e1.fullUrl = append('https://example/Practitioner/', uuid1), request.url = append('Practitioner/', uuid1) then {\n performer.assignedEntity as assEntity then {\n // inizio modifica identifier+meta\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/Accertamenti/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), request.url = append('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 // fine modifica\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 participant.time as t -> serviceRequest.authoredOn = create('dateTime') as value then TSDateTime(t, value) "value2";\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, practitioner.id = uuid() as uuid1, e1.fullUrl = append('https://example/Practitioner/', uuid1), request.url = append('Practitioner/', uuid1) then {\n // modifica meta+identifier\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/Accertamenti/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 uuid2, e1.fullUrl = append('https://example/Practitioner/', uuid2), request.url = append('Practitioner/', uuid2), serviceRequest.requester = 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 // fine modifica\n participantRole.playingEntity as pe then {\n pe.name -> practitioner.name;\n } "pe";\n };\n };\n obs.component as comp -> 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', ob.hasMember = create('Reference') as reference, reference.reference = ('https://example/Observation/' + %observation.id) then {\n comp.observation as obs then {\n obs.code -> observation.code;\n obs.statusCode as statusc where (code = 'completed') -> observation.status = 'final';\n obs.statusCode as statusc where (code = 'active') -> observation.status = 'registered';\n obs.statusCode as statusc where (code = 'aborted') -> observation.status = 'cancelled';\n obs.statusCode as statusc where (code = 'suspended') -> observation.status = 'partial';\n obs where obs.statusCode.exists().not() then {\n obs -> observation.status = 'final' "status";\n } "statuscode";\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/' + %encounter.id) "reference";\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);\n } "where";\n obs.value as val -> observation.value = (val.dataString);\n } "obs";\n } "observation";\n}\n\n// -----------------------------------------------------------------------------------------------------------\n// Sezione ParametriVitali--------------------------------------------------------------------------------------\ngroup ClinicalDocumentSectionParametriVitali(source cda : ClinicalDocument, source src : Section, target patient : Patient, target tgt, target bundle : Bundle, target enc : Encounter) {\n src.title as t -> tgt.title = (t.dataString);\n src.code -> tgt.code;\n src 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 } "entry-exists";\n // Sezione Narrativa----------------------------------------------------------------------------------------------------------------------------------------------------\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 // Sezione Strutturata --------------------------------------------------------------------------------------------------------------------------------------------------------\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.organizer as org then {\n org -> observation.subject = create('Reference') as reference, reference.reference = ('https://example/Patient/' + %patient.id) "reference";\n org -> observation.encounter = create('Reference') as reference, reference.reference = ('https://example/Encounter/' + %enc.id) "reference";\n org.statusCode as statusc where (code = 'completed') -> observation.status = 'final';\n org.statusCode as statusc where (code = 'active') -> observation.status = 'registered';\n org.statusCode as statusc where (code = 'aborted') -> observation.status = 'cancelled';\n org.statusCode as statusc where (code = 'suspended') -> observation.status = 'partial';\n org where obs.statusCode.exists().not() then {\n org -> observation.status = 'final' "status";\n } "statuscode";\n org.code -> observation.code;\n org where org.code.exists().not() then {\n src.code -> observation.code;\n } "code";\n org.component as component -> bundle.entry as e1, e1.request = create('BackboneElement') as request, request.method = 'POST', e1.resource = create('Observation') as observation1, observation1.id = uuid() as uuid1, e1.fullUrl = append('https://example/Observation/', uuid1), request.url = 'Observation', observation.hasMember = create('Reference') as reference, reference.reference = ('https://example/Observation/' + %observation1.id) then {\n component.observation as obs then {\n obs -> observation1.subject = create('Reference') as reference, reference.reference = ('https://example/Patient/' + %patient.id) "reference";\n obs -> observation1.encounter = create('Reference') as reference, reference.reference = ('https://example/Encounter/' + %enc.id) "reference";\n obs.code -> observation1.code;\n obs.statusCode -> observation1.status;\n obs.statusCode as statusc where (code = 'completed') -> observation1.status = 'final';\n obs.statusCode as statusc where (code = 'active') -> observation1.status = 'registered';\n obs.statusCode as statusc where (code = 'aborted') -> observation1.status = 'cancelled';\n obs.statusCode as statusc where (code = 'suspended') -> observation1.status = 'partial';\n obs where obs.statusCode.exists().not() then {\n obs -> observation1.status = 'final' "status";\n } "statuscode";\n obs -> observation1.value = create('Quantity') as quant then {\n obs.value as v -> quant.value = (v.value);\n obs.value as v -> quant.unit = (v.unit);\n } "quant";\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 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 : ST as value -> ob.value = create('string'), ob.value = (value.dataString);\n obs.value : INT as int -> ob.value = (int.value);\n obs.value : BL as boolean -> ob.value = (boolean.value) "boolean";\n obs.interpretationCode -> observation1.interpretation;\n obs.methodCode -> observation1.method;\n obs.targetSiteCode -> observation1.bodySite;\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, e1.fullUrl = append('https://example/Practitioner/', uuid1), request.url = append('Practitioner/', uuid1) then {\n performer.time as t -> observation1.issued = create('dateTime') as date then TSDateTime(t, date);\n performer.assignedEntity as assEntity then {\n // inizio modifica meta+ identifier\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/ParametriVitali/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), request.url = append('Practitioner/', uuid2), observation1.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 // fine modifica\n assEntity.assignedPerson as assPerson then {\n assPerson.name -> practitioner.name;\n } "assPerson";\n } "assEntity";\n };\n obs.participant as parti -> 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', observation1.basedOn = create('Reference') as reference, reference.reference = ('https://example/ServiceRequest/' + %serviceRequest.id) then {\n parti -> serviceRequest.subject = create('Reference') as reference, reference.reference = ('https://example/Patient/' + %patient.id) "reference";\n parti -> serviceRequest.encounter = create('Reference') as reference, reference.reference = ('https://example/Encounter/' + %enc.id) "reference";\n parti -> serviceRequest.status = 'active' "status";\n parti -> serviceRequest.intent = 'order' "intent";\n parti.time as t -> serviceRequest.authoredOn = create('dateTime') as value then TSDateTime(t, value) "value2";\n parti.participantRole as partRole -> bundle.entry as e1, e1.request = create('BackboneElement') as request, request.method = 'PUT', e1.resource = create('Practitioner') as practitioner, practitioner.id = uuid() as uuid1, e1.fullUrl = append('https://example/Practitioner/', uuid1), request.url = append('Practitioner/', uuid1) then {\n // inizio modifica meta + identifier\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/ParametriVitali/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/', uuid2), serviceRequest.requester = 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 // fine modifica\n partRole.playingEntity as playingEntity then {\n playingEntity.name -> practitioner.name;\n } "name";\n } "partRole";\n } "parti";\n } "obs";\n };\n } "obs";\n } "Observation";\n}\n\n// -----------------------------------------------------------------------------------------------------------------\n// Sezione terapia Farma in Pronto----------------------------------------------------------------------------------\ngroup ClinicalDocumentSectionTerapiaFarmacoInPronto(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 } "entry-exists";\n // Sezione Narrativa------------------------------------------------------------------------------------------------------------------------------------------------\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('MedicationAdministration') as MedicationAdministration, MedicationAdministration.id = uuid() as uuid8, e8.fullUrl = append('https://example/MedicationAdministration/', uuid8), request.url = 'MedicationAdministration', tgt.entry = create('Reference') as reference, reference.reference = ('https://example/MedicationAdministration/' + %MedicationAdministration.id) then {\n src -> MedicationAdministration.subject = create('Reference') as reference, reference.reference = ('https://example/Patient/' + %patient.id) "reference";\n src -> MedicationAdministration.context = create('Reference') as reference, reference.reference = ('https://example/Encounter/' + %enc.id) "reference";\n src -> MedicationAdministration.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 -> MedicationAdministration.status = 'completed' "status";\n } "statuscode";\n cdaText -> MedicationAdministration.note as note then {\n cdaText as t -> note.text = t "reference";\n cdaText -> MedicationAdministration.medication = create('CodeableConcept') as medication then {\n cdaText as txt -> medication.text = txt "text";\n } "medication";\n } "reference";\n } "cdaText";\n } "where";\n // Sezione Strutturata-------------------------------------------------------------------------------------------------------------------------------------------------\n src.entry as entry1 -> bundle.entry as e1, e1.request = create('BackboneElement') as request, request.method = 'POST', e1.resource = create('MedicationAdministration') as medAdm, medAdm.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/' + %medAdm.id), medAdm.note as note then {\n entry1 -> medAdm.subject = create('Reference') as reference, reference.reference = ('https://example/Patient/' + %patient.id) "reference";\n entry1 -> medAdm.context = create('Reference') as reference, reference.reference = ('https://example/Encounter/' + %enc.id) "reference";\n entry1.substanceAdministration as sub then {\n sub.text as tx then {\n tx.reference as reff -> note.text = (reff.value);\n } "txx";\n sub.statusCode -> medAdm.status;\n // sub.effectiveTime: IVL_TS as eff -> medAdm.effective =create('Period') as period then IVLTSPeriod(eff,period); CHECK THIS\n sub.effectiveTime as eff -> medAdm.effective = create('Period') as period then IVLTSPeriod(eff, period);\n sub.effectiveTime : PIVL_TS as eff -> medAdm.dosage as dosage then {\n eff -> dosage.rate = create('Ratio') as ratio then {\n eff -> ratio.numerator = create('Quantity') as num then {\n eff.period as per -> num.value = (per.value);\n eff.period as per -> num.unit = (per.unit);\n } "num";\n eff -> ratio.denominator = create('Quantity') as num then {\n eff.period as per -> num.value = '1';\n eff.period as per -> num.unit = (per.unit);\n } "den";\n } "ratio";\n } "eff2";\n sub -> medAdm.dosage as dosage then {\n sub.routeCode -> dosage.route;\n } "route";\n sub -> medAdm.dosage as dosage then {\n sub.approachSiteCode -> dosage.site;\n } "route";\n sub -> bundle.entry as e1, e1.request = create('BackboneElement') as request, request.method = 'POST', e1.resource = create('MedicationRequest') as medRq, medRq.id = uuid() as uuid1, e1.fullUrl = append('https://example/MedicationRequest/', uuid1), request.url = 'MedicationRequest', medAdm.request = create('Reference') as reference, reference.reference = ('https://example/MedicationRequest/' + %medRq.id) then {\n sub.entryRelationship as rel then {\n rel.supply as supl -> medRq.dispenseRequest = create('BackboneElement') as disp then {\n supl -> disp.quantity = create('SimpleQuantity') as q then {\n supl.quantity as qua -> q.value = (qua.value) "fds";\n } "SimpleQuantity";\n } "obs";\n } "rel";\n sub -> medRq.subject = create('Reference') as reference, reference.reference = ('https://example/Patient/' + %patient.id) "reference";\n sub -> medRq.encounter = create('Reference') as reference, reference.reference = ('https://example/Encounter/' + %enc.id) "reference";\n sub -> medRq.status = 'active' "status";\n sub -> medRq.intent = 'order' "intent";\n sub -> medRq.medication = create('CodeableConcept') as cod then {\n sub -> cod.text = 'medication' "Medi";\n } "code";\n sub.doseQuantity as quantity then {\n quantity -> medRq.dosageInstruction = create('Dosage') as dosage then {\n quantity -> dosage.doseAndRate as dosRange then {\n quantity -> dosRange.dose = create('Range') as range then {\n quantity -> range.low = create('SimpleQuantity') as quant then {\n quantity.low as l -> quant.value = (l.value) "v1";\n quantity.low as l -> quant.unit = (l.unit) "v1";\n } "low";\n quantity -> range.high = create('SimpleQuantity') as quant then {\n quantity.high as h -> quant.value = (h.value) "v1";\n quantity.high as h -> quant.unit = (h.unit) "v1";\n } "high";\n } "range";\n } "dos";\n } "dosage";\n } "dose-quantity";\n sub.rateQuantity as rate then {\n rate -> medRq.dosageInstruction = create('Dosage') as dosage then {\n rate -> dosage.doseAndRate as dosRange then {\n rate -> dosRange.dose = create('Range') as range then {\n rate -> range.low = create('SimpleQuantity') as quant then {\n rate.low as l -> quant.value = (l.value) "v1";\n rate.low as l -> quant.unit = (l.unit) "v1";\n } "low";\n rate -> range.high = create('SimpleQuantity') as quant then {\n rate.high as h -> quant.value = (h.value) "v1";\n rate.high as h -> quant.unit = (h.unit) "v1";\n } "high";\n } "range";\n } "dos";\n } "dosage";\n } "Rate-quantity";\n sub.participant as part then {\n part.time as t -> medRq.authoredOn = create('dateTime') as date then TSDateTime(t, date);\n part.participantRole as partRole -> bundle.entry as e1, e1.request = create('BackboneElement') as request, request.method = 'PUT', e1.resource = create('Practitioner') as practitioner, practitioner.id = uuid() as uuid1, e1.fullUrl = append('https://example/Practitioner/', uuid1), request.url = append('Practitioner/', uuid1) then {\n // inizio meta+identifier\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/TerapiaFarmacologicaPS/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/', uuid2), medRq.requester = 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 // fine modifiche\n partRole.id -> practitioner.identifier;\n partRole.playingEntity as play then {\n play.name -> practitioner.name;\n } "play";\n } "Part";\n } "part";\n } "medicationRequest";\n sub -> bundle.entry as e1, e1.request = create('BackboneElement') as request, request.method = 'POST', e1.resource = create('Medication') as med, med.id = uuid() as uuid1, e1.fullUrl = append('https://example/Medication/', uuid1), request.url = 'Medication', medAdm.medication = create('Reference') as reference, reference.reference = ('https://example/Medication/' + %med.id) then {\n sub.administrationUnitCode as adduni then {\n sub.administrationUnitCode -> med.form;\n sub.consumable as consum then {\n consum.manufacturedProduct as manuProd then {\n manuProd.manufacturedMaterial as manuMt then {\n manuMt.code -> med.code;\n } "manuMat";\n } "manuMat";\n } "consum";\n } "unicode";\n sub.entryRelationship as entryR then {\n entryR.observation as observation then {\n observation.code where displayName = 'Grammatura' -> med.ingredient as ingredient then {\n sub.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 -> med.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 } "entry-R";\n } "med";\n sub.performer as perf -> bundle.entry as e1, e1.request = create('BackboneElement') as request, request.method = 'PUT', e1.resource = create('Practitioner') as practitioner, practitioner.id = uuid() as uuid1, e1.fullUrl = append('https://example/Practitioner/', uuid1), request.url = append('Practitioner/', uuid1) then {\n perf -> medAdm.note as note then {\n perf -> note.text = 'performertime' "notaa";\n perf.time as t -> note.time = create('dateTime') as value then TSDateTime(t, value) "notetime";\n } "preftime";\n perf.assignedEntity as ent then {\n // inizio modifica meta+identifier\n ent -> practitioner.meta as meta then {\n ent -> meta.tag = create('Coding') as coding then {\n ent -> coding.system = 'http://algoritmodiscoring' "system";\n ent -> coding.code = 'ClinicalDocument/body/TerapiaFarmacologicaPS/performer' "code";\n } "coding";\n } "meta";\n ent.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/', uuid2), medAdm.performer as p, p.actor = create('Reference') as reference, reference.reference = ('https://example/Practitioner/' + %practitioner.id) "aut";\n } "r";\n } "identifier";\n ent.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 // fine modifica\n ent.assignedPerson as assPerson then {\n assPerson.name -> practitioner.name;\n } "assperson";\n } "ent";\n } "perform";\n } "MedAdm";\n };\n}\n\n// ------------------------------------------------------------------------------------------------------------------\n// -\ngroup ClinicalDocumentSectionPianoCuraDimissione(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 as entry1 -> 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 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 src.text as cdaText -> careplan.note as carenote then {\n cdaText as t -> carenote.text = t "notetxt";\n entry1.author as author then {\n author.time as t -> carenote.time = create('dateTime') as value then TSDateTime(t, value) "notetime";\n author.assignedAuthor as assauthor -> bundle.entry as e1, e1.request = create('BackboneElement') as request, request.method = 'PUT', e1.resource = create('Practitioner') as practitioner, practitioner.id = uuid() as uuid1, e1.fullUrl = append('https://example/Practitioner/', uuid1), request.url = append('Practitioner/', uuid1) then {\n // inizio modifica meta+identifier\n assauthor -> practitioner.meta as meta then {\n assauthor -> meta.tag = create('Coding') as coding then {\n assauthor -> coding.system = 'http://algoritmodiscoring' "system";\n assauthor -> coding.code = 'ClinicalDocument/body/PianoCuraDimissione/author' "code";\n } "coding";\n } "meta";\n assauthor.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/', uuid2), carenote.author = create('Reference') as reference, reference.reference = ('https://example/Practitioner/' + %practitioner.id) "aut";\n } "r";\n } "identifier";\n assauthor.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 // fine modifica\n assauthor.assignedPerson as pers then {\n pers.name -> practitioner.name;\n } "namepers";\n } "authpract";\n } "CFauthor";\n } "author";\n entry1.entry as entry2 then {\n entry2.act as entryact -> 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', careplan.activity = create('BackboneElement') as activ, activ.reference = create('Reference') as reference, reference.reference = ('https://example/ServiceRequest/' + %servicerequest.id) then {\n entryact -> servicerequest.subject = create('Reference') as reference, reference.reference = ('https://example/Patient/' + %patient.id) "reference";\n entryact -> servicerequest.encounter = create('Reference') as reference, reference.reference = ('https://example/Encounter/' + %enc.id) "reference";\n entryact -> servicerequest.status = 'active' "status";\n entryact -> servicerequest.intent = 'order' "intent";\n entryact -> servicerequest.identifier = create('BackboneElement') as identif then {\n entryact.reference as actref then {\n actref.externalAct as extact then {\n extact -> servicerequest.identifier = create('BackboneElement') as identif3 then {\n extact.id as id then {\n id.root as r -> identif3.system = translate(r, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri') "root1";\n id.extension as ext -> identif3.value = ext then {\n id.assigningAuthorityName as s -> identif3.assigner as a, a.display = s;\n } "ext";\n } "idnetn";\n } "extact";\n } "actref";\n } "jarilemes";\n entryact.code -> servicerequest.code;\n entryact.statusCode -> servicerequest.status;\n entryact.author as actauthor then {\n actauthor.time as t -> servicerequest.authoredOn = create('dateTime') as date then TSDateTime(t, date);\n actauthor.assignedAuthor as assauthor -> bundle.entry as e1, e1.request = create('BackboneElement') as request, request.method = 'PUT', e1.resource = create('Practitioner') as practitioner, practitioner.id = uuid() as uuid1, e1.fullUrl = append('https://example/Practitioner/', uuid1), request.url = append('Practitioner/', uuid1) then {\n // inizio modifica identifier\n assauthor -> practitioner.meta as meta then {\n assauthor -> meta.tag = create('Coding') as coding then {\n assauthor -> coding.system = 'http://algoritmodiscoring' "system";\n assauthor -> coding.code = 'ClinicalDocument/body/PianoCuraDimissione/author' "code";\n } "coding";\n } "meta";\n assauthor.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/', uuid2), servicerequest.requester = create('Reference') as reference, reference.reference = ('https://example/Practitioner/' + %practitioner.id) "aut";\n } "r";\n } "identifier";\n assauthor.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 // fine modifica\n assauthor.assignedPerson as pers then {\n pers.name -> practitioner.name;\n } "namepers";\n } "author";\n } "servReq";\n } "entry2";\n } "carnote";\n } "entry1";\n } "entryident3";\n}\n\n// -------Dimissione------------------------------------------------------------------------------------------------------\ngroup ClinicalDocumentSectionDimissione(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.entry as entry1 then {\n entry1.act as act -> bundle.entry as e1, e1.request = create('BackboneElement') as request, request.method = 'POST', e1.resource = create('Encounter') as encountert, encountert.id = uuid() as uuid1, e1.fullUrl = append('https://example/Encounter/', uuid1), request.url = 'Encounter', tgt.entry = create('Reference') as reference, reference.reference = ('https://example/Encounter/' + %encountert.id) then {\n act -> encountert.status = 'finished' "status";\n act -> encountert.class = create('Coding') as cl then {\n act -> cl.code = 'AMB' "code";\n act -> cl.display = 'ambulatory' "code";\n } "class";\n act -> encountert.partOf = create('Reference') as reference, reference.reference = ('https://example/Encounter/' + enc.id) "refenc";\n act -> encountert.subject = create('Reference') as reference, reference.reference = ('https://example/Patient/' + patient.id) "refpatient";\n act.code -> encountert.type;\n act where effectiveTime.low.exists() or effectiveTime.high.exists() then {\n act.effectiveTime as eff -> encountert.period = create('Period') as period then IVLTSPeriod(eff, period);\n } "where";\n // effectiveTime = time-stamp\n act where effectiveTime.low.exists().not() or effectiveTime.high.exists().not() then {\n act.effectiveTime as effectivetime1 -> encountert.period = create('Period') as period then {\n effectivetime1 -> period.start = create('dateTime') as start then TSDateTime(effectivetime1, start) "val";\n } "efft";\n } "where";\n act.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, e1.fullUrl = append('https://example/Practitioner/', uuid1), request.url = append('Practitioner/', uuid1) 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/Dimissione/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 = append('Practitioner/', uuid2), encountert.participant as perf then {\n performer -> perf.period = create('Period') as period then {\n performer.time as time -> period.start = create('dateTime') as start then TSDateTime(time, start);\n } "period";\n performer -> perf.individual = create('Reference') as reference, reference.reference = ('https://example/Practitioner/' + %practitioner.id) "aut";\n } "perf";\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.assignedPerson as assPers then {\n assPers.name -> practitioner.name;\n } "assPer";\n } "ass";\n } "erformer";\n // Encounter Post dimissione---------------------------------------------------------------------------------------------------------------------------------------\n act.entryRelationship as entriRel then {\n entriRel.encounter as enc1 then {\n enc1 -> bundle.entry as e1, e1.request = create('BackboneElement') as request, request.method = 'POST', e1.resource = create('Encounter') as encountert1, encountert1.id = uuid() as uuid1, e1.fullUrl = append('https://example/Encounter/', uuid1), request.url = 'Encounter', tgt.entry = create('Reference') as reference, reference.reference = ('https://example/Encounter/' + %encountert1.id), encountert1.partOf = create('Reference') as reference, reference.reference = ('https://example/Encounter/' + encountert.id) then {\n enc1 -> encountert1.status = 'finished' "status";\n enc1 -> encountert1.class = create('Coding') as cl then {\n enc1 -> cl.code = 'AMB' "code";\n enc1 -> cl.display = 'ambulatory' "code";\n } "class";\n enc1 -> encountert1.subject = create('Reference') as reference, reference.reference = ('https://example/Patient/' + patient.id) "refpatient";\n enc1.id -> encountert1.identifier;\n // enc1.code -> encountert1.type;\n enc1 -> encountert1.type = create('CodeableConcept') as ti then {\n enc1 -> ti.coding = create('Coding') as cod then {\n enc1.code as c -> cod.code = (c.code);\n enc1.code as c then {\n c.codeSystem as s -> cod.system = translate(s, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri') "system";\n } "syst";\n enc1.code as c -> cod.display = (c.displayName) "dispaly";\n } "coding";\n enc1.text as tx then {\n tx.reference as ref -> ti.text = (ref.value) "val";\n };\n } "code";\n enc1 where effectiveTime.low.exists() or effectiveTime.high.exists() then {\n enc1.effectiveTime as eff -> encountert1.period = create('Period') as period then IVLTSPeriod(eff, period);\n } "where";\n // effectiveTime = time-stamp\n enc1 where effectiveTime.low.exists().not() or effectiveTime.high.exists().not() then {\n enc1.effectiveTime as effectivetime1 -> encountert1.period = create('Period') as period then {\n effectivetime1 -> period.start = create('dateTime') as start then TSDateTime(effectivetime1, start) "val";\n } "efft";\n } "where";\n enc1.participant as part where (typeCode = 'LOC') -> bundle.entry as e1, e1.request = create('BackboneElement') as request, request.method = 'PUT', e1.resource = create('Location') as location, location.id = uuid() as uuid1, e1.fullUrl = append('https://example/Location/', uuid1), request.url = append('Location/', uuid1) then {\n part -> location.meta as meta then {\n part -> meta.tag = create('Coding') as coding then {\n part -> coding.system = 'http://algoritmodiscoring' "system";\n part -> coding.code = 'ClinicalDocument/body/Dimissione/participant' "code";\n } "coding";\n } "meta";\n part.time as tim -> encountert1.location as locat then {\n tim -> locat.period = create('Period') as period then IVLTSPeriod(tim, period) "time";\n part.time as tim -> locat.period = create('Period') as period then {\n tim -> period.start = create('dateTime') as start then TSDateTime(tim, start) "val";\n };\n part.participantRole as partRole then {\n partRole.id as id -> location.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 partRole -> request.url = append('Location?identifier=', ext) "UUID";\n } "ext";\n id.assigningAuthorityName as s -> identifier.assigner as a, a.display = s;\n id.root as r then {\n id.extension as ext -> location.id = (r + '-' + ext) as uuid, e1.fullUrl = append('https://example/Location/', uuid), locat.location = create('Reference') as reference, reference.reference = ('https://example/Location/' + %location.id) "idasi";\n } "r";\n } "identifier";\n // partRole.id -> location.identifier;\n partRole.code -> location.type;\n } "partRole";\n } "location1";\n } "Location";\n enc1.entryRelationship as entryrel2 -> 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', encountert1.reasonReference = create('BackboneElement') as reference, reference.reference = ('https://example/Observation/' + %observation.id) then {\n entryrel2.observation as obs then {\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/' + %encountert1.id) "reference";\n obs.code -> observation.code;\n obs.statusCode as statusc where (code = 'completed') -> observation.status = 'final';\n obs.statusCode as statusc where (code = 'active') -> observation.status = 'registered';\n obs.statusCode as statusc where (code = 'aborted') -> observation.status = 'cancelled';\n obs.statusCode as statusc where (code = 'suspended') -> observation.status = 'partial';\n obs -> observation.status = 'final' "notpresent";\n obs.effectiveTime as effectiveTime -> observation.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 -> observation.effective = create('Period') as period then IVLTSPeriod(eff, period);\n } "where";\n obs.value : INT as int -> observation.value = (int.value);\n obs.value : BL as boolean -> observation.value = (boolean.value) "boolean";\n obs.value : CE as val then {\n val -> observation.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 -> observation.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 : PQ as val then {\n val -> observation.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 -> observation.value = create('string'), observation.value = (value.dataString);\n } "obs";\n } "entryrel2";\n } "enc1";\n } "enc";\n } "entriRel";\n // Trasferimento post dimissione-------------------------------------------------------------------------------------------------------------------------------------\n act.entryRelationship as entriRel2 then {\n entriRel2.act as a then {\n a -> bundle.entry as e1, e1.request = create('BackboneElement') as request, request.method = 'POST', e1.resource = create('Encounter') as encountert2, encountert2.id = uuid() as uuid1, e1.fullUrl = append('https://example/Encounter/', uuid1), request.url = 'Encounter', tgt.entry = create('Reference') as reference, reference.reference = ('https://example/Encounter/' + encountert2.id), encountert2.partOf = create('Reference') as reference, reference.reference = ('https://example/Encounter/' + encountert.id) then {\n a -> encountert2.status = 'finished' "status";\n a -> encountert2.class = create('Coding') as cl then {\n a -> cl.code = 'AMB' "code";\n a -> cl.display = 'ambulatory' "code";\n } "class";\n a -> encountert2.subject = create('Reference') as reference, reference.reference = ('https://example/Patient/' + patient.id) "refpatient";\n a where effectiveTime.low.exists() or effectiveTime.high.exists() then {\n a.effectiveTime as eff -> encountert2.period = create('Period') as period then IVLTSPeriod(eff, period);\n } "where";\n // effectiveTime = time-stamp\n a where effectiveTime.low.exists().not() or effectiveTime.high.exists().not() then {\n a.effectiveTime as effectivetime1 -> encountert2.period = create('Period') as period then {\n effectivetime1 -> period.start = create('dateTime') as start then TSDateTime(effectivetime1, start) "val";\n } "efft";\n } "where";\n a -> bundle.entry as e1, e1.request = create('BackboneElement') as request, request.method = 'PUT', e1.resource = create('Location') as location, location.id = uuid() as uuid1, e1.fullUrl = append('https://example/Location/', uuid1), request.url = append('Location/', uuid1) then {\n a.text as tx then {\n tx.reference as ref -> location.description = (ref.value) "dfs";\n };\n a.participant as part then {\n part -> location.meta as meta then {\n part -> meta.tag = create('Coding') as coding then {\n part -> coding.system = 'http://algoritmodiscoring' "system";\n part -> coding.code = 'ClinicalDocument/body/Dimissione/act' "code";\n } "coding";\n } "meta";\n part.time as tim -> encountert2.location as locat then {\n tim -> locat.period = create('Period') as period then IVLTSPeriod(tim, period) "time";\n part.time as tim -> locat.period = create('Period') as period then {\n tim -> period.start = create('dateTime') as start then TSDateTime(tim, start) "val";\n };\n part.participantRole as partRole then {\n partRole.id as id -> location.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 partRole -> request.url = append('Location?identifier=', ext) "UUID";\n } "ext";\n id.assigningAuthorityName as s -> identifier.assigner as a, a.display = s;\n id.root as r then {\n id.extension as ext -> location.id = (r + '-' + ext) as uuid, e1.fullUrl = append('https://example/Location/', uuid), locat.location = create('Reference') as reference, reference.reference = ('https://example/Location/' + %location.id) "idasi";\n } "r";\n } "identifier";\n // partRole.id -> location.identifier;\n partRole.code -> location.type;\n } "partRole";\n } "loc2";\n } "Location";\n } "loc";\n a.entryRelationship as entryrel2 -> 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', encountert2.reasonReference = create('BackboneElement') as reference, reference.reference = ('https://example/Observation/' + %observation.id) then {\n entryrel2.observation as obs then {\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/' + %encountert2.id) "reference";\n obs.code -> observation.code;\n obs.statusCode as statusc where (code = 'completed') -> observation.status = 'final';\n obs.statusCode as statusc where (code = 'active') -> observation.status = 'registered';\n obs.statusCode as statusc where (code = 'aborted') -> observation.status = 'cancelled';\n obs.statusCode as statusc where (code = 'suspended') -> observation.status = 'partial';\n obs -> observation.status = 'final' "notpresent";\n obs.effectiveTime as effectiveTime -> observation.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 -> observation.effective = create('Period') as period then IVLTSPeriod(eff, period);\n } "where";\n obs.value : INT as int -> observation.value = (int.value);\n obs.value : BL as boolean -> observation.value = (boolean.value) "boolean";\n obs.value : CE as val then {\n val -> observation.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 -> observation.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 : PQ as val then {\n val -> observation.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 -> observation.value = create('string'), observation.value = (value.dataString);\n } "obs";\n } "entryrel2";\n } "act";\n } "a";\n } "entri-act";\n // --------------Diagnosi alla dimissione-------------------------------------------------------------\n act.entryRelationship as entryrel2 then {\n entryrel2.observation as obs then {\n obs.code as code where (code = '29308-4') -> 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', encountert.reasonReference = create('Reference') as reference, reference.reference = ('https://example/Observation/' + %observation.id) then {\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/' + %encountert.id) "reference";\n obs.code -> observation.code;\n obs.statusCode as statusc where (code = 'completed') -> observation.status = 'final';\n obs.statusCode as statusc where (code = 'active') -> observation.status = 'registered';\n obs.statusCode as statusc where (code = 'aborted') -> observation.status = 'cancelled';\n obs.statusCode as statusc where (code = 'suspended') -> observation.status = 'partial';\n // obs where obs.statusCode.exists().not() then {\n obs -> observation.status = 'final' "status";\n // }"statuscode";\n obs.effectiveTime as effectiveTime -> observation.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 -> observation.effective = create('Period') as period then IVLTSPeriod(eff, period);\n } "where";\n obs.value as val then {\n val -> observation.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 : INT as int -> ob.value = (int.value);\n obs.value : BL as boolean -> ob.value = (boolean.value) "boolean";\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 } "222";\n } "obs";\n } "entryrel2";\n // --------Esito----------------------------\n act.entryRelationship as entriRel3 then {\n entriRel3.observation as obs2 then {\n obs2.code as code then {\n code.code where (code.code = '11302-7') then {\n obs2 -> encountert.hospitalization as hospital then {\n obs2.value -> hospital.dischargeDisposition;\n } "hospital";\n } "entry-obs1";\n } "act";\n } "x";\n } "3";\n };\n } "entry1";\n src.entry as entry1 then {\n entry1.observation as obs 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', tgt.entry = create('Reference') as reference, reference.reference = ('https://example/Observation/' + %observation.id) then {\n obs.value as val where ('xsi:type' = 'BL') -> observation.value = (val.value);\n obs then Observation(obs, patient, enc, observation, bundle) "act";\n } "obstarg";\n } "obs";\n };\n}\n\n// -----------------------------------------------------------------------------------------------------------------------\n// ------------------------------TerapiaFarmacologicaDimissione-----------------------------------------------------------------------------------------\ngroup ClinicalDocumentSectionTerapiaFarmacologicaDimissione(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 // Sezione Narrativa------------------------------------------------------------------------------------------------------------------------------------------------\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 medRq, medRq.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/' + %medRq.id), medRq.note = create('Annotation') as note then {\n cdaText -> note.text = cdaText "reference";\n cdaText -> medRq.subject = create('Reference') as reference, reference.reference = ('https://example/Patient/' + %patient.id) "reference";\n cdaText -> medRq.encounter = create('Reference') as reference, reference.reference = ('https://example/Encounter/' + %enc.id) "reference";\n cdaText -> medRq.status = 'active' "status";\n cdaText -> medRq.intent = 'order' "intent";\n src.author as auth -> bundle.entry as e1, e1.request = create('BackboneElement') as request, request.method = 'PUT', e1.resource = create('Practitioner') as practitioner, practitioner.id = uuid() as uuid1, e1.fullUrl = append('https://example/Practitioner/', uuid1), request.url = append('Practitioner/', uuid1) then {\n auth.time as t -> note.time = create('dateTime') as value then TSDateTime(t, value);\n auth.assignedAuthor as assAuth then {\n // assAuth.time -> note.time;\n assAuth -> practitioner.meta as meta then {\n assAuth -> meta.tag = create('Coding') as coding then {\n assAuth -> coding.system = 'http://algoritmodiscoring' "system";\n assAuth -> coding.code = 'ClinicalDocument/body/TerapiaFarmacologicaDimissione/author' "code";\n } "coding";\n } "meta";\n assAuth.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/', uuid2), note.author = create('Reference') as reference, reference.reference = ('https://example/Practitioner/' + %practitioner.id) "aut";\n } "r";\n } "identifier";\n assAuth.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 assAuth.assignedPerson as asspers then {\n asspers.name -> practitioner.name;\n } "assPers";\n } "assAuth";\n } "auth";\n src -> medRq.medication = create('CodeableConcept') as medication then {\n src.text as txt -> medication.text = txt;\n } "medicationesiste";\n } "note";\n } "text";\n // Sezione Strutturata------------------------------------------------------------------------------------------------------------------------------------------\n src where src.entry.exists() then {\n src -> bundle.entry as e1, e1.request = create('BackboneElement') as request, request.method = 'POST', e1.resource = create('MedicationRequest') as medRq, medRq.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/' + %medRq.id), medRq.note = create('Annotation') as note then {\n src.text as t -> note.text = t "reference";\n src -> medRq.subject = create('Reference') as reference, reference.reference = ('https://example/Patient/' + %patient.id) "reference";\n src -> medRq.encounter = create('Reference') as reference, reference.reference = ('https://example/Encounter/' + %enc.id) "reference";\n src -> medRq.status = 'active' "status";\n src -> medRq.intent = 'order' "intent";\n src.author as auth -> bundle.entry as e1, e1.request = create('BackboneElement') as request, request.method = 'PUT', e1.resource = create('Practitioner') as practitioner, practitioner.id = uuid() as uuid1, e1.fullUrl = append('https://example/Practitioner/', uuid1), request.url = append('Practitioner/', uuid1) then {\n auth.time as t -> note.time = create('dateTime') as value then TSDateTime(t, value);\n auth.assignedAuthor as assAuth then {\n // assAuth.time -> note.time;\n assAuth -> practitioner.meta as meta then {\n assAuth -> meta.tag = create('Coding') as coding then {\n assAuth -> coding.system = 'http://algoritmodiscoring' "system";\n assAuth -> coding.code = 'ClinicalDocument/body/TerapiaFarmacologicaDimissione/author' "code";\n } "coding";\n } "meta";\n assAuth.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/', uuid2), note.author = create('Reference') as reference, reference.reference = ('https://example/Practitioner/' + %practitioner.id) "aut";\n } "r";\n } "identifier";\n assAuth.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 assAuth.assignedPerson as asspers then {\n asspers.name -> practitioner.name;\n } "assPers";\n } "assAuth";\n } "auth";\n src.entry as entry1 then {\n entry1.substanceAdministration as sub then {\n sub.statusCode -> medRq.status;\n sub -> medRq.dosageInstruction = create('Dosage') as dosage then {\n sub -> dosage.timing = create('Timing') as tim then {\n sub.effectiveTime as eff -> tim.repeat as repeat then {\n eff -> repeat.bounds = create('Period') as period then IVLTSPeriod(eff, period) "boundsperiod";\n } "repeat";\n } "timing";\n } "dosage";\n sub.effectiveTime : PIVL_TS as eff -> medRq.dosageInstruction = create('Dosage') as dosage then {\n eff -> dosage.timing = create('Timing') as timing then periodTiming(eff, timing) "cod";\n } "eff";\n sub -> medRq.dosageInstruction = create('Dosage') as dosage then {\n sub.routeCode -> dosage.route;\n } "dosage";\n sub -> medRq.dosageInstruction = create('Dosage') as dosage then {\n sub.approachSiteCode -> dosage.site;\n } "dosage";\n sub.doseQuantity as doseQuant then {\n doseQuant -> medRq.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 sub.rateQuantity as rateQuantity -> medRq.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 } "qualcosa";\n } "dosageRate";\n } "Dosage";\n } "doseQuant";\n sub -> bundle.entry as e1, e1.request = create('BackboneElement') as request, request.method = 'POST', e1.resource = create('Medication') as medication, medication.id = uuid() as uuid1, e1.fullUrl = append('https://example/Medication/', uuid1), request.url = 'Medication', medRq.medication = create('Reference') as reference, reference.reference = ('https://example/Medication/' + %medication.id) then {\n sub.administrationUnitCode -> medication.form;\n sub.consumable as cons then {\n cons.manufacturedProduct as manuprod then {\n manuprod.manufacturedMaterial as manufact then {\n manufact.code -> medication.code;\n } "manuFact";\n } "manumat";\n } "cons";\n sub.entryRelationship as entryR then {\n entryR.observation as observation then {\n observation.code where displayName = 'Grammatura' -> medication.ingredient as ingredient then {\n sub.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 sub.participant as part -> bundle.entry as e1, e1.request = create('BackboneElement') as request, request.method = 'PUT', e1.resource = create('Practitioner') as participant, participant.id = uuid() as uuid1, e1.fullUrl = append('https://example/Participant/', uuid1), request.url = append('Participant/', uuid1) then {\n part.time as t -> medRq.authoredOn = create('dateTime') as date then TSDateTime(t, date) "authoredOn";\n part.participantRole as partRole then {\n partRole -> participant.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/TerapiaFarmacologicaDimissione/participant' "code";\n } "coding";\n } "meta";\n partRole.id as id -> participant.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 -> participant.id = (r + '-' + ext) as uuid2, e1.fullUrl = append('https://example/Practitioner/', uuid2), request.url = append('Practitioner/', uuid2), medRq.requester = create('Reference') as reference, reference.reference = ('https://example/Practitioner/' + %participant.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 playent then {\n playent.name -> participant.name;\n } "playent";\n } "partRole";\n };\n sub.reference as ref then {\n ref.externalAct as external then {\n external.id -> medRq.identifier;\n } "external";\n } "ref";\n sub.entryRelationship as entryRelationship then {\n entryRelationship.supply as sup -> medRq.dispenseRequest as dispreq then {\n sup -> dispreq.quantity = create('SimpleQuantity') as quantity then {\n sup.quantity as q -> quantity.value = (q.value);\n } "quantity";\n } "sub";\n } "med";\n } "admnistrationUnicode";\n } "sub";\n };\n } "medication";\n } "sezioneesiste";\n}\n\n// -----------------------------------------------------------------------------------------------------------------------\n// ______1._____________Sections________________________\ngroup ModalitadiTrasposto(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.entry as entry1 then {\n src.entry as entry1 -> tgt.entry = create('Reference') as reference, reference.reference = ('https://example/Encounter/' + %enc.id) then {\n entry1.act as act1 then Act(act1, patient, enc, bundle);\n } "entry1";\n };\n}\n\ngroup MotivoDellaVisita(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.entry as entry -> bundle.entry as e2, e2.request = create('BackboneElement') as request, request.method = 'POST', e2.resource = create('Observation') as observation, observation.id = uuid() as uuid2, e2.fullUrl = append('https://example/Observation/', uuid2), request.url = 'Observation', tgt.entry = create('Reference') as reference, reference.reference = ('https://example/Observation/' + %observation.id) then {\n entry.observation as obs then Observation(obs, patient, enc, observation, bundle);\n };\n}\n\ngroup Triage(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.entry as entry -> bundle.entry as e2, e2.request = create('BackboneElement') as request, request.method = 'POST', e2.resource = create('Observation') as observation, observation.id = uuid() as uuid2, e2.fullUrl = append('https://example/Observation/', uuid2), request.url = 'Observation', tgt.entry = create('Reference') as reference, reference.reference = ('https://example/Observation/' + %observation.id) then {\n entry.observation as obs then Observation(obs, patient, enc, observation, bundle);\n };\n}\n\ngroup InquadramentoClinicoIniziale(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 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 src.author as author then {\n author -> bundle.entry as e2, e2.request = create('BackboneElement') as request, request.method = 'PUT', e2.resource = create('Practitioner') as practitioner then {\n author.assignedAuthor as assignedAuthor then {\n assignedAuthor -> practitioner.meta as meta then {\n assignedAuthor -> meta.tag = create('Coding') as coding then {\n assignedAuthor -> coding.system = 'http://algoritmodiscoring' "system";\n assignedAuthor -> coding.code = 'ClinicalDocument/body/InquadramentoClinicoIniziale/author' "code";\n } "coding";\n } "meta";\n assignedAuthor.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, e2.fullUrl = append('https://example/Practitioner/', uuid2), request.url = append('Practitioner/', uuid2), note.author = create('Reference') as reference, reference.reference = ('https://example/Practitioner/' + %practitioner.id) "aut";\n } "r";\n } "identifier";\n assignedAuthor.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 assignedAuthor.assignedPerson as person then {\n person.name -> practitioner.name;\n } "name";\n };\n } "practitioner";\n author.time as t -> note.time = create('dateTime') as value then TSDateTime(t, value);\n } "Author";\n cdaText as t -> note.text = t "reference";\n } "reference";\n } "cdaText";\n // START sottosections\n src.component as component then {\n component.section as sottosection then {\n sottosection -> tgt.section as section then {\n // 1. Anamnesi Narrativa-------------------------------------------------------------------------------------------------------------------------------------------\n sottosection.code where (code = '11329-0') -> section.code;\n sottosection.code as code1 where (code = '11329-0') then {\n src where sottosection.entry.exists().not() then {\n sottosection.title as t -> section.title = (t.dataString);\n sottosection.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', section.entry = create('Reference') as reference, reference.reference = ('https://example/Observation/' + %observation.id) 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 sottosection.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 sottosection.author as authors then {\n authors.time as time -> note.time = create('dateTime') as value then TSDateTime(time, value) "timeAuthor";\n authors.assignedAuthor as assignedAuthor -> bundle.entry as e9, e9.request = create('BackboneElement') as request, request.method = 'PUT', e9.resource = create('Practitioner') as practitioner then {\n assignedAuthor -> practitioner.meta as meta then {\n assignedAuthor -> meta.tag = create('Coding') as coding then {\n assignedAuthor -> coding.system = 'http://algoritmodiscoring' "system";\n assignedAuthor -> coding.code = 'ClinicalDocument/body/EsameObiettivo/author' "code";\n } "coding";\n } "meta";\n assignedAuthor.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 uuid9, e9.fullUrl = append('https://example/Practitioner/', uuid9), request.url = append('Practitioner/', uuid9), note.author = create('Reference') as reference, reference.reference = ('https://example/Practitioner/' + %practitioner.id) "autore";\n } "r";\n } "identifier";\n assignedAuthor.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 assignedAuthor.assignedPerson as person then {\n person.name -> practitioner.name;\n };\n } "assighedAuthor";\n };\n } "reference";\n } "cdaText";\n } "where";\n // Anamnesi Strutturata-----------------------------------------------------------------------------------------------------------------------------------------\n sottosection.entry as entry1 then {\n entry1.observation as obs then {\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', section.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 // blocco Narrativo\n sottosection.text as cdaText1 -> condition.note as note then {\n cdaText1 as t -> note.text = t "reference";\n sottosection.author as authors then {\n authors.time as time -> note.time = create('dateTime') as value then TSDateTime(time, value) "timeAuthor";\n authors.assignedAuthor as assignedAuthor -> bundle.entry as e5, e5.request = create('BackboneElement') as request, request.method = 'PUT', e5.resource = create('Practitioner') as practitioner then {\n assignedAuthor -> practitioner.meta as meta then {\n assignedAuthor -> meta.tag = create('Coding') as coding then {\n assignedAuthor -> coding.system = 'http://algoritmodiscoring' "system";\n assignedAuthor -> coding.code = 'ClinicalDocument/body/Anamnesi/author' "code";\n } "coding";\n } "meta";\n assignedAuthor.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 uuid5, e5.fullUrl = append('https://example/Practitioner/', uuid5), request.url = append('Practitioner/', uuid5), note.author = create('Reference') as reference, reference.reference = ('https://example/Practitioner/' + %practitioner.id);\n } "r";\n } "identifier";\n assignedAuthor.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 assignedAuthor.assignedPerson as person then {\n person.name -> practitioner.name;\n };\n } "assighedAuthor";\n };\n } "cdaText1";\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.effectiveTime as effectiveTime -> condition.onset = create('dateTime') as value then TSDateTime(effectiveTime, value) "onsetDateTime";\n obs.value : INT as int -> ob.value = (int.value);\n obs.value : BL as boolean -> ob.value = (boolean.value) "boolean";\n obs.value : ST as value -> ob.value = create('string'), ob.value = (value.dataString);\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 -> 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 -> observation.value = (int.value);\n observation2.value : BL as boolean -> observation.value = (boolean.value) "boolean";\n observation2.value : ST as value -> observation.value = create('string'), observation.value = (value.dataString);\n observation2.effectiveTime as effectiveTime -> observation.effective = create('dateTime') as value then TSDateTime(effectiveTime, value) "value2";\n observation2 where effectiveTime.low.exists() or effectiveTime.high.exists() then {\n observation2.effectiveTime as eff -> observation.effective = create('Period') as period then IVLTSPeriod(eff, period);\n } "where";\n observation2.value : PQ as val then {\n val -> observation.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 : 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 } "condition";\n } "89261-2";\n } "entryobservation1";\n // Anamnesi Familiare---------------------------------------------------------------------------------------------------------------------------------------------\n entry1.organizer as organizer then {\n organizer.code where (code = '10157-6') then {\n organizer -> bundle.entry as e4, e4.request = create('BackboneElement') as request, request.method = 'POST', e4.resource = create('FamilyMemberHistory') as FamilyMemberHistory, FamilyMemberHistory.id = uuid() as uuid5, e4.fullUrl = append('https://example/FamilyMemberHistory/', uuid5), request.url = 'FamilyMemberHistory', section.entry = create('Reference') as reference, reference.reference = ('https://example/FamilyMemberHistory/' + %FamilyMemberHistory.id) then {\n organizer.effectiveTime as effective then {\n effective.value as eff -> FamilyMemberHistory.date = create('dateTime') as value then TSDateTime(eff, value) "date";\n } "effective";\n organizer -> FamilyMemberHistory.patient = create('Reference') as reference, reference.reference = ('https://example/Patient/' + %patient.id) "reference";\n organizer.subject as subject then {\n subject.relatedSubject as relatedSubject then {\n relatedSubject.code -> FamilyMemberHistory.relationship "relationship";\n relatedSubject.subject as subject -> FamilyMemberHistory.sex as sex then {\n subject.administrativeGenderCode as administrativeGenderCode -> sex.coding as coding then {\n administrativeGenderCode.code as code -> coding.code = translate(code, '#AdministrativeGender', 'code') "gender";\n administrativeGenderCode -> coding.system = 'http://hl7.org/fhir/administrative-gender' "system";\n } "coding";\n } "subject1";\n };\n };\n // blocco Narrativo\n sottosection.text as cdaText1 -> FamilyMemberHistory.note as note then {\n cdaText1 as t -> note.text = t "reference";\n sottosection.author as authors then {\n authors.time as time -> note.time = create('dateTime') as value then TSDateTime(time, value) "timeAuthor";\n authors.assignedAuthor as assignedAuthor -> bundle.entry as e7, e7.request = create('BackboneElement') as request, request.method = 'PUT', e7.resource = create('Practitioner') as practitioner then {\n assignedAuthor -> practitioner.meta as meta then {\n assignedAuthor -> meta.tag = create('Coding') as coding then {\n assignedAuthor -> coding.system = 'http://algoritmodiscoring' "system";\n assignedAuthor -> coding.code = 'ClinicalDocument/body/Anamnesi/author' "code";\n } "coding";\n } "meta";\n assignedAuthor.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 uuid7, e7.fullUrl = append('https://example/Practitioner/', uuid7), request.url = append('Practitioner/', uuid7), note.author = create('Reference') as reference, reference.reference = ('https://example/Practitioner/' + %practitioner.id);\n } "r";\n } "identifier";\n assignedAuthor.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 assignedAuthor.assignedPerson as person then {\n person.name -> practitioner.name;\n };\n } "assighedAuthor";\n };\n } "cdaText1";\n organizer.component as component -> FamilyMemberHistory.condition as condition then {\n component.observation as observation then {\n observation.code -> condition.code;\n observation.text as text -> FamilyMemberHistory.note as note then {\n text.reference as reference -> note.text = (reference.value) "value";\n } "reference";\n observation.statusCode -> FamilyMemberHistory.status;\n observation.value -> condition.outcome "codeable";\n observation.entryRelationship as entryRelationship then {\n entryRelationship.observation as obsservation1 then {\n obsservation1.code as code then {\n code.code where (code.code = '35267-4') then {\n obsservation1.value as value -> condition.onset = create('Age') as Age then {\n value.value as valueAge -> Age.value = valueAge "age";\n value.unit as unit -> Age.code = unit;\n value.unit as unit -> Age.unit = unit;\n value -> Age.system = 'http://unitsofmeasure.org' "system";\n };\n } "insorgenza";\n };\n obsservation1.code as code then {\n code.code where (code.code = '39016-1') then {\n obsservation1.value as value -> FamilyMemberHistory.deceased = create('Age') as Age then {\n value.value as valueAge -> Age.value = valueAge "age";\n value.unit as unit -> Age.code = unit;\n value.unit as unit -> Age.unit = unit;\n value -> Age.system = 'http://unitsofmeasure.org' "system";\n };\n } "deceased";\n };\n } "obser";\n } "EntryRel";\n observation where observation.effectiveTime.exists() then {\n observation.effectiveTime as effectiveTime -> FamilyMemberHistory.condition = create('BackboneElement') as condition then {\n effectiveTime -> condition.onset = create('Period') as period then {\n effectiveTime -> period.start = create('dateTime') as start then TSDateTime(effectiveTime, start) "val";\n } "efft";\n observation.code -> condition.code;\n observation.value -> condition.outcome "codeable";\n } "effttemp";\n } "cont";\n } "observationCondition";\n };\n } "organizer";\n } "10157-6";\n } "observation1";\n } "subsection1";\n } "11329-0";\n // 2. Esame Obiettivo Narrativa-----------------------------------------------------------------------------------------------------------------------------------\n sottosection.code where (code = '29545-1') -> section.code;\n sottosection.code as code1 where (code = '29545-1') then {\n sottosection.title as t -> section.title = (t.dataString);\n sottosection.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', section.entry = create('Reference') as reference, reference.reference = ('https://example/Observation/' + %observation.id) 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 sottosection.code -> observation.code;\n sottosection where observation.statusCode.exists().not() then {\n sottosection -> observation.status = 'final' "status";\n } "statuscode";\n cdaText -> observation.note as note then {\n cdaText as t -> note.text = t "reference";\n sottosection.author as authors then {\n authors.time as time -> note.time = create('dateTime') as value then TSDateTime(time, value) "timeAuthor";\n authors.assignedAuthor as assignedAuthor -> bundle.entry as e9, e9.request = create('BackboneElement') as request, request.method = 'PUT', e9.resource = create('Practitioner') as practitioner then {\n assignedAuthor -> practitioner.meta as meta then {\n assignedAuthor -> meta.tag = create('Coding') as coding then {\n assignedAuthor -> coding.system = 'http://algoritmodiscoring' "system";\n assignedAuthor -> coding.code = 'ClinicalDocument/body/EsameObiettivo/author' "code";\n } "coding";\n } "meta";\n assignedAuthor.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 uuid9, e9.fullUrl = append('https://example/Practitioner/', uuid9), request.url = append('Practitioner/', uuid9), note.author = create('Reference') as reference, reference.reference = ('https://example/Practitioner/' + %practitioner.id) "autore";\n } "r";\n } "identifier";\n assignedAuthor.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 assignedAuthor.assignedPerson as person then {\n person.name -> practitioner.name;\n };\n } "assighedAuthor";\n };\n } "reference";\n } "cdaText";\n } "condizioneesameObiettivo";\n // 3. Terapia Farmacologica all'ingresso Narrativa --------------------------------------------------------------------------------------------------------------\n sottosection.code where (code = '42346-7') -> section.code;\n sottosection.code as code1 where (code = '42346-7') then {\n sottosection.title as t -> section.title = (t.dataString);\n sottosection.text as cdaText -> bundle.entry as e10, e10.request = create('BackboneElement') as request, request.method = 'POST', e10.resource = create('MedicationStatement') as medicStatement, medicStatement.id = uuid() as uuid10, e10.fullUrl = append('https://example/MedicationStatement/', uuid10), request.url = 'MedicationStatement', section.entry = create('Reference') as reference, reference.reference = ('https://example/MedicationStatement/' + %medicStatement.id) then {\n cdaText -> medicStatement.subject = create('Reference') as reference, reference.reference = ('https://example/Patient/' + %patient.id) "reference";\n sottosection where medicStatement.statusCode.exists().not() then {\n sottosection -> medicStatement.status = 'completed' "status";\n } "statuscode";\n cdaText -> medicStatement.medication = create('CodeableConcept') as medication then {\n cdaText as txt -> medication.text = txt "text";\n } "medication";\n cdaText -> medicStatement.note as note then {\n cdaText as t -> note.text = t "reference";\n sottosection.author as authors then {\n authors.time as time -> note.time = create('dateTime') as value then TSDateTime(time, value) "timeAuthor";\n authors.assignedAuthor as assignedAuthor -> bundle.entry as e11, e11.request = create('BackboneElement') as request, request.method = 'PUT', e11.resource = create('Practitioner') as practitioner then {\n assignedAuthor -> practitioner.meta as meta then {\n assignedAuthor -> meta.tag = create('Coding') as coding then {\n assignedAuthor -> coding.system = 'http://algoritmodiscoring' "system";\n assignedAuthor -> coding.code = 'ClinicalDocument/body/TerapiaFarmacologicaIngresso/author' "code";\n } "coding";\n } "meta";\n assignedAuthor.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 uuid11, e11.fullUrl = append('https://example/Practitioner/', uuid11), request.url = append('Practitioner/', uuid11), note.author = create('Reference') as reference, reference.reference = ('https://example/Practitioner/' + %practitioner.id);\n } "r";\n } "identifier";\n assignedAuthor.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 assignedAuthor.assignedPerson as person then {\n person.name -> practitioner.name;\n };\n } "assighedAuthor";\n };\n } "reference";\n } "cdaText";\n } "condizioneterapiaingresso";\n // 4. Allergie\n sottosection.code where (code = '48765-2') -> section.code;\n sottosection.code as code1 where (code = '48765-2') then {\n sottosection.title as t -> section.title = (t.dataString);\n // Allergia Narrativa-------------------------------------------------------------------------------------------------------------------------------------------\n src where sottosection.entry.exists().not() then {\n sottosection.title as t -> section.title = (t.dataString);\n sottosection.text as cdaText -> bundle.entry as e8, e8.request = create('BackboneElement') as request, request.method = 'POST', e8.resource = create('AllergyIntolerance') as AllergyIntolerance, AllergyIntolerance.id = uuid() as uuid8, e8.fullUrl = append('https://example/AllergyIntolerance/', uuid8), request.url = 'AllergyIntolerance', section.entry = create('Reference') as reference, reference.reference = ('https://example/AllergyIntolerance/' + %AllergyIntolerance.id) then {\n cdaText -> AllergyIntolerance.patient = create('Reference') as reference, reference.reference = ('https://example/Patient/' + %patient.id) "reference";\n cdaText -> AllergyIntolerance.encounter = create('Reference') as reference, reference.reference = ('https://example/Encounter/' + %enc.id) "reference";\n cdaText -> AllergyIntolerance.clinicalStatus = create('CodeableConcept') as status then {\n cdaText -> status.coding = create('Coding') as coding then {\n cdaText -> coding.code = 'active' "active";\n cdaText -> coding.system = 'http://terminology.hl7.org/CodeSystem/allergyintolerance-clinical' "system";\n cdaText -> coding.display = 'active' "active";\n } "coding";\n } "clinicalStatus";\n cdaText -> AllergyIntolerance.note as note then {\n cdaText as t -> note.text = t "reference";\n sottosection.author as authors then {\n authors.time as time -> note.time = create('dateTime') as value then TSDateTime(time, value) "timeAuthor";\n authors.assignedAuthor as assignedAuthor -> bundle.entry as e9, e9.request = create('BackboneElement') as request, request.method = 'PUT', e9.resource = create('Practitioner') as practitioner then {\n assignedAuthor -> practitioner.meta as meta then {\n assignedAuthor -> meta.tag = create('Coding') as coding then {\n assignedAuthor -> coding.system = 'http://algoritmodiscoring' "system";\n assignedAuthor -> coding.code = 'ClinicalDocument/body/EsameObiettivo/author' "code";\n } "coding";\n } "meta";\n assignedAuthor.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 uuid9, e9.fullUrl = append('https://example/Practitioner/', uuid9), request.url = append('Practitioner/', uuid9), note.author = create('Reference') as reference, reference.reference = ('https://example/Practitioner/' + %practitioner.id) "autore";\n } "r";\n } "identifier";\n assignedAuthor.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 assignedAuthor.assignedPerson as person then {\n person.name -> practitioner.name;\n };\n } "assighedAuthor";\n };\n } "reference";\n } "cdaText";\n } "where";\n // Allergia Strutturata----------------------------------------------------------------------------------------------------------------------------------------\n sottosection.entry as entry1 -> bundle.entry as e12, e12.request = create('BackboneElement') as request, request.method = 'POST', e12.resource = create('AllergyIntolerance') as allergy, allergy.id = uuid() as uuid12, e12.fullUrl = append('https://example/AllergyIntolerance/', uuid12), request.url = 'AllergyIntolerance', section.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 effectiveTime -> allergy.onset = create('dateTime') as value then TSDateTime(effectiveTime, value) "onsetDateTime";\n actallint where effectiveTime.low.exists() or effectiveTime.high.exists() then {\n actallint.effectiveTime as eff -> allergy.onset = create('Period') as period then IVLTSPeriod(eff, period) "onsetPeriod";\n } "where";\n // mapping note\n sottosection.text as cdaText1 -> allergy.note as note then {\n cdaText1 as t -> note.text = t "reference";\n sottosection.author as authors then {\n authors.time as time -> note.time = create('dateTime') as value then TSDateTime(time, value) "timeAuthor";\n authors.assignedAuthor as assignedAuthor -> bundle.entry as e13, e13.request = create('BackboneElement') as request, request.method = 'PUT', e13.resource = create('Practitioner') as practitioner then {\n assignedAuthor -> practitioner.meta as meta then {\n assignedAuthor -> meta.tag = create('Coding') as coding then {\n assignedAuthor -> coding.system = 'http://algoritmodiscoring' "system";\n assignedAuthor -> coding.code = 'ClinicalDocument/body/Allergie/author' "code";\n } "coding";\n } "meta";\n assignedAuthor.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 uuid13, e13.fullUrl = append('https://example/Practitioner/', uuid13), request.url = append('Practitioner/', uuid13), note.author = create('Reference') as reference, reference.reference = ('https://example/Practitioner/' + %practitioner.id);\n } "r";\n } "identifier";\n assignedAuthor.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 assignedAuthor.assignedPerson as person then {\n person.name -> practitioner.name;\n };\n } "assighedAuthor";\n };\n } "cdaText1";\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 value then TSDateTime(l, value);\n } "eff";\n entobs.value -> reaction.manifestation "manifest";\n } "entryobservation";\n };\n } "reaction";\n };\n };\n };\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 };\n } "severity";\n } "entryobservation2";\n } "entryrelationship2";\n entryobs.entryRelationship as entryobs3 then {\n entryobs3.observation as entobs then {\n entobs.code as code where (code = '33999-4') then {\n // entobs.value->allergy.clinicalStatus "cstatus";\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->coding.version='ConditionClinicalStatusCodes 4.0.1'"version";\n value.displayName as display -> coding.display = cast(display, 'string');\n } "value1";\n } "coding";\n } "clinicalStatus";\n } "33999-4";\n } "entryobservation3";\n } "entryrelationship3";\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 } "entryact1";\n } "entryrelationshi4";\n } "entryobservation";\n } "entryrelationshipact";\n } "entryact2";\n } "allergy";\n } "condizioneallergie";\n // 5. Problemi aperti\n sottosection.code where (code = '11450-4') -> section.code;\n sottosection.code as code1 where (code = '11450-4') then {\n sottosection.title as t -> section.title = (t.dataString);\n sottosection.text as cdaText -> bundle.entry as e14, e14.request = create('BackboneElement') as request, request.method = 'POST', e14.resource = create('Condition') as condition, condition.id = uuid() as uuid14, e14.fullUrl = append('https://example/Condition/', uuid14), request.url = 'Condition', section.entry = create('Reference') as reference, reference.reference = ('https://example/Condition/' + %condition.id) 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 sottosection.code -> condition.code;\n cdaText -> condition.note as note then {\n cdaText as t -> note.text = t "reference";\n sottosection.author as authors then {\n authors.time as time -> note.time = create('dateTime') as value then TSDateTime(time, value) "timeAuthor";\n authors.assignedAuthor as assignedAuthor -> bundle.entry as e15, e15.request = create('BackboneElement') as request, request.method = 'PUT', e15.resource = create('Practitioner') as practitioner then {\n assignedAuthor -> practitioner.meta as meta then {\n assignedAuthor -> meta.tag = create('Coding') as coding then {\n assignedAuthor -> coding.system = 'http://algoritmodiscoring' "system";\n assignedAuthor -> coding.code = 'ClinicalDocument/body/ProblemiAperti/author' "code";\n } "coding";\n } "meta";\n assignedAuthor.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 uuid15, e15.fullUrl = append('https://example/Practitioner/', uuid15), request.url = append('Practitioner/', uuid15), note.author = create('Reference') as reference, reference.reference = ('https://example/Practitioner/' + %practitioner.id) "aut";\n } "r";\n } "identifier";\n assignedAuthor.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 assignedAuthor.assignedPerson as person then {\n person.name -> practitioner.name;\n };\n } "assighedAuthor";\n };\n } "reference";\n } "cdaText";\n } "condizioneproblemiaperti";\n } "Sectionfhir";\n } "Sottosection";\n };\n}\n\n// ______2._____________ClinicalStatements________________________\ngroup Act(source cda : Act, target pat : Patient, target enc : Encounter, target bundle : Bundle) {\n cda.code as code -> enc.extension as extension2 then modeOfArrival(code, extension2);\n cda.participant as participant then {\n participant -> enc.participant as FhirParticipant then {\n participant as p -> FhirParticipant.type as type then {\n p -> type.coding as coding then {\n p -> coding.code = (p.typeCode) "codice";\n p -> coding.system = 'http://terminology.hl7.org/CodeSystem/v3-ParticipationType' "system";\n } "codeType";\n } "type";\n } "fhirParticipant";\n participant.participantRole as participantRole -> bundle.entry as e1, e1.request = create('BackboneElement') as request, request.method = 'POST', e1.resource = create('PractitionerRole') as practitionerRole, practitionerRole.id = uuid() as uuid1, e1.fullUrl = append('https://example/PractitionerRole/', uuid1), request.url = 'PractitionerRole', enc.participant = create('BackboneElement') as participant1, participant1.individual = create('Reference') as referencepart, referencepart.reference = ('https://example/PractitionerRole/' + %practitionerRole.id) then {\n participantRole.code -> practitionerRole.code;\n } "participantrole";\n };\n}\n\n// ______3._____________Extensions_DtType________________________\ngroup modeOfArrival(source src : CE, target ext : Extension) {\n src -> ext.url = 'http://hl7.org/fhir/StructureDefinition/encounter-modeOfArrival' "url";\n src -> ext.value = create('Coding') as code1 then coding(src, code1) "coding";\n}\n\ngroup coding(source src : CE, target tgt : Coding) {\n src.code as code -> tgt.code = cast(code, 'string');\n src.codeSystem as system -> tgt.system = translate(system, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri');\n src.displayName as display -> tgt.display = cast(display, 'string');\n src.codeSystemVersion as version -> tgt.version = cast(version, 'string');\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</pre>\n </div>"
},
"url" : "http://hl7.it/fhir/cda2fhir/StructureMap/cda2fhirEdReport",
"version" : "0.1.0",
"name" : "cda2fhirEdReport",
"status" : "draft",
"date" : "2024-04-11T15:38:19+02:00",
"publisher" : "HL7 Italy",
"contact" : [
{
"name" : "HL7 Italy",
"telecom" : [
{
"system" : "url",
"value" : "http://hl7.it"
}
]
}
],
"jurisdiction" : [
{
"coding" : [
{
"system" : "urn:iso:std:iso:3166",
"code" : "IT",
"display" : "Italy"
}
]
}
],
"structure" : [
{
"url" : "http://hl7.org/fhir/cda/StructureDefinition/ClinicalDocument",
"mode" : "source",
"alias" : "ClinicalDocument"
},
{
"url" : "http://hl7.org/fhir/cda/StructureDefinition/AssignedAuthor",
"mode" : "queried",
"alias" : "AssignedAuthor"
},
{
"url" : "http://hl7.org/fhir/cda/StructureDefinition/AssignedEntity",
"mode" : "queried",
"alias" : "AssignedEntity"
},
{
"url" : "http://hl7.org/fhir/cda/StructureDefinition/AssociatedEntity",
"mode" : "queried",
"alias" : "AssociatedEntity"
},
{
"url" : "http://hl7.org/fhir/cda/StructureDefinition/CustodianOrganization",
"mode" : "queried",
"alias" : "CustodianOrganization"
},
{
"url" : "http://hl7.org/fhir/cda/StructureDefinition/OrganizationPartOf",
"mode" : "queried",
"alias" : "OrganizationPartOf"
},
{
"url" : "http://hl7.org/fhir/cda/StructureDefinition/Organization",
"mode" : "queried",
"alias" : "rapresentedOrganization"
},
{
"url" : "http://hl7.org/fhir/cda/StructureDefinition/Section",
"mode" : "queried",
"alias" : "Section"
},
{
"url" : "http://hl7.org/fhir/cda/StructureDefinition/PatientRole",
"mode" : "queried",
"alias" : "PatientRole"
},
{
"url" : "http://hl7.org/fhir/cda/StructureDefinition/AD",
"mode" : "source",
"alias" : "AD"
},
{
"url" : "http://hl7.org/fhir/StructureDefinition/Bundle",
"mode" : "target",
"alias" : "Bundle"
},
{
"url" : "http://hl7.org/fhir/StructureDefinition/Composition",
"mode" : "produced",
"alias" : "Composition"
},
{
"url" : "http://hl7.org/fhir/StructureDefinition/Patient",
"mode" : "produced",
"alias" : "Patient"
},
{
"url" : "http://hl7.org/fhir/StructureDefinition/Encounter",
"mode" : "produced",
"alias" : "Encounter"
},
{
"url" : "http://hl7.org/fhir/StructureDefinition/Person",
"mode" : "produced",
"alias" : "Patient"
},
{
"url" : "http://hl7.org/fhir/StructureDefinition/Practitioner",
"mode" : "produced",
"alias" : "Practitioner"
},
{
"url" : "http://hl7.org/fhir/StructureDefinition/Organization",
"mode" : "produced",
"alias" : "Organization"
},
{
"url" : "http://hl7.org/fhir/cda/StructureDefinition/Act",
"mode" : "produced",
"alias" : "Act"
},
{
"url" : "http://hl7.org/fhir/cda/StructureDefinition/IVL-PQ",
"mode" : "source",
"alias" : "IVL_PQ"
},
{
"url" : "http://hl7.org/fhir/cda/StructureDefinition/IVL-TS",
"mode" : "source"
},
{
"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",
"documentation" : "--------------------------------------------------------------------------------------------",
"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" : "e6"
},
{
"context" : "e6",
"contextType" : "variable",
"element" : "request",
"variable" : "request",
"transform" : "create",
"parameter" : [
{
"valueString" : "BackboneElement"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "method",
"transform" : "copy",
"parameter" : [
{
"valueString" : "POST"
}
]
},
{
"context" : "e6",
"contextType" : "variable",
"element" : "resource",
"variable" : "DocumentReference",
"transform" : "create",
"parameter" : [
{
"valueString" : "DocumentReference"
}
]
},
{
"context" : "DocumentReference",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid6",
"transform" : "uuid"
},
{
"context" : "e6",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "https://example/DocumentReference/"
},
{
"valueId" : "uuid6"
}
]
},
{
"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" : "recPat",
"source" : [
{
"context" : "cda",
"element" : "recordTarget",
"variable" : "recordTarget"
}
],
"rule" : [
{
"name" : "record",
"source" : [
{
"context" : "recordTarget",
"element" : "patientRole",
"variable" : "patient"
}
],
"rule" : [
{
"name" : "idfr",
"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" : "value",
"source" : [
{
"context" : "id",
"element" : "extension",
"variable" : "ext1"
}
],
"target" : [
{
"context" : "identifier",
"contextType" : "variable",
"element" : "value",
"transform" : "copy",
"parameter" : [
{
"valueId" : "ext1"
}
]
}
]
},
{
"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" : "Modalitaditrasporto",
"source" : [
{
"context" : "srcSection",
"element" : "code",
"condition" : "(code = '11459-5')"
}
],
"target" : [
{
"context" : "composition",
"contextType" : "variable",
"element" : "section",
"variable" : "tgtSection"
}
],
"dependent" : [
{
"name" : "ModalitadiTrasposto",
"variable" : [
"cda",
"srcSection",
"patient",
"tgtSection",
"bundle",
"encounter"
]
}
]
},
{
"name" : "Inquadramentoclinico",
"source" : [
{
"context" : "srcSection",
"element" : "code",
"condition" : "(code = '78337-3')"
}
],
"target" : [
{
"context" : "composition",
"contextType" : "variable",
"element" : "section",
"variable" : "tgtSection"
}
],
"dependent" : [
{
"name" : "InquadramentoClinicoIniziale",
"variable" : [
"cda",
"srcSection",
"patient",
"tgtSection",
"bundle",
"encounter"
]
}
]
},
{
"name" : "Inquadramentoclinico",
"source" : [
{
"context" : "srcSection",
"element" : "code",
"condition" : "(code = '46239-0')"
}
],
"target" : [
{
"context" : "composition",
"contextType" : "variable",
"element" : "section",
"variable" : "tgtSection"
}
],
"dependent" : [
{
"name" : "MotivoDellaVisita",
"variable" : [
"cda",
"srcSection",
"patient",
"tgtSection",
"bundle",
"encounter"
]
}
]
},
{
"name" : "Triage",
"source" : [
{
"context" : "srcSection",
"element" : "code",
"condition" : "(code = '54094-8')"
}
],
"target" : [
{
"context" : "composition",
"contextType" : "variable",
"element" : "section",
"variable" : "tgtSection"
}
],
"dependent" : [
{
"name" : "Triage",
"variable" : [
"cda",
"srcSection",
"patient",
"tgtSection",
"bundle",
"encounter"
]
}
]
},
{
"name" : "motivoricovero",
"source" : [
{
"context" : "srcSection",
"element" : "code",
"condition" : "(code = '46240-8')"
}
],
"target" : [
{
"context" : "composition",
"contextType" : "variable",
"element" : "section",
"variable" : "tgtSection"
}
],
"dependent" : [
{
"name" : "ClinicalDocumentSectionEncounter",
"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 = '62387-6')"
}
],
"target" : [
{
"context" : "composition",
"contextType" : "variable",
"element" : "section",
"variable" : "tgtSection"
}
],
"dependent" : [
{
"name" : "ClinicalDocumentSectionConsulenza",
"variable" : [
"cda",
"srcSection",
"patient",
"tgtSection",
"bundle",
"encounter"
]
}
]
},
{
"name" : "Accertamenti",
"source" : [
{
"context" : "srcSection",
"element" : "code",
"condition" : "(code = '30954-2')"
}
],
"target" : [
{
"context" : "composition",
"contextType" : "variable",
"element" : "section",
"variable" : "tgtSection"
}
],
"dependent" : [
{
"name" : "ClinicalDocumentSectionAccertamenti",
"variable" : [
"cda",
"srcSection",
"patient",
"tgtSection",
"bundle",
"encounter"
]
}
]
},
{
"name" : "Accertamenti",
"source" : [
{
"context" : "srcSection",
"element" : "code",
"condition" : "(code = '8716-3')"
}
],
"target" : [
{
"context" : "composition",
"contextType" : "variable",
"element" : "section",
"variable" : "tgtSection"
}
],
"dependent" : [
{
"name" : "ClinicalDocumentSectionParametriVitali",
"variable" : [
"cda",
"srcSection",
"patient",
"tgtSection",
"bundle",
"encounter"
]
}
]
},
{
"name" : "Accertamenti",
"source" : [
{
"context" : "srcSection",
"element" : "code",
"condition" : "(code = '29549-3')"
}
],
"target" : [
{
"context" : "composition",
"contextType" : "variable",
"element" : "section",
"variable" : "tgtSection"
}
],
"dependent" : [
{
"name" : "ClinicalDocumentSectionTerapiaFarmacoInPronto",
"variable" : [
"cda",
"srcSection",
"patient",
"tgtSection",
"bundle",
"encounter"
]
}
]
},
{
"name" : "Pianodicuraalladimissione",
"source" : [
{
"context" : "srcSection",
"element" : "code",
"condition" : "(code = '18776-5')"
}
],
"target" : [
{
"context" : "composition",
"contextType" : "variable",
"element" : "section",
"variable" : "tgtSection"
}
],
"dependent" : [
{
"name" : "ClinicalDocumentSectionPianoCuraDimissione",
"variable" : [
"cda",
"srcSection",
"patient",
"tgtSection",
"bundle",
"encounter"
]
}
]
},
{
"name" : "Dimissione",
"source" : [
{
"context" : "srcSection",
"element" : "code",
"condition" : "(code = '28574-2')"
}
],
"target" : [
{
"context" : "composition",
"contextType" : "variable",
"element" : "section",
"variable" : "tgtSection"
}
],
"dependent" : [
{
"name" : "ClinicalDocumentSectionDimissione",
"variable" : [
"cda",
"srcSection",
"patient",
"tgtSection",
"bundle",
"encounter"
]
}
]
},
{
"name" : "TerapiaFarmacologicaDimissione",
"source" : [
{
"context" : "srcSection",
"element" : "code",
"condition" : "(code = '75311-1')"
}
],
"target" : [
{
"context" : "composition",
"contextType" : "variable",
"element" : "section",
"variable" : "tgtSection"
}
],
"dependent" : [
{
"name" : "ClinicalDocumentSectionTerapiaFarmacologicaDimissione",
"variable" : [
"cda",
"srcSection",
"patient",
"tgtSection",
"bundle",
"encounter"
]
}
]
}
]
}
]
}
]
}
]
}
]
},
{
"name" : "ClinicalDocumentSectionComplicanze",
"typeMode" : "none",
"documentation" : "Sezione complicanze--------------------------------------------------------------------------",
"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" : "entryexists",
"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"
]
}
]
}
],
"documentation" : "Sezione Strutturata-----------------------------------------------------------------------------------------------------------------------------------------------"
},
{
"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"
}
]
}
]
}
]
}
]
}
],
"documentation" : "Sezione Narrativa---------------------------------------------------------------------------------------------------------------------------------------------"
}
]
},
{
"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" : "effectiveTime",
"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" : "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" : "translation1",
"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" : "translation1",
"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" : "BL",
"element" : "value",
"variable" : "value"
}
],
"target" : [
{
"context" : "ob",
"contextType" : "variable",
"element" : "value",
"transform" : "create",
"parameter" : [
{
"valueString" : "boolean"
}
]
},
{
"context" : "ob",
"contextType" : "variable",
"element" : "value",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "value.value"
}
]
}
]
},
{
"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" : "performer",
"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"
}
]
}
],
"rule" : [
{
"name" : "assignedEntity",
"source" : [
{
"context" : "performer",
"element" : "assignedEntity",
"variable" : "entity"
}
],
"rule" : [
{
"name" : "meta",
"source" : [
{
"context" : "entity"
}
],
"target" : [
{
"context" : "practitioner",
"contextType" : "variable",
"element" : "meta",
"variable" : "meta"
}
],
"rule" : [
{
"name" : "coding",
"source" : [
{
"context" : "entity"
}
],
"target" : [
{
"context" : "meta",
"contextType" : "variable",
"element" : "tag",
"variable" : "coding",
"transform" : "create",
"parameter" : [
{
"valueString" : "Coding"
}
]
}
],
"rule" : [
{
"name" : "system",
"source" : [
{
"context" : "entity"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "system",
"transform" : "copy",
"parameter" : [
{
"valueString" : "http://algoritmodiscoring"
}
]
}
]
},
{
"name" : "code",
"source" : [
{
"context" : "entity"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "code",
"transform" : "copy",
"parameter" : [
{
"valueString" : "ClinicalDocument/body/observation/performer"
}
]
}
]
}
]
}
]
},
{
"name" : "identifier",
"source" : [
{
"context" : "entity",
"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" : "entity"
}
],
"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" : "r",
"source" : [
{
"context" : "id",
"element" : "root",
"variable" : "r"
}
],
"rule" : [
{
"name" : "performer",
"source" : [
{
"context" : "id",
"element" : "extension",
"variable" : "ext"
}
],
"target" : [
{
"context" : "practitioner",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid1",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "r + '-' + ext"
}
]
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "https://example/Practitioner/"
},
{
"valueId" : "uuid1"
}
]
},
{
"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" : "name",
"source" : [
{
"context" : "entity",
"element" : "assignedPerson",
"variable" : "person"
}
],
"rule" : [
{
"name" : "name",
"source" : [
{
"context" : "person",
"element" : "name",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "practitioner",
"contextType" : "variable",
"element" : "name",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "birth",
"source" : [
{
"context" : "person",
"element" : "birthTime",
"variable" : "birthTime"
}
],
"rule" : [
{
"name" : "value",
"source" : [
{
"context" : "birthTime",
"element" : "value",
"variable" : "date"
}
],
"target" : [
{
"context" : "practitioner",
"contextType" : "variable",
"element" : "birthDate",
"transform" : "truncate",
"parameter" : [
{
"valueId" : "date"
},
{
"valueInteger" : 10
}
]
}
]
}
]
}
]
}
]
}
]
},
{
"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" : "IVL-PQ",
"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" : "ClinicalDocumentSectionDecorsoOspedaliero",
"typeMode" : "none",
"documentation" : "------------------------------------------------------------------------------------------------------\r\nSezione Decorso Ospedaliero----------------------------------------------------------------------------",
"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" : "OB-note",
"source" : [
{
"context" : "src"
}
],
"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" : "observation",
"contextType" : "variable",
"element" : "note",
"variable" : "note"
}
],
"rule" : [
{
"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" : "src",
"element" : "text",
"variable" : "t"
}
],
"target" : [
{
"context" : "note",
"contextType" : "variable",
"element" : "text",
"transform" : "copy",
"parameter" : [
{
"valueId" : "t"
}
]
}
]
},
{
"name" : "Auth",
"source" : [
{
"context" : "src",
"element" : "author",
"variable" : "auth"
}
],
"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"
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "https://example/Practitioner/"
},
{
"valueId" : "uuid1"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "url",
"transform" : "append",
"parameter" : [
{
"valueString" : "Practitioner/"
},
{
"valueId" : "uuid1"
}
]
}
],
"rule" : [
{
"name" : "time",
"source" : [
{
"context" : "auth",
"element" : "time",
"variable" : "ti"
}
],
"target" : [
{
"context" : "note",
"contextType" : "variable",
"element" : "time",
"variable" : "value",
"transform" : "create",
"parameter" : [
{
"valueString" : "dateTime"
}
]
}
],
"dependent" : [
{
"name" : "TSDateTime",
"variable" : [
"ti",
"value"
]
}
]
},
{
"name" : "assAuth",
"source" : [
{
"context" : "auth",
"element" : "assignedAuthor",
"variable" : "assAuth"
}
],
"rule" : [
{
"name" : "meta",
"source" : [
{
"context" : "assAuth"
}
],
"target" : [
{
"context" : "practitioner",
"contextType" : "variable",
"element" : "meta",
"variable" : "meta"
}
],
"rule" : [
{
"name" : "coding",
"source" : [
{
"context" : "assAuth"
}
],
"target" : [
{
"context" : "meta",
"contextType" : "variable",
"element" : "tag",
"variable" : "coding",
"transform" : "create",
"parameter" : [
{
"valueString" : "Coding"
}
]
}
],
"rule" : [
{
"name" : "system",
"source" : [
{
"context" : "assAuth"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "system",
"transform" : "copy",
"parameter" : [
{
"valueString" : "http://algoritmodiscoring"
}
]
}
]
},
{
"name" : "code",
"source" : [
{
"context" : "assAuth"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "code",
"transform" : "copy",
"parameter" : [
{
"valueString" : "ClinicalDocument/body/DecorsoOspedaliero/author"
}
]
}
]
}
]
}
],
"documentation" : "meta+identifier"
},
{
"name" : "identifier",
"source" : [
{
"context" : "assAuth",
"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" : "uuid2"
}
]
},
{
"context" : "note",
"contextType" : "variable",
"element" : "author",
"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" : "assAuth",
"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" : "assPers",
"source" : [
{
"context" : "assAuth",
"element" : "assignedPerson",
"variable" : "assPers"
}
],
"rule" : [
{
"name" : "name",
"source" : [
{
"context" : "assPers",
"element" : "name",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "practitioner",
"contextType" : "variable",
"element" : "name",
"variable" : "vvv",
"transform" : "create"
}
]
}
]
}
]
}
]
}
]
}
]
},
{
"name" : "ClinicalDocumentSectionEncounter",
"typeMode" : "none",
"documentation" : "--------------------------------------------------------------------------------------------------------\r\nSezione Encounter---------------------------------------------------------------------------------------",
"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" : "enc1",
"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" : "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" : "encounter",
"transform" : "create",
"parameter" : [
{
"valueString" : "Encounter"
}
]
},
{
"context" : "encounter",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid1",
"transform" : "uuid"
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "https://example/Encounter/"
},
{
"valueId" : "uuid1"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "url",
"transform" : "copy",
"parameter" : [
{
"valueString" : "Encounter"
}
]
},
{
"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/Encounter/' + %encounter.id"
}
]
}
],
"rule" : [
{
"name" : "refer",
"source" : [
{
"context" : "entry1"
}
],
"target" : [
{
"context" : "encounter",
"contextType" : "variable",
"element" : "partOf",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Encounter/' + %enc1.id"
}
]
}
]
},
{
"name" : "refer",
"source" : [
{
"context" : "entry1"
}
],
"target" : [
{
"context" : "encounter",
"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" : "entry1"
}
],
"target" : [
{
"context" : "encounter",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "finished"
}
]
}
]
},
{
"name" : "class",
"source" : [
{
"context" : "entry1"
}
],
"target" : [
{
"context" : "encounter",
"contextType" : "variable",
"element" : "class",
"variable" : "cl",
"transform" : "create",
"parameter" : [
{
"valueString" : "Coding"
}
]
}
],
"rule" : [
{
"name" : "code",
"source" : [
{
"context" : "entry1"
}
],
"target" : [
{
"context" : "cl",
"contextType" : "variable",
"element" : "code",
"transform" : "copy",
"parameter" : [
{
"valueString" : "AMB"
}
]
}
]
},
{
"name" : "code",
"source" : [
{
"context" : "entry1"
}
],
"target" : [
{
"context" : "cl",
"contextType" : "variable",
"element" : "display",
"transform" : "copy",
"parameter" : [
{
"valueString" : "ambulatory"
}
]
}
]
}
]
},
{
"name" : "encounter",
"source" : [
{
"context" : "entry1",
"element" : "encounter",
"variable" : "enc"
}
],
"rule" : [
{
"name" : "code",
"source" : [
{
"context" : "enc",
"element" : "code",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "encounter",
"contextType" : "variable",
"element" : "type",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "where",
"source" : [
{
"context" : "enc",
"condition" : "effectiveTime.low.exists() or effectiveTime.high.exists()"
}
],
"rule" : [
{
"name" : "effectiveTime",
"source" : [
{
"context" : "enc",
"element" : "effectiveTime",
"variable" : "eff"
}
],
"target" : [
{
"context" : "encounter",
"contextType" : "variable",
"element" : "period",
"variable" : "period",
"transform" : "create",
"parameter" : [
{
"valueString" : "Period"
}
]
}
],
"dependent" : [
{
"name" : "IVLTSPeriod",
"variable" : [
"eff",
"period"
]
}
]
}
],
"documentation" : "effectiveTime=period"
},
{
"name" : "where",
"source" : [
{
"context" : "enc",
"condition" : "effectiveTime.low.exists().not() or effectiveTime.high.exists().not()"
}
],
"rule" : [
{
"name" : "efft",
"source" : [
{
"context" : "enc",
"element" : "effectiveTime",
"variable" : "effectivetime1"
}
],
"target" : [
{
"context" : "encounter",
"contextType" : "variable",
"element" : "period",
"variable" : "period",
"transform" : "create",
"parameter" : [
{
"valueString" : "Period"
}
]
}
],
"rule" : [
{
"name" : "val",
"source" : [
{
"context" : "effectivetime1"
}
],
"target" : [
{
"context" : "period",
"contextType" : "variable",
"element" : "start",
"variable" : "start",
"transform" : "create",
"parameter" : [
{
"valueString" : "dateTime"
}
]
}
],
"dependent" : [
{
"name" : "TSDateTime",
"variable" : [
"effectivetime1",
"start"
]
}
]
}
]
}
],
"documentation" : "effectiveTime = time-stamp"
},
{
"name" : "participant-ADM",
"source" : [
{
"context" : "enc",
"element" : "participant",
"variable" : "part",
"condition" : "(typeCode != 'LOC')"
}
],
"target" : [
{
"context" : "encounter",
"contextType" : "variable",
"element" : "participant",
"variable" : "patarg",
"transform" : "create",
"parameter" : [
{
"valueString" : "BackboneElement"
}
]
}
],
"rule" : [
{
"name" : "type",
"source" : [
{
"context" : "part"
}
],
"target" : [
{
"context" : "patarg",
"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" : "time",
"source" : [
{
"context" : "part",
"element" : "time",
"variable" : "time1"
}
],
"target" : [
{
"context" : "patarg",
"contextType" : "variable",
"element" : "period",
"variable" : "period",
"transform" : "create",
"parameter" : [
{
"valueString" : "Period"
}
]
}
],
"rule" : [
{
"name" : "val",
"source" : [
{
"context" : "time1"
}
],
"target" : [
{
"context" : "period",
"contextType" : "variable",
"element" : "start",
"variable" : "start",
"transform" : "create",
"parameter" : [
{
"valueString" : "dateTime"
}
]
}
],
"dependent" : [
{
"name" : "TSDateTime",
"variable" : [
"time1",
"start"
]
}
]
}
]
},
{
"name" : "time",
"source" : [
{
"context" : "part",
"element" : "time",
"variable" : "ti"
}
],
"target" : [
{
"context" : "patarg",
"contextType" : "variable",
"element" : "period",
"variable" : "period",
"transform" : "create",
"parameter" : [
{
"valueString" : "Period"
}
]
}
],
"dependent" : [
{
"name" : "IVLTSPeriod",
"variable" : [
"ti",
"period"
]
}
]
},
{
"name" : "partRole",
"source" : [
{
"context" : "part",
"element" : "participantRole",
"variable" : "partRole"
}
],
"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"
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "https://example/Practitioner/"
},
{
"valueId" : "uuid1"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "url",
"transform" : "append",
"parameter" : [
{
"valueString" : "Practitioner/"
},
{
"valueId" : "uuid1"
}
]
}
],
"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/Encounter/participant"
}
]
}
]
}
]
}
],
"documentation" : "modifica meta+identifier"
},
{
"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" : "uuid2"
}
]
},
{
"context" : "patarg",
"contextType" : "variable",
"element" : "individual",
"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" : "playEnt",
"source" : [
{
"context" : "partRole",
"element" : "playingEntity",
"variable" : "playEnt"
}
],
"rule" : [
{
"name" : "name",
"source" : [
{
"context" : "playEnt",
"element" : "name",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "practitioner",
"contextType" : "variable",
"element" : "name",
"variable" : "vvv",
"transform" : "create"
}
]
}
]
}
]
}
],
"documentation" : "enc.effectiveTime as eff -> encounter.period = create('Period') as period then{"
},
{
"name" : "participant2",
"source" : [
{
"context" : "enc",
"element" : "participant",
"variable" : "part",
"condition" : "(typeCode = 'LOC')"
}
],
"rule" : [
{
"name" : "location",
"source" : [
{
"context" : "part",
"element" : "time",
"variable" : "tim"
}
],
"target" : [
{
"context" : "encounter",
"contextType" : "variable",
"element" : "location",
"variable" : "locat"
}
],
"rule" : [
{
"name" : "time",
"source" : [
{
"context" : "tim"
}
],
"target" : [
{
"context" : "locat",
"contextType" : "variable",
"element" : "period",
"variable" : "period",
"transform" : "create",
"parameter" : [
{
"valueString" : "Period"
}
]
}
],
"dependent" : [
{
"name" : "IVLTSPeriod",
"variable" : [
"tim",
"period"
]
}
]
},
{
"name" : "time",
"source" : [
{
"context" : "part",
"element" : "time",
"variable" : "tim"
}
],
"target" : [
{
"context" : "locat",
"contextType" : "variable",
"element" : "period",
"variable" : "period",
"transform" : "create",
"parameter" : [
{
"valueString" : "Period"
}
]
}
],
"rule" : [
{
"name" : "val",
"source" : [
{
"context" : "tim"
}
],
"target" : [
{
"context" : "period",
"contextType" : "variable",
"element" : "start",
"variable" : "start",
"transform" : "create",
"parameter" : [
{
"valueString" : "dateTime"
}
]
}
],
"dependent" : [
{
"name" : "TSDateTime",
"variable" : [
"tim",
"start"
]
}
]
}
]
},
{
"name" : "partRole",
"source" : [
{
"context" : "part",
"element" : "participantRole",
"variable" : "partRole"
}
],
"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" : "location",
"transform" : "create",
"parameter" : [
{
"valueString" : "Location"
}
]
},
{
"context" : "location",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid1",
"transform" : "uuid"
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "https://example/Location/"
},
{
"valueId" : "uuid1"
}
]
}
],
"rule" : [
{
"name" : "meta",
"source" : [
{
"context" : "part"
}
],
"target" : [
{
"context" : "location",
"contextType" : "variable",
"element" : "meta",
"variable" : "meta"
}
],
"rule" : [
{
"name" : "coding",
"source" : [
{
"context" : "part"
}
],
"target" : [
{
"context" : "meta",
"contextType" : "variable",
"element" : "tag",
"variable" : "coding",
"transform" : "create",
"parameter" : [
{
"valueString" : "Coding"
}
]
}
],
"rule" : [
{
"name" : "system",
"source" : [
{
"context" : "part"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "system",
"transform" : "copy",
"parameter" : [
{
"valueString" : "http://algoritmodiscoring"
}
]
}
]
},
{
"name" : "code",
"source" : [
{
"context" : "part"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "code",
"transform" : "copy",
"parameter" : [
{
"valueString" : "ClinicalDocument/body/Encounter/participant"
}
]
}
]
}
]
}
]
},
{
"name" : "identifier",
"source" : [
{
"context" : "partRole",
"element" : "id",
"variable" : "id"
}
],
"target" : [
{
"context" : "location",
"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" : "partRole"
}
],
"target" : [
{
"context" : "request",
"contextType" : "variable",
"element" : "url",
"transform" : "append",
"parameter" : [
{
"valueString" : "Location?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" : "r",
"source" : [
{
"context" : "id",
"element" : "root",
"variable" : "r"
}
],
"rule" : [
{
"name" : "idasi",
"source" : [
{
"context" : "id",
"element" : "extension",
"variable" : "ext"
}
],
"target" : [
{
"context" : "location",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "r + '-' + ext"
}
]
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "https://example/Location/"
},
{
"valueId" : "uuid"
}
]
},
{
"context" : "locat",
"contextType" : "variable",
"element" : "location",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Location/' + %location.id"
}
]
}
]
}
]
}
]
},
{
"name" : "code",
"source" : [
{
"context" : "partRole",
"element" : "code",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "location",
"contextType" : "variable",
"element" : "type",
"variable" : "vvv",
"transform" : "create"
}
]
}
]
}
]
}
]
},
{
"name" : "entryRel-SUBJ",
"source" : [
{
"context" : "enc",
"element" : "entryRelationship",
"variable" : "entr"
}
],
"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" : "encounter",
"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" : "act",
"source" : [
{
"context" : "entr",
"element" : "act",
"variable" : "act"
}
],
"rule" : [
{
"name" : "code",
"source" : [
{
"context" : "act",
"element" : "code",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "observation",
"contextType" : "variable",
"element" : "code",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "reference",
"source" : [
{
"context" : "act"
}
],
"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" : "act"
}
],
"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/' + %enc1.id"
}
]
}
]
},
{
"name" : "statuscode",
"source" : [
{
"context" : "act",
"condition" : "act.statusCode.exists().not()"
}
],
"rule" : [
{
"name" : "status",
"source" : [
{
"context" : "act"
}
],
"target" : [
{
"context" : "observation",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "final"
}
]
}
]
}
]
},
{
"name" : "note",
"source" : [
{
"context" : "act"
}
],
"target" : [
{
"context" : "observation",
"contextType" : "variable",
"element" : "note",
"variable" : "note",
"transform" : "create",
"parameter" : [
{
"valueString" : "Annotation"
}
]
}
],
"rule" : [
{
"name" : "text",
"source" : [
{
"context" : "act",
"element" : "text",
"variable" : "text"
}
],
"rule" : [
{
"name" : "reference",
"source" : [
{
"context" : "text",
"element" : "reference",
"variable" : "reff"
}
],
"target" : [
{
"context" : "note",
"contextType" : "variable",
"element" : "text",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "reff.value"
}
]
}
]
}
]
},
{
"name" : "String",
"source" : [
{
"context" : "act",
"element" : "text",
"variable" : "tx"
}
],
"rule" : [
{
"name" : "val",
"source" : [
{
"context" : "tx",
"element" : "reference",
"variable" : "ref"
}
],
"target" : [
{
"context" : "note",
"contextType" : "variable",
"element" : "text",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "ref.value"
}
]
}
]
}
]
},
{
"name" : "practitioner",
"source" : [
{
"context" : "act",
"element" : "author",
"variable" : "auth"
}
],
"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"
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "https://example/Practitioner/"
},
{
"valueId" : "uuid1"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "url",
"transform" : "append",
"parameter" : [
{
"valueString" : "Practitioner/"
},
{
"valueId" : "uuid1"
}
]
}
],
"rule" : [
{
"name" : "notetime",
"source" : [
{
"context" : "auth",
"element" : "time",
"variable" : "ti"
}
],
"target" : [
{
"context" : "note",
"contextType" : "variable",
"element" : "time",
"variable" : "value",
"transform" : "create",
"parameter" : [
{
"valueString" : "dateTime"
}
]
}
],
"dependent" : [
{
"name" : "TSDateTime",
"variable" : [
"ti",
"value"
]
}
]
},
{
"name" : "assAush",
"source" : [
{
"context" : "auth",
"element" : "assignedAuthor",
"variable" : "assAuth"
}
],
"rule" : [
{
"name" : "meta",
"source" : [
{
"context" : "assAuth"
}
],
"target" : [
{
"context" : "practitioner",
"contextType" : "variable",
"element" : "meta",
"variable" : "meta"
}
],
"rule" : [
{
"name" : "coding",
"source" : [
{
"context" : "assAuth"
}
],
"target" : [
{
"context" : "meta",
"contextType" : "variable",
"element" : "tag",
"variable" : "coding",
"transform" : "create",
"parameter" : [
{
"valueString" : "Coding"
}
]
}
],
"rule" : [
{
"name" : "system",
"source" : [
{
"context" : "assAuth"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "system",
"transform" : "copy",
"parameter" : [
{
"valueString" : "http://algoritmodiscoring"
}
]
}
]
},
{
"name" : "code",
"source" : [
{
"context" : "assAuth"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "code",
"transform" : "copy",
"parameter" : [
{
"valueString" : "ClinicalDocument/body/Encounter/author"
}
]
}
]
}
]
}
]
},
{
"name" : "identifier",
"source" : [
{
"context" : "assAuth",
"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" : "uuid2"
}
]
},
{
"context" : "note",
"contextType" : "variable",
"element" : "author",
"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" : "assAuth",
"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" : "time",
"source" : [
{
"context" : "assAuth",
"element" : "time",
"variable" : "t"
}
],
"target" : [
{
"context" : "note",
"contextType" : "variable",
"element" : "text",
"variable" : "value",
"transform" : "create",
"parameter" : [
{
"valueString" : "dateTime"
}
]
}
],
"dependent" : [
{
"name" : "TSDateTime",
"variable" : [
"t",
"value"
]
}
],
"documentation" : "fine modifica"
},
{
"name" : "name",
"source" : [
{
"context" : "assAuth",
"element" : "assignedPerson",
"variable" : "assPers"
}
],
"rule" : [
{
"name" : "name",
"source" : [
{
"context" : "assPers",
"element" : "name",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "practitioner",
"contextType" : "variable",
"element" : "name",
"variable" : "vvv",
"transform" : "create"
}
]
}
]
}
]
}
]
}
]
}
]
}
]
}
]
}
]
}
]
},
{
"name" : "ClinicalDocumentSectionConsulenza",
"typeMode" : "none",
"documentation" : "--------------------------------------------------------------------------------------------------------\r\nSezione Consulenza--------------------------------------------------------------------------------------",
"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" : "entry-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" : "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" : "ServiceRequest",
"transform" : "create",
"parameter" : [
{
"valueString" : "ServiceRequest"
}
]
},
{
"context" : "ServiceRequest",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid8",
"transform" : "uuid"
},
{
"context" : "e8",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "https://example/ServiceRequest/"
},
{
"valueId" : "uuid8"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "url",
"transform" : "copy",
"parameter" : [
{
"valueString" : "ServiceRequest"
}
]
},
{
"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/ServiceRequest/' + %ServiceRequest.id"
}
]
}
],
"rule" : [
{
"name" : "reference",
"source" : [
{
"context" : "src"
}
],
"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" : "src"
}
],
"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/' + %enc.id"
}
]
}
]
},
{
"name" : "status",
"source" : [
{
"context" : "src"
}
],
"target" : [
{
"context" : "ServiceRequest",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "active"
}
]
}
]
},
{
"name" : "intent",
"source" : [
{
"context" : "src"
}
],
"target" : [
{
"context" : "ServiceRequest",
"contextType" : "variable",
"element" : "intent",
"transform" : "copy",
"parameter" : [
{
"valueString" : "order"
}
]
}
]
},
{
"name" : "reference",
"source" : [
{
"context" : "cdaText"
}
],
"target" : [
{
"context" : "ServiceRequest",
"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"
}
]
}
]
}
]
}
]
}
],
"documentation" : "Sezione Narrativa--------------------------------------------------------------------------------------------------------------------------------------------------"
},
{
"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" : "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" : "tgt",
"contextType" : "variable",
"element" : "entry",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/ServiceRequest/' + %serviceRequest.id"
}
]
},
{
"context" : "serviceRequest",
"contextType" : "variable",
"element" : "note",
"variable" : "note"
}
],
"rule" : [
{
"name" : "reference",
"source" : [
{
"context" : "entry1"
}
],
"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" : "entry1"
}
],
"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/' + %enc.id"
}
]
}
]
},
{
"name" : "status",
"source" : [
{
"context" : "entry1"
}
],
"target" : [
{
"context" : "serviceRequest",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "active"
}
]
}
]
},
{
"name" : "intent",
"source" : [
{
"context" : "entry1"
}
],
"target" : [
{
"context" : "serviceRequest",
"contextType" : "variable",
"element" : "intent",
"transform" : "copy",
"parameter" : [
{
"valueString" : "order"
}
]
}
]
},
{
"name" : "ACT",
"source" : [
{
"context" : "entry1",
"element" : "act",
"variable" : "act"
}
],
"rule" : [
{
"name" : "code",
"source" : [
{
"context" : "act",
"element" : "code",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "serviceRequest",
"contextType" : "variable",
"element" : "code",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "text",
"source" : [
{
"context" : "act",
"element" : "text",
"variable" : "t"
}
],
"target" : [
{
"context" : "note",
"contextType" : "variable",
"element" : "text",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "t.dataString"
}
]
}
]
},
{
"name" : "statusCode",
"source" : [
{
"context" : "act",
"element" : "statusCode",
"variable" : "code"
}
],
"target" : [
{
"context" : "serviceRequest",
"contextType" : "variable",
"element" : "status",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "code.code"
}
]
}
]
},
{
"name" : "performer",
"source" : [
{
"context" : "act",
"element" : "performer",
"variable" : "perf"
}
],
"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"
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "https://example/Practitioner/"
},
{
"valueId" : "uuid1"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "url",
"transform" : "append",
"parameter" : [
{
"valueString" : "Practitioner/"
},
{
"valueId" : "uuid1"
}
]
}
],
"rule" : [
{
"name" : "time",
"source" : [
{
"context" : "perf",
"element" : "time",
"variable" : "time"
}
],
"target" : [
{
"context" : "serviceRequest",
"contextType" : "variable",
"element" : "occurrence",
"variable" : "t",
"transform" : "create",
"parameter" : [
{
"valueString" : "dateTime"
}
]
}
],
"dependent" : [
{
"name" : "TSDateTime",
"variable" : [
"time",
"t"
]
}
]
},
{
"name" : "assEnt",
"source" : [
{
"context" : "perf",
"element" : "assignedEntity",
"variable" : "assEnt"
}
],
"rule" : [
{
"name" : "meta",
"source" : [
{
"context" : "assEnt"
}
],
"target" : [
{
"context" : "practitioner",
"contextType" : "variable",
"element" : "meta",
"variable" : "meta"
}
],
"rule" : [
{
"name" : "coding",
"source" : [
{
"context" : "assEnt"
}
],
"target" : [
{
"context" : "meta",
"contextType" : "variable",
"element" : "tag",
"variable" : "coding",
"transform" : "create",
"parameter" : [
{
"valueString" : "Coding"
}
]
}
],
"rule" : [
{
"name" : "system",
"source" : [
{
"context" : "assEnt"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "system",
"transform" : "copy",
"parameter" : [
{
"valueString" : "http://algoritmodiscoring"
}
]
}
]
},
{
"name" : "code",
"source" : [
{
"context" : "assEnt"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "code",
"transform" : "copy",
"parameter" : [
{
"valueString" : "ClinicalDocument/body/Consulenze/performer"
}
]
}
]
}
]
}
]
},
{
"name" : "identifier",
"source" : [
{
"context" : "assEnt",
"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" : "uuid2"
}
]
},
{
"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" : "assEnt",
"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" : "assPer",
"source" : [
{
"context" : "assEnt",
"element" : "assignedPerson",
"variable" : "assPer"
}
],
"rule" : [
{
"name" : "name",
"source" : [
{
"context" : "assPer",
"element" : "name",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "practitioner",
"contextType" : "variable",
"element" : "name",
"variable" : "vvv",
"transform" : "create"
}
]
}
]
}
]
}
]
},
{
"name" : "participant",
"source" : [
{
"context" : "act",
"element" : "participant",
"variable" : "parti"
}
],
"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"
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "https://example/Practitioner/"
},
{
"valueId" : "uuid1"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "url",
"transform" : "append",
"parameter" : [
{
"valueString" : "Practitioner/"
},
{
"valueId" : "uuid1"
}
]
}
],
"rule" : [
{
"name" : "time",
"source" : [
{
"context" : "parti",
"element" : "time",
"variable" : "time"
}
],
"target" : [
{
"context" : "serviceRequest",
"contextType" : "variable",
"element" : "authoredOn",
"variable" : "t",
"transform" : "create",
"parameter" : [
{
"valueString" : "dateTime"
}
]
}
],
"dependent" : [
{
"name" : "TSDateTime",
"variable" : [
"time",
"t"
]
}
]
},
{
"name" : "partRole",
"source" : [
{
"context" : "parti",
"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/Consulenze/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" : "uuid2"
}
]
},
{
"context" : "serviceRequest",
"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" : "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" : "entity",
"source" : [
{
"context" : "partRole",
"element" : "playingEntity",
"variable" : "entity"
}
],
"rule" : [
{
"name" : "name",
"source" : [
{
"context" : "entity",
"element" : "name",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "practitioner",
"contextType" : "variable",
"element" : "name",
"variable" : "vvv",
"transform" : "create"
}
]
}
]
}
]
}
]
}
]
}
],
"documentation" : "Sezione Strutturata--------------------------------------------------------------------------------------------------------------------------------------------"
}
]
},
{
"name" : "ClinicalDocumentSectionAccertamenti",
"typeMode" : "none",
"documentation" : "---------------------------------------------------------------------------------------------------------\r\nSezione Accertamenti--------------------------------------------------------------------------------------",
"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" : "entryExists",
"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" : "obs",
"source" : [
{
"context" : "entry1",
"element" : "organizer",
"variable" : "obs"
}
],
"rule" : [
{
"name" : "code",
"source" : [
{
"context" : "src",
"element" : "code",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "observation",
"contextType" : "variable",
"element" : "code",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "act",
"source" : [
{
"context" : "obs"
}
],
"dependent" : [
{
"name" : "ObservationAccertamenti",
"variable" : [
"obs",
"patient",
"enc",
"observation",
"bundle"
]
}
]
}
]
}
],
"documentation" : "Sezione Strutturata---------------------------------------------------------------------------------------------------------------------------------------------"
},
{
"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"
}
]
}
]
}
]
}
]
}
],
"documentation" : "Sezione Narrativa--------------------------------------------------------------------------------------------------------------------------------------------"
}
]
},
{
"name" : "ObservationAccertamenti",
"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" : "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" : "effectiveTime",
"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" : "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" : "qual",
"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" : "qual",
"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" : "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" : "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" : "IVL-PQ",
"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"
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "https://example/Practitioner/"
},
{
"valueId" : "uuid1"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "url",
"transform" : "append",
"parameter" : [
{
"valueString" : "Practitioner/"
},
{
"valueId" : "uuid1"
}
]
}
],
"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/Accertamenti/performer"
}
]
}
]
}
]
}
],
"documentation" : "inizio modifica identifier+meta"
},
{
"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" : "request",
"contextType" : "variable",
"element" : "url",
"transform" : "append",
"parameter" : [
{
"valueString" : "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"
}
]
}
],
"documentation" : "fine modifica"
}
]
}
]
},
{
"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" : "value2",
"source" : [
{
"context" : "participant",
"element" : "time",
"variable" : "t"
}
],
"target" : [
{
"context" : "serviceRequest",
"contextType" : "variable",
"element" : "authoredOn",
"variable" : "value",
"transform" : "create",
"parameter" : [
{
"valueString" : "dateTime"
}
]
}
],
"dependent" : [
{
"name" : "TSDateTime",
"variable" : [
"t",
"value"
]
}
],
"documentation" : "participant.time as t -> serviceRequest.authoredOn = (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"
}
]
},
{
"context" : "practitioner",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid1",
"transform" : "uuid"
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "https://example/Practitioner/"
},
{
"valueId" : "uuid1"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "url",
"transform" : "append",
"parameter" : [
{
"valueString" : "Practitioner/"
},
{
"valueId" : "uuid1"
}
]
}
],
"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/Accertamenti/participant"
}
]
}
]
}
]
}
],
"documentation" : "modifica meta+identifier"
},
{
"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" : "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" : "uuid2"
}
]
},
{
"context" : "serviceRequest",
"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" : "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"
}
]
}
],
"documentation" : "fine modifica"
}
]
}
]
},
{
"name" : "observation",
"source" : [
{
"context" : "obs",
"element" : "component",
"variable" : "comp"
}
],
"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" : "ob",
"contextType" : "variable",
"element" : "hasMember",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Observation/' + %observation.id"
}
]
}
],
"rule" : [
{
"name" : "obs",
"source" : [
{
"context" : "comp",
"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",
"element" : "statusCode",
"variable" : "statusc",
"condition" : "(code = 'completed')"
}
],
"target" : [
{
"context" : "observation",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "final"
}
]
}
]
},
{
"name" : "statusCode",
"source" : [
{
"context" : "obs",
"element" : "statusCode",
"variable" : "statusc",
"condition" : "(code = 'active')"
}
],
"target" : [
{
"context" : "observation",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "registered"
}
]
}
]
},
{
"name" : "statusCode",
"source" : [
{
"context" : "obs",
"element" : "statusCode",
"variable" : "statusc",
"condition" : "(code = 'aborted')"
}
],
"target" : [
{
"context" : "observation",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "cancelled"
}
]
}
]
},
{
"name" : "statusCode",
"source" : [
{
"context" : "obs",
"element" : "statusCode",
"variable" : "statusc",
"condition" : "(code = 'suspended')"
}
],
"target" : [
{
"context" : "observation",
"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" : "observation",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "final"
}
]
}
]
}
]
},
{
"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/' + %encounter.id"
}
]
}
]
},
{
"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" : "effectiveTime",
"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",
"element" : "value",
"variable" : "val"
}
],
"target" : [
{
"context" : "observation",
"contextType" : "variable",
"element" : "value",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "val.dataString"
}
]
}
]
}
]
}
]
}
]
},
{
"name" : "ClinicalDocumentSectionParametriVitali",
"typeMode" : "none",
"documentation" : "-----------------------------------------------------------------------------------------------------------\r\nSezione ParametriVitali--------------------------------------------------------------------------------------",
"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" : "entry-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" : "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"
}
]
}
]
}
]
}
]
}
],
"documentation" : "Sezione Narrativa----------------------------------------------------------------------------------------------------------------------------------------------------"
},
{
"name" : "Observation",
"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" : "obs",
"source" : [
{
"context" : "entry1",
"element" : "organizer",
"variable" : "org"
}
],
"rule" : [
{
"name" : "reference",
"source" : [
{
"context" : "org"
}
],
"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" : "org"
}
],
"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" : "org",
"element" : "statusCode",
"variable" : "statusc",
"condition" : "(code = 'completed')"
}
],
"target" : [
{
"context" : "observation",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "final"
}
]
}
]
},
{
"name" : "statusCode",
"source" : [
{
"context" : "org",
"element" : "statusCode",
"variable" : "statusc",
"condition" : "(code = 'active')"
}
],
"target" : [
{
"context" : "observation",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "registered"
}
]
}
]
},
{
"name" : "statusCode",
"source" : [
{
"context" : "org",
"element" : "statusCode",
"variable" : "statusc",
"condition" : "(code = 'aborted')"
}
],
"target" : [
{
"context" : "observation",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "cancelled"
}
]
}
]
},
{
"name" : "statusCode",
"source" : [
{
"context" : "org",
"element" : "statusCode",
"variable" : "statusc",
"condition" : "(code = 'suspended')"
}
],
"target" : [
{
"context" : "observation",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "partial"
}
]
}
]
},
{
"name" : "statuscode",
"source" : [
{
"context" : "org",
"condition" : "obs.statusCode.exists().not()"
}
],
"rule" : [
{
"name" : "status",
"source" : [
{
"context" : "org"
}
],
"target" : [
{
"context" : "observation",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "final"
}
]
}
]
}
]
},
{
"name" : "code",
"source" : [
{
"context" : "org",
"element" : "code",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "observation",
"contextType" : "variable",
"element" : "code",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "code",
"source" : [
{
"context" : "org",
"condition" : "org.code.exists().not()"
}
],
"rule" : [
{
"name" : "code",
"source" : [
{
"context" : "src",
"element" : "code",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "observation",
"contextType" : "variable",
"element" : "code",
"variable" : "vvv",
"transform" : "create"
}
]
}
]
},
{
"name" : "component",
"source" : [
{
"context" : "org",
"element" : "component",
"variable" : "component"
}
],
"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" : "observation1",
"transform" : "create",
"parameter" : [
{
"valueString" : "Observation"
}
]
},
{
"context" : "observation1",
"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" : "observation",
"contextType" : "variable",
"element" : "hasMember",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Observation/' + %observation1.id"
}
]
}
],
"rule" : [
{
"name" : "obs",
"source" : [
{
"context" : "component",
"element" : "observation",
"variable" : "obs"
}
],
"rule" : [
{
"name" : "reference",
"source" : [
{
"context" : "obs"
}
],
"target" : [
{
"context" : "observation1",
"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" : "observation1",
"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" : "obs",
"element" : "code",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "observation1",
"contextType" : "variable",
"element" : "code",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "statusCode",
"source" : [
{
"context" : "obs",
"element" : "statusCode",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "observation1",
"contextType" : "variable",
"element" : "status",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "statusCode",
"source" : [
{
"context" : "obs",
"element" : "statusCode",
"variable" : "statusc",
"condition" : "(code = 'completed')"
}
],
"target" : [
{
"context" : "observation1",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "final"
}
]
}
]
},
{
"name" : "statusCode",
"source" : [
{
"context" : "obs",
"element" : "statusCode",
"variable" : "statusc",
"condition" : "(code = 'active')"
}
],
"target" : [
{
"context" : "observation1",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "registered"
}
]
}
]
},
{
"name" : "statusCode",
"source" : [
{
"context" : "obs",
"element" : "statusCode",
"variable" : "statusc",
"condition" : "(code = 'aborted')"
}
],
"target" : [
{
"context" : "observation1",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "cancelled"
}
]
}
]
},
{
"name" : "statusCode",
"source" : [
{
"context" : "obs",
"element" : "statusCode",
"variable" : "statusc",
"condition" : "(code = 'suspended')"
}
],
"target" : [
{
"context" : "observation1",
"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" : "observation1",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "final"
}
]
}
]
}
]
},
{
"name" : "quant",
"source" : [
{
"context" : "obs"
}
],
"target" : [
{
"context" : "observation1",
"contextType" : "variable",
"element" : "value",
"variable" : "quant",
"transform" : "create",
"parameter" : [
{
"valueString" : "Quantity"
}
]
}
],
"rule" : [
{
"name" : "value",
"source" : [
{
"context" : "obs",
"element" : "value",
"variable" : "v"
}
],
"target" : [
{
"context" : "quant",
"contextType" : "variable",
"element" : "value",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "v.value"
}
]
}
]
},
{
"name" : "value",
"source" : [
{
"context" : "obs",
"element" : "value",
"variable" : "v"
}
],
"target" : [
{
"context" : "quant",
"contextType" : "variable",
"element" : "unit",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "v.unit"
}
]
}
]
}
]
},
{
"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" : "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" : "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" : "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" : "interpretationCode",
"source" : [
{
"context" : "obs",
"element" : "interpretationCode",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "observation1",
"contextType" : "variable",
"element" : "interpretation",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "methodCode",
"source" : [
{
"context" : "obs",
"element" : "methodCode",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "observation1",
"contextType" : "variable",
"element" : "method",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "targetSiteCode",
"source" : [
{
"context" : "obs",
"element" : "targetSiteCode",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "observation1",
"contextType" : "variable",
"element" : "bodySite",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "performer",
"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"
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "https://example/Practitioner/"
},
{
"valueId" : "uuid1"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "url",
"transform" : "append",
"parameter" : [
{
"valueString" : "Practitioner/"
},
{
"valueId" : "uuid1"
}
]
}
],
"rule" : [
{
"name" : "time",
"source" : [
{
"context" : "performer",
"element" : "time",
"variable" : "t"
}
],
"target" : [
{
"context" : "observation1",
"contextType" : "variable",
"element" : "issued",
"variable" : "date",
"transform" : "create",
"parameter" : [
{
"valueString" : "dateTime"
}
]
}
],
"dependent" : [
{
"name" : "TSDateTime",
"variable" : [
"t",
"date"
]
}
]
},
{
"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/ParametriVitali/performer"
}
]
}
]
}
]
}
],
"documentation" : "inizio modifica meta+ identifier"
},
{
"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" : "request",
"contextType" : "variable",
"element" : "url",
"transform" : "append",
"parameter" : [
{
"valueString" : "Practitioner/"
},
{
"valueId" : "uuid2"
}
]
},
{
"context" : "observation1",
"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" : "assPerson",
"source" : [
{
"context" : "assEntity",
"element" : "assignedPerson",
"variable" : "assPerson"
}
],
"rule" : [
{
"name" : "name",
"source" : [
{
"context" : "assPerson",
"element" : "name",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "practitioner",
"contextType" : "variable",
"element" : "name",
"variable" : "vvv",
"transform" : "create"
}
]
}
],
"documentation" : "fine modifica"
}
]
}
]
},
{
"name" : "parti",
"source" : [
{
"context" : "obs",
"element" : "participant",
"variable" : "parti"
}
],
"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" : "observation1",
"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" : "reference",
"source" : [
{
"context" : "parti"
}
],
"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" : "parti"
}
],
"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/' + %enc.id"
}
]
}
]
},
{
"name" : "status",
"source" : [
{
"context" : "parti"
}
],
"target" : [
{
"context" : "serviceRequest",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "active"
}
]
}
]
},
{
"name" : "intent",
"source" : [
{
"context" : "parti"
}
],
"target" : [
{
"context" : "serviceRequest",
"contextType" : "variable",
"element" : "intent",
"transform" : "copy",
"parameter" : [
{
"valueString" : "order"
}
]
}
]
},
{
"name" : "value2",
"source" : [
{
"context" : "parti",
"element" : "time",
"variable" : "t"
}
],
"target" : [
{
"context" : "serviceRequest",
"contextType" : "variable",
"element" : "authoredOn",
"variable" : "value",
"transform" : "create",
"parameter" : [
{
"valueString" : "dateTime"
}
]
}
],
"dependent" : [
{
"name" : "TSDateTime",
"variable" : [
"t",
"value"
]
}
]
},
{
"name" : "partRole",
"source" : [
{
"context" : "parti",
"element" : "participantRole",
"variable" : "partRole"
}
],
"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"
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "https://example/Practitioner/"
},
{
"valueId" : "uuid1"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "url",
"transform" : "append",
"parameter" : [
{
"valueString" : "Practitioner/"
},
{
"valueId" : "uuid1"
}
]
}
],
"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/ParametriVitali/participant"
}
]
}
]
}
]
}
],
"documentation" : "inizio modifica meta + identifier"
},
{
"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" : "uuid2"
}
]
},
{
"context" : "serviceRequest",
"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" : "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" : "name",
"source" : [
{
"context" : "partRole",
"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"
}
]
}
],
"documentation" : "fine modifica"
}
]
}
]
}
]
}
]
}
]
}
],
"documentation" : "Sezione Strutturata --------------------------------------------------------------------------------------------------------------------------------------------------------"
}
]
},
{
"name" : "ClinicalDocumentSectionTerapiaFarmacoInPronto",
"typeMode" : "none",
"documentation" : "-----------------------------------------------------------------------------------------------------------------\r\nSezione terapia Farma in Pronto----------------------------------------------------------------------------------",
"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" : "entry-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" : "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" : "MedicationAdministration",
"transform" : "create",
"parameter" : [
{
"valueString" : "MedicationAdministration"
}
]
},
{
"context" : "MedicationAdministration",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid8",
"transform" : "uuid"
},
{
"context" : "e8",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "https://example/MedicationAdministration/"
},
{
"valueId" : "uuid8"
}
]
},
{
"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/' + %MedicationAdministration.id"
}
]
}
],
"rule" : [
{
"name" : "reference",
"source" : [
{
"context" : "src"
}
],
"target" : [
{
"context" : "MedicationAdministration",
"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" : "MedicationAdministration",
"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" : "Period",
"source" : [
{
"context" : "src"
}
],
"target" : [
{
"context" : "MedicationAdministration",
"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" : "MedicationAdministration",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "completed"
}
]
}
]
}
]
},
{
"name" : "reference",
"source" : [
{
"context" : "cdaText"
}
],
"target" : [
{
"context" : "MedicationAdministration",
"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" : "medication",
"source" : [
{
"context" : "cdaText"
}
],
"target" : [
{
"context" : "MedicationAdministration",
"contextType" : "variable",
"element" : "medication",
"variable" : "medication",
"transform" : "create",
"parameter" : [
{
"valueString" : "CodeableConcept"
}
]
}
],
"rule" : [
{
"name" : "text",
"source" : [
{
"context" : "cdaText",
"variable" : "txt"
}
],
"target" : [
{
"context" : "medication",
"contextType" : "variable",
"element" : "text",
"transform" : "copy",
"parameter" : [
{
"valueId" : "txt"
}
]
}
]
}
]
}
]
}
]
}
],
"documentation" : "Sezione Narrativa------------------------------------------------------------------------------------------------------------------------------------------------"
},
{
"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" : "medAdm",
"transform" : "create",
"parameter" : [
{
"valueString" : "MedicationAdministration"
}
]
},
{
"context" : "medAdm",
"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/' + %medAdm.id"
}
]
},
{
"context" : "medAdm",
"contextType" : "variable",
"element" : "note",
"variable" : "note"
}
],
"rule" : [
{
"name" : "reference",
"source" : [
{
"context" : "entry1"
}
],
"target" : [
{
"context" : "medAdm",
"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" : "medAdm",
"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" : "MedAdm",
"source" : [
{
"context" : "entry1",
"element" : "substanceAdministration",
"variable" : "sub"
}
],
"rule" : [
{
"name" : "txx",
"source" : [
{
"context" : "sub",
"element" : "text",
"variable" : "tx"
}
],
"rule" : [
{
"name" : "reference",
"source" : [
{
"context" : "tx",
"element" : "reference",
"variable" : "reff"
}
],
"target" : [
{
"context" : "note",
"contextType" : "variable",
"element" : "text",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "reff.value"
}
]
}
]
}
]
},
{
"name" : "statusCode",
"source" : [
{
"context" : "sub",
"element" : "statusCode",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "medAdm",
"contextType" : "variable",
"element" : "status",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "effectiveTime",
"source" : [
{
"context" : "sub",
"element" : "effectiveTime",
"variable" : "eff"
}
],
"target" : [
{
"context" : "medAdm",
"contextType" : "variable",
"element" : "effective",
"variable" : "period",
"transform" : "create",
"parameter" : [
{
"valueString" : "Period"
}
]
}
],
"dependent" : [
{
"name" : "IVLTSPeriod",
"variable" : [
"eff",
"period"
]
}
],
"documentation" : "sub.effectiveTime: IVL_TS as eff -> medAdm.effective =create('Period') as period then IVLTSPeriod(eff,period); CHECK THIS"
},
{
"name" : "eff2",
"source" : [
{
"context" : "sub",
"type" : "PIVL_TS",
"element" : "effectiveTime",
"variable" : "eff"
}
],
"target" : [
{
"context" : "medAdm",
"contextType" : "variable",
"element" : "dosage",
"variable" : "dosage"
}
],
"rule" : [
{
"name" : "ratio",
"source" : [
{
"context" : "eff"
}
],
"target" : [
{
"context" : "dosage",
"contextType" : "variable",
"element" : "rate",
"variable" : "ratio",
"transform" : "create",
"parameter" : [
{
"valueString" : "Ratio"
}
]
}
],
"rule" : [
{
"name" : "num",
"source" : [
{
"context" : "eff"
}
],
"target" : [
{
"context" : "ratio",
"contextType" : "variable",
"element" : "numerator",
"variable" : "num",
"transform" : "create",
"parameter" : [
{
"valueString" : "Quantity"
}
]
}
],
"rule" : [
{
"name" : "period",
"source" : [
{
"context" : "eff",
"element" : "period",
"variable" : "per"
}
],
"target" : [
{
"context" : "num",
"contextType" : "variable",
"element" : "value",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "per.value"
}
]
}
]
},
{
"name" : "period",
"source" : [
{
"context" : "eff",
"element" : "period",
"variable" : "per"
}
],
"target" : [
{
"context" : "num",
"contextType" : "variable",
"element" : "unit",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "per.unit"
}
]
}
]
}
]
},
{
"name" : "den",
"source" : [
{
"context" : "eff"
}
],
"target" : [
{
"context" : "ratio",
"contextType" : "variable",
"element" : "denominator",
"variable" : "num",
"transform" : "create",
"parameter" : [
{
"valueString" : "Quantity"
}
]
}
],
"rule" : [
{
"name" : "period",
"source" : [
{
"context" : "eff",
"element" : "period",
"variable" : "per"
}
],
"target" : [
{
"context" : "num",
"contextType" : "variable",
"element" : "value",
"transform" : "copy",
"parameter" : [
{
"valueString" : "1"
}
]
}
]
},
{
"name" : "period",
"source" : [
{
"context" : "eff",
"element" : "period",
"variable" : "per"
}
],
"target" : [
{
"context" : "num",
"contextType" : "variable",
"element" : "unit",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "per.unit"
}
]
}
]
}
]
}
]
}
]
},
{
"name" : "route",
"source" : [
{
"context" : "sub"
}
],
"target" : [
{
"context" : "medAdm",
"contextType" : "variable",
"element" : "dosage",
"variable" : "dosage"
}
],
"rule" : [
{
"name" : "routeCode",
"source" : [
{
"context" : "sub",
"element" : "routeCode",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "dosage",
"contextType" : "variable",
"element" : "route",
"variable" : "vvv",
"transform" : "create"
}
]
}
]
},
{
"name" : "route",
"source" : [
{
"context" : "sub"
}
],
"target" : [
{
"context" : "medAdm",
"contextType" : "variable",
"element" : "dosage",
"variable" : "dosage"
}
],
"rule" : [
{
"name" : "approachSiteCode",
"source" : [
{
"context" : "sub",
"element" : "approachSiteCode",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "dosage",
"contextType" : "variable",
"element" : "site",
"variable" : "vvv",
"transform" : "create"
}
]
}
]
},
{
"name" : "medicationRequest",
"source" : [
{
"context" : "sub"
}
],
"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" : "medRq",
"transform" : "create",
"parameter" : [
{
"valueString" : "MedicationRequest"
}
]
},
{
"context" : "medRq",
"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" : "medAdm",
"contextType" : "variable",
"element" : "request",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/MedicationRequest/' + %medRq.id"
}
]
}
],
"rule" : [
{
"name" : "rel",
"source" : [
{
"context" : "sub",
"element" : "entryRelationship",
"variable" : "rel"
}
],
"rule" : [
{
"name" : "obs",
"source" : [
{
"context" : "rel",
"element" : "supply",
"variable" : "supl"
}
],
"target" : [
{
"context" : "medRq",
"contextType" : "variable",
"element" : "dispenseRequest",
"variable" : "disp",
"transform" : "create",
"parameter" : [
{
"valueString" : "BackboneElement"
}
]
}
],
"rule" : [
{
"name" : "SimpleQuantity",
"source" : [
{
"context" : "supl"
}
],
"target" : [
{
"context" : "disp",
"contextType" : "variable",
"element" : "quantity",
"variable" : "q",
"transform" : "create",
"parameter" : [
{
"valueString" : "SimpleQuantity"
}
]
}
],
"rule" : [
{
"name" : "fds",
"source" : [
{
"context" : "supl",
"element" : "quantity",
"variable" : "qua"
}
],
"target" : [
{
"context" : "q",
"contextType" : "variable",
"element" : "value",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "qua.value"
}
]
}
]
}
]
}
]
}
]
},
{
"name" : "reference",
"source" : [
{
"context" : "sub"
}
],
"target" : [
{
"context" : "medRq",
"contextType" : "variable",
"element" : "subject",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Patient/' + %patient.id"
}
]
}
]
},
{
"name" : "reference",
"source" : [
{
"context" : "sub"
}
],
"target" : [
{
"context" : "medRq",
"contextType" : "variable",
"element" : "encounter",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Encounter/' + %enc.id"
}
]
}
]
},
{
"name" : "status",
"source" : [
{
"context" : "sub"
}
],
"target" : [
{
"context" : "medRq",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "active"
}
]
}
]
},
{
"name" : "intent",
"source" : [
{
"context" : "sub"
}
],
"target" : [
{
"context" : "medRq",
"contextType" : "variable",
"element" : "intent",
"transform" : "copy",
"parameter" : [
{
"valueString" : "order"
}
]
}
]
},
{
"name" : "code",
"source" : [
{
"context" : "sub"
}
],
"target" : [
{
"context" : "medRq",
"contextType" : "variable",
"element" : "medication",
"variable" : "cod",
"transform" : "create",
"parameter" : [
{
"valueString" : "CodeableConcept"
}
]
}
],
"rule" : [
{
"name" : "Medi",
"source" : [
{
"context" : "sub"
}
],
"target" : [
{
"context" : "cod",
"contextType" : "variable",
"element" : "text",
"transform" : "copy",
"parameter" : [
{
"valueString" : "medication"
}
]
}
]
}
]
},
{
"name" : "dose-quantity",
"source" : [
{
"context" : "sub",
"element" : "doseQuantity",
"variable" : "quantity"
}
],
"rule" : [
{
"name" : "dosage",
"source" : [
{
"context" : "quantity"
}
],
"target" : [
{
"context" : "medRq",
"contextType" : "variable",
"element" : "dosageInstruction",
"variable" : "dosage",
"transform" : "create",
"parameter" : [
{
"valueString" : "Dosage"
}
]
}
],
"rule" : [
{
"name" : "dos",
"source" : [
{
"context" : "quantity"
}
],
"target" : [
{
"context" : "dosage",
"contextType" : "variable",
"element" : "doseAndRate",
"variable" : "dosRange"
}
],
"rule" : [
{
"name" : "range",
"source" : [
{
"context" : "quantity"
}
],
"target" : [
{
"context" : "dosRange",
"contextType" : "variable",
"element" : "dose",
"variable" : "range",
"transform" : "create",
"parameter" : [
{
"valueString" : "Range"
}
]
}
],
"rule" : [
{
"name" : "low",
"source" : [
{
"context" : "quantity"
}
],
"target" : [
{
"context" : "range",
"contextType" : "variable",
"element" : "low",
"variable" : "quant",
"transform" : "create",
"parameter" : [
{
"valueString" : "SimpleQuantity"
}
]
}
],
"rule" : [
{
"name" : "v1",
"source" : [
{
"context" : "quantity",
"element" : "low",
"variable" : "l"
}
],
"target" : [
{
"context" : "quant",
"contextType" : "variable",
"element" : "value",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "l.value"
}
]
}
]
},
{
"name" : "v1",
"source" : [
{
"context" : "quantity",
"element" : "low",
"variable" : "l"
}
],
"target" : [
{
"context" : "quant",
"contextType" : "variable",
"element" : "unit",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "l.unit"
}
]
}
]
}
]
},
{
"name" : "high",
"source" : [
{
"context" : "quantity"
}
],
"target" : [
{
"context" : "range",
"contextType" : "variable",
"element" : "high",
"variable" : "quant",
"transform" : "create",
"parameter" : [
{
"valueString" : "SimpleQuantity"
}
]
}
],
"rule" : [
{
"name" : "v1",
"source" : [
{
"context" : "quantity",
"element" : "high",
"variable" : "h"
}
],
"target" : [
{
"context" : "quant",
"contextType" : "variable",
"element" : "value",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "h.value"
}
]
}
]
},
{
"name" : "v1",
"source" : [
{
"context" : "quantity",
"element" : "high",
"variable" : "h"
}
],
"target" : [
{
"context" : "quant",
"contextType" : "variable",
"element" : "unit",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "h.unit"
}
]
}
]
}
]
}
]
}
]
}
]
}
]
},
{
"name" : "Rate-quantity",
"source" : [
{
"context" : "sub",
"element" : "rateQuantity",
"variable" : "rate"
}
],
"rule" : [
{
"name" : "dosage",
"source" : [
{
"context" : "rate"
}
],
"target" : [
{
"context" : "medRq",
"contextType" : "variable",
"element" : "dosageInstruction",
"variable" : "dosage",
"transform" : "create",
"parameter" : [
{
"valueString" : "Dosage"
}
]
}
],
"rule" : [
{
"name" : "dos",
"source" : [
{
"context" : "rate"
}
],
"target" : [
{
"context" : "dosage",
"contextType" : "variable",
"element" : "doseAndRate",
"variable" : "dosRange"
}
],
"rule" : [
{
"name" : "range",
"source" : [
{
"context" : "rate"
}
],
"target" : [
{
"context" : "dosRange",
"contextType" : "variable",
"element" : "dose",
"variable" : "range",
"transform" : "create",
"parameter" : [
{
"valueString" : "Range"
}
]
}
],
"rule" : [
{
"name" : "low",
"source" : [
{
"context" : "rate"
}
],
"target" : [
{
"context" : "range",
"contextType" : "variable",
"element" : "low",
"variable" : "quant",
"transform" : "create",
"parameter" : [
{
"valueString" : "SimpleQuantity"
}
]
}
],
"rule" : [
{
"name" : "v1",
"source" : [
{
"context" : "rate",
"element" : "low",
"variable" : "l"
}
],
"target" : [
{
"context" : "quant",
"contextType" : "variable",
"element" : "value",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "l.value"
}
]
}
]
},
{
"name" : "v1",
"source" : [
{
"context" : "rate",
"element" : "low",
"variable" : "l"
}
],
"target" : [
{
"context" : "quant",
"contextType" : "variable",
"element" : "unit",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "l.unit"
}
]
}
]
}
]
},
{
"name" : "high",
"source" : [
{
"context" : "rate"
}
],
"target" : [
{
"context" : "range",
"contextType" : "variable",
"element" : "high",
"variable" : "quant",
"transform" : "create",
"parameter" : [
{
"valueString" : "SimpleQuantity"
}
]
}
],
"rule" : [
{
"name" : "v1",
"source" : [
{
"context" : "rate",
"element" : "high",
"variable" : "h"
}
],
"target" : [
{
"context" : "quant",
"contextType" : "variable",
"element" : "value",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "h.value"
}
]
}
]
},
{
"name" : "v1",
"source" : [
{
"context" : "rate",
"element" : "high",
"variable" : "h"
}
],
"target" : [
{
"context" : "quant",
"contextType" : "variable",
"element" : "unit",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "h.unit"
}
]
}
]
}
]
}
]
}
]
}
]
}
]
},
{
"name" : "part",
"source" : [
{
"context" : "sub",
"element" : "participant",
"variable" : "part"
}
],
"rule" : [
{
"name" : "time",
"source" : [
{
"context" : "part",
"element" : "time",
"variable" : "t"
}
],
"target" : [
{
"context" : "medRq",
"contextType" : "variable",
"element" : "authoredOn",
"variable" : "date",
"transform" : "create",
"parameter" : [
{
"valueString" : "dateTime"
}
]
}
],
"dependent" : [
{
"name" : "TSDateTime",
"variable" : [
"t",
"date"
]
}
]
},
{
"name" : "Part",
"source" : [
{
"context" : "part",
"element" : "participantRole",
"variable" : "partRole"
}
],
"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"
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "https://example/Practitioner/"
},
{
"valueId" : "uuid1"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "url",
"transform" : "append",
"parameter" : [
{
"valueString" : "Practitioner/"
},
{
"valueId" : "uuid1"
}
]
}
],
"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/TerapiaFarmacologicaPS/participant"
}
]
}
]
}
]
}
],
"documentation" : "inizio meta+identifier"
},
{
"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" : "uuid2"
}
]
},
{
"context" : "medRq",
"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" : "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" : "id",
"source" : [
{
"context" : "partRole",
"element" : "id",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "practitioner",
"contextType" : "variable",
"element" : "identifier",
"variable" : "vvv",
"transform" : "create"
}
],
"documentation" : "fine modifiche"
},
{
"name" : "play",
"source" : [
{
"context" : "partRole",
"element" : "playingEntity",
"variable" : "play"
}
],
"rule" : [
{
"name" : "name",
"source" : [
{
"context" : "play",
"element" : "name",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "practitioner",
"contextType" : "variable",
"element" : "name",
"variable" : "vvv",
"transform" : "create"
}
]
}
]
}
]
}
]
}
]
},
{
"name" : "med",
"source" : [
{
"context" : "sub"
}
],
"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" : "med",
"transform" : "create",
"parameter" : [
{
"valueString" : "Medication"
}
]
},
{
"context" : "med",
"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" : "medAdm",
"contextType" : "variable",
"element" : "medication",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Medication/' + %med.id"
}
]
}
],
"rule" : [
{
"name" : "unicode",
"source" : [
{
"context" : "sub",
"element" : "administrationUnitCode",
"variable" : "adduni"
}
],
"rule" : [
{
"name" : "administrationUnitCode",
"source" : [
{
"context" : "sub",
"element" : "administrationUnitCode",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "med",
"contextType" : "variable",
"element" : "form",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "consum",
"source" : [
{
"context" : "sub",
"element" : "consumable",
"variable" : "consum"
}
],
"rule" : [
{
"name" : "manuMat",
"source" : [
{
"context" : "consum",
"element" : "manufacturedProduct",
"variable" : "manuProd"
}
],
"rule" : [
{
"name" : "manuMat",
"source" : [
{
"context" : "manuProd",
"element" : "manufacturedMaterial",
"variable" : "manuMt"
}
],
"rule" : [
{
"name" : "code",
"source" : [
{
"context" : "manuMt",
"element" : "code",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "med",
"contextType" : "variable",
"element" : "code",
"variable" : "vvv",
"transform" : "create"
}
]
}
]
}
]
}
]
}
]
},
{
"name" : "entry-R",
"source" : [
{
"context" : "sub",
"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" : "med",
"contextType" : "variable",
"element" : "ingredient",
"variable" : "ingredient"
}
],
"rule" : [
{
"name" : "consumable",
"source" : [
{
"context" : "sub",
"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" : "med",
"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" : "perform",
"source" : [
{
"context" : "sub",
"element" : "performer",
"variable" : "perf"
}
],
"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"
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "https://example/Practitioner/"
},
{
"valueId" : "uuid1"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "url",
"transform" : "append",
"parameter" : [
{
"valueString" : "Practitioner/"
},
{
"valueId" : "uuid1"
}
]
}
],
"rule" : [
{
"name" : "preftime",
"source" : [
{
"context" : "perf"
}
],
"target" : [
{
"context" : "medAdm",
"contextType" : "variable",
"element" : "note",
"variable" : "note"
}
],
"rule" : [
{
"name" : "notaa",
"source" : [
{
"context" : "perf"
}
],
"target" : [
{
"context" : "note",
"contextType" : "variable",
"element" : "text",
"transform" : "copy",
"parameter" : [
{
"valueString" : "performertime"
}
]
}
]
},
{
"name" : "notetime",
"source" : [
{
"context" : "perf",
"element" : "time",
"variable" : "t"
}
],
"target" : [
{
"context" : "note",
"contextType" : "variable",
"element" : "time",
"variable" : "value",
"transform" : "create",
"parameter" : [
{
"valueString" : "dateTime"
}
]
}
],
"dependent" : [
{
"name" : "TSDateTime",
"variable" : [
"t",
"value"
]
}
]
}
]
},
{
"name" : "ent",
"source" : [
{
"context" : "perf",
"element" : "assignedEntity",
"variable" : "ent"
}
],
"rule" : [
{
"name" : "meta",
"source" : [
{
"context" : "ent"
}
],
"target" : [
{
"context" : "practitioner",
"contextType" : "variable",
"element" : "meta",
"variable" : "meta"
}
],
"rule" : [
{
"name" : "coding",
"source" : [
{
"context" : "ent"
}
],
"target" : [
{
"context" : "meta",
"contextType" : "variable",
"element" : "tag",
"variable" : "coding",
"transform" : "create",
"parameter" : [
{
"valueString" : "Coding"
}
]
}
],
"rule" : [
{
"name" : "system",
"source" : [
{
"context" : "ent"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "system",
"transform" : "copy",
"parameter" : [
{
"valueString" : "http://algoritmodiscoring"
}
]
}
]
},
{
"name" : "code",
"source" : [
{
"context" : "ent"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "code",
"transform" : "copy",
"parameter" : [
{
"valueString" : "ClinicalDocument/body/TerapiaFarmacologicaPS/performer"
}
]
}
]
}
]
}
],
"documentation" : "inizio modifica meta+identifier"
},
{
"name" : "identifier",
"source" : [
{
"context" : "ent",
"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" : "uuid2"
}
]
},
{
"context" : "medAdm",
"contextType" : "variable",
"element" : "performer",
"variable" : "p"
},
{
"context" : "p",
"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" : "ent",
"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" : "assperson",
"source" : [
{
"context" : "ent",
"element" : "assignedPerson",
"variable" : "assPerson"
}
],
"rule" : [
{
"name" : "name",
"source" : [
{
"context" : "assPerson",
"element" : "name",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "practitioner",
"contextType" : "variable",
"element" : "name",
"variable" : "vvv",
"transform" : "create"
}
]
}
],
"documentation" : "fine modifica"
}
]
}
]
}
]
}
],
"documentation" : "Sezione Strutturata-------------------------------------------------------------------------------------------------------------------------------------------------"
}
]
},
{
"name" : "ClinicalDocumentSectionPianoCuraDimissione",
"typeMode" : "none",
"documentation" : "------------------------------------------------------------------------------------------------------------------\r\n-",
"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" : "entryident3",
"source" : [
{
"context" : "src",
"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" : "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" : "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" : "author",
"source" : [
{
"context" : "src",
"element" : "text",
"variable" : "cdaText"
}
],
"target" : [
{
"context" : "careplan",
"contextType" : "variable",
"element" : "note",
"variable" : "carenote"
}
],
"rule" : [
{
"name" : "notetxt",
"source" : [
{
"context" : "cdaText",
"variable" : "t"
}
],
"target" : [
{
"context" : "carenote",
"contextType" : "variable",
"element" : "text",
"transform" : "copy",
"parameter" : [
{
"valueId" : "t"
}
]
}
]
},
{
"name" : "CFauthor",
"source" : [
{
"context" : "entry1",
"element" : "author",
"variable" : "author"
}
],
"rule" : [
{
"name" : "notetime",
"source" : [
{
"context" : "author",
"element" : "time",
"variable" : "t"
}
],
"target" : [
{
"context" : "carenote",
"contextType" : "variable",
"element" : "time",
"variable" : "value",
"transform" : "create",
"parameter" : [
{
"valueString" : "dateTime"
}
]
}
],
"dependent" : [
{
"name" : "TSDateTime",
"variable" : [
"t",
"value"
]
}
]
},
{
"name" : "authpract",
"source" : [
{
"context" : "author",
"element" : "assignedAuthor",
"variable" : "assauthor"
}
],
"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"
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "https://example/Practitioner/"
},
{
"valueId" : "uuid1"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "url",
"transform" : "append",
"parameter" : [
{
"valueString" : "Practitioner/"
},
{
"valueId" : "uuid1"
}
]
}
],
"rule" : [
{
"name" : "meta",
"source" : [
{
"context" : "assauthor"
}
],
"target" : [
{
"context" : "practitioner",
"contextType" : "variable",
"element" : "meta",
"variable" : "meta"
}
],
"rule" : [
{
"name" : "coding",
"source" : [
{
"context" : "assauthor"
}
],
"target" : [
{
"context" : "meta",
"contextType" : "variable",
"element" : "tag",
"variable" : "coding",
"transform" : "create",
"parameter" : [
{
"valueString" : "Coding"
}
]
}
],
"rule" : [
{
"name" : "system",
"source" : [
{
"context" : "assauthor"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "system",
"transform" : "copy",
"parameter" : [
{
"valueString" : "http://algoritmodiscoring"
}
]
}
]
},
{
"name" : "code",
"source" : [
{
"context" : "assauthor"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "code",
"transform" : "copy",
"parameter" : [
{
"valueString" : "ClinicalDocument/body/PianoCuraDimissione/author"
}
]
}
]
}
]
}
],
"documentation" : "inizio modifica meta+identifier"
},
{
"name" : "identifier",
"source" : [
{
"context" : "assauthor",
"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" : "uuid2"
}
]
},
{
"context" : "carenote",
"contextType" : "variable",
"element" : "author",
"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" : "assauthor",
"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" : "namepers",
"source" : [
{
"context" : "assauthor",
"element" : "assignedPerson",
"variable" : "pers"
}
],
"rule" : [
{
"name" : "name",
"source" : [
{
"context" : "pers",
"element" : "name",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "practitioner",
"contextType" : "variable",
"element" : "name",
"variable" : "vvv",
"transform" : "create"
}
]
}
],
"documentation" : "fine modifica"
}
]
}
]
}
]
},
{
"name" : "entry1",
"source" : [
{
"context" : "entry1",
"element" : "entry",
"variable" : "entry2"
}
],
"rule" : [
{
"name" : "carnote",
"source" : [
{
"context" : "entry2",
"element" : "act",
"variable" : "entryact"
}
],
"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" : "careplan",
"contextType" : "variable",
"element" : "activity",
"variable" : "activ",
"transform" : "create",
"parameter" : [
{
"valueString" : "BackboneElement"
}
]
},
{
"context" : "activ",
"contextType" : "variable",
"element" : "reference",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/ServiceRequest/' + %servicerequest.id"
}
]
}
],
"rule" : [
{
"name" : "reference",
"source" : [
{
"context" : "entryact"
}
],
"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" : "entryact"
}
],
"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/' + %enc.id"
}
]
}
]
},
{
"name" : "status",
"source" : [
{
"context" : "entryact"
}
],
"target" : [
{
"context" : "servicerequest",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "active"
}
]
}
]
},
{
"name" : "intent",
"source" : [
{
"context" : "entryact"
}
],
"target" : [
{
"context" : "servicerequest",
"contextType" : "variable",
"element" : "intent",
"transform" : "copy",
"parameter" : [
{
"valueString" : "order"
}
]
}
]
},
{
"name" : "entry2",
"source" : [
{
"context" : "entryact"
}
],
"target" : [
{
"context" : "servicerequest",
"contextType" : "variable",
"element" : "identifier",
"variable" : "identif",
"transform" : "create",
"parameter" : [
{
"valueString" : "BackboneElement"
}
]
}
],
"rule" : [
{
"name" : "jarilemes",
"source" : [
{
"context" : "entryact",
"element" : "reference",
"variable" : "actref"
}
],
"rule" : [
{
"name" : "actref",
"source" : [
{
"context" : "actref",
"element" : "externalAct",
"variable" : "extact"
}
],
"rule" : [
{
"name" : "extact",
"source" : [
{
"context" : "extact"
}
],
"target" : [
{
"context" : "servicerequest",
"contextType" : "variable",
"element" : "identifier",
"variable" : "identif3",
"transform" : "create",
"parameter" : [
{
"valueString" : "BackboneElement"
}
]
}
],
"rule" : [
{
"name" : "idnetn",
"source" : [
{
"context" : "extact",
"element" : "id",
"variable" : "id"
}
],
"rule" : [
{
"name" : "root1",
"source" : [
{
"context" : "id",
"element" : "root",
"variable" : "r"
}
],
"target" : [
{
"context" : "identif3",
"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" : "identif3",
"contextType" : "variable",
"element" : "value",
"transform" : "copy",
"parameter" : [
{
"valueId" : "ext"
}
]
}
],
"rule" : [
{
"name" : "assigningAuthorityName",
"source" : [
{
"context" : "id",
"element" : "assigningAuthorityName",
"variable" : "s"
}
],
"target" : [
{
"context" : "identif3",
"contextType" : "variable",
"element" : "assigner",
"variable" : "a"
},
{
"context" : "a",
"contextType" : "variable",
"element" : "display",
"transform" : "copy",
"parameter" : [
{
"valueId" : "s"
}
]
}
]
}
]
}
]
}
]
}
]
}
]
},
{
"name" : "code",
"source" : [
{
"context" : "entryact",
"element" : "code",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "servicerequest",
"contextType" : "variable",
"element" : "code",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "statusCode",
"source" : [
{
"context" : "entryact",
"element" : "statusCode",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "servicerequest",
"contextType" : "variable",
"element" : "status",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "servReq",
"source" : [
{
"context" : "entryact",
"element" : "author",
"variable" : "actauthor"
}
],
"rule" : [
{
"name" : "time",
"source" : [
{
"context" : "actauthor",
"element" : "time",
"variable" : "t"
}
],
"target" : [
{
"context" : "servicerequest",
"contextType" : "variable",
"element" : "authoredOn",
"variable" : "date",
"transform" : "create",
"parameter" : [
{
"valueString" : "dateTime"
}
]
}
],
"dependent" : [
{
"name" : "TSDateTime",
"variable" : [
"t",
"date"
]
}
]
},
{
"name" : "author",
"source" : [
{
"context" : "actauthor",
"element" : "assignedAuthor",
"variable" : "assauthor"
}
],
"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"
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "https://example/Practitioner/"
},
{
"valueId" : "uuid1"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "url",
"transform" : "append",
"parameter" : [
{
"valueString" : "Practitioner/"
},
{
"valueId" : "uuid1"
}
]
}
],
"rule" : [
{
"name" : "meta",
"source" : [
{
"context" : "assauthor"
}
],
"target" : [
{
"context" : "practitioner",
"contextType" : "variable",
"element" : "meta",
"variable" : "meta"
}
],
"rule" : [
{
"name" : "coding",
"source" : [
{
"context" : "assauthor"
}
],
"target" : [
{
"context" : "meta",
"contextType" : "variable",
"element" : "tag",
"variable" : "coding",
"transform" : "create",
"parameter" : [
{
"valueString" : "Coding"
}
]
}
],
"rule" : [
{
"name" : "system",
"source" : [
{
"context" : "assauthor"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "system",
"transform" : "copy",
"parameter" : [
{
"valueString" : "http://algoritmodiscoring"
}
]
}
]
},
{
"name" : "code",
"source" : [
{
"context" : "assauthor"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "code",
"transform" : "copy",
"parameter" : [
{
"valueString" : "ClinicalDocument/body/PianoCuraDimissione/author"
}
]
}
]
}
]
}
],
"documentation" : "inizio modifica identifier"
},
{
"name" : "identifier",
"source" : [
{
"context" : "assauthor",
"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" : "uuid2"
}
]
},
{
"context" : "servicerequest",
"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" : "assauthor",
"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" : "namepers",
"source" : [
{
"context" : "assauthor",
"element" : "assignedPerson",
"variable" : "pers"
}
],
"rule" : [
{
"name" : "name",
"source" : [
{
"context" : "pers",
"element" : "name",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "practitioner",
"contextType" : "variable",
"element" : "name",
"variable" : "vvv",
"transform" : "create"
}
]
}
],
"documentation" : "fine modifica"
}
]
}
]
}
]
}
]
}
]
}
]
}
]
},
{
"name" : "ClinicalDocumentSectionDimissione",
"typeMode" : "none",
"documentation" : "-------Dimissione------------------------------------------------------------------------------------------------------",
"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" : "entry1",
"source" : [
{
"context" : "src",
"element" : "entry",
"variable" : "entry1"
}
],
"rule" : [
{
"name" : "act",
"source" : [
{
"context" : "entry1",
"element" : "act",
"variable" : "act"
}
],
"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" : "encountert",
"transform" : "create",
"parameter" : [
{
"valueString" : "Encounter"
}
]
},
{
"context" : "encountert",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid1",
"transform" : "uuid"
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "https://example/Encounter/"
},
{
"valueId" : "uuid1"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "url",
"transform" : "copy",
"parameter" : [
{
"valueString" : "Encounter"
}
]
},
{
"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/Encounter/' + %encountert.id"
}
]
}
],
"rule" : [
{
"name" : "status",
"source" : [
{
"context" : "act"
}
],
"target" : [
{
"context" : "encountert",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "finished"
}
]
}
]
},
{
"name" : "class",
"source" : [
{
"context" : "act"
}
],
"target" : [
{
"context" : "encountert",
"contextType" : "variable",
"element" : "class",
"variable" : "cl",
"transform" : "create",
"parameter" : [
{
"valueString" : "Coding"
}
]
}
],
"rule" : [
{
"name" : "code",
"source" : [
{
"context" : "act"
}
],
"target" : [
{
"context" : "cl",
"contextType" : "variable",
"element" : "code",
"transform" : "copy",
"parameter" : [
{
"valueString" : "AMB"
}
]
}
]
},
{
"name" : "code",
"source" : [
{
"context" : "act"
}
],
"target" : [
{
"context" : "cl",
"contextType" : "variable",
"element" : "display",
"transform" : "copy",
"parameter" : [
{
"valueString" : "ambulatory"
}
]
}
]
}
]
},
{
"name" : "refenc",
"source" : [
{
"context" : "act"
}
],
"target" : [
{
"context" : "encountert",
"contextType" : "variable",
"element" : "partOf",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Encounter/' + enc.id"
}
]
}
]
},
{
"name" : "refpatient",
"source" : [
{
"context" : "act"
}
],
"target" : [
{
"context" : "encountert",
"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" : "code",
"source" : [
{
"context" : "act",
"element" : "code",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "encountert",
"contextType" : "variable",
"element" : "type",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "where",
"source" : [
{
"context" : "act",
"condition" : "effectiveTime.low.exists() or effectiveTime.high.exists()"
}
],
"rule" : [
{
"name" : "effectiveTime",
"source" : [
{
"context" : "act",
"element" : "effectiveTime",
"variable" : "eff"
}
],
"target" : [
{
"context" : "encountert",
"contextType" : "variable",
"element" : "period",
"variable" : "period",
"transform" : "create",
"parameter" : [
{
"valueString" : "Period"
}
]
}
],
"dependent" : [
{
"name" : "IVLTSPeriod",
"variable" : [
"eff",
"period"
]
}
]
}
]
},
{
"name" : "where",
"source" : [
{
"context" : "act",
"condition" : "effectiveTime.low.exists().not() or effectiveTime.high.exists().not()"
}
],
"rule" : [
{
"name" : "efft",
"source" : [
{
"context" : "act",
"element" : "effectiveTime",
"variable" : "effectivetime1"
}
],
"target" : [
{
"context" : "encountert",
"contextType" : "variable",
"element" : "period",
"variable" : "period",
"transform" : "create",
"parameter" : [
{
"valueString" : "Period"
}
]
}
],
"rule" : [
{
"name" : "val",
"source" : [
{
"context" : "effectivetime1"
}
],
"target" : [
{
"context" : "period",
"contextType" : "variable",
"element" : "start",
"variable" : "start",
"transform" : "create",
"parameter" : [
{
"valueString" : "dateTime"
}
]
}
],
"dependent" : [
{
"name" : "TSDateTime",
"variable" : [
"effectivetime1",
"start"
]
}
]
}
]
}
],
"documentation" : "effectiveTime = time-stamp"
},
{
"name" : "erformer",
"source" : [
{
"context" : "act",
"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"
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "https://example/Practitioner/"
},
{
"valueId" : "uuid1"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "url",
"transform" : "append",
"parameter" : [
{
"valueString" : "Practitioner/"
},
{
"valueId" : "uuid1"
}
]
}
],
"rule" : [
{
"name" : "ass",
"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/Dimissione/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" : "perf",
"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" : "uuid2"
}
]
},
{
"context" : "encountert",
"contextType" : "variable",
"element" : "participant",
"variable" : "perf"
}
],
"rule" : [
{
"name" : "period",
"source" : [
{
"context" : "performer"
}
],
"target" : [
{
"context" : "perf",
"contextType" : "variable",
"element" : "period",
"variable" : "period",
"transform" : "create",
"parameter" : [
{
"valueString" : "Period"
}
]
}
],
"rule" : [
{
"name" : "time",
"source" : [
{
"context" : "performer",
"element" : "time",
"variable" : "time"
}
],
"target" : [
{
"context" : "period",
"contextType" : "variable",
"element" : "start",
"variable" : "start",
"transform" : "create",
"parameter" : [
{
"valueString" : "dateTime"
}
]
}
],
"dependent" : [
{
"name" : "TSDateTime",
"variable" : [
"time",
"start"
]
}
]
}
]
},
{
"name" : "aut",
"source" : [
{
"context" : "performer"
}
],
"target" : [
{
"context" : "perf",
"contextType" : "variable",
"element" : "individual",
"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" : "assPer",
"source" : [
{
"context" : "assEnty",
"element" : "assignedPerson",
"variable" : "assPers"
}
],
"rule" : [
{
"name" : "name",
"source" : [
{
"context" : "assPers",
"element" : "name",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "practitioner",
"contextType" : "variable",
"element" : "name",
"variable" : "vvv",
"transform" : "create"
}
]
}
]
}
],
"documentation" : "performer.time as ti -> note.time = (ti.value);"
}
]
},
{
"name" : "entriRel",
"source" : [
{
"context" : "act",
"element" : "entryRelationship",
"variable" : "entriRel"
}
],
"rule" : [
{
"name" : "enc",
"source" : [
{
"context" : "entriRel",
"element" : "encounter",
"variable" : "enc1"
}
],
"rule" : [
{
"name" : "enc1",
"source" : [
{
"context" : "enc1"
}
],
"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" : "encountert1",
"transform" : "create",
"parameter" : [
{
"valueString" : "Encounter"
}
]
},
{
"context" : "encountert1",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid1",
"transform" : "uuid"
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "https://example/Encounter/"
},
{
"valueId" : "uuid1"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "url",
"transform" : "copy",
"parameter" : [
{
"valueString" : "Encounter"
}
]
},
{
"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/Encounter/' + %encountert1.id"
}
]
},
{
"context" : "encountert1",
"contextType" : "variable",
"element" : "partOf",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Encounter/' + encountert.id"
}
]
}
],
"rule" : [
{
"name" : "status",
"source" : [
{
"context" : "enc1"
}
],
"target" : [
{
"context" : "encountert1",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "finished"
}
]
}
]
},
{
"name" : "class",
"source" : [
{
"context" : "enc1"
}
],
"target" : [
{
"context" : "encountert1",
"contextType" : "variable",
"element" : "class",
"variable" : "cl",
"transform" : "create",
"parameter" : [
{
"valueString" : "Coding"
}
]
}
],
"rule" : [
{
"name" : "code",
"source" : [
{
"context" : "enc1"
}
],
"target" : [
{
"context" : "cl",
"contextType" : "variable",
"element" : "code",
"transform" : "copy",
"parameter" : [
{
"valueString" : "AMB"
}
]
}
]
},
{
"name" : "code",
"source" : [
{
"context" : "enc1"
}
],
"target" : [
{
"context" : "cl",
"contextType" : "variable",
"element" : "display",
"transform" : "copy",
"parameter" : [
{
"valueString" : "ambulatory"
}
]
}
]
}
]
},
{
"name" : "refpatient",
"source" : [
{
"context" : "enc1"
}
],
"target" : [
{
"context" : "encountert1",
"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" : "id",
"source" : [
{
"context" : "enc1",
"element" : "id",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "encountert1",
"contextType" : "variable",
"element" : "identifier",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "code",
"source" : [
{
"context" : "enc1"
}
],
"target" : [
{
"context" : "encountert1",
"contextType" : "variable",
"element" : "type",
"variable" : "ti",
"transform" : "create",
"parameter" : [
{
"valueString" : "CodeableConcept"
}
]
}
],
"rule" : [
{
"name" : "coding",
"source" : [
{
"context" : "enc1"
}
],
"target" : [
{
"context" : "ti",
"contextType" : "variable",
"element" : "coding",
"variable" : "cod",
"transform" : "create",
"parameter" : [
{
"valueString" : "Coding"
}
]
}
],
"rule" : [
{
"name" : "code",
"source" : [
{
"context" : "enc1",
"element" : "code",
"variable" : "c"
}
],
"target" : [
{
"context" : "cod",
"contextType" : "variable",
"element" : "code",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "c.code"
}
]
}
]
},
{
"name" : "syst",
"source" : [
{
"context" : "enc1",
"element" : "code",
"variable" : "c"
}
],
"rule" : [
{
"name" : "system",
"source" : [
{
"context" : "c",
"element" : "codeSystem",
"variable" : "s"
}
],
"target" : [
{
"context" : "cod",
"contextType" : "variable",
"element" : "system",
"transform" : "translate",
"parameter" : [
{
"valueId" : "s"
},
{
"valueString" : "http://hl7.org/fhir/ConceptMap/special-oid2uri"
},
{
"valueString" : "uri"
}
]
}
]
}
]
},
{
"name" : "dispaly",
"source" : [
{
"context" : "enc1",
"element" : "code",
"variable" : "c"
}
],
"target" : [
{
"context" : "cod",
"contextType" : "variable",
"element" : "display",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "c.displayName"
}
]
}
]
}
]
},
{
"name" : "text",
"source" : [
{
"context" : "enc1",
"element" : "text",
"variable" : "tx"
}
],
"rule" : [
{
"name" : "val",
"source" : [
{
"context" : "tx",
"element" : "reference",
"variable" : "ref"
}
],
"target" : [
{
"context" : "ti",
"contextType" : "variable",
"element" : "text",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "ref.value"
}
]
}
]
}
]
}
],
"documentation" : "enc1.code -> encountert1.type;"
},
{
"name" : "where",
"source" : [
{
"context" : "enc1",
"condition" : "effectiveTime.low.exists() or effectiveTime.high.exists()"
}
],
"rule" : [
{
"name" : "effectiveTime",
"source" : [
{
"context" : "enc1",
"element" : "effectiveTime",
"variable" : "eff"
}
],
"target" : [
{
"context" : "encountert1",
"contextType" : "variable",
"element" : "period",
"variable" : "period",
"transform" : "create",
"parameter" : [
{
"valueString" : "Period"
}
]
}
],
"dependent" : [
{
"name" : "IVLTSPeriod",
"variable" : [
"eff",
"period"
]
}
]
}
]
},
{
"name" : "where",
"source" : [
{
"context" : "enc1",
"condition" : "effectiveTime.low.exists().not() or effectiveTime.high.exists().not()"
}
],
"rule" : [
{
"name" : "efft",
"source" : [
{
"context" : "enc1",
"element" : "effectiveTime",
"variable" : "effectivetime1"
}
],
"target" : [
{
"context" : "encountert1",
"contextType" : "variable",
"element" : "period",
"variable" : "period",
"transform" : "create",
"parameter" : [
{
"valueString" : "Period"
}
]
}
],
"rule" : [
{
"name" : "val",
"source" : [
{
"context" : "effectivetime1"
}
],
"target" : [
{
"context" : "period",
"contextType" : "variable",
"element" : "start",
"variable" : "start",
"transform" : "create",
"parameter" : [
{
"valueString" : "dateTime"
}
]
}
],
"dependent" : [
{
"name" : "TSDateTime",
"variable" : [
"effectivetime1",
"start"
]
}
]
}
]
}
],
"documentation" : "effectiveTime = time-stamp"
},
{
"name" : "Location",
"source" : [
{
"context" : "enc1",
"element" : "participant",
"variable" : "part",
"condition" : "(typeCode = 'LOC')"
}
],
"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" : "location",
"transform" : "create",
"parameter" : [
{
"valueString" : "Location"
}
]
},
{
"context" : "location",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid1",
"transform" : "uuid"
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "https://example/Location/"
},
{
"valueId" : "uuid1"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "url",
"transform" : "append",
"parameter" : [
{
"valueString" : "Location/"
},
{
"valueId" : "uuid1"
}
]
}
],
"rule" : [
{
"name" : "meta",
"source" : [
{
"context" : "part"
}
],
"target" : [
{
"context" : "location",
"contextType" : "variable",
"element" : "meta",
"variable" : "meta"
}
],
"rule" : [
{
"name" : "coding",
"source" : [
{
"context" : "part"
}
],
"target" : [
{
"context" : "meta",
"contextType" : "variable",
"element" : "tag",
"variable" : "coding",
"transform" : "create",
"parameter" : [
{
"valueString" : "Coding"
}
]
}
],
"rule" : [
{
"name" : "system",
"source" : [
{
"context" : "part"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "system",
"transform" : "copy",
"parameter" : [
{
"valueString" : "http://algoritmodiscoring"
}
]
}
]
},
{
"name" : "code",
"source" : [
{
"context" : "part"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "code",
"transform" : "copy",
"parameter" : [
{
"valueString" : "ClinicalDocument/body/Dimissione/participant"
}
]
}
]
}
]
}
]
},
{
"name" : "location1",
"source" : [
{
"context" : "part",
"element" : "time",
"variable" : "tim"
}
],
"target" : [
{
"context" : "encountert1",
"contextType" : "variable",
"element" : "location",
"variable" : "locat"
}
],
"rule" : [
{
"name" : "time",
"source" : [
{
"context" : "tim"
}
],
"target" : [
{
"context" : "locat",
"contextType" : "variable",
"element" : "period",
"variable" : "period",
"transform" : "create",
"parameter" : [
{
"valueString" : "Period"
}
]
}
],
"dependent" : [
{
"name" : "IVLTSPeriod",
"variable" : [
"tim",
"period"
]
}
]
},
{
"name" : "time",
"source" : [
{
"context" : "part",
"element" : "time",
"variable" : "tim"
}
],
"target" : [
{
"context" : "locat",
"contextType" : "variable",
"element" : "period",
"variable" : "period",
"transform" : "create",
"parameter" : [
{
"valueString" : "Period"
}
]
}
],
"rule" : [
{
"name" : "val",
"source" : [
{
"context" : "tim"
}
],
"target" : [
{
"context" : "period",
"contextType" : "variable",
"element" : "start",
"variable" : "start",
"transform" : "create",
"parameter" : [
{
"valueString" : "dateTime"
}
]
}
],
"dependent" : [
{
"name" : "TSDateTime",
"variable" : [
"tim",
"start"
]
}
]
}
]
},
{
"name" : "partRole",
"source" : [
{
"context" : "part",
"element" : "participantRole",
"variable" : "partRole"
}
],
"rule" : [
{
"name" : "identifier",
"source" : [
{
"context" : "partRole",
"element" : "id",
"variable" : "id"
}
],
"target" : [
{
"context" : "location",
"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" : "partRole"
}
],
"target" : [
{
"context" : "request",
"contextType" : "variable",
"element" : "url",
"transform" : "append",
"parameter" : [
{
"valueString" : "Location?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" : "r",
"source" : [
{
"context" : "id",
"element" : "root",
"variable" : "r"
}
],
"rule" : [
{
"name" : "idasi",
"source" : [
{
"context" : "id",
"element" : "extension",
"variable" : "ext"
}
],
"target" : [
{
"context" : "location",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "r + '-' + ext"
}
]
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "https://example/Location/"
},
{
"valueId" : "uuid"
}
]
},
{
"context" : "locat",
"contextType" : "variable",
"element" : "location",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Location/' + %location.id"
}
]
}
]
}
]
}
]
},
{
"name" : "code",
"source" : [
{
"context" : "partRole",
"element" : "code",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "location",
"contextType" : "variable",
"element" : "type",
"variable" : "vvv",
"transform" : "create"
}
],
"documentation" : "partRole.id -> location.identifier;"
}
]
}
]
}
]
},
{
"name" : "entryrel2",
"source" : [
{
"context" : "enc1",
"element" : "entryRelationship",
"variable" : "entryrel2"
}
],
"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" : "encountert1",
"contextType" : "variable",
"element" : "reasonReference",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "BackboneElement"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Observation/' + %observation.id"
}
]
}
],
"rule" : [
{
"name" : "obs",
"source" : [
{
"context" : "entryrel2",
"element" : "observation",
"variable" : "obs"
}
],
"rule" : [
{
"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/' + %encountert1.id"
}
]
}
]
},
{
"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",
"element" : "statusCode",
"variable" : "statusc",
"condition" : "(code = 'completed')"
}
],
"target" : [
{
"context" : "observation",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "final"
}
]
}
]
},
{
"name" : "statusCode",
"source" : [
{
"context" : "obs",
"element" : "statusCode",
"variable" : "statusc",
"condition" : "(code = 'active')"
}
],
"target" : [
{
"context" : "observation",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "registered"
}
]
}
]
},
{
"name" : "statusCode",
"source" : [
{
"context" : "obs",
"element" : "statusCode",
"variable" : "statusc",
"condition" : "(code = 'aborted')"
}
],
"target" : [
{
"context" : "observation",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "cancelled"
}
]
}
]
},
{
"name" : "statusCode",
"source" : [
{
"context" : "obs",
"element" : "statusCode",
"variable" : "statusc",
"condition" : "(code = 'suspended')"
}
],
"target" : [
{
"context" : "observation",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "partial"
}
]
}
]
},
{
"name" : "notpresent",
"source" : [
{
"context" : "obs"
}
],
"target" : [
{
"context" : "observation",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "final"
}
]
}
]
},
{
"name" : "value2",
"source" : [
{
"context" : "obs",
"element" : "effectiveTime",
"variable" : "effectiveTime"
}
],
"target" : [
{
"context" : "observation",
"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" : "effectiveTime",
"source" : [
{
"context" : "obs",
"element" : "effectiveTime",
"variable" : "eff"
}
],
"target" : [
{
"context" : "observation",
"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" : "observation",
"contextType" : "variable",
"element" : "value",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "int.value"
}
]
}
]
},
{
"name" : "boolean",
"source" : [
{
"context" : "obs",
"type" : "BL",
"element" : "value",
"variable" : "boolean"
}
],
"target" : [
{
"context" : "observation",
"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" : "observation",
"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" : "observation",
"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" : "obs",
"type" : "PQ",
"element" : "value",
"variable" : "val"
}
],
"rule" : [
{
"name" : "quantity",
"source" : [
{
"context" : "val"
}
],
"target" : [
{
"context" : "observation",
"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" : "observation",
"contextType" : "variable",
"element" : "value",
"transform" : "create",
"parameter" : [
{
"valueString" : "string"
}
]
},
{
"context" : "observation",
"contextType" : "variable",
"element" : "value",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "value.dataString"
}
]
}
]
}
]
}
]
}
]
}
]
}
],
"documentation" : "Encounter Post dimissione---------------------------------------------------------------------------------------------------------------------------------------"
},
{
"name" : "entri-act",
"source" : [
{
"context" : "act",
"element" : "entryRelationship",
"variable" : "entriRel2"
}
],
"rule" : [
{
"name" : "a",
"source" : [
{
"context" : "entriRel2",
"element" : "act",
"variable" : "a"
}
],
"rule" : [
{
"name" : "act",
"source" : [
{
"context" : "a"
}
],
"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" : "encountert2",
"transform" : "create",
"parameter" : [
{
"valueString" : "Encounter"
}
]
},
{
"context" : "encountert2",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid1",
"transform" : "uuid"
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "https://example/Encounter/"
},
{
"valueId" : "uuid1"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "url",
"transform" : "copy",
"parameter" : [
{
"valueString" : "Encounter"
}
]
},
{
"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/Encounter/' + encountert2.id"
}
]
},
{
"context" : "encountert2",
"contextType" : "variable",
"element" : "partOf",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Encounter/' + encountert.id"
}
]
}
],
"rule" : [
{
"name" : "status",
"source" : [
{
"context" : "a"
}
],
"target" : [
{
"context" : "encountert2",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "finished"
}
]
}
]
},
{
"name" : "class",
"source" : [
{
"context" : "a"
}
],
"target" : [
{
"context" : "encountert2",
"contextType" : "variable",
"element" : "class",
"variable" : "cl",
"transform" : "create",
"parameter" : [
{
"valueString" : "Coding"
}
]
}
],
"rule" : [
{
"name" : "code",
"source" : [
{
"context" : "a"
}
],
"target" : [
{
"context" : "cl",
"contextType" : "variable",
"element" : "code",
"transform" : "copy",
"parameter" : [
{
"valueString" : "AMB"
}
]
}
]
},
{
"name" : "code",
"source" : [
{
"context" : "a"
}
],
"target" : [
{
"context" : "cl",
"contextType" : "variable",
"element" : "display",
"transform" : "copy",
"parameter" : [
{
"valueString" : "ambulatory"
}
]
}
]
}
]
},
{
"name" : "refpatient",
"source" : [
{
"context" : "a"
}
],
"target" : [
{
"context" : "encountert2",
"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" : "where",
"source" : [
{
"context" : "a",
"condition" : "effectiveTime.low.exists() or effectiveTime.high.exists()"
}
],
"rule" : [
{
"name" : "effectiveTime",
"source" : [
{
"context" : "a",
"element" : "effectiveTime",
"variable" : "eff"
}
],
"target" : [
{
"context" : "encountert2",
"contextType" : "variable",
"element" : "period",
"variable" : "period",
"transform" : "create",
"parameter" : [
{
"valueString" : "Period"
}
]
}
],
"dependent" : [
{
"name" : "IVLTSPeriod",
"variable" : [
"eff",
"period"
]
}
]
}
]
},
{
"name" : "where",
"source" : [
{
"context" : "a",
"condition" : "effectiveTime.low.exists().not() or effectiveTime.high.exists().not()"
}
],
"rule" : [
{
"name" : "efft",
"source" : [
{
"context" : "a",
"element" : "effectiveTime",
"variable" : "effectivetime1"
}
],
"target" : [
{
"context" : "encountert2",
"contextType" : "variable",
"element" : "period",
"variable" : "period",
"transform" : "create",
"parameter" : [
{
"valueString" : "Period"
}
]
}
],
"rule" : [
{
"name" : "val",
"source" : [
{
"context" : "effectivetime1"
}
],
"target" : [
{
"context" : "period",
"contextType" : "variable",
"element" : "start",
"variable" : "start",
"transform" : "create",
"parameter" : [
{
"valueString" : "dateTime"
}
]
}
],
"dependent" : [
{
"name" : "TSDateTime",
"variable" : [
"effectivetime1",
"start"
]
}
]
}
]
}
],
"documentation" : "effectiveTime = time-stamp"
},
{
"name" : "loc",
"source" : [
{
"context" : "a"
}
],
"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" : "location",
"transform" : "create",
"parameter" : [
{
"valueString" : "Location"
}
]
},
{
"context" : "location",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid1",
"transform" : "uuid"
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "https://example/Location/"
},
{
"valueId" : "uuid1"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "url",
"transform" : "append",
"parameter" : [
{
"valueString" : "Location/"
},
{
"valueId" : "uuid1"
}
]
}
],
"rule" : [
{
"name" : "text",
"source" : [
{
"context" : "a",
"element" : "text",
"variable" : "tx"
}
],
"rule" : [
{
"name" : "dfs",
"source" : [
{
"context" : "tx",
"element" : "reference",
"variable" : "ref"
}
],
"target" : [
{
"context" : "location",
"contextType" : "variable",
"element" : "description",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "ref.value"
}
]
}
]
}
]
},
{
"name" : "Location",
"source" : [
{
"context" : "a",
"element" : "participant",
"variable" : "part"
}
],
"rule" : [
{
"name" : "meta",
"source" : [
{
"context" : "part"
}
],
"target" : [
{
"context" : "location",
"contextType" : "variable",
"element" : "meta",
"variable" : "meta"
}
],
"rule" : [
{
"name" : "coding",
"source" : [
{
"context" : "part"
}
],
"target" : [
{
"context" : "meta",
"contextType" : "variable",
"element" : "tag",
"variable" : "coding",
"transform" : "create",
"parameter" : [
{
"valueString" : "Coding"
}
]
}
],
"rule" : [
{
"name" : "system",
"source" : [
{
"context" : "part"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "system",
"transform" : "copy",
"parameter" : [
{
"valueString" : "http://algoritmodiscoring"
}
]
}
]
},
{
"name" : "code",
"source" : [
{
"context" : "part"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "code",
"transform" : "copy",
"parameter" : [
{
"valueString" : "ClinicalDocument/body/Dimissione/act"
}
]
}
]
}
]
}
]
},
{
"name" : "loc2",
"source" : [
{
"context" : "part",
"element" : "time",
"variable" : "tim"
}
],
"target" : [
{
"context" : "encountert2",
"contextType" : "variable",
"element" : "location",
"variable" : "locat"
}
],
"rule" : [
{
"name" : "time",
"source" : [
{
"context" : "tim"
}
],
"target" : [
{
"context" : "locat",
"contextType" : "variable",
"element" : "period",
"variable" : "period",
"transform" : "create",
"parameter" : [
{
"valueString" : "Period"
}
]
}
],
"dependent" : [
{
"name" : "IVLTSPeriod",
"variable" : [
"tim",
"period"
]
}
]
},
{
"name" : "time",
"source" : [
{
"context" : "part",
"element" : "time",
"variable" : "tim"
}
],
"target" : [
{
"context" : "locat",
"contextType" : "variable",
"element" : "period",
"variable" : "period",
"transform" : "create",
"parameter" : [
{
"valueString" : "Period"
}
]
}
],
"rule" : [
{
"name" : "val",
"source" : [
{
"context" : "tim"
}
],
"target" : [
{
"context" : "period",
"contextType" : "variable",
"element" : "start",
"variable" : "start",
"transform" : "create",
"parameter" : [
{
"valueString" : "dateTime"
}
]
}
],
"dependent" : [
{
"name" : "TSDateTime",
"variable" : [
"tim",
"start"
]
}
]
}
]
},
{
"name" : "partRole",
"source" : [
{
"context" : "part",
"element" : "participantRole",
"variable" : "partRole"
}
],
"rule" : [
{
"name" : "identifier",
"source" : [
{
"context" : "partRole",
"element" : "id",
"variable" : "id"
}
],
"target" : [
{
"context" : "location",
"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" : "partRole"
}
],
"target" : [
{
"context" : "request",
"contextType" : "variable",
"element" : "url",
"transform" : "append",
"parameter" : [
{
"valueString" : "Location?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" : "r",
"source" : [
{
"context" : "id",
"element" : "root",
"variable" : "r"
}
],
"rule" : [
{
"name" : "idasi",
"source" : [
{
"context" : "id",
"element" : "extension",
"variable" : "ext"
}
],
"target" : [
{
"context" : "location",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "r + '-' + ext"
}
]
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "https://example/Location/"
},
{
"valueId" : "uuid"
}
]
},
{
"context" : "locat",
"contextType" : "variable",
"element" : "location",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Location/' + %location.id"
}
]
}
]
}
]
}
]
},
{
"name" : "code",
"source" : [
{
"context" : "partRole",
"element" : "code",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "location",
"contextType" : "variable",
"element" : "type",
"variable" : "vvv",
"transform" : "create"
}
],
"documentation" : "partRole.id -> location.identifier;"
}
]
}
]
}
]
}
]
},
{
"name" : "entryrel2",
"source" : [
{
"context" : "a",
"element" : "entryRelationship",
"variable" : "entryrel2"
}
],
"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" : "encountert2",
"contextType" : "variable",
"element" : "reasonReference",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "BackboneElement"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Observation/' + %observation.id"
}
]
}
],
"rule" : [
{
"name" : "obs",
"source" : [
{
"context" : "entryrel2",
"element" : "observation",
"variable" : "obs"
}
],
"rule" : [
{
"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/' + %encountert2.id"
}
]
}
]
},
{
"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",
"element" : "statusCode",
"variable" : "statusc",
"condition" : "(code = 'completed')"
}
],
"target" : [
{
"context" : "observation",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "final"
}
]
}
]
},
{
"name" : "statusCode",
"source" : [
{
"context" : "obs",
"element" : "statusCode",
"variable" : "statusc",
"condition" : "(code = 'active')"
}
],
"target" : [
{
"context" : "observation",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "registered"
}
]
}
]
},
{
"name" : "statusCode",
"source" : [
{
"context" : "obs",
"element" : "statusCode",
"variable" : "statusc",
"condition" : "(code = 'aborted')"
}
],
"target" : [
{
"context" : "observation",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "cancelled"
}
]
}
]
},
{
"name" : "statusCode",
"source" : [
{
"context" : "obs",
"element" : "statusCode",
"variable" : "statusc",
"condition" : "(code = 'suspended')"
}
],
"target" : [
{
"context" : "observation",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "partial"
}
]
}
]
},
{
"name" : "notpresent",
"source" : [
{
"context" : "obs"
}
],
"target" : [
{
"context" : "observation",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "final"
}
]
}
]
},
{
"name" : "value2",
"source" : [
{
"context" : "obs",
"element" : "effectiveTime",
"variable" : "effectiveTime"
}
],
"target" : [
{
"context" : "observation",
"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" : "effectiveTime",
"source" : [
{
"context" : "obs",
"element" : "effectiveTime",
"variable" : "eff"
}
],
"target" : [
{
"context" : "observation",
"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" : "observation",
"contextType" : "variable",
"element" : "value",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "int.value"
}
]
}
]
},
{
"name" : "boolean",
"source" : [
{
"context" : "obs",
"type" : "BL",
"element" : "value",
"variable" : "boolean"
}
],
"target" : [
{
"context" : "observation",
"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" : "observation",
"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" : "observation",
"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" : "obs",
"type" : "PQ",
"element" : "value",
"variable" : "val"
}
],
"rule" : [
{
"name" : "quantity",
"source" : [
{
"context" : "val"
}
],
"target" : [
{
"context" : "observation",
"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" : "observation",
"contextType" : "variable",
"element" : "value",
"transform" : "create",
"parameter" : [
{
"valueString" : "string"
}
]
},
{
"context" : "observation",
"contextType" : "variable",
"element" : "value",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "value.dataString"
}
]
}
]
}
]
}
]
}
]
}
]
}
],
"documentation" : "Trasferimento post dimissione-------------------------------------------------------------------------------------------------------------------------------------"
},
{
"name" : "entryrel2",
"source" : [
{
"context" : "act",
"element" : "entryRelationship",
"variable" : "entryrel2"
}
],
"rule" : [
{
"name" : "obs",
"source" : [
{
"context" : "entryrel2",
"element" : "observation",
"variable" : "obs"
}
],
"rule" : [
{
"name" : "222",
"source" : [
{
"context" : "obs",
"element" : "code",
"variable" : "code",
"condition" : "(code = '29308-4')"
}
],
"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" : "encountert",
"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" : "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/' + %encountert.id"
}
]
}
]
},
{
"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",
"element" : "statusCode",
"variable" : "statusc",
"condition" : "(code = 'completed')"
}
],
"target" : [
{
"context" : "observation",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "final"
}
]
}
]
},
{
"name" : "statusCode",
"source" : [
{
"context" : "obs",
"element" : "statusCode",
"variable" : "statusc",
"condition" : "(code = 'active')"
}
],
"target" : [
{
"context" : "observation",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "registered"
}
]
}
]
},
{
"name" : "statusCode",
"source" : [
{
"context" : "obs",
"element" : "statusCode",
"variable" : "statusc",
"condition" : "(code = 'aborted')"
}
],
"target" : [
{
"context" : "observation",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "cancelled"
}
]
}
]
},
{
"name" : "statusCode",
"source" : [
{
"context" : "obs",
"element" : "statusCode",
"variable" : "statusc",
"condition" : "(code = 'suspended')"
}
],
"target" : [
{
"context" : "observation",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "partial"
}
]
}
]
},
{
"name" : "status",
"source" : [
{
"context" : "obs"
}
],
"target" : [
{
"context" : "observation",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "final"
}
]
}
],
"documentation" : "obs where obs.statusCode.exists().not() then {"
},
{
"name" : "value2",
"source" : [
{
"context" : "obs",
"element" : "effectiveTime",
"variable" : "effectiveTime"
}
],
"target" : [
{
"context" : "observation",
"contextType" : "variable",
"element" : "effective",
"variable" : "value",
"transform" : "create",
"parameter" : [
{
"valueString" : "dateTime"
}
]
}
],
"dependent" : [
{
"name" : "TSDateTime",
"variable" : [
"effectiveTime",
"value"
]
}
],
"documentation" : "}\"statuscode\";"
},
{
"name" : "where",
"source" : [
{
"context" : "obs",
"condition" : "effectiveTime.low.exists() or effectiveTime.high.exists()"
}
],
"rule" : [
{
"name" : "effectiveTime",
"source" : [
{
"context" : "obs",
"element" : "effectiveTime",
"variable" : "eff"
}
],
"target" : [
{
"context" : "observation",
"contextType" : "variable",
"element" : "effective",
"variable" : "period",
"transform" : "create",
"parameter" : [
{
"valueString" : "Period"
}
]
}
],
"dependent" : [
{
"name" : "IVLTSPeriod",
"variable" : [
"eff",
"period"
]
}
]
}
]
},
{
"name" : "val",
"source" : [
{
"context" : "obs",
"element" : "value",
"variable" : "val"
}
],
"rule" : [
{
"name" : "coding",
"source" : [
{
"context" : "val"
}
],
"target" : [
{
"context" : "observation",
"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" : "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" : "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"
}
]
}
]
}
]
}
]
}
],
"documentation" : "--------------Diagnosi alla dimissione-------------------------------------------------------------"
},
{
"name" : "3",
"source" : [
{
"context" : "act",
"element" : "entryRelationship",
"variable" : "entriRel3"
}
],
"rule" : [
{
"name" : "x",
"source" : [
{
"context" : "entriRel3",
"element" : "observation",
"variable" : "obs2"
}
],
"rule" : [
{
"name" : "act",
"source" : [
{
"context" : "obs2",
"element" : "code",
"variable" : "code"
}
],
"rule" : [
{
"name" : "entry-obs1",
"source" : [
{
"context" : "code",
"element" : "code",
"condition" : "(code.code = '11302-7')"
}
],
"rule" : [
{
"name" : "hospital",
"source" : [
{
"context" : "obs2"
}
],
"target" : [
{
"context" : "encountert",
"contextType" : "variable",
"element" : "hospitalization",
"variable" : "hospital"
}
],
"rule" : [
{
"name" : "value",
"source" : [
{
"context" : "obs2",
"element" : "value",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "hospital",
"contextType" : "variable",
"element" : "dischargeDisposition",
"variable" : "vvv",
"transform" : "create"
}
]
}
]
}
]
}
]
}
]
}
],
"documentation" : "--------Esito----------------------------"
}
]
}
]
},
{
"name" : "entry",
"source" : [
{
"context" : "src",
"element" : "entry",
"variable" : "entry1"
}
],
"rule" : [
{
"name" : "obs",
"source" : [
{
"context" : "entry1",
"element" : "observation",
"variable" : "obs"
}
],
"rule" : [
{
"name" : "obstarg",
"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"
}
]
},
{
"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" : "value",
"source" : [
{
"context" : "obs",
"element" : "value",
"variable" : "val",
"condition" : "('xsi:type' = 'BL')"
}
],
"target" : [
{
"context" : "observation",
"contextType" : "variable",
"element" : "value",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "val.value"
}
]
}
]
},
{
"name" : "act",
"source" : [
{
"context" : "obs"
}
],
"dependent" : [
{
"name" : "Observation",
"variable" : [
"obs",
"patient",
"enc",
"observation",
"bundle"
]
}
]
}
]
}
]
}
]
}
]
},
{
"name" : "ClinicalDocumentSectionTerapiaFarmacologicaDimissione",
"typeMode" : "none",
"documentation" : "-----------------------------------------------------------------------------------------------------------------------\r\n------------------------------TerapiaFarmacologicaDimissione-----------------------------------------------------------------------------------------",
"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" : "text",
"source" : [
{
"context" : "src",
"condition" : "src.entry.exists().not()"
}
],
"rule" : [
{
"name" : "note",
"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" : "medRq",
"transform" : "create",
"parameter" : [
{
"valueString" : "MedicationRequest"
}
]
},
{
"context" : "medRq",
"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/' + %medRq.id"
}
]
},
{
"context" : "medRq",
"contextType" : "variable",
"element" : "note",
"variable" : "note",
"transform" : "create",
"parameter" : [
{
"valueString" : "Annotation"
}
]
}
],
"rule" : [
{
"name" : "reference",
"source" : [
{
"context" : "cdaText"
}
],
"target" : [
{
"context" : "note",
"contextType" : "variable",
"element" : "text",
"transform" : "copy",
"parameter" : [
{
"valueId" : "cdaText"
}
]
}
]
},
{
"name" : "reference",
"source" : [
{
"context" : "cdaText"
}
],
"target" : [
{
"context" : "medRq",
"contextType" : "variable",
"element" : "subject",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Patient/' + %patient.id"
}
]
}
]
},
{
"name" : "reference",
"source" : [
{
"context" : "cdaText"
}
],
"target" : [
{
"context" : "medRq",
"contextType" : "variable",
"element" : "encounter",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Encounter/' + %enc.id"
}
]
}
]
},
{
"name" : "status",
"source" : [
{
"context" : "cdaText"
}
],
"target" : [
{
"context" : "medRq",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "active"
}
]
}
]
},
{
"name" : "intent",
"source" : [
{
"context" : "cdaText"
}
],
"target" : [
{
"context" : "medRq",
"contextType" : "variable",
"element" : "intent",
"transform" : "copy",
"parameter" : [
{
"valueString" : "order"
}
]
}
]
},
{
"name" : "auth",
"source" : [
{
"context" : "src",
"element" : "author",
"variable" : "auth"
}
],
"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"
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "https://example/Practitioner/"
},
{
"valueId" : "uuid1"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "url",
"transform" : "append",
"parameter" : [
{
"valueString" : "Practitioner/"
},
{
"valueId" : "uuid1"
}
]
}
],
"rule" : [
{
"name" : "time",
"source" : [
{
"context" : "auth",
"element" : "time",
"variable" : "t"
}
],
"target" : [
{
"context" : "note",
"contextType" : "variable",
"element" : "time",
"variable" : "value",
"transform" : "create",
"parameter" : [
{
"valueString" : "dateTime"
}
]
}
],
"dependent" : [
{
"name" : "TSDateTime",
"variable" : [
"t",
"value"
]
}
]
},
{
"name" : "assAuth",
"source" : [
{
"context" : "auth",
"element" : "assignedAuthor",
"variable" : "assAuth"
}
],
"rule" : [
{
"name" : "meta",
"source" : [
{
"context" : "assAuth"
}
],
"target" : [
{
"context" : "practitioner",
"contextType" : "variable",
"element" : "meta",
"variable" : "meta"
}
],
"rule" : [
{
"name" : "coding",
"source" : [
{
"context" : "assAuth"
}
],
"target" : [
{
"context" : "meta",
"contextType" : "variable",
"element" : "tag",
"variable" : "coding",
"transform" : "create",
"parameter" : [
{
"valueString" : "Coding"
}
]
}
],
"rule" : [
{
"name" : "system",
"source" : [
{
"context" : "assAuth"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "system",
"transform" : "copy",
"parameter" : [
{
"valueString" : "http://algoritmodiscoring"
}
]
}
]
},
{
"name" : "code",
"source" : [
{
"context" : "assAuth"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "code",
"transform" : "copy",
"parameter" : [
{
"valueString" : "ClinicalDocument/body/TerapiaFarmacologicaDimissione/author"
}
]
}
]
}
]
}
],
"documentation" : "assAuth.time -> note.time;"
},
{
"name" : "identifier",
"source" : [
{
"context" : "assAuth",
"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" : "uuid2"
}
]
},
{
"context" : "note",
"contextType" : "variable",
"element" : "author",
"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" : "assAuth",
"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" : "assPers",
"source" : [
{
"context" : "assAuth",
"element" : "assignedPerson",
"variable" : "asspers"
}
],
"rule" : [
{
"name" : "name",
"source" : [
{
"context" : "asspers",
"element" : "name",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "practitioner",
"contextType" : "variable",
"element" : "name",
"variable" : "vvv",
"transform" : "create"
}
]
}
]
}
]
}
]
},
{
"name" : "medicationesiste",
"source" : [
{
"context" : "src"
}
],
"target" : [
{
"context" : "medRq",
"contextType" : "variable",
"element" : "medication",
"variable" : "medication",
"transform" : "create",
"parameter" : [
{
"valueString" : "CodeableConcept"
}
]
}
],
"rule" : [
{
"name" : "text",
"source" : [
{
"context" : "src",
"element" : "text",
"variable" : "txt"
}
],
"target" : [
{
"context" : "medication",
"contextType" : "variable",
"element" : "text",
"transform" : "copy",
"parameter" : [
{
"valueId" : "txt"
}
]
}
]
}
]
}
]
}
],
"documentation" : "Sezione Narrativa------------------------------------------------------------------------------------------------------------------------------------------------"
},
{
"name" : "sezioneesiste",
"source" : [
{
"context" : "src",
"condition" : "src.entry.exists()"
}
],
"rule" : [
{
"name" : "medication",
"source" : [
{
"context" : "src"
}
],
"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" : "medRq",
"transform" : "create",
"parameter" : [
{
"valueString" : "MedicationRequest"
}
]
},
{
"context" : "medRq",
"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/' + %medRq.id"
}
]
},
{
"context" : "medRq",
"contextType" : "variable",
"element" : "note",
"variable" : "note",
"transform" : "create",
"parameter" : [
{
"valueString" : "Annotation"
}
]
}
],
"rule" : [
{
"name" : "reference",
"source" : [
{
"context" : "src",
"element" : "text",
"variable" : "t"
}
],
"target" : [
{
"context" : "note",
"contextType" : "variable",
"element" : "text",
"transform" : "copy",
"parameter" : [
{
"valueId" : "t"
}
]
}
]
},
{
"name" : "reference",
"source" : [
{
"context" : "src"
}
],
"target" : [
{
"context" : "medRq",
"contextType" : "variable",
"element" : "subject",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Patient/' + %patient.id"
}
]
}
]
},
{
"name" : "reference",
"source" : [
{
"context" : "src"
}
],
"target" : [
{
"context" : "medRq",
"contextType" : "variable",
"element" : "encounter",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Encounter/' + %enc.id"
}
]
}
]
},
{
"name" : "status",
"source" : [
{
"context" : "src"
}
],
"target" : [
{
"context" : "medRq",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "active"
}
]
}
]
},
{
"name" : "intent",
"source" : [
{
"context" : "src"
}
],
"target" : [
{
"context" : "medRq",
"contextType" : "variable",
"element" : "intent",
"transform" : "copy",
"parameter" : [
{
"valueString" : "order"
}
]
}
]
},
{
"name" : "auth",
"source" : [
{
"context" : "src",
"element" : "author",
"variable" : "auth"
}
],
"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"
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "https://example/Practitioner/"
},
{
"valueId" : "uuid1"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "url",
"transform" : "append",
"parameter" : [
{
"valueString" : "Practitioner/"
},
{
"valueId" : "uuid1"
}
]
}
],
"rule" : [
{
"name" : "time",
"source" : [
{
"context" : "auth",
"element" : "time",
"variable" : "t"
}
],
"target" : [
{
"context" : "note",
"contextType" : "variable",
"element" : "time",
"variable" : "value",
"transform" : "create",
"parameter" : [
{
"valueString" : "dateTime"
}
]
}
],
"dependent" : [
{
"name" : "TSDateTime",
"variable" : [
"t",
"value"
]
}
]
},
{
"name" : "assAuth",
"source" : [
{
"context" : "auth",
"element" : "assignedAuthor",
"variable" : "assAuth"
}
],
"rule" : [
{
"name" : "meta",
"source" : [
{
"context" : "assAuth"
}
],
"target" : [
{
"context" : "practitioner",
"contextType" : "variable",
"element" : "meta",
"variable" : "meta"
}
],
"rule" : [
{
"name" : "coding",
"source" : [
{
"context" : "assAuth"
}
],
"target" : [
{
"context" : "meta",
"contextType" : "variable",
"element" : "tag",
"variable" : "coding",
"transform" : "create",
"parameter" : [
{
"valueString" : "Coding"
}
]
}
],
"rule" : [
{
"name" : "system",
"source" : [
{
"context" : "assAuth"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "system",
"transform" : "copy",
"parameter" : [
{
"valueString" : "http://algoritmodiscoring"
}
]
}
]
},
{
"name" : "code",
"source" : [
{
"context" : "assAuth"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "code",
"transform" : "copy",
"parameter" : [
{
"valueString" : "ClinicalDocument/body/TerapiaFarmacologicaDimissione/author"
}
]
}
]
}
]
}
],
"documentation" : "assAuth.time -> note.time;"
},
{
"name" : "identifier",
"source" : [
{
"context" : "assAuth",
"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" : "uuid2"
}
]
},
{
"context" : "note",
"contextType" : "variable",
"element" : "author",
"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" : "assAuth",
"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" : "assPers",
"source" : [
{
"context" : "assAuth",
"element" : "assignedPerson",
"variable" : "asspers"
}
],
"rule" : [
{
"name" : "name",
"source" : [
{
"context" : "asspers",
"element" : "name",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "practitioner",
"contextType" : "variable",
"element" : "name",
"variable" : "vvv",
"transform" : "create"
}
]
}
]
}
]
}
]
},
{
"name" : "entry",
"source" : [
{
"context" : "src",
"element" : "entry",
"variable" : "entry1"
}
],
"rule" : [
{
"name" : "sub",
"source" : [
{
"context" : "entry1",
"element" : "substanceAdministration",
"variable" : "sub"
}
],
"rule" : [
{
"name" : "statusCode",
"source" : [
{
"context" : "sub",
"element" : "statusCode",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "medRq",
"contextType" : "variable",
"element" : "status",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "dosage",
"source" : [
{
"context" : "sub"
}
],
"target" : [
{
"context" : "medRq",
"contextType" : "variable",
"element" : "dosageInstruction",
"variable" : "dosage",
"transform" : "create",
"parameter" : [
{
"valueString" : "Dosage"
}
]
}
],
"rule" : [
{
"name" : "timing",
"source" : [
{
"context" : "sub"
}
],
"target" : [
{
"context" : "dosage",
"contextType" : "variable",
"element" : "timing",
"variable" : "tim",
"transform" : "create",
"parameter" : [
{
"valueString" : "Timing"
}
]
}
],
"rule" : [
{
"name" : "repeat",
"source" : [
{
"context" : "sub",
"element" : "effectiveTime",
"variable" : "eff"
}
],
"target" : [
{
"context" : "tim",
"contextType" : "variable",
"element" : "repeat",
"variable" : "repeat"
}
],
"rule" : [
{
"name" : "boundsperiod",
"source" : [
{
"context" : "eff"
}
],
"target" : [
{
"context" : "repeat",
"contextType" : "variable",
"element" : "bounds",
"variable" : "period",
"transform" : "create",
"parameter" : [
{
"valueString" : "Period"
}
]
}
],
"dependent" : [
{
"name" : "IVLTSPeriod",
"variable" : [
"eff",
"period"
]
}
]
}
]
}
]
}
]
},
{
"name" : "eff",
"source" : [
{
"context" : "sub",
"type" : "PIVL_TS",
"element" : "effectiveTime",
"variable" : "eff"
}
],
"target" : [
{
"context" : "medRq",
"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" : "sub"
}
],
"target" : [
{
"context" : "medRq",
"contextType" : "variable",
"element" : "dosageInstruction",
"variable" : "dosage",
"transform" : "create",
"parameter" : [
{
"valueString" : "Dosage"
}
]
}
],
"rule" : [
{
"name" : "routeCode",
"source" : [
{
"context" : "sub",
"element" : "routeCode",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "dosage",
"contextType" : "variable",
"element" : "route",
"variable" : "vvv",
"transform" : "create"
}
]
}
]
},
{
"name" : "dosage",
"source" : [
{
"context" : "sub"
}
],
"target" : [
{
"context" : "medRq",
"contextType" : "variable",
"element" : "dosageInstruction",
"variable" : "dosage",
"transform" : "create",
"parameter" : [
{
"valueString" : "Dosage"
}
]
}
],
"rule" : [
{
"name" : "approachSiteCode",
"source" : [
{
"context" : "sub",
"element" : "approachSiteCode",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "dosage",
"contextType" : "variable",
"element" : "site",
"variable" : "vvv",
"transform" : "create"
}
]
}
]
},
{
"name" : "doseQuant",
"source" : [
{
"context" : "sub",
"element" : "doseQuantity",
"variable" : "doseQuant"
}
],
"rule" : [
{
"name" : "Dosage",
"source" : [
{
"context" : "doseQuant"
}
],
"target" : [
{
"context" : "medRq",
"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" : "dosageRate",
"source" : [
{
"context" : "sub",
"element" : "rateQuantity",
"variable" : "rateQuantity"
}
],
"target" : [
{
"context" : "medRq",
"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" : "qualcosa",
"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" : "admnistrationUnicode",
"source" : [
{
"context" : "sub"
}
],
"target" : [
{
"context" : "bundle",
"contextType" : "variable",
"element" : "entry",
"variable" : "e1"
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "request",
"variable" : "request",
"transform" : "create",
"parameter" : [
{
"valueString" : "BackboneElement"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "method",
"transform" : "copy",
"parameter" : [
{
"valueString" : "POST"
}
]
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "resource",
"variable" : "medication",
"transform" : "create",
"parameter" : [
{
"valueString" : "Medication"
}
]
},
{
"context" : "medication",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid1",
"transform" : "uuid"
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "https://example/Medication/"
},
{
"valueId" : "uuid1"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "url",
"transform" : "copy",
"parameter" : [
{
"valueString" : "Medication"
}
]
},
{
"context" : "medRq",
"contextType" : "variable",
"element" : "medication",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Medication/' + %medication.id"
}
]
}
],
"rule" : [
{
"name" : "administrationUnitCode",
"source" : [
{
"context" : "sub",
"element" : "administrationUnitCode",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "medication",
"contextType" : "variable",
"element" : "form",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "cons",
"source" : [
{
"context" : "sub",
"element" : "consumable",
"variable" : "cons"
}
],
"rule" : [
{
"name" : "manumat",
"source" : [
{
"context" : "cons",
"element" : "manufacturedProduct",
"variable" : "manuprod"
}
],
"rule" : [
{
"name" : "manuFact",
"source" : [
{
"context" : "manuprod",
"element" : "manufacturedMaterial",
"variable" : "manufact"
}
],
"rule" : [
{
"name" : "code",
"source" : [
{
"context" : "manufact",
"element" : "code",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "medication",
"contextType" : "variable",
"element" : "code",
"variable" : "vvv",
"transform" : "create"
}
]
}
]
}
]
}
]
},
{
"name" : "entryR",
"source" : [
{
"context" : "sub",
"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" : "sub",
"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" : "participant",
"source" : [
{
"context" : "sub",
"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" : "participant",
"transform" : "create",
"parameter" : [
{
"valueString" : "Practitioner"
}
]
},
{
"context" : "participant",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid1",
"transform" : "uuid"
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "https://example/Participant/"
},
{
"valueId" : "uuid1"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "url",
"transform" : "append",
"parameter" : [
{
"valueString" : "Participant/"
},
{
"valueId" : "uuid1"
}
]
}
],
"rule" : [
{
"name" : "authoredOn",
"source" : [
{
"context" : "part",
"element" : "time",
"variable" : "t"
}
],
"target" : [
{
"context" : "medRq",
"contextType" : "variable",
"element" : "authoredOn",
"variable" : "date",
"transform" : "create",
"parameter" : [
{
"valueString" : "dateTime"
}
]
}
],
"dependent" : [
{
"name" : "TSDateTime",
"variable" : [
"t",
"date"
]
}
]
},
{
"name" : "partRole",
"source" : [
{
"context" : "part",
"element" : "participantRole",
"variable" : "partRole"
}
],
"rule" : [
{
"name" : "meta",
"source" : [
{
"context" : "partRole"
}
],
"target" : [
{
"context" : "participant",
"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/TerapiaFarmacologicaDimissione/participant"
}
]
}
]
}
]
}
]
},
{
"name" : "identifier",
"source" : [
{
"context" : "partRole",
"element" : "id",
"variable" : "id"
}
],
"target" : [
{
"context" : "participant",
"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" : "participant",
"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" : "uuid2"
}
]
},
{
"context" : "medRq",
"contextType" : "variable",
"element" : "requester",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Practitioner/' + %participant.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" : "playent",
"source" : [
{
"context" : "partRole",
"element" : "playingEntity",
"variable" : "playent"
}
],
"rule" : [
{
"name" : "name",
"source" : [
{
"context" : "playent",
"element" : "name",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "participant",
"contextType" : "variable",
"element" : "name",
"variable" : "vvv",
"transform" : "create"
}
]
}
]
}
]
}
]
},
{
"name" : "ref",
"source" : [
{
"context" : "sub",
"element" : "reference",
"variable" : "ref"
}
],
"rule" : [
{
"name" : "external",
"source" : [
{
"context" : "ref",
"element" : "externalAct",
"variable" : "external"
}
],
"rule" : [
{
"name" : "id",
"source" : [
{
"context" : "external",
"element" : "id",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "medRq",
"contextType" : "variable",
"element" : "identifier",
"variable" : "vvv",
"transform" : "create"
}
]
}
]
}
]
},
{
"name" : "med",
"source" : [
{
"context" : "sub",
"element" : "entryRelationship",
"variable" : "entryRelationship"
}
],
"rule" : [
{
"name" : "sub",
"source" : [
{
"context" : "entryRelationship",
"element" : "supply",
"variable" : "sup"
}
],
"target" : [
{
"context" : "medRq",
"contextType" : "variable",
"element" : "dispenseRequest",
"variable" : "dispreq"
}
],
"rule" : [
{
"name" : "quantity",
"source" : [
{
"context" : "sup"
}
],
"target" : [
{
"context" : "dispreq",
"contextType" : "variable",
"element" : "quantity",
"variable" : "quantity",
"transform" : "create",
"parameter" : [
{
"valueString" : "SimpleQuantity"
}
]
}
],
"rule" : [
{
"name" : "quantity",
"source" : [
{
"context" : "sup",
"element" : "quantity",
"variable" : "q"
}
],
"target" : [
{
"context" : "quantity",
"contextType" : "variable",
"element" : "value",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "q.value"
}
]
}
]
}
]
}
]
}
]
}
]
}
]
}
]
}
]
}
],
"documentation" : "Sezione Strutturata------------------------------------------------------------------------------------------------------------------------------------------"
}
]
},
{
"name" : "ModalitadiTrasposto",
"typeMode" : "none",
"documentation" : "-----------------------------------------------------------------------------------------------------------------------\r\n______1._____________Sections________________________",
"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" : "entry",
"variable" : "entry1"
}
],
"rule" : [
{
"name" : "entry1",
"source" : [
{
"context" : "src",
"element" : "entry",
"variable" : "entry1"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "entry",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Encounter/' + %enc.id"
}
]
}
],
"rule" : [
{
"name" : "act",
"source" : [
{
"context" : "entry1",
"element" : "act",
"variable" : "act1"
}
],
"dependent" : [
{
"name" : "Act",
"variable" : [
"act1",
"patient",
"enc",
"bundle"
]
}
]
}
]
}
]
}
]
},
{
"name" : "MotivoDellaVisita",
"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" : "entry",
"variable" : "entry"
}
],
"target" : [
{
"context" : "bundle",
"contextType" : "variable",
"element" : "entry",
"variable" : "e2"
},
{
"context" : "e2",
"contextType" : "variable",
"element" : "request",
"variable" : "request",
"transform" : "create",
"parameter" : [
{
"valueString" : "BackboneElement"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "method",
"transform" : "copy",
"parameter" : [
{
"valueString" : "POST"
}
]
},
{
"context" : "e2",
"contextType" : "variable",
"element" : "resource",
"variable" : "observation",
"transform" : "create",
"parameter" : [
{
"valueString" : "Observation"
}
]
},
{
"context" : "observation",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid2",
"transform" : "uuid"
},
{
"context" : "e2",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "https://example/Observation/"
},
{
"valueId" : "uuid2"
}
]
},
{
"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" : "observation",
"source" : [
{
"context" : "entry",
"element" : "observation",
"variable" : "obs"
}
],
"dependent" : [
{
"name" : "Observation",
"variable" : [
"obs",
"patient",
"enc",
"observation",
"bundle"
]
}
]
}
]
}
]
},
{
"name" : "Triage",
"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" : "entry",
"variable" : "entry"
}
],
"target" : [
{
"context" : "bundle",
"contextType" : "variable",
"element" : "entry",
"variable" : "e2"
},
{
"context" : "e2",
"contextType" : "variable",
"element" : "request",
"variable" : "request",
"transform" : "create",
"parameter" : [
{
"valueString" : "BackboneElement"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "method",
"transform" : "copy",
"parameter" : [
{
"valueString" : "POST"
}
]
},
{
"context" : "e2",
"contextType" : "variable",
"element" : "resource",
"variable" : "observation",
"transform" : "create",
"parameter" : [
{
"valueString" : "Observation"
}
]
},
{
"context" : "observation",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid2",
"transform" : "uuid"
},
{
"context" : "e2",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "https://example/Observation/"
},
{
"valueId" : "uuid2"
}
]
},
{
"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" : "observation",
"source" : [
{
"context" : "entry",
"element" : "observation",
"variable" : "obs"
}
],
"dependent" : [
{
"name" : "Observation",
"variable" : [
"obs",
"patient",
"enc",
"observation",
"bundle"
]
}
]
}
]
}
]
},
{
"name" : "InquadramentoClinicoIniziale",
"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" : "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" : "Author",
"source" : [
{
"context" : "src",
"element" : "author",
"variable" : "author"
}
],
"rule" : [
{
"name" : "practitioner",
"source" : [
{
"context" : "author"
}
],
"target" : [
{
"context" : "bundle",
"contextType" : "variable",
"element" : "entry",
"variable" : "e2"
},
{
"context" : "e2",
"contextType" : "variable",
"element" : "request",
"variable" : "request",
"transform" : "create",
"parameter" : [
{
"valueString" : "BackboneElement"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "method",
"transform" : "copy",
"parameter" : [
{
"valueString" : "PUT"
}
]
},
{
"context" : "e2",
"contextType" : "variable",
"element" : "resource",
"variable" : "practitioner",
"transform" : "create",
"parameter" : [
{
"valueString" : "Practitioner"
}
]
}
],
"rule" : [
{
"name" : "assignedAuthor",
"source" : [
{
"context" : "author",
"element" : "assignedAuthor",
"variable" : "assignedAuthor"
}
],
"rule" : [
{
"name" : "meta",
"source" : [
{
"context" : "assignedAuthor"
}
],
"target" : [
{
"context" : "practitioner",
"contextType" : "variable",
"element" : "meta",
"variable" : "meta"
}
],
"rule" : [
{
"name" : "coding",
"source" : [
{
"context" : "assignedAuthor"
}
],
"target" : [
{
"context" : "meta",
"contextType" : "variable",
"element" : "tag",
"variable" : "coding",
"transform" : "create",
"parameter" : [
{
"valueString" : "Coding"
}
]
}
],
"rule" : [
{
"name" : "system",
"source" : [
{
"context" : "assignedAuthor"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "system",
"transform" : "copy",
"parameter" : [
{
"valueString" : "http://algoritmodiscoring"
}
]
}
]
},
{
"name" : "code",
"source" : [
{
"context" : "assignedAuthor"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "code",
"transform" : "copy",
"parameter" : [
{
"valueString" : "ClinicalDocument/body/InquadramentoClinicoIniziale/author"
}
]
}
]
}
]
}
]
},
{
"name" : "identifier",
"source" : [
{
"context" : "assignedAuthor",
"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" : "e2",
"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" : "uuid2"
}
]
},
{
"context" : "note",
"contextType" : "variable",
"element" : "author",
"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" : "assignedAuthor",
"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" : "name",
"source" : [
{
"context" : "assignedAuthor",
"element" : "assignedPerson",
"variable" : "person"
}
],
"rule" : [
{
"name" : "name",
"source" : [
{
"context" : "person",
"element" : "name",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "practitioner",
"contextType" : "variable",
"element" : "name",
"variable" : "vvv",
"transform" : "create"
}
]
}
]
}
]
}
]
},
{
"name" : "time",
"source" : [
{
"context" : "author",
"element" : "time",
"variable" : "t"
}
],
"target" : [
{
"context" : "note",
"contextType" : "variable",
"element" : "time",
"variable" : "value",
"transform" : "create",
"parameter" : [
{
"valueString" : "dateTime"
}
]
}
],
"dependent" : [
{
"name" : "TSDateTime",
"variable" : [
"t",
"value"
]
}
]
}
]
},
{
"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" : "Sottosection",
"source" : [
{
"context" : "component",
"element" : "section",
"variable" : "sottosection"
}
],
"rule" : [
{
"name" : "Sectionfhir",
"source" : [
{
"context" : "sottosection"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "section",
"variable" : "section"
}
],
"rule" : [
{
"name" : "code",
"source" : [
{
"context" : "sottosection",
"element" : "code",
"variable" : "vvv",
"condition" : "(code = '11329-0')"
}
],
"target" : [
{
"context" : "section",
"contextType" : "variable",
"element" : "code",
"variable" : "vvv",
"transform" : "create"
}
],
"documentation" : "1. Anamnesi Narrativa-------------------------------------------------------------------------------------------------------------------------------------------"
},
{
"name" : "11329-0",
"source" : [
{
"context" : "sottosection",
"element" : "code",
"variable" : "code1",
"condition" : "(code = '11329-0')"
}
],
"rule" : [
{
"name" : "where",
"source" : [
{
"context" : "src",
"condition" : "sottosection.entry.exists().not()"
}
],
"rule" : [
{
"name" : "title",
"source" : [
{
"context" : "sottosection",
"element" : "title",
"variable" : "t"
}
],
"target" : [
{
"context" : "section",
"contextType" : "variable",
"element" : "title",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "t.dataString"
}
]
}
]
},
{
"name" : "cdaText",
"source" : [
{
"context" : "sottosection",
"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" : "section",
"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" : "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" : "code",
"source" : [
{
"context" : "sottosection",
"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" : "author",
"source" : [
{
"context" : "sottosection",
"element" : "author",
"variable" : "authors"
}
],
"rule" : [
{
"name" : "timeAuthor",
"source" : [
{
"context" : "authors",
"element" : "time",
"variable" : "time"
}
],
"target" : [
{
"context" : "note",
"contextType" : "variable",
"element" : "time",
"variable" : "value",
"transform" : "create",
"parameter" : [
{
"valueString" : "dateTime"
}
]
}
],
"dependent" : [
{
"name" : "TSDateTime",
"variable" : [
"time",
"value"
]
}
]
},
{
"name" : "assighedAuthor",
"source" : [
{
"context" : "authors",
"element" : "assignedAuthor",
"variable" : "assignedAuthor"
}
],
"target" : [
{
"context" : "bundle",
"contextType" : "variable",
"element" : "entry",
"variable" : "e9"
},
{
"context" : "e9",
"contextType" : "variable",
"element" : "request",
"variable" : "request",
"transform" : "create",
"parameter" : [
{
"valueString" : "BackboneElement"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "method",
"transform" : "copy",
"parameter" : [
{
"valueString" : "PUT"
}
]
},
{
"context" : "e9",
"contextType" : "variable",
"element" : "resource",
"variable" : "practitioner",
"transform" : "create",
"parameter" : [
{
"valueString" : "Practitioner"
}
]
}
],
"rule" : [
{
"name" : "meta",
"source" : [
{
"context" : "assignedAuthor"
}
],
"target" : [
{
"context" : "practitioner",
"contextType" : "variable",
"element" : "meta",
"variable" : "meta"
}
],
"rule" : [
{
"name" : "coding",
"source" : [
{
"context" : "assignedAuthor"
}
],
"target" : [
{
"context" : "meta",
"contextType" : "variable",
"element" : "tag",
"variable" : "coding",
"transform" : "create",
"parameter" : [
{
"valueString" : "Coding"
}
]
}
],
"rule" : [
{
"name" : "system",
"source" : [
{
"context" : "assignedAuthor"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "system",
"transform" : "copy",
"parameter" : [
{
"valueString" : "http://algoritmodiscoring"
}
]
}
]
},
{
"name" : "code",
"source" : [
{
"context" : "assignedAuthor"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "code",
"transform" : "copy",
"parameter" : [
{
"valueString" : "ClinicalDocument/body/EsameObiettivo/author"
}
]
}
]
}
]
}
]
},
{
"name" : "identifier",
"source" : [
{
"context" : "assignedAuthor",
"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" : "autore",
"source" : [
{
"context" : "id",
"element" : "extension",
"variable" : "ext"
}
],
"target" : [
{
"context" : "practitioner",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid9",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "r + '-' + ext"
}
]
},
{
"context" : "e9",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "https://example/Practitioner/"
},
{
"valueId" : "uuid9"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "url",
"transform" : "append",
"parameter" : [
{
"valueString" : "Practitioner/"
},
{
"valueId" : "uuid9"
}
]
},
{
"context" : "note",
"contextType" : "variable",
"element" : "author",
"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" : "assignedAuthor",
"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" : "assignedPerson",
"source" : [
{
"context" : "assignedAuthor",
"element" : "assignedPerson",
"variable" : "person"
}
],
"rule" : [
{
"name" : "name",
"source" : [
{
"context" : "person",
"element" : "name",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "practitioner",
"contextType" : "variable",
"element" : "name",
"variable" : "vvv",
"transform" : "create"
}
]
}
]
}
]
}
]
}
]
}
]
}
]
},
{
"name" : "subsection1",
"source" : [
{
"context" : "sottosection",
"element" : "entry",
"variable" : "entry1"
}
],
"rule" : [
{
"name" : "entryobservation1",
"source" : [
{
"context" : "entry1",
"element" : "observation",
"variable" : "obs"
}
],
"rule" : [
{
"name" : "89261-2",
"source" : [
{
"context" : "obs",
"element" : "code",
"condition" : "(code = '75326-9')"
}
],
"rule" : [
{
"name" : "condition",
"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" : "section",
"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" : "cdaText1",
"source" : [
{
"context" : "sottosection",
"element" : "text",
"variable" : "cdaText1"
}
],
"target" : [
{
"context" : "condition",
"contextType" : "variable",
"element" : "note",
"variable" : "note"
}
],
"rule" : [
{
"name" : "reference",
"source" : [
{
"context" : "cdaText1",
"variable" : "t"
}
],
"target" : [
{
"context" : "note",
"contextType" : "variable",
"element" : "text",
"transform" : "copy",
"parameter" : [
{
"valueId" : "t"
}
]
}
]
},
{
"name" : "author",
"source" : [
{
"context" : "sottosection",
"element" : "author",
"variable" : "authors"
}
],
"rule" : [
{
"name" : "timeAuthor",
"source" : [
{
"context" : "authors",
"element" : "time",
"variable" : "time"
}
],
"target" : [
{
"context" : "note",
"contextType" : "variable",
"element" : "time",
"variable" : "value",
"transform" : "create",
"parameter" : [
{
"valueString" : "dateTime"
}
]
}
],
"dependent" : [
{
"name" : "TSDateTime",
"variable" : [
"time",
"value"
]
}
]
},
{
"name" : "assighedAuthor",
"source" : [
{
"context" : "authors",
"element" : "assignedAuthor",
"variable" : "assignedAuthor"
}
],
"target" : [
{
"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" : "PUT"
}
]
},
{
"context" : "e5",
"contextType" : "variable",
"element" : "resource",
"variable" : "practitioner",
"transform" : "create",
"parameter" : [
{
"valueString" : "Practitioner"
}
]
}
],
"rule" : [
{
"name" : "meta",
"source" : [
{
"context" : "assignedAuthor"
}
],
"target" : [
{
"context" : "practitioner",
"contextType" : "variable",
"element" : "meta",
"variable" : "meta"
}
],
"rule" : [
{
"name" : "coding",
"source" : [
{
"context" : "assignedAuthor"
}
],
"target" : [
{
"context" : "meta",
"contextType" : "variable",
"element" : "tag",
"variable" : "coding",
"transform" : "create",
"parameter" : [
{
"valueString" : "Coding"
}
]
}
],
"rule" : [
{
"name" : "system",
"source" : [
{
"context" : "assignedAuthor"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "system",
"transform" : "copy",
"parameter" : [
{
"valueString" : "http://algoritmodiscoring"
}
]
}
]
},
{
"name" : "code",
"source" : [
{
"context" : "assignedAuthor"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "code",
"transform" : "copy",
"parameter" : [
{
"valueString" : "ClinicalDocument/body/Anamnesi/author"
}
]
}
]
}
]
}
]
},
{
"name" : "identifier",
"source" : [
{
"context" : "assignedAuthor",
"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" : "extension",
"source" : [
{
"context" : "id",
"element" : "extension",
"variable" : "ext"
}
],
"target" : [
{
"context" : "practitioner",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid5",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "r + '-' + ext"
}
]
},
{
"context" : "e5",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "https://example/Practitioner/"
},
{
"valueId" : "uuid5"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "url",
"transform" : "append",
"parameter" : [
{
"valueString" : "Practitioner/"
},
{
"valueId" : "uuid5"
}
]
},
{
"context" : "note",
"contextType" : "variable",
"element" : "author",
"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" : "assignedAuthor",
"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" : "assignedPerson",
"source" : [
{
"context" : "assignedAuthor",
"element" : "assignedPerson",
"variable" : "person"
}
],
"rule" : [
{
"name" : "name",
"source" : [
{
"context" : "person",
"element" : "name",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "practitioner",
"contextType" : "variable",
"element" : "name",
"variable" : "vvv",
"transform" : "create"
}
]
}
]
}
]
}
]
}
],
"documentation" : "blocco Narrativo"
},
{
"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" : "onsetDateTime",
"source" : [
{
"context" : "obs",
"element" : "effectiveTime",
"variable" : "effectiveTime"
}
],
"target" : [
{
"context" : "condition",
"contextType" : "variable",
"element" : "onset",
"variable" : "value",
"transform" : "create",
"parameter" : [
{
"valueString" : "dateTime"
}
]
}
],
"dependent" : [
{
"name" : "TSDateTime",
"variable" : [
"effectiveTime",
"value"
]
}
]
},
{
"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" : "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" : "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" : "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" : "observation",
"contextType" : "variable",
"element" : "value",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "int.value"
}
]
}
]
},
{
"name" : "boolean",
"source" : [
{
"context" : "observation2",
"type" : "BL",
"element" : "value",
"variable" : "boolean"
}
],
"target" : [
{
"context" : "observation",
"contextType" : "variable",
"element" : "value",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "boolean.value"
}
]
}
]
},
{
"name" : "value",
"source" : [
{
"context" : "observation2",
"type" : "ST",
"element" : "value",
"variable" : "value"
}
],
"target" : [
{
"context" : "observation",
"contextType" : "variable",
"element" : "value",
"transform" : "create",
"parameter" : [
{
"valueString" : "string"
}
]
},
{
"context" : "observation",
"contextType" : "variable",
"element" : "value",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "value.dataString"
}
]
}
]
},
{
"name" : "value2",
"source" : [
{
"context" : "observation2",
"element" : "effectiveTime",
"variable" : "effectiveTime"
}
],
"target" : [
{
"context" : "observation",
"contextType" : "variable",
"element" : "effective",
"variable" : "value",
"transform" : "create",
"parameter" : [
{
"valueString" : "dateTime"
}
]
}
],
"dependent" : [
{
"name" : "TSDateTime",
"variable" : [
"effectiveTime",
"value"
]
}
]
},
{
"name" : "where",
"source" : [
{
"context" : "observation2",
"condition" : "effectiveTime.low.exists() or effectiveTime.high.exists()"
}
],
"rule" : [
{
"name" : "effectiveTime",
"source" : [
{
"context" : "observation2",
"element" : "effectiveTime",
"variable" : "eff"
}
],
"target" : [
{
"context" : "observation",
"contextType" : "variable",
"element" : "effective",
"variable" : "period",
"transform" : "create",
"parameter" : [
{
"valueString" : "Period"
}
]
}
],
"dependent" : [
{
"name" : "IVLTSPeriod",
"variable" : [
"eff",
"period"
]
}
]
}
]
},
{
"name" : "valueQuantity",
"source" : [
{
"context" : "observation2",
"type" : "PQ",
"element" : "value",
"variable" : "val"
}
],
"rule" : [
{
"name" : "quantity",
"source" : [
{
"context" : "val"
}
],
"target" : [
{
"context" : "observation",
"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" : "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"
}
]
}
]
}
]
}
]
}
]
}
]
}
]
}
]
}
]
}
]
}
]
}
]
},
{
"name" : "observation1",
"source" : [
{
"context" : "entry1",
"element" : "organizer",
"variable" : "organizer"
}
],
"rule" : [
{
"name" : "10157-6",
"source" : [
{
"context" : "organizer",
"element" : "code",
"condition" : "(code = '10157-6')"
}
],
"rule" : [
{
"name" : "organizer",
"source" : [
{
"context" : "organizer"
}
],
"target" : [
{
"context" : "bundle",
"contextType" : "variable",
"element" : "entry",
"variable" : "e4"
},
{
"context" : "e4",
"contextType" : "variable",
"element" : "request",
"variable" : "request",
"transform" : "create",
"parameter" : [
{
"valueString" : "BackboneElement"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "method",
"transform" : "copy",
"parameter" : [
{
"valueString" : "POST"
}
]
},
{
"context" : "e4",
"contextType" : "variable",
"element" : "resource",
"variable" : "FamilyMemberHistory",
"transform" : "create",
"parameter" : [
{
"valueString" : "FamilyMemberHistory"
}
]
},
{
"context" : "FamilyMemberHistory",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid5",
"transform" : "uuid"
},
{
"context" : "e4",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "https://example/FamilyMemberHistory/"
},
{
"valueId" : "uuid5"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "url",
"transform" : "copy",
"parameter" : [
{
"valueString" : "FamilyMemberHistory"
}
]
},
{
"context" : "section",
"contextType" : "variable",
"element" : "entry",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/FamilyMemberHistory/' + %FamilyMemberHistory.id"
}
]
}
],
"rule" : [
{
"name" : "effective",
"source" : [
{
"context" : "organizer",
"element" : "effectiveTime",
"variable" : "effective"
}
],
"rule" : [
{
"name" : "date",
"source" : [
{
"context" : "effective",
"element" : "value",
"variable" : "eff"
}
],
"target" : [
{
"context" : "FamilyMemberHistory",
"contextType" : "variable",
"element" : "date",
"variable" : "value",
"transform" : "create",
"parameter" : [
{
"valueString" : "dateTime"
}
]
}
],
"dependent" : [
{
"name" : "TSDateTime",
"variable" : [
"eff",
"value"
]
}
]
}
]
},
{
"name" : "reference",
"source" : [
{
"context" : "organizer"
}
],
"target" : [
{
"context" : "FamilyMemberHistory",
"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" : "subject",
"source" : [
{
"context" : "organizer",
"element" : "subject",
"variable" : "subject"
}
],
"rule" : [
{
"name" : "relatedSubject",
"source" : [
{
"context" : "subject",
"element" : "relatedSubject",
"variable" : "relatedSubject"
}
],
"rule" : [
{
"name" : "relationship",
"source" : [
{
"context" : "relatedSubject",
"element" : "code",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "FamilyMemberHistory",
"contextType" : "variable",
"element" : "relationship",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "subject1",
"source" : [
{
"context" : "relatedSubject",
"element" : "subject",
"variable" : "subject"
}
],
"target" : [
{
"context" : "FamilyMemberHistory",
"contextType" : "variable",
"element" : "sex",
"variable" : "sex"
}
],
"rule" : [
{
"name" : "coding",
"source" : [
{
"context" : "subject",
"element" : "administrativeGenderCode",
"variable" : "administrativeGenderCode"
}
],
"target" : [
{
"context" : "sex",
"contextType" : "variable",
"element" : "coding",
"variable" : "coding"
}
],
"rule" : [
{
"name" : "gender",
"source" : [
{
"context" : "administrativeGenderCode",
"element" : "code",
"variable" : "code"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "code",
"transform" : "translate",
"parameter" : [
{
"valueId" : "code"
},
{
"valueString" : "#AdministrativeGender"
},
{
"valueString" : "code"
}
]
}
]
},
{
"name" : "system",
"source" : [
{
"context" : "administrativeGenderCode"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "system",
"transform" : "copy",
"parameter" : [
{
"valueString" : "http://hl7.org/fhir/administrative-gender"
}
]
}
]
}
]
}
]
}
]
}
]
},
{
"name" : "cdaText1",
"source" : [
{
"context" : "sottosection",
"element" : "text",
"variable" : "cdaText1"
}
],
"target" : [
{
"context" : "FamilyMemberHistory",
"contextType" : "variable",
"element" : "note",
"variable" : "note"
}
],
"rule" : [
{
"name" : "reference",
"source" : [
{
"context" : "cdaText1",
"variable" : "t"
}
],
"target" : [
{
"context" : "note",
"contextType" : "variable",
"element" : "text",
"transform" : "copy",
"parameter" : [
{
"valueId" : "t"
}
]
}
]
},
{
"name" : "author",
"source" : [
{
"context" : "sottosection",
"element" : "author",
"variable" : "authors"
}
],
"rule" : [
{
"name" : "timeAuthor",
"source" : [
{
"context" : "authors",
"element" : "time",
"variable" : "time"
}
],
"target" : [
{
"context" : "note",
"contextType" : "variable",
"element" : "time",
"variable" : "value",
"transform" : "create",
"parameter" : [
{
"valueString" : "dateTime"
}
]
}
],
"dependent" : [
{
"name" : "TSDateTime",
"variable" : [
"time",
"value"
]
}
]
},
{
"name" : "assighedAuthor",
"source" : [
{
"context" : "authors",
"element" : "assignedAuthor",
"variable" : "assignedAuthor"
}
],
"target" : [
{
"context" : "bundle",
"contextType" : "variable",
"element" : "entry",
"variable" : "e7"
},
{
"context" : "e7",
"contextType" : "variable",
"element" : "request",
"variable" : "request",
"transform" : "create",
"parameter" : [
{
"valueString" : "BackboneElement"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "method",
"transform" : "copy",
"parameter" : [
{
"valueString" : "PUT"
}
]
},
{
"context" : "e7",
"contextType" : "variable",
"element" : "resource",
"variable" : "practitioner",
"transform" : "create",
"parameter" : [
{
"valueString" : "Practitioner"
}
]
}
],
"rule" : [
{
"name" : "meta",
"source" : [
{
"context" : "assignedAuthor"
}
],
"target" : [
{
"context" : "practitioner",
"contextType" : "variable",
"element" : "meta",
"variable" : "meta"
}
],
"rule" : [
{
"name" : "coding",
"source" : [
{
"context" : "assignedAuthor"
}
],
"target" : [
{
"context" : "meta",
"contextType" : "variable",
"element" : "tag",
"variable" : "coding",
"transform" : "create",
"parameter" : [
{
"valueString" : "Coding"
}
]
}
],
"rule" : [
{
"name" : "system",
"source" : [
{
"context" : "assignedAuthor"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "system",
"transform" : "copy",
"parameter" : [
{
"valueString" : "http://algoritmodiscoring"
}
]
}
]
},
{
"name" : "code",
"source" : [
{
"context" : "assignedAuthor"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "code",
"transform" : "copy",
"parameter" : [
{
"valueString" : "ClinicalDocument/body/Anamnesi/author"
}
]
}
]
}
]
}
]
},
{
"name" : "identifier",
"source" : [
{
"context" : "assignedAuthor",
"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" : "extension",
"source" : [
{
"context" : "id",
"element" : "extension",
"variable" : "ext"
}
],
"target" : [
{
"context" : "practitioner",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid7",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "r + '-' + ext"
}
]
},
{
"context" : "e7",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "https://example/Practitioner/"
},
{
"valueId" : "uuid7"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "url",
"transform" : "append",
"parameter" : [
{
"valueString" : "Practitioner/"
},
{
"valueId" : "uuid7"
}
]
},
{
"context" : "note",
"contextType" : "variable",
"element" : "author",
"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" : "assignedAuthor",
"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" : "assignedPerson",
"source" : [
{
"context" : "assignedAuthor",
"element" : "assignedPerson",
"variable" : "person"
}
],
"rule" : [
{
"name" : "name",
"source" : [
{
"context" : "person",
"element" : "name",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "practitioner",
"contextType" : "variable",
"element" : "name",
"variable" : "vvv",
"transform" : "create"
}
]
}
]
}
]
}
]
}
],
"documentation" : "blocco Narrativo"
},
{
"name" : "component",
"source" : [
{
"context" : "organizer",
"element" : "component",
"variable" : "component"
}
],
"target" : [
{
"context" : "FamilyMemberHistory",
"contextType" : "variable",
"element" : "condition",
"variable" : "condition"
}
],
"rule" : [
{
"name" : "observationCondition",
"source" : [
{
"context" : "component",
"element" : "observation",
"variable" : "observation"
}
],
"rule" : [
{
"name" : "code",
"source" : [
{
"context" : "observation",
"element" : "code",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "condition",
"contextType" : "variable",
"element" : "code",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "reference",
"source" : [
{
"context" : "observation",
"element" : "text",
"variable" : "text"
}
],
"target" : [
{
"context" : "FamilyMemberHistory",
"contextType" : "variable",
"element" : "note",
"variable" : "note"
}
],
"rule" : [
{
"name" : "value",
"source" : [
{
"context" : "text",
"element" : "reference",
"variable" : "reference"
}
],
"target" : [
{
"context" : "note",
"contextType" : "variable",
"element" : "text",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "reference.value"
}
]
}
]
}
]
},
{
"name" : "statusCode",
"source" : [
{
"context" : "observation",
"element" : "statusCode",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "FamilyMemberHistory",
"contextType" : "variable",
"element" : "status",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "codeable",
"source" : [
{
"context" : "observation",
"element" : "value",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "condition",
"contextType" : "variable",
"element" : "outcome",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "EntryRel",
"source" : [
{
"context" : "observation",
"element" : "entryRelationship",
"variable" : "entryRelationship"
}
],
"rule" : [
{
"name" : "obser",
"source" : [
{
"context" : "entryRelationship",
"element" : "observation",
"variable" : "obsservation1"
}
],
"rule" : [
{
"name" : "code",
"source" : [
{
"context" : "obsservation1",
"element" : "code",
"variable" : "code"
}
],
"rule" : [
{
"name" : "insorgenza",
"source" : [
{
"context" : "code",
"element" : "code",
"condition" : "(code.code = '35267-4')"
}
],
"rule" : [
{
"name" : "value",
"source" : [
{
"context" : "obsservation1",
"element" : "value",
"variable" : "value"
}
],
"target" : [
{
"context" : "condition",
"contextType" : "variable",
"element" : "onset",
"variable" : "Age",
"transform" : "create",
"parameter" : [
{
"valueString" : "Age"
}
]
}
],
"rule" : [
{
"name" : "age",
"source" : [
{
"context" : "value",
"element" : "value",
"variable" : "valueAge"
}
],
"target" : [
{
"context" : "Age",
"contextType" : "variable",
"element" : "value",
"transform" : "copy",
"parameter" : [
{
"valueId" : "valueAge"
}
]
}
]
},
{
"name" : "unit",
"source" : [
{
"context" : "value",
"element" : "unit",
"variable" : "unit"
}
],
"target" : [
{
"context" : "Age",
"contextType" : "variable",
"element" : "code",
"transform" : "copy",
"parameter" : [
{
"valueId" : "unit"
}
]
}
]
},
{
"name" : "unit",
"source" : [
{
"context" : "value",
"element" : "unit",
"variable" : "unit"
}
],
"target" : [
{
"context" : "Age",
"contextType" : "variable",
"element" : "unit",
"transform" : "copy",
"parameter" : [
{
"valueId" : "unit"
}
]
}
]
},
{
"name" : "system",
"source" : [
{
"context" : "value"
}
],
"target" : [
{
"context" : "Age",
"contextType" : "variable",
"element" : "system",
"transform" : "copy",
"parameter" : [
{
"valueString" : "http://unitsofmeasure.org"
}
]
}
]
}
]
}
]
}
]
},
{
"name" : "code",
"source" : [
{
"context" : "obsservation1",
"element" : "code",
"variable" : "code"
}
],
"rule" : [
{
"name" : "deceased",
"source" : [
{
"context" : "code",
"element" : "code",
"condition" : "(code.code = '39016-1')"
}
],
"rule" : [
{
"name" : "value",
"source" : [
{
"context" : "obsservation1",
"element" : "value",
"variable" : "value"
}
],
"target" : [
{
"context" : "FamilyMemberHistory",
"contextType" : "variable",
"element" : "deceased",
"variable" : "Age",
"transform" : "create",
"parameter" : [
{
"valueString" : "Age"
}
]
}
],
"rule" : [
{
"name" : "age",
"source" : [
{
"context" : "value",
"element" : "value",
"variable" : "valueAge"
}
],
"target" : [
{
"context" : "Age",
"contextType" : "variable",
"element" : "value",
"transform" : "copy",
"parameter" : [
{
"valueId" : "valueAge"
}
]
}
]
},
{
"name" : "unit",
"source" : [
{
"context" : "value",
"element" : "unit",
"variable" : "unit"
}
],
"target" : [
{
"context" : "Age",
"contextType" : "variable",
"element" : "code",
"transform" : "copy",
"parameter" : [
{
"valueId" : "unit"
}
]
}
]
},
{
"name" : "unit",
"source" : [
{
"context" : "value",
"element" : "unit",
"variable" : "unit"
}
],
"target" : [
{
"context" : "Age",
"contextType" : "variable",
"element" : "unit",
"transform" : "copy",
"parameter" : [
{
"valueId" : "unit"
}
]
}
]
},
{
"name" : "system",
"source" : [
{
"context" : "value"
}
],
"target" : [
{
"context" : "Age",
"contextType" : "variable",
"element" : "system",
"transform" : "copy",
"parameter" : [
{
"valueString" : "http://unitsofmeasure.org"
}
]
}
]
}
]
}
]
}
]
}
]
}
]
},
{
"name" : "cont",
"source" : [
{
"context" : "observation",
"condition" : "observation.effectiveTime.exists()"
}
],
"rule" : [
{
"name" : "effttemp",
"source" : [
{
"context" : "observation",
"element" : "effectiveTime",
"variable" : "effectiveTime"
}
],
"target" : [
{
"context" : "FamilyMemberHistory",
"contextType" : "variable",
"element" : "condition",
"variable" : "condition",
"transform" : "create",
"parameter" : [
{
"valueString" : "BackboneElement"
}
]
}
],
"rule" : [
{
"name" : "efft",
"source" : [
{
"context" : "effectiveTime"
}
],
"target" : [
{
"context" : "condition",
"contextType" : "variable",
"element" : "onset",
"variable" : "period",
"transform" : "create",
"parameter" : [
{
"valueString" : "Period"
}
]
}
],
"rule" : [
{
"name" : "val",
"source" : [
{
"context" : "effectiveTime"
}
],
"target" : [
{
"context" : "period",
"contextType" : "variable",
"element" : "start",
"variable" : "start",
"transform" : "create",
"parameter" : [
{
"valueString" : "dateTime"
}
]
}
],
"dependent" : [
{
"name" : "TSDateTime",
"variable" : [
"effectiveTime",
"start"
]
}
]
}
]
},
{
"name" : "code",
"source" : [
{
"context" : "observation",
"element" : "code",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "condition",
"contextType" : "variable",
"element" : "code",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "codeable",
"source" : [
{
"context" : "observation",
"element" : "value",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "condition",
"contextType" : "variable",
"element" : "outcome",
"variable" : "vvv",
"transform" : "create"
}
]
}
]
}
]
}
]
}
]
}
]
}
]
}
],
"documentation" : "Anamnesi Familiare---------------------------------------------------------------------------------------------------------------------------------------------"
}
],
"documentation" : "Anamnesi Strutturata-----------------------------------------------------------------------------------------------------------------------------------------"
}
]
},
{
"name" : "code",
"source" : [
{
"context" : "sottosection",
"element" : "code",
"variable" : "vvv",
"condition" : "(code = '29545-1')"
}
],
"target" : [
{
"context" : "section",
"contextType" : "variable",
"element" : "code",
"variable" : "vvv",
"transform" : "create"
}
],
"documentation" : "2. Esame Obiettivo Narrativa-----------------------------------------------------------------------------------------------------------------------------------"
},
{
"name" : "condizioneesameObiettivo",
"source" : [
{
"context" : "sottosection",
"element" : "code",
"variable" : "code1",
"condition" : "(code = '29545-1')"
}
],
"rule" : [
{
"name" : "title",
"source" : [
{
"context" : "sottosection",
"element" : "title",
"variable" : "t"
}
],
"target" : [
{
"context" : "section",
"contextType" : "variable",
"element" : "title",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "t.dataString"
}
]
}
]
},
{
"name" : "cdaText",
"source" : [
{
"context" : "sottosection",
"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" : "section",
"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" : "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" : "code",
"source" : [
{
"context" : "sottosection",
"element" : "code",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "observation",
"contextType" : "variable",
"element" : "code",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "statuscode",
"source" : [
{
"context" : "sottosection",
"condition" : "observation.statusCode.exists().not()"
}
],
"rule" : [
{
"name" : "status",
"source" : [
{
"context" : "sottosection"
}
],
"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" : "author",
"source" : [
{
"context" : "sottosection",
"element" : "author",
"variable" : "authors"
}
],
"rule" : [
{
"name" : "timeAuthor",
"source" : [
{
"context" : "authors",
"element" : "time",
"variable" : "time"
}
],
"target" : [
{
"context" : "note",
"contextType" : "variable",
"element" : "time",
"variable" : "value",
"transform" : "create",
"parameter" : [
{
"valueString" : "dateTime"
}
]
}
],
"dependent" : [
{
"name" : "TSDateTime",
"variable" : [
"time",
"value"
]
}
]
},
{
"name" : "assighedAuthor",
"source" : [
{
"context" : "authors",
"element" : "assignedAuthor",
"variable" : "assignedAuthor"
}
],
"target" : [
{
"context" : "bundle",
"contextType" : "variable",
"element" : "entry",
"variable" : "e9"
},
{
"context" : "e9",
"contextType" : "variable",
"element" : "request",
"variable" : "request",
"transform" : "create",
"parameter" : [
{
"valueString" : "BackboneElement"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "method",
"transform" : "copy",
"parameter" : [
{
"valueString" : "PUT"
}
]
},
{
"context" : "e9",
"contextType" : "variable",
"element" : "resource",
"variable" : "practitioner",
"transform" : "create",
"parameter" : [
{
"valueString" : "Practitioner"
}
]
}
],
"rule" : [
{
"name" : "meta",
"source" : [
{
"context" : "assignedAuthor"
}
],
"target" : [
{
"context" : "practitioner",
"contextType" : "variable",
"element" : "meta",
"variable" : "meta"
}
],
"rule" : [
{
"name" : "coding",
"source" : [
{
"context" : "assignedAuthor"
}
],
"target" : [
{
"context" : "meta",
"contextType" : "variable",
"element" : "tag",
"variable" : "coding",
"transform" : "create",
"parameter" : [
{
"valueString" : "Coding"
}
]
}
],
"rule" : [
{
"name" : "system",
"source" : [
{
"context" : "assignedAuthor"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "system",
"transform" : "copy",
"parameter" : [
{
"valueString" : "http://algoritmodiscoring"
}
]
}
]
},
{
"name" : "code",
"source" : [
{
"context" : "assignedAuthor"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "code",
"transform" : "copy",
"parameter" : [
{
"valueString" : "ClinicalDocument/body/EsameObiettivo/author"
}
]
}
]
}
]
}
]
},
{
"name" : "identifier",
"source" : [
{
"context" : "assignedAuthor",
"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" : "autore",
"source" : [
{
"context" : "id",
"element" : "extension",
"variable" : "ext"
}
],
"target" : [
{
"context" : "practitioner",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid9",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "r + '-' + ext"
}
]
},
{
"context" : "e9",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "https://example/Practitioner/"
},
{
"valueId" : "uuid9"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "url",
"transform" : "append",
"parameter" : [
{
"valueString" : "Practitioner/"
},
{
"valueId" : "uuid9"
}
]
},
{
"context" : "note",
"contextType" : "variable",
"element" : "author",
"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" : "assignedAuthor",
"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" : "assignedPerson",
"source" : [
{
"context" : "assignedAuthor",
"element" : "assignedPerson",
"variable" : "person"
}
],
"rule" : [
{
"name" : "name",
"source" : [
{
"context" : "person",
"element" : "name",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "practitioner",
"contextType" : "variable",
"element" : "name",
"variable" : "vvv",
"transform" : "create"
}
]
}
]
}
]
}
]
}
]
}
]
}
]
},
{
"name" : "code",
"source" : [
{
"context" : "sottosection",
"element" : "code",
"variable" : "vvv",
"condition" : "(code = '42346-7')"
}
],
"target" : [
{
"context" : "section",
"contextType" : "variable",
"element" : "code",
"variable" : "vvv",
"transform" : "create"
}
],
"documentation" : "3. Terapia Farmacologica all'ingresso Narrativa --------------------------------------------------------------------------------------------------------------"
},
{
"name" : "condizioneterapiaingresso",
"source" : [
{
"context" : "sottosection",
"element" : "code",
"variable" : "code1",
"condition" : "(code = '42346-7')"
}
],
"rule" : [
{
"name" : "title",
"source" : [
{
"context" : "sottosection",
"element" : "title",
"variable" : "t"
}
],
"target" : [
{
"context" : "section",
"contextType" : "variable",
"element" : "title",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "t.dataString"
}
]
}
]
},
{
"name" : "cdaText",
"source" : [
{
"context" : "sottosection",
"element" : "text",
"variable" : "cdaText"
}
],
"target" : [
{
"context" : "bundle",
"contextType" : "variable",
"element" : "entry",
"variable" : "e10"
},
{
"context" : "e10",
"contextType" : "variable",
"element" : "request",
"variable" : "request",
"transform" : "create",
"parameter" : [
{
"valueString" : "BackboneElement"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "method",
"transform" : "copy",
"parameter" : [
{
"valueString" : "POST"
}
]
},
{
"context" : "e10",
"contextType" : "variable",
"element" : "resource",
"variable" : "medicStatement",
"transform" : "create",
"parameter" : [
{
"valueString" : "MedicationStatement"
}
]
},
{
"context" : "medicStatement",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid10",
"transform" : "uuid"
},
{
"context" : "e10",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "https://example/MedicationStatement/"
},
{
"valueId" : "uuid10"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "url",
"transform" : "copy",
"parameter" : [
{
"valueString" : "MedicationStatement"
}
]
},
{
"context" : "section",
"contextType" : "variable",
"element" : "entry",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/MedicationStatement/' + %medicStatement.id"
}
]
}
],
"rule" : [
{
"name" : "reference",
"source" : [
{
"context" : "cdaText"
}
],
"target" : [
{
"context" : "medicStatement",
"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" : "statuscode",
"source" : [
{
"context" : "sottosection",
"condition" : "medicStatement.statusCode.exists().not()"
}
],
"rule" : [
{
"name" : "status",
"source" : [
{
"context" : "sottosection"
}
],
"target" : [
{
"context" : "medicStatement",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "completed"
}
]
}
]
}
]
},
{
"name" : "medication",
"source" : [
{
"context" : "cdaText"
}
],
"target" : [
{
"context" : "medicStatement",
"contextType" : "variable",
"element" : "medication",
"variable" : "medication",
"transform" : "create",
"parameter" : [
{
"valueString" : "CodeableConcept"
}
]
}
],
"rule" : [
{
"name" : "text",
"source" : [
{
"context" : "cdaText",
"variable" : "txt"
}
],
"target" : [
{
"context" : "medication",
"contextType" : "variable",
"element" : "text",
"transform" : "copy",
"parameter" : [
{
"valueId" : "txt"
}
]
}
]
}
]
},
{
"name" : "reference",
"source" : [
{
"context" : "cdaText"
}
],
"target" : [
{
"context" : "medicStatement",
"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" : "author",
"source" : [
{
"context" : "sottosection",
"element" : "author",
"variable" : "authors"
}
],
"rule" : [
{
"name" : "timeAuthor",
"source" : [
{
"context" : "authors",
"element" : "time",
"variable" : "time"
}
],
"target" : [
{
"context" : "note",
"contextType" : "variable",
"element" : "time",
"variable" : "value",
"transform" : "create",
"parameter" : [
{
"valueString" : "dateTime"
}
]
}
],
"dependent" : [
{
"name" : "TSDateTime",
"variable" : [
"time",
"value"
]
}
]
},
{
"name" : "assighedAuthor",
"source" : [
{
"context" : "authors",
"element" : "assignedAuthor",
"variable" : "assignedAuthor"
}
],
"target" : [
{
"context" : "bundle",
"contextType" : "variable",
"element" : "entry",
"variable" : "e11"
},
{
"context" : "e11",
"contextType" : "variable",
"element" : "request",
"variable" : "request",
"transform" : "create",
"parameter" : [
{
"valueString" : "BackboneElement"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "method",
"transform" : "copy",
"parameter" : [
{
"valueString" : "PUT"
}
]
},
{
"context" : "e11",
"contextType" : "variable",
"element" : "resource",
"variable" : "practitioner",
"transform" : "create",
"parameter" : [
{
"valueString" : "Practitioner"
}
]
}
],
"rule" : [
{
"name" : "meta",
"source" : [
{
"context" : "assignedAuthor"
}
],
"target" : [
{
"context" : "practitioner",
"contextType" : "variable",
"element" : "meta",
"variable" : "meta"
}
],
"rule" : [
{
"name" : "coding",
"source" : [
{
"context" : "assignedAuthor"
}
],
"target" : [
{
"context" : "meta",
"contextType" : "variable",
"element" : "tag",
"variable" : "coding",
"transform" : "create",
"parameter" : [
{
"valueString" : "Coding"
}
]
}
],
"rule" : [
{
"name" : "system",
"source" : [
{
"context" : "assignedAuthor"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "system",
"transform" : "copy",
"parameter" : [
{
"valueString" : "http://algoritmodiscoring"
}
]
}
]
},
{
"name" : "code",
"source" : [
{
"context" : "assignedAuthor"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "code",
"transform" : "copy",
"parameter" : [
{
"valueString" : "ClinicalDocument/body/TerapiaFarmacologicaIngresso/author"
}
]
}
]
}
]
}
]
},
{
"name" : "identifier",
"source" : [
{
"context" : "assignedAuthor",
"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" : "extension",
"source" : [
{
"context" : "id",
"element" : "extension",
"variable" : "ext"
}
],
"target" : [
{
"context" : "practitioner",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid11",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "r + '-' + ext"
}
]
},
{
"context" : "e11",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "https://example/Practitioner/"
},
{
"valueId" : "uuid11"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "url",
"transform" : "append",
"parameter" : [
{
"valueString" : "Practitioner/"
},
{
"valueId" : "uuid11"
}
]
},
{
"context" : "note",
"contextType" : "variable",
"element" : "author",
"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" : "assignedAuthor",
"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" : "assignedPerson",
"source" : [
{
"context" : "assignedAuthor",
"element" : "assignedPerson",
"variable" : "person"
}
],
"rule" : [
{
"name" : "name",
"source" : [
{
"context" : "person",
"element" : "name",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "practitioner",
"contextType" : "variable",
"element" : "name",
"variable" : "vvv",
"transform" : "create"
}
]
}
]
}
]
}
]
}
]
}
]
}
]
},
{
"name" : "code",
"source" : [
{
"context" : "sottosection",
"element" : "code",
"variable" : "vvv",
"condition" : "(code = '48765-2')"
}
],
"target" : [
{
"context" : "section",
"contextType" : "variable",
"element" : "code",
"variable" : "vvv",
"transform" : "create"
}
],
"documentation" : "4. Allergie"
},
{
"name" : "condizioneallergie",
"source" : [
{
"context" : "sottosection",
"element" : "code",
"variable" : "code1",
"condition" : "(code = '48765-2')"
}
],
"rule" : [
{
"name" : "title",
"source" : [
{
"context" : "sottosection",
"element" : "title",
"variable" : "t"
}
],
"target" : [
{
"context" : "section",
"contextType" : "variable",
"element" : "title",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "t.dataString"
}
]
}
]
},
{
"name" : "where",
"source" : [
{
"context" : "src",
"condition" : "sottosection.entry.exists().not()"
}
],
"rule" : [
{
"name" : "title",
"source" : [
{
"context" : "sottosection",
"element" : "title",
"variable" : "t"
}
],
"target" : [
{
"context" : "section",
"contextType" : "variable",
"element" : "title",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "t.dataString"
}
]
}
]
},
{
"name" : "cdaText",
"source" : [
{
"context" : "sottosection",
"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" : "AllergyIntolerance",
"transform" : "create",
"parameter" : [
{
"valueString" : "AllergyIntolerance"
}
]
},
{
"context" : "AllergyIntolerance",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid8",
"transform" : "uuid"
},
{
"context" : "e8",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "https://example/AllergyIntolerance/"
},
{
"valueId" : "uuid8"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "url",
"transform" : "copy",
"parameter" : [
{
"valueString" : "AllergyIntolerance"
}
]
},
{
"context" : "section",
"contextType" : "variable",
"element" : "entry",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/AllergyIntolerance/' + %AllergyIntolerance.id"
}
]
}
],
"rule" : [
{
"name" : "reference",
"source" : [
{
"context" : "cdaText"
}
],
"target" : [
{
"context" : "AllergyIntolerance",
"contextType" : "variable",
"element" : "patient",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Patient/' + %patient.id"
}
]
}
]
},
{
"name" : "reference",
"source" : [
{
"context" : "cdaText"
}
],
"target" : [
{
"context" : "AllergyIntolerance",
"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" : "clinicalStatus",
"source" : [
{
"context" : "cdaText"
}
],
"target" : [
{
"context" : "AllergyIntolerance",
"contextType" : "variable",
"element" : "clinicalStatus",
"variable" : "status",
"transform" : "create",
"parameter" : [
{
"valueString" : "CodeableConcept"
}
]
}
],
"rule" : [
{
"name" : "coding",
"source" : [
{
"context" : "cdaText"
}
],
"target" : [
{
"context" : "status",
"contextType" : "variable",
"element" : "coding",
"variable" : "coding",
"transform" : "create",
"parameter" : [
{
"valueString" : "Coding"
}
]
}
],
"rule" : [
{
"name" : "active",
"source" : [
{
"context" : "cdaText"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "code",
"transform" : "copy",
"parameter" : [
{
"valueString" : "active"
}
]
}
]
},
{
"name" : "system",
"source" : [
{
"context" : "cdaText"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "system",
"transform" : "copy",
"parameter" : [
{
"valueString" : "http://terminology.hl7.org/CodeSystem/allergyintolerance-clinical"
}
]
}
]
},
{
"name" : "active",
"source" : [
{
"context" : "cdaText"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "display",
"transform" : "copy",
"parameter" : [
{
"valueString" : "active"
}
]
}
]
}
]
}
]
},
{
"name" : "reference",
"source" : [
{
"context" : "cdaText"
}
],
"target" : [
{
"context" : "AllergyIntolerance",
"contextType" : "variable",
"element" : "note",
"variable" : "note"
}
],
"rule" : [
{
"name" : "reference",
"source" : [
{
"context" : "cdaText",
"variable" : "t"
}
],
"target" : [
{
"context" : "note",
"contextType" : "variable",
"element" : "text",
"transform" : "copy",
"parameter" : [
{
"valueId" : "t"
}
]
}
]
},
{
"name" : "author",
"source" : [
{
"context" : "sottosection",
"element" : "author",
"variable" : "authors"
}
],
"rule" : [
{
"name" : "timeAuthor",
"source" : [
{
"context" : "authors",
"element" : "time",
"variable" : "time"
}
],
"target" : [
{
"context" : "note",
"contextType" : "variable",
"element" : "time",
"variable" : "value",
"transform" : "create",
"parameter" : [
{
"valueString" : "dateTime"
}
]
}
],
"dependent" : [
{
"name" : "TSDateTime",
"variable" : [
"time",
"value"
]
}
]
},
{
"name" : "assighedAuthor",
"source" : [
{
"context" : "authors",
"element" : "assignedAuthor",
"variable" : "assignedAuthor"
}
],
"target" : [
{
"context" : "bundle",
"contextType" : "variable",
"element" : "entry",
"variable" : "e9"
},
{
"context" : "e9",
"contextType" : "variable",
"element" : "request",
"variable" : "request",
"transform" : "create",
"parameter" : [
{
"valueString" : "BackboneElement"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "method",
"transform" : "copy",
"parameter" : [
{
"valueString" : "PUT"
}
]
},
{
"context" : "e9",
"contextType" : "variable",
"element" : "resource",
"variable" : "practitioner",
"transform" : "create",
"parameter" : [
{
"valueString" : "Practitioner"
}
]
}
],
"rule" : [
{
"name" : "meta",
"source" : [
{
"context" : "assignedAuthor"
}
],
"target" : [
{
"context" : "practitioner",
"contextType" : "variable",
"element" : "meta",
"variable" : "meta"
}
],
"rule" : [
{
"name" : "coding",
"source" : [
{
"context" : "assignedAuthor"
}
],
"target" : [
{
"context" : "meta",
"contextType" : "variable",
"element" : "tag",
"variable" : "coding",
"transform" : "create",
"parameter" : [
{
"valueString" : "Coding"
}
]
}
],
"rule" : [
{
"name" : "system",
"source" : [
{
"context" : "assignedAuthor"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "system",
"transform" : "copy",
"parameter" : [
{
"valueString" : "http://algoritmodiscoring"
}
]
}
]
},
{
"name" : "code",
"source" : [
{
"context" : "assignedAuthor"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "code",
"transform" : "copy",
"parameter" : [
{
"valueString" : "ClinicalDocument/body/EsameObiettivo/author"
}
]
}
]
}
]
}
]
},
{
"name" : "identifier",
"source" : [
{
"context" : "assignedAuthor",
"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" : "autore",
"source" : [
{
"context" : "id",
"element" : "extension",
"variable" : "ext"
}
],
"target" : [
{
"context" : "practitioner",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid9",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "r + '-' + ext"
}
]
},
{
"context" : "e9",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "https://example/Practitioner/"
},
{
"valueId" : "uuid9"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "url",
"transform" : "append",
"parameter" : [
{
"valueString" : "Practitioner/"
},
{
"valueId" : "uuid9"
}
]
},
{
"context" : "note",
"contextType" : "variable",
"element" : "author",
"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" : "assignedAuthor",
"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" : "assignedPerson",
"source" : [
{
"context" : "assignedAuthor",
"element" : "assignedPerson",
"variable" : "person"
}
],
"rule" : [
{
"name" : "name",
"source" : [
{
"context" : "person",
"element" : "name",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "practitioner",
"contextType" : "variable",
"element" : "name",
"variable" : "vvv",
"transform" : "create"
}
]
}
]
}
]
}
]
}
]
}
]
}
],
"documentation" : "Allergia Narrativa-------------------------------------------------------------------------------------------------------------------------------------------"
},
{
"name" : "allergy",
"source" : [
{
"context" : "sottosection",
"element" : "entry",
"variable" : "entry1"
}
],
"target" : [
{
"context" : "bundle",
"contextType" : "variable",
"element" : "entry",
"variable" : "e12"
},
{
"context" : "e12",
"contextType" : "variable",
"element" : "request",
"variable" : "request",
"transform" : "create",
"parameter" : [
{
"valueString" : "BackboneElement"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "method",
"transform" : "copy",
"parameter" : [
{
"valueString" : "POST"
}
]
},
{
"context" : "e12",
"contextType" : "variable",
"element" : "resource",
"variable" : "allergy",
"transform" : "create",
"parameter" : [
{
"valueString" : "AllergyIntolerance"
}
]
},
{
"context" : "allergy",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid12",
"transform" : "uuid"
},
{
"context" : "e12",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "https://example/AllergyIntolerance/"
},
{
"valueId" : "uuid12"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "url",
"transform" : "copy",
"parameter" : [
{
"valueString" : "AllergyIntolerance"
}
]
},
{
"context" : "section",
"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" : "entryact2",
"source" : [
{
"context" : "entry1",
"element" : "act",
"variable" : "actallint"
}
],
"rule" : [
{
"name" : "onsetDateTime",
"source" : [
{
"context" : "actallint",
"element" : "effectiveTime",
"variable" : "effectiveTime"
}
],
"target" : [
{
"context" : "allergy",
"contextType" : "variable",
"element" : "onset",
"variable" : "value",
"transform" : "create",
"parameter" : [
{
"valueString" : "dateTime"
}
]
}
],
"dependent" : [
{
"name" : "TSDateTime",
"variable" : [
"effectiveTime",
"value"
]
}
]
},
{
"name" : "where",
"source" : [
{
"context" : "actallint",
"condition" : "effectiveTime.low.exists() or effectiveTime.high.exists()"
}
],
"rule" : [
{
"name" : "onsetPeriod",
"source" : [
{
"context" : "actallint",
"element" : "effectiveTime",
"variable" : "eff"
}
],
"target" : [
{
"context" : "allergy",
"contextType" : "variable",
"element" : "onset",
"variable" : "period",
"transform" : "create",
"parameter" : [
{
"valueString" : "Period"
}
]
}
],
"dependent" : [
{
"name" : "IVLTSPeriod",
"variable" : [
"eff",
"period"
]
}
]
}
]
},
{
"name" : "cdaText1",
"source" : [
{
"context" : "sottosection",
"element" : "text",
"variable" : "cdaText1"
}
],
"target" : [
{
"context" : "allergy",
"contextType" : "variable",
"element" : "note",
"variable" : "note"
}
],
"rule" : [
{
"name" : "reference",
"source" : [
{
"context" : "cdaText1",
"variable" : "t"
}
],
"target" : [
{
"context" : "note",
"contextType" : "variable",
"element" : "text",
"transform" : "copy",
"parameter" : [
{
"valueId" : "t"
}
]
}
]
},
{
"name" : "author",
"source" : [
{
"context" : "sottosection",
"element" : "author",
"variable" : "authors"
}
],
"rule" : [
{
"name" : "timeAuthor",
"source" : [
{
"context" : "authors",
"element" : "time",
"variable" : "time"
}
],
"target" : [
{
"context" : "note",
"contextType" : "variable",
"element" : "time",
"variable" : "value",
"transform" : "create",
"parameter" : [
{
"valueString" : "dateTime"
}
]
}
],
"dependent" : [
{
"name" : "TSDateTime",
"variable" : [
"time",
"value"
]
}
]
},
{
"name" : "assighedAuthor",
"source" : [
{
"context" : "authors",
"element" : "assignedAuthor",
"variable" : "assignedAuthor"
}
],
"target" : [
{
"context" : "bundle",
"contextType" : "variable",
"element" : "entry",
"variable" : "e13"
},
{
"context" : "e13",
"contextType" : "variable",
"element" : "request",
"variable" : "request",
"transform" : "create",
"parameter" : [
{
"valueString" : "BackboneElement"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "method",
"transform" : "copy",
"parameter" : [
{
"valueString" : "PUT"
}
]
},
{
"context" : "e13",
"contextType" : "variable",
"element" : "resource",
"variable" : "practitioner",
"transform" : "create",
"parameter" : [
{
"valueString" : "Practitioner"
}
]
}
],
"rule" : [
{
"name" : "meta",
"source" : [
{
"context" : "assignedAuthor"
}
],
"target" : [
{
"context" : "practitioner",
"contextType" : "variable",
"element" : "meta",
"variable" : "meta"
}
],
"rule" : [
{
"name" : "coding",
"source" : [
{
"context" : "assignedAuthor"
}
],
"target" : [
{
"context" : "meta",
"contextType" : "variable",
"element" : "tag",
"variable" : "coding",
"transform" : "create",
"parameter" : [
{
"valueString" : "Coding"
}
]
}
],
"rule" : [
{
"name" : "system",
"source" : [
{
"context" : "assignedAuthor"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "system",
"transform" : "copy",
"parameter" : [
{
"valueString" : "http://algoritmodiscoring"
}
]
}
]
},
{
"name" : "code",
"source" : [
{
"context" : "assignedAuthor"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "code",
"transform" : "copy",
"parameter" : [
{
"valueString" : "ClinicalDocument/body/Allergie/author"
}
]
}
]
}
]
}
]
},
{
"name" : "identifier",
"source" : [
{
"context" : "assignedAuthor",
"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" : "extension",
"source" : [
{
"context" : "id",
"element" : "extension",
"variable" : "ext"
}
],
"target" : [
{
"context" : "practitioner",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid13",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "r + '-' + ext"
}
]
},
{
"context" : "e13",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "https://example/Practitioner/"
},
{
"valueId" : "uuid13"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "url",
"transform" : "append",
"parameter" : [
{
"valueString" : "Practitioner/"
},
{
"valueId" : "uuid13"
}
]
},
{
"context" : "note",
"contextType" : "variable",
"element" : "author",
"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" : "assignedAuthor",
"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" : "assignedPerson",
"source" : [
{
"context" : "assignedAuthor",
"element" : "assignedPerson",
"variable" : "person"
}
],
"rule" : [
{
"name" : "name",
"source" : [
{
"context" : "person",
"element" : "name",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "practitioner",
"contextType" : "variable",
"element" : "name",
"variable" : "vvv",
"transform" : "create"
}
]
}
]
}
]
}
]
}
],
"documentation" : "mapping note"
},
{
"name" : "entryrelationshipact",
"source" : [
{
"context" : "actallint",
"element" : "entryRelationship",
"variable" : "entryact"
}
],
"rule" : [
{
"name" : "entryobservation",
"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" : "participant",
"source" : [
{
"context" : "entryobs",
"element" : "participant",
"variable" : "partic"
}
],
"rule" : [
{
"name" : "participantRole",
"source" : [
{
"context" : "partic",
"element" : "participantRole",
"variable" : "pratRole"
}
],
"rule" : [
{
"name" : "playingEntity",
"source" : [
{
"context" : "pratRole",
"element" : "playingEntity",
"variable" : "pratent"
}
],
"rule" : [
{
"name" : "reaction",
"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" : "entryRelationship",
"source" : [
{
"context" : "entryobs",
"element" : "entryRelationship",
"variable" : "entryobs1",
"condition" : "(typeCode = 'MFST')"
}
],
"rule" : [
{
"name" : "entryobservation",
"source" : [
{
"context" : "entryobs1",
"element" : "observation",
"variable" : "entobs"
}
],
"rule" : [
{
"name" : "eff",
"source" : [
{
"context" : "entobs",
"element" : "effectiveTime",
"variable" : "eff"
}
],
"rule" : [
{
"name" : "low",
"source" : [
{
"context" : "eff",
"element" : "low",
"variable" : "l"
}
],
"target" : [
{
"context" : "reaction",
"contextType" : "variable",
"element" : "onset",
"variable" : "value",
"transform" : "create",
"parameter" : [
{
"valueString" : "dateTime"
}
]
}
],
"dependent" : [
{
"name" : "TSDateTime",
"variable" : [
"l",
"value"
]
}
]
}
]
},
{
"name" : "manifest",
"source" : [
{
"context" : "entobs",
"element" : "value",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "reaction",
"contextType" : "variable",
"element" : "manifestation",
"variable" : "vvv",
"transform" : "create"
}
]
}
]
}
]
}
]
}
]
}
]
}
]
},
{
"name" : "entryrelationship2",
"source" : [
{
"context" : "entryobs",
"element" : "entryRelationship",
"variable" : "entryobs2"
}
],
"rule" : [
{
"name" : "entryobservation2",
"source" : [
{
"context" : "entryobs2",
"element" : "observation",
"variable" : "entobs"
}
],
"rule" : [
{
"name" : "severity",
"source" : [
{
"context" : "entobs",
"element" : "code",
"variable" : "code",
"condition" : "(code = 'SEV')"
}
],
"rule" : [
{
"name" : "value",
"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" : "entryrelationship3",
"source" : [
{
"context" : "entryobs",
"element" : "entryRelationship",
"variable" : "entryobs3"
}
],
"rule" : [
{
"name" : "entryobservation3",
"source" : [
{
"context" : "entryobs3",
"element" : "observation",
"variable" : "entobs"
}
],
"rule" : [
{
"name" : "33999-4",
"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"
}
]
}
],
"documentation" : "value->coding.version='ConditionClinicalStatusCodes 4.0.1'\"version\";"
}
]
}
]
}
],
"documentation" : "entobs.value->allergy.clinicalStatus \"cstatus\";"
}
]
}
]
}
]
},
{
"name" : "entryrelationshi4",
"source" : [
{
"context" : "entryobs",
"element" : "entryRelationship",
"variable" : "entryobs4"
}
],
"rule" : [
{
"name" : "entryact1",
"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"
}
]
}
]
}
]
}
]
}
]
}
]
}
]
}
]
}
]
}
],
"documentation" : "Allergia Strutturata----------------------------------------------------------------------------------------------------------------------------------------"
}
]
},
{
"name" : "code",
"source" : [
{
"context" : "sottosection",
"element" : "code",
"variable" : "vvv",
"condition" : "(code = '11450-4')"
}
],
"target" : [
{
"context" : "section",
"contextType" : "variable",
"element" : "code",
"variable" : "vvv",
"transform" : "create"
}
],
"documentation" : "5. Problemi aperti"
},
{
"name" : "condizioneproblemiaperti",
"source" : [
{
"context" : "sottosection",
"element" : "code",
"variable" : "code1",
"condition" : "(code = '11450-4')"
}
],
"rule" : [
{
"name" : "title",
"source" : [
{
"context" : "sottosection",
"element" : "title",
"variable" : "t"
}
],
"target" : [
{
"context" : "section",
"contextType" : "variable",
"element" : "title",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "t.dataString"
}
]
}
]
},
{
"name" : "cdaText",
"source" : [
{
"context" : "sottosection",
"element" : "text",
"variable" : "cdaText"
}
],
"target" : [
{
"context" : "bundle",
"contextType" : "variable",
"element" : "entry",
"variable" : "e14"
},
{
"context" : "e14",
"contextType" : "variable",
"element" : "request",
"variable" : "request",
"transform" : "create",
"parameter" : [
{
"valueString" : "BackboneElement"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "method",
"transform" : "copy",
"parameter" : [
{
"valueString" : "POST"
}
]
},
{
"context" : "e14",
"contextType" : "variable",
"element" : "resource",
"variable" : "condition",
"transform" : "create",
"parameter" : [
{
"valueString" : "Condition"
}
]
},
{
"context" : "condition",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid14",
"transform" : "uuid"
},
{
"context" : "e14",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "https://example/Condition/"
},
{
"valueId" : "uuid14"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "url",
"transform" : "copy",
"parameter" : [
{
"valueString" : "Condition"
}
]
},
{
"context" : "section",
"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" : "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" : "code",
"source" : [
{
"context" : "sottosection",
"element" : "code",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "condition",
"contextType" : "variable",
"element" : "code",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "reference",
"source" : [
{
"context" : "cdaText"
}
],
"target" : [
{
"context" : "condition",
"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" : "author",
"source" : [
{
"context" : "sottosection",
"element" : "author",
"variable" : "authors"
}
],
"rule" : [
{
"name" : "timeAuthor",
"source" : [
{
"context" : "authors",
"element" : "time",
"variable" : "time"
}
],
"target" : [
{
"context" : "note",
"contextType" : "variable",
"element" : "time",
"variable" : "value",
"transform" : "create",
"parameter" : [
{
"valueString" : "dateTime"
}
]
}
],
"dependent" : [
{
"name" : "TSDateTime",
"variable" : [
"time",
"value"
]
}
]
},
{
"name" : "assighedAuthor",
"source" : [
{
"context" : "authors",
"element" : "assignedAuthor",
"variable" : "assignedAuthor"
}
],
"target" : [
{
"context" : "bundle",
"contextType" : "variable",
"element" : "entry",
"variable" : "e15"
},
{
"context" : "e15",
"contextType" : "variable",
"element" : "request",
"variable" : "request",
"transform" : "create",
"parameter" : [
{
"valueString" : "BackboneElement"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "method",
"transform" : "copy",
"parameter" : [
{
"valueString" : "PUT"
}
]
},
{
"context" : "e15",
"contextType" : "variable",
"element" : "resource",
"variable" : "practitioner",
"transform" : "create",
"parameter" : [
{
"valueString" : "Practitioner"
}
]
}
],
"rule" : [
{
"name" : "meta",
"source" : [
{
"context" : "assignedAuthor"
}
],
"target" : [
{
"context" : "practitioner",
"contextType" : "variable",
"element" : "meta",
"variable" : "meta"
}
],
"rule" : [
{
"name" : "coding",
"source" : [
{
"context" : "assignedAuthor"
}
],
"target" : [
{
"context" : "meta",
"contextType" : "variable",
"element" : "tag",
"variable" : "coding",
"transform" : "create",
"parameter" : [
{
"valueString" : "Coding"
}
]
}
],
"rule" : [
{
"name" : "system",
"source" : [
{
"context" : "assignedAuthor"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "system",
"transform" : "copy",
"parameter" : [
{
"valueString" : "http://algoritmodiscoring"
}
]
}
]
},
{
"name" : "code",
"source" : [
{
"context" : "assignedAuthor"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "code",
"transform" : "copy",
"parameter" : [
{
"valueString" : "ClinicalDocument/body/ProblemiAperti/author"
}
]
}
]
}
]
}
]
},
{
"name" : "identifier",
"source" : [
{
"context" : "assignedAuthor",
"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" : "uuid15",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "r + '-' + ext"
}
]
},
{
"context" : "e15",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "https://example/Practitioner/"
},
{
"valueId" : "uuid15"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "url",
"transform" : "append",
"parameter" : [
{
"valueString" : "Practitioner/"
},
{
"valueId" : "uuid15"
}
]
},
{
"context" : "note",
"contextType" : "variable",
"element" : "author",
"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" : "assignedAuthor",
"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" : "assignedPerson",
"source" : [
{
"context" : "assignedAuthor",
"element" : "assignedPerson",
"variable" : "person"
}
],
"rule" : [
{
"name" : "name",
"source" : [
{
"context" : "person",
"element" : "name",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "practitioner",
"contextType" : "variable",
"element" : "name",
"variable" : "vvv",
"transform" : "create"
}
]
}
]
}
]
}
]
}
]
}
]
}
]
}
]
}
]
}
],
"documentation" : "START sottosections"
}
]
},
{
"name" : "Act",
"typeMode" : "none",
"documentation" : "______2._____________ClinicalStatements________________________",
"input" : [
{
"name" : "cda",
"type" : "Act",
"mode" : "source"
},
{
"name" : "pat",
"type" : "Patient",
"mode" : "target"
},
{
"name" : "enc",
"type" : "Encounter",
"mode" : "target"
},
{
"name" : "bundle",
"type" : "Bundle",
"mode" : "target"
}
],
"rule" : [
{
"name" : "code",
"source" : [
{
"context" : "cda",
"element" : "code",
"variable" : "code"
}
],
"target" : [
{
"context" : "enc",
"contextType" : "variable",
"element" : "extension",
"variable" : "extension2"
}
],
"dependent" : [
{
"name" : "modeOfArrival",
"variable" : [
"code",
"extension2"
]
}
]
},
{
"name" : "participant",
"source" : [
{
"context" : "cda",
"element" : "participant",
"variable" : "participant"
}
],
"rule" : [
{
"name" : "fhirParticipant",
"source" : [
{
"context" : "participant"
}
],
"target" : [
{
"context" : "enc",
"contextType" : "variable",
"element" : "participant",
"variable" : "FhirParticipant"
}
],
"rule" : [
{
"name" : "type",
"source" : [
{
"context" : "participant",
"variable" : "p"
}
],
"target" : [
{
"context" : "FhirParticipant",
"contextType" : "variable",
"element" : "type",
"variable" : "type"
}
],
"rule" : [
{
"name" : "codeType",
"source" : [
{
"context" : "p"
}
],
"target" : [
{
"context" : "type",
"contextType" : "variable",
"element" : "coding",
"variable" : "coding"
}
],
"rule" : [
{
"name" : "codice",
"source" : [
{
"context" : "p"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "code",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "p.typeCode"
}
]
}
]
},
{
"name" : "system",
"source" : [
{
"context" : "p"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "system",
"transform" : "copy",
"parameter" : [
{
"valueString" : "http://terminology.hl7.org/CodeSystem/v3-ParticipationType"
}
]
}
]
}
]
}
]
}
]
},
{
"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" : "POST"
}
]
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "resource",
"variable" : "practitionerRole",
"transform" : "create",
"parameter" : [
{
"valueString" : "PractitionerRole"
}
]
},
{
"context" : "practitionerRole",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid1",
"transform" : "uuid"
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "https://example/PractitionerRole/"
},
{
"valueId" : "uuid1"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "url",
"transform" : "copy",
"parameter" : [
{
"valueString" : "PractitionerRole"
}
]
},
{
"context" : "enc",
"contextType" : "variable",
"element" : "participant",
"variable" : "participant1",
"transform" : "create",
"parameter" : [
{
"valueString" : "BackboneElement"
}
]
},
{
"context" : "participant1",
"contextType" : "variable",
"element" : "individual",
"variable" : "referencepart",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "referencepart",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/PractitionerRole/' + %practitionerRole.id"
}
]
}
],
"rule" : [
{
"name" : "code",
"source" : [
{
"context" : "participantRole",
"element" : "code",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "practitionerRole",
"contextType" : "variable",
"element" : "code",
"variable" : "vvv",
"transform" : "create"
}
]
}
]
}
]
}
]
},
{
"name" : "modeOfArrival",
"typeMode" : "none",
"documentation" : "______3._____________Extensions_DtType________________________",
"input" : [
{
"name" : "src",
"type" : "CE",
"mode" : "source"
},
{
"name" : "ext",
"type" : "Extension",
"mode" : "target"
}
],
"rule" : [
{
"name" : "url",
"source" : [
{
"context" : "src"
}
],
"target" : [
{
"context" : "ext",
"contextType" : "variable",
"element" : "url",
"transform" : "copy",
"parameter" : [
{
"valueString" : "http://hl7.org/fhir/StructureDefinition/encounter-modeOfArrival"
}
]
}
]
},
{
"name" : "coding",
"source" : [
{
"context" : "src"
}
],
"target" : [
{
"context" : "ext",
"contextType" : "variable",
"element" : "value",
"variable" : "code1",
"transform" : "create",
"parameter" : [
{
"valueString" : "Coding"
}
]
}
],
"dependent" : [
{
"name" : "coding",
"variable" : [
"src",
"code1"
]
}
]
}
]
},
{
"name" : "coding",
"typeMode" : "none",
"input" : [
{
"name" : "src",
"type" : "CE",
"mode" : "source"
},
{
"name" : "tgt",
"type" : "Coding",
"mode" : "target"
}
],
"rule" : [
{
"name" : "code",
"source" : [
{
"context" : "src",
"element" : "code",
"variable" : "code"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "code",
"transform" : "cast",
"parameter" : [
{
"valueId" : "code"
},
{
"valueString" : "string"
}
]
}
]
},
{
"name" : "codeSystem",
"source" : [
{
"context" : "src",
"element" : "codeSystem",
"variable" : "system"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "system",
"transform" : "translate",
"parameter" : [
{
"valueId" : "system"
},
{
"valueString" : "http://hl7.org/fhir/ConceptMap/special-oid2uri"
},
{
"valueString" : "uri"
}
]
}
]
},
{
"name" : "displayName",
"source" : [
{
"context" : "src",
"element" : "displayName",
"variable" : "display"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "display",
"transform" : "cast",
"parameter" : [
{
"valueId" : "display"
},
{
"valueString" : "string"
}
]
}
]
},
{
"name" : "codeSystemVersion",
"source" : [
{
"context" : "src",
"element" : "codeSystemVersion",
"variable" : "version"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "version",
"transform" : "cast",
"parameter" : [
{
"valueId" : "version"
},
{
"valueString" : "string"
}
]
}
]
}
]
},
{
"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"
}
]
}
]
}
]
}
]
}
]
}