C-CDA to FHIR System API - Implementation Template

(0 reviews)

Developer guide

This document provides information generated from the DataWeave scripts included in the project, such as function definitions, variable definitions, and data mapping tables. It can be used by developers seeking a solution to convert C-CDA XML-based objects to FHIR R4 JSON.

C-CDA Document List

The table provided below includes the C-CDA document type (eg. Continuity of Care or CCD) and the corresponding CDA sections that can be reused across various FHIR conversion requirements.

DocumentDescription
Continuity Of CareThe Continuity of Care Document (CCD) represents a core data set of the most relevant administrative, demographic, and clinical information facts about a patient's healthcare, covering one or more healthcare encounters.
Supported Sections:
Allergies and Intolerances, Medications, Problem, Procedures, Results, Advanced Directives, Encounters, Family History, Functional Status, Immunization, Medical Equipment, Payers, Plan of Treatment, Social History, Vital Signs, Mental Status, Nutrition
Discharge SummaryThe Discharge Summary is a document which synopsizes a patient's admission to a hospital, LTPAC provider, or other setting. It provides information for the continuation of care following discharge.
Supported Sections:
Allergies and Intolerances, Discharge Diagnosis, Discharge Medications, Plan of Treatment, Nutrition, Family History, Functional Status, Admission Diagnosis, Admission Medications, Immunization, Problem, Procedures, Social History, Vital Signs
Consultation NoteThe Consultation Note is generated by a request from a clinician for an opinion or advice from another clinician. Consultations may involve face-to-face time with the patient or may fall under the auspices of telemedicine visits.
Supported Sections:
Allergies and Intolerances, Problem, Family History, Immunization, Medications, Procedures, Results, Social History, Vital Signs, Functional Status, Medical Equipment, Advanced Directives, Mental Status, Nutrition, Plan of Treatment
History and PhysicalA History and Physical (H&P) note is a medical report that documents the current and past conditions of the patient. It contains essential information that helps determine an individual’s health status.
Supported Sections:
Allergies and Intolerances, Family History, Medications, Results, Social History, Vital Signs, Immunization, Problem, Procedures, Plan of Treatment, Advanced Directives
Operative NoteThe Operative Note is a frequently used type of procedure note with specific requirements set forth by regulatory agencies. The Operative Note is created immediately following a surgical or other high-risk procedure.
Supported Sections:
Procedure Anesthesia, Complications, Procedure Findings, Preoperative Diagnosis, Postoperative Diagnosis, Plan of Treatment
Progress NoteProgress Note represents a patients clinical status during a hospitalization, outpatient visit, treatment with a LTPAC provider, or other healthcare encounter. It also defines as an ongoing record of a patient's illness and treatment.
Supported Sections:
Allergies and Intolerances, Medications, Problem, Results, Vital Signs, Nutrition, Plan of Treatment, Advanced Directives
Procedure NoteA Procedure Note encompasses many types of non-operative procedures including interventional cardiology, gastrointestinal endoscopy, osteopathic manipulation, and many other specialty fields. Procedure Notes are differentiated from Operative Notes because they do not involve incision or excision as the primary act.
Supported Sections:
Allergies and Intolerances, Family History, Medications, Procedures, Social History, Complications, Postprocedure Diagnosis, Procedure Indications, Procedure Findings, Procedure Anesthesia
Referral NoteA Referral Note communicates pertinent information from a provider who is requesting services of another provider of clinical or non-clinical services. The information in this document includes the reason for the referral and additional information that would augment decision making and care delivery.
Supported Sections:
Reason for Referral, Problem, Allergies and Intolerances, Medications, Family History, Immunization, Procedures, Results, Social History, Vital Signs, Functional Status, Medical Equipment, Advanced Directives, Mental Status, Nutrition
Transfer SummaryThe Transfer Summary standardizes critical information for exchange of information between providers of care when a patient moves between health care settings.
Supported Sections:
Advanced Directives, Allergies and Intolerances, Encounters, Family History, Functional Status, Discharge Diagnosis, Immunization, Medical Equipment, Medications, Payers, Plan of Treatment, Problem, Procedures, Results, Social History, Vital Signs, Mental Status, Nutrition, Admission Diagnosis, Admission Medications, Reason for Referral
Unstructured DocumentAn Unstructured Document document type can (1) include unstructured content, such as a graphic, directly in a text element with a mediaType attribute, or (2) reference a single document file, such as a word-processing document using a text/reference element.
Supported Sections:
N/A

convert-admissiondiagnosis-to-fhir

Converts Admission Diagnosis section from C-CDA to FHIR R4 JSON.
Produces the following FHIR R4 Resources:
Condition

Source: .src/main/resources/dwl/fhirUtil/cdaSection/convert-admissiondiagnosis-to-fhir.dwl

Functions

fun getCdaAdmissionDiagnosis (payload)

Gets a list of C-CDA admission diagnosis objects from the input payload.

param payload is the input XML CDA request.
return A list of C-CDA admission diagnosis objects or an empty list.

fun getCdaAdmissionDiagnosisEntries (cdaAdmissionDiagnosis)

Gets a filtered list of C-CDA admission diagnostic entries.

param cdaAdmissionDiagnosis is a list of C-CDA entries.
return A filtered list of C-CDA admission diagnosis entries or an empty list.

fun buildAdmissionDiagnosisObservations (cdaAdmissionDiagnosisEntries, patientId, practitionersList)

Builds a list of admission diagnosis FHIR Observation objects.

param cdaAdmissionDiagnosisEntries is a filtered list of C-CDA admission diagnosis entries.
param patientId is a string with the patient ID.
param practitionersList is a list of practitioners set as vars.practitionersList.

(back to top)

convert-admissionmedications-to-fhir

Converts Admission Medications section from C-CDA to FHIR R4 JSON.
Produces the following FHIR R4 Resources:
Medication
MedicationRequest
MedicationDispense
MedicationStatement

Source: .src/main/resources/dwl/fhirUtil/cdaSection/convert-admissionmedications-to-fhir.dwl

Functions

fun getCdaMedicationSections (payload)

Gets a list of C-CDA medication sections from the input payload.

param payload is the input XML CDA request.
return A list of C-CDA medication sections or an empty list.

fun buildMedication (cdaMedicationSections)

Builds a list of FHIR formatted Medication objects.

param cdaMedicationSections is a list of C-CDA medication sections.
return A FHIR formatted list of Medication objects or an empty list.

fun buildMedicationRequest (cdaMedicationSections, patientId, practitionersList)

Builds a list of FHIR formatted MedicationRequest objects.

param cdaMedicationSections is a list of C-CDA medication sections.
param patientId is a string with the patient ID.
param practitionersList is a list of Practitioners set in the vars.practitionersList variable.
return A FHIR formatted list of MedicationRequest objects or an empty list.

fun buildMedicationDispence (cdaMedicationSections, patientId, medicationRequest, practitionersList)

Builds a list of FHIR formatted MedicationDispence objects.

param cdaMedicationSections is a list of C-CDA medication sections.
param patientId is a string with the patient ID.
param medicationRequest is a list of FHIR formatted MedicationRequest objects.
param practitionersList is a list of Practitioners set in the vars.practitionersList variable.
return A FHIR formatted list of MedicationDispence objects or an empty list.

fun buildMedicationStatement (cdaMedicationSections, patientId, medicationRequest, medicationDispense)

Builds a list of FHIR formatted MedicationStatement objects.

param cdaMedicationSections is a list of C-CDA medication sections.
param patientId is a string with the patient ID.
param medicationRequest is a list of FHIR formatted MedicationRequest objects.
param medicationDispense is a list of FHIR formatted MedicationDispense objects.
return A FHIR formatted list of MedicationStatement objects or an empty list.

(back to top)

convert-advanceddirective-to-fhir

Converts Advanced Directives section from C-CDA to FHIR R4 JSON.
Produces the following FHIR R4 Resources:
Consent
DocumentReference
Practitioner

Source: .src/main/resources/dwl/fhirUtil/cdaSection/convert-advanceddirective-to-fhir.dwl

(back to top)

convert-allergyintolerance-to-fhir

Converts Allergy Intolerance section from C-CDA to FHIR R4 JSON.
Produces the following FHIR R4 Resources:
AllergyIntolerance
ClinicalImpression
Practitioner

Source: .src/main/resources/dwl/fhirUtil/cdaSection/convert-allergyintolerance-to-fhir.dwl

Functions

fun buildClinicalImpressions (clinicalImpressions, patientId, practitionersList, allergyList)

Builds the ClinicalImpression FHIR objects and returns them as a list.

param clinicalImpressions is a list of clinical impression C-CDA objects.
param patientId is a string with the patient ID.
param practitionersList is a list of the C-CDA practitioners.
param allergyList is a list of FHIR formatted AllergyIntolerance objects.
return A list of FHIR formatted ClinicalImpressions objects.

fun buildAllergies (clinicalImpressions, patientId, practitionersList)

Builds the allergy FHIR objects and returns them as a list.

param clinicalImpressions is a list of clinical impression C-CDA objects.
param patientId is a string with the patient ID.
param practitionersList is a list of the C-CDA practitioners.
return A list of FHIR formatted AllergyIntolerance objects.

fun getAllergies (ClinicalImpressions)

Gets a list of allergy objects with the provided list of clinical impressions. Uses getEntryRelationshipResource function from cdaToFHIRTools

param ClinicalImpressions is a list of clinical impression objects.
return A list of allergy objects or empty list.

fun getClinicalImpressions (payload)

Gets the clinical impressions with the provided payload. Uses getEntrySection function from cdaToFHIRTools

param payload is the input XML CDA request.
return A list of clinical impressions or an empty list.

(back to top)

convert-complication-to-fhir

Converts Complication section from C-CDA to FHIR R4 JSON.
Produces the following FHIR R4 Resources:
Condition

Source: .src/main/resources/dwl/fhirUtil/cdaSection/convert-complication-to-fhir.dwl

Functions

fun getComplicationSection (payload)

Gets a list of C-CDA complication objects.

param payload is the input XML CDA request.
return A list of C-CDA complication objects or an empty list.

fun getComplicationEntries (complicationSection)

Gets a filtered list of C-CDA complication entries.

param complicationSection is a list of C-CDA complication objects.
return A filtered list of C-CDA complication entries.

fun buildComplicationConditions (complicationEntries, patientId, practitionersList)

Builds a list of FHIR formatted Condition objects.

param complicationEntries is a filtered list of C-CDA complication entries.
param patientId is a string with the patient ID.
param practitionersList is a list of practitioners set as vars.practitionersList.
return A list of FHIR formatted Condition objects or an empty list.

(back to top)

convert-dischargediagnosis-to-fhir

Converts Discharge Diagnosis section from C-CDA to FHIR R4 JSON.
Produces the following FHIR R4 Resources:
Condition

Source: .src/main/resources/dwl/fhirUtil/cdaSection/convert-dischargediagnosis-to-fhir.dwl

Functions

fun getCdaDischargeDiagnosis (payload)

Gets a list of C-CDA discharge diagnosis objects.

param payload is the input XML CDA request.
return A list of C-CDA discharge diagnosis objects or an empty list.

fun getCdaDischargeDiagnosisEntries (cdaDischargeDiagnosis)

Gets a filtered list of C-CDA discharge diagnosis entries.

param cdaDischargeDiagnosis is a list of C-CDA discharge diagnosis objects.
return A filtered list of C-CDA discharge diagnosis entries.

fun buildDischargeDiagnosisCondition (cdaDischargeDiagnosisEntries, patientId, practitionersList)

Builds a list of FHIR formatted Condition objects.

param cdaDischargeDiagnosisEntries is a filtered list of C-CDA discharge diagnosis entries.
param patientId is a string with the patient ID.
param practitionersList is a list of practitioners set as vars.practitionersList.
return A list of FHIR formatted Condition objects or an empty list.

(back to top)

convert-dischargemedications-to-fhir

Converts Discharge Medications section from C-CDA to FHIR R4 JSON.
Produces the following FHIR R4 Resources:
Condition
Practitioner
Medication
MedicationDispense
MedicationAdministration
Organization

Source: .src/main/resources/dwl/fhirUtil/cdaSection/convert-dischargemedications-to-fhir.dwl

Functions

fun getCdaMedications (payload)

Gets a list of C-CDA medication objects.

param payload is the input XML CDA request.
return A list of C-CDA medication objects or an empty list.

fun getCdaMedicationsEntries (cdaDischargeMedications)

Filters and returns a list of C-CDA medication entries.

param cdaDischargeMedications is a list of C-CDA medication objects to filter.
return A filtered list of C-CDA medication entries or an empty list.

fun buildDischargeOrganization (cdaDischargeMedicationsEntries)

Builds a list of FHIR formatted discharge Organization objects.

param cdaDischargeMedicationsEntries is a list of C-CDA discharge medication entries.
return A list of FHIR formatted Organization objects or an empty list.

fun buildDischargeMedication (cdaDischargeMedicationsEntries)

Builds a list of FHIR formatted discharge Medication objects.

param cdaDischargeMedicationsEntries is a list of C-CDA discharge medication entries.
return A list of FHIR formatted Medication objects or an empty list.

fun buildDischargeMedicationAdministration (cdaDischargeMedicationsEntries, patientId, dischargeMedicationIds)

Builds a list of FHIR formatted discharge MedicationAdministration objects.

param cdaDischargeMedicationsEntries is a list of C-CDA discharge medication entries.
param patientId is a string with the patient ID.
param dischargeMedicationIds is a list of discharge medication IDs.
return A list of FHIR formatted MedicationAdministration objects or an empty list.

fun buildDischargeMedicationCondition (cdaDischargeMedicationsEntries, patientId, practitionersList)

Builds a list of FHIR formatted discharge medication Condition objects.

param cdaDischargeMedicationsEntries is a list of C-CDA discharge medication entries.
param patientId is a string with the patient ID.
param practitionersList is a list of practitioners set as vars.practitionersList.
return A list of FHIR formatted medication Condition objects or an empty list.

fun buildDischargeMedicationDispensePractitioner (cdaDischargeMedicationsEntries)

Builds a list of FHIR formatted discharge medication dispense Practitioner objects.

param cdaDischargeMedicationsEntries is a list of C-CDA discharge medication entries.
return A list of FHIR formatted discharge medication dispense Practitioner objects or an empty list.

fun buildDischargeMedicationDispense (cdaDischargeMedicationsEntries, patientId, dischargeMedicationIds, dischargeMedicationDispensePractitionersIds)

Builds a list of FHIR formatted discharge MedicationDispense objects.

param cdaDischargeMedicationsEntries is a list of C-CDA discharge medication entries.
param patientId is a string with the patient ID.
param dischargeMedicationIds is a list of discharge medication IDs.
param dischargeMedicationDispensePractitionersIds is a list of discharge medication dispense practitioner IDs.
return A list of FHIR formatted discharge MedicationDispense objects or an empty list.

(back to top)

convert-encounter-to-fhir

Converts Encounters section from C-CDA to FHIR R4 JSON.
Produces the following FHIR R4 Resources:
Practitioner
Encounter
Location

Source: .src/main/resources/dwl/fhirUtil/cdaSection/convert-encounter-to-fhir.dwl

Functions

fun getEncounters (payload)

Gets a list of C-CDA encounter objects with the provided payload.

param payload is the input CDA XML request.
return A list of C-CDA encounter objects or an empty array.

fun buildLocations (cdaEncounters)

Builds a list of FHIR formatted Location objects with the provided list of encounters and location ID.

param cdaEncounters is a list of C-CDA encounter objects.
return A list of FHIR formatted Location objects or a blank list.

fun buildEncounters (cdaEncounters, patientId, locId, practitionerList)

Builds a list of FHIR formatted Encounter objects with the provided arguments.

param cdaEncounters is a list of C-CDA encounter objects.
param patientId is a string with the patient ID.
param locId is a string with the location ID.
param practitionersList is a list of practitioners.
return a list of FHIR formatted Encounter objects or an empty list.

(back to top)

convert-familyhistory-to-fhir

Converts Family History section from C-CDA to FHIR R4 JSON.
Produces the following FHIR R4 Resources:
FamilyHistory

Source: .src/main/resources/dwl/fhirUtil/cdaSection/convert-familyhistory-to-fhir.dwl

Functions

fun buildFamilyHistory (familyHistoryList, fhirFamHistConstants, patientId)

Function to build a list of FamilyHistory FHIR R4 resources using input C-CDA Family History section. Uses getEntrySection from cdaToFHIRTools.

param familyHistoryList is a list of family history organizer objects.
param fhirFamHistConstants is a list of constants used to in FHIR R4 mapping.
param patientId is the id of the patient.
return An array of FHIR R4 FamilyHistory resources.

(back to top)

convert-functionalstatus-to-fhir

Converts Functional Status section from C-CDA to FHIR R4 JSON.
Produces the following FHIR R4 Resources:
Observation
DeviceUseStatement

Source: .src/main/resources/dwl/fhirUtil/cdaSection/convert-functionalstatus-to-fhir.dwl

Functions

fun getCdaFunctionalStatus (payload)

Gets a list of C-CDA functional status objects with the provided payload.

param payload is the input XML CDA request.
return A list of C-CDA functional status objects or an empty list.

fun getCdaFunctionalStatusOrganizer (cdaFunctionalStatus)

Gets a list of C-CDA functional status organizer objects with the provided list of C-CDA functional status objects.

param cdaFunctionalStatus is a list of C-CDA functional status objects.
return A list of C-CDA functional status organizer objects or empty list.

fun buildFunctionalObservations (functionalStatusOrganizer, patientId, perfRefList)

Builds a list of FHIR functional Observation objects with the provided functional status organizer list and patient ID.

param functionalStatusOrganizer is a C-CDA functional status organizer list of objects.
param patientId is a string with the patient ID.
return A list of FHIR formatted Observation objects or an empty list.

fun buildSelfCareObservations (functionalStatusOrganizer, patientId, perfRefList)

Builds a list of FHIR self care Observation objects with the provided functional status organizer list and patient ID.

param functionalStatusOrganizer is a C-CDA functional status organizer list of objects.
param patientId is a string with the patient ID.
return A list of FHIR formatted Observation objects or an empty list.

fun buildSensoryObservations (cdaFunctionalStatus, patientId, perfRefList)

Builds a list of FHIR sensory Observation objects with the provided functional status list and patient ID.

param cdaFunctionalStatus is a C-CDA functional status list of objects.
param patientId is a string with the patient ID.
return A list of FHIR formatted Observation objects or an empty list.

fun buildAssessmentScaleObservations (cdaFunctionalStatus, patientId, perfRefList)

Builds a list of FHIR assessment scale Observation objects with the provided functional status list and patient ID.

param cdaFunctionalStatus is a C-CDA functional status list of objects.
param patientId is a string with the patient ID.
return A list of FHIR formatted Observation objects or an empty list.

fun buildProblemObservations (cdaFunctionalStatus, patientId, perfRefList)

Builds a list of FHIR problem Observation objects with the provided functional status list and patient ID.

param cdaFunctionalStatus is a C-CDA functional status list of objects.
param patientId is a string with the patient ID.
return A list of FHIR formatted Observation objects or an empty list.

fun buildNonMedDeviceSupply (cdaFunctionalStatus, patientId)

Builds a list of FHIR non medical device supply DeviceUseStatment objects with the provided functional status list and patient ID.

param cdaFunctionalStatus is a C-CDA functional status list of objects.
param patientId is a string with the patient ID.
return A list of FHIR formatted Observation objects or an empty list.

fun buildCareGiverCharObservations (cdaFunctionalStatus, patientId, perfRefList)

Builds a list of FHIR care giver Observation objects with the provided functional status list and patient ID.

param cdaFunctionalStatus is a C-CDA functional status list of objects.
param patientId is a string with the patient ID.
return A list of FHIR formatted Observation objects or an empty list.

(back to top)

convert-immunization-to-fhir

Converts Immunization section from C-CDA to FHIR R4 JSON.
Produces the following FHIR R4 Resources:
Practitioner
Immunization

Source: .src/main/resources/dwl/fhirUtil/cdaSection/convert-immunization-to-fhir.dwl

Functions

fun getCdaImmunizations (payload)

Gets a list of C-CDA immunization objects with the provided payload.

param payload is the input XML CDA request.
return A list of C-CDA immunization objects or an empty array.

fun buildImmunizations (cdaImmunizations, patientId, performersList)

Builds a list of FHIR formatted Immunization objects with the provided list of C-CDA immunization objects.

param cdaImmunizations is a list of C-CDA immunization objects.
param patientId is a string with the patient ID.
param performersList is the list of performers.
return A list of FHIR formatted Immunization objects or an empty list.

(back to top)

convert-medicalequipment-to-fhir

Converts Medical Equipment section from C-CDA to FHIR R4 JSON.
Produces the following FHIR R4 Resources:
Practitioner
Device
Organization
Procedure

Source: .src/main/resources/dwl/fhirUtil/cdaSection/convert-medicalequipment-to-fhir.dwl

Functions

fun buildMedicalEquipment (payload, templateId)

Build the MedicalEquipment Section FHIR objects and returns them as a list.

param payload is input XML CDA request.
param templateId is the Template ID.
return A list of MedicalEquipment Section or an empty list.

fun buildMedicalEquipmentOrganizer (medicalEquipment, templateId)

Build the MedicalEquipmentOrganizer FHIR objects and returns them as a list.

param medicalEquipment is a list of MedicalEquipment C-CDA objects.
param templateId is the Template ID.
return A list of MedicalEquipmentOrganizer list or an empty list.

fun buildNonMedicalSupply (medicalEquipment, templateId)

Build the NonMedicalSupply FHIR objects and returns them as a list.

param medicalEquipment is a list of MedicalEquipment C-CDA objects.
param templateId is the Template ID.
return A list of NonMedicalSupply list or an empty list.

fun buildSupplyResources (medicalEquipmentOrganizer, nonMedicalSupply)

Build the SupplyResources FHIR objects and returns them as a list.

param medicalEquipmentOrganizer is a list of medicalEquipmentOrganizer C-CDA objects.
param nonMedicalSupply is a list of nonMedicalSupply C-CDA objects.
return A list of SupplyResources list or an empty list.

fun buildDeviceList (supplyResources)

Build the DeviceIds FHIR objects and returns them as a list.

param supplyResources is a list of Supply Resources C-CDA objects.
return A list of Device list or an empty list.

fun buildMedicalEquipProcedureList (medicalEquipment)

Build the MedicalEquipProcedure list FHIR objects and returns them as a list.

param medicalEquipment is a list of Supply Resources C-CDA objects.
return A list of MedicalEquipProcedure list or an empty list.

fun buildMedEquipPerformers (medicalEquipProcedureList)

Build the MedEquipPerformers list FHIR objects and returns them as a list.

param medicalEquipProcedureList is a list of Supply Resources C-CDA objects.
return A list of MedEquipPerformers list or an empty list.

fun buildMedEquipPerformersList (medEquipPerformers)

Build the MedEquipPerformers list FHIR objects and returns them as a list.

param medEquipPerformers is a list of Supply Resources C-CDA objects.
return A list of MedEquipPerformers list or an empty list.

fun buildMedEquipProcedure (medicalEquipProcedureList)

Build the Medical Equipment Procedure list FHIR objects and returns them as a list.

param medicalEquipProcedureList is a list of Supply Resources C-CDA objects.
return A list of Medical Equipment Procedure list or an empty list.

(back to top)

convert-medication-section-to-fhir

Converts Medications section from C-CDA to FHIR R4 JSON.
Produces the following FHIR R4 Resources:
Medication
MedicationRequest
MedicationDispense
MedicationStatement

Source: .src/main/resources/dwl/fhirUtil/cdaSection/convert-medication-section-to-fhir.dwl

Functions

fun getCdaMedicationSections (payload)

Gets a list of C-CDA medication sections.

param payload is the input XML CDA request.
return A list of C-CDA medication sections or an empty list.

fun buildMedication (cdaMedicationSections)

Builds a FHIR formatted list of Medication objects.

param cdaMedicationSections is a list of C-CDA medication objects.
return A FHIR formatted list of Medication objects or an empty list.

fun buildMedicationRequest (cdaMedicationSections, patientId, medications, practitionersList)

Builds a list of FHIR formatted MedicationRequest objects.

param cdaMedicationSections is a list of C-CDA medication sections.
param patientId is a string with the patient ID.
param practitionersList is a list of Practitioners set in the vars.practitionersList variable.
return A FHIR formatted list of MedicationRequest objects or an empty list.

fun buildMedicationDispense (cdaMedicationSections, patientId, medicationRequest, practitionersList)

Builds a list of FHIR formatted MedicationDispence objects.

param cdaMedicationSections is a list of C-CDA medication sections.
param patientId is a string with the patient ID.
param medicationRequest is a list of FHIR formatted MedicationRequest objects.
param practitionersList is a list of Practitioners set in the vars.practitionersList variable.
return A FHIR formatted list of MedicationDispence objects or an empty list.

fun buildMedicationStatement (cdaMedicationSections, patientId, medicationRequest, medicationDispense)

Builds a list of FHIR formatted MedicationStatement objects.

param cdaMedicationSections is a list of C-CDA medication sections.
param patientId is a string with the patient ID.
param medicationRequest is a list of FHIR formatted MedicationRequest objects.
param medicationDispense is a list of FHIR formatted MedicationDispense objects.
return A FHIR formatted list of MedicationStatement objects or an empty list.

(back to top)

convert-mentalhealth-to-fhir

Converts Mental Health section from C-CDA to FHIR R4 JSON.
Produces the following FHIR R4 Resources:
Observation

Source: .src/main/resources/dwl/fhirUtil/cdaSection/convert-mentalhealth-to-fhir.dwl

Functions

fun getCdaMentalStatusEntries (payload)

Gets a list of C-CDA mental status entries objects with the provided payload.

param payload is the input XML CDA request.
return A list of C-CDA mental status entries objects or an empty list.

fun getCdaAssessmentObservations (cdaMentalStatusEntries)

Gets a list of C-CDA assessment observation objects with the provided payload.

param cdaMentalStatusEntries is a list of C-CDA mental status entries.
return A list of C-CDA assessment observation objects or an empty list.

fun buildAssessmentObservation (cdaAssessmentObservations, patientId, perfRefList)

Builds a list of FHIR formatted assessment Observation objects.

param cdaAssessmentObservations is a list of C-CDA assessment observation objects.
param patientId is a string with the patient ID.
return A list of FHIR formatted assessment Observation objects or an empty list.

fun getCdaMentalStatusObservations (cdaMentalStatusEntries)

Gets a list of C-CDA mental status observation objects with the provided payload.

param cdaMentalStatusEntries is a list of C-CDA mental status entries.
return A list of C-CDA mental status observation objects or an empty list.

fun buildMentalStatusObservation (cdaMentalStatusObservations, patientId, perfRefList)

Builds a list of FHIR formatted mental status Observation objects.

param cdaMentalStatusObservations is a list of C-CDA mental status observation objects.
param patientId is a string with the patient ID.
return A list of FHIR formatted mental status Observation objects or an empty list.

(back to top)

convert-nutrition-to-fhir

Converts Nutrition section from C-CDA to FHIR R4 JSON.
Produces the following FHIR R4 Resources:
Observation

Source: .src/main/resources/dwl/fhirUtil/cdaSection/convert-nutrition-to-fhir.dwl

Functions

fun getCdaNutritionSections (payload)

Gets a list of C-CDA nutrition section objects.

param payload is the input XML CDA request.
return A list of C-CDA nutrition section objects or an empty list.

fun getCdaNutritionObservations (cdaNutritionSections)

Gets a list of C-CDA nutrition observation objects.

param cdaNutritionSections is a list of C-CDA nutrition section objects.
return A list of C-CDA nutrition observation objects or an empty list.

fun getCdaNutritionAssessments (cdaNutritionObservations)

Gets a list of C-CDA nutrition assessment objects.

param cdaNutritionSections is a list of C-CDA nutrition section objects.
return A list of C-CDA nutrition assessment objects or an empty array.

fun buildNutritionObservations (cdaNutritionAssessments, patientId, perfRefList)

Gets a list of FHIR formatted nutrition Observation objects with the provided C-CDA nutrition assessments.

param cdaNutritionAssessments is a list of C-CDA nutrition assessment objects.
param patientId is a string with the patient ID.
return A list of FHIR formatted nutrition Observation objects or an empty list.

(back to top)

convert-payer-to-fhir

Converts Payers section from C-CDA to FHIR R4 JSON.
Produces the following FHIR R4 Resources:
Organization
Coverage

Source: .src/main/resources/dwl/fhirUtil/cdaSection/convert-payer-to-fhir.dwl

Functions

fun getPayersSection (payload)

Gets payer org and from within that, fetch payers and coverage with the provided payload.

param payload is the input XML CDA request.
return A array of payers and coverage or empty array.

fun getCoverage (payersSection)

Gets the coverage with the payer org.

param payersSection is payers and coverage with the provided payload.
return A list of coverage or an empty list.

fun getPolicy (coverage)

Gets the policy with the payer org.

param coverage is policy that covers in payer org.
return A list of coverage or an empty list.

fun buildPayers (payersSection)

Creates the list of organizations with the payer org.

param payersSection is payers and coverage with the provided payload.
return A list of organizations or an empty list.

fun buildPolicy (policy)

Creates the list of coverage with the payer org.

param payersSection is payers and coverage with the provided payload.
return A list of coverage or an empty list.

fun getPayerIds (payers)

Gets the payer id's with the payer org.

param payers is list of payers in payer org.
return A list of payer id's or empty list.

(back to top)

convert-planoftreatment-to-fhir

Converts Plan of Treatment section from C-CDA to FHIR R4 JSON.
Produces the following FHIR R4 Resources:
Practitioner
Goal
ServiceRequest
MedicationRequest

Source: .src/main/resources/dwl/fhirUtil/cdaSection/convert-planoftreatment-to-fhir.dwl

Variables

var planSection

Filter payload to fetch various plan section subsets.

Functions

fun getPlanSectionAuthors (plannedObsrv, plannedEncounter, planActs, planProcs, planMedAct, planSupply, planImmAct, planNutritionSect, planGoalObsrv)

Function to extract authors from all planed action sections.

param plannedObsrv is the list of planned observation.
param plannedEncounter is the list of planned encounters.
param planActs is the list of planned acts.
param planProcs is the list of planned procedures.
param planMedAct is the list of planned medication activity.
param planSupply is the list of planned supply.
param planImmAct is the list of planned immunization activity.
param planNutritionSect is the list of planned nutrition recommendation.
param planGoalObsrv is the list of planned goal observation.

fun buildServRequests (servList, fhirServConstants, patientId, refList)

Function to build FHIR R4 Service Requests from Plan of Treatment Section. Uses createServiceRequest function.

param servList is a list of C-CDA format service requests.
param fhirServConstants is a list of constants used for mapping.
param patientId is the patient's Id.
param refList is a list of practitioner references for author mapping.
return An array of FHIR formatted Service Requests List.

fun buildPlannedMedicationRequests (medReqList, fhirMedConstants, patientId, refList)

Function to build FHIR R4 Planned Medication Requests from Plan of Treatment Section. Uses createServiceRequest function.

param medReqList is a list of C-CDA format Planned Medication requests.
param fhirServConstants is a list of constants used for mapping.
param patientId is the patient's Id.
param refList is a list of practitioner references for author mapping.
return An array of FHIR formatted Planned Medication Requests List.

fun buildGoal (goalReqs, patientId)

Function to build FHIR R4 Goal Requests from Plan of Treatment Section. Uses createServiceRequest function.

param goalReqs is a list of C-CDA format Goal requests.
param patientId is the patient's Id.
return An array of FHIR formatted Goal objects List.

(back to top)

convert-postoperativediagnosis-to-fhir

Converts PostoperativeDiagnosis section from C-CDA to FHIR R4 JSON.
Produces the following FHIR R4 Resources:
Condition

Source: .src/main/resources/dwl/fhirUtil/cdaSection/convert-postoperativediagnosis-to-fhir.dwl

Functions

fun getPostoperativeDiagnosisSection (payload)

Gets a list of C-CDA PostoperativeDiagnosis objects.

param payload is the input XML CDA request.
return A list of CDA PostoperativeDiagnosis objects or an empty list.

fun getPostoperativeDiagnosisActEntries (postoperativeDiagnosisSection)

Gets a filtered list of C-CDA PostoperativeDiagnosis entries.

param postoperativeDiagnosisSection is a list of C-CDA PostoperativeDiagnosis objects.
return A filtered list of C-CDA PostoperativeDiagnosis entries.

fun getPostoperativeDiagnosisObservations (postoperativeDiagnosisActEntries)

Gets a filtered list of C-CDA PostoperativeDiagnosis observations.

param postoperativeDiagnosisActEntries is a list of C-CDA PostoperativeDiagnosis entries.
return A filtered list of C-CDA PostoperativeDiagnosis observations objects.

fun buildPostoperativeDiagnosisConditions (postoperativeDiagnosisObservations, patientId, practitionersList)

Builds a list of FHIR formatted PostoperativeDiagnosis Condition objects.

param postoperativeDiagnosisObservations is a filtered list of C-CDA PostoperativeDiagnosis observation objects.
param patientId is a string with the patient ID.
param practitionersList is a list of practitioners set as vars.practitionersList.
return A list of FHIR formatted Condition objects or an empty list.

(back to top)

convert-postprocedurediagnosis-to-fhir

Converts Postprocedure Diagnosis section from C-CDA to FHIR R4 JSON.
Produces the following FHIR R4 Resources:
Condition

Source: .src/main/resources/dwl/fhirUtil/cdaSection/convert-postprocedurediagnosis-to-fhir.dwl

Functions

fun getPostprocedureDiagnosisSection (payload)

Gets a list of C-CDA Postprocedure Diagnosis objects.

param payload is the input XML CDA request.
return A list of C-CDA PostprocedureDiagnosis objects or an empty list.

fun getPostprocedureDiagnosisEntries (postprocedureDiagnosisSection)

Gets a filtered list of C-CDA Postprocedure Diagnosis entries.

param postprocedureDiagnosisSection is a list of C-CDA PostprocedureDiagnosis objects.
return A filtered list of C-CDA PostprocedureDiagnosis entries.

fun buildPostprocedureDiagnosisConditions (postprocedureDiagnosisEntries, patientId, practitionersList)

Builds a list of FHIR formatted Postprocedure Diagnosis Condition objects.

param postprocedureDiagnosisEntries is a filtered list of C-CDA PostprocedureDiagnosis entries.
param patientId is a string with the patient ID.
param practitionersList is a list of practitioners set as vars.practitionersList.
return A list of FHIR formatted Condition objects or an empty list.

(back to top)

convert-preoperativediagnosis-to-fhir

Converts PreoperativeDiagnosis section from CDA to FHIR R4 JSON.
Produces the following FHIR R4 Resources:
Condition

Source: .src/main/resources/dwl/fhirUtil/cdaSection/convert-preoperativediagnosis-to-fhir.dwl

Functions

fun getPreoperativeDiagnosisSection (payload)

Gets a list of CDA PreoperativeDiagnosis objects.

param payload is the XML CDA request.
return A list of CDA PreoperativeDiagnosis objects or an empty list.

fun getPreoperativeDiagnosisActEntries (preoperativeDiagnosisSection)

Gets a filtered list of CDA PreoperativeDiagnosis entries.

param preoperativeDiagnosisSection is a list of CDA PreoperativeDiagnosis objects.
return A filtered list of CDA PreoperativeDiagnosis entries.

fun getPreoperativeDiagnosisObservations (preoperativeDiagnosisActEntries)

Gets a filtered list of CDA PreoperativeDiagnosis observations.

param preoperativeDiagnosisActEntries is a list of CDA PreoperativeDiagnosis entries.
return A filtered list of CDA PreoperativeDiagnosis observations objects.

fun buildPreoperativeDiagnosisConditions (preoperativeDiagnosisObservations, patientId, practitionersList)

Builds a list of FHIR formatted Condition objects.

param preoperativeDiagnosisObservations is a filtered list of CDA PreoperativeDiagnosis observation objects.
param patientId is a string with the patient ID.
param practitionersList is a list of practitioners set as vars.practitionersList.
return A list of FHIR formatted Condition objects or an empty list.

(back to top)

convert-problem-to-fhir

Converts Problems section from C-CDA to FHIR R4 JSON.
Produces the following FHIR R4 Resources:
Condition
ClinicalImpression
Practitioner

Source: .src/main/resources/dwl/fhirUtil/cdaSection/convert-problem-to-fhir.dwl

Functions

fun buildConditions (problemConcerns, conditionTemplateId, resourceType, fhirProblemConstants, perfRefList, categoryCode)

Function to build condition FHIR resources using the input C-CDA Observations. Uses function getEntryRelationshipResource to fetch the C-CDA observations list, which is then mapped to FHIR R4 Condition.

param problemConcerns is a list of C-CDA "act" resource.
param conditionTemplateId is the C-CDA templateId for Conditions.
param resourceType is the type of object to be selected for Condition. Example: observation.
param fhirProblemConstants is a list of constants used for mapping.

fun buildClinicalImpressions (problemsList, patientId, practList, conditionsList, impressionType)

Function to build condition FHIR resources using the input C-CDA's Act. Uses createClinicalImpression function from cdaToFHIRTools.

param problemList is the list of C-CDA "act" from the input.
param patientId identifies the id of patient to be used for reference.

(back to top)

convert-procedure-to-fhir

Converts Procedures section from C-CDA to FHIR R4 JSON.
Produces the following FHIR R4 Resources:
Organization
Practitioner
Procedure
Observation

Source: .src/main/resources/dwl/fhirUtil/cdaSection/convert-procedure-to-fhir.dwl

Functions

fun buildProcedureSection (payload, templateId)

Build the Procedure Section FHIR objects and returns them as a list.

param payload is the input XML CDA request.
param templateId is the Template ID.
return A list of Procedure Section or an empty list.

fun buildProcedureActivityProcedure (procedureSection, templateId)

Build the Procedure Activity Section FHIR objects and returns them as a list.

param procedureSection is a list of C-CDA objects.
param templateId is the Template ID.
return A list of procedure activity or an empty list.

fun buildProcedureObservations (procedureSection, templateId)

Build the procedure observations FHIR objects and returns them as a list.

param payload is the input XML CDA request.
param templateId is the Template ID.
return A list of procedure observation or an empty list.

fun buildProcedureActs (procedureSection, templateId)

Build the procedure observations FHIR objects and returns them as a list.

param procedureSection is a list of C-CDA procedure section objects.
param templateId is the Template ID.
return A list of procedure observation or an empty list.

fun buildProceduresList (procedureActs, procedureActivityProcedure)

Build the procedures list FHIR objects and returns them as a list.

param performers is a list of C-CDA performers objects.
param templateId is the Template ID.
return A list of procedure or an empty list.

(back to top)

convert-procedureanesthesia-to-fhir

Converts ProcedureAnesthesia section from C-CDA to FHIR R4 JSON.
Produces the following FHIR R4 Resources:
Organization
Practitioner
Procedure
Observation
Medication
MedicationAdministration

Source: .src/main/resources/dwl/fhirUtil/cdaSection/convert-procedureanesthesia-to-fhir.dwl

Functions

fun buildProcedureAnesthesiaSection (payload, templateId)

Build the Procedure Anesthesia Section FHIR objects and returns them as a list.

param payload is the input XML CDA request.
param templateId is the Template ID.
return A list of Procedure Anesthesia Section or an empty list.

fun buildProcedureEntries (procedureAnesthesiaSection, templateId)

Build the Procedure Activity Section FHIR objects and returns them as a list.

param procedureAnesthesiaSection is a list of C-CDA objects.
param templateId is the Template ID.
return A list of Procedure objects or an empty list.

fun buildMedicationEntries (procedureAnesthesiaSection, templateId)

Build the Medication Section FHIR objects and returns them as a list.

param procedureAnesthesiaSection is a list of C-CDA Medication section objects.
param templateId is the Template ID.
return A list of Medication objects or an empty list.

fun buildRepresentedOrganization (performers)

Build the represented organization FHIR objects and returns them as a list.

param performers is a list of C-CDA objects.
return A list of procedure observation or an empty list.

fun buildProceduresList (procedureEntries)

Build the procedures FHIR objects and returns them as a list.

param procedureEntries is a list of C-CDA procedure entries.
return A list of procedure or an empty list.

fun buildMedicationAdministration (medicationEntries, patientId, medicationIds)

Builds a list of FHIR formatted MedicationAdministration objects.

param medicationEntries is a list of C-CDA medication entries.
param patientId is a string with the patient ID.
param medicationIds is a list of medication IDs.
return A list of FHIR formatted MedicationAdministration objects or an empty list.

fun buildMedications (medicationEntries)

Builds a list of FHIR formatted Medication objects.

param medicationEntries is a list of C-CDA medication entries.
return A list of FHIR formatted Medication objects or an empty list.

(back to top)

convert-procedurefinding-to-fhir

Converts ProcedureFinding section from C-CDA to FHIR R4 JSON.
Produces the following FHIR R4 Resources:
Condition

Source: .src/main/resources/dwl/fhirUtil/cdaSection/convert-procedurefinding-to-fhir.dwl

Functions

fun getProcedureFindingSection (payload)

Gets a list of C-CDA ProcedureFinding objects.

param payload is the input XML CDA request.
return A list of C-CDA ProcedureFinding objects or an empty list.

fun getProcedureFindingEntries (procedureFindingSection)

Gets a filtered list of C-CDA ProcedureFinding entries.

param procedureFindingSection is a list of C-CDA ProcedureFinding objects.
return A filtered list of C-CDA ProcedureFinding entries.

fun buildProcedureFindingConditions (procedureFindingEntries, patientId, practitionersList)

Builds a list of FHIR formatted ProcedureFinding Condition objects.

param procedureFindingEntries is a filtered list of C-CDA ProcedureFinding entries.
param patientId is a string with the patient ID.
param practitionersList is a list of practitioners set as vars.practitionersList.
return A list of FHIR formatted Condition objects or an empty list.

(back to top)

convert-procedureindications-to-fhir

Converts Procedure Indications section from C-CDA to FHIR R4 JSON.
Produces the following FHIR R4 Resources:
Observation

Source: .src/main/resources/dwl/fhirUtil/cdaSection/convert-procedureindications-to-fhir.dwl

Functions

fun buildProcedureIndicationsSection (payload, templateId)

Build the Procedure Indications Section FHIR objects and returns them as a list.

param payload is input XML CDA request.
param templateId is the Template ID.
return A list of Procedure Indications or an empty list.

fun buildProcedureIndicationsObservations (procedureIndications, templateId)

Build the Procedure Indications Observations FHIR objects and returns them as a list.

param socialHistory is a list of Procedure Indications C-CDA objects.
param templateId is the Template ID.
return A list of Procedure Indications or an empty list.

(back to top)

convert-reasonforreferral-to-fhir

Creates the Reason for Referral section from C-CDA to FHIR R4 JSON.
Produces the following FHIR R4 Resources:
ServiceRequest

Source: .src/main/resources/dwl/fhirUtil/cdaSection/convert-reasonforreferral-to-fhir.dwl

Functions

fun buildServRequests (servList, fhirServConstants, patientId, refList)

Function to build FHIR R4 Service Requests from Plan of Treatment Section. Uses createServiceRequest function.

param servList is a list of CDA format service requests.
param fhirServConstants is a list of constants used for mapping.
param patientId is the patient's Id.
param refList is a list of practitioner references for author mapping.
return An array of FHIR formatted Service Requests List.

(back to top)

convert-results-to-fhir

Converts Results section from C-CDA to FHIR R4 JSON.
Produces the following FHIR R4 Resources:
Observation

Source: .src/main/resources/dwl/fhirUtil/cdaSection/convert-results-to-fhir.dwl

Functions

fun buildDiagnosticReportSection (payload, templateId)

Build the Diagnostic Report Section FHIR objects and returns them as a list.

param payload is the input XML CDA request.
param templateId is the Template ID.
return A list of Diagnostic Report Section or an empty list.

fun buildDiagnosticObservations (diagnosticReport, templateId, perfRefList)

Build the Diagnostic Report Observations FHIR objects and returns them as a list.

param diagnosticReport is a list of Diagnostic Report C-CDA objects.
param templateId is the Template ID.
return A list of Social History or an empty list.

fun buildDiagnosticObservationIds (diagnosticObservations)

Build the Diagnostic Observations ID objects and returns them as a list.

param diagnosticObservations is a list of Diagnostic Report C-CDA objects.
param templateId is the Template ID.
return A list of Diagnostic Observation IDs or an empty list.

(back to top)

convert-socialhistory-to-fhir

Converts Social History section from C-CDA to FHIR R4 JSON.
Produces the following FHIR R4 Resources:
Observation

Source: .src/main/resources/dwl/fhirUtil/cdaSection/convert-socialhistory-to-fhir.dwl

Functions

fun buildSocialHistorySection (payload, templateId)

Build the Social History Section FHIR objects and returns them as a list.

param payload is the input XML CDA request.
param templateId is the Template ID.
return A list of Social History Section or an empty list.

fun buildSocialHistoryObservations (socialHistory, templateId)

Build the Social History Observations FHIR objects and returns them as a list.

param socialHistory is a list of Social History C-CDA objects.
param templateId is the Template ID.
return A list of Social History or an empty list.

(back to top)

convert-vitalsigns-to-fhir

Converts Vital Signs section from C-CDA to FHIR R4 JSON.
Produces the following FHIR R4 Resources:
Observation

Source: .src/main/resources/dwl/fhirUtil/cdaSection/convert-vitalsigns-to-fhir.dwl

Functions

fun buildVitalSignSection (payload, templateId)

Build the VitalSign Section FHIR objects and returns them as a list.

param payload is the input XML CDA request.
param templateId is the Template ID.
return A list of Vital Signs Section or an empty list.

fun buildVitalSignObservations (vitalSigns, templateId, perfRefList)

Build the VitalSign Observations FHIR objects and returns them as a list.

param vitalSigns is a list of Vital Signs C-CDA objects.
param templateId is the Template ID.
return A list of Vital Signs or an empty list.

(back to top)

createFHIRR4AllergyIntolerance

This module implements functions to support creation of FHIR R4 AllergyIntolerance.

Source: .src/main/resources/dwl/fhirUtil/createFHIRR4AllergyIntolerance.dwl

Functions

fun allergyIntoleranceCategoryLookUp (incode)

Function to lookup C-CDA AllergyIntolerance category type and fetch FHIR type.

param incode is C-CDA format code.
return A FHIR format code.

fun allergyIntoleranceTypeLookUp (incode)

Function to lookup C-CDA AllergyIntolerance type and fetch FHIR type.

param incode is C-CDA format AllergyIntolerance type code.
return A FHIR format AllergyIntolerance type code.

fun createAllergyIntolerance (allergy, fhirAllergyConstants, allergyId, patientId, practitionerList, allergyStatusCode)

Function to create AllergyIntolerance FHIR object from the input XML CDA Request. Uses getIdentifier function from cdaToFHIRTools.

param allergy is a object from the CDA input XML, containing AllergyIntolerance information.
param fhirAllergyConstants is a list of constants to be used for mapping.
param patientId is the patient id.
param allergyId is id for the resource.
param practitionerList is a list of practitioner identifiers and IDs.
return A FHIR format AllergyIntolerance object.

FHIR R4 Element NameC-CDA Element NameMapping Description
idId generated using GUID for resource
text.statusConstant "generated"
text.divallergy.textNarrative that contains a summary of the resource in encoded format
identifier.systemallergy.idIdentifier system for resource
identifier.valueallergy.idIdentifier value for resource
clinicalStatus.coding.systemConstant clinicalStatusSystem from fhirConstants.AllergyIntolerance
clinicalStatus.coding.codeallergy.effectiveTimeUse function getClinicalStatus to lookup code
typeallergy.value.codeIdentification of the underlying physiological mechanism for a Reaction Risk
categoryallergy.value.codeUse function allergyIntoleranceCategoryLookUp to lookup category
recordedDateallergy.author.time.valueFormat datetime using function formatDateTime
recorder.referenceallergy.author.assignedAuthor.id.extensionLookup practitioner id from practitionerList
code.coding.systemConstant codeCodeSystem from fhirConstants.AllergyIntolerance
code.coding.codeallergy.participant.participantRole.playingEntity.code.codeAllergy Intolerance Code
code.coding.systemConstant codeCodeSystem from fhirConstants.AllergyIntolerance
code.coding.displayallergy.participant.participantRole.playingEntity.code.displayNameAllergy Intolerance Display Name
patient.referencepatientIdPatient ID created from recordTarget
reaction.onsetallergy.entryRelationship.observation.effectiveTime.low.valueReaction Onset Time
reaction.substance.coding.codeallergy.entryRelationship.observation.participant.participantRole.playingEntity.code.codeAllergy Substance code
reaction.substance.coding.systemConstant codeCodeSystem from fhirConstants.AllergyIntolerance
reaction.substance.coding.displayallergy.entryRelationship.observation.participant.participantRole.playingEntity.code.displayNameAllergy Substance Code Name
onsetDateTimeallergy.author.time.valueFormat datetime using formatDateTime

fun getClinicalStatus (effectivedate)

Gets the clinical status field with the provided effective date.

param effectivedate is an effective date object.
return A string with resolved, active, or inactive.

(back to top)

createFHIRR4ClinicalImpression

This module implements functions to support creation of FHIR R4 ClinicalImpression.

Source: .src/main/resources/dwl/fhirUtil/createFHIRR4ClinicalImpression.dwl

Functions

fun createClinicalImpression (clin, patientId, practList, clinId, refList, refType)

Function to create ClincalImpression FHIR object from the input XML CDA Request. Uses getIdentifier function from cdaToFHIRTools.

param clin is a object from the CDA input XML, containing ClincalImpression information.
param fhirProblemConstants is a list of constants to be used for mapping.
param patientId is the patient id.
param clinId is id for the resource.
param practList is a list of practitioner identifiers and IDs.
param refList is a list of references.
param refType is a literal of the reference type.
return A FHIR format ClincalImpression object.

FHIR R4 Element NameC-CDA Element NameMapping Description
idId generated using GUID for resource
text.statusConstant "generated"
text.divclin.textNarrative that contains a summary of the resource in encoded format
identifier.systemclin.idIdentifier system for resource
identifier.valueclin.idIdentifier value for resource
statusConstant "completed"
subject.referencepatientIdPatient ID created from recordTarget
effectivePeriod.startclin.effectiveTime.low.valueClinical Impression Start Date
effectivePeriod.endclin.effectiveTime.high.valueClinical Impression End Date
performer.referenceclin.author.assignedAuthor.id.extensionLookup practList using the extension for id
problem.referenceclin.entryRelationship.observation.id.rootLookup refList using entryRelationship.observation.id.root for problem reference

(back to top)

createFHIRR4Composition

This module implements functions to support creation of FHIR R4 Composition.

Source: .src/main/resources/dwl/fhirUtil/createFHIRR4Composition.dwl

Functions

fun createCompositionSection (resourceSection, resourceList, compConstants, note)

Function to create section array for composition.

param resourceSection is a object from the CDA input XML request, containing Clinical Document Resource information.
param compConstants is a list of constants to be used for mapping.
param resourceList is a list of FHIR resources converted for the resourceSection.
return An array of section for Composition.

FHIRR4 Element NameC-CDA Element NameMapping Description
titleresourceSection.titleId generated using uuid() for resource
text.statusConstant "generated"
text.divresourceSection.code.displayName or resourceSection.titleConcat with w3org url to create div
code.coding.coderesourceSection.code.codeComposition Section Code
code.coding.systemresourceSection.code.codeSystemUse function mapCodeSystem to lookup code system
modeConstant compSectionMode from fhirConstants.Composition
statusConstant compStatus from fhirConstants.Composition
entry.referenceresourceList.resource.resourceType ++ resourceList.resource.idCreate an entry using resourceType and id
entry.dispalyresourceList.resource.code.coding.displayResource name for section

fun createCompositionHeader (compId, compHeader, compConstants, practList, patientId, custodianOrgId, encounterId, organizationsList)

Function to create FHIR object from incoming C-CDA Request. Uses getIdentifier function from cdaToFHIRTools.

param compId is ID for the resource.
param compHeader is a object from the CDA input XML, containing Clinical Document header information.
param compConstants is a list of constants to be used for mapping.
param practList is a list of practitioner identifiers and IDs.
param patientId is the patient ID.
param custodianOrgId is the Custodian orgId.
param encounterId is the Encompassing encounter Id.
param organizationsList is a list of organizations identifiers and IDs.
return - FHIR format Composition Header object.

FHIR R4 Element NameC-CDA Element NameMapping Description
idcompHeader.setId.extensionClinicalDocument.setId.extension is used as Composition Id
identifier.systemConstant compIdentifierSystem from fhirConstants.Composition
identifier.valueuuid()Identifier value for resource
statusConstant compStatus from fhirConstants.Composition
type.coding.codecompHeader.code.codeComposition Header type code
type.coding.dispalycompHeader.code.displayNameComposition Header type name
type.coding.systemcompHeader.code.codeSystemUse function mapCodeSystem to lookup code system
dateresource.effectiveTime.valueFormat datetime using function formatDateTime
author.referencecompHeader.author.assignedAuthor.id.extensionUse parameter practList ++ organizationsList to identify author and organization
titlecompHeader.titleComposition title
confidentialitycompHeader.confidentialityCode.codeIdentify confidentiality code for resource
attestor.modeConstant "legal"
attestor.timecompHeader.legalAuthenticator.time.valueFormat datetime using function formatDateTime
attestor.party.referencecompHeader.legalAuthenticator.assignedEntity.id.extensionUse parameter practList to identify legal authenticator
subject.referencepatientIdId of the patient resource created from recordTarget
encounter.referenceencounterIdEncompassing encounter id from parameters
custodian.referencecustodianOrgIdCustodian orgId from parameters
event.period.startcompHeader.documentationOf.serviceEvent.effectiveTime.low.valueFormat datetime using function formatDateTime
event.period.endcompHeader.documentationOf.serviceEvent.effectiveTime.high.valueFormat datetime using function formatDateTime

fun buildCompositionResource (compList, compResource, fhirConstants, practList, patientId, custodianOrgId, encompassingEncounterId, organizationsList)

Function to build composition resource. Uses createCompositionHeader function.

param compList is the list of sections.
param compResource is the C-CDA ClinicalDocument.
param fhirConstants is the list of constants used for mapping.
param practList is the list of practitioner identifiers and IDs.
param patientId is the id of the patient.
param custodianOrgId is the id for the Custodian organization.
param encompassingEncounterId is the id for the encompassing encounter if present.
param organizationsList is the list of organization identifiers and IDs.
param sectionList is the list of sections in the C-CDA document.
return A FHIR R4 formated Composition Resource.

fun getCDASection (body, templateId)

Function to get CDA Section from C-CDA Document. Filters the input to match the templateId and returns the first section.

param body is the input C-CDA request's component.
param templateId is used to match the template.
return An Object with the section of the C-CDA or an empty object.

(back to top)

createFHIRR4Condition

This module implements functions to support creation of FHIR R4 Condition.

Source: .src/main/resources/dwl/fhirUtil/createFHIRR4Condition.dwl

Functions

fun createCondition (cond, fhirProblemConstants, patientId, practList, condId, categoryCode)

Function to create Condition FHIR object from the input XML CDA Request. Uses getIdentifier,formatDateTime and mapCodeSystem functions from cdaToFHIRTools.

param cond is a object from the CDA input XML, containing Condition information.
param fhirProblemConstants is a list of constants to be used for mapping.
param patientId is the patient ID.
param condId is ID for the resource.
param practList is a list of practitioner identifiers and IDs.
return A FHIR format Condition object.

FHIR R4 Element NameC-CDA Element NameMapping Description
idId generated using GUID for resource
text.statusConstant "generated"
text.divcond.textNarrative that contains a summary of the resource in encoded format
identifier.systemcond.idIdentifier system for resource
identifier.valuecond.idIdentifier value for resource
clinicalStatus.coding.codecond.effectiveTime.high.valueConditionally set to "active" or "resolved"
clinicalStatus.coding.systemConstant problemClinicalStatusSystem from fhirConstants.Problem
category.coding.codeparentSection.codeCondition category Code
category.coding.systemUse function conditionCategory to lookup code system name
category.coding.displayCondition category display name
code.coding.codecond.value.codeCondition Code
code.coding.systemcond.value.codeSystemUse function mapCodeSystem to lookup code system name
code.coding.displaycond.value.displayNameCondition display name
subject.referencepatientIdPatient ID created from recordTarget
onsetDateTimecond.effectiveTime.low.valueFormat datetime using function formatDateTime
recordedDatecond.author.time.valueFormat datetime using function formatDateTime
recorder.referencecond.author.assignedAuthor.id.extensionFilter practList to get id match

(back to top)

createFHIRR4Consent

This module implements functions to support creation of FHIR R4 Consent.

Source: .src/main/resources/dwl/fhirUtil/createFHIRR4Consent.dwl

Functions

fun createConsent (advDirectiveArray, patientId, docId, practRefArray, fhirConsentConstants)

Function to create Consent FHIR object from the input XML CDA Request. Uses getIdentifier function from cdaToFHIRTools.

param advDirectiveArray is an array from the CDA input XML, containing Consent information.
param fhirConsentConstants is a list of constants to be used for mapping.
param patientId is the patient ID.
param docId is the reference to DocumentReference resource.
param practRefArray is a list of practitioner identifiers and IDs.
return A FHIR format Consent object.

FHIR R4 Element NameC-CDA Element NameMapping Description
idId generated using GUID for resource
text.statusConstant "generated"
text.divadvObs.textNarrative that contains a summary of the resource in encoded format
identifier.systemadvDir.idIdentifier system for resource
identifier.valueadvDir.idIdentifier value for resource
statusadvObs.effectiveTime.highConditionally set to "active"
scope.coding.systemConstant consentScopeCodingSystem from fhirConstants.Consent
scope.coding.codeConstant consentScopeCodingCode from fhirConstants.Consent
category.coding.codeadvDir.code.codeConsent Category Code
category.coding.systemConstant categorySystem from fhirConstants.Consent
dateTimeadvObs.effectiveTime.lowFormat datetime using function formatDateTime
provision.code.codeadvObs.value.codeConsent provision code
provision.code.displayadvObs.value.displayNameConsent provision code name
provision.code.systemConstant provisionCodeSystem from fhirConstants.Consent
subject.referencepatientIdPatient ID created from recordTarget
sourceReference.referencedocIdDocument Reference provided as parameter to the function
performer.referenceadvObs.author.assignedAuthor.idUse function getPractitionerRef to get practitioner id

(back to top)

createFHIRR4Coverage

This module implements functions to support creation of FHIR R4 Coverage.

Source: .src/main/resources/dwl/fhirUtil/createFHIRR4Coverage.dwl

Functions

fun createCoverage (cov, fhirCoverageConstants, covId, patientId, payers)

Function to create Coverage FHIR object from the input XML CDA Request. Uses getIdentifier function from cdaToFHIRTools.

param cov is an object from the CDA input XML, containing Coverage information.
param fhirCoverageConstants is a list of constants to be used for mapping.
param covId is the ID for the resource.
return A FHIR format Coverage object.

FHIR R4 Element NameC-CDA Element NameMapping Description
idId generated using GUID for resource
text.statusConstant "generated"
text.divcov.textNarrative that contains a summary of the resource in encoded format
identifier.systemcov.idIdentifier system for resource
identifier.valuecov.idIdentifier value for resource
statuscov.performer.time.high.valueConditionally set to "active or cancelled"
type.coding.systemConstant selfPayTypeCodeSystem from fhirConstants.Coverage
type.coding.codecov.code.codeConditionally set to "pay"
type.coding.displaycov.code.codeConditionally set to "PAY"
beneficiary.referencepatientIdPatient ID created from recordTarget
payor.referencePayer or Org RefIf cov.code.code is 81(SelfPay)then it is Patient Ref else Insurance Org Ref

fun mapCodeableConcept4CoverageType (codeableConceptObj)

Maps mapCodeableConcept4CoverageType from C-CDA format to FHIR format.

param codeableConceptObj C-CDA codeableConcept Object.
return A string of coding element within the codeableConcept object, located in the type field of the coverage resource in FHIR format.

(back to top)

createFHIRR4Device

This module implements functions to support creation of FHIR R4 Device.

Source: .src/main/resources/dwl/fhirUtil/createFHIRR4Device.dwl

Functions

fun createDevice (device, fhirDeviceConstants, deviceId)

Function to create Device FHIR object from the input XML CDA Request. Uses getIdentifier function from cdaToFHIRTools.

param device is an object from the CDA input XML, containing Device information.
param fhirDeviceConstants is a list of constants to be used for mapping.
param deviceId is the ID for the resource.
return A FHIR format Device object.

FHIR R4 Element NameC-CDA Element NameMapping Description
idId generated using GUID for resource
text.statusConstant "generated"
text.divdevice.textNarrative that contains a summary of the resource in encoded format
identifier.systemdevice.idIdentifier system for resource
identifier.valuedevice.idIdentifier value for resource
type.codedevice.participant.participantRole.playingDevice.code.codeDevice Type Code
type.displayNamedevice.participant.participantRole.playingDevice.code.displayNameDevice Type Code Name
type.systemConstant deviceCodeSystem from fhirConstants.Device
manufacturerdevice.participant.participantRole.scopingEntity.descDevice manufacturer name

(back to top)

createFHIRR4DeviceUseStatement

This module implements functions to support creation of FHIR R4 DeviceUseStatement.

Source: .src/main/resources/dwl/fhirUtil/createFHIRR4DeviceUseStatement.dwl

Functions

fun createDeviceUseStatement (supply, fhirDeviceUseConstants, supplyId, patientId)

Function to create DeviceUseStatement FHIR object from the input XML CDA Request. Uses getIdentifier function from cdaToFHIRTools.

param supply is an object from the CDA input XML, containing DeviceUseStatement information.
param fhirDeviceUseConstants is a list of constants to be used for mapping.
param supplyId is the ID for the resource.
param patientId is the patient ID.
return A FHIR format DeviceUseStatement object.

FHIR R4 Element NameC-CDA Element NameMapping Description
idId generated using GUID for resource
text.statusConstant "generated"
text.divsupply.textNarrative that contains a summary of the resource in encoded format
identifier.systemsupply.idIdentifier system for resource
identifier.valuesupply.idIdentifier value for resource
statussupply.statusCode.codeDevice Use Statement Status Code
subject.referencepatientIdPatient ID created from recordTarget
device.coding.codesupply.participant.participantRole.playingDevice.code.codeDevice Code
device.coding.displaysupply.participant.participantRole.playingDevice.code.displayNameDevice Code Name
device.coding.displayConstant deviceCodeSystem from fhirConstants.DeviceUseStatement

(back to top)

createFHIRR4DiagnosticReport

This module implements functions to support creation of FHIR R4 DiagnosticReport.

Source: .src/main/resources/dwl/fhirUtil/createFHIRR4DiagnosticReport.dwl

Functions

fun diagnosticReportStatusLookup (inCode)

Function to lookup diagnostic report status.

param inCode is the C-CDA format code.
return A FHIR formatted code.

fun createDiagnosticReport (diagnostic, fhirDiagRepConstants, patientId, diagId, diagnosticObservationIds)

Function to create DiagnosticReport FHIR object from the input XML CDA Request. Uses getIdentifier,formatDateTime and mapCodeSystem functions from cdaToFHIRTools.

param diagnostic is an object from the CDA input XML, containing DiagnosticReport information.
param fhirDiagRepConstants is a list of constants to be used for mapping.
param diagId is the ID for diagnostic report resource.
param patientId is the patient ID.
param diagnosticObservationIds is a list of observation IDs.
return A FHIR format DiagnosticReport object.

FHIR R4 Element NameC-CDA Element NameMapping Description
idId generated using GUID for resource
text.statusConstant "generated"
text.divdiagnostic.textNarrative that contains a summary of the resource in encoded format
identifier.systemdiagnostic.idIdentifier system for resource
identifier.valuediagnostic.idIdentifier value for resource
statusdiagnostic.organizer.statusCode.codeUse function diagnosticReportStatusLookup to lookup status
code.coding.codediagnostic.organizer.code.codeDiagnostic Report Code
code.coding.displaydiagnostic.organizer.code.displayNameDiagnostic Report Code Name
code.coding.systemdiagnostic.organizer.code.codeSystemUse function mapCodeSystem to lookup Diagnostic Report Code System
effectivePeriod.startdiagnostic.organizer.effectiveTime.low.valueFormat datetime using function formatDateTime
effectivePeriod.enddiagnostic.organizer.effectiveTime.high.valueFormat datetime using function formatDateTime
effectiveDateTimediagnostic.organizer.effectiveTime.valueFormat datetime using function formatDateTime
subject.referencepatientIdPatient ID created from recordTarget
result.referencediagnostic.organizer.component.observationFilter diagnosticObservationIds to match current observation

(back to top)

createFHIRR4DocumentReference

This module implements functions to support creation of FHIR R4 DocumentReference.

Source: .src/main/resources/dwl/fhirUtil/createFHIRR4DocumentReference.dwl

Functions

fun createDocumentRef (advDirective, fhirDocRefConstants)

Function to create DocumenatReference FHIR object from the input XML CDA Request.

param advDirective is an object from the CDA input XML, containing Documentation information.
param fhirDocRefConstants is a list of constants used for mapping.
return A FHIR format DocumentReference object.

FHIR R4 Element NameC-CDA Element NameMapping Description
idId generated using GUID for resource
text.statusConstant "generated"
text.divadvObs.textNarrative that contains a summary of the resource in encoded format
statusadvObs.effectiveTime.highConditionally set to "current"
content.attachment.contentTypeadvObs.reference.externalDocument.text.mediaTypeContent type for Document
content.attachment.urladvObs.reference.externalDocument.text.reference.valueURL for Document

fun createDocumentRefUCDA (ucdaObj, mediaType, patientId, custodianOrgId, practList, organizationsList)

Function to create DocumenatReference FHIR object from the input XML Unstructured CDA Request.

param ucdaObj is an object from the CDA input XML, containing Documentation information.
param mediaType is mediaType of the document.
return A FHIR format DocumentReference object.

FHIR R4 Element NameC-CDA Element NameMapping Description
idId generated using GUID for resource
text.statusConstant "generated"
text.divadvObs.textNarrative that contains a summary of the resource in encoded format
statusadvObs.effectiveTime.highConditionally set to "current"
content.attachment.contentTypeadvObs.reference.externalDocument.text.mediaTypeContent type for Document
content.attachment.urladvObs.reference.externalDocument.text.reference.valueURL for Document

(back to top)

createFHIRR4Encounter

This module implements functions to support creation of FHIR R4 Encounter.

Source: .src/main/resources/dwl/fhirUtil/createFHIRR4Encounter.dwl

Functions

fun createEncounter (encounterObj, fhirEncounterConstants, encounterId, patientId, practitioners, locations)

Function to create Encounter FHIR object from the input XML CDA Request. Uses getIdentifier function from cdaToFHIRTools.

param encounterObj is an object from the CDA input XML, containing Encounter information.
param fhirEncounterConstants is a list of constants to be used for mapping.
param encounterId is the ID for the resource.
param patientId is the patient ID.
param practitioners is a list of practitioner IDs and identifiers.
return A FHIR format Encounter object.

FHIR R4 Element NameC-CDA Element NameMapping Description
idId generated using GUID for resource
text.statusConstant "generated"
text.divencounterObj.textNarrative that contains a summary of the resource in encoded format
identifier.systemencounterObj.idIdentifier system for resource
identifier.valueencounterObj.idIdentifier value for resource
statusConstant status from fhirConstants.Encounter
class.codeencounterObj.translation.codeEncounter class code
class.displayencounterObj.translation.displayNameEncounter class code name
class.systemencounterObj.translation.codeSystemEncounter class code system name
type.coding.codeencounterObj.code.codeEncounter type code
type.coding.displayencounterObj.code.displayNameEncounter type code name
type.coding.systemencounterObj.code.codeSystemEncounter type code system name
subject.referencepatientIdPatient ID created from recordTarget
participant.type.systemConstant participantTypeSystem from fhirConstants.Encounter
participant.type.codeConstant participantTypeCode from fhirConstants.Encounter
participant.individual.referenceencounterObj.performer.assignedEntity.id.extensionLookup practitionerId from practitioners
location.location.referencelocation.locationMap locations from location parameter

fun createEncompassingEncounter (encounterObj, fhirEncounterConstants, encounterId, patientId, practitioners, location)

Function to create Encounter FHIR object from incoming C-CDA Request. Uses getIdentifier function from cdaToFHIRTools.

param encounterObj is an object from the CDA input XML, containing Encounter information.
param fhirEncounterConstants is a list of constants to be used for mapping.
param encounterId is the ID for the resource.
param patientId is the patient ID.
param practitioners is a list of practitioner ID and identifiers.
param location is the id of the location of encounter.
return A FHIR format Encounter object.

FHIR R4 Element NameC-CDA Element NameMapping Description
idId generated using uuid() for resource
identifier.systemencounterObj.idIdentifier system for resource
identifier.valueencounterObj.idIdentifier value for resource
statusConstant status from fhirConstants.Encounter
class.codeencounterObj.translation.codeEncounter class code
class.displayencounterObj.translation.displayNameEncounter class code name
class.systemencounterObj.translation.codeSystemEncounter class code system name
type.coding.codeencounterObj.code.codeEncounter type code
type.coding.displayencounterObj.code.displayNameEncounter type code name
type.coding.systemencounterObj.code.codeSystemEncounter type code system name
period.startencounterObj.effectiveTime.low.valueFormat datetime using function formatDateTime
period.endencounterObj.effectiveTime.high.valueFormat datetime using function formatDateTime
subject.referencepatientIdPatient ID created from recordTarget
hospitalization.dischargeDisposition.codeencounterObj.dischargeDispositionCode.codeConditionally set to "home"
hospitalization.dischargeDisposition.displayencounterObj.dischargeDispositionCode.displayNameConditionally set to "Home"
hospitalization.dischargeDisposition.systemConstant dischargeDispositionCodeSystem from fhirConstants.Encounter
participant.type.systemConstant participantTypeSystem from fhirConstants.Encounter
participant.type.codeConstant participantTypeCode from fhirConstants.Encounter
participant.individual.referenceencounterObj.performer.assignedEntity.id.extensionLookup practitionerId from practitioners
location.location.referencelocation.locationMap locations from location parameter

fun mapCodeableConcept4EncounterDischargeDisposition (codeableConceptObj)

Maps mapCodeableConcept4CoverageType from C-CDA format to FHIR format.

param codeableConceptObj C-CDA codeableConcept Object.
return A string of coding element within the codeableConcept object, located in the type field of the coverage resource in FHIR format.

(back to top)

createFHIRR4FamilyHistory

This module implements functions to support creation of FHIR R4 FamilyHistory.

Source: .src/main/resources/dwl/fhirUtil/createFHIRR4FamilyHistory.dwl

Functions

fun createFamilyHistory (history, fhirHistoryConstants, histId, patientId)

Function to create FamilyHistory FHIR object from the input XML CDA Request. Uses getIdentifier function from cdaToFHIRTools.

param history is an object from the CDA input XML, containing FamilyHistory information.
param fhirHistoryConstants is a list of constants to be used for mapping.
param histId is the ID for the resource.
param patientId is the patient ID.
return A FHIR formatted FamilyHistory object.

FHIR R4 Element NameC-CDA Element NameMapping Description
idId generated using GUID for resource
text.statusConstant "generated"
text.divhistory.textNarrative that contains a summary of the resource in encoded format
identifier.systemhistory.idIdentifier system for resource
identifier.valuehistory.idIdentifier value for resource
statusConstant "completed"
relationship.codehistory.subject.relatedSubject.code.translation.codeRelationship Code to Patient
relationship.displayhistory.subject.relatedSubject.code.translation.displayNameRelationship Name to Patient
relationship.systemConstant codeSystem from fhirConstants.FamilyHistory
sex.codehistory.subject.relatedSubject.subject.administrativeGenderCode.codeFamily Member Gender Code
sex.displayhistory.subject.relatedSubject.subject.administrativeGenderCode.displayNameFamily Member Gender Display
sex.systemhistory.subject.relatedSubject.subject.administrativeGenderCode.codeSystemFamily Member Gender Code System
bornStringhistory.subject.relatedSubject.subject.birthTime.valueFamily Member BirthTime
condition.codehistory.component.observation.value.codeFamily Member Condition Code
condition.displayhistory.component.observation.value.displayNameFamily Member Condition Display
condition.systemConstant codeSystem from fhirConstants.FamilyHistory
condition.contributedToDeathConditionally set to true if deathObservationTemplateId is found in Observation
condition.onsetAge.valuehistory.component.observation.entryRelationship.observation.value.valueOnset Age for condition
condition.onsetAge.systemConstant unitOfMeasureSystem from fhirConstants.FamilyHistory
condition.onsetAge.codehistory.component.observation.entryRelationship.observation.value.unitOnset Age Condition Code
patient.referencepatientIdPatient ID created from recordTarget

(back to top)

createFHIRR4Goal

This module implements functions to support creation of FHIR R4 Goal.

Source: .src/main/resources/dwl/fhirUtil/createFHIRR4Goal.dwl

Functions

fun createGoal (goal, goalId, patientId)

Function to create Goal FHIR object from the input XML CDA Request. Uses getIdentifier and formatDateTime functions from cdaToFHIRTools.

param goal is an object from the CDA input XML, containing Goal information.
param goalId is the ID for the resource.
param patientId is the patient ID.
return A FHIR formatted Goal object.

FHIR R4 Element NameC-CDA Element NameMapping Description
idId generated using GUID for resource
text.statusConstant "generated"
text.divgoal.textNarrative that contains a summary of the resource in encoded format
identifier.systemgoal.idIdentifier system for resource
identifier.valuegoal.idIdentifier value for resource
description.codegoal.code.codeGoal Description Code
description.displaygoal.code.displayNameGoal Description Code Name
lifecycleStatusgoal.statusCode.codeGoal Status
subject.referencepatientIdPatient Id created from recordTarget
startDategoal.effectveTimeFormat datetime using function formatDateTime

(back to top)

createFHIRR4Immunization

This module implements functions to support creation of FHIR R4 Immunization.

Source: .src/main/resources/dwl/fhirUtil/createFHIRR4Immunization.dwl

Functions

fun createImmunization (immItem, fhirConstants, immunizationId, patientId, performers)

Creates a FHIR Immunization object with the provided C-CDA substanceAdministration item, patient ID, and performer reference. Uses getIdentifier function from cdaToFHIRTools.

param immItem is a substanceAdministration C-CDA object.
param fhirConstants is a list of constants used for mapping.
param immunizationId is ID used for the resource.
param patientId is a String with the patient ID to use.
param performers is a list of Practitioners, PractitionerRole, or Organization to use as the performer reference.
return A FHIR formatted Immunization object.

FHIR R4 Element NameC-CDA Element NameMapping Description
idId generated using GUID for resource
text.statusConstant "generated"
text.divimmItem.textNarrative that contains a summary of the resource in encoded format
identifier.systemimmItem.idIdentifier system for resource
identifier.valueimmItem.idIdentifier value for resource
statusimmItem.statusCode.codeUse function mapImmunizationStatus to lookup status
manufacturerimmItem.consumable.manufacturedProduct.manufacturerOrganization.id.rootUse function mapImmunizationManufacturer for mapping
lotNumberimmItem.consumable.manufacturedProduct.manufacturedMaterial.lotNumberTextImmunization substance lot number
vaccineCodeimmItem.consumable.manufacturedProduct.manufacturedMaterial.code.codeUse function mapImmunizationVaccineCode for mapping
patient.referencepatientIdPatient ID created from recordTarget
performer.actor.referenceimmItem.performer.assignedEntity.id.extensionLookup performer id from input parameter performers
occurenceStringimmItem.effectiveTime.valueFormat datetime using formatDateTime
siteimmItem.approachSiteCode.codeUse function mapImmunizationSite for mapping
routeimmItem.routeCode.codeUse function mapImmunizationRoute for mapping
doseQuantityimmItem.doseQuantity.center.valueImmunization dose quantity
note.textimmItem.textImmunization note
reactionimmItemUse function mapImmunizationReaction with object detailed in the function

fun mapImmunizationStatus (code)

Maps the immunization status code.

param code is a String with the C-CDA status code.
return A String with the FHIR status code.

fun getImmunizationCvxDisplay (code)

Maps the CVX immunization vaccine code provided to a display string.

param code is a String with the CVX immunization vaccine code.
return A String with the display or blank if not matched.

fun getImmunizationOidDisplay (code)

Maps the OID immunization vaccine code provided to a display string.

param code is a String with the OID immunization vaccine code.
return A String with the display or blank if not matched.

fun mapImmunizationManufacturer (id)

Maps the immunization manufacturer ID to an organization reference.

param id is a String with the organization ID.
return A FHIR formatted Organization object reference.

fun mapImmunizationSite (code)

Maps the immunization site code to the FHIR formatted site CodeableConcept object.

param code is a String with the code to map.
return A CodeableConcept object with the site code or null if not matched.

fun mapImmunizationRoute (code)

Map the immunization route code to the FHIR formatted CodeableConcept object.

param code is a String with the route code.
return A CodeableConcept object with the route code or null if not matched.

fun mapImmunizationReaction (item)

Maps the immunization item to the FHIR formatted immunization reaction list.

param item is a substanceAdministration object to map from.
return A FHIR formatted reaction list, or null if not found.

fun mapImmunizationGetReactionObs (item)

Gets the list of reaction observations with the provided substanceAdministration object.

param item is a substanceAdministration object.
return A list of reactions observations.

fun mapCodeableConcept4ImmunizationVaccineCode (codeableConceptObj)

Maps mapCodeableConcept4ImmunizationVaccineCode from C-CDA format to FHIR format.

param codeableConceptObj C-CDA codeableConcept Object.
return A string of coding element within the codeableConcept object, located in the type field of the coverage resource in FHIR format.

(back to top)

createFHIRR4Location

This module implements functions to support creation of FHIR R4 Location.

Source: .src/main/resources/dwl/fhirUtil/createFHIRR4Location.dwl

Functions

fun createLocation (location, fhirLocationsConstants, locId)

Function to create Location FHIR object from the input XML CDA Request.

param location is an object from the CDA input XML, containing Location information.
param fhirLocationsConstants is a list of constants to be used for mapping.
param locId is the ID for location resource.
return A FHIR formatted MedicationDispense object.

FHIR R4 Element NameC-CDA Element NameMapping Description
idId generated using GUID for resource
text.statusConstant "generated"
text.divlocation.textNarrative that contains a summary of the resource in encoded format
namelocation.playingEntity.nameLocation Name
address.uselocation.addr.useLocation Address Use
address.linelocation.addr.streetAddressLineLocation Address Line
address.citylocation.addr.cityLocation Address City
address.statelocation.addr.stateLocation Address State
address.countrylocation.addr.countryLocation Address Country
address.postalCodelocation.addr.postalCodeLocation Address Postal Code
address.period.startlocation.addr.useablePeriod.low.valueLocation Address used period start date
address.period.endlocation.addr.useablePeriod.high.valueLocation Address used period end date
telecom.systemUsed telecomSystemLookup to lookup system value
telecom.valuelocation.telecom.valueLocation's communication details
telecom.uselocation.telecom.useUsed telecomUseLookup function to lookup telecom use value
telecom.period.startlocation.telecom.useablePeriod.low.valueTelecom system used period start date
telecom.period.endlocation.telecom.useablePeriod.high.valueTelecom system used period end date
type.codelocation.code.codeLocation Type Code
type.systemlocation.code.codeSystemLocation Type Code System
type.displaylocation.code.displayNameLocation Type Name

(back to top)

createFHIRR4Medication

This module implements functions to support creation of FHIR R4 Medication.

Source: .src/main/resources/dwl/fhirUtil/createFHIRR4Medication.dwl

Functions

fun createMedication (med, fhirConstants, medId)

Function to create Medication FHIR object from the input XML CDA Request with parameters medicationObject, organizationId. Uses getIdentifier function from cdaToFHIRTools.

param med is an object from the CDA input XML, containing Medication information.
param fhirConstants is a list of constants used for mapping.
param medId is the ID used for resource.
return A FHIR format Medication object.

FHIR R4 Element NameC-CDA Element NameMapping Description
idId generated using GUID for resource
text.statusConstant "generated"
text.divmed.textNarrative that contains a summary of the resource in encoded format
code.codemed.consumable.manufacturedProduct.manufacturedMaterial.code.codeMedication Code
code.displaymed.consumable.manufacturedProduct.manufacturedMaterial.code.displayNameMedication Name
code.systemConstant medicationCodeSystem from fhirConstants.Medication

(back to top)

createFHIRR4MedicationAdministration

This module implements functions to support creation of FHIR R4 MedicationAdministration.

Source: .src/main/resources/dwl/fhirUtil/createFHIRR4MedicationAdministration.dwl

Functions

fun createMedicationAdministration (medAdmn, fhirMedAdmnConstants, patientId, medAdmnId, dischargeMedicationId)

Function to create MedicationAdministration FHIR object from the input XML CDA Request. Uses functions getIdentifier,formatDateTime,medAdmnStatusLookup from cdaToFHIRTools.

param medAdnm is the C-CDA medication administration resource.
param fhirMedAdmnConstants is a list of constants for mapping.
param patientId is a reference to a Patient.
param medAdmnId is the id for MedicationAdministration.
param dischargeMedicationId is the discharge medication id.
return - FHIR formatted MedicationAdministration object.

FHIR R4 Element NameC-CDA Element NameMapping Description
idId generated using GUID for resource
text.statusConstant "generated"
text.divmedAdmn.textNarrative that contains a summary of the resource in encoded format
identifier.systemmedAdmn.idIdentifier system for resource
identifier.valuemedAdmn.idIdentifier value for resource
statusmedAdmn.statusCode.codeUse function medAdmnStatusLookup to lookup status
effectivePeriod.startmedAdmn.effectiveTime.low.valueFormat datetime using function formatDateTime
effectivePeriod.endmedAdmn.effectiveTime.high.valueFormat datetime using function formatDateTime
medicationReference.referencedischargeMedicationIdMap the dischargeMedicationId as a reference
subject.referencepatientIdPatient ID created from recordTarget
dosage.route.coding.systemConstant dosageRouteCodeSystem from fhirConstants.MedicationAdminstration
dosage.route.coding.codemedAdmn.routeCode.codeMedication Administration route code
dosage.route.coding.displaymedAdmn.routeCode.displayNameMedication Administration route Code Name
dosage.dose.valuemedAdmn.doseQuantity.valueMedication Adminstration Dose Quantity
dosage.rateQuantity.valuemedAdmn.rateQuantity.valueMedication Adminstration Dosage Rate Quantity

(back to top)

createFHIRR4MedicationDispense

This module implements functions to support creation of FHIR R4 MedicationDispense.

Source: .src/main/resources/dwl/fhirUtil/createFHIRR4MedicationDispense.dwl

Functions

fun createMedicationDispense (medDisp, fhirMedDispConstants, patientId, medDispId, medicationRequests, practitioners, medDispIdx, medications)

Function to create MedicationDispense FHIR object from the input XML CDA Request.

param medDisp is an object from the CDA input XML, containing MedicationDispense information.
param fhirMedDispConstants is a list of constants to be used for mapping.
param patientId is a reference to a Patient.
param medDispId is the ID for medication dispense resource.
param medicationRequests is a list of medication requests.
param practitioners is a list of practitioner identifier and IDs.
return A FHIR formatted MedicationDispense object.

FHIR R4 Element NameC-CDA Element NameMapping Description
idId generated using GUID for resource
text.statusConstant "generated"
text.divmedDisp.textNarrative that contains a summary of the resource in encoded format
identifier.systemmedDisp.idIdentifier system for resource
identifier.valuemedDisp.idIdentifier value for resource
intentConstant set to "order"
statusmedDisp.statusCode.codeMedication Dispense status
whenPreparedmedDisp.effectiveTime.low.valueMedication dispense prepared
whenHandedOvermedDisp.effectiveTime.high.valueMedication dispense handed over
quantity.valuemedDisp.quantity.valueMedication dispensed quantity
subject.referencepatientIdPatient ID created from recordTarget
medicationReference.referenceMedication Reference
performer.actor.referenceperformer.assignedEntity.id.extensionUse parameter practitioners to filter for practitioner id
authorizingPrescription.referenceUse function getMedReferenceId and parameter medicationRequests to filter medicationRequestId

fun createDischargeMedicationDispense (medDisp, patientId, medDispId, medicationId, practitioners)

Function to create DischargeMedicationDispense FHIR object from incoming C-CDA Request.

param medDisp is an object from the CDA input XML, containing MedicationDispense information.
param patientId is a reference to a Patient.
param medDispId is the ID for medication dispense resource.
param medicationRequests is a list of medication requests.
param practitioners is a list of practitioner identifiers and IDs.
return A FHIR formatted MedicationDispense object.

FHIR R4 Element NameC-CDA Element NameMapping Description
idId generated using uuid() for resource
identifier.systemresource.idIdentifier system for resource
identifier.valueresource.idIdentifier value for resource
intentConstant set to "order"
statusresource.statusCode.codeMedication Dispense status
whenPreparedresource.effectiveTime.low.valueMedication dispense prepared
whenHandedOverresource.effectiveTime.high.valueMedication dispense handed over
quantity.valueresource.quantity.valueMedication dispensed quantity
subject.referencepatientIdPatient ID created from recordTarget
medication.reference.referencemedicationIdMedication reference id
performer.actor.referenceperformer.assignedEntity.id.extensionPractitioner reference for medication dispense

(back to top)

createFHIRR4MedicationRequest

This module implements functions to support creation of FHIR R4 MedicationRequest.

Source: .src/main/resources/dwl/fhirUtil/createFHIRR4MedicationRequest.dwl

Functions

fun createMedicationRequest (medicationRequest, fhirMedReqConstants, patientId, medReqId, practitioners, medications, medReqIdx)

Function to create MedicationRequest FHIR object from the input XML CDA Request.

param medicationRequest is an object from the CDA input XML, containing MedicationRequest information.
param fhirMedReqConstants is a list of constants used for mapping.
param patientId is a reference to a Patient.
param medReqId is ID for medication request.
param practitioners is a list of practitioner identifier and IDs.
return A FHIR formatted MedicationRequest object.

FHIR R4 Element NameC-CDA Element NameMapping Description
idId generated using GUID for resource
text.statusConstant "generated"
text.divmedicationRequest.textNarrative that contains a summary of the resource in encoded format
identifier.systemmedicationRequest.idIdentifier system for resource
identifier.valuemedicationRequest.idIdentifier value for resource
intentConstant set to "order"
statusmedicationRequest.statusCode.codeMedication request status
subject.referencepatientIdPatient ID created from recordTarget
medicationReference.referenceMedication reference
requester.referenceauthor.assignedAuthor.id.extensionFilter practitioners using the C-CDA element and get the ID from the array

(back to top)

createFHIRR4MedicationStatement

This module implements functions to support creation of FHIR R4 MedicationStatement.

Source: .src/main/resources/dwl/fhirUtil/createFHIRR4MedicationStatement.dwl

Functions

fun createMedicationStatement (medState, fhirMedStateConstants, medStateId, medReq, medDispense, patientId, medStateIdx)

Function to create MedicationStatement FHIR object from the input XML CDA Request.

param medState is an object from the CDA input XML, containing MedicationStatement information.
param fhirMedStateConsants is a set of constants used.
param medStateId is a reference to a MedicationDispense.
param medReq is a list of medication requests.
param medDispense is a list of medication dispense.
param patientId is a reference to a Patient.
return A FHIR format MedicationStatement object.

FHIR R4 Element NameC-CDA Element NameMapping Description
idId generated using GUID for resource
text.statusConstant "generated"
text.divmedState.textNarrative that contains a summary of the resource in encoded format
identifier.systemmedState.idIdentifier system for resource
identifier.valuemedState.idIdentifier value for resource
basedOnFunction getMedReferenceId helps fetch reference for MedicationRequest
partOfFunction getMedReferenceId helps fetch reference for MedicationDispense
statusmedState.statusCode.codeConditionally mapped to "stopped"
medicationReference.referenceMedication reference
subject.referencepatientIdPatient ID created from recordTarget
effectiveDateTimemedState.effectiveTime.low.valueFormat datetime using formatDateTime function filtered for dataType IVL_TS
dosage.timing.repeat.frequencymedState.effectiveTime.period.valueFilter for frequency using dataType PIVL_TS
dosage.timing.repeat.periodConstant of "1" and can be modify as desired
dosage.timing.repeat.periodUnitmedState.effectiveTime.period.unitTimePeriod Unit
dosage.doseAndRate.codemedState.effectiveTime.institutionSpecifiedConditionally set to "calculated"
dosage.doseAndRate.systemConstant value
dosage.doseQuantity.valuemedState.doseQuantity.valueMedication quantity
dosage.doseQuantity.unitmedState.doseQuantity.unitMedication quantity units
dosage.route.codemedState.routeCode.codeDosage route code
dosage.route.systemmedState.routeCode.codeSystemDosage route code system
dosage.route.displaymedState.routeCode.dispalyNameDosage route display

(back to top)

createFHIRR4Observation

This module implements functions to support creation of FHIR R4 Observation.

Source: .src/main/resources/dwl/fhirUtil/createFHIRR4Observation.dwl

Functions

fun createObservation (observation, patientId, fhirObsrvConstants, obsrvId, practitionersList, cdaSectionName)

Function to create FHIR R4 Observation from CDA input XML request. Uses getIdentifier,createObservationValue,formatDateTime,ObservationStatusLookup,mapCodeSystem and mapCodeableConcept functions from cdaToFHIRTools.

param observation is a resource of C-CDA Observation type.
param patientId is the ID of the Patient resource.
param fhirObsrvConstants is the list of constants used.
param obsrvId is the ID to be used for creating the resource.
return A FHIR format Observation resource.

FHIR R4 Element NameC-CDA Element NameMapping Description
idId generated using GUID for resource
text.statusConstant "generated"
text.divobservation.textNarrative that contains a summary of the resource in encoded format
identifier.systemobservation.idIdentifier system for resource
identifier.valueobservation.idIdentifier value for resource
category.systemConstant categorySystem from fhirConstants.Observation
category.codeConstant categoryCode from fhirConstants.Observation
statusobservation.statusCode.codeLookup code using function ObservationStatusLookup
code.coderesorce.code.codeTrim value for Observation code
code.displayresorce.code.displayNameObservation Code Name
code.systemresorce.code.codeSystemLookup codesystem using function mapCodeSystem
effectivePeriod.startobservation.effectiveTime.low.valueFormat datetime using function formatDateTime
effectivePeriod.endobservation.effectiveTime.high.valueFormat datetime using function formatDateTime
effectiveDateTimeobservation.effectiveTime.valueFormat datetime using function formatDateTime
valueFunction createObservationValue maps either a CodeableConcept or an object
rangeFunction createObservationRange maps reference ranges for observation
interpretation.codeinterpretationCode.codeObservation interpretation code
interpretation.systeminterpretationCode.codeSystemLookup codeSystem using mapCodeableConcept
bodySite.codeobservation.targetSiteCode.codeBody Site code
bodySite.systemConstant bodySiteSystem from fhirConstants.Observation
subject.referencepatientIdPatient ID created from recordTarget

fun createObservationValue (inValue)

Function to create value for US Core Observation using CDA C-CDA XML value.

param inValue is the XML complex type for value in C-CDA.
return Either a valueCodeableConcept or value quantity type.

fun createObservationRange (inValue)

Function to create ObservationRange for US Core Observation using C-CDA XML value.

param inValue is the XML complex type for value in C-CDA.
return a referenceRange element

fun ObservationStatusLookup (incode)

Function to convert C-CDA observation status to US Core Observation status.

param incode is the input observation status in C-CDA format.
return A FHIR format status code equivalent.

(back to top)

createFHIRR4Organization

This module implements functions to support creation of FHIR R4 Organization.

Source: .src/main/resources/dwl/fhirUtil/createFHIRR4Organization.dwl

Functions

fun createOrganization (org, fhirOrgConstants, orgId)

Function to create FHIR R4 Organization from CDA input XML request. Uses getIdentifier functions from cdaToFHIRTools.

param org is a resource of C-CDA Organization type.
param fhirOrgConstants is the list of constants used.
param orgId is the ID to be used for creating the resource.
return A FHIR format Observation resource.

FHIR R4 Element NameC-CDA Element NameMapping Description
idId generated using GUID for resource
text.statusConstant "generated"
text.divorg.textNarrative that contains a summary of the resource in encoded format
identifier.systemorg.idIdentifier system for resource
identifier.valueorg.idIdentifier value for resource
nameorg.nameOrg name
address.useorg.addr.useOrg Address Use
address.lineorg.addr.streetAddressLineOrg Address Line
address.cityorg.addr.cityOrg Address City
address.stateorg.addr.stateOrg Address State
address.postalCodeorg.addr.postalCodeOrg Address Postal Code
address.countryorg.addr.countryOrg Address Country
address.period.startorg.addr.useablePeriod.low.valueOrg Address used Start Date
address.period.endorg.addr.useablePeriod.high.valueOrg Address used End Date
telecom.systemused telecomSystemLookup to lookup system value
telecom.valueorg.telecom.valueOrg's communication details
telecom.useorg.telecom.useUsed telecomUseLookup function to lookup telecom use value
telecom.period.startorg.telecom.useablePeriod.low.valueTelecom system used start date
telecom.period.endorg.telecom.useablePeriod.high.valueTelecom system used end date

(back to top)

createFHIRR4Patient

This module implements functions to support creation of FHIR R4 Patient.

Source: .src/main/resources/dwl/fhirUtil/createFHIRR4Patient.dwl

Functions

fun createPatient (patientRole, fhirPatientConstants, birthSex, patientId)

Function to create FHIR R4 Patient from CDA input XML request with parameters patientRole, fhirPatientConstants,birthSex.

param patientRole is an object from the CDA input XML under recordTarget, containing patient information.
param fhirPatientConstants is a list of constants used for creating patient resource.
param birthSex is the assigned sex at birth of the patient. Generated from CCD's Social History template.
param patientId is the ID to be used for Patient resource.
return A FHIR formatted Patient object.

FHIR R4 Element NameC-CDA Element NameMapping Description
idId generated using GUID for resource
extension.valueCoding.systemConstant ombRaceCategorySystem from fhirConstants.Patient
extension.valueCoding.codepatientRole.patient.raceCode.codePatient's race code
extension.valueCoding.displaypatientRole.patient.raceCode.displayNamePatient's race name
extension.urlConstant raceCategoryText from fhirConstants.Patient
extension.valueStringpatientRole.patient.raceCode.displayName
urlConstant ombRaceUrl from fhirConstants.Patient
identifier.type.systemConstant identifierSystem from fhirConstants.Patient
identifier.type.codeConstant identifierCode from fhirConstants.Patient
identifier.valuepatientRole.id.extensionPatient Identifier
identifier.systemConstant identifierValueSystem from fhirConstants.Patient
activeConstant "true"
name.usepatientRole.patient.name.useUsed nameUseLookup function to lookup use value.
name.familypatientRole.patient.name.familyPatient's family name
name.givenpatientRole.patient.name.givenPatient's given name
name.prefixpatientRole.patient.name.prefixPatient's name prefix
name.suffixpatientRole.patient.name.suffixPatient's name suffix
name.period.startpatientRole.patient.name.validTime.low.valuePatient's name used period start date
name.period.endpatientRole.patient.name.validTime.high.valuePatient's name used period end date
birthDatepatientRole.patient.birthTime.valueFormat datetime using function formatDateTime
telecom.systemUsed telecomSystemLookup to lookup system value
telecom.valuepatientRole.patient.telecom.phone.valuePatient's telecom details
telecom.usepatientRole.patient.telecom.phone.useUsed telecomUseLookup function to lookup telecom use value
telecom.period.startpatient.telecom.useablePeriod.low.valueTelecom system used period start date
telecom.period.endpatient.telecom.useablePeriod.high.valueTelecom system used period end date
genderpatientRole.patient.administrativeGenderCode.codeLookup gender code using function genderLookup
address.usepatientRole.addr.useAddress use value
address.linepatientRole.addr.streetAddressLinePatient's street address
address.citypatientRole.addr.cityPatient's Address city
address.statepatientRole.addr.statePatient's Address state
address.postalCodepatientRole.addr.postalCodePatient's Address postalCode
address.countrypatientRole.addr.countryPatient's Address country
address.period.startpatientRole.addr.useablePeriod.low.valuePatient's Address used period start date
address.period.endpatientRole.addr.useablePeriod.high.valuePatient's Address used period end date
maritalStauts.coding.systemConstant maritalStatusSystem from fhirConstants.Patient
maritalStauts.coding.codepatientRole.patient.maritalStatusCode.codePatient's marital status code
maritalStauts.coding.displaypatientRole.patient.maritalStatusCode.displayNamePatient's marital status display
contact.relationship.coding.systemConstant contactRelationshipSystem from fhirConstants.Patient
contact.relationship.coding.codepatientRole.patient.guardian.code.codeConditionally set to "C" or "N"
contact.relationship.coding.displayConditionally set to "Emergency Contact" or "Next-of-Kin"
contact.name.usepatientRole.patient.guardian.contact.guardianPerson.name.useUsed nameUseLookup function to lookup use value.
contact.name.familypatientRole.patient.guardian.guardianPerson.name.familyPatient's Guardian's family name
contact.name.givenpatientRole.patient.guardian.guardianPerson.name.givenPatient's Guardian's given name
contact.name.prefixpatientRole.patient.guardian.guardianPerson.name.prefixPatient's Guardian's name prefix
contact.name.suffixpatientRole.patient.guardian.guardianPerson.name.suffixPatient's Guardian's name suffix
contact.name.period.startpatientRole.patient.guardian.guardianPerson.name.validTime.low.valuePatient's Guardian's name used period start date
contact.name.period.endpatientRole.patient.guardian.guardianPerson.name.validTime.high.valuePatient's Guardian's name used period end date
contact.telecom.systemUsed telecomSystemLookup to lookup system value
contact.telecom.valuepatientRole.patient.guardian.telecom.phone.valuePatient's Guardian's telecom details
contact.telecom.usepatientRole.patient.guardian.telecom.phone.useUsed telecomUseLookup function to lookup telecom use value
contact.telecom.period.startpatientRole.patient.guardian.telecom.useablePeriod.low.valueTelecom system used period start date
contact.telecom.period.endpatientRole.patient.guardian.telecom.useablePeriod.high.valueTelecom system used period end date
contact.address.usepatientRole.patient.guardian.addr.useAddress use value
contact.address.linepatientRole.patient.guardian.addr.streetAddressLinePatient's Guardian's street address
contact.address.citypatientRole.patient.guardian.addr.cityPatient's Guardian's Address city
contact.address.statepatientRole.patient.guardian.addr.statePatient's Guardian's Address state
contact.address.postalCodepatientRole.patient.guardian.addr.postalCodePatient's Guardian's Address postalCode
contact.address.countrypatientRole.patient.guardian.addr.countryPatient's Guardian's Address country
contact.address.period.startpatientRole.patient.guardian.addr.useablePeriod.low.valuePatient's Guardian's Address used period start date
contact.address.period.endpatientRole.patient.guardian.addr.useablePeriod.high.valuePatient's Guardian's Address used period end date
communication.language.coding.systemConstant communicationLangaugeSystem from fhirConstants.Patient
communication.language.coding.codepatientRole.patient.languageCommunication.languageCode.codePatient's language of communication
communication.preferredpatientRole.patient.languageCommunication.preferenceInd.valueConditionally true or false based on the C-CDA element

fun mapPatientIdentifier (patientRole, fhirPatientConstants)

Maps the PatientIdentifier.

param patientRole is a String with the Patient Identifier information.
param fhirPatientConstants is a list of constants used for creating patient resource.
return A Patient Identifier object with the FHIR formatted structure.

(back to top)

createFHIRR4Practitioner

This module implements functions to support creation of FHIR R4 Practitioner.

Source: .src/main/resources/dwl/fhirUtil/createFHIRR4Practitioner.dwl

Functions

fun createPractitioner (pract, fhirPractConstants, practId)

Function to create FHIR R4 Practitioner from CDA input XML request. Uses getIdentifier functions from cdaToFHIRTools.

param pract is a resource of C-CDA Practitioner type.
param fhirPractConstants is the list of constants used.
param practId is the ID to be used for creating the resource.
return A FHIR format Practitioner resource.

FHIR R4 Element NameC-CDA Element NameMapping Description
idId generated using GUID for resource
identifier.systempract.idIdentifier system for resource
identifier.valuepract.idIdentifier value for resource
name.usepract.assignedPerson.name.useUsed nameUseLookup function to lookup use value.
name.familypract.assignedPerson.name.familyPractitioner's family name
name.givenpract.assignedPerson.name.givenPractitioner's given name
name.prefixpract.assignedPerson.name.prefixPractitioner's name prefix
name.suffixpract.assignedPerson.name.suffixPractitioner's name suffix
name.period.startpract.assignedPerson.name.validTime.low.valuePractitioner's name used period start date
name.period.endpract.assignedPerson.name.validTime.high.valuePractitioner's name used period end date
address.usepract.addr.useAddress use value
address.linepract.addr.streetAddressLinePractitioner's street address
address.citypract.addr.cityPractitioner's Address city
address.statepract.addr.statePractitioner's Address state
address.postalCodepract.addr.postalCodePractitioner's Address postalCode
address.countrypract.addr.countryPractitioner's Address country
address.period.startpract.addr.useablePeriod.low.valuePractitioner's Address used period start date
address.period.endpract.addr.useablePeriod.high.valuePractitioner's Address used period end date
telecom.systemUsed telecomSystemLookup to lookup system value
telecom.valuepract.telecom.phone.valuePractitioner's telecom details
telecom.usepract.telecom.phone.useUsed telecomUseLookup function to lookup telecom use value
telecom.period.startpract.telecom.useablePeriod.low.valueTelecom system used period start date
telecom.period.endpract.telecom.useablePeriod.high.valueTelecom system used period end date
qualification.codepract.code.codePractitioner's Qualification Code
qualification.displaypract.code.displayNamePractitioner's Qualification display name
qualification.systemPractitioner's Qualification System from fhirConstants's Practitioner

fun buildPractitioners (practitioners, fhirPractConstants)

Function to create a list of FHIR R4 practitioners using input C-CDA's informants, author, legalAuthenticator. Uses createPractitioner from dwl.fhirUtil.

param practitioners is the list of practitioners in C-CDA format.
param fhirPractConstants is a list of constants used for creating Practitioners.
return An array of FHIR R4 formated Practitioners.

fun buildPractitionersforRef (performers, practList, fhirPractConstants)

Function to build FHIR R4 Practitioners from Planned Procedures.

param performers a list of authors for planned procedure.
param practList is the list of informant practitioners from Header.
return An array of FHIR R4 Practitioners List.

fun buildPractRefList (perfList, practList)

Function to build a reference list of practitioners for Planned Procedure Service Request creation.

param perfList a list of authors for planned procedure.
param practList is the list of informant practitioners from Header.
return An array of id and identfiers of practitioners

fun getPractitionerRef (practList, authorId)

Function to fetch practitioner id from list.

param practList is a list of practitioner's IDs and Identifiers.
param authorId is the id to use for matching.
return A reference if a match is found else null.

(back to top)

createFHIRR4Procedure

This module implements functions to support creation of FHIR R4 Procedure.

Source: .src/main/resources/dwl/fhirUtil/createFHIRR4Procedure.dwl

Functions

fun getPerformerRefs (perfList, procRefType, refIdent)

Function to create performer reference.

param perfList is the list of practitioners created.
param procRefType is a literal with either "Organization" or "Practitioner" for creating reference.
param refIdent is the identifier value to be used for lookup perfList's ID.
return A reference of type Organization or Practitioner.

fun createProcedure (proc, fhirProcConstants, patientId, procId, perfList, procType)

Function to create FHIR R4 Procedure from CDA input XML request. Uses formatDateTime,getIdentifier functions from cdaToFHIRTools.

param proc is the procedure component.
param fhirProcPersonConstants is the list of constants used to create related person FHIR resource.
param patientId is used as reference to patient in the related person resource.
param procId is the ID to be used for creating the resource.
param perfList is the list of practitioners.
param procType is a literal that identifies a Planned procedure vs a performed procedure.
return A FHIR format Procedure resource.

FHIR R4 Element NameC-CDA Element NameMapping Description
idId generated using GUID for resource
text.statusConstant "generated"
text.divproc.textNarrative that contains a summary of the resource in encoded format
identifier.systemproc.idIdentifier system for resource
identifier.valueproc.idIdentifier value for resource
stateproc.statusCode.codeConditionally set to "preparation"
code.codeproc.code.codeProcedure Code
code.displayproc.code.displayNameProcedure Name
code.systemConstant codeSystem from fhirConstants.Procedure
performedDateTimeproc.effectiveTime.valueFormat datetime using function formatDateTime
bodySite.codeproc.targetSiteCode.codeProcedure body site code
bodySite.displayproc.targetSiteCode.displayNameProcedure body site name
bodySite.systemConstant bodySiteSystem from fhirConstants.Procedure
subject.referencepatientIdPatient Id created from recordTarget
performer.referenceproc.author.assignedAuthor.id or performer.assignedEntity.representedOrganization.idUse function getPerformerRefs to fetch reference

(back to top)

createFHIRR4RelatedPerson

This module implements Create RelatedPersons for C-CDA to FHIR conversion.

Source: .src/main/resources/dwl/fhirUtil/createFHIRR4RelatedPerson.dwl

Functions

fun createRelatedPerson (relatedPerson, fhirRelatedPersonConstants, patientId, relPerId)

Function to create FHIR R4 RelatedPerson from CDA input XML request. Uses relationshipLookup and addressUseLookup functions from cdaToFhirTools library.

param relatedPerson is the relatedPerson component.
param fhirRelatedPersonConstants is the list of constants used to create related person FHIR resource.
param patientId is used as reference to patient in the related person resource.
param relPerId is the ID to be used for creating the resource .
return An array of FHIR formatted relatedPerson array.

FHIR R4 Element NameC-CDA Element NameMapping Description
idId generated using GUID for resource
identifier.systemrelatedPerson.idIdentifier system for resource
identifier.valuerelatedPerson.idIdentifier value for resource
patient.referencepatientIdPatient Id created from recordTarget
relationship.systemConstant relationshipSystem from fhirConstants.RelatedPerson
relationship.coderelatedPerson.associatedEntity.classCodeLookup using function relationshipLookup
activeConstant value "true"
name.userelatedPerson.associatedEntity.associatedPerson.name.useUsed nameUseLookup function to lookup use value.
name.familyrelatedPerson.associatedEntity.associatedPerson.name.familyRelatedPerson's family name
name.givenrelatedPerson.associatedEntity.associatedPerson.name.givenRelatedPerson's given name
name.prefixrelatedPerson.associatedEntity.associatedPerson.name.prefixRelatedPerson's name prefix
name.suffixrelatedPerson.associatedEntity.associatedPerson.name.suffixRelatedPerson's name suffix
name.period.startrelatedPerson.associatedEntity.associatedPerson.name.validTime.low.valueRelatedPerson's name used period start date
name.period.endrelatedPerson.associatedEntity.associatedPerson.name.validTime.high.valueRelatedPerson's name used period end date
telecom.systemUsed telecomSystemLookup to lookup system value
telecom.valuerelatedPerson.associatedEntity.telecom.phone.valueRelatedPerson's telecom details
telecom.userelatedPerson.associatedEntity.telecom.phone.useUsed telecomUseLookup function to lookup telecom use value
telecom.period.startrelatedPerson.associatedEntity.telecom.useablePeriod.low.valueTelecom system used period start date
telecom.period.endrelatedPerson.associatedEntity.telecom.useablePeriod.high.valueTelecom system used period end date
address.userelatedPerson.associatedEntity.addr.useAddress use value
address.linerelatedPerson.associatedEntity.addr.streetAddressLineRelatedPerson's street address
address.cityrelatedPerson.associatedEntity.addr.cityRelatedPerson's Address city
address.staterelatedPerson.associatedEntity.addr.stateRelatedPerson's Address state
address.postalCoderelatedPerson.associatedEntity.addr.postalCodeRelatedPerson's Address postalCode
address.countryrelatedPerson.associatedEntity.addr.countryRelatedPerson's Address country
address.period.startrelatedPerson.associatedEntity.addr.useablePeriod.low.valueRelatedPerson's Address used period start date
address.period.endrelatedPerson.associatedEntity.addr.useablePeriod.high.valueRelatedPerson's Address used period end date

(back to top)

createFHIRR4ServiceRequest

This module implements functions to support creation of FHIR R4 ServiceRequest.

Source: .src/main/resources/dwl/fhirUtil/createFHIRR4ServiceRequest.dwl

Functions

fun createServiceRequest (servReq, servReqId, patientId, fhirServReqConstants, practList)

Function to create ServiceRequest FHIR object from incoming C-CDA Request. Uses getIdentifier,formatDateTime,servReqStatusLookup,mapCodeSystem function from cdaToFHIRTools and getPractitionerRef.

param servReq is an object from the CDA input XML, containing ServiceRequest information.
param fhirServReqConstants is a list of constants to be used for mapping.
param servReqId is the ID for the resource.
param patientId is the patient ID.
return A FHIR formatted ServiceRequest object.

FHIR R4 Element NameC-CDA Element NameMapping Description
idId generated using GUID for resource
text.statusConstant "generated"
text.divservReq.textNarrative that contains a summary of the resource in encoded format
identifier.systemservReq.idIdentifier system for resource
identifier.valueservReq.idIdentifier value for resource
statusservReq.statusCode.codeLookup statusCode using function servReqStatusLookup
occurrenceDateTimeservReq.effectiveTime.valueFormat datetime using function formatDateTime
intentConstant value "proposal" and can update as needed
code.systemservReq.code.codeSystemConvert codeSystem using function mapCodeSystem
code.codeservReq.code.codeService Request Code
code.displayservReq.code.displayNameDisplay Name for Service Request code
subject.referencepatientIdPatientId from recordTarget
authoredOnservReq.author.time.valueFormat datetime using function formatDateTime
author.referenceservReq.author.assignedAuthor.id.extensionUse function getPractitionerRef for lookup

(back to top)


Reviews

TypeTemplate
OrganizationMulesoft Inc.
Published by
MuleSoft Solutions
Published onFeb 26, 2024
Asset overview

Asset versions for 1.0.x

Asset versions
VersionActions
1.0.8
1.0.7
1.0.6
1.0.5
1.0.4
1.0.3
1.0.2
1.0.1
1.0.0