health.fhir.r4utils.ccdatofhir
Module health.fhir.r4utils.ccdatofhir
API
ballerinax/health.fhir.r4utils.ccdatofhir Ballerina library
C-CDA to FHIR Package
Package containing C-CDA to FHIR pre-built mapping functionalities.
Package Overview
This package implements the CCDA to FHIR implementation guide (http://build.fhir.org/ig/HL7/ccda-on-fhir/CF-index.html).
- C-CDA Allergy Intolerance Observation to FHIR USCore Allergy Intolerance Profile.
- C-CDA Problem observation to FHIR USCore Condition Profile.
- C-CDA Results to FHIR USCore Diagnostic Report Profile.
- C-CDA Immunization Activity to FHIR USCore Immunization Profile.
- C-CDA Medication Activity to FHIR USCore Medication Profile.
- C-CDA Patient Role Header to FHIR USCore Patient Profile.
- C-CDA Author Header to FHIR USCore Practitioner Profile.
- C-CDA Procedure Activity to FHIR USCore Procedure Profile.
Functions
ccdaToDocumentReference
function ccdaToDocumentReference(xml actElement, xml parentDocument) returns USCoreDocumentReferenceProfile?
Map CCDA DocumentReference to FHIR DocumentReference
Return Type
- USCoreDocumentReferenceProfile? - FHIR DocumentReference
ccdaToEncounter
Maps C-CDA Encounter Activity or EncompassingEncounter to FHIR Encounter resource.
Parameters
- document xml - C-CDA Encounter Activity or EncompassingEncounter XML element
- parentDocument xml - C-CDA document XML element
Return Type
- Resource[] - Mapped USCore Encounter Profile or () if mapping fails
ccdaToFhir
function ccdaToFhir(xml? ccda, CcdaToFhirMapper? customMapper) returns Bundle|FHIRError
Transform an C-CDA message to FHIR.
Parameters
- ccda xml? - C-CDA message as a xml
- customMapper CcdaToFhirMapper? (default ()) - Custom mapper to be used for the transformation
Return Type
- Bundle|FHIRError - FHIR Bundle
getElementByID
Retrieves an XML element by its ID attribute.
Parameters
- xmlElement xml - the XML element to search within
- id string - the ID of the element to find
Return Type
- xml? - the XML element with the specified ID, or null if not found
getOperationOutcome
function getOperationOutcome(string detail) returns OperationOutcome
getOperationOutcome - Returns an OperationOutcome resource with the given detail
Parameters
- detail string - detail of the error
Return Type
- OperationOutcome - OperationOutcome resource
mapCcdaAddressToFhirAddress
function mapCcdaAddressToFhirAddress(xml addressElements) returns Address[]?
Map C-CDA address to FHIR Address.
Parameters
- addressElements xml - C-CDA address element
Return Type
- Address[]? - Return FHIR Address
mapCcdaAssigningAuthorityToFhirAssigner
Map C-CDA assigningAuthorityName to FHIR Identifier assigner.display
Parameters
- idElement xml - C-CDA id element
Return Type
- string? - Return FHIR Identifier assigner.display
mapCcdaAwarenessCodeToFhirAwarenessCode
function mapCcdaAwarenessCodeToFhirAwarenessCode(xml awarenessCodeElement, xml parentDocument) returns CodeableConcept?
Maps C-CDA awareness code to FHIR awareness code
Parameters
- awarenessCodeElement xml - The C-CDA awareness code element
- parentDocument xml - The parent document of the C-CDA
Return Type
- CodeableConcept? - The mapped FHIR awareness code
mapCcdaCodingsToFhirCodings
function mapCcdaCodingsToFhirCodings(xml codingElements) returns Coding[]?
Map C-CDA codes to FHIR Coding.
Parameters
- codingElements xml - C-CDA code element
Return Type
- Coding[]? - Return FHIR Coding
mapCcdaCodingToFhirCodeableConcept
function mapCcdaCodingToFhirCodeableConcept(xml codingElement, xml parentDocument) returns CodeableConcept?
Map C-CDA code to FHIR CodeableConcept.
Return Type
- CodeableConcept? - Return FHIR CodeableConcept
mapCcdaCodingToFhirCoding
function mapCcdaCodingToFhirCoding(xml codingElement) returns Coding?
Map C-CDA code to FHIR Coding.
Parameters
- codingElement xml - C-CDA code element
Return Type
- Coding? - Return FHIR Coding
mapCcdaDateTimeToFhirDateTime
function mapCcdaDateTimeToFhirDateTime(xml dateTimeElement) returns dateTime?
Map C-CDA dateTime to FHIR dateTime.
Parameters
- dateTimeElement xml - C-CDA dateTime element
Return Type
- dateTime? - Return FHIR dateTime
mapCcdaFunctionCodeToFhirFunctionCode
function mapCcdaFunctionCodeToFhirFunctionCode(xml functionCodeElement, xml parentDocument) returns CodeableConcept?
Maps C-CDA participant function code to FHIR function code
Parameters
- functionCodeElement xml - The C-CDA function code element
- parentDocument xml - The parent document of the C-CDA
Return Type
- CodeableConcept? - The mapped FHIR function code
mapCcdaIdToFhirIdentifier
function mapCcdaIdToFhirIdentifier(xml idElement) returns USCorePatientProfileIdentifier?
Map C-CDA id to FHIR Identifier.
Parameters
- idElement xml - C-CDA id element
Return Type
- USCorePatientProfileIdentifier? - Return FHIR Identifier
mapCcdaIntervalToFhirPeriod
function mapCcdaIntervalToFhirPeriod(xml ivlTsElement) returns Period?
Map C-CDA interval timestamp to FHIR Period
Parameters
- ivlTsElement xml - C-CDA interval timestamp element
Return Type
- Period? - Return FHIR Period
mapCcdaModeCodeToFhirModeCode
function mapCcdaModeCodeToFhirModeCode(xml modeCodeElement, xml parentDocument) returns CodeableConcept?
Maps C-CDA mode code to FHIR mode code
Parameters
- modeCodeElement xml - The C-CDA mode code element
- parentDocument xml - The parent document of the C-CDA
Return Type
- CodeableConcept? - The mapped FHIR mode code
mapCcdaNameToFhirName
function mapCcdaNameToFhirName(xml nameElements) returns HumanName[]?
Map C-CDA name to FHIR HumanName.
Parameters
- nameElements xml - C-CDA name element
Return Type
- HumanName[]? - Return FHIR HumanName
mapCcdaNametoFhirPractitionerName
function mapCcdaNametoFhirPractitionerName(xml nameElement) returns USCorePractitionerProfileName?
Map C-CDA name to FHIR Practitioner HumanName.
Parameters
- nameElement xml - C-CDA name element
Return Type
- USCorePractitionerProfileName? - Return FHIR HumanName
mapCcdaOrganizationPartOfToFhirPartOf
function mapCcdaOrganizationPartOfToFhirPartOf(xml partOfElement) returns Reference?
Maps C-CDA organization part-of to FHIR organization part-of
Parameters
- partOfElement xml - The C-CDA organization part-of element
Return Type
- Reference? - The mapped FHIR organization part-of reference
mapCcdaParticipantTimeToFhirPeriod
function mapCcdaParticipantTimeToFhirPeriod(xml timeElement) returns Period?
Maps C-CDA participant time to FHIR period
Parameters
- timeElement xml - The C-CDA time element
Return Type
- Period? - The mapped FHIR period
mapCcdaParticipantToFhirDevice
function mapCcdaParticipantToFhirDevice(xml participantElement) returns Reference
Maps C-CDA participant to FHIR Device
Parameters
- participantElement xml - The C-CDA participant element
Return Type
- Reference - The mapped FHIR Device reference
mapCcdaParticipantToFhirLocation
function mapCcdaParticipantToFhirLocation(xml participantElement) returns Reference
Maps C-CDA participant to FHIR Location
Parameters
- participantElement xml - The C-CDA participant element
Return Type
- Reference - The mapped FHIR Location reference
mapCcdaParticipantToFhirOrganization
function mapCcdaParticipantToFhirOrganization(xml participantElement) returns Reference
Maps C-CDA participant to FHIR Organization
Parameters
- participantElement xml - The C-CDA participant element
Return Type
- Reference - The mapped FHIR Organization reference
mapCcdaParticipantToFhirPractitioner
function mapCcdaParticipantToFhirPractitioner(xml participantElement) returns Reference
Maps C-CDA participant to FHIR Practitioner
Parameters
- participantElement xml - The C-CDA participant element
Return Type
- Reference - The mapped FHIR Practitioner reference
mapCcdaParticipantToFhirPractitionerRole
function mapCcdaParticipantToFhirPractitionerRole(xml participantElement) returns Reference
Maps C-CDA participant to FHIR PractitionerRole
Parameters
- participantElement xml - The C-CDA participant element
Return Type
- Reference - The mapped FHIR PractitionerRole reference
mapCcdaParticipantToFhirRelatedPerson
function mapCcdaParticipantToFhirRelatedPerson(xml participantElement) returns Reference
Maps C-CDA participant to FHIR RelatedPerson
Parameters
- participantElement xml - The C-CDA participant element
Return Type
- Reference - The mapped FHIR RelatedPerson reference
mapCcdaParticipantTypeToFhirType
function mapCcdaParticipantTypeToFhirType(string typeCode) returns CodeableConcept?
Maps C-CDA participant type code to FHIR participant type
Parameters
- typeCode string - The C-CDA participant type code
Return Type
- CodeableConcept? - The mapped FHIR participant type
mapCcdaPatientRelationshipToFhirRelationship
function mapCcdaPatientRelationshipToFhirRelationship(xml relationshipElement, xml parentDocument) returns CodeableConcept?
Maps C-CDA patient relationship to FHIR relationship
Parameters
- relationshipElement xml - The C-CDA patient relationship element
- parentDocument xml - The parent document of the C-CDA
Return Type
- CodeableConcept? - The mapped FHIR relationship
mapCcdaPeriodicIntervalToFhirTiming
Map C-CDA periodic interval to FHIR Timing
Parameters
- pivlTsElement xml - C-CDA periodic interval element
Return Type
- Timing?|error - Return FHIR Timing
mapCcdaStandardIndustryClassCodeToFhirType
function mapCcdaStandardIndustryClassCodeToFhirType(xml standardIndustryClassCodeElement, xml parentDocument) returns CodeableConcept?
Maps C-CDA standard industry class code to FHIR organization type
Parameters
- standardIndustryClassCodeElement xml - The C-CDA standard industry class code element
- parentDocument xml - The parent document of the C-CDA
Return Type
- CodeableConcept? - The mapped FHIR organization type
mapCcdaTelecomToFhirContactPoint
function mapCcdaTelecomToFhirContactPoint(xml telecomElement) returns ContactPoint?
Map C-CDA telecom to FHIR ContactPoint.
Parameters
- telecomElement xml - C-CDA telecom element
Return Type
- ContactPoint? - Return FHIR ContactPoint
mapCcdaTelecomToFhirPatientTelecom
function mapCcdaTelecomToFhirPatientTelecom(xml telecomElement) returns USCorePatientProfileTelecom?
Map C-CDA telecom to FHIR Patient ContactPoint.
Parameters
- telecomElement xml - C-CDA telecom element
Return Type
- USCorePatientProfileTelecom? - Return FHIR ContactPoint
mapCcdaTelecomToFhirTelecom
function mapCcdaTelecomToFhirTelecom(xml telecomElements) returns ContactPoint[]?
Map C-CDA telecom to FHIR ContactPoint.
Parameters
- telecomElements xml - C-CDA telecom element
Return Type
- ContactPoint[]? - Return FHIR ContactPoint
mapCcdaTimestampToFhirDateTime
function mapCcdaTimestampToFhirDateTime(xml tsElement) returns dateTime?
Map C-CDA timestamp to FHIR dateTime
Parameters
- tsElement xml - C-CDA timestamp element
Return Type
- dateTime? - Return FHIR dateTime
mapCcdaUuidToFhirIdentifier
function mapCcdaUuidToFhirIdentifier(xml idElement) returns USCorePatientProfileIdentifier?
Map C-CDA II with UUID root to FHIR Identifier
Parameters
- idElement xml - C-CDA id element
Return Type
- USCorePatientProfileIdentifier? - Return FHIR Identifier
mapOidToUri
Map C-CDA OID to FHIR codesystems.
Parameters
- oid string - C-CDA OID
Return Type
- string - Return FHIR codesystems
Records
health.fhir.r4utils.ccdatofhir: CcdaToFhirMapper
CcdaToFhir Mapper function implementation holder record.
Fields
- ccdaToAllergyIntolerance CcdaToAllergyIntolerance - C-CDA Allergy Intolerance Activity to USCore Allergy Intolerance function.
- ccdaToImmunization CcdaToImmunization - C-CDA Immunization Activity to USCore Immunization function.
- ccdaToMedication CcdaToMedication - C-CDA Medication Activity to USCore Medication function.
- ccdaToPatient CcdaToPatient - C-CDA US Realm Record Target to USCore Patient function.
- ccdaToCondition CcdaToCondition - C-CDA Problem Concern Activity to USCore Condition function.
- ccdaToProcedure CcdaToProcedure - C-CDA Procedure Acitivity to USCore Procedure function.
- ccdaToDiagnosticReport CcdaToDiagnosticReport - C-CDA Diagnostic Imaging Report to USCore DiagnosticReport function.
- ccdaToPractitioner CcdaToPractitioner - C-CDA Author Header to USCore Practitioner function
- ccdaToEncounter CcdaToEncounter - C-CDA Encounter Activity to USCore Encounter function
- ccdaToDocumentReference CcdaToDocumentReference - C-CDA Document Reference Activity to USCore DocumentReference function
Function types
health.fhir.r4utils.ccdatofhir: CcdaToAllergyIntolerance
function(xml, xml) returns ([USCoreAllergyIntolerance, USCoreProvenance?]?)
CcdaToAllergyIntolerance
#################################################################################################### Mapping function definitions for C-CDA to FHIR #################################################################################################### Mapping function type for C-CDA Allergy Intolerance Activity to USCore Allergy Intolerance FHIR resource.
health.fhir.r4utils.ccdatofhir: CcdaToImmunization
function(xml, xml) returns (USCoreImmunizationProfile?)
CcdaToImmunization
Mapping function type for C-CDA Immunization Activity to USCore Immunization FHIR resource.
health.fhir.r4utils.ccdatofhir: CcdaToMedication
function(xml, xml) returns (USCoreMedicationRequestProfile?)
CcdaToMedication
Mapping function type for C-CDA Medication Activity to USCore Medication FHIR resource.
health.fhir.r4utils.ccdatofhir: CcdaToPatient
function(xml, xml) returns (USCorePatientProfile?)
CcdaToPatient
Mapping function type for C-CDA US Realm Record Target to USCore Patient FHIR resource.
health.fhir.r4utils.ccdatofhir: CcdaToCondition
function(xml, xml, xml) returns (USCoreCondition?)
CcdaToCondition
Mapping function type for C-CDA Problem Concern Activity to USCore Condition FHIR resource.
health.fhir.r4utils.ccdatofhir: CcdaToProcedure
function(xml, xml) returns (USCoreProcedureProfile?)
CcdaToProcedure
Mapping function type for C-CDA Procedure Acitivity to USCore Procedure FHIR resource.
health.fhir.r4utils.ccdatofhir: CcdaToDiagnosticReport
function(xml, xml) returns (USCoreDiagnosticReportProfileLaboratoryReporting?)
CcdaToDiagnosticReport
Mapping function type for C-CDA Diagnostic Imaging Report to USCore DiagnosticReport FHIR resource.
health.fhir.r4utils.ccdatofhir: CcdaToEncounter
function(xml, xml) returns (Resource[])
CcdaToEncounter
Mapping function type for C-CDA Encounter Activity to USCore Encounter FHIR resource.
Import
import ballerinax/health.fhir.r4utils.ccdatofhir;
Metadata
Released date: 9 days ago
Version: 3.0.2
Compatibility
Platform: any
Ballerina version: 2201.12.2
GraalVM compatible: Yes
Pull count
Total: 691
Current verison: 32
Weekly downloads
Keywords
Healthcare
FHIR
R4
Utils
CCDAtoFHIR
Contributors