CDA-FHIR-Maps (R4)
0.3.0 - DSTU 1
This page is part of the CDA-FHIR-Maps (R4) (v0.3.0: DSTU 1) based on FHIR R4. . For a full list of available versions, see the Directory of published versions
{
"resourceType" : "StructureMap",
"id" : "CdaToBundle",
"text" : {
"status" : "generated",
"div" : "<div xmlns=\"http://www.w3.org/1999/xhtml\">\n <pre>map "http://fhir.ch/ig/cda-fhir-maps/StructureMap/CdaToBundle" = "CdaToBundle"\n\n// CDA document\n// 2020-01-16 Oliver Egger, copyright ahdis ag, Apache License\n// CDA: http://build.fhir.org/ig/ahdis/cda-core-2.0/branches/master/index.html\n// FHIR: http://hl7.org/fhir/r4/\n\nconceptmap "cm-v3-administrative-gender" {\n prefix s = "http://terminology.hl7.org/ValueSet/v3-AdministrativeGender"\n prefix t = "http://hl7.org/fhir/ValueSet/administrative-gender"\n\n s:M == t:male\n s:F == t:female\n}\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/CustodianOrganization" alias CustodianOrganization 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/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/Person" alias Patient as produced\nuses "http://hl7.org/fhir/StructureDefinition/Practitioner" alias Practitioner as produced\nuses "http://hl7.org/fhir/StructureDefinition/Organization" alias Organization as produced\n\nimports "http://fhir.ch/ig/cda-fhir-maps/StructureMap/CdaToFhirTypes"\n\ngroup CdaToBundle(source cda : ClinicalDocument, target bundle : Bundle) {\n cda -> bundle.entry as e, e.resource = create('Composition') as composition, composition.id = uuid() as uuid, e.fullUrl = append('urn:uuid:', uuid), bundle.entry as e2, e2.resource = create('Patient') as patient, patient.id = uuid() as uuid2, e2.fullUrl = append('urn:uuid:', uuid2) then {\n cda then ClinicalDocumentToBundle(cda, patient, composition, bundle) "cdatobundle";\n } "ClinicalDocumentToBody";\n}\n\ngroup ClinicalDocumentToBundle(source cda : ClinicalDocument, target patient : Patient, target composition : Composition, target bundle : Bundle) {\n cda -> bundle.id = uuid() "id";\n cda.id -> bundle.identifier "identifier";\n cda -> bundle.type = 'document' "type";\n cda.effectiveTime -> bundle.timestamp;\n cda then ClinicalDocumentComposition(cda, composition, patient, bundle) "composition";\n cda.component as component then {\n component.structuredBody as body then {\n body.component as component log 'component' then {\n component.section as srcSection where $this.code.empty() -> composition.section as tgtSection then ClinicalDocumentSection(cda, srcSection, patient, tgtSection, bundle);\n };\n } "body";\n };\n}\n\n// _________________________ Section Level Templates _________________________\ngroup ClinicalDocumentSection(source cda : ClinicalDocument, source src : Section, source patient : Patient, target tgt, target bundle : Bundle) {\n src.id as id where ($this.root = %cda.id.root) = false -> tgt.extension as ext then ChExtEprSectionId(id, ext) "sectionId";\n src.title as t -> tgt.title = (t.dataString);\n src.code -> tgt.code;\n src.text as cdaText -> tgt.text as fhirText then {\n cdaText -> fhirText.status = 'generated' "narrativeStatus";\n cdaText as t -> fhirText.div = t "narrativeText";\n } "cdaText";\n src.section as srcSection -> tgt.section as tgtSection then ClinicalDocumentSection(cda, srcSection, patient, tgtSection, bundle);\n}\n\n// _________________________ Entry Level Templates ________________________\n// _________________________ Header Level Templates _________________________\ngroup ClinicalDocumentComposition(source src : ClinicalDocument, target tgt : Composition, target patientResource : Patient, target bundle : Bundle) {\n src.languageCode -> tgt.language;\n src.id where src.setId.exists().not() -> tgt.identifier "identifier";\n src.setId -> tgt.identifier "identifier";\n src -> tgt.status = 'final' "status";\n src.code -> tgt.type;\n src.title as t -> tgt.title = (t.dataString);\n src.recordTarget as recordTarget then {\n recordTarget.patientRole as patient -> tgt.subject = create('Reference') as reference, reference.reference = ('urn:uuid:' + %patientResource.id) then ClinicalDocumentPatientRole(patient, patientResource, bundle) "subject";\n } "patientRole";\n src.componentOf as comp -> bundle.entry as e, e.resource = create('Encounter') as encounter, encounter.id = uuid() as uuid, e.fullUrl = append('urn:uuid:', uuid) then {\n comp.encompassingEncounter as srcEnc -> tgt.encounter = create('Reference') as reference, reference.reference = ('urn:uuid:' + %encounter.id) then ClinicalDocumentEncounter(srcEnc, bundle, encounter) "srcEncounter";\n } "encompassingEncounter";\n src.effectiveTime -> tgt.date;\n src.author as srcAuthor -> bundle.entry as e, e.resource = create('Practitioner') as practitioner, practitioner.id = uuid() as uuid2, e.fullUrl = append('urn:uuid:', uuid2), tgt.author = create('Reference') as reference, reference.reference = ('urn:uuid:' + %practitioner.id) then {\n srcAuthor.time as time -> reference.extension as exttime then ChExtEprTime(time, exttime);\n srcAuthor.assignedAuthor as assignedAuthor then {\n assignedAuthor.id -> practitioner.identifier;\n assignedAuthor.addr -> practitioner.address;\n assignedAuthor.telecom -> practitioner.telecom;\n assignedAuthor.assignedPerson as person then {\n person.name -> practitioner.name;\n } "name";\n assignedAuthor.representedOrganization as srcOrg -> bundle.entry as e2, e2.resource = create('Organization') as organization, organization.id = uuid() as uuid3, e2.fullUrl = append('urn:uuid:', uuid3), tgt.author = create('Reference') as reference2, reference2.reference = ('urn:uuid:' + %organization.id) then ClinicalDocumentOrganization(srcOrg, organization);\n } "author";\n } "srcAuthor";\n src.confidentialityCode -> tgt.confidentiality;\n src.legalAuthenticator as legalAuth -> bundle.entry as e, e.resource = create('Practitioner') as practitioner, practitioner.id = uuid() as uuid2, e.fullUrl = append('urn:uuid:', uuid2) then {\n legalAuth -> tgt.attester as attester then {\n legalAuth -> attester.mode = 'legal' "mode";\n legalAuth.time -> attester.time;\n legalAuth.assignedEntity as entity -> attester.party = create('Reference') as reference, reference.reference = ('urn:uuid:' + %practitioner.id) then ClinicalDocumentEntityPractitioner(entity, practitioner) "entity";\n } "attester";\n } "legalAuth";\n src.authenticator as auth -> bundle.entry as e, e.resource = create('Practitioner') as practitioner, practitioner.id = uuid() as uuid2, e.fullUrl = append('urn:uuid:', uuid2) then {\n auth -> tgt.attester as attester then {\n auth -> attester.mode = 'official' "mode";\n auth.time -> attester.time;\n auth.assignedEntity as entity -> attester.party = create('Reference') as reference, reference.reference = ('urn:uuid:' + %practitioner.id) then ClinicalDocumentEntityPractitioner(entity, practitioner) "entity";\n } "attester";\n } "auth";\n src.custodian as custodian -> bundle.entry as e then {\n custodian.assignedCustodian as assignedCustodian -> e.resource = create('Organization') as organization, organization.id = uuid() as uuid3, e.fullUrl = append('urn:uuid:', uuid3) then {\n assignedCustodian.representedCustodianOrganization as srcOrg -> tgt.custodian = create('Reference') as reference, reference.reference = ('urn:uuid:' + %organization.id) then ClinicalDocumentOrganization(srcOrg, organization) "assignedCustodian";\n } "custodian";\n } "cust";\n src.documentationOf as docOf then {\n docOf.serviceEvent as serviceEvent -> tgt.event as event then {\n serviceEvent.code -> event.code "eventCode";\n serviceEvent.effectiveTime -> event.period "eventTime";\n } "docOf";\n };\n src.relatedDocument as relatedDoc -> tgt.relatesTo as relates then {\n relatedDoc.typeCode -> relates.code;\n relatedDoc.parentDocument as parentDoc then {\n parentDoc.setId -> relates.targetIdentifier;\n } "parentDoc";\n } "relatedDoc";\n}\n\ngroup ClinicalDocumentEntityPractitioner(source src : AssignedEntity, target tgt : Practitioner) {\n src.id -> tgt.identifier;\n src.addr -> tgt.address;\n src.telecom -> tgt.telecom;\n src.assignedPerson as person then {\n person.name -> tgt.name;\n } "name";\n}\n\ngroup ClinicalDocumentOrganization(source src : CustodianOrganization, target tgt : Organization) {\n src.id -> tgt.identifier;\n src.name as v -> tgt.name = (v.other);\n src.telecom -> tgt.telecom;\n src.addr -> tgt.address;\n}\n\ngroup ClinicalDocumentPatientRole(source src : PatientRole, target tgt : Patient, target bundle : Bundle) {\n // src.id -> tgt.identifier;\n src -> tgt.identifier as identifier then {\n src.id as id -> identifier.type as type, type.coding as coding, coding.system as system, coding.code as code then {\n src -> system.value = 'http://terminology.hl7.org/CodeSystem/v2-0203' "system";\n src -> code.value = 'MR' "code";\n id.extension as extension -> identifier.value as value, value.value = extension;\n id.root as root -> identifier.system as system, system.value = append('urn:oid:', root);\n };\n } "identifier";\n src.addr -> tgt.address;\n src.telecom -> tgt.telecom;\n src.patient as patient then {\n patient.name -> tgt.name;\n patient.administrativeGenderCode as gender then {\n gender.code as v -> tgt.gender = translate(v, '#cm-v3-administrative-gender', 'code') "gender";\n } "gender";\n patient.birthTime -> tgt.birthDate "birthDate";\n patient.deceasedInd as indicator where patient.deceasedTime.empty() -> tgt.deceased = create('boolean') as bool then boolean(indicator, bool) "deceasedBL";\n patient.deceasedTime -> tgt.deceased;\n patient.maritalStatusCode -> tgt.maritalStatus "maritalStatus";\n patient.languageCommunication as language -> tgt.communication as communication then {\n language.languageCode -> communication.language "communication";\n } "language";\n };\n src.providerOrganization as org -> bundle.entry as e, e.resource = create('Organization') as organization, organization.id = uuid() as uuid3, e.fullUrl = append('urn:uuid:', uuid3) then {\n org -> tgt.managingOrganization = create('Reference') as reference, reference.reference = ('urn:uuid:' + %organization.id) "reference";\n org.id -> organization.identifier;\n org.name as v -> organization.name = (v.other);\n org.telecom -> organization.telecom;\n org.addr -> organization.address;\n } "organization";\n}\n\ngroup ClinicalDocumentEncounter(source src : EncompassingEncounter, target bundle : Bundle, target tgt : Encounter) {\n src.id -> tgt.identifier;\n src.code -> tgt.type;\n src.effectiveTime -> tgt.period;\n src where admissionReferralSourceCode.exists() or dischargeDispositionCode.exists() -> tgt.hospitalization as hosp then {\n src.admissionReferralSourceCode -> hosp.admitSource "adminReferral";\n src.dischargeDispositionCode -> hosp.dischargeDisposition "discDisposition";\n } "hospitalization";\n src.encounterParticipant as srcPart -> tgt.participant as tgtPart then {\n srcPart.typeCode as code -> tgtPart.type = cc('http://terminology.hl7.org/CodeSystem/v3-ParticipationType', code);\n srcPart.time -> tgtPart.period;\n srcPart.assignedEntity as entity -> bundle.entry as e, e.resource = create('Practitioner') as practitioner, practitioner.id = uuid() as uuid2, e.fullUrl = append('urn:uuid:', uuid2) then {\n entity -> tgtPart.individual = create('Reference') as reference, reference.reference = ('urn:uuid:' + %practitioner.id) then ClinicalDocumentEntityPractitioner(entity, practitioner) "entry";\n } "entity";\n } "participant";\n src.location as srcLocation then {\n srcLocation.healthCareFacility as facility -> bundle.entry as e, e.resource = create('Location') as location, location.id = uuid() as uuid2, e.fullUrl = append('urn:uuid:', uuid2) then {\n facility -> tgt.location as tgtLocation, tgtLocation.location = create('Reference') as reference, reference.reference = ('urn:uuid:' + %location.id) then ClinicalDocumentLocation(facility, bundle, location) "facLocation";\n } "facility";\n };\n}\n\ngroup ClinicalDocumentLocation(source src : HealthCareFacility, target bundle : Bundle, target tgt : Location) {\n src.id -> tgt.identifier;\n src.code -> tgt.type;\n src.location as location then {\n // place names are usually stored with no parts location.name as srcName -> tgt.name = cast(srcName, 'string');\n location.addr -> tgt.address;\n location.serviceProviderOrganization as srcOrg -> bundle.entry as e, e.resource = create('Organization') as organization, organization.id = uuid() as uuid3, e.fullUrl = append('urn:uuid:', uuid3) then {\n srcOrg -> tgt.managingOrganization = create('Reference') as reference, reference.reference = ('urn:uuid:' + %organization.id) then ClinicalDocumentOrganization(srcOrg, organization) "organization";\n } "org";\n };\n}\n\n// source dataEnterer: https://art-decor.org/art-decor/decor-templates--hl7chcda-?id=2.16.756.5.30.1.1.10.2.7\n// source author: https://art-decor.org/art-decor/decor-templates--hl7chcda-?id=2.16.840.1.113883.10.12.102\n// target: https://build.fhir.org/ig/hl7ch/ch-core//StructureDefinition-ch-ext-epr-time.html\ngroup ChExtEprTime(source src : TSDateTime, target ext : Extension) {\n src -> ext.url = 'http://fhir.ch/ig/ch-core/StructureDefinition/ch-ext-epr-time' "url";\n src -> ext.value = create('dateTime') as value then TSDateTime(src, value) "value";\n}\n\n// https://art-decor.org/art-decor/decor-templates--hl7chcda-?id=2.16.756.5.30.1.1.10.3.45\n// target: http://build.fhir.org/ig/hl7ch/ch-core/branches/master/StructureDefinition-ch-ext-epr-sectionid.html\ngroup ChExtEprSectionId(source src : II, target ext : Extension) {\n src -> ext.url = 'http://fhir.ch/ig/ch-core/StructureDefinition/ch-ext-epr-sectionid' "url";\n src -> ext.value = create('Identifier') as value then II(src, value) "value";\n}\n\n// _________________________ Template Type not specified ___________________\ngroup NarrativeLink(source url, target ext : Extension) {\n url -> ext.url = 'http://hl7.org/fhir/StructureDefinition/narrativeLink' "url";\n url -> ext.value = create('url') as value, value.value = url "value";\n}\n\n</pre>\n </div>"
},
"contained" : [
{
"resourceType" : "ConceptMap",
"id" : "cm-v3-administrative-gender",
"status" : "draft",
"group" : [
{
"source" : "http://terminology.hl7.org/ValueSet/v3-AdministrativeGender",
"target" : "http://hl7.org/fhir/ValueSet/administrative-gender",
"element" : [
{
"code" : "M",
"target" : [
{
"code" : "male",
"equivalence" : "equivalent"
}
]
},
{
"code" : "F",
"target" : [
{
"code" : "female",
"equivalence" : "equivalent"
}
]
}
]
}
]
}
],
"extension" : [
{
"url" : "http://fhir.ch/reference",
"valueReference" : {
"reference" : "#cm-v3-administrative-gender"
}
}
],
"url" : "http://fhir.ch/ig/cda-fhir-maps/StructureMap/CdaToBundle",
"version" : "0.3.0",
"name" : "CdaToBundle",
"status" : "draft",
"date" : "2022-02-11T11:14:39+01:00",
"publisher" : "ahdis",
"contact" : [
{
"name" : "ahdis",
"telecom" : [
{
"system" : "url",
"value" : "http://www.ahdis.ch/"
}
]
}
],
"description" : "CDA document 2020-01-16 Oliver Egger, copyright ahdis ag, Apache License CDA: http://build.fhir.org/ig/ahdis/cda-core-2.0/branches/master/index.html FHIR: http://hl7.org/fhir/r4/",
"copyright" : "CC-BY-SA-4.0",
"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/CustodianOrganization",
"mode" : "queried",
"alias" : "CustodianOrganization"
},
{
"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/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/Person",
"mode" : "produced",
"alias" : "Patient"
},
{
"url" : "http://hl7.org/fhir/StructureDefinition/Practitioner",
"mode" : "produced",
"alias" : "Practitioner"
},
{
"url" : "http://hl7.org/fhir/StructureDefinition/Organization",
"mode" : "produced",
"alias" : "Organization"
}
],
"import" : [
"http://fhir.ch/ig/cda-fhir-maps/StructureMap/CdaToFhirTypes"
],
"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" : "resource",
"variable" : "composition",
"transform" : "create",
"parameter" : [
{
"valueString" : "Composition"
}
]
},
{
"context" : "composition",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid",
"transform" : "uuid"
},
{
"context" : "e",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "urn:uuid:"
},
{
"valueId" : "uuid"
}
]
},
{
"context" : "bundle",
"contextType" : "variable",
"element" : "entry",
"variable" : "e2"
},
{
"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" : "urn:uuid:"
},
{
"valueId" : "uuid2"
}
]
}
],
"rule" : [
{
"name" : "cdatobundle",
"source" : [
{
"context" : "cda"
}
],
"dependent" : [
{
"name" : "ClinicalDocumentToBundle",
"variable" : [
"cda",
"patient",
"composition",
"bundle"
]
}
]
}
]
}
]
},
{
"name" : "ClinicalDocumentToBundle",
"typeMode" : "none",
"input" : [
{
"name" : "cda",
"type" : "ClinicalDocument",
"mode" : "source"
},
{
"name" : "patient",
"type" : "Patient",
"mode" : "target"
},
{
"name" : "composition",
"type" : "Composition",
"mode" : "target"
},
{
"name" : "bundle",
"type" : "Bundle",
"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" : "document"
}
]
}
]
},
{
"name" : "effectiveTime",
"source" : [
{
"context" : "cda",
"element" : "effectiveTime",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "bundle",
"contextType" : "variable",
"element" : "timestamp",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "composition",
"source" : [
{
"context" : "cda"
}
],
"dependent" : [
{
"name" : "ClinicalDocumentComposition",
"variable" : [
"cda",
"composition",
"patient",
"bundle"
]
}
]
},
{
"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",
"logMessage" : "'component'"
}
],
"rule" : [
{
"name" : "section",
"source" : [
{
"context" : "component",
"element" : "section",
"variable" : "srcSection",
"condition" : "$this.code.empty()"
}
],
"target" : [
{
"context" : "composition",
"contextType" : "variable",
"element" : "section",
"variable" : "tgtSection"
}
],
"dependent" : [
{
"name" : "ClinicalDocumentSection",
"variable" : [
"cda",
"srcSection",
"patient",
"tgtSection",
"bundle"
]
}
]
}
]
}
]
}
]
}
]
},
{
"name" : "ClinicalDocumentSection",
"typeMode" : "none",
"documentation" : "_________________________ Section Level Templates _________________________",
"input" : [
{
"name" : "cda",
"type" : "ClinicalDocument",
"mode" : "source"
},
{
"name" : "src",
"type" : "Section",
"mode" : "source"
},
{
"name" : "patient",
"type" : "Patient",
"mode" : "source"
},
{
"name" : "tgt",
"mode" : "target"
},
{
"name" : "bundle",
"type" : "Bundle",
"mode" : "target"
}
],
"rule" : [
{
"name" : "sectionId",
"source" : [
{
"context" : "src",
"element" : "id",
"variable" : "id",
"condition" : "($this.root = %cda.id.root) = false"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "extension",
"variable" : "ext"
}
],
"dependent" : [
{
"name" : "ChExtEprSectionId",
"variable" : [
"id",
"ext"
]
}
]
},
{
"name" : "title",
"source" : [
{
"context" : "src",
"element" : "title",
"variable" : "t"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "title",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "t.dataString"
}
]
}
]
},
{
"name" : "code",
"source" : [
{
"context" : "src",
"element" : "code",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "code",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "cdaText",
"source" : [
{
"context" : "src",
"element" : "text",
"variable" : "cdaText"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "text",
"variable" : "fhirText"
}
],
"rule" : [
{
"name" : "narrativeStatus",
"source" : [
{
"context" : "cdaText"
}
],
"target" : [
{
"context" : "fhirText",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "generated"
}
]
}
]
},
{
"name" : "narrativeText",
"source" : [
{
"context" : "cdaText",
"variable" : "t"
}
],
"target" : [
{
"context" : "fhirText",
"contextType" : "variable",
"element" : "div",
"transform" : "copy",
"parameter" : [
{
"valueId" : "t"
}
]
}
]
}
]
},
{
"name" : "section",
"source" : [
{
"context" : "src",
"element" : "section",
"variable" : "srcSection"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "section",
"variable" : "tgtSection"
}
],
"dependent" : [
{
"name" : "ClinicalDocumentSection",
"variable" : [
"cda",
"srcSection",
"patient",
"tgtSection",
"bundle"
]
}
]
}
]
},
{
"name" : "ClinicalDocumentComposition",
"typeMode" : "none",
"documentation" : "_________________________ Entry Level Templates ________________________ _________________________ Header Level Templates _________________________",
"input" : [
{
"name" : "src",
"type" : "ClinicalDocument",
"mode" : "source"
},
{
"name" : "tgt",
"type" : "Composition",
"mode" : "target"
},
{
"name" : "patientResource",
"type" : "Patient",
"mode" : "target"
},
{
"name" : "bundle",
"type" : "Bundle",
"mode" : "target"
}
],
"rule" : [
{
"name" : "languageCode",
"source" : [
{
"context" : "src",
"element" : "languageCode",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "language",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "identifier",
"source" : [
{
"context" : "src",
"element" : "id",
"variable" : "vvv",
"condition" : "src.setId.exists().not()"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "identifier",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "identifier",
"source" : [
{
"context" : "src",
"element" : "setId",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "identifier",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "status",
"source" : [
{
"context" : "src"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "status",
"transform" : "copy",
"parameter" : [
{
"valueString" : "final"
}
]
}
]
},
{
"name" : "code",
"source" : [
{
"context" : "src",
"element" : "code",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "type",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "title",
"source" : [
{
"context" : "src",
"element" : "title",
"variable" : "t"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "title",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "t.dataString"
}
]
}
]
},
{
"name" : "patientRole",
"source" : [
{
"context" : "src",
"element" : "recordTarget",
"variable" : "recordTarget"
}
],
"rule" : [
{
"name" : "subject",
"source" : [
{
"context" : "recordTarget",
"element" : "patientRole",
"variable" : "patient"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "subject",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'urn:uuid:' + %patientResource.id"
}
]
}
],
"dependent" : [
{
"name" : "ClinicalDocumentPatientRole",
"variable" : [
"patient",
"patientResource",
"bundle"
]
}
]
}
]
},
{
"name" : "encompassingEncounter",
"source" : [
{
"context" : "src",
"element" : "componentOf",
"variable" : "comp"
}
],
"target" : [
{
"context" : "bundle",
"contextType" : "variable",
"element" : "entry",
"variable" : "e"
},
{
"context" : "e",
"contextType" : "variable",
"element" : "resource",
"variable" : "encounter",
"transform" : "create",
"parameter" : [
{
"valueString" : "Encounter"
}
]
},
{
"context" : "encounter",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid",
"transform" : "uuid"
},
{
"context" : "e",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "urn:uuid:"
},
{
"valueId" : "uuid"
}
]
}
],
"rule" : [
{
"name" : "srcEncounter",
"source" : [
{
"context" : "comp",
"element" : "encompassingEncounter",
"variable" : "srcEnc"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "encounter",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'urn:uuid:' + %encounter.id"
}
]
}
],
"dependent" : [
{
"name" : "ClinicalDocumentEncounter",
"variable" : [
"srcEnc",
"bundle",
"encounter"
]
}
]
}
]
},
{
"name" : "effectiveTime",
"source" : [
{
"context" : "src",
"element" : "effectiveTime",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "date",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "srcAuthor",
"source" : [
{
"context" : "src",
"element" : "author",
"variable" : "srcAuthor"
}
],
"target" : [
{
"context" : "bundle",
"contextType" : "variable",
"element" : "entry",
"variable" : "e"
},
{
"context" : "e",
"contextType" : "variable",
"element" : "resource",
"variable" : "practitioner",
"transform" : "create",
"parameter" : [
{
"valueString" : "Practitioner"
}
]
},
{
"context" : "practitioner",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid2",
"transform" : "uuid"
},
{
"context" : "e",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "urn:uuid:"
},
{
"valueId" : "uuid2"
}
]
},
{
"context" : "tgt",
"contextType" : "variable",
"element" : "author",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'urn:uuid:' + %practitioner.id"
}
]
}
],
"rule" : [
{
"name" : "time",
"source" : [
{
"context" : "srcAuthor",
"element" : "time",
"variable" : "time"
}
],
"target" : [
{
"context" : "reference",
"contextType" : "variable",
"element" : "extension",
"variable" : "exttime"
}
],
"dependent" : [
{
"name" : "ChExtEprTime",
"variable" : [
"time",
"exttime"
]
}
]
},
{
"name" : "author",
"source" : [
{
"context" : "srcAuthor",
"element" : "assignedAuthor",
"variable" : "assignedAuthor"
}
],
"rule" : [
{
"name" : "id",
"source" : [
{
"context" : "assignedAuthor",
"element" : "id",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "practitioner",
"contextType" : "variable",
"element" : "identifier",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "addr",
"source" : [
{
"context" : "assignedAuthor",
"element" : "addr",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "practitioner",
"contextType" : "variable",
"element" : "address",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "telecom",
"source" : [
{
"context" : "assignedAuthor",
"element" : "telecom",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "practitioner",
"contextType" : "variable",
"element" : "telecom",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "name",
"source" : [
{
"context" : "assignedAuthor",
"element" : "assignedPerson",
"variable" : "person"
}
],
"rule" : [
{
"name" : "name",
"source" : [
{
"context" : "person",
"element" : "name",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "practitioner",
"contextType" : "variable",
"element" : "name",
"variable" : "vvv",
"transform" : "create"
}
]
}
]
},
{
"name" : "representedOrganization",
"source" : [
{
"context" : "assignedAuthor",
"element" : "representedOrganization",
"variable" : "srcOrg"
}
],
"target" : [
{
"context" : "bundle",
"contextType" : "variable",
"element" : "entry",
"variable" : "e2"
},
{
"context" : "e2",
"contextType" : "variable",
"element" : "resource",
"variable" : "organization",
"transform" : "create",
"parameter" : [
{
"valueString" : "Organization"
}
]
},
{
"context" : "organization",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid3",
"transform" : "uuid"
},
{
"context" : "e2",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "urn:uuid:"
},
{
"valueId" : "uuid3"
}
]
},
{
"context" : "tgt",
"contextType" : "variable",
"element" : "author",
"variable" : "reference2",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference2",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'urn:uuid:' + %organization.id"
}
]
}
],
"dependent" : [
{
"name" : "ClinicalDocumentOrganization",
"variable" : [
"srcOrg",
"organization"
]
}
]
}
]
}
]
},
{
"name" : "confidentialityCode",
"source" : [
{
"context" : "src",
"element" : "confidentialityCode",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "confidentiality",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "legalAuth",
"source" : [
{
"context" : "src",
"element" : "legalAuthenticator",
"variable" : "legalAuth"
}
],
"target" : [
{
"context" : "bundle",
"contextType" : "variable",
"element" : "entry",
"variable" : "e"
},
{
"context" : "e",
"contextType" : "variable",
"element" : "resource",
"variable" : "practitioner",
"transform" : "create",
"parameter" : [
{
"valueString" : "Practitioner"
}
]
},
{
"context" : "practitioner",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid2",
"transform" : "uuid"
},
{
"context" : "e",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "urn:uuid:"
},
{
"valueId" : "uuid2"
}
]
}
],
"rule" : [
{
"name" : "attester",
"source" : [
{
"context" : "legalAuth"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "attester",
"variable" : "attester"
}
],
"rule" : [
{
"name" : "mode",
"source" : [
{
"context" : "legalAuth"
}
],
"target" : [
{
"context" : "attester",
"contextType" : "variable",
"element" : "mode",
"transform" : "copy",
"parameter" : [
{
"valueString" : "legal"
}
]
}
]
},
{
"name" : "time",
"source" : [
{
"context" : "legalAuth",
"element" : "time",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "attester",
"contextType" : "variable",
"element" : "time",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "entity",
"source" : [
{
"context" : "legalAuth",
"element" : "assignedEntity",
"variable" : "entity"
}
],
"target" : [
{
"context" : "attester",
"contextType" : "variable",
"element" : "party",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'urn:uuid:' + %practitioner.id"
}
]
}
],
"dependent" : [
{
"name" : "ClinicalDocumentEntityPractitioner",
"variable" : [
"entity",
"practitioner"
]
}
]
}
]
}
]
},
{
"name" : "auth",
"source" : [
{
"context" : "src",
"element" : "authenticator",
"variable" : "auth"
}
],
"target" : [
{
"context" : "bundle",
"contextType" : "variable",
"element" : "entry",
"variable" : "e"
},
{
"context" : "e",
"contextType" : "variable",
"element" : "resource",
"variable" : "practitioner",
"transform" : "create",
"parameter" : [
{
"valueString" : "Practitioner"
}
]
},
{
"context" : "practitioner",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid2",
"transform" : "uuid"
},
{
"context" : "e",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "urn:uuid:"
},
{
"valueId" : "uuid2"
}
]
}
],
"rule" : [
{
"name" : "attester",
"source" : [
{
"context" : "auth"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "attester",
"variable" : "attester"
}
],
"rule" : [
{
"name" : "mode",
"source" : [
{
"context" : "auth"
}
],
"target" : [
{
"context" : "attester",
"contextType" : "variable",
"element" : "mode",
"transform" : "copy",
"parameter" : [
{
"valueString" : "official"
}
]
}
]
},
{
"name" : "time",
"source" : [
{
"context" : "auth",
"element" : "time",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "attester",
"contextType" : "variable",
"element" : "time",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "entity",
"source" : [
{
"context" : "auth",
"element" : "assignedEntity",
"variable" : "entity"
}
],
"target" : [
{
"context" : "attester",
"contextType" : "variable",
"element" : "party",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'urn:uuid:' + %practitioner.id"
}
]
}
],
"dependent" : [
{
"name" : "ClinicalDocumentEntityPractitioner",
"variable" : [
"entity",
"practitioner"
]
}
]
}
]
}
]
},
{
"name" : "cust",
"source" : [
{
"context" : "src",
"element" : "custodian",
"variable" : "custodian"
}
],
"target" : [
{
"context" : "bundle",
"contextType" : "variable",
"element" : "entry",
"variable" : "e"
}
],
"rule" : [
{
"name" : "custodian",
"source" : [
{
"context" : "custodian",
"element" : "assignedCustodian",
"variable" : "assignedCustodian"
}
],
"target" : [
{
"context" : "e",
"contextType" : "variable",
"element" : "resource",
"variable" : "organization",
"transform" : "create",
"parameter" : [
{
"valueString" : "Organization"
}
]
},
{
"context" : "organization",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid3",
"transform" : "uuid"
},
{
"context" : "e",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "urn:uuid:"
},
{
"valueId" : "uuid3"
}
]
}
],
"rule" : [
{
"name" : "assignedCustodian",
"source" : [
{
"context" : "assignedCustodian",
"element" : "representedCustodianOrganization",
"variable" : "srcOrg"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "custodian",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'urn:uuid:' + %organization.id"
}
]
}
],
"dependent" : [
{
"name" : "ClinicalDocumentOrganization",
"variable" : [
"srcOrg",
"organization"
]
}
]
}
]
}
]
},
{
"name" : "documentationOf",
"source" : [
{
"context" : "src",
"element" : "documentationOf",
"variable" : "docOf"
}
],
"rule" : [
{
"name" : "docOf",
"source" : [
{
"context" : "docOf",
"element" : "serviceEvent",
"variable" : "serviceEvent"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "event",
"variable" : "event"
}
],
"rule" : [
{
"name" : "eventCode",
"source" : [
{
"context" : "serviceEvent",
"element" : "code",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "event",
"contextType" : "variable",
"element" : "code",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "eventTime",
"source" : [
{
"context" : "serviceEvent",
"element" : "effectiveTime",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "event",
"contextType" : "variable",
"element" : "period",
"variable" : "vvv",
"transform" : "create"
}
]
}
]
}
]
},
{
"name" : "relatedDoc",
"source" : [
{
"context" : "src",
"element" : "relatedDocument",
"variable" : "relatedDoc"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "relatesTo",
"variable" : "relates"
}
],
"rule" : [
{
"name" : "typeCode",
"source" : [
{
"context" : "relatedDoc",
"element" : "typeCode",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "relates",
"contextType" : "variable",
"element" : "code",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "parentDoc",
"source" : [
{
"context" : "relatedDoc",
"element" : "parentDocument",
"variable" : "parentDoc"
}
],
"rule" : [
{
"name" : "setId",
"source" : [
{
"context" : "parentDoc",
"element" : "setId",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "relates",
"contextType" : "variable",
"element" : "targetIdentifier",
"variable" : "vvv",
"transform" : "create"
}
]
}
]
}
]
}
]
},
{
"name" : "ClinicalDocumentEntityPractitioner",
"typeMode" : "none",
"input" : [
{
"name" : "src",
"type" : "AssignedEntity",
"mode" : "source"
},
{
"name" : "tgt",
"type" : "Practitioner",
"mode" : "target"
}
],
"rule" : [
{
"name" : "id",
"source" : [
{
"context" : "src",
"element" : "id",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "identifier",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "addr",
"source" : [
{
"context" : "src",
"element" : "addr",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "address",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "telecom",
"source" : [
{
"context" : "src",
"element" : "telecom",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "telecom",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "name",
"source" : [
{
"context" : "src",
"element" : "assignedPerson",
"variable" : "person"
}
],
"rule" : [
{
"name" : "name",
"source" : [
{
"context" : "person",
"element" : "name",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "name",
"variable" : "vvv",
"transform" : "create"
}
]
}
]
}
]
},
{
"name" : "ClinicalDocumentOrganization",
"typeMode" : "none",
"input" : [
{
"name" : "src",
"type" : "CustodianOrganization",
"mode" : "source"
},
{
"name" : "tgt",
"type" : "Organization",
"mode" : "target"
}
],
"rule" : [
{
"name" : "id",
"source" : [
{
"context" : "src",
"element" : "id",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "identifier",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "name",
"source" : [
{
"context" : "src",
"element" : "name",
"variable" : "v"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "name",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "v.other"
}
]
}
]
},
{
"name" : "telecom",
"source" : [
{
"context" : "src",
"element" : "telecom",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "telecom",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "addr",
"source" : [
{
"context" : "src",
"element" : "addr",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "address",
"variable" : "vvv",
"transform" : "create"
}
]
}
]
},
{
"name" : "ClinicalDocumentPatientRole",
"typeMode" : "none",
"input" : [
{
"name" : "src",
"type" : "PatientRole",
"mode" : "source"
},
{
"name" : "tgt",
"type" : "Patient",
"mode" : "target"
},
{
"name" : "bundle",
"type" : "Bundle",
"mode" : "target"
}
],
"rule" : [
{
"name" : "identifier",
"source" : [
{
"context" : "src"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "identifier",
"variable" : "identifier"
}
],
"rule" : [
{
"name" : "id",
"source" : [
{
"context" : "src",
"element" : "id",
"variable" : "id"
}
],
"target" : [
{
"context" : "identifier",
"contextType" : "variable",
"element" : "type",
"variable" : "type"
},
{
"context" : "type",
"contextType" : "variable",
"element" : "coding",
"variable" : "coding"
},
{
"context" : "coding",
"contextType" : "variable",
"element" : "system",
"variable" : "system"
},
{
"context" : "coding",
"contextType" : "variable",
"element" : "code",
"variable" : "code"
}
],
"rule" : [
{
"name" : "system",
"source" : [
{
"context" : "src"
}
],
"target" : [
{
"context" : "system",
"contextType" : "variable",
"element" : "value",
"transform" : "copy",
"parameter" : [
{
"valueString" : "http://terminology.hl7.org/CodeSystem/v2-0203"
}
]
}
]
},
{
"name" : "code",
"source" : [
{
"context" : "src"
}
],
"target" : [
{
"context" : "code",
"contextType" : "variable",
"element" : "value",
"transform" : "copy",
"parameter" : [
{
"valueString" : "MR"
}
]
}
]
},
{
"name" : "extension",
"source" : [
{
"context" : "id",
"element" : "extension",
"variable" : "extension"
}
],
"target" : [
{
"context" : "identifier",
"contextType" : "variable",
"element" : "value",
"variable" : "value"
},
{
"context" : "value",
"contextType" : "variable",
"element" : "value",
"transform" : "copy",
"parameter" : [
{
"valueId" : "extension"
}
]
}
]
},
{
"name" : "root",
"source" : [
{
"context" : "id",
"element" : "root",
"variable" : "root"
}
],
"target" : [
{
"context" : "identifier",
"contextType" : "variable",
"element" : "system",
"variable" : "system"
},
{
"context" : "system",
"contextType" : "variable",
"element" : "value",
"transform" : "append",
"parameter" : [
{
"valueString" : "urn:oid:"
},
{
"valueId" : "root"
}
]
}
]
}
]
}
],
"documentation" : "src.id -> tgt.identifier;"
},
{
"name" : "addr",
"source" : [
{
"context" : "src",
"element" : "addr",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "address",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "telecom",
"source" : [
{
"context" : "src",
"element" : "telecom",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "telecom",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "patient",
"source" : [
{
"context" : "src",
"element" : "patient",
"variable" : "patient"
}
],
"rule" : [
{
"name" : "name",
"source" : [
{
"context" : "patient",
"element" : "name",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "name",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "gender",
"source" : [
{
"context" : "patient",
"element" : "administrativeGenderCode",
"variable" : "gender"
}
],
"rule" : [
{
"name" : "gender",
"source" : [
{
"context" : "gender",
"element" : "code",
"variable" : "v"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "gender",
"transform" : "translate",
"parameter" : [
{
"valueId" : "v"
},
{
"valueString" : "#cm-v3-administrative-gender"
},
{
"valueString" : "code"
}
]
}
]
}
]
},
{
"name" : "birthDate",
"source" : [
{
"context" : "patient",
"element" : "birthTime",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "birthDate",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "deceasedBL",
"source" : [
{
"context" : "patient",
"element" : "deceasedInd",
"variable" : "indicator",
"condition" : "patient.deceasedTime.empty()"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "deceased",
"variable" : "bool",
"transform" : "create",
"parameter" : [
{
"valueString" : "boolean"
}
]
}
],
"dependent" : [
{
"name" : "boolean",
"variable" : [
"indicator",
"bool"
]
}
]
},
{
"name" : "deceasedTime",
"source" : [
{
"context" : "patient",
"element" : "deceasedTime",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "deceased",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "maritalStatus",
"source" : [
{
"context" : "patient",
"element" : "maritalStatusCode",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "maritalStatus",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "language",
"source" : [
{
"context" : "patient",
"element" : "languageCommunication",
"variable" : "language"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "communication",
"variable" : "communication"
}
],
"rule" : [
{
"name" : "communication",
"source" : [
{
"context" : "language",
"element" : "languageCode",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "communication",
"contextType" : "variable",
"element" : "language",
"variable" : "vvv",
"transform" : "create"
}
]
}
]
}
]
},
{
"name" : "organization",
"source" : [
{
"context" : "src",
"element" : "providerOrganization",
"variable" : "org"
}
],
"target" : [
{
"context" : "bundle",
"contextType" : "variable",
"element" : "entry",
"variable" : "e"
},
{
"context" : "e",
"contextType" : "variable",
"element" : "resource",
"variable" : "organization",
"transform" : "create",
"parameter" : [
{
"valueString" : "Organization"
}
]
},
{
"context" : "organization",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid3",
"transform" : "uuid"
},
{
"context" : "e",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "urn:uuid:"
},
{
"valueId" : "uuid3"
}
]
}
],
"rule" : [
{
"name" : "reference",
"source" : [
{
"context" : "org"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "managingOrganization",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'urn:uuid:' + %organization.id"
}
]
}
]
},
{
"name" : "id",
"source" : [
{
"context" : "org",
"element" : "id",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "organization",
"contextType" : "variable",
"element" : "identifier",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "name",
"source" : [
{
"context" : "org",
"element" : "name",
"variable" : "v"
}
],
"target" : [
{
"context" : "organization",
"contextType" : "variable",
"element" : "name",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "v.other"
}
]
}
]
},
{
"name" : "telecom",
"source" : [
{
"context" : "org",
"element" : "telecom",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "organization",
"contextType" : "variable",
"element" : "telecom",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "addr",
"source" : [
{
"context" : "org",
"element" : "addr",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "organization",
"contextType" : "variable",
"element" : "address",
"variable" : "vvv",
"transform" : "create"
}
]
}
]
}
]
},
{
"name" : "ClinicalDocumentEncounter",
"typeMode" : "none",
"input" : [
{
"name" : "src",
"type" : "EncompassingEncounter",
"mode" : "source"
},
{
"name" : "bundle",
"type" : "Bundle",
"mode" : "target"
},
{
"name" : "tgt",
"type" : "Encounter",
"mode" : "target"
}
],
"rule" : [
{
"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" : "type",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "effectiveTime",
"source" : [
{
"context" : "src",
"element" : "effectiveTime",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "period",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "hospitalization",
"source" : [
{
"context" : "src",
"condition" : "admissionReferralSourceCode.exists() or dischargeDispositionCode.exists()"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "hospitalization",
"variable" : "hosp"
}
],
"rule" : [
{
"name" : "adminReferral",
"source" : [
{
"context" : "src",
"element" : "admissionReferralSourceCode",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "hosp",
"contextType" : "variable",
"element" : "admitSource",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "discDisposition",
"source" : [
{
"context" : "src",
"element" : "dischargeDispositionCode",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "hosp",
"contextType" : "variable",
"element" : "dischargeDisposition",
"variable" : "vvv",
"transform" : "create"
}
]
}
]
},
{
"name" : "participant",
"source" : [
{
"context" : "src",
"element" : "encounterParticipant",
"variable" : "srcPart"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "participant",
"variable" : "tgtPart"
}
],
"rule" : [
{
"name" : "typeCode",
"source" : [
{
"context" : "srcPart",
"element" : "typeCode",
"variable" : "code"
}
],
"target" : [
{
"context" : "tgtPart",
"contextType" : "variable",
"element" : "type",
"transform" : "cc",
"parameter" : [
{
"valueString" : "http://terminology.hl7.org/CodeSystem/v3-ParticipationType"
},
{
"valueId" : "code"
}
]
}
]
},
{
"name" : "time",
"source" : [
{
"context" : "srcPart",
"element" : "time",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "tgtPart",
"contextType" : "variable",
"element" : "period",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "entity",
"source" : [
{
"context" : "srcPart",
"element" : "assignedEntity",
"variable" : "entity"
}
],
"target" : [
{
"context" : "bundle",
"contextType" : "variable",
"element" : "entry",
"variable" : "e"
},
{
"context" : "e",
"contextType" : "variable",
"element" : "resource",
"variable" : "practitioner",
"transform" : "create",
"parameter" : [
{
"valueString" : "Practitioner"
}
]
},
{
"context" : "practitioner",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid2",
"transform" : "uuid"
},
{
"context" : "e",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "urn:uuid:"
},
{
"valueId" : "uuid2"
}
]
}
],
"rule" : [
{
"name" : "entry",
"source" : [
{
"context" : "entity"
}
],
"target" : [
{
"context" : "tgtPart",
"contextType" : "variable",
"element" : "individual",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'urn:uuid:' + %practitioner.id"
}
]
}
],
"dependent" : [
{
"name" : "ClinicalDocumentEntityPractitioner",
"variable" : [
"entity",
"practitioner"
]
}
]
}
]
}
]
},
{
"name" : "location",
"source" : [
{
"context" : "src",
"element" : "location",
"variable" : "srcLocation"
}
],
"rule" : [
{
"name" : "facility",
"source" : [
{
"context" : "srcLocation",
"element" : "healthCareFacility",
"variable" : "facility"
}
],
"target" : [
{
"context" : "bundle",
"contextType" : "variable",
"element" : "entry",
"variable" : "e"
},
{
"context" : "e",
"contextType" : "variable",
"element" : "resource",
"variable" : "location",
"transform" : "create",
"parameter" : [
{
"valueString" : "Location"
}
]
},
{
"context" : "location",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid2",
"transform" : "uuid"
},
{
"context" : "e",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "urn:uuid:"
},
{
"valueId" : "uuid2"
}
]
}
],
"rule" : [
{
"name" : "facLocation",
"source" : [
{
"context" : "facility"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "location",
"variable" : "tgtLocation"
},
{
"context" : "tgtLocation",
"contextType" : "variable",
"element" : "location",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'urn:uuid:' + %location.id"
}
]
}
],
"dependent" : [
{
"name" : "ClinicalDocumentLocation",
"variable" : [
"facility",
"bundle",
"location"
]
}
]
}
]
}
]
}
]
},
{
"name" : "ClinicalDocumentLocation",
"typeMode" : "none",
"input" : [
{
"name" : "src",
"type" : "HealthCareFacility",
"mode" : "source"
},
{
"name" : "bundle",
"type" : "Bundle",
"mode" : "target"
},
{
"name" : "tgt",
"type" : "Location",
"mode" : "target"
}
],
"rule" : [
{
"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" : "type",
"variable" : "vvv",
"transform" : "create"
}
]
},
{
"name" : "location",
"source" : [
{
"context" : "src",
"element" : "location",
"variable" : "location"
}
],
"rule" : [
{
"name" : "addr",
"source" : [
{
"context" : "location",
"element" : "addr",
"variable" : "vvv"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "address",
"variable" : "vvv",
"transform" : "create"
}
],
"documentation" : "place names are usually stored with no parts location.name as srcName -> tgt.name = cast(srcName, 'string');"
},
{
"name" : "org",
"source" : [
{
"context" : "location",
"element" : "serviceProviderOrganization",
"variable" : "srcOrg"
}
],
"target" : [
{
"context" : "bundle",
"contextType" : "variable",
"element" : "entry",
"variable" : "e"
},
{
"context" : "e",
"contextType" : "variable",
"element" : "resource",
"variable" : "organization",
"transform" : "create",
"parameter" : [
{
"valueString" : "Organization"
}
]
},
{
"context" : "organization",
"contextType" : "variable",
"element" : "id",
"variable" : "uuid3",
"transform" : "uuid"
},
{
"context" : "e",
"contextType" : "variable",
"element" : "fullUrl",
"transform" : "append",
"parameter" : [
{
"valueString" : "urn:uuid:"
},
{
"valueId" : "uuid3"
}
]
}
],
"rule" : [
{
"name" : "organization",
"source" : [
{
"context" : "srcOrg"
}
],
"target" : [
{
"context" : "tgt",
"contextType" : "variable",
"element" : "managingOrganization",
"variable" : "reference",
"transform" : "create",
"parameter" : [
{
"valueString" : "Reference"
}
]
},
{
"context" : "reference",
"contextType" : "variable",
"element" : "reference",
"transform" : "evaluate",
"parameter" : [
{
"valueString" : "'urn:uuid:' + %organization.id"
}
]
}
],
"dependent" : [
{
"name" : "ClinicalDocumentOrganization",
"variable" : [
"srcOrg",
"organization"
]
}
]
}
]
}
]
}
]
},
{
"name" : "ChExtEprTime",
"typeMode" : "none",
"documentation" : "source dataEnterer: https://art-decor.org/art-decor/decor-templates--hl7chcda-?id=2.16.756.5.30.1.1.10.2.7 source author: https://art-decor.org/art-decor/decor-templates--hl7chcda-?id=2.16.840.1.113883.10.12.102 target: https://build.fhir.org/ig/hl7ch/ch-core//StructureDefinition-ch-ext-epr-time.html",
"input" : [
{
"name" : "src",
"type" : "TSDateTime",
"mode" : "source"
},
{
"name" : "ext",
"type" : "Extension",
"mode" : "target"
}
],
"rule" : [
{
"name" : "url",
"source" : [
{
"context" : "src"
}
],
"target" : [
{
"context" : "ext",
"contextType" : "variable",
"element" : "url",
"transform" : "copy",
"parameter" : [
{
"valueString" : "http://fhir.ch/ig/ch-core/StructureDefinition/ch-ext-epr-time"
}
]
}
]
},
{
"name" : "value",
"source" : [
{
"context" : "src"
}
],
"target" : [
{
"context" : "ext",
"contextType" : "variable",
"element" : "value",
"variable" : "value",
"transform" : "create",
"parameter" : [
{
"valueString" : "dateTime"
}
]
}
],
"dependent" : [
{
"name" : "TSDateTime",
"variable" : [
"src",
"value"
]
}
]
}
]
},
{
"name" : "ChExtEprSectionId",
"typeMode" : "none",
"documentation" : "https://art-decor.org/art-decor/decor-templates--hl7chcda-?id=2.16.756.5.30.1.1.10.3.45 target: http://build.fhir.org/ig/hl7ch/ch-core/branches/master/StructureDefinition-ch-ext-epr-sectionid.html",
"input" : [
{
"name" : "src",
"type" : "II",
"mode" : "source"
},
{
"name" : "ext",
"type" : "Extension",
"mode" : "target"
}
],
"rule" : [
{
"name" : "url",
"source" : [
{
"context" : "src"
}
],
"target" : [
{
"context" : "ext",
"contextType" : "variable",
"element" : "url",
"transform" : "copy",
"parameter" : [
{
"valueString" : "http://fhir.ch/ig/ch-core/StructureDefinition/ch-ext-epr-sectionid"
}
]
}
]
},
{
"name" : "value",
"source" : [
{
"context" : "src"
}
],
"target" : [
{
"context" : "ext",
"contextType" : "variable",
"element" : "value",
"variable" : "value",
"transform" : "create",
"parameter" : [
{
"valueString" : "Identifier"
}
]
}
],
"dependent" : [
{
"name" : "II",
"variable" : [
"src",
"value"
]
}
]
}
]
},
{
"name" : "NarrativeLink",
"typeMode" : "none",
"documentation" : "_________________________ Template Type not specified ___________________",
"input" : [
{
"name" : "url",
"mode" : "source"
},
{
"name" : "ext",
"type" : "Extension",
"mode" : "target"
}
],
"rule" : [
{
"name" : "url",
"source" : [
{
"context" : "url"
}
],
"target" : [
{
"context" : "ext",
"contextType" : "variable",
"element" : "url",
"transform" : "copy",
"parameter" : [
{
"valueString" : "http://hl7.org/fhir/StructureDefinition/narrativeLink"
}
]
}
]
},
{
"name" : "value",
"source" : [
{
"context" : "url"
}
],
"target" : [
{
"context" : "ext",
"contextType" : "variable",
"element" : "value",
"variable" : "value",
"transform" : "create",
"parameter" : [
{
"valueString" : "url"
}
]
},
{
"context" : "value",
"contextType" : "variable",
"element" : "value",
"transform" : "copy",
"parameter" : [
{
"valueId" : "url"
}
]
}
]
}
]
}
]
}