health.hl7v23.utils.v2tofhirr4
Module health.hl7v23.utils.v2tofhirr4
API
Definitions
ballerinax/health.hl7v23.utils.v2tofhirr4 Ballerina library
Package containing HL7v2.3 to FHIR pre-built mapping functionalities.
HL7v2 to FHIR Package
Package Overview
This package implements the HL7 version 2.3 to FHIR implementation guide (https://build.fhir.org/ig/HL7/v2-to-fhir/branches/master/datatype_maps.html).
Note:
From Ballerina Swan Lake Update 10 upwards, --optimize-dependency-compilation flag is
introduced to optimize the memory usage during the compilation time.
Use the flag in the build command as follows,
bal build --optimize-dependency-compilation
or add as a config in the Ballerina.toml file.
[build-options] optimizeDependencyCompilation = true
Functions
al1ToAllerygyIntolerance
function al1ToAllerygyIntolerance(Al1 al1) returns AllergyIntoleranceParameters
- al1 Al1 -
ceToCode
Parameters
- ce Ce -
ceToCodeableConcept
function ceToCodeableConcept(Ce ce) returns CodeableConceptParameters
- ce Ce -
ceToCodeableConcepts
function ceToCodeableConcepts(Ce ce) returns CodeableConcept[]Parameters
- ce Ce -
ceToCoding
Parameters
- ce Ce -
ceToCodings
Parameters
- ce Ce -
ceToUri
Parameters
- ce Ce -
dg1ToCondition
Parameters
- dg1 Dg1 -
dg1ToEncounter
dg1ToEpisodeOfCare
function dg1ToEpisodeOfCare(Dg1 dg1, string? conditionId, string? patientId) returns EpisodeOfCaredtmToDateTime
Parameters
- ts Dtm -
dtmToInstant
Parameters
- ts Dtm -
eiToCoding
Parameters
- ei Ei -
eiToIdentifier
function eiToIdentifier(Ei ei) returns IdentifierParameters
- ei Ei -
eiToReferenceWithType
evnToProvenance
function evnToProvenance(Evn evn) returns ProvenanceParameters
- evn Evn -
generateFhirResourceId
function generateFhirResourceId() returns stringhdToMessageHeaderDestination
function hdToMessageHeaderDestination(Hd hd) returns MessageHeaderDestinationParameters
- hd Hd -
hdToMessageHeaderSource
function hdToMessageHeaderSource(Hd hd) returns MessageHeaderSourceParameters
- hd Hd -
hl7DateToFhir
Parameters
- hl7Date string -
idToAddressType
function idToAddressType(Id id) returns AddressTypeParameters
- id Id -
idToAddressUse
function idToAddressUse(Id id) returns AddressUse?Parameters
- id Id -
idToCodeableConcept
function idToCodeableConcept(ID id) returns CodeableConcept?Parameters
- id ID -
idToCodeableConceptArray
function idToCodeableConceptArray(Id id) returns CodeableConcept[]Parameters
- id Id -
idToCoding
Parameters
- id ID -
idToContactPointSystem
function idToContactPointSystem(Id id) returns ContactPointSystemParameters
- id Id -
idToContactPointUse
function idToContactPointUse(Id id) returns ContactPointUseParameters
- id Id -
idToDiagnosticReportStatus
function idToDiagnosticReportStatus(ID id) returns DiagnosticReportStatusParameters
- id ID -
idToHumanNameUse
function idToHumanNameUse(Id id) returns HumanNameUseParameters
- id Id -
idToServiceRequestPriority
function idToServiceRequestPriority(ID id) returns ServiceRequestPriorityParameters
- id ID -
isToAllergyIntoleranceCategory
function isToAllergyIntoleranceCategory(Is 'is) returns AllergyIntoleranceCategoryParameters
- 'is Is -
isToAllergyIntoleranceCriticality
function isToAllergyIntoleranceCriticality(Is 'is) returns AllergyIntoleranceCriticalityParameters
- 'is Is -
isToAllergyIntoleranceType
function isToAllergyIntoleranceType(string 'is) returns AllergyIntoleranceTypeParameters
- 'is string -
msgToCoding
Parameters
- msg CM_MSG -
mshToMessageHeader
function mshToMessageHeader(Msh msh) returns MessageHeaderParameters
- msh Msh -
nameToServiceRequestIntent
function nameToServiceRequestIntent(string name) returns ServiceRequestIntentParameters
- name string -
nk1ToContact
nk1ToPatient
Parameters
- nk1 Nk1 -
obrToDiagnosticReport
function obrToDiagnosticReport(Obr obr) returns DiagnosticReportParameters
- obr Obr -
obrToServiceRequest
function obrToServiceRequest(Obr obr) returns ServiceRequestParameters
- obr Obr -
obxToObservation
function obxToObservation(Obx obx) returns ObservationParameters
- obx Obx -
orcToDiagnosticReport
function orcToDiagnosticReport(Orc orc) returns DiagnosticReportParameters
- orc Orc -
orcToImmunization
function orcToImmunization(Orc orc) returns ImmunizationParameters
- orc Orc -
pd1ToExtension
Parameters
- pd16 string -
pd1ToGeneralPractitioner
pd1ToPatient
Parameters
- pd1 Pd1 -
pidToAddress
pidToAdministrativeSex
function pidToAdministrativeSex(string pid8) returns PatientGender?Parameters
- pid8 string -
pidToBirthOrder
pidToBirthPlace
Parameters
- pid23 string -
pidToMaritalStatus
function pidToMaritalStatus(Pid16 pid16) returns CodeableConcept?Parameters
- pid16 Pid16 -
pidToMultipleBirthIndicator
Parameters
- pid24 string -
pidToPatient
Parameters
- pid Pid -
pidToPatientDeathIndicator
Parameters
- pid30 string -
pidToPatientName
pidToPhoneNumber
function pidToPhoneNumber(Pid13 pid13, Pid14 pid14) returns ContactPoint[]?pidToPrimaryLanguage
function pidToPrimaryLanguage(Pid15 pid15) returns PatientCommunication[]?Parameters
- pid15 Pid15 -
pidToSsnNumberIdentifier
function pidToSsnNumberIdentifier(string pid19) returns Identifier[]?Parameters
- pid19 string -
ptToMeta
Parameters
- pt Pt -
pv1ToEncounter
Parameters
- pv1 Pv1 -
pv1ToExtension
Parameters
- pv116 string -
pv1ToPatient
Parameters
- pv1 Pv1 -
pv2ToEncounter
Parameters
- pv2 Pv2 -
segmentToFhir
function segmentToFhir(string segmentName, Segment segment, V2SegmentToFhirMapper? customMapper, V2ToFhirCustomMapperServiceConfig? serviceconf) returns BundleEntry[]|errorTransform an HL7 segment to FHIR Bundle.
Parameters
- segmentName string - Name of the HL7 segment
- segment Segment - HL7 segment
- customMapper V2SegmentToFhirMapper? - Custom mapper implementation
- serviceconf V2ToFhirCustomMapperServiceConfig? - Custom mapping service configuration
Return Type
- BundleEntry[]|error - FHIR Bundle
stringToHl7
Parse a string to an HL7 message.
Parameters
- msg string - HL7 message as a string
tsToDateTime
Parameters
- ts Ts -
tsToInstant
Parameters
- ts Ts -
v2ToFhir
function v2ToFhir(string|Message hl7, V2SegmentToFhirMapper? customMapper, V2ToFhirCustomMapperServiceConfig? mapperServiceConf) returns json|errorTransform an HL7 message to FHIR.
Parameters
- customMapper V2SegmentToFhirMapper? (default ()) - Custom mapper implementation
- mapperServiceConf V2ToFhirCustomMapperServiceConfig? (default ()) - Custom mapping service configuration
Return Type
- json|error - FHIR Bundle as a json
xadToAddress
Parameters
- xad Xad -
xcnToCodeableConcept
function xcnToCodeableConcept(Xcn xcn) returns CodeableConceptParameters
- xcn Xcn -
xcnToReference
Parameters
- xcn Xcn -
xcnToReferenceWithType
xonToOrganization
function xonToOrganization(Xon xon) returns OrganizationParameters
- xon Xon -
xonToReference
Parameters
- xon Xon -
xpnToHumanName
Parameters
- xpn Xpn -
xtnToContactPoint
function xtnToContactPoint(Xtn xtn) returns ContactPoint?Parameters
- xtn Xtn -
Records
health.hl7v23.utils.v2tofhirr4: V2SegmentToFhirMapper
V2toFHIR Mapper function implementation holder record.
Fields
- pv1ToPatient? Pv1ToPatient - PV1 segment to Patient FHIR resource mapping function
- pv1ToEncounter? Pv1ToEncounter - PV1 segment to Encounter FHIR resource mapping function
- nk1ToPatient? Nk1ToPatient - NK1 segment to Patient FHIR resource mapping function
- pd1ToPatient? Pd1ToPatient - PD1 segment to Patient FHIR resource mapping function
- pidToPatient? PidToPatient - PID segment to Patient FHIR resource mapping function
- dg1ToCondition? Dg1ToCondition - DG1 segment to Condition FHIR resource mapping function
- dg1ToEncounter? Dg1ToEncounter - DG1 segment to Encounter FHIR resource mapping function
- dg1ToEpisodeOfCare? Dg1ToEpisodeOfCare - DG1 segment to EpisodeOfCare FHIR resource mapping function
- obxToObservation? ObxToObservation - OBX segment to Observation FHIR resource mapping function
- obrToDiagnosticReport? ObrToDiagnosticReport - OBR segment to DiagnosticReport FHIR resource mapping function
- al1ToAllerygyIntolerance? Al1ToAllerygyIntolerance - AL1 segment to AllergyIntolerance FHIR resource mapping function
- evnToProvenance? EvnToProvenance - EVN segment to Provenance FHIR resource mapping function
- mshToMessageHeader? MshToMessageHeader - MSH segment to MessageHeader FHIR resource mapping function
- pv2ToEncounter? Pv2ToEncounter - PV2 segment to Encounter FHIR resource mapping function
- orcToImmunization? OrcToImmunization - ORC segment to Immunization FHIR resource mapping function
health.hl7v23.utils.v2tofhirr4: V2ToFhirCustomMapperServiceConfig
Fields
- baseUrl string -
Union types
Array types
health.hl7v23.utils.v2tofhirr4: Pid5
Pid5
Union types defined for data types for supported hl7 versions.
###################################################################### Union type for holding patient name for all supported hl7 versions.
health.hl7v23.utils.v2tofhirr4: Pid9
Pid9
Union type for holding patient alias name for all supported hl7 versions.
health.hl7v23.utils.v2tofhirr4: Pid11
Pid11
Union type for holding patient address for all supported hl7 versions.
health.hl7v23.utils.v2tofhirr4: Pid13
Pid13
Union type for holding patient home phone number for all supported hl7 versions.
health.hl7v23.utils.v2tofhirr4: Pid14
Pid14
Union type for holding patient business phone number for all supported hl7 versions.
health.hl7v23.utils.v2tofhirr4: Pd13
Pd13
Union type for patient primary facility for all supported hl7 versions.
health.hl7v23.utils.v2tofhirr4: Pd14
Pd14
Union type for patient primary care provider for all supported hl7 versions.
health.hl7v23.utils.v2tofhirr4: Nk12
Nk12
Union type for patient's extended person's name for all supported hl7 versions.
health.hl7v23.utils.v2tofhirr4: Nk14
Nk14
Union type for patient's extended person's address for all supported hl7 versions.
health.hl7v23.utils.v2tofhirr4: Nk15
Nk15
Union type for patient's extended person's home phone number for all supported hl7 versions.
health.hl7v23.utils.v2tofhirr4: Nk16
Nk16
Union type for patient's extended person's business phone number for all supported hl7 versions.
health.hl7v23.utils.v2tofhirr4: Nk113
Nk113
Union type for patient's extended person's organization name for all supported hl7 versions.
health.hl7v23.utils.v2tofhirr4: Nk130
Nk130
Union type for patient's extended person's contact person name for all supported hl7 versions.
health.hl7v23.utils.v2tofhirr4: Nk131
Nk131
Union type for patient's extended person's contact person phone number for all supported hl7 versions.
health.hl7v23.utils.v2tofhirr4: Nk132
Nk132
Union type for patient's extended person's contact person address for all supported hl7 versions.
Function types
health.hl7v23.utils.v2tofhirr4: Pv1ToPatient
function(Pv1) returns (Patient)Pv1ToPatient
#################################################################################################### Mapping function definitions for V2 to FHIR #################################################################################################### Mapping function type for PV1 segment to Patient FHIR resource.
health.hl7v23.utils.v2tofhirr4: Pv1ToEncounter
function(Pv1) returns (Encounter)Pv1ToEncounter
Mapping function type for PV1 segment to Encounter FHIR resource.
health.hl7v23.utils.v2tofhirr4: Nk1ToPatient
function(Nk1) returns (Patient)Nk1ToPatient
Mapping function type for NK1 segment to Patient FHIR resource.
health.hl7v23.utils.v2tofhirr4: Pd1ToPatient
function(Pd1) returns (Patient)Pd1ToPatient
Mapping function type for PD1 segment to Patient FHIR resource.
health.hl7v23.utils.v2tofhirr4: PidToPatient
function(Pid) returns (Patient)PidToPatient
Mapping function type for PID segment to Patient FHIR resource.
health.hl7v23.utils.v2tofhirr4: Dg1ToCondition
function(Dg1) returns (Condition)Dg1ToCondition
Mapping function type for DG1 segment to Condition FHIR resource.
health.hl7v23.utils.v2tofhirr4: Dg1ToEncounter
function(Dg1, string?) returns (Encounter)Dg1ToEncounter
Mapping function type for DG1 segment to Encounter FHIR resource.
health.hl7v23.utils.v2tofhirr4: Dg1ToEpisodeOfCare
function(Dg1, string?, string?) returns (EpisodeOfCare)Dg1ToEpisodeOfCare
Mapping function type for DG1 segment to EpisodeOfCare FHIR resource.
health.hl7v23.utils.v2tofhirr4: ObxToObservation
function(Obx) returns (Observation)ObxToObservation
Mapping function type for OBX segment to Observation FHIR resource.
health.hl7v23.utils.v2tofhirr4: ObrToDiagnosticReport
function(Obr) returns (DiagnosticReport)ObrToDiagnosticReport
Mapping function type for OBR segment to DiagnosticReport FHIR resource.
health.hl7v23.utils.v2tofhirr4: Al1ToAllerygyIntolerance
function(Al1) returns (AllergyIntolerance)Al1ToAllerygyIntolerance
Mapping function type for AL1 segment to AllergyIntolerance FHIR resource.
health.hl7v23.utils.v2tofhirr4: EvnToProvenance
function(Evn) returns (Provenance)EvnToProvenance
Mapping function type for EVN segment to Provenance FHIR resource.
health.hl7v23.utils.v2tofhirr4: MshToMessageHeader
function(Msh) returns (MessageHeader)MshToMessageHeader
Mapping function type for MSH segment to MessageHeader FHIR resource.
health.hl7v23.utils.v2tofhirr4: Pv2ToEncounter
function(Pv2) returns (Encounter)Pv2ToEncounter
Mapping function type for PV2 segment to Encounter FHIR resource.
health.hl7v23.utils.v2tofhirr4: OrcToImmunization
function(Orc) returns (Immunization)OrcToImmunization
Mapping function type for ORC segment to Immunization FHIR resource.
Simple name reference types
health.hl7v23.utils.v2tofhirr4: Ce
Ce
Union type for CE data type for all supported hl7 versions.
health.hl7v23.utils.v2tofhirr4: Xad
Xad
Union type for XAD data type for all supported hl7 versions.
health.hl7v23.utils.v2tofhirr4: Xon
Xon
Union type for XON data type for all supported hl7 versions.
health.hl7v23.utils.v2tofhirr4: Xpn
Xpn
Union type for XPN data type for all supported hl7 versions.
health.hl7v23.utils.v2tofhirr4: Xtn
Xtn
Union type for XTN data type for all supported hl7 versions.
health.hl7v23.utils.v2tofhirr4: Hd
Hd
Union type for HD data type for all supported hl7 versions.
health.hl7v23.utils.v2tofhirr4: Pt
Pt
Union type for PT data type for all supported hl7 versions.
health.hl7v23.utils.v2tofhirr4: Ei
Ei
Union type for EI data type for all supported hl7 versions.
health.hl7v23.utils.v2tofhirr4: Id
Id
Union type for ID data type for all supported hl7 versions.
health.hl7v23.utils.v2tofhirr4: Xcn
Xcn
Union type for XCN data type for all supported hl7 versions.
health.hl7v23.utils.v2tofhirr4: Dtm
Dtm
Union type for DTM data type for all supported hl7 versions.
health.hl7v23.utils.v2tofhirr4: Ts
Ts
Union type for TS data type for all supported hl7 versions.
health.hl7v23.utils.v2tofhirr4: Is
Is
Union type for IS data type for all supported hl7 versions.
health.hl7v23.utils.v2tofhirr4: Msh
Msh
Union types for holding hl7 segments for supported hl7 versions.
######################################################################## Union type for holding message header segment for all supported hl7 versions.
health.hl7v23.utils.v2tofhirr4: Al1
Al1
Union type for holding patient allergy information segment for all supported hl7 versions.
health.hl7v23.utils.v2tofhirr4: Evn
Evn
Union type for holding event type segment for all supported hl7 versions.
health.hl7v23.utils.v2tofhirr4: Dg1
Dg1
Union type for holding patient visit segment for all supported hl7 versions.
health.hl7v23.utils.v2tofhirr4: Nk1
Nk1
Union type for holding next of kin segment for all supported hl7 versions.
health.hl7v23.utils.v2tofhirr4: Pd1
Pd1
Union type for holding patient identification segment for all supported hl7 versions.
health.hl7v23.utils.v2tofhirr4: Pid
Pid
Union type for holding patient identification segment for all supported hl7 versions.
health.hl7v23.utils.v2tofhirr4: Pv1
Pv1
Union type for holding patient visit segment for all supported hl7 versions.
health.hl7v23.utils.v2tofhirr4: Pv2
Pv2
Union type for holding patient visit additional information segment for all supported hl7 versions.
health.hl7v23.utils.v2tofhirr4: Obx
Obx
Union type for holding observation segment for all supported hl7 versions.
health.hl7v23.utils.v2tofhirr4: Orc
Orc
Union type for holding common order segment for all supported hl7 versions.
health.hl7v23.utils.v2tofhirr4: Obr
Obr
Union type for holding observation request segment for all supported hl7 versions.
health.hl7v23.utils.v2tofhirr4: Pid15
Pid15
Union type for holding patient primary language for all supported hl7 versions.
health.hl7v23.utils.v2tofhirr4: Nk17
Nk17
Union type for patient's extended person's contact role for all supported hl7 versions.
health.hl7v23.utils.v2tofhirr4: Nk18
Nk18
Union type for patient's extended person's start date for all supported hl7 versions.
health.hl7v23.utils.v2tofhirr4: Nk19
Nk19
Union type for patient's extended person's end date for all supported hl7 versions.
health.hl7v23.utils.v2tofhirr4: Nk115
Nk115
Union type for patient's extended person's gender for all supported hl7 versions.
Import
import ballerinax/health.hl7v23.utils.v2tofhirr4;Other versions
1.0.0
Metadata
Released date: 3 days ago
Version: 1.0.0
Compatibility
Platform: any
Ballerina version: 2201.12.10
GraalVM compatible: Yes
Pull count
Total: 28
Current verison: 28
Weekly downloads
Keywords
Healthcare
HL7
FHIR
Contributors