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" : "cda2fhirAmbReport",
"text" : {
"status" : "generated",
"div" : "<div xmlns=\"http://www.w3.org/1999/xhtml\">\n <pre>map "http://hl7.it/fhir/cda2fhir/StructureMap/cda2fhirAmbReport" = "cda2fhirAmbReport"\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/List" alias List as produced\nuses "http://hl7.org/fhir/StructureDefinition/Practitioner" alias Practitioner as produced\nuses "http://hl7.org/fhir/StructureDefinition/Organization" alias Organization as produced\nuses "http://hl7.org/fhir/cda/StructureDefinition/Act" alias Act as produced\nuses "http://hl7.org/fhir/cda/StructureDefinition/IVL-PQ" alias IVL_PQ as source\nuses "http://hl7.org/fhir/cda/StructureDefinition/PQ" alias PQ as source\nuses "http://hl7.org/fhir/StructureDefinition/SimpleQuantity" alias SimpleQuantity as target\n\nimports "http://hl7.it/fhir/cda2fhir/StructureMap/cda2fhirDataTypes"\nimports "http://hl7.it/fhir/cda2fhir/StructureMap/cda2fhirHeader"\n\ngroup CdaToBundle(source cda : ClinicalDocument, target bundle : Bundle) {\n cda -> bundle.entry as e, e.request = create('BackboneElement') as request, request.method = 'POST', e.resource = create('Composition') as composition, composition.id = uuid() as uuid1, e.fullUrl = append('https://example/Composition/', uuid1), request.url = 'Composition', bundle.entry as e2, e2.request = create('BackboneElement') as requestPAT, requestPAT.method = 'PUT', e2.resource = create('Patient') as patient, patient.id = uuid() as uuid2, e2.fullUrl = append('https://example/Patient/', uuid2), bundle.entry as e3, e3.request = create('BackboneElement') as request, request.method = 'POST', e3.resource = create('Encounter') as encounter, encounter.id = uuid() as uuid3, e3.fullUrl = append('https://example/Encounter/', uuid3), request.url = 'Encounter', bundle.entry as e4, e4.request = create('BackboneElement') as request, request.method = 'POST', e4.resource = create('DocumentReference') as DocumentReference, DocumentReference.id = uuid() as uuid4, e4.fullUrl = append('https://example/DocumentReference/', uuid4), request.url = 'DocumentReference' then {\n cda then ClinicalDocumentToBundle(cda, patient, composition, encounter, bundle, DocumentReference) "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 } "record";\n } "recPat";\n } "patient";\n } "ClinicalDocumentToBody";\n}\n\ngroup ClinicalDocumentToBundle(source cda : ClinicalDocument, target patient : Patient, target composition : Composition, target encounter : Encounter, target bundle : Bundle, target DocumentReference : DocumentReference) {\n cda -> bundle.id = uuid() "id";\n cda.id -> bundle.identifier "identifier";\n cda -> bundle.type = 'transaction' "type";\n cda -> bundle.timestamp = (timestamp.now()) "date";\n cda then ClinicalDocumentComposition(cda, composition, patient, encounter, bundle, DocumentReference) "composition";\n cda -> bundle.entry as e, e.request = create('BackboneElement') as request, request.method = 'POST', e.resource = create('DiagnosticReport') as diagnosticReport, diagnosticReport.id = uuid() as uuid1, e.fullUrl = append('https://example/DiagnosticReport/', uuid1), request.url = 'DiagnosticReport' then {\n cda.code -> diagnosticReport.code "diagnosticCode";\n cda -> diagnosticReport.status = 'registered' "stats";\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 -> composition.section as tgtSection then ClinicalDocumentSection(cda, srcSection, patient, tgtSection, bundle, encounter, diagnosticReport);\n };\n };\n } "body";\n };\n } "diagnostic";\n}\n\ngroup ClinicalDocumentSection(source cda : ClinicalDocument, source src : Section, target patient : Patient, target tgt, target bundle : Bundle, target enc : Encounter, target dReport : DiagnosticReport) {\n src.title as t -> tgt.title = (t.dataString);\n src.code -> tgt.code;\n src -> tgt.entry = create('Reference') as reference, reference.reference = ('https://example/DiagnosticReport/' + %dReport.id) "reference";\n src.entry as entry 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 then DiagnosticReportFunction(src, entry, dReport, bundle, enc, patient) "dreport";\n };\n src where src.entry.exists().not() then DiagnosticReportFunction(src, cda, dReport, bundle, enc, patient) "narrative";\n src.component as component then {\n component.section as sec -> tgt.section as tgtSection then ClinicalDocumentSection(cda, sec, patient, tgtSection, bundle, enc, dReport);\n };\n}\n\ngroup DiagnosticReportFunction(source section : section, source src : entry, target dReport : DiagnosticReport, target bundle : Bundle, target encounter : Encounter, target patient : Patient) {\n src.observation as observation then {\n section where code.code = '29299-5' -> bundle.entry as e1, e1.request = create('BackboneElement') as request, request.method = 'POST', e1.resource = create('Observation') as obs1, obs1.id = uuid() as uuid1, e1.fullUrl = append('https://example/Observation/', uuid1), request.url = 'Observation', dReport.result = create('Reference') as reference, reference.reference = ('https://example/Observation/' + %obs1.id) then Observation(observation, patient, encounter, obs1, bundle) "QuesitoDiagnostico";\n section where code.code = '11329-0' -> bundle.entry as e2, e2.request = create('BackboneElement') as request, request.method = 'POST', e2.resource = create('Observation') as obs2, obs2.id = uuid() as uuid2, e2.fullUrl = append('https://example/Observation/', uuid2), request.url = 'Observation', dReport.result = create('Reference') as reference, reference.reference = ('https://example/Observation/' + %obs2.id) then {\n section -> obs2.subject = create('Reference') as reference, reference.reference = ('https://example/Patient/' + %patient.id) "reference";\n section -> obs2.encounter = create('Reference') as reference, reference.reference = ('https://example/Encounter/' + %encounter.id) "reference";\n section -> obs2.status = 'final' "STatusobse";\n section.code -> obs2.code;\n observation.statusCode as s then {\n s.code as cos -> obs2.status = translate(cos, '#OBSstatus', 'code') "codeS";\n } "status";\n section.component as component then {\n component.section as section then {\n section.code where code = '10160-0' then {\n section.entry as entry then {\n entry.substanceAdministration as subAdmin -> bundle.entry as e11, e11.request = create('BackboneElement') as request, request.method = 'POST', e11.resource = create('MedicationStatement') as medicationstatement, medicationstatement.id = uuid() as uuid11, e11.fullUrl = append('https://example/MedicationStatement/', uuid11), request.url = 'MedicationStatement', obs2.partOf = create('Reference') as reference, reference.reference = ('https://example/MedicationStatement/' + %medicationstatement.id) then MedicationStatement(subAdmin, medicationstatement, patient, encounter, bundle) "creat";\n };\n } "sectionCode";\n section.code where code = '48765-2' then {\n section -> bundle.entry as e4, e4.request = create('BackboneElement') as request, request.method = 'POST', e4.resource = create('List') as list1, list1.id = uuid() as uuid4, e4.fullUrl = append('https://example/List/', uuid4), request.url = 'List', obs2.focus = create('Reference') as reference, reference.reference = ('https://example/List/' + %list1.id) then {\n section -> list1.subject = create('Reference') as reference, reference.reference = ('https://example/Patient/' + %patient.id) "reference";\n section -> list1.status = 'current' "listatus";\n section -> list1.mode = 'working' "lstmod";\n section -> list1.encounter = create('Reference') as reference, reference.reference = ('https://example/Encounter/' + %encounter.id) "reference";\n section -> list1.entry as entryList1 then {\n section.entry as entry then {\n entry.act as act1 -> bundle.entry as e5, e5.request = create('BackboneElement') as request, request.method = 'POST', e5.resource = create('AllergyIntolerance') as allergy, allergy.id = uuid() as uuid5, e5.fullUrl = append('https://example/AllergyIntolerance/', uuid5), request.url = 'AllergyIntolerance', entryList1.item = create('Reference') as reference, reference.reference = ('https://example/AllergyIntolerance/' + %allergy.id) then allergyFunction(act1, allergy, patient, encounter) "allergy";\n } "entryAll";\n } "entryList";\n } "section";\n } "conditionAllergie";\n };\n } "subSection";\n section.entry as entry then {\n entry.observation -> bundle.entry as e3, e3.request = create('BackboneElement') as request, request.method = 'POST', e3.resource = create('Condition') as condition, condition.id = uuid() as uuid3, e3.fullUrl = append('https://example/Condition/', uuid3), request.url = 'Condition', obs2.focus = create('Reference') as reference, reference.reference = ('https://example/Condition/' + %condition.id) then ConditionFunction(observation, condition, patient, encounter, bundle) "condition";\n entry.organizer as organizer then {\n section -> bundle.entry as e11, e11.request = create('BackboneElement') as request, request.method = 'POST', e11.resource = create('List') as list11, list11.id = uuid() as uuid11, e11.fullUrl = append('https://example/List/', uuid11), request.url = 'List', obs2.focus = create('Reference') as reference, reference.reference = ('https://example/List/' + %list11.id) then {\n section -> list11.subject = create('Reference') as reference, reference.reference = ('https://example/Patient/' + %patient.id) "reference";\n section -> list11.status = 'current' "liststat";\n section -> list11.mode = 'working' "listmd";\n section -> list11.encounter = create('Reference') as reference, reference.reference = ('https://example/Encounter/' + %encounter.id) "reference";\n organizer -> list11.entry as entryList2 then {\n organizer -> bundle.entry as e12, e12.request = create('BackboneElement') as request, request.method = 'POST', e12.resource = create('FamilyMemberHistory') as familyMember, familyMember.id = uuid() as uuid12, e12.fullUrl = append('https://example/FamilyMemberHistory/', uuid12), request.url = 'FamilyMemberHistory', entryList2.item = create('Reference') as reference, reference.reference = ('https://example/FamilyMemberHistory/' + %familyMember.id) then FamilyMemberFunction(organizer, familyMember, patient) "family";\n } "org";\n } "List";\n };\n };\n } "StoriaClinica1";\n section where code.code = '30954-2' -> bundle.entry as e4, e4.request = create('BackboneElement') as request, request.method = 'POST', e4.resource = create('Observation') as obs4, obs4.id = uuid() as uuid4, e4.fullUrl = append('https://example/Observation/', uuid4), request.url = 'Observation', dReport.result = create('Reference') as reference, reference.reference = ('https://example/Observation/' + %obs4.id) then Observation(observation, patient, encounter, obs4, bundle) "PrecedentiEsamiEseguiti";\n section where code.code = '29548-5' -> bundle.entry as e5, e5.request = create('BackboneElement') as request, request.method = 'POST', e5.resource = create('Observation') as obs5, obs5.id = uuid() as uuid5, e5.fullUrl = append('https://example/Observation/', uuid5), request.url = 'Observation', dReport.result = create('Reference') as reference, reference.reference = ('https://example/Observation/' + %obs5.id) then Observation(observation, patient, encounter, obs5, bundle) "Diagnosi";\n } "entryObs";\n src.act as act then {\n section where code.code = '62387-6' -> dReport.encounter = create('Reference') as reference, reference.reference = ('https://example/Encounter/' + %encounter.id) then {\n act.code -> encounter.type "type";\n act.effectiveTime as effectiveTime -> encounter.period as period then {\n effectiveTime -> period.start = create('dateTime') as start then TSDateTime(effectiveTime, start) "val";\n } "period";\n act -> bundle.entry as e10, e10.request = create('BackboneElement') as request, request.method = 'POST', e10.resource = create('Procedure') as procedureRes, procedureRes.id = uuid() as uuid10, e10.fullUrl = append('https://example/Procedure/', uuid10), request.url = 'Procedure', encounter.reasonReference = create('Reference') as reference, reference.reference = ('https://example/Procedure/' + %procedureRes.id) then {\n act -> procedureRes.subject = create('Reference') as reference, reference.reference = ('https://example/Patient/' + %patient.id) "reference";\n act -> procedureRes.encounter = create('Reference') as reference, reference.reference = ('https://example/Encounter/' + %encounter.id) "reference";\n act.statusCode -> procedureRes.status "status1";\n act where statusCode.exists().not() -> procedureRes.status = 'unknown' "status2";\n act.entryRelationship as entryRel then {\n entryRel.procedure as proc -> bundle.entry as e9, e9.request = create('BackboneElement') as request, request.method = 'POST', e9.resource = create('Procedure') as procedure2, procedure2.id = uuid() as uuid9, e9.fullUrl = append('https://example/Procedure/', uuid9), request.url = 'Procedure', procedureRes.partOf = create('Reference') as reference, reference.reference = ('https://example/Procedure/' + %procedure2.id) then Procedure(proc, patient, encounter, procedure2, bundle) "procedurePrestazioni";\n entryRel.substanceAdministration as subAdmin -> bundle.entry as e8, e8.request = create('BackboneElement') as request, request.method = 'POST', e8.resource = create('MedicationAdministration') as medAdmin, medAdmin.id = uuid() as uuid8, e8.fullUrl = append('https://example/MedicationAdministration/', uuid8), request.url = 'MedicationAdministration', procedureRes.partOf = create('Reference') as reference, reference.reference = ('https://example/MedicationAdministration/' + %medAdmin.id) then MedicationAdministration(subAdmin, patient, encounter, medAdmin, bundle) "farmacPrestazioni";\n entryRel.observation as entryRobs -> bundle.entry as e7, e7.request = create('BackboneElement') as request, request.method = 'POST', e7.resource = create('Observation') as obs7, obs7.id = uuid() as uuid7, e7.fullUrl = append('https://example/Observation/', uuid7), request.url = 'Observation', procedureRes.partOf = create('Reference') as reference, reference.reference = ('https://example/Observation/' + %obs7.id) then ObservationPrest(entryRobs, patient, encounter, obs7, bundle) "osservazioniPrestazioni";\n entryRel.act as act2 -> bundle.entry as e6, e6.request = create('BackboneElement') as request, request.method = 'POST', e6.resource = create('Procedure') as procedure3, procedure3.id = uuid() as uuid6, e6.fullUrl = append('https://example/Procedure/', uuid6), request.url = 'Procedure', procedureRes.partOf = create('Reference') as reference, reference.reference = ('https://example/Procedure/' + %procedure3.id) then Procedure(act2, patient, encounter, procedure3, bundle) "procedureGenerichePrestazioni";\n } "Relationship";\n } "proceduraMadre";\n } "Prestazioni";\n section where code.code = '80615-8' -> bundle.entry as e12, e12.request = create('BackboneElement') as request, request.method = 'POST', e12.resource = create('Observation') as obs12, obs12.id = uuid() as uuid12, e12.fullUrl = append('https://example/Observation/', uuid12), request.url = 'Observation', dReport.result = create('Reference') as reference, reference.reference = ('https://example/Observation/' + %obs12.id) then Observation(act, patient, encounter, obs12, bundle) "Followup";\n } "entryAct";\n // src.substanceAdministration\n src.substanceAdministration as substanceadmin then {\n section where code.code = '93341-6' -> bundle.entry as e6, e6.request = create('BackboneElement') as request, request.method = 'POST', e6.resource = create('MedicationRequest') as medre1, medre1.id = uuid() as uuid6, e6.fullUrl = append('https://example/MedicationRequest/', uuid6), request.url = 'MedicationRequest', dReport.basedOn = create('Reference') as reference, reference.reference = ('https://example/MedicationRequest/' + %medre1.id) then MedicationRequest(substanceadmin, patient, encounter, medre1, bundle) "TerapiaFarmacologicaConsigliata";\n } "substanceadmin";\n section where section.entry.exists().not() then {\n section where (code.code = '48765-2') -> bundle.entry as e2, e2.request = create('BackboneElement') as request, request.method = 'POST', e2.resource = create('Observation') as obs1, obs1.id = uuid() as uuid2, e2.fullUrl = append('https://example/Observation/', uuid2), request.url = 'Observation', dReport.result = create('Reference') as reference, reference.reference = ('https://example/Observation/' + %obs1.id) then {\n section -> obs1.subject = create('Reference') as reference, reference.reference = ('https://example/Patient/' + %patient.id) "reference";\n section -> obs1.encounter = create('Reference') as reference, reference.reference = ('https://example/Encounter/' + %encounter.id) "reference";\n section -> obs1.status = 'final' "STatusobse";\n section.code -> obs1.code;\n section.statusCode as s then {\n s.code as cos -> obs1.status = translate(cos, '#OBSstatus', 'code') "codeS";\n } "status";\n section.text as text -> bundle.entry as e5, e5.request = create('BackboneElement') as request, request.method = 'POST', e5.resource = create('AllergyIntolerance') as allergy, allergy.id = uuid() as uuid5, e5.fullUrl = append('https://example/AllergyIntolerance/', uuid5), request.url = 'AllergyIntolerance', obs1.focus = create('Reference') as reference, reference.reference = ('https://example/AllergyIntolerance/' + %allergy.id) then {\n section -> allergy.patient = create('Reference') as reference, reference.reference = ('https://example/Patient/' + %patient.id) "reference";\n section -> allergy.encounter = create('Reference') as reference, reference.reference = ('https://example/Encounter/' + %encounter.id) "reference";\n section -> allergy.clinicalStatus as clinicalStatus then {\n section -> clinicalStatus.coding = create('Coding') as coding then {\n section -> coding.code = 'active' "code";\n section -> coding.system = 'http://terminology.hl7.org/CodeSystem/allergyintolerance-clinical' "system";\n } "coding";\n } "status";\n text -> allergy.note as note then {\n text as t -> note.text = create('string') as textNote then EDstring(t, textNote) "note";\n } "narrative";\n } "allergytext";\n } "allergyAct";\n section where (code.code = '93341-6') then {\n section.text as text -> bundle.entry as e13, e13.request = create('BackboneElement') as request, request.method = 'POST', e13.resource = create('MedicationRequest') as obs13, obs13.id = uuid() as uuid13, e13.fullUrl = append('https://example/MedicationRequest/', uuid13), request.url = 'MedicationRequest', dReport.basedOn = create('Reference') as reference, reference.reference = ('https://example/MedicationRequest/' + %obs13.id) then {\n section -> obs13.subject = create('Reference') as reference, reference.reference = ('https://example/Patient/' + %patient.id) "reference";\n section -> obs13.encounter = create('Reference') as reference, reference.reference = ('https://example/Encounter/' + %encounter.id) "reference";\n section -> obs13.intent = 'order' "intent";\n section where statusCode.exists().not() -> obs13.status = 'unknown' "st";\n text -> obs13.note as note then {\n text as t -> note.text = create('string') as textNote then EDstring(t, textNote) "note";\n } "note";\n section -> obs13.medication = create('CodeableConcept') as code then {\n section -> code.text = 'string' "string";\n } "code";\n } "txtsec";\n } "MedicationRequest";\n section where (code.code = '55110-1').not() and (code.code = '93341-6').not() and (code.code = '48765-2').not() then {\n section.text as text -> bundle.entry as e13, e13.request = create('BackboneElement') as request, request.method = 'POST', e13.resource = create('Observation') as obs13, obs13.id = uuid() as uuid13, e13.fullUrl = append('https://example/Observation/', uuid13), request.url = 'Observation', dReport.result = create('Reference') as reference, reference.reference = ('https://example/Observation/' + %obs13.id) then {\n section -> obs13.subject = create('Reference') as reference, reference.reference = ('https://example/Patient/' + %patient.id) "reference";\n section -> obs13.encounter = create('Reference') as reference, reference.reference = ('https://example/Encounter/' + %encounter.id) "reference";\n section -> obs13.status = 'preliminary' "obsst";\n section.code -> obs13.code "obscde";\n section -> obs13.status = 'final' "statusS";\n text -> obs13.note as note then {\n text as t -> note.text = create('string') as textNote then EDstring(t, textNote) "note";\n } "narrative";\n } "txtsec";\n } "NonConclusion";\n section where (code.code = '55110-1') then {\n section.text as t -> dReport.conclusion = create('string') as textConclusion then EDstring(t, textConclusion) "conc";\n } "conclusion";\n } "whereCond";\n}\n\ngroup Observation(source cda : observation, target patient : Patient, target encounter : Encounter, target ob : Observation, target bundle : Bundle) {\n cda -> ob.subject = create('Reference') as reference, reference.reference = ('https://example/Patient/' + %patient.id) "reference";\n cda -> ob.encounter = create('Reference') as reference, reference.reference = ('https://example/Encounter/' + %encounter.id) "reference";\n cda.code -> ob.code;\n cda -> ob.status = 'final' "Stats";\n // value datatype\n cda.value : INT as int -> ob.value = (int.value);\n cda.value : ST as st -> ob.value = create('string'), ob.value = (st.dataString);\n cda.value : BL as boolean -> ob.value = (boolean.value) "boolean";\n cda.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.value);\n };\n val -> ce.coding as coding then {\n val.code as code -> coding.code = cast(code, 'string');\n val.codeSystem as system -> coding.system = translate(system, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri');\n val.displayName as display -> coding.display = cast(display, 'string');\n } "code";\n val.translation as translation -> ce.coding as coding then {\n translation.code as code -> coding.code = cast(code, 'string');\n translation.codeSystem as system -> coding.system = translate(system, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri');\n translation.displayName as display -> coding.display = cast(display, 'string');\n translation.qualifier as qualifier then {\n qualifier.value as value -> ce.coding as coding then {\n value.code as code -> coding.code = cast(code, 'string');\n value.codeSystem as system -> coding.system = translate(system, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri');\n value.displayName as display -> coding.display = cast(display, 'string');\n };\n };\n };\n } "coding";\n } "val";\n cda.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.value);\n };\n val -> ce.coding as coding then {\n val.code as code -> coding.code = cast(code, 'string');\n val.codeSystem as system -> coding.system = translate(system, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri');\n val.displayName as display -> coding.display = cast(display, 'string');\n } "code";\n val.translation as translation -> ce.coding as coding then {\n translation.code as code -> coding.code = cast(code, 'string');\n translation.codeSystem as system -> coding.system = translate(system, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri');\n translation.displayName as display -> coding.display = cast(display, 'string');\n translation.qualifier as qualifier then {\n qualifier.value as value -> ce.coding as coding then {\n value.code as code -> coding.code = cast(code, 'string');\n value.codeSystem as system -> coding.system = translate(system, 'http://hl7.org/fhir/ConceptMap/special-oid2uri', 'uri');\n value.displayName as display -> coding.display = cast(display, 'string');\n };\n };\n };\n } "coding";\n } "val";\n cda.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 cda.effectiveTime as effectiveTime where (value.exists()) -> ob.effective = create('dateTime') as value then TSDateTime(effectiveTime, value) "value1";\n cda.effectiveTime as effectiveTime where (low.exists()) -> ob.effective = create('Period') as value then IVLTSPeriod(effectiveTime, value) "valuePeriod";\n cda.text as text -> ob.note as note then {\n text.reference as reference -> note.text = (reference.value) "text";\n } "note";\n cda.statusCode as s then {\n s.code as cos -> ob.status = translate(cos, '#OBSstatus', 'code') "codeS";\n } "status";\n}\n\ngroup ConditionFunction(source src : cdaElement, target tgt : Condition, target patient : patient, target encounter : encounter, target bundle : Bundle) {\n src.code -> tgt.category;\n src -> tgt.subject = create('Reference') as reference, reference.reference = ('https://example/Patient/' + %patient.id) "reference";\n src -> tgt.encounter = create('Reference') as reference, reference.reference = ('https://example/Encounter/' + %encounter.id) "reference";\n src.statusCode as stscode -> tgt.verificationStatus as verifstatus then {\n stscode as codeS -> verifstatus.coding = create('Coding') as coding then {\n codeS.code -> coding.code = 'confirmed';\n codeS -> coding.system = 'http://terminology.hl7.org/CodeSystem/condition-ver-status' "system";\n codeS -> coding.display = cast('Confirmed', 'string') "display";\n } "coding";\n } "verifstatus";\n src.effectiveTime as effectiveTime -> tgt.onset = create('Period') as value then IVLTSPeriod(effectiveTime, value) "valuePeriod";\n src.value -> tgt.code;\n src.entryRelationship as entryRelationship then {\n entryRelationship.observation as obsentry then {\n obsentry.code where code = '89261-2' then {\n obsentry -> tgt.evidence as evidence, bundle.entry as e1, e1.request = create('BackboneElement') as request, request.method = 'POST', e1.resource = create('Observation') as obsy, obsy.id = uuid() as uuid1, e1.fullUrl = append('https://example/Observation/', uuid1), request.url = 'Observation', evidence.detail = create('Reference') as reference, reference.reference = ('https://example/Observation/' + %obsy.id) then Observation(obsentry, patient, encounter, obsy, bundle) "observation";\n } "observation";\n obsentry.code where code = '33999-4' then {\n obsentry.value as value -> tgt.clinicalStatus as clinicalstatus then {\n value as val -> clinicalstatus.coding = create('Coding') as coding then {\n val where (code = 'LA9041-0') -> coding.code = 'resolved' "code";\n val where (code = 'LA18632-2') -> coding.code = 'inactive' "code";\n val where (code = 'LA16666-2') -> coding.code = 'active' "code";\n val -> coding.system = 'http://terminology.hl7.org/CodeSystem/condition-clinical' "system";\n val.displayName as display -> coding.display = cast(display, 'string') "display";\n } "coding";\n obsentry.text as text then {\n text.reference as reference -> clinicalstatus.text = (reference.value) "text";\n };\n } "clinicalstatus";\n } "clinicalStatus2";\n } "EntryRelObsevation";\n } "entryR";\n}\n\ngroup Procedure(source src : procedure, target patient : Patient, target encounter : Encounter, target tgt : Procedure, target bundle : Bundle) {\n src -> tgt.subject = create('Reference') as reference, reference.reference = ('https://example/Patient/' + %patient.id) "reference";\n src -> tgt.encounter = create('Reference') as reference, reference.reference = ('https://example/Encounter/' + %encounter.id) "reference";\n src.statusCode -> tgt.status "status1";\n src where statusCode.exists().not() -> tgt.status = 'unknown' "status2";\n src.id -> tgt.identifier;\n src.code -> tgt.code;\n src.effectiveTime as effectiveTime where (value.exists()) -> tgt.performed = create('dateTime') as value then TSDateTime(effectiveTime, value) "value1";\n src.effectiveTime as effectiveTime where (low.exists()) -> tgt.performed = create('Period') as value then IVLTSPeriod(effectiveTime, value) "valuePeriod";\n src.methodCode as methodCode -> tgt.extension as ext1 then ITMethodExt(methodCode, ext1);\n src.participant as participant then {\n participant.participantRole as participantRole -> tgt.performer as performer then {\n participantRole.playingDevice as device -> bundle.entry as e2, e2.request = create('BackboneElement') as request, request.method = 'POST', e2.resource = create('Device') as deviceRes, deviceRes.id = uuid() as uuid2, e2.fullUrl = append('https://example/Device/', uuid2), request.url = 'Device', performer.actor = create('Reference') as reference, reference.reference = ('https://example/Device/' + %deviceRes.id) then {\n device.manufacturerModelName as manufacturerModelName then {\n manufacturerModelName.displayName as displayName -> deviceRes.manufacturer = cast(displayName, 'string') "manuf";\n } "manufacturer";\n device.code -> deviceRes.type;\n } "device";\n };\n };\n src.entryRelationship as entryR then {\n entryR.observation as observation -> bundle.entry as e3, e3.request = create('BackboneElement') as request, request.method = 'POST', e3.resource = create('Observation') as obs1, obs1.id = uuid() as uuid3, e3.fullUrl = append('https://example/Observation/', uuid3), request.url = 'Observation', tgt.partOf = create('Reference') as reference, reference.reference = ('https://example/Observation/' + %obs1.id) then Observation(observation, patient, encounter, obs1, bundle) "Parametri";\n entryR.act as act then {\n act.text as text -> tgt.note as note then {\n text.reference as reference -> note.text = (reference.value) "text";\n } "note";\n };\n } "entryRelProcedure";\n}\n\ngroup ITMethodExt(source src, target ext) {\n src -> ext.url = 'http://hl7.org/fhir/StructureDefinition/procedure-method' "url";\n src -> ext.value = create('CodeableConcept') as value then CECodeableConcept(src, value) "value";\n}\n\ngroup MedicationAdministration(source src : substanceAdministration, target patient : Patient, target encounter : Encounter, target tgt : MedicationAdministration, target bundle : Bundle) {\n src -> tgt.subject = create('Reference') as reference, reference.reference = ('https://example/Patient/' + %patient.id) "reference";\n src -> tgt.context = create('Reference') as reference, reference.reference = ('https://example/Encounter/' + %encounter.id) "reference";\n src.statusCode -> tgt.status "status1";\n src where statusCode.exists().not() -> tgt.status = 'unknown' "status2";\n src.id -> tgt.identifier;\n src.effectiveTime as effectiveTime where (value.exists()) -> tgt.effective = create('dateTime') as value then TSDateTime(effectiveTime, value) "value1";\n src.effectiveTime as effectiveTime where (low.exists()) -> tgt.effective = create('Period') as value then IVLTSPeriod(effectiveTime, value) "valuePeriod";\n src -> tgt.dosage as dosage then {\n src.routeCode -> dosage.route "route";\n src.repeatNumber as repeatNumber -> dosage.rate = create('SimpleQuantity') as value then PQQuantity(repeatNumber, value) "repQ";\n src.approachSiteCode -> dosage.site "site";\n src.targetSiteCode -> dosage.site "site";\n } "dosage";\n src.consumable as consumable -> 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', tgt.medication = create('Reference') as medref, medref.reference = ('https://example/Medication/' + %medication.id) then Medication(src, medication, patient, bundle) "medication";\n src.participant as participant then {\n participant.participantRole as participantRole -> tgt.performer as performer then {\n participantRole.device as device -> bundle.entry as e2, e2.request = create('BackboneElement') as request, request.method = 'POST', e2.resource = create('Device') as deviceRes, deviceRes.id = uuid() as uuid2, e2.fullUrl = append('https://example/Device/', uuid2), request.url = 'Device', performer.actor = create('Reference') as reference, reference.reference = ('https://example/Device/' + %deviceRes.id) then {\n device.ManufacturerModelName as ManufacturerModelName then {\n ManufacturerModelName.code -> deviceRes.manufacturer "manuf";\n } "manufacturer";\n };\n };\n };\n src.entryRelationship as entryR then {\n entryR.observation as observation -> bundle.entry as e3, e3.request = create('BackboneElement') as request, request.method = 'POST', e3.resource = create('Observation') as obs1, obs1.id = uuid() as uuid3, e3.fullUrl = append('https://example/Observation/', uuid3), request.url = 'Observation', tgt.partOf = create('Reference') as reference, reference.reference = ('https://example/Observation/' + %obs1.id) then Observation(observation, patient, encounter, obs1, bundle) "Parametri";\n entryR.act as act then {\n act.text as text -> tgt.note as note then {\n text.reference as reference -> note.text = (reference.value) "text";\n } "note";\n };\n } "entryRelMedication";\n src where (src.doseQuantity.exists() or src.rateQuantity.exists()) -> bundle.entry as e1, e1.request = create('BackboneElement') as request, request.method = 'POST', e1.resource = create('MedicationRequest') as medicationRq, medicationRq.id = uuid() as uuid1, e1.fullUrl = append('https://example/MedicationRequest/', uuid1), request.url = 'MedicationRequest', tgt.request = create('Reference') as reference, reference.reference = ('https://example/MedicationRequest/' + %medicationRq.id) then MedicationRequest(src, patient, encounter, medicationRq, bundle) "medRequ";\n src.text as text -> tgt.note as note then {\n text -> note.text "text";\n } "note";\n}\n\ngroup ObservationPrest(source src : observation, target patient : Patient, target encounter : Encounter, target tgt : Observation, target bundle : Bundle) {\n src -> tgt.subject = create('Reference') as reference, reference.reference = ('https://example/Patient/' + %patient.id) "reference";\n src -> tgt.encounter = create('Reference') as reference, reference.reference = ('https://example/Encounter/' + %encounter.id) "reference";\n src.statusCode as s then {\n s.code as cos -> tgt.status = translate(cos, '#OBSstatus', 'code') "codeS";\n } "status";\n src.id -> tgt.identifier;\n src.code -> tgt.code;\n src.effectiveTime as effectiveTime where (value.exists()) -> tgt.perfomed = create('dateTime') as value then TSDateTime(effectiveTime, value) "value1";\n src.effectiveTime as effectiveTime where (low.exists()) -> tgt.perfomed = create('Period') as value then IVLTSPeriod(effectiveTime, value) "valuePeriod";\n src.methodCode -> tgt.method;\n src.participant as participant then {\n participant.participantRole as participantRole then {\n participantRole.device as device -> bundle.entry as e2, e2.request = create('BackboneElement') as request, request.method = 'POST', e2.resource = create('Device') as deviceRes, deviceRes.id = uuid() as uuid2, e2.fullUrl = append('https://example/Device/', uuid2), request.url = 'Device', tgt.device = create('Reference') as reference, reference.reference = ('https://example/Device/' + %deviceRes.id) then {\n device.ManufacturerModelName as ManufacturerModelName then {\n ManufacturerModelName.code -> deviceRes.manufacturer "manuf";\n } "manufacturer";\n };\n };\n };\n src.entryRelationship as entryR then {\n entryR.observation as observation -> bundle.entry as e3, e3.request = create('BackboneElement') as request, request.method = 'POST', e3.resource = create('Observation') as obs1, obs1.id = uuid() as uuid3, e3.fullUrl = append('https://example/Observation/', uuid3), request.url = 'Observation', tgt.hasMember = create('Reference') as reference, reference.reference = ('https://example/Observation/' + %obs1.id) then Observation(observation, patient, encounter, obs1, bundle) "Parametri";\n entryR.act as act then {\n act.text as text -> tgt.note as note then {\n text.reference as reference -> note.text = (reference.value) "text";\n } "note";\n };\n } "entryRelOsservazioni";\n}\n\ngroup MedicationRequest(source src : substanceAdministration, target patient : Patient, target encounter : Encounter, target tgt : MedicationRequest, target bundle : Bundle) {\n // default + mandatory\n src -> tgt.subject = create('Reference') as reference, reference.reference = ('https://example/Patient/' + %patient.id) "reference";\n src -> tgt.encounter = create('Reference') as reference, reference.reference = ('https://example/Encounter/' + %encounter.id) "reference";\n src -> tgt.intent = 'order' "intent";\n src where statusCode.exists().not() -> tgt.status = 'unknown' "st";\n src.statusCode as sc then {\n sc.code as cos -> tgt.status = translate(cos, '#MedicationStatusMap', 'code') "codeS";\n } "status";\n src.text as txt -> tgt.note as note then {\n txt.reference as reference -> note.text = (reference.value) "text";\n } "note";\n src.effectiveTime : IVL_TS as eff -> tgt.dosageInstruction = create('Dosage') as dosage then {\n eff -> dosage.timing = create('Timing') as timing then {\n eff -> timing.repeat as rep then {\n eff as eff where (value.exists()) -> rep.bounds = create('dateTime') as value then TSDateTime(eff, value) "value1";\n eff as eff where (low.exists()) -> rep.bounds = create('Period') as value then IVLTSPeriod(eff, value) "valuePeriod";\n } "rep";\n } "timing";\n } "period";\n src.effectiveTime : EIVL_TS as effe -> tgt.dosageInstruction = create('Dosage') as dosage then {\n effe -> dosage.timing = create('Timing') as timing then {\n effe -> timing.repeat as rep then {\n effe.eventCode as ev -> rep.when = (ev.code);\n } "rep";\n } "timing";\n } "period";\n src.effectiveTime : IVL_TS as eff -> tgt.dosageInstruction = create('Dosage') as dosage, dosage.timing = create('Timing') as timing, timing.event = (eff.value) "tim";\n src.effectiveTime : PIVL_TS as eff -> tgt.dosageInstruction = create('Dosage') as dosage then {\n eff -> dosage.timing = create('Timing') as timing then periodTiming(eff, timing) "cod";\n } "eff";\n src where (src.doseQuantity.exists() or src.rateQuantity.exists()) then {\n src -> tgt.dosageInstruction = create('Dosage') as dosageInstruction then {\n src.doseQuantity as doseQuant 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 };\n src.rateQuantity as rateQuantity then {\n rateQuantity.originalText as ot then {\n ot.reference -> dosageInstruction.text;\n } "ot";\n rateQuantity -> dosageInstruction.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 } "high";\n } "r";\n } "dosageRate";\n } "rate";\n src.routeCode -> dosageInstruction.route "route";\n src.approachSiteCode -> dosageInstruction.site "site";\n src.targetSiteCode -> dosageInstruction.site "site";\n } "dosageIn";\n } "condition";\n src.consumable as consumable -> 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', tgt.medication = create('Reference') as medref, medref.reference = ('https://example/Medication/' + %medication.id) then Medication(src, medication, patient, bundle) "medication";\n src.entryRelationship as entryRelationship then {\n entryRelationship.supply as supply -> tgt.dispenseRequest as dispenseRequest then {\n supply.quantity as quantityCDA -> dispenseRequest.quantity as quantityFHIR then {\n quantityCDA -> quantityFHIR.value = (quantityCDA.value) "value";\n };\n };\n } "entryR";\n src.participant as participant then {\n participant then Practitioner(participant, tgt, bundle) "function";\n participant.effectiveTime -> tgt.authoredOn "autor";\n } "Partecipant";\n}\n\ngroup periodTiming(source effectiveTime : PIVL_TS, target timing : Timing) {\n effectiveTime -> timing.repeat as r then {\n effectiveTime.period as p -> r.period = (p.value);\n effectiveTime.period as p -> r.periodUnit = (p.unit);\n } "repeat";\n}\n\ngroup Medication(source src : cda, target tgt : Medication, target patient : Patient, target bundle : Bundle) {\n src.consumable as consumable then {\n consumable.manufacturedProduct as manufacturedProduct then {\n manufacturedProduct.manufacturedMaterial as manufacturedMaterial then {\n manufacturedMaterial.code -> tgt.code "CE";\n src.administrationUnitCode -> tgt.form "form";\n } "material";\n } "product";\n };\n src.entryRelationship as entryR then {\n entryR.observation as observation then {\n observation.code where displayName = 'Grammatura' -> tgt.ingredient as ingredient then {\n src.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 -> tgt.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}\n\ngroup MedicationStatement(source src : subAdmin, target tgt : MedicationStatement, target patient : Patient, target encounter : Encounter, target bundle : Bundle) {\n src -> tgt.subject = create('Reference') as reference, reference.reference = ('https://example/Patient/' + %patient.id) "reference";\n src.statusCode -> tgt.status;\n src where statusCode.exists().not() -> tgt.status = 'unknown' "notpresent";\n src.consumable as consumable then {\n consumable.manufacturedProduct as manufacturedProduct then {\n manufacturedProduct.manufacturedMaterial as manufacturedMaterial then {\n manufacturedMaterial.code as code -> tgt.medication = create('CodeableConcept') as ce then CECodeableConcept(code, ce) "CE";\n } "material";\n } "product";\n };\n}\n\ngroup FamilyMemberFunction(source src : organizer, target tgt : FamilyMemberHistory, target patient : patient) {\n src -> tgt.patient = create('Reference') as reference, reference.reference = ('https://example/Patient/' + %patient.id) "patReference";\n src.statusCode -> tgt.status;\n src.effectiveTime as effectiveTime -> tgt.date = create('date') as value then TSDateTime(effectiveTime, value) "date";\n src.subject as subject then {\n subject.relatedSubject as relatedSubject then {\n relatedSubject.code -> tgt.relationship "relationshipCode";\n relatedSubject.subject as subject -> tgt.sex as sex then {\n subject.administrativeGenderCode as administrativeGenderCode -> sex.coding as coding then {\n administrativeGenderCode.code as sexCode -> coding.code = translate(sexCode, '#cm-v3-administrative-gender', 'code') "gender";\n administrativeGenderCode -> coding.system = 'http://hl7.org/fhir/administrative-gender' "system";\n } "coding";\n };\n } "relatedSub";\n } "relationship";\n src.component as component -> tgt.condition as condition then {\n component.observation as observation then {\n observation.code -> condition.code;\n observation.text as text -> tgt.note as note then {\n text.reference as reference -> note.text = (reference.value) "value";\n } "reference";\n observation.statusCode -> tgt.status;\n // observation.effectiveTime as effectiveTime -> condition.onset = create('Period') as value then IVLTSPeriod(effectiveTime, value) "valuePeriod";\n observation where observation.effectiveTime.exists() then {\n observation.effectiveTime as effectiveTime -> tgt.condition = create('BackboneElement') as condition then {\n observation.code -> condition.code;\n observation.value -> condition.outcome "codeable";\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 } "effttemp";\n } "cont";\n observation.value -> condition.outcome "codeable";\n observation.entryRelationship as entryR then {\n entryR.observation as obs then {\n obs where (code.code = '35267-4') then {\n obs.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 obs where (code.code = '39016-1') then {\n obs.value as value -> tgt.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 } "death";\n } "obser";\n } "EntryRel";\n };\n };\n}\n\ngroup allergyFunction(source src : cdaElement, target tgt : AllergyIntolerance, target patient : patient, target encounter : encounter) {\n src -> tgt.patient = create('Reference') as reference, reference.reference = ('https://example/Patient/' + %patient.id) "reference";\n src -> tgt.encounter = create('Reference') as reference, reference.reference = ('https://example/Encounter/' + %encounter.id) "reference";\n src.entryRelationship as entryRelationship1 then {\n entryRelationship1.observation as observation1 then {\n observation1.effectiveTime as effectiveTime -> tgt.onset = create('Period') as value then IVLTSPeriod(effectiveTime, value) "valuePeriod";\n observation1.value as code then {\n code.code as code1 -> tgt.type = translate(code1, '#AllergyTypeMap', 'code') "type";\n code.code as code1 -> tgt.category = translate(code1, '#AllergyCategoryMap', 'code') "category";\n } "code";\n observation1.participant as participant -> tgt.reaction as reaction then {\n observation1.entryRelationship as entryRelationship2 where (typeCode = 'MFST') then {\n entryRelationship2.observation as observation2 then {\n observation2.value -> reaction.manifestation "manifestation";\n observation2.effectiveTime as effectiveTime then {\n effectiveTime.low as low -> reaction.onset = create('dateTime') as value then TSDateTime(low, value) "valuePeriodLow";\n } "low";\n } "observ2";\n } "entryR2";\n participant.participantRole as participantRole then {\n participantRole.playingEntity as playingEntity then {\n playingEntity.code -> reaction.substance "reaction";\n };\n };\n };\n observation1.entryRelationship as entryRelationship2 where (typeCode = 'MFST') then {\n entryRelationship2.observation as observation2 where observation1.participant.exists().not() -> tgt.reaction as reaction then {\n observation2.value -> reaction.manifestation "manifestation";\n observation2.effectiveTime as effectiveTime then {\n effectiveTime.low as low -> reaction.onset = create('dateTime') as value then TSDateTime(low, value) "valuePeriodLow";\n } "low";\n } "observ2";\n } "entryR2";\n observation1.entryRelationship as entryRelationship3 where (typeCode = 'SUBJ') then {\n entryRelationship3.observation as observation3 then {\n observation3.value as value then {\n value.code as c -> tgt.criticality = translate(c, '#CricalityMap', 'code') "value";\n } "criticality";\n } "observ3";\n entryRelationship3.act as act -> tgt.note as note then {\n act.text as text then {\n text.reference as reference -> note.text = (reference.value);\n } "note";\n };\n } "entryR3";\n observation1.entryRelationship as entryRelationship4 where (typeCode = 'REFR') then {\n entryRelationship4.observation as observation4 then {\n observation4.value as value -> tgt.clinicalStatus as clinicalStatus then {\n value as valu -> clinicalStatus.coding = create('Coding') as coding then {\n valu where (code = 'LA9041-0') -> coding.code = 'resolved' "code";\n valu where (code = 'LA18632-2') -> coding.code = 'inactive' "code";\n valu where (code = 'LA16666-2') -> coding.code = 'active' "code";\n valu -> coding.system = 'http://terminology.hl7.org/CodeSystem/allergyintolerance-clinical' "system";\n valu.displayName as display -> coding.display = cast(display, 'string') "display";\n } "coding";\n } "clinicalStatus";\n } "observ4";\n } "entryR4";\n };\n } "entryrelationship";\n}\n\ngroup Practitioner(source src : participant, target tgt : MedicationRequest, target bundle : Bundle) {\n src -> bundle.entry as e22, e22.request = create('BackboneElement') as request, request.method = 'PUT', e22.resource = create('Practitioner') as practitioner1 then {\n src.participantRole as practr then {\n practr.id as id -> practitioner1.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 "ext";\n id.assigningAuthorityName as s -> identifier.assigner as a, a.display = s;\n id.root as r then {\n id.extension as ext -> practitioner1.id = (r + '-' + ext) as uuid22, e22.fullUrl = append('https://example/Practitioner/', uuid22), tgt.requester = create('Reference') as reference, reference.reference = ('https://example/Practitioner/' + %practitioner1.id) "id";\n } "r";\n } "identifier";\n practr.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 practr.id as id where (root != '2.16.840.1.113883.2.9.4.3.2') then {\n id.extension as ext -> request.url = append('Practitioner?identifier=', ext) "UUID";\n } "diverso";\n practr -> practitioner1.meta as meta then {\n practr -> meta.tag = create('Coding') as coding then {\n practr -> coding.system = 'http://algoritmodiscoring' "system";\n practr -> coding.code = 'ClinicalDocument/body/TerapiaFarmacologicaConsigliata/participant' "code";\n } "coding";\n } "meta";\n practr.addr -> practitioner1.address;\n practr.telecom -> practitioner1.telecom;\n practr.playingEntity as plentity then {\n plentity.name -> practitioner1.name;\n plentity.birthTime as birthTime then {\n birthTime.value as date -> practitioner1.birthDate = truncate(date, 10);\n } "birth";\n } "partname";\n } "resurceCreation";\n } "practitionerCreate";\n}\n\n</pre>\n </div>"
},
"url" : "http://hl7.it/fhir/cda2fhir/StructureMap/cda2fhirAmbReport",
"version" : "0.1.0",
"name" : "cda2fhirAmbReport",
"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/List",
"mode" : "produced",
"alias" : "List"
},
{
"url" : "http://hl7.org/fhir/StructureDefinition/Practitioner",
"mode" : "produced",
"alias" : "Practitioner"
},
{
"url" : "http://hl7.org/fhir/StructureDefinition/Organization",
"mode" : "produced",
"alias" : "Organization"
},
{
"url" : "http://hl7.org/fhir/cda/StructureDefinition/Act",
"mode" : "produced",
"alias" : "Act"
},
{
"url" : "http://hl7.org/fhir/cda/StructureDefinition/IVL-PQ",
"mode" : "source",
"alias" : "IVL_PQ"
},
{
"url" : "http://hl7.org/fhir/cda/StructureDefinition/PQ",
"mode" : "source",
"alias" : "PQ"
},
{
"url" : "http://hl7.org/fhir/StructureDefinition/SimpleQuantity",
"mode" : "target",
"alias" : "SimpleQuantity"
}
],
"import" : [
🔗 "http://hl7.it/fhir/cda2fhir/StructureMap/cda2fhirDataTypes"🔗 ,
"http://hl7.it/fhir/cda2fhir/StructureMap/cda2fhirHeader"
],
"group" : [
{
"name" : "CdaToBundle",
"typeMode" : "none",
"input" : [
{
"name" : "cda",
"type" : "ClinicalDocument",
"mode" : "source"
},
{
"name" : "bundle",
"type" : "Bundle",
"mode" : "target"
}
],
"rule" : [
{
"name" : "ClinicalDocumentToBody",
"source" : [
{
"context" : "cda"
}
],
"target" : [
{
"context" : "bundle",
"contextType" : "variable",
"element" : "entry",
"variable" : "e"
},
{
"context" : "e",
"contextType" : "variable",
"element" : "request",
"variable" : "request",
"transform" : "create",
"parameter" : [
{
"valueString" : "BackboneElement"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "method",
"transform" : "copy",
"parameter" : [
{
"valueString" : "POST"
}
]
},
{
"context" : "e",
"contextType" : "variable",
"element" : "resource",
"variable" : "composition",
"transform" : "create",
"parameter" : [
{
"valueString" : "Composition"
}
]
},
{
"context" : "composition",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid1",
"transform" : "uuid"
},
{
"context" : "e",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "https://example/Composition/"
},
{
"valueId" : "uuid1"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "url",
"transform" : "copy",
"parameter" : [
{
"valueString" : "Composition"
}
]
},
{
"context" : "bundle",
"contextType" : "variable",
"element" : "entry",
"variable" : "e2"
},
{
"context" : "e2",
"contextType" : "variable",
"element" : "request",
"variable" : "requestPAT",
"transform" : "create",
"parameter" : [
{
"valueString" : "BackboneElement"
}
]
},
{
"context" : "requestPAT",
"contextType" : "variable",
"element" : "method",
"transform" : "copy",
"parameter" : [
{
"valueString" : "PUT"
}
]
},
{
"context" : "e2",
"contextType" : "variable",
"element" : "resource",
"variable" : "patient",
"transform" : "create",
"parameter" : [
{
"valueString" : "Patient"
}
]
},
{
"context" : "patient",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid2",
"transform" : "uuid"
},
{
"context" : "e2",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "https://example/Patient/"
},
{
"valueId" : "uuid2"
}
]
},
{
"context" : "bundle",
"contextType" : "variable",
"element" : "entry",
"variable" : "e3"
},
{
"context" : "e3",
"contextType" : "variable",
"element" : "request",
"variable" : "request",
"transform" : "create",
"parameter" : [
{
"valueString" : "BackboneElement"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "method",
"transform" : "copy",
"parameter" : [
{
"valueString" : "POST"
}
]
},
{
"context" : "e3",
"contextType" : "variable",
"element" : "resource",
"variable" : "encounter",
"transform" : "create",
"parameter" : [
{
"valueString" : "Encounter"
}
]
},
{
"context" : "encounter",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid3",
"transform" : "uuid"
},
{
"context" : "e3",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "https://example/Encounter/"
},
{
"valueId" : "uuid3"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "url",
"transform" : "copy",
"parameter" : [
{
"valueString" : "Encounter"
}
]
},
{
"context" : "bundle",
"contextType" : "variable",
"element" : "entry",
"variable" : "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" : "DocumentReference",
"transform" : "create",
"parameter" : [
{
"valueString" : "DocumentReference"
}
]
},
{
"context" : "DocumentReference",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid4",
"transform" : "uuid"
},
{
"context" : "e4",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "https://example/DocumentReference/"
},
{
"valueId" : "uuid4"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "url",
"transform" : "copy",
"parameter" : [
{
"valueString" : "DocumentReference"
}
]
}
],
"rule" : [
{
"name" : "cdatobundle",
"source" : [
{
"context" : "cda"
}
],
"dependent" : [
{
"name" : "ClinicalDocumentToBundle",
"variable" : [
"cda",
"patient",
"composition",
"encounter",
"bundle",
"DocumentReference"
]
}
]
},
{
"name" : "patient",
"source" : [
{
"context" : "cda",
"element" : "recordTarget",
"variable" : "recordTarget"
}
],
"rule" : [
{
"name" : "recPat",
"source" : [
{
"context" : "recordTarget",
"element" : "patientRole",
"variable" : "patient"
}
],
"rule" : [
{
"name" : "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" : "record",
"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" : "diagnostic",
"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" : "diagnosticReport",
"transform" : "create",
"parameter" : [
{
"valueString" : "DiagnosticReport"
}
]
},
{
"context" : "diagnosticReport",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid1",
"transform" : "uuid"
},
{
"context" : "e",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "https://example/DiagnosticReport/"
},
{
"valueId" : "uuid1"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "url",
"transform" : "copy",
"parameter" : [
{
"valueString" : "DiagnosticReport"
}
]
}
],
"rule" : [
{
"name" : "diagnosticCode",
"source" : [
{
"context" : "cda",
"element" : "code",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "diagnosticReport",
"contextType" : "variable",
"element" : "code",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "stats",
"source" : [
{
"context" : "cda"
}
],
"target" : [
{
"context" : "diagnosticReport",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "registered"
}
]
}
]
},
{
"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" : "code",
"source" : [
{
"context" : "srcSection",
"element" : "code"
}
],
"target" : [
{
"context" : "composition",
"contextType" : "variable",
"element" : "section",
"variable" : "tgtSection"
}
],
"dependent" : [
{
"name" : "ClinicalDocumentSection",
"variable" : [
"cda",
"srcSection",
"patient",
"tgtSection",
"bundle",
"encounter",
"diagnosticReport"
]
}
]
}
]
}
]
}
]
}
]
}
]
}
]
},
{
"name" : "ClinicalDocumentSection",
"typeMode" : "none",
"input" : [
{
"name" : "cda",
"type" : "ClinicalDocument",
"mode" : "source"
},
{
"name" : "src",
"type" : "Section",
"mode" : "source"
},
{
"name" : "patient",
"type" : "Patient",
"mode" : "target"
},
{
"name" : "tgt",
"mode" : "target"
},
{
"name" : "bundle",
"type" : "Bundle",
"mode" : "target"
},
{
"name" : "enc",
"type" : "Encounter",
"mode" : "target"
},
{
"name" : "dReport",
"type" : "DiagnosticReport",
"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" : "reference",
"source" : [
{
"context" : "src"
}
],
"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/DiagnosticReport/' + %dReport.id"
}
]
}
]
},
{
"name" : "entry",
"source" : [
{
"context" : "src",
"element" : "entry",
"variable" : "entry"
}
],
"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" : "dreport",
"source" : [
{
"context" : "entry"
}
],
"dependent" : [
{
"name" : "DiagnosticReportFunction",
"variable" : [
"src",
"entry",
"dReport",
"bundle",
"enc",
"patient"
]
}
]
}
]
},
{
"name" : "narrative",
"source" : [
{
"context" : "src",
"condition" : "src.entry.exists().not()"
}
],
"dependent" : [
{
"name" : "DiagnosticReportFunction",
"variable" : [
"src",
"cda",
"dReport",
"bundle",
"enc",
"patient"
]
}
]
},
{
"name" : "component",
"source" : [
{
"context" : "src",
"element" : "component",
"variable" : "component"
}
],
"rule" : [
{
"name" : "section",
"source" : [
{
"context" : "component",
"element" : "section",
"variable" : "sec"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "section",
"variable" : "tgtSection"
}
],
"dependent" : [
{
"name" : "ClinicalDocumentSection",
"variable" : [
"cda",
"sec",
"patient",
"tgtSection",
"bundle",
"enc",
"dReport"
]
}
]
}
]
}
]
},
{
"name" : "DiagnosticReportFunction",
"typeMode" : "none",
"input" : [
{
"name" : "section",
"type" : "section",
"mode" : "source"
},
{
"name" : "src",
"type" : "entry",
"mode" : "source"
},
{
"name" : "dReport",
"type" : "DiagnosticReport",
"mode" : "target"
},
{
"name" : "bundle",
"type" : "Bundle",
"mode" : "target"
},
{
"name" : "encounter",
"type" : "Encounter",
"mode" : "target"
},
{
"name" : "patient",
"type" : "Patient",
"mode" : "target"
}
],
"rule" : [
{
"name" : "entryObs",
"source" : [
{
"context" : "src",
"element" : "observation",
"variable" : "observation"
}
],
"rule" : [
{
"name" : "QuesitoDiagnostico",
"source" : [
{
"context" : "section",
"condition" : "code.code = '29299-5'"
}
],
"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" : "obs1",
"transform" : "create",
"parameter" : [
{
"valueString" : "Observation"
}
]
},
{
"context" : "obs1",
"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" : "dReport",
"contextType" : "variable",
"element" : "result",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Observation/' + %obs1.id"
}
]
}
],
"dependent" : [
{
"name" : "Observation",
"variable" : [
"observation",
"patient",
"encounter",
"obs1",
"bundle"
]
}
]
},
{
"name" : "StoriaClinica1",
"source" : [
{
"context" : "section",
"condition" : "code.code = '11329-0'"
}
],
"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" : "obs2",
"transform" : "create",
"parameter" : [
{
"valueString" : "Observation"
}
]
},
{
"context" : "obs2",
"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" : "dReport",
"contextType" : "variable",
"element" : "result",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Observation/' + %obs2.id"
}
]
}
],
"rule" : [
{
"name" : "reference",
"source" : [
{
"context" : "section"
}
],
"target" : [
{
"context" : "obs2",
"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" : "section"
}
],
"target" : [
{
"context" : "obs2",
"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" : "STatusobse",
"source" : [
{
"context" : "section"
}
],
"target" : [
{
"context" : "obs2",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "final"
}
]
}
]
},
{
"name" : "code",
"source" : [
{
"context" : "section",
"element" : "code",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "obs2",
"contextType" : "variable",
"element" : "code",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "status",
"source" : [
{
"context" : "observation",
"element" : "statusCode",
"variable" : "s"
}
],
"rule" : [
{
"name" : "codeS",
"source" : [
{
"context" : "s",
"element" : "code",
"variable" : "cos"
}
],
"target" : [
{
"context" : "obs2",
"contextType" : "variable",
"element" : "status",
"transform" : "translate",
"parameter" : [
{
"valueId" : "cos"
},
{
"valueString" : "#OBSstatus"
},
{
"valueString" : "code"
}
]
}
]
}
]
},
{
"name" : "subSection",
"source" : [
{
"context" : "section",
"element" : "component",
"variable" : "component"
}
],
"rule" : [
{
"name" : "section",
"source" : [
{
"context" : "component",
"element" : "section",
"variable" : "section"
}
],
"rule" : [
{
"name" : "sectionCode",
"source" : [
{
"context" : "section",
"element" : "code",
"condition" : "code = '10160-0'"
}
],
"rule" : [
{
"name" : "entry",
"source" : [
{
"context" : "section",
"element" : "entry",
"variable" : "entry"
}
],
"rule" : [
{
"name" : "creat",
"source" : [
{
"context" : "entry",
"element" : "substanceAdministration",
"variable" : "subAdmin"
}
],
"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" : "POST"
}
]
},
{
"context" : "e11",
"contextType" : "variable",
"element" : "resource",
"variable" : "medicationstatement",
"transform" : "create",
"parameter" : [
{
"valueString" : "MedicationStatement"
}
]
},
{
"context" : "medicationstatement",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid11",
"transform" : "uuid"
},
{
"context" : "e11",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "https://example/MedicationStatement/"
},
{
"valueId" : "uuid11"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "url",
"transform" : "copy",
"parameter" : [
{
"valueString" : "MedicationStatement"
}
]
},
{
"context" : "obs2",
"contextType" : "variable",
"element" : "partOf",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/MedicationStatement/' + %medicationstatement.id"
}
]
}
],
"dependent" : [
{
"name" : "MedicationStatement",
"variable" : [
"subAdmin",
"medicationstatement",
"patient",
"encounter",
"bundle"
]
}
]
}
]
}
]
},
{
"name" : "conditionAllergie",
"source" : [
{
"context" : "section",
"element" : "code",
"condition" : "code = '48765-2'"
}
],
"rule" : [
{
"name" : "section",
"source" : [
{
"context" : "section"
}
],
"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" : "list1",
"transform" : "create",
"parameter" : [
{
"valueString" : "List"
}
]
},
{
"context" : "list1",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid4",
"transform" : "uuid"
},
{
"context" : "e4",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "https://example/List/"
},
{
"valueId" : "uuid4"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "url",
"transform" : "copy",
"parameter" : [
{
"valueString" : "List"
}
]
},
{
"context" : "obs2",
"contextType" : "variable",
"element" : "focus",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/List/' + %list1.id"
}
]
}
],
"rule" : [
{
"name" : "reference",
"source" : [
{
"context" : "section"
}
],
"target" : [
{
"context" : "list1",
"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" : "listatus",
"source" : [
{
"context" : "section"
}
],
"target" : [
{
"context" : "list1",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "current"
}
]
}
]
},
{
"name" : "lstmod",
"source" : [
{
"context" : "section"
}
],
"target" : [
{
"context" : "list1",
"contextType" : "variable",
"element" : "mode",
"transform" : "copy",
"parameter" : [
{
"valueString" : "working"
}
]
}
]
},
{
"name" : "reference",
"source" : [
{
"context" : "section"
}
],
"target" : [
{
"context" : "list1",
"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" : "entryList",
"source" : [
{
"context" : "section"
}
],
"target" : [
{
"context" : "list1",
"contextType" : "variable",
"element" : "entry",
"variable" : "entryList1"
}
],
"rule" : [
{
"name" : "entryAll",
"source" : [
{
"context" : "section",
"element" : "entry",
"variable" : "entry"
}
],
"rule" : [
{
"name" : "allergy",
"source" : [
{
"context" : "entry",
"element" : "act",
"variable" : "act1"
}
],
"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" : "POST"
}
]
},
{
"context" : "e5",
"contextType" : "variable",
"element" : "resource",
"variable" : "allergy",
"transform" : "create",
"parameter" : [
{
"valueString" : "AllergyIntolerance"
}
]
},
{
"context" : "allergy",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid5",
"transform" : "uuid"
},
{
"context" : "e5",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "https://example/AllergyIntolerance/"
},
{
"valueId" : "uuid5"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "url",
"transform" : "copy",
"parameter" : [
{
"valueString" : "AllergyIntolerance"
}
]
},
{
"context" : "entryList1",
"contextType" : "variable",
"element" : "item",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/AllergyIntolerance/' + %allergy.id"
}
]
}
],
"dependent" : [
{
"name" : "allergyFunction",
"variable" : [
"act1",
"allergy",
"patient",
"encounter"
]
}
]
}
]
}
]
}
]
}
]
}
]
}
]
},
{
"name" : "entry",
"source" : [
{
"context" : "section",
"element" : "entry",
"variable" : "entry"
}
],
"rule" : [
{
"name" : "condition",
"source" : [
{
"context" : "entry",
"element" : "observation"
}
],
"target" : [
{
"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" : "condition",
"transform" : "create",
"parameter" : [
{
"valueString" : "Condition"
}
]
},
{
"context" : "condition",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid3",
"transform" : "uuid"
},
{
"context" : "e3",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "https://example/Condition/"
},
{
"valueId" : "uuid3"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "url",
"transform" : "copy",
"parameter" : [
{
"valueString" : "Condition"
}
]
},
{
"context" : "obs2",
"contextType" : "variable",
"element" : "focus",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Condition/' + %condition.id"
}
]
}
],
"dependent" : [
{
"name" : "ConditionFunction",
"variable" : [
"observation",
"condition",
"patient",
"encounter",
"bundle"
]
}
]
},
{
"name" : "organizer",
"source" : [
{
"context" : "entry",
"element" : "organizer",
"variable" : "organizer"
}
],
"rule" : [
{
"name" : "List",
"source" : [
{
"context" : "section"
}
],
"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" : "POST"
}
]
},
{
"context" : "e11",
"contextType" : "variable",
"element" : "resource",
"variable" : "list11",
"transform" : "create",
"parameter" : [
{
"valueString" : "List"
}
]
},
{
"context" : "list11",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid11",
"transform" : "uuid"
},
{
"context" : "e11",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "https://example/List/"
},
{
"valueId" : "uuid11"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "url",
"transform" : "copy",
"parameter" : [
{
"valueString" : "List"
}
]
},
{
"context" : "obs2",
"contextType" : "variable",
"element" : "focus",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/List/' + %list11.id"
}
]
}
],
"rule" : [
{
"name" : "reference",
"source" : [
{
"context" : "section"
}
],
"target" : [
{
"context" : "list11",
"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" : "liststat",
"source" : [
{
"context" : "section"
}
],
"target" : [
{
"context" : "list11",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "current"
}
]
}
]
},
{
"name" : "listmd",
"source" : [
{
"context" : "section"
}
],
"target" : [
{
"context" : "list11",
"contextType" : "variable",
"element" : "mode",
"transform" : "copy",
"parameter" : [
{
"valueString" : "working"
}
]
}
]
},
{
"name" : "reference",
"source" : [
{
"context" : "section"
}
],
"target" : [
{
"context" : "list11",
"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" : "org",
"source" : [
{
"context" : "organizer"
}
],
"target" : [
{
"context" : "list11",
"contextType" : "variable",
"element" : "entry",
"variable" : "entryList2"
}
],
"rule" : [
{
"name" : "family",
"source" : [
{
"context" : "organizer"
}
],
"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" : "familyMember",
"transform" : "create",
"parameter" : [
{
"valueString" : "FamilyMemberHistory"
}
]
},
{
"context" : "familyMember",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid12",
"transform" : "uuid"
},
{
"context" : "e12",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "https://example/FamilyMemberHistory/"
},
{
"valueId" : "uuid12"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "url",
"transform" : "copy",
"parameter" : [
{
"valueString" : "FamilyMemberHistory"
}
]
},
{
"context" : "entryList2",
"contextType" : "variable",
"element" : "item",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/FamilyMemberHistory/' + %familyMember.id"
}
]
}
],
"dependent" : [
{
"name" : "FamilyMemberFunction",
"variable" : [
"organizer",
"familyMember",
"patient"
]
}
]
}
]
}
]
}
]
}
]
}
]
},
{
"name" : "PrecedentiEsamiEseguiti",
"source" : [
{
"context" : "section",
"condition" : "code.code = '30954-2'"
}
],
"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" : "obs4",
"transform" : "create",
"parameter" : [
{
"valueString" : "Observation"
}
]
},
{
"context" : "obs4",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid4",
"transform" : "uuid"
},
{
"context" : "e4",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "https://example/Observation/"
},
{
"valueId" : "uuid4"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "url",
"transform" : "copy",
"parameter" : [
{
"valueString" : "Observation"
}
]
},
{
"context" : "dReport",
"contextType" : "variable",
"element" : "result",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Observation/' + %obs4.id"
}
]
}
],
"dependent" : [
{
"name" : "Observation",
"variable" : [
"observation",
"patient",
"encounter",
"obs4",
"bundle"
]
}
]
},
{
"name" : "Diagnosi",
"source" : [
{
"context" : "section",
"condition" : "code.code = '29548-5'"
}
],
"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" : "POST"
}
]
},
{
"context" : "e5",
"contextType" : "variable",
"element" : "resource",
"variable" : "obs5",
"transform" : "create",
"parameter" : [
{
"valueString" : "Observation"
}
]
},
{
"context" : "obs5",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid5",
"transform" : "uuid"
},
{
"context" : "e5",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "https://example/Observation/"
},
{
"valueId" : "uuid5"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "url",
"transform" : "copy",
"parameter" : [
{
"valueString" : "Observation"
}
]
},
{
"context" : "dReport",
"contextType" : "variable",
"element" : "result",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Observation/' + %obs5.id"
}
]
}
],
"dependent" : [
{
"name" : "Observation",
"variable" : [
"observation",
"patient",
"encounter",
"obs5",
"bundle"
]
}
]
}
]
},
{
"name" : "entryAct",
"source" : [
{
"context" : "src",
"element" : "act",
"variable" : "act"
}
],
"rule" : [
{
"name" : "Prestazioni",
"source" : [
{
"context" : "section",
"condition" : "code.code = '62387-6'"
}
],
"target" : [
{
"context" : "dReport",
"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"
}
]
}
],
"rule" : [
{
"name" : "type",
"source" : [
{
"context" : "act",
"element" : "code",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "encounter",
"contextType" : "variable",
"element" : "type",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "period",
"source" : [
{
"context" : "act",
"element" : "effectiveTime",
"variable" : "effectiveTime"
}
],
"target" : [
{
"context" : "encounter",
"contextType" : "variable",
"element" : "period",
"variable" : "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" : "proceduraMadre",
"source" : [
{
"context" : "act"
}
],
"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" : "procedureRes",
"transform" : "create",
"parameter" : [
{
"valueString" : "Procedure"
}
]
},
{
"context" : "procedureRes",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid10",
"transform" : "uuid"
},
{
"context" : "e10",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "https://example/Procedure/"
},
{
"valueId" : "uuid10"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "url",
"transform" : "copy",
"parameter" : [
{
"valueString" : "Procedure"
}
]
},
{
"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/Procedure/' + %procedureRes.id"
}
]
}
],
"rule" : [
{
"name" : "reference",
"source" : [
{
"context" : "act"
}
],
"target" : [
{
"context" : "procedureRes",
"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" : "procedureRes",
"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" : "status1",
"source" : [
{
"context" : "act",
"element" : "statusCode",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "procedureRes",
"contextType" : "variable",
"element" : "status",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "status2",
"source" : [
{
"context" : "act",
"condition" : "statusCode.exists().not()"
}
],
"target" : [
{
"context" : "procedureRes",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "unknown"
}
]
}
]
},
{
"name" : "Relationship",
"source" : [
{
"context" : "act",
"element" : "entryRelationship",
"variable" : "entryRel"
}
],
"rule" : [
{
"name" : "procedurePrestazioni",
"source" : [
{
"context" : "entryRel",
"element" : "procedure",
"variable" : "proc"
}
],
"target" : [
{
"context" : "bundle",
"contextType" : "variable",
"element" : "entry",
"variable" : "e9"
},
{
"context" : "e9",
"contextType" : "variable",
"element" : "request",
"variable" : "request",
"transform" : "create",
"parameter" : [
{
"valueString" : "BackboneElement"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "method",
"transform" : "copy",
"parameter" : [
{
"valueString" : "POST"
}
]
},
{
"context" : "e9",
"contextType" : "variable",
"element" : "resource",
"variable" : "procedure2",
"transform" : "create",
"parameter" : [
{
"valueString" : "Procedure"
}
]
},
{
"context" : "procedure2",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid9",
"transform" : "uuid"
},
{
"context" : "e9",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "https://example/Procedure/"
},
{
"valueId" : "uuid9"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "url",
"transform" : "copy",
"parameter" : [
{
"valueString" : "Procedure"
}
]
},
{
"context" : "procedureRes",
"contextType" : "variable",
"element" : "partOf",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Procedure/' + %procedure2.id"
}
]
}
],
"dependent" : [
{
"name" : "Procedure",
"variable" : [
"proc",
"patient",
"encounter",
"procedure2",
"bundle"
]
}
]
},
{
"name" : "farmacPrestazioni",
"source" : [
{
"context" : "entryRel",
"element" : "substanceAdministration",
"variable" : "subAdmin"
}
],
"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" : "medAdmin",
"transform" : "create",
"parameter" : [
{
"valueString" : "MedicationAdministration"
}
]
},
{
"context" : "medAdmin",
"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" : "procedureRes",
"contextType" : "variable",
"element" : "partOf",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/MedicationAdministration/' + %medAdmin.id"
}
]
}
],
"dependent" : [
{
"name" : "MedicationAdministration",
"variable" : [
"subAdmin",
"patient",
"encounter",
"medAdmin",
"bundle"
]
}
]
},
{
"name" : "osservazioniPrestazioni",
"source" : [
{
"context" : "entryRel",
"element" : "observation",
"variable" : "entryRobs"
}
],
"target" : [
{
"context" : "bundle",
"contextType" : "variable",
"element" : "entry",
"variable" : "e7"
},
{
"context" : "e7",
"contextType" : "variable",
"element" : "request",
"variable" : "request",
"transform" : "create",
"parameter" : [
{
"valueString" : "BackboneElement"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "method",
"transform" : "copy",
"parameter" : [
{
"valueString" : "POST"
}
]
},
{
"context" : "e7",
"contextType" : "variable",
"element" : "resource",
"variable" : "obs7",
"transform" : "create",
"parameter" : [
{
"valueString" : "Observation"
}
]
},
{
"context" : "obs7",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid7",
"transform" : "uuid"
},
{
"context" : "e7",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "https://example/Observation/"
},
{
"valueId" : "uuid7"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "url",
"transform" : "copy",
"parameter" : [
{
"valueString" : "Observation"
}
]
},
{
"context" : "procedureRes",
"contextType" : "variable",
"element" : "partOf",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Observation/' + %obs7.id"
}
]
}
],
"dependent" : [
{
"name" : "ObservationPrest",
"variable" : [
"entryRobs",
"patient",
"encounter",
"obs7",
"bundle"
]
}
]
},
{
"name" : "procedureGenerichePrestazioni",
"source" : [
{
"context" : "entryRel",
"element" : "act",
"variable" : "act2"
}
],
"target" : [
{
"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" : "procedure3",
"transform" : "create",
"parameter" : [
{
"valueString" : "Procedure"
}
]
},
{
"context" : "procedure3",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid6",
"transform" : "uuid"
},
{
"context" : "e6",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "https://example/Procedure/"
},
{
"valueId" : "uuid6"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "url",
"transform" : "copy",
"parameter" : [
{
"valueString" : "Procedure"
}
]
},
{
"context" : "procedureRes",
"contextType" : "variable",
"element" : "partOf",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Procedure/' + %procedure3.id"
}
]
}
],
"dependent" : [
{
"name" : "Procedure",
"variable" : [
"act2",
"patient",
"encounter",
"procedure3",
"bundle"
]
}
]
}
]
}
]
}
]
},
{
"name" : "Followup",
"source" : [
{
"context" : "section",
"condition" : "code.code = '80615-8'"
}
],
"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" : "obs12",
"transform" : "create",
"parameter" : [
{
"valueString" : "Observation"
}
]
},
{
"context" : "obs12",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid12",
"transform" : "uuid"
},
{
"context" : "e12",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "https://example/Observation/"
},
{
"valueId" : "uuid12"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "url",
"transform" : "copy",
"parameter" : [
{
"valueString" : "Observation"
}
]
},
{
"context" : "dReport",
"contextType" : "variable",
"element" : "result",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Observation/' + %obs12.id"
}
]
}
],
"dependent" : [
{
"name" : "Observation",
"variable" : [
"act",
"patient",
"encounter",
"obs12",
"bundle"
]
}
]
}
]
},
{
"name" : "substanceadmin",
"source" : [
{
"context" : "src",
"element" : "substanceAdministration",
"variable" : "substanceadmin"
}
],
"rule" : [
{
"name" : "TerapiaFarmacologicaConsigliata",
"source" : [
{
"context" : "section",
"condition" : "code.code = '93341-6'"
}
],
"target" : [
{
"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" : "medre1",
"transform" : "create",
"parameter" : [
{
"valueString" : "MedicationRequest"
}
]
},
{
"context" : "medre1",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid6",
"transform" : "uuid"
},
{
"context" : "e6",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "https://example/MedicationRequest/"
},
{
"valueId" : "uuid6"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "url",
"transform" : "copy",
"parameter" : [
{
"valueString" : "MedicationRequest"
}
]
},
{
"context" : "dReport",
"contextType" : "variable",
"element" : "basedOn",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/MedicationRequest/' + %medre1.id"
}
]
}
],
"dependent" : [
{
"name" : "MedicationRequest",
"variable" : [
"substanceadmin",
"patient",
"encounter",
"medre1",
"bundle"
]
}
]
}
],
"documentation" : "src.substanceAdministration"
},
{
"name" : "whereCond",
"source" : [
{
"context" : "section",
"condition" : "section.entry.exists().not()"
}
],
"rule" : [
{
"name" : "allergyAct",
"source" : [
{
"context" : "section",
"condition" : "(code.code = '48765-2')"
}
],
"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" : "obs1",
"transform" : "create",
"parameter" : [
{
"valueString" : "Observation"
}
]
},
{
"context" : "obs1",
"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" : "dReport",
"contextType" : "variable",
"element" : "result",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Observation/' + %obs1.id"
}
]
}
],
"rule" : [
{
"name" : "reference",
"source" : [
{
"context" : "section"
}
],
"target" : [
{
"context" : "obs1",
"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" : "section"
}
],
"target" : [
{
"context" : "obs1",
"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" : "STatusobse",
"source" : [
{
"context" : "section"
}
],
"target" : [
{
"context" : "obs1",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "final"
}
]
}
]
},
{
"name" : "code",
"source" : [
{
"context" : "section",
"element" : "code",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "obs1",
"contextType" : "variable",
"element" : "code",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "status",
"source" : [
{
"context" : "section",
"element" : "statusCode",
"variable" : "s"
}
],
"rule" : [
{
"name" : "codeS",
"source" : [
{
"context" : "s",
"element" : "code",
"variable" : "cos"
}
],
"target" : [
{
"context" : "obs1",
"contextType" : "variable",
"element" : "status",
"transform" : "translate",
"parameter" : [
{
"valueId" : "cos"
},
{
"valueString" : "#OBSstatus"
},
{
"valueString" : "code"
}
]
}
]
}
]
},
{
"name" : "allergytext",
"source" : [
{
"context" : "section",
"element" : "text",
"variable" : "text"
}
],
"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" : "POST"
}
]
},
{
"context" : "e5",
"contextType" : "variable",
"element" : "resource",
"variable" : "allergy",
"transform" : "create",
"parameter" : [
{
"valueString" : "AllergyIntolerance"
}
]
},
{
"context" : "allergy",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid5",
"transform" : "uuid"
},
{
"context" : "e5",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "https://example/AllergyIntolerance/"
},
{
"valueId" : "uuid5"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "url",
"transform" : "copy",
"parameter" : [
{
"valueString" : "AllergyIntolerance"
}
]
},
{
"context" : "obs1",
"contextType" : "variable",
"element" : "focus",
"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" : "section"
}
],
"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" : "section"
}
],
"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/' + %encounter.id"
}
]
}
]
},
{
"name" : "status",
"source" : [
{
"context" : "section"
}
],
"target" : [
{
"context" : "allergy",
"contextType" : "variable",
"element" : "clinicalStatus",
"variable" : "clinicalStatus"
}
],
"rule" : [
{
"name" : "coding",
"source" : [
{
"context" : "section"
}
],
"target" : [
{
"context" : "clinicalStatus",
"contextType" : "variable",
"element" : "coding",
"variable" : "coding",
"transform" : "create",
"parameter" : [
{
"valueString" : "Coding"
}
]
}
],
"rule" : [
{
"name" : "code",
"source" : [
{
"context" : "section"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "code",
"transform" : "copy",
"parameter" : [
{
"valueString" : "active"
}
]
}
]
},
{
"name" : "system",
"source" : [
{
"context" : "section"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "system",
"transform" : "copy",
"parameter" : [
{
"valueString" : "http://terminology.hl7.org/CodeSystem/allergyintolerance-clinical"
}
]
}
]
}
]
}
]
},
{
"name" : "narrative",
"source" : [
{
"context" : "text"
}
],
"target" : [
{
"context" : "allergy",
"contextType" : "variable",
"element" : "note",
"variable" : "note"
}
],
"rule" : [
{
"name" : "note",
"source" : [
{
"context" : "text",
"variable" : "t"
}
],
"target" : [
{
"context" : "note",
"contextType" : "variable",
"element" : "text",
"variable" : "textNote",
"transform" : "create",
"parameter" : [
{
"valueString" : "string"
}
]
}
],
"dependent" : [
{
"name" : "EDstring",
"variable" : [
"t",
"textNote"
]
}
]
}
]
}
]
}
]
},
{
"name" : "MedicationRequest",
"source" : [
{
"context" : "section",
"condition" : "(code.code = '93341-6')"
}
],
"rule" : [
{
"name" : "txtsec",
"source" : [
{
"context" : "section",
"element" : "text",
"variable" : "text"
}
],
"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" : "POST"
}
]
},
{
"context" : "e13",
"contextType" : "variable",
"element" : "resource",
"variable" : "obs13",
"transform" : "create",
"parameter" : [
{
"valueString" : "MedicationRequest"
}
]
},
{
"context" : "obs13",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid13",
"transform" : "uuid"
},
{
"context" : "e13",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "https://example/MedicationRequest/"
},
{
"valueId" : "uuid13"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "url",
"transform" : "copy",
"parameter" : [
{
"valueString" : "MedicationRequest"
}
]
},
{
"context" : "dReport",
"contextType" : "variable",
"element" : "basedOn",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/MedicationRequest/' + %obs13.id"
}
]
}
],
"rule" : [
{
"name" : "reference",
"source" : [
{
"context" : "section"
}
],
"target" : [
{
"context" : "obs13",
"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" : "section"
}
],
"target" : [
{
"context" : "obs13",
"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" : "intent",
"source" : [
{
"context" : "section"
}
],
"target" : [
{
"context" : "obs13",
"contextType" : "variable",
"element" : "intent",
"transform" : "copy",
"parameter" : [
{
"valueString" : "order"
}
]
}
]
},
{
"name" : "st",
"source" : [
{
"context" : "section",
"condition" : "statusCode.exists().not()"
}
],
"target" : [
{
"context" : "obs13",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "unknown"
}
]
}
]
},
{
"name" : "note",
"source" : [
{
"context" : "text"
}
],
"target" : [
{
"context" : "obs13",
"contextType" : "variable",
"element" : "note",
"variable" : "note"
}
],
"rule" : [
{
"name" : "note",
"source" : [
{
"context" : "text",
"variable" : "t"
}
],
"target" : [
{
"context" : "note",
"contextType" : "variable",
"element" : "text",
"variable" : "textNote",
"transform" : "create",
"parameter" : [
{
"valueString" : "string"
}
]
}
],
"dependent" : [
{
"name" : "EDstring",
"variable" : [
"t",
"textNote"
]
}
]
}
]
},
{
"name" : "code",
"source" : [
{
"context" : "section"
}
],
"target" : [
{
"context" : "obs13",
"contextType" : "variable",
"element" : "medication",
"variable" : "code",
"transform" : "create",
"parameter" : [
{
"valueString" : "CodeableConcept"
}
]
}
],
"rule" : [
{
"name" : "string",
"source" : [
{
"context" : "section"
}
],
"target" : [
{
"context" : "code",
"contextType" : "variable",
"element" : "text",
"transform" : "copy",
"parameter" : [
{
"valueString" : "string"
}
]
}
]
}
]
}
]
}
]
},
{
"name" : "NonConclusion",
"source" : [
{
"context" : "section",
"condition" : "(code.code = '55110-1').not() and (code.code = '93341-6').not() and (code.code = '48765-2').not()"
}
],
"rule" : [
{
"name" : "txtsec",
"source" : [
{
"context" : "section",
"element" : "text",
"variable" : "text"
}
],
"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" : "POST"
}
]
},
{
"context" : "e13",
"contextType" : "variable",
"element" : "resource",
"variable" : "obs13",
"transform" : "create",
"parameter" : [
{
"valueString" : "Observation"
}
]
},
{
"context" : "obs13",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid13",
"transform" : "uuid"
},
{
"context" : "e13",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "https://example/Observation/"
},
{
"valueId" : "uuid13"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "url",
"transform" : "copy",
"parameter" : [
{
"valueString" : "Observation"
}
]
},
{
"context" : "dReport",
"contextType" : "variable",
"element" : "result",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Observation/' + %obs13.id"
}
]
}
],
"rule" : [
{
"name" : "reference",
"source" : [
{
"context" : "section"
}
],
"target" : [
{
"context" : "obs13",
"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" : "section"
}
],
"target" : [
{
"context" : "obs13",
"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" : "obsst",
"source" : [
{
"context" : "section"
}
],
"target" : [
{
"context" : "obs13",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "preliminary"
}
]
}
]
},
{
"name" : "obscde",
"source" : [
{
"context" : "section",
"element" : "code",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "obs13",
"contextType" : "variable",
"element" : "code",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "statusS",
"source" : [
{
"context" : "section"
}
],
"target" : [
{
"context" : "obs13",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "final"
}
]
}
]
},
{
"name" : "narrative",
"source" : [
{
"context" : "text"
}
],
"target" : [
{
"context" : "obs13",
"contextType" : "variable",
"element" : "note",
"variable" : "note"
}
],
"rule" : [
{
"name" : "note",
"source" : [
{
"context" : "text",
"variable" : "t"
}
],
"target" : [
{
"context" : "note",
"contextType" : "variable",
"element" : "text",
"variable" : "textNote",
"transform" : "create",
"parameter" : [
{
"valueString" : "string"
}
]
}
],
"dependent" : [
{
"name" : "EDstring",
"variable" : [
"t",
"textNote"
]
}
]
}
]
}
]
}
]
},
{
"name" : "conclusion",
"source" : [
{
"context" : "section",
"condition" : "(code.code = '55110-1')"
}
],
"rule" : [
{
"name" : "conc",
"source" : [
{
"context" : "section",
"element" : "text",
"variable" : "t"
}
],
"target" : [
{
"context" : "dReport",
"contextType" : "variable",
"element" : "conclusion",
"variable" : "textConclusion",
"transform" : "create",
"parameter" : [
{
"valueString" : "string"
}
]
}
],
"dependent" : [
{
"name" : "EDstring",
"variable" : [
"t",
"textConclusion"
]
}
]
}
]
}
]
}
]
},
{
"name" : "Observation",
"typeMode" : "none",
"input" : [
{
"name" : "cda",
"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" : "cda"
}
],
"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" : "cda"
}
],
"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" : "cda",
"element" : "code",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "ob",
"contextType" : "variable",
"element" : "code",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "Stats",
"source" : [
{
"context" : "cda"
}
],
"target" : [
{
"context" : "ob",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "final"
}
]
}
]
},
{
"name" : "value",
"source" : [
{
"context" : "cda",
"type" : "INT",
"element" : "value",
"variable" : "int"
}
],
"target" : [
{
"context" : "ob",
"contextType" : "variable",
"element" : "value",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "int.value"
}
]
}
],
"documentation" : "value datatype"
},
{
"name" : "value",
"source" : [
{
"context" : "cda",
"type" : "ST",
"element" : "value",
"variable" : "st"
}
],
"target" : [
{
"context" : "ob",
"contextType" : "variable",
"element" : "value",
"transform" : "create",
"parameter" : [
{
"valueString" : "string"
}
]
},
{
"context" : "ob",
"contextType" : "variable",
"element" : "value",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "st.dataString"
}
]
}
]
},
{
"name" : "boolean",
"source" : [
{
"context" : "cda",
"type" : "BL",
"element" : "value",
"variable" : "boolean"
}
],
"target" : [
{
"context" : "ob",
"contextType" : "variable",
"element" : "value",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "boolean.value"
}
]
}
]
},
{
"name" : "val",
"source" : [
{
"context" : "cda",
"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" : "originalText"
}
],
"rule" : [
{
"name" : "reference",
"source" : [
{
"context" : "originalText",
"element" : "reference",
"variable" : "reference"
}
],
"target" : [
{
"context" : "ce",
"contextType" : "variable",
"element" : "text",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "reference.value"
}
]
}
]
}
]
},
{
"name" : "code",
"source" : [
{
"context" : "val"
}
],
"target" : [
{
"context" : "ce",
"contextType" : "variable",
"element" : "coding",
"variable" : "coding"
}
],
"rule" : [
{
"name" : "code",
"source" : [
{
"context" : "val",
"element" : "code",
"variable" : "code"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "code",
"transform" : "cast",
"parameter" : [
{
"valueId" : "code"
},
{
"valueString" : "string"
}
]
}
]
},
{
"name" : "codeSystem",
"source" : [
{
"context" : "val",
"element" : "codeSystem",
"variable" : "system"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "system",
"transform" : "translate",
"parameter" : [
{
"valueId" : "system"
},
{
"valueString" : "http://hl7.org/fhir/ConceptMap/special-oid2uri"
},
{
"valueString" : "uri"
}
]
}
]
},
{
"name" : "displayName",
"source" : [
{
"context" : "val",
"element" : "displayName",
"variable" : "display"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "display",
"transform" : "cast",
"parameter" : [
{
"valueId" : "display"
},
{
"valueString" : "string"
}
]
}
]
}
]
},
{
"name" : "translation",
"source" : [
{
"context" : "val",
"element" : "translation",
"variable" : "translation"
}
],
"target" : [
{
"context" : "ce",
"contextType" : "variable",
"element" : "coding",
"variable" : "coding"
}
],
"rule" : [
{
"name" : "code",
"source" : [
{
"context" : "translation",
"element" : "code",
"variable" : "code"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "code",
"transform" : "cast",
"parameter" : [
{
"valueId" : "code"
},
{
"valueString" : "string"
}
]
}
]
},
{
"name" : "codeSystem",
"source" : [
{
"context" : "translation",
"element" : "codeSystem",
"variable" : "system"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "system",
"transform" : "translate",
"parameter" : [
{
"valueId" : "system"
},
{
"valueString" : "http://hl7.org/fhir/ConceptMap/special-oid2uri"
},
{
"valueString" : "uri"
}
]
}
]
},
{
"name" : "displayName",
"source" : [
{
"context" : "translation",
"element" : "displayName",
"variable" : "display"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "display",
"transform" : "cast",
"parameter" : [
{
"valueId" : "display"
},
{
"valueString" : "string"
}
]
}
]
},
{
"name" : "qualifier",
"source" : [
{
"context" : "translation",
"element" : "qualifier",
"variable" : "qualifier"
}
],
"rule" : [
{
"name" : "value",
"source" : [
{
"context" : "qualifier",
"element" : "value",
"variable" : "value"
}
],
"target" : [
{
"context" : "ce",
"contextType" : "variable",
"element" : "coding",
"variable" : "coding"
}
],
"rule" : [
{
"name" : "code",
"source" : [
{
"context" : "value",
"element" : "code",
"variable" : "code"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "code",
"transform" : "cast",
"parameter" : [
{
"valueId" : "code"
},
{
"valueString" : "string"
}
]
}
]
},
{
"name" : "codeSystem",
"source" : [
{
"context" : "value",
"element" : "codeSystem",
"variable" : "system"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "system",
"transform" : "translate",
"parameter" : [
{
"valueId" : "system"
},
{
"valueString" : "http://hl7.org/fhir/ConceptMap/special-oid2uri"
},
{
"valueString" : "uri"
}
]
}
]
},
{
"name" : "displayName",
"source" : [
{
"context" : "value",
"element" : "displayName",
"variable" : "display"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "display",
"transform" : "cast",
"parameter" : [
{
"valueId" : "display"
},
{
"valueString" : "string"
}
]
}
]
}
]
}
]
}
]
}
]
}
]
},
{
"name" : "val",
"source" : [
{
"context" : "cda",
"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" : "originalText"
}
],
"rule" : [
{
"name" : "reference",
"source" : [
{
"context" : "originalText",
"element" : "reference",
"variable" : "reference"
}
],
"target" : [
{
"context" : "ce",
"contextType" : "variable",
"element" : "text",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "reference.value"
}
]
}
]
}
]
},
{
"name" : "code",
"source" : [
{
"context" : "val"
}
],
"target" : [
{
"context" : "ce",
"contextType" : "variable",
"element" : "coding",
"variable" : "coding"
}
],
"rule" : [
{
"name" : "code",
"source" : [
{
"context" : "val",
"element" : "code",
"variable" : "code"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "code",
"transform" : "cast",
"parameter" : [
{
"valueId" : "code"
},
{
"valueString" : "string"
}
]
}
]
},
{
"name" : "codeSystem",
"source" : [
{
"context" : "val",
"element" : "codeSystem",
"variable" : "system"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "system",
"transform" : "translate",
"parameter" : [
{
"valueId" : "system"
},
{
"valueString" : "http://hl7.org/fhir/ConceptMap/special-oid2uri"
},
{
"valueString" : "uri"
}
]
}
]
},
{
"name" : "displayName",
"source" : [
{
"context" : "val",
"element" : "displayName",
"variable" : "display"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "display",
"transform" : "cast",
"parameter" : [
{
"valueId" : "display"
},
{
"valueString" : "string"
}
]
}
]
}
]
},
{
"name" : "translation",
"source" : [
{
"context" : "val",
"element" : "translation",
"variable" : "translation"
}
],
"target" : [
{
"context" : "ce",
"contextType" : "variable",
"element" : "coding",
"variable" : "coding"
}
],
"rule" : [
{
"name" : "code",
"source" : [
{
"context" : "translation",
"element" : "code",
"variable" : "code"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "code",
"transform" : "cast",
"parameter" : [
{
"valueId" : "code"
},
{
"valueString" : "string"
}
]
}
]
},
{
"name" : "codeSystem",
"source" : [
{
"context" : "translation",
"element" : "codeSystem",
"variable" : "system"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "system",
"transform" : "translate",
"parameter" : [
{
"valueId" : "system"
},
{
"valueString" : "http://hl7.org/fhir/ConceptMap/special-oid2uri"
},
{
"valueString" : "uri"
}
]
}
]
},
{
"name" : "displayName",
"source" : [
{
"context" : "translation",
"element" : "displayName",
"variable" : "display"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "display",
"transform" : "cast",
"parameter" : [
{
"valueId" : "display"
},
{
"valueString" : "string"
}
]
}
]
},
{
"name" : "qualifier",
"source" : [
{
"context" : "translation",
"element" : "qualifier",
"variable" : "qualifier"
}
],
"rule" : [
{
"name" : "value",
"source" : [
{
"context" : "qualifier",
"element" : "value",
"variable" : "value"
}
],
"target" : [
{
"context" : "ce",
"contextType" : "variable",
"element" : "coding",
"variable" : "coding"
}
],
"rule" : [
{
"name" : "code",
"source" : [
{
"context" : "value",
"element" : "code",
"variable" : "code"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "code",
"transform" : "cast",
"parameter" : [
{
"valueId" : "code"
},
{
"valueString" : "string"
}
]
}
]
},
{
"name" : "codeSystem",
"source" : [
{
"context" : "value",
"element" : "codeSystem",
"variable" : "system"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "system",
"transform" : "translate",
"parameter" : [
{
"valueId" : "system"
},
{
"valueString" : "http://hl7.org/fhir/ConceptMap/special-oid2uri"
},
{
"valueString" : "uri"
}
]
}
]
},
{
"name" : "displayName",
"source" : [
{
"context" : "value",
"element" : "displayName",
"variable" : "display"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "display",
"transform" : "cast",
"parameter" : [
{
"valueId" : "display"
},
{
"valueString" : "string"
}
]
}
]
}
]
}
]
}
]
}
]
}
]
},
{
"name" : "valueQuantity",
"source" : [
{
"context" : "cda",
"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" : "value1",
"source" : [
{
"context" : "cda",
"element" : "effectiveTime",
"variable" : "effectiveTime",
"condition" : "(value.exists())"
}
],
"target" : [
{
"context" : "ob",
"contextType" : "variable",
"element" : "effective",
"variable" : "value",
"transform" : "create",
"parameter" : [
{
"valueString" : "dateTime"
}
]
}
],
"dependent" : [
{
"name" : "TSDateTime",
"variable" : [
"effectiveTime",
"value"
]
}
]
},
{
"name" : "valuePeriod",
"source" : [
{
"context" : "cda",
"element" : "effectiveTime",
"variable" : "effectiveTime",
"condition" : "(low.exists())"
}
],
"target" : [
{
"context" : "ob",
"contextType" : "variable",
"element" : "effective",
"variable" : "value",
"transform" : "create",
"parameter" : [
{
"valueString" : "Period"
}
]
}
],
"dependent" : [
{
"name" : "IVLTSPeriod",
"variable" : [
"effectiveTime",
"value"
]
}
]
},
{
"name" : "note",
"source" : [
{
"context" : "cda",
"element" : "text",
"variable" : "text"
}
],
"target" : [
{
"context" : "ob",
"contextType" : "variable",
"element" : "note",
"variable" : "note"
}
],
"rule" : [
{
"name" : "text",
"source" : [
{
"context" : "text",
"element" : "reference",
"variable" : "reference"
}
],
"target" : [
{
"context" : "note",
"contextType" : "variable",
"element" : "text",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "reference.value"
}
]
}
]
}
]
},
{
"name" : "status",
"source" : [
{
"context" : "cda",
"element" : "statusCode",
"variable" : "s"
}
],
"rule" : [
{
"name" : "codeS",
"source" : [
{
"context" : "s",
"element" : "code",
"variable" : "cos"
}
],
"target" : [
{
"context" : "ob",
"contextType" : "variable",
"element" : "status",
"transform" : "translate",
"parameter" : [
{
"valueId" : "cos"
},
{
"valueString" : "#OBSstatus"
},
{
"valueString" : "code"
}
]
}
]
}
]
}
]
},
{
"name" : "ConditionFunction",
"typeMode" : "none",
"input" : [
{
"name" : "src",
"type" : "cdaElement",
"mode" : "source"
},
{
"name" : "tgt",
"type" : "Condition",
"mode" : "target"
},
{
"name" : "patient",
"type" : "patient",
"mode" : "target"
},
{
"name" : "encounter",
"type" : "encounter",
"mode" : "target"
},
{
"name" : "bundle",
"type" : "Bundle",
"mode" : "target"
}
],
"rule" : [
{
"name" : "code",
"source" : [
{
"context" : "src",
"element" : "code",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "category",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "reference",
"source" : [
{
"context" : "src"
}
],
"target" : [
{
"context" : "tgt",
"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" : "tgt",
"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" : "verifstatus",
"source" : [
{
"context" : "src",
"element" : "statusCode",
"variable" : "stscode"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "verificationStatus",
"variable" : "verifstatus"
}
],
"rule" : [
{
"name" : "coding",
"source" : [
{
"context" : "stscode",
"variable" : "codeS"
}
],
"target" : [
{
"context" : "verifstatus",
"contextType" : "variable",
"element" : "coding",
"variable" : "coding",
"transform" : "create",
"parameter" : [
{
"valueString" : "Coding"
}
]
}
],
"rule" : [
{
"name" : "code",
"source" : [
{
"context" : "codeS",
"element" : "code"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "code",
"transform" : "copy",
"parameter" : [
{
"valueString" : "confirmed"
}
]
}
]
},
{
"name" : "system",
"source" : [
{
"context" : "codeS"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "system",
"transform" : "copy",
"parameter" : [
{
"valueString" : "http://terminology.hl7.org/CodeSystem/condition-ver-status"
}
]
}
]
},
{
"name" : "display",
"source" : [
{
"context" : "codeS"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "display",
"transform" : "cast",
"parameter" : [
{
"valueString" : "Confirmed"
},
{
"valueString" : "string"
}
]
}
]
}
]
}
]
},
{
"name" : "valuePeriod",
"source" : [
{
"context" : "src",
"element" : "effectiveTime",
"variable" : "effectiveTime"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "onset",
"variable" : "value",
"transform" : "create",
"parameter" : [
{
"valueString" : "Period"
}
]
}
],
"dependent" : [
{
"name" : "IVLTSPeriod",
"variable" : [
"effectiveTime",
"value"
]
}
]
},
{
"name" : "value",
"source" : [
{
"context" : "src",
"element" : "value",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "code",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "entryR",
"source" : [
{
"context" : "src",
"element" : "entryRelationship",
"variable" : "entryRelationship"
}
],
"rule" : [
{
"name" : "EntryRelObsevation",
"source" : [
{
"context" : "entryRelationship",
"element" : "observation",
"variable" : "obsentry"
}
],
"rule" : [
{
"name" : "observation",
"source" : [
{
"context" : "obsentry",
"element" : "code",
"condition" : "code = '89261-2'"
}
],
"rule" : [
{
"name" : "observation",
"source" : [
{
"context" : "obsentry"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "evidence",
"variable" : "evidence"
},
{
"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" : "obsy",
"transform" : "create",
"parameter" : [
{
"valueString" : "Observation"
}
]
},
{
"context" : "obsy",
"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" : "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/' + %obsy.id"
}
]
}
],
"dependent" : [
{
"name" : "Observation",
"variable" : [
"obsentry",
"patient",
"encounter",
"obsy",
"bundle"
]
}
]
}
]
},
{
"name" : "clinicalStatus2",
"source" : [
{
"context" : "obsentry",
"element" : "code",
"condition" : "code = '33999-4'"
}
],
"rule" : [
{
"name" : "clinicalstatus",
"source" : [
{
"context" : "obsentry",
"element" : "value",
"variable" : "value"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "clinicalStatus",
"variable" : "clinicalstatus"
}
],
"rule" : [
{
"name" : "coding",
"source" : [
{
"context" : "value",
"variable" : "val"
}
],
"target" : [
{
"context" : "clinicalstatus",
"contextType" : "variable",
"element" : "coding",
"variable" : "coding",
"transform" : "create",
"parameter" : [
{
"valueString" : "Coding"
}
]
}
],
"rule" : [
{
"name" : "code",
"source" : [
{
"context" : "val",
"condition" : "(code = 'LA9041-0')"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "code",
"transform" : "copy",
"parameter" : [
{
"valueString" : "resolved"
}
]
}
]
},
{
"name" : "code",
"source" : [
{
"context" : "val",
"condition" : "(code = 'LA18632-2')"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "code",
"transform" : "copy",
"parameter" : [
{
"valueString" : "inactive"
}
]
}
]
},
{
"name" : "code",
"source" : [
{
"context" : "val",
"condition" : "(code = 'LA16666-2')"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "code",
"transform" : "copy",
"parameter" : [
{
"valueString" : "active"
}
]
}
]
},
{
"name" : "system",
"source" : [
{
"context" : "val"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "system",
"transform" : "copy",
"parameter" : [
{
"valueString" : "http://terminology.hl7.org/CodeSystem/condition-clinical"
}
]
}
]
},
{
"name" : "display",
"source" : [
{
"context" : "val",
"element" : "displayName",
"variable" : "display"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "display",
"transform" : "cast",
"parameter" : [
{
"valueId" : "display"
},
{
"valueString" : "string"
}
]
}
]
}
]
},
{
"name" : "text",
"source" : [
{
"context" : "obsentry",
"element" : "text",
"variable" : "text"
}
],
"rule" : [
{
"name" : "text",
"source" : [
{
"context" : "text",
"element" : "reference",
"variable" : "reference"
}
],
"target" : [
{
"context" : "clinicalstatus",
"contextType" : "variable",
"element" : "text",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "reference.value"
}
]
}
]
}
]
}
]
}
]
}
]
}
]
}
]
},
{
"name" : "Procedure",
"typeMode" : "none",
"input" : [
{
"name" : "src",
"type" : "procedure",
"mode" : "source"
},
{
"name" : "patient",
"type" : "Patient",
"mode" : "target"
},
{
"name" : "encounter",
"type" : "Encounter",
"mode" : "target"
},
{
"name" : "tgt",
"type" : "Procedure",
"mode" : "target"
},
{
"name" : "bundle",
"type" : "Bundle",
"mode" : "target"
}
],
"rule" : [
{
"name" : "reference",
"source" : [
{
"context" : "src"
}
],
"target" : [
{
"context" : "tgt",
"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" : "tgt",
"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" : "status1",
"source" : [
{
"context" : "src",
"element" : "statusCode",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "status",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "status2",
"source" : [
{
"context" : "src",
"condition" : "statusCode.exists().not()"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "unknown"
}
]
}
]
},
{
"name" : "id",
"source" : [
{
"context" : "src",
"element" : "id",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "identifier",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "code",
"source" : [
{
"context" : "src",
"element" : "code",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "code",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "value1",
"source" : [
{
"context" : "src",
"element" : "effectiveTime",
"variable" : "effectiveTime",
"condition" : "(value.exists())"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "performed",
"variable" : "value",
"transform" : "create",
"parameter" : [
{
"valueString" : "dateTime"
}
]
}
],
"dependent" : [
{
"name" : "TSDateTime",
"variable" : [
"effectiveTime",
"value"
]
}
]
},
{
"name" : "valuePeriod",
"source" : [
{
"context" : "src",
"element" : "effectiveTime",
"variable" : "effectiveTime",
"condition" : "(low.exists())"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "performed",
"variable" : "value",
"transform" : "create",
"parameter" : [
{
"valueString" : "Period"
}
]
}
],
"dependent" : [
{
"name" : "IVLTSPeriod",
"variable" : [
"effectiveTime",
"value"
]
}
]
},
{
"name" : "methodCode",
"source" : [
{
"context" : "src",
"element" : "methodCode",
"variable" : "methodCode"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "extension",
"variable" : "ext1"
}
],
"dependent" : [
{
"name" : "ITMethodExt",
"variable" : [
"methodCode",
"ext1"
]
}
]
},
{
"name" : "participant",
"source" : [
{
"context" : "src",
"element" : "participant",
"variable" : "participant"
}
],
"rule" : [
{
"name" : "participantRole",
"source" : [
{
"context" : "participant",
"element" : "participantRole",
"variable" : "participantRole"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "performer",
"variable" : "performer"
}
],
"rule" : [
{
"name" : "device",
"source" : [
{
"context" : "participantRole",
"element" : "playingDevice",
"variable" : "device"
}
],
"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" : "deviceRes",
"transform" : "create",
"parameter" : [
{
"valueString" : "Device"
}
]
},
{
"context" : "deviceRes",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid2",
"transform" : "uuid"
},
{
"context" : "e2",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "https://example/Device/"
},
{
"valueId" : "uuid2"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "url",
"transform" : "copy",
"parameter" : [
{
"valueString" : "Device"
}
]
},
{
"context" : "performer",
"contextType" : "variable",
"element" : "actor",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Device/' + %deviceRes.id"
}
]
}
],
"rule" : [
{
"name" : "manufacturer",
"source" : [
{
"context" : "device",
"element" : "manufacturerModelName",
"variable" : "manufacturerModelName"
}
],
"rule" : [
{
"name" : "manuf",
"source" : [
{
"context" : "manufacturerModelName",
"element" : "displayName",
"variable" : "displayName"
}
],
"target" : [
{
"context" : "deviceRes",
"contextType" : "variable",
"element" : "manufacturer",
"transform" : "cast",
"parameter" : [
{
"valueId" : "displayName"
},
{
"valueString" : "string"
}
]
}
]
}
]
},
{
"name" : "code",
"source" : [
{
"context" : "device",
"element" : "code",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "deviceRes",
"contextType" : "variable",
"element" : "type",
"variable" : "vvv",
"transform" : "create"
}
]
}
]
}
]
}
]
},
{
"name" : "entryRelProcedure",
"source" : [
{
"context" : "src",
"element" : "entryRelationship",
"variable" : "entryR"
}
],
"rule" : [
{
"name" : "Parametri",
"source" : [
{
"context" : "entryR",
"element" : "observation",
"variable" : "observation"
}
],
"target" : [
{
"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" : "obs1",
"transform" : "create",
"parameter" : [
{
"valueString" : "Observation"
}
]
},
{
"context" : "obs1",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid3",
"transform" : "uuid"
},
{
"context" : "e3",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "https://example/Observation/"
},
{
"valueId" : "uuid3"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "url",
"transform" : "copy",
"parameter" : [
{
"valueString" : "Observation"
}
]
},
{
"context" : "tgt",
"contextType" : "variable",
"element" : "partOf",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Observation/' + %obs1.id"
}
]
}
],
"dependent" : [
{
"name" : "Observation",
"variable" : [
"observation",
"patient",
"encounter",
"obs1",
"bundle"
]
}
]
},
{
"name" : "act",
"source" : [
{
"context" : "entryR",
"element" : "act",
"variable" : "act"
}
],
"rule" : [
{
"name" : "note",
"source" : [
{
"context" : "act",
"element" : "text",
"variable" : "text"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "note",
"variable" : "note"
}
],
"rule" : [
{
"name" : "text",
"source" : [
{
"context" : "text",
"element" : "reference",
"variable" : "reference"
}
],
"target" : [
{
"context" : "note",
"contextType" : "variable",
"element" : "text",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "reference.value"
}
]
}
]
}
]
}
]
}
]
}
]
},
{
"name" : "ITMethodExt",
"typeMode" : "none",
"input" : [
{
"name" : "src",
"mode" : "source"
},
{
"name" : "ext",
"mode" : "target"
}
],
"rule" : [
{
"name" : "url",
"source" : [
{
"context" : "src"
}
],
"target" : [
{
"context" : "ext",
"contextType" : "variable",
"element" : "url",
"transform" : "copy",
"parameter" : [
{
"valueString" : "http://hl7.org/fhir/StructureDefinition/procedure-method"
}
]
}
]
},
{
"name" : "value",
"source" : [
{
"context" : "src"
}
],
"target" : [
{
"context" : "ext",
"contextType" : "variable",
"element" : "value",
"variable" : "value",
"transform" : "create",
"parameter" : [
{
"valueString" : "CodeableConcept"
}
]
}
],
"dependent" : [
{
"name" : "CECodeableConcept",
"variable" : [
"src",
"value"
]
}
]
}
]
},
{
"name" : "MedicationAdministration",
"typeMode" : "none",
"input" : [
{
"name" : "src",
"type" : "substanceAdministration",
"mode" : "source"
},
{
"name" : "patient",
"type" : "Patient",
"mode" : "target"
},
{
"name" : "encounter",
"type" : "Encounter",
"mode" : "target"
},
{
"name" : "tgt",
"type" : "MedicationAdministration",
"mode" : "target"
},
{
"name" : "bundle",
"type" : "Bundle",
"mode" : "target"
}
],
"rule" : [
{
"name" : "reference",
"source" : [
{
"context" : "src"
}
],
"target" : [
{
"context" : "tgt",
"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" : "tgt",
"contextType" : "variable",
"element" : "context",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Encounter/' + %encounter.id"
}
]
}
]
},
{
"name" : "status1",
"source" : [
{
"context" : "src",
"element" : "statusCode",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "status",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "status2",
"source" : [
{
"context" : "src",
"condition" : "statusCode.exists().not()"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "unknown"
}
]
}
]
},
{
"name" : "id",
"source" : [
{
"context" : "src",
"element" : "id",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "identifier",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "value1",
"source" : [
{
"context" : "src",
"element" : "effectiveTime",
"variable" : "effectiveTime",
"condition" : "(value.exists())"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "effective",
"variable" : "value",
"transform" : "create",
"parameter" : [
{
"valueString" : "dateTime"
}
]
}
],
"dependent" : [
{
"name" : "TSDateTime",
"variable" : [
"effectiveTime",
"value"
]
}
]
},
{
"name" : "valuePeriod",
"source" : [
{
"context" : "src",
"element" : "effectiveTime",
"variable" : "effectiveTime",
"condition" : "(low.exists())"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "effective",
"variable" : "value",
"transform" : "create",
"parameter" : [
{
"valueString" : "Period"
}
]
}
],
"dependent" : [
{
"name" : "IVLTSPeriod",
"variable" : [
"effectiveTime",
"value"
]
}
]
},
{
"name" : "dosage",
"source" : [
{
"context" : "src"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "dosage",
"variable" : "dosage"
}
],
"rule" : [
{
"name" : "route",
"source" : [
{
"context" : "src",
"element" : "routeCode",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "dosage",
"contextType" : "variable",
"element" : "route",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "repQ",
"source" : [
{
"context" : "src",
"element" : "repeatNumber",
"variable" : "repeatNumber"
}
],
"target" : [
{
"context" : "dosage",
"contextType" : "variable",
"element" : "rate",
"variable" : "value",
"transform" : "create",
"parameter" : [
{
"valueString" : "SimpleQuantity"
}
]
}
],
"dependent" : [
{
"name" : "PQQuantity",
"variable" : [
"repeatNumber",
"value"
]
}
]
},
{
"name" : "site",
"source" : [
{
"context" : "src",
"element" : "approachSiteCode",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "dosage",
"contextType" : "variable",
"element" : "site",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "site",
"source" : [
{
"context" : "src",
"element" : "targetSiteCode",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "dosage",
"contextType" : "variable",
"element" : "site",
"variable" : "vvv",
"transform" : "create"
}
]
}
]
},
{
"name" : "medication",
"source" : [
{
"context" : "src",
"element" : "consumable",
"variable" : "consumable"
}
],
"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" : "tgt",
"contextType" : "variable",
"element" : "medication",
"variable" : "medref",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "medref",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Medication/' + %medication.id"
}
]
}
],
"dependent" : [
{
"name" : "Medication",
"variable" : [
"src",
"medication",
"patient",
"bundle"
]
}
]
},
{
"name" : "participant",
"source" : [
{
"context" : "src",
"element" : "participant",
"variable" : "participant"
}
],
"rule" : [
{
"name" : "participantRole",
"source" : [
{
"context" : "participant",
"element" : "participantRole",
"variable" : "participantRole"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "performer",
"variable" : "performer"
}
],
"rule" : [
{
"name" : "device",
"source" : [
{
"context" : "participantRole",
"element" : "device",
"variable" : "device"
}
],
"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" : "deviceRes",
"transform" : "create",
"parameter" : [
{
"valueString" : "Device"
}
]
},
{
"context" : "deviceRes",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid2",
"transform" : "uuid"
},
{
"context" : "e2",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "https://example/Device/"
},
{
"valueId" : "uuid2"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "url",
"transform" : "copy",
"parameter" : [
{
"valueString" : "Device"
}
]
},
{
"context" : "performer",
"contextType" : "variable",
"element" : "actor",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Device/' + %deviceRes.id"
}
]
}
],
"rule" : [
{
"name" : "manufacturer",
"source" : [
{
"context" : "device",
"element" : "ManufacturerModelName",
"variable" : "ManufacturerModelName"
}
],
"rule" : [
{
"name" : "manuf",
"source" : [
{
"context" : "ManufacturerModelName",
"element" : "code",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "deviceRes",
"contextType" : "variable",
"element" : "manufacturer",
"variable" : "vvv",
"transform" : "create"
}
]
}
]
}
]
}
]
}
]
},
{
"name" : "entryRelMedication",
"source" : [
{
"context" : "src",
"element" : "entryRelationship",
"variable" : "entryR"
}
],
"rule" : [
{
"name" : "Parametri",
"source" : [
{
"context" : "entryR",
"element" : "observation",
"variable" : "observation"
}
],
"target" : [
{
"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" : "obs1",
"transform" : "create",
"parameter" : [
{
"valueString" : "Observation"
}
]
},
{
"context" : "obs1",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid3",
"transform" : "uuid"
},
{
"context" : "e3",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "https://example/Observation/"
},
{
"valueId" : "uuid3"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "url",
"transform" : "copy",
"parameter" : [
{
"valueString" : "Observation"
}
]
},
{
"context" : "tgt",
"contextType" : "variable",
"element" : "partOf",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Observation/' + %obs1.id"
}
]
}
],
"dependent" : [
{
"name" : "Observation",
"variable" : [
"observation",
"patient",
"encounter",
"obs1",
"bundle"
]
}
]
},
{
"name" : "act",
"source" : [
{
"context" : "entryR",
"element" : "act",
"variable" : "act"
}
],
"rule" : [
{
"name" : "note",
"source" : [
{
"context" : "act",
"element" : "text",
"variable" : "text"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "note",
"variable" : "note"
}
],
"rule" : [
{
"name" : "text",
"source" : [
{
"context" : "text",
"element" : "reference",
"variable" : "reference"
}
],
"target" : [
{
"context" : "note",
"contextType" : "variable",
"element" : "text",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "reference.value"
}
]
}
]
}
]
}
]
}
]
},
{
"name" : "medRequ",
"source" : [
{
"context" : "src",
"condition" : "(src.doseQuantity.exists() or src.rateQuantity.exists())"
}
],
"target" : [
{
"context" : "bundle",
"contextType" : "variable",
"element" : "entry",
"variable" : "e1"
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "request",
"variable" : "request",
"transform" : "create",
"parameter" : [
{
"valueString" : "BackboneElement"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "method",
"transform" : "copy",
"parameter" : [
{
"valueString" : "POST"
}
]
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "resource",
"variable" : "medicationRq",
"transform" : "create",
"parameter" : [
{
"valueString" : "MedicationRequest"
}
]
},
{
"context" : "medicationRq",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid1",
"transform" : "uuid"
},
{
"context" : "e1",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "https://example/MedicationRequest/"
},
{
"valueId" : "uuid1"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "url",
"transform" : "copy",
"parameter" : [
{
"valueString" : "MedicationRequest"
}
]
},
{
"context" : "tgt",
"contextType" : "variable",
"element" : "request",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/MedicationRequest/' + %medicationRq.id"
}
]
}
],
"dependent" : [
{
"name" : "MedicationRequest",
"variable" : [
"src",
"patient",
"encounter",
"medicationRq",
"bundle"
]
}
]
},
{
"name" : "note",
"source" : [
{
"context" : "src",
"element" : "text",
"variable" : "text"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "note",
"variable" : "note"
}
],
"rule" : [
{
"name" : "text",
"source" : [
{
"context" : "text"
}
],
"target" : [
{
"context" : "note",
"contextType" : "variable",
"element" : "text"
}
]
}
]
}
]
},
{
"name" : "ObservationPrest",
"typeMode" : "none",
"input" : [
{
"name" : "src",
"type" : "observation",
"mode" : "source"
},
{
"name" : "patient",
"type" : "Patient",
"mode" : "target"
},
{
"name" : "encounter",
"type" : "Encounter",
"mode" : "target"
},
{
"name" : "tgt",
"type" : "Observation",
"mode" : "target"
},
{
"name" : "bundle",
"type" : "Bundle",
"mode" : "target"
}
],
"rule" : [
{
"name" : "reference",
"source" : [
{
"context" : "src"
}
],
"target" : [
{
"context" : "tgt",
"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" : "tgt",
"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" : "src",
"element" : "statusCode",
"variable" : "s"
}
],
"rule" : [
{
"name" : "codeS",
"source" : [
{
"context" : "s",
"element" : "code",
"variable" : "cos"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "status",
"transform" : "translate",
"parameter" : [
{
"valueId" : "cos"
},
{
"valueString" : "#OBSstatus"
},
{
"valueString" : "code"
}
]
}
]
}
]
},
{
"name" : "id",
"source" : [
{
"context" : "src",
"element" : "id",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "identifier",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "code",
"source" : [
{
"context" : "src",
"element" : "code",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "code",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "value1",
"source" : [
{
"context" : "src",
"element" : "effectiveTime",
"variable" : "effectiveTime",
"condition" : "(value.exists())"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "perfomed",
"variable" : "value",
"transform" : "create",
"parameter" : [
{
"valueString" : "dateTime"
}
]
}
],
"dependent" : [
{
"name" : "TSDateTime",
"variable" : [
"effectiveTime",
"value"
]
}
]
},
{
"name" : "valuePeriod",
"source" : [
{
"context" : "src",
"element" : "effectiveTime",
"variable" : "effectiveTime",
"condition" : "(low.exists())"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "perfomed",
"variable" : "value",
"transform" : "create",
"parameter" : [
{
"valueString" : "Period"
}
]
}
],
"dependent" : [
{
"name" : "IVLTSPeriod",
"variable" : [
"effectiveTime",
"value"
]
}
]
},
{
"name" : "methodCode",
"source" : [
{
"context" : "src",
"element" : "methodCode",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "method",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "participant",
"source" : [
{
"context" : "src",
"element" : "participant",
"variable" : "participant"
}
],
"rule" : [
{
"name" : "participantRole",
"source" : [
{
"context" : "participant",
"element" : "participantRole",
"variable" : "participantRole"
}
],
"rule" : [
{
"name" : "device",
"source" : [
{
"context" : "participantRole",
"element" : "device",
"variable" : "device"
}
],
"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" : "deviceRes",
"transform" : "create",
"parameter" : [
{
"valueString" : "Device"
}
]
},
{
"context" : "deviceRes",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid2",
"transform" : "uuid"
},
{
"context" : "e2",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "https://example/Device/"
},
{
"valueId" : "uuid2"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "url",
"transform" : "copy",
"parameter" : [
{
"valueString" : "Device"
}
]
},
{
"context" : "tgt",
"contextType" : "variable",
"element" : "device",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Device/' + %deviceRes.id"
}
]
}
],
"rule" : [
{
"name" : "manufacturer",
"source" : [
{
"context" : "device",
"element" : "ManufacturerModelName",
"variable" : "ManufacturerModelName"
}
],
"rule" : [
{
"name" : "manuf",
"source" : [
{
"context" : "ManufacturerModelName",
"element" : "code",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "deviceRes",
"contextType" : "variable",
"element" : "manufacturer",
"variable" : "vvv",
"transform" : "create"
}
]
}
]
}
]
}
]
}
]
},
{
"name" : "entryRelOsservazioni",
"source" : [
{
"context" : "src",
"element" : "entryRelationship",
"variable" : "entryR"
}
],
"rule" : [
{
"name" : "Parametri",
"source" : [
{
"context" : "entryR",
"element" : "observation",
"variable" : "observation"
}
],
"target" : [
{
"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" : "obs1",
"transform" : "create",
"parameter" : [
{
"valueString" : "Observation"
}
]
},
{
"context" : "obs1",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid3",
"transform" : "uuid"
},
{
"context" : "e3",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "https://example/Observation/"
},
{
"valueId" : "uuid3"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "url",
"transform" : "copy",
"parameter" : [
{
"valueString" : "Observation"
}
]
},
{
"context" : "tgt",
"contextType" : "variable",
"element" : "hasMember",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Observation/' + %obs1.id"
}
]
}
],
"dependent" : [
{
"name" : "Observation",
"variable" : [
"observation",
"patient",
"encounter",
"obs1",
"bundle"
]
}
]
},
{
"name" : "act",
"source" : [
{
"context" : "entryR",
"element" : "act",
"variable" : "act"
}
],
"rule" : [
{
"name" : "note",
"source" : [
{
"context" : "act",
"element" : "text",
"variable" : "text"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "note",
"variable" : "note"
}
],
"rule" : [
{
"name" : "text",
"source" : [
{
"context" : "text",
"element" : "reference",
"variable" : "reference"
}
],
"target" : [
{
"context" : "note",
"contextType" : "variable",
"element" : "text",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "reference.value"
}
]
}
]
}
]
}
]
}
]
}
]
},
{
"name" : "MedicationRequest",
"typeMode" : "none",
"input" : [
{
"name" : "src",
"type" : "substanceAdministration",
"mode" : "source"
},
{
"name" : "patient",
"type" : "Patient",
"mode" : "target"
},
{
"name" : "encounter",
"type" : "Encounter",
"mode" : "target"
},
{
"name" : "tgt",
"type" : "MedicationRequest",
"mode" : "target"
},
{
"name" : "bundle",
"type" : "Bundle",
"mode" : "target"
}
],
"rule" : [
{
"name" : "reference",
"source" : [
{
"context" : "src"
}
],
"target" : [
{
"context" : "tgt",
"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"
}
]
}
],
"documentation" : "default + mandatory"
},
{
"name" : "reference",
"source" : [
{
"context" : "src"
}
],
"target" : [
{
"context" : "tgt",
"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" : "intent",
"source" : [
{
"context" : "src"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "intent",
"transform" : "copy",
"parameter" : [
{
"valueString" : "order"
}
]
}
]
},
{
"name" : "st",
"source" : [
{
"context" : "src",
"condition" : "statusCode.exists().not()"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "unknown"
}
]
}
]
},
{
"name" : "status",
"source" : [
{
"context" : "src",
"element" : "statusCode",
"variable" : "sc"
}
],
"rule" : [
{
"name" : "codeS",
"source" : [
{
"context" : "sc",
"element" : "code",
"variable" : "cos"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "status",
"transform" : "translate",
"parameter" : [
{
"valueId" : "cos"
},
{
"valueString" : "#MedicationStatusMap"
},
{
"valueString" : "code"
}
]
}
]
}
]
},
{
"name" : "note",
"source" : [
{
"context" : "src",
"element" : "text",
"variable" : "txt"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "note",
"variable" : "note"
}
],
"rule" : [
{
"name" : "text",
"source" : [
{
"context" : "txt",
"element" : "reference",
"variable" : "reference"
}
],
"target" : [
{
"context" : "note",
"contextType" : "variable",
"element" : "text",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "reference.value"
}
]
}
]
}
]
},
{
"name" : "period",
"source" : [
{
"context" : "src",
"type" : "IVL_TS",
"element" : "effectiveTime",
"variable" : "eff"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "dosageInstruction",
"variable" : "dosage",
"transform" : "create",
"parameter" : [
{
"valueString" : "Dosage"
}
]
}
],
"rule" : [
{
"name" : "timing",
"source" : [
{
"context" : "eff"
}
],
"target" : [
{
"context" : "dosage",
"contextType" : "variable",
"element" : "timing",
"variable" : "timing",
"transform" : "create",
"parameter" : [
{
"valueString" : "Timing"
}
]
}
],
"rule" : [
{
"name" : "rep",
"source" : [
{
"context" : "eff"
}
],
"target" : [
{
"context" : "timing",
"contextType" : "variable",
"element" : "repeat",
"variable" : "rep"
}
],
"rule" : [
{
"name" : "value1",
"source" : [
{
"context" : "eff",
"variable" : "eff",
"condition" : "(value.exists())"
}
],
"target" : [
{
"context" : "rep",
"contextType" : "variable",
"element" : "bounds",
"variable" : "value",
"transform" : "create",
"parameter" : [
{
"valueString" : "dateTime"
}
]
}
],
"dependent" : [
{
"name" : "TSDateTime",
"variable" : [
"eff",
"value"
]
}
]
},
{
"name" : "valuePeriod",
"source" : [
{
"context" : "eff",
"variable" : "eff",
"condition" : "(low.exists())"
}
],
"target" : [
{
"context" : "rep",
"contextType" : "variable",
"element" : "bounds",
"variable" : "value",
"transform" : "create",
"parameter" : [
{
"valueString" : "Period"
}
]
}
],
"dependent" : [
{
"name" : "IVLTSPeriod",
"variable" : [
"eff",
"value"
]
}
]
}
]
}
]
}
]
},
{
"name" : "period",
"source" : [
{
"context" : "src",
"type" : "EIVL_TS",
"element" : "effectiveTime",
"variable" : "effe"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "dosageInstruction",
"variable" : "dosage",
"transform" : "create",
"parameter" : [
{
"valueString" : "Dosage"
}
]
}
],
"rule" : [
{
"name" : "timing",
"source" : [
{
"context" : "effe"
}
],
"target" : [
{
"context" : "dosage",
"contextType" : "variable",
"element" : "timing",
"variable" : "timing",
"transform" : "create",
"parameter" : [
{
"valueString" : "Timing"
}
]
}
],
"rule" : [
{
"name" : "rep",
"source" : [
{
"context" : "effe"
}
],
"target" : [
{
"context" : "timing",
"contextType" : "variable",
"element" : "repeat",
"variable" : "rep"
}
],
"rule" : [
{
"name" : "eventCode",
"source" : [
{
"context" : "effe",
"element" : "eventCode",
"variable" : "ev"
}
],
"target" : [
{
"context" : "rep",
"contextType" : "variable",
"element" : "when",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "ev.code"
}
]
}
]
}
]
}
]
}
]
},
{
"name" : "tim",
"source" : [
{
"context" : "src",
"type" : "IVL_TS",
"element" : "effectiveTime",
"variable" : "eff"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "dosageInstruction",
"variable" : "dosage",
"transform" : "create",
"parameter" : [
{
"valueString" : "Dosage"
}
]
},
{
"context" : "dosage",
"contextType" : "variable",
"element" : "timing",
"variable" : "timing",
"transform" : "create",
"parameter" : [
{
"valueString" : "Timing"
}
]
},
{
"context" : "timing",
"contextType" : "variable",
"element" : "event",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "eff.value"
}
]
}
]
},
{
"name" : "eff",
"source" : [
{
"context" : "src",
"type" : "PIVL_TS",
"element" : "effectiveTime",
"variable" : "eff"
}
],
"target" : [
{
"context" : "tgt",
"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" : "condition",
"source" : [
{
"context" : "src",
"condition" : "(src.doseQuantity.exists() or src.rateQuantity.exists())"
}
],
"rule" : [
{
"name" : "dosageIn",
"source" : [
{
"context" : "src"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "dosageInstruction",
"variable" : "dosageInstruction",
"transform" : "create",
"parameter" : [
{
"valueString" : "Dosage"
}
]
}
],
"rule" : [
{
"name" : "doseQuantity",
"source" : [
{
"context" : "src",
"element" : "doseQuantity",
"variable" : "doseQuant"
}
],
"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" : "rate",
"source" : [
{
"context" : "src",
"element" : "rateQuantity",
"variable" : "rateQuantity"
}
],
"rule" : [
{
"name" : "ot",
"source" : [
{
"context" : "rateQuantity",
"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" : "rateQuantity"
}
],
"target" : [
{
"context" : "dosageInstruction",
"contextType" : "variable",
"element" : "doseAndRate",
"variable" : "dosageRate"
}
],
"rule" : [
{
"name" : "r",
"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" : "high",
"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" : "route",
"source" : [
{
"context" : "src",
"element" : "routeCode",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "dosageInstruction",
"contextType" : "variable",
"element" : "route",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "site",
"source" : [
{
"context" : "src",
"element" : "approachSiteCode",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "dosageInstruction",
"contextType" : "variable",
"element" : "site",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "site",
"source" : [
{
"context" : "src",
"element" : "targetSiteCode",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "dosageInstruction",
"contextType" : "variable",
"element" : "site",
"variable" : "vvv",
"transform" : "create"
}
]
}
]
}
]
},
{
"name" : "medication",
"source" : [
{
"context" : "src",
"element" : "consumable",
"variable" : "consumable"
}
],
"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" : "tgt",
"contextType" : "variable",
"element" : "medication",
"variable" : "medref",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "medref",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Medication/' + %medication.id"
}
]
}
],
"dependent" : [
{
"name" : "Medication",
"variable" : [
"src",
"medication",
"patient",
"bundle"
]
}
]
},
{
"name" : "entryR",
"source" : [
{
"context" : "src",
"element" : "entryRelationship",
"variable" : "entryRelationship"
}
],
"rule" : [
{
"name" : "supply",
"source" : [
{
"context" : "entryRelationship",
"element" : "supply",
"variable" : "supply"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "dispenseRequest",
"variable" : "dispenseRequest"
}
],
"rule" : [
{
"name" : "quantity",
"source" : [
{
"context" : "supply",
"element" : "quantity",
"variable" : "quantityCDA"
}
],
"target" : [
{
"context" : "dispenseRequest",
"contextType" : "variable",
"element" : "quantity",
"variable" : "quantityFHIR"
}
],
"rule" : [
{
"name" : "value",
"source" : [
{
"context" : "quantityCDA"
}
],
"target" : [
{
"context" : "quantityFHIR",
"contextType" : "variable",
"element" : "value",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "quantityCDA.value"
}
]
}
]
}
]
}
]
}
]
},
{
"name" : "Partecipant",
"source" : [
{
"context" : "src",
"element" : "participant",
"variable" : "participant"
}
],
"rule" : [
{
"name" : "function",
"source" : [
{
"context" : "participant"
}
],
"dependent" : [
{
"name" : "Practitioner",
"variable" : [
"participant",
"tgt",
"bundle"
]
}
]
},
{
"name" : "autor",
"source" : [
{
"context" : "participant",
"element" : "effectiveTime",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "authoredOn",
"variable" : "vvv",
"transform" : "create"
}
]
}
]
}
]
},
{
"name" : "periodTiming",
"typeMode" : "none",
"input" : [
{
"name" : "effectiveTime",
"type" : "PIVL_TS",
"mode" : "source"
},
{
"name" : "timing",
"type" : "Timing",
"mode" : "target"
}
],
"rule" : [
{
"name" : "repeat",
"source" : [
{
"context" : "effectiveTime"
}
],
"target" : [
{
"context" : "timing",
"contextType" : "variable",
"element" : "repeat",
"variable" : "r"
}
],
"rule" : [
{
"name" : "period",
"source" : [
{
"context" : "effectiveTime",
"element" : "period",
"variable" : "p"
}
],
"target" : [
{
"context" : "r",
"contextType" : "variable",
"element" : "period",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "p.value"
}
]
}
]
},
{
"name" : "period",
"source" : [
{
"context" : "effectiveTime",
"element" : "period",
"variable" : "p"
}
],
"target" : [
{
"context" : "r",
"contextType" : "variable",
"element" : "periodUnit",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "p.unit"
}
]
}
]
}
]
}
]
},
{
"name" : "Medication",
"typeMode" : "none",
"input" : [
{
"name" : "src",
"type" : "cda",
"mode" : "source"
},
{
"name" : "tgt",
"type" : "Medication",
"mode" : "target"
},
{
"name" : "patient",
"type" : "Patient",
"mode" : "target"
},
{
"name" : "bundle",
"type" : "Bundle",
"mode" : "target"
}
],
"rule" : [
{
"name" : "consumable",
"source" : [
{
"context" : "src",
"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" : "vvv"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "code",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "form",
"source" : [
{
"context" : "src",
"element" : "administrationUnitCode",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "form",
"variable" : "vvv",
"transform" : "create"
}
]
}
]
}
]
}
]
},
{
"name" : "entryR",
"source" : [
{
"context" : "src",
"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" : "tgt",
"contextType" : "variable",
"element" : "ingredient",
"variable" : "ingredient"
}
],
"rule" : [
{
"name" : "consumable",
"source" : [
{
"context" : "src",
"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" : "tgt",
"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" : "MedicationStatement",
"typeMode" : "none",
"input" : [
{
"name" : "src",
"type" : "subAdmin",
"mode" : "source"
},
{
"name" : "tgt",
"type" : "MedicationStatement",
"mode" : "target"
},
{
"name" : "patient",
"type" : "Patient",
"mode" : "target"
},
{
"name" : "encounter",
"type" : "Encounter",
"mode" : "target"
},
{
"name" : "bundle",
"type" : "Bundle",
"mode" : "target"
}
],
"rule" : [
{
"name" : "reference",
"source" : [
{
"context" : "src"
}
],
"target" : [
{
"context" : "tgt",
"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" : "src",
"element" : "statusCode",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "status",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "notpresent",
"source" : [
{
"context" : "src",
"condition" : "statusCode.exists().not()"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "unknown"
}
]
}
]
},
{
"name" : "consumable",
"source" : [
{
"context" : "src",
"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" : "tgt",
"contextType" : "variable",
"element" : "medication",
"variable" : "ce",
"transform" : "create",
"parameter" : [
{
"valueString" : "CodeableConcept"
}
]
}
],
"dependent" : [
{
"name" : "CECodeableConcept",
"variable" : [
"code",
"ce"
]
}
]
}
]
}
]
}
]
}
]
},
{
"name" : "FamilyMemberFunction",
"typeMode" : "none",
"input" : [
{
"name" : "src",
"type" : "organizer",
"mode" : "source"
},
{
"name" : "tgt",
"type" : "FamilyMemberHistory",
"mode" : "target"
},
{
"name" : "patient",
"type" : "patient",
"mode" : "target"
}
],
"rule" : [
{
"name" : "patReference",
"source" : [
{
"context" : "src"
}
],
"target" : [
{
"context" : "tgt",
"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" : "statusCode",
"source" : [
{
"context" : "src",
"element" : "statusCode",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "status",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "date",
"source" : [
{
"context" : "src",
"element" : "effectiveTime",
"variable" : "effectiveTime"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "date",
"variable" : "value",
"transform" : "create",
"parameter" : [
{
"valueString" : "date"
}
]
}
],
"dependent" : [
{
"name" : "TSDateTime",
"variable" : [
"effectiveTime",
"value"
]
}
]
},
{
"name" : "relationship",
"source" : [
{
"context" : "src",
"element" : "subject",
"variable" : "subject"
}
],
"rule" : [
{
"name" : "relatedSub",
"source" : [
{
"context" : "subject",
"element" : "relatedSubject",
"variable" : "relatedSubject"
}
],
"rule" : [
{
"name" : "relationshipCode",
"source" : [
{
"context" : "relatedSubject",
"element" : "code",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "relationship",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "subject",
"source" : [
{
"context" : "relatedSubject",
"element" : "subject",
"variable" : "subject"
}
],
"target" : [
{
"context" : "tgt",
"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" : "sexCode"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "code",
"transform" : "translate",
"parameter" : [
{
"valueId" : "sexCode"
},
{
"valueString" : "#cm-v3-administrative-gender"
},
{
"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" : "component",
"source" : [
{
"context" : "src",
"element" : "component",
"variable" : "component"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "condition",
"variable" : "condition"
}
],
"rule" : [
{
"name" : "observation",
"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" : "tgt",
"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" : "tgt",
"contextType" : "variable",
"element" : "status",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "cont",
"source" : [
{
"context" : "observation",
"condition" : "observation.effectiveTime.exists()"
}
],
"rule" : [
{
"name" : "effttemp",
"source" : [
{
"context" : "observation",
"element" : "effectiveTime",
"variable" : "effectiveTime"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "condition",
"variable" : "condition",
"transform" : "create",
"parameter" : [
{
"valueString" : "BackboneElement"
}
]
}
],
"rule" : [
{
"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"
}
]
},
{
"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"
]
}
]
}
]
}
]
}
],
"documentation" : "observation.effectiveTime as effectiveTime -> condition.onset = create('Period') as value then IVLTSPeriod(effectiveTime, value) \"valuePeriod\";"
},
{
"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" : "entryR"
}
],
"rule" : [
{
"name" : "obser",
"source" : [
{
"context" : "entryR",
"element" : "observation",
"variable" : "obs"
}
],
"rule" : [
{
"name" : "insorgenza",
"source" : [
{
"context" : "obs",
"condition" : "(code.code = '35267-4')"
}
],
"rule" : [
{
"name" : "value",
"source" : [
{
"context" : "obs",
"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" : "death",
"source" : [
{
"context" : "obs",
"condition" : "(code.code = '39016-1')"
}
],
"rule" : [
{
"name" : "value",
"source" : [
{
"context" : "obs",
"element" : "value",
"variable" : "value"
}
],
"target" : [
{
"context" : "tgt",
"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" : "allergyFunction",
"typeMode" : "none",
"input" : [
{
"name" : "src",
"type" : "cdaElement",
"mode" : "source"
},
{
"name" : "tgt",
"type" : "AllergyIntolerance",
"mode" : "target"
},
{
"name" : "patient",
"type" : "patient",
"mode" : "target"
},
{
"name" : "encounter",
"type" : "encounter",
"mode" : "target"
}
],
"rule" : [
{
"name" : "reference",
"source" : [
{
"context" : "src"
}
],
"target" : [
{
"context" : "tgt",
"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" : "tgt",
"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" : "entryrelationship",
"source" : [
{
"context" : "src",
"element" : "entryRelationship",
"variable" : "entryRelationship1"
}
],
"rule" : [
{
"name" : "observation",
"source" : [
{
"context" : "entryRelationship1",
"element" : "observation",
"variable" : "observation1"
}
],
"rule" : [
{
"name" : "valuePeriod",
"source" : [
{
"context" : "observation1",
"element" : "effectiveTime",
"variable" : "effectiveTime"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "onset",
"variable" : "value",
"transform" : "create",
"parameter" : [
{
"valueString" : "Period"
}
]
}
],
"dependent" : [
{
"name" : "IVLTSPeriod",
"variable" : [
"effectiveTime",
"value"
]
}
]
},
{
"name" : "code",
"source" : [
{
"context" : "observation1",
"element" : "value",
"variable" : "code"
}
],
"rule" : [
{
"name" : "type",
"source" : [
{
"context" : "code",
"element" : "code",
"variable" : "code1"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "type",
"transform" : "translate",
"parameter" : [
{
"valueId" : "code1"
},
{
"valueString" : "#AllergyTypeMap"
},
{
"valueString" : "code"
}
]
}
]
},
{
"name" : "category",
"source" : [
{
"context" : "code",
"element" : "code",
"variable" : "code1"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "category",
"transform" : "translate",
"parameter" : [
{
"valueId" : "code1"
},
{
"valueString" : "#AllergyCategoryMap"
},
{
"valueString" : "code"
}
]
}
]
}
]
},
{
"name" : "participant",
"source" : [
{
"context" : "observation1",
"element" : "participant",
"variable" : "participant"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "reaction",
"variable" : "reaction"
}
],
"rule" : [
{
"name" : "entryR2",
"source" : [
{
"context" : "observation1",
"element" : "entryRelationship",
"variable" : "entryRelationship2",
"condition" : "(typeCode = 'MFST')"
}
],
"rule" : [
{
"name" : "observ2",
"source" : [
{
"context" : "entryRelationship2",
"element" : "observation",
"variable" : "observation2"
}
],
"rule" : [
{
"name" : "manifestation",
"source" : [
{
"context" : "observation2",
"element" : "value",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "reaction",
"contextType" : "variable",
"element" : "manifestation",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "low",
"source" : [
{
"context" : "observation2",
"element" : "effectiveTime",
"variable" : "effectiveTime"
}
],
"rule" : [
{
"name" : "valuePeriodLow",
"source" : [
{
"context" : "effectiveTime",
"element" : "low",
"variable" : "low"
}
],
"target" : [
{
"context" : "reaction",
"contextType" : "variable",
"element" : "onset",
"variable" : "value",
"transform" : "create",
"parameter" : [
{
"valueString" : "dateTime"
}
]
}
],
"dependent" : [
{
"name" : "TSDateTime",
"variable" : [
"low",
"value"
]
}
]
}
]
}
]
}
]
},
{
"name" : "participantRole",
"source" : [
{
"context" : "participant",
"element" : "participantRole",
"variable" : "participantRole"
}
],
"rule" : [
{
"name" : "playingEntity",
"source" : [
{
"context" : "participantRole",
"element" : "playingEntity",
"variable" : "playingEntity"
}
],
"rule" : [
{
"name" : "reaction",
"source" : [
{
"context" : "playingEntity",
"element" : "code",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "reaction",
"contextType" : "variable",
"element" : "substance",
"variable" : "vvv",
"transform" : "create"
}
]
}
]
}
]
}
]
},
{
"name" : "entryR2",
"source" : [
{
"context" : "observation1",
"element" : "entryRelationship",
"variable" : "entryRelationship2",
"condition" : "(typeCode = 'MFST')"
}
],
"rule" : [
{
"name" : "observ2",
"source" : [
{
"context" : "entryRelationship2",
"element" : "observation",
"variable" : "observation2",
"condition" : "observation1.participant.exists().not()"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "reaction",
"variable" : "reaction"
}
],
"rule" : [
{
"name" : "manifestation",
"source" : [
{
"context" : "observation2",
"element" : "value",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "reaction",
"contextType" : "variable",
"element" : "manifestation",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "low",
"source" : [
{
"context" : "observation2",
"element" : "effectiveTime",
"variable" : "effectiveTime"
}
],
"rule" : [
{
"name" : "valuePeriodLow",
"source" : [
{
"context" : "effectiveTime",
"element" : "low",
"variable" : "low"
}
],
"target" : [
{
"context" : "reaction",
"contextType" : "variable",
"element" : "onset",
"variable" : "value",
"transform" : "create",
"parameter" : [
{
"valueString" : "dateTime"
}
]
}
],
"dependent" : [
{
"name" : "TSDateTime",
"variable" : [
"low",
"value"
]
}
]
}
]
}
]
}
]
},
{
"name" : "entryR3",
"source" : [
{
"context" : "observation1",
"element" : "entryRelationship",
"variable" : "entryRelationship3",
"condition" : "(typeCode = 'SUBJ')"
}
],
"rule" : [
{
"name" : "observ3",
"source" : [
{
"context" : "entryRelationship3",
"element" : "observation",
"variable" : "observation3"
}
],
"rule" : [
{
"name" : "criticality",
"source" : [
{
"context" : "observation3",
"element" : "value",
"variable" : "value"
}
],
"rule" : [
{
"name" : "value",
"source" : [
{
"context" : "value",
"element" : "code",
"variable" : "c"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "criticality",
"transform" : "translate",
"parameter" : [
{
"valueId" : "c"
},
{
"valueString" : "#CricalityMap"
},
{
"valueString" : "code"
}
]
}
]
}
]
}
]
},
{
"name" : "act",
"source" : [
{
"context" : "entryRelationship3",
"element" : "act",
"variable" : "act"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "note",
"variable" : "note"
}
],
"rule" : [
{
"name" : "note",
"source" : [
{
"context" : "act",
"element" : "text",
"variable" : "text"
}
],
"rule" : [
{
"name" : "reference",
"source" : [
{
"context" : "text",
"element" : "reference",
"variable" : "reference"
}
],
"target" : [
{
"context" : "note",
"contextType" : "variable",
"element" : "text",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "reference.value"
}
]
}
]
}
]
}
]
}
]
},
{
"name" : "entryR4",
"source" : [
{
"context" : "observation1",
"element" : "entryRelationship",
"variable" : "entryRelationship4",
"condition" : "(typeCode = 'REFR')"
}
],
"rule" : [
{
"name" : "observ4",
"source" : [
{
"context" : "entryRelationship4",
"element" : "observation",
"variable" : "observation4"
}
],
"rule" : [
{
"name" : "clinicalStatus",
"source" : [
{
"context" : "observation4",
"element" : "value",
"variable" : "value"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "clinicalStatus",
"variable" : "clinicalStatus"
}
],
"rule" : [
{
"name" : "coding",
"source" : [
{
"context" : "value",
"variable" : "valu"
}
],
"target" : [
{
"context" : "clinicalStatus",
"contextType" : "variable",
"element" : "coding",
"variable" : "coding",
"transform" : "create",
"parameter" : [
{
"valueString" : "Coding"
}
]
}
],
"rule" : [
{
"name" : "code",
"source" : [
{
"context" : "valu",
"condition" : "(code = 'LA9041-0')"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "code",
"transform" : "copy",
"parameter" : [
{
"valueString" : "resolved"
}
]
}
]
},
{
"name" : "code",
"source" : [
{
"context" : "valu",
"condition" : "(code = 'LA18632-2')"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "code",
"transform" : "copy",
"parameter" : [
{
"valueString" : "inactive"
}
]
}
]
},
{
"name" : "code",
"source" : [
{
"context" : "valu",
"condition" : "(code = 'LA16666-2')"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "code",
"transform" : "copy",
"parameter" : [
{
"valueString" : "active"
}
]
}
]
},
{
"name" : "system",
"source" : [
{
"context" : "valu"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "system",
"transform" : "copy",
"parameter" : [
{
"valueString" : "http://terminology.hl7.org/CodeSystem/allergyintolerance-clinical"
}
]
}
]
},
{
"name" : "display",
"source" : [
{
"context" : "valu",
"element" : "displayName",
"variable" : "display"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "display",
"transform" : "cast",
"parameter" : [
{
"valueId" : "display"
},
{
"valueString" : "string"
}
]
}
]
}
]
}
]
}
]
}
]
}
]
}
]
}
]
},
{
"name" : "Practitioner",
"typeMode" : "none",
"input" : [
{
"name" : "src",
"type" : "participant",
"mode" : "source"
},
{
"name" : "tgt",
"type" : "MedicationRequest",
"mode" : "target"
},
{
"name" : "bundle",
"type" : "Bundle",
"mode" : "target"
}
],
"rule" : [
{
"name" : "practitionerCreate",
"source" : [
{
"context" : "src"
}
],
"target" : [
{
"context" : "bundle",
"contextType" : "variable",
"element" : "entry",
"variable" : "e22"
},
{
"context" : "e22",
"contextType" : "variable",
"element" : "request",
"variable" : "request",
"transform" : "create",
"parameter" : [
{
"valueString" : "BackboneElement"
}
]
},
{
"context" : "request",
"contextType" : "variable",
"element" : "method",
"transform" : "copy",
"parameter" : [
{
"valueString" : "PUT"
}
]
},
{
"context" : "e22",
"contextType" : "variable",
"element" : "resource",
"variable" : "practitioner1",
"transform" : "create",
"parameter" : [
{
"valueString" : "Practitioner"
}
]
}
],
"rule" : [
{
"name" : "resurceCreation",
"source" : [
{
"context" : "src",
"element" : "participantRole",
"variable" : "practr"
}
],
"rule" : [
{
"name" : "identifier",
"source" : [
{
"context" : "practr",
"element" : "id",
"variable" : "id"
}
],
"target" : [
{
"context" : "practitioner1",
"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"
}
]
}
]
},
{
"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" : "id",
"source" : [
{
"context" : "id",
"element" : "extension",
"variable" : "ext"
}
],
"target" : [
{
"context" : "practitioner1",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid22",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "r + '-' + ext"
}
]
},
{
"context" : "e22",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "https://example/Practitioner/"
},
{
"valueId" : "uuid22"
}
]
},
{
"context" : "tgt",
"contextType" : "variable",
"element" : "requester",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'https://example/Practitioner/' + %practitioner1.id"
}
]
}
]
}
]
}
]
},
{
"name" : "2.16.840.1.113883.2.9.4.3.2",
"source" : [
{
"context" : "practr",
"element" : "id",
"variable" : "id",
"condition" : "(root = '2.16.840.1.113883.2.9.4.3.2')"
}
],
"rule" : [
{
"name" : "UUID",
"source" : [
{
"context" : "id",
"element" : "extension",
"variable" : "ext"
}
],
"target" : [
{
"context" : "request",
"contextType" : "variable",
"element" : "url",
"transform" : "append",
"parameter" : [
{
"valueString" : "Practitioner?identifier="
},
{
"valueId" : "ext"
}
]
}
]
}
]
},
{
"name" : "diverso",
"source" : [
{
"context" : "practr",
"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" : "meta",
"source" : [
{
"context" : "practr"
}
],
"target" : [
{
"context" : "practitioner1",
"contextType" : "variable",
"element" : "meta",
"variable" : "meta"
}
],
"rule" : [
{
"name" : "coding",
"source" : [
{
"context" : "practr"
}
],
"target" : [
{
"context" : "meta",
"contextType" : "variable",
"element" : "tag",
"variable" : "coding",
"transform" : "create",
"parameter" : [
{
"valueString" : "Coding"
}
]
}
],
"rule" : [
{
"name" : "system",
"source" : [
{
"context" : "practr"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "system",
"transform" : "copy",
"parameter" : [
{
"valueString" : "http://algoritmodiscoring"
}
]
}
]
},
{
"name" : "code",
"source" : [
{
"context" : "practr"
}
],
"target" : [
{
"context" : "coding",
"contextType" : "variable",
"element" : "code",
"transform" : "copy",
"parameter" : [
{
"valueString" : "ClinicalDocument/body/TerapiaFarmacologicaConsigliata/participant"
}
]
}
]
}
]
}
]
},
{
"name" : "addr",
"source" : [
{
"context" : "practr",
"element" : "addr",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "practitioner1",
"contextType" : "variable",
"element" : "address",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "telecom",
"source" : [
{
"context" : "practr",
"element" : "telecom",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "practitioner1",
"contextType" : "variable",
"element" : "telecom",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "partname",
"source" : [
{
"context" : "practr",
"element" : "playingEntity",
"variable" : "plentity"
}
],
"rule" : [
{
"name" : "name",
"source" : [
{
"context" : "plentity",
"element" : "name",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "practitioner1",
"contextType" : "variable",
"element" : "name",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "birth",
"source" : [
{
"context" : "plentity",
"element" : "birthTime",
"variable" : "birthTime"
}
],
"rule" : [
{
"name" : "value",
"source" : [
{
"context" : "birthTime",
"element" : "value",
"variable" : "date"
}
],
"target" : [
{
"context" : "practitioner1",
"contextType" : "variable",
"element" : "birthDate",
"transform" : "truncate",
"parameter" : [
{
"valueId" : "date"
},
{
"valueInteger" : 10
}
]
}
]
}
]
}
]
}
]
}
]
}
]
}
]
}