health.hl7v23
Module health.hl7v23
Declarations
ballerinax/health.hl7v23 Ballerina library
Module for HL7 v2.3 specification.
HL7 v23 Module
Module Overview
This Module holds the messages, segments and data types for the HL7 version 2.3.
Usage
To add the HL7 v23 dependency the project simply import the package as below,
import ballerinax/health.hl7v23
Sample: Simple HL7 Server implementation compatible for HL7 v2.3 which accept any message HL7 message available
in this package. This server binds to port 3000
Tip: Use Hapi TestPanel or any HL7 v2.3 compatible client to invoke this server.
import ballerina/log; import ballerina/tcp; import ballerina/uuid; import ballerinax/health.hl7v2; import ballerinax/health.hl7v23; service on new tcp:Listener(3000) { remote function onConnect(tcp:Caller caller) returns tcp:ConnectionService { log:printInfo("Client connected to echoServer: " + caller.remotePort.toString()); return new HL7ServiceConnectionService(); } } service class HL7ServiceConnectionService { *tcp:ConnectionService; remote function onBytes(tcp:Caller caller, readonly & byte[] data) returns tcp:Error? { string|error fromBytes = string:fromBytes(data); if fromBytes is string { log:printInfo("Received HL7 Message: " + fromBytes); } hl7v2:HL7Parser parser = new(); hl7v2:Message|hl7v2:GenericMessage|hl7v2:HL7Error parsedMsg = parser.parse(data); if parsedMsg is hl7v2:HL7Error { return error("Error occurred while parsing the received message", parsedMsg); } log:printInfo("Parsed HL7 message:" + parsedMsg.toString()); // Extract Message header (MSH) hl7v23:MSH? msh = (); if parsedMsg is hl7v2:Message && parsedMsg.hasKey("msh") { anydata mshEntry = parsedMsg["msh"]; hl7v23:MSH|error tempMSH = mshEntry.ensureType(); if tempMSH is error { return error("Error occurred while casting MSH"); } msh = tempMSH; } if msh is () { return error("Failed to extract MSH from HL7 message"); } // Create Ackknowledgement message hl7v23:ACK ack = { msh: { msh3: { hd1: "TESTSERVER"}, msh4: { hd1: "WSO2OH" }, msh5: { hd1: msh.msh3.hd1 }, msh6: { hd1: msh.msh4.hd1 }, msh9: { cm_msg1: hl7v23:ACK_MESSAGE_TYPE }, msh10: uuid:createType1AsString().substring(0,8), msh11: { pt1: "P" }, msh12: "2.3" }, msa: { msa1: "AA", msa2: msh.msh10 } }; // encode message to wire format hl7v2:HL7Encoder encoder = new(); byte[]|hl7v2:HL7Error encodedMsg = encoder.encode(hl7v23:VERSION, ack); if encodedMsg is hl7v2:HL7Error { return error("Error occurred while encoding acknowledgement"); } string|error resp = string:fromBytes(encodedMsg); if resp is string { log:printInfo("Encoded HL7 ACK Response Message: " + resp); } // Echoes back the data to the client from which the data is received. check caller->writeBytes(encodedMsg); } remote function onError(tcp:Error err) { log:printError("An error occurred", 'error = err); } remote function onClose() { log:printInfo("Client left"); } }
Functions
createHL7v23Encoder
function createHL7v23Encoder() returns Encoder
Function to create hl7v2:Encoder implementation for HL7 v2.3. Note: It is recommended to use hl7v2:HL7Encoder instead of this. This function is used by internal internal package framework
Return Type
- Encoder - Return instance of hl7v2:Encoder implementation
createHL7v23Parser
function createHL7v23Parser() returns Parser
Function to create hl7v2:Parser implementation for HL7 v2.3. Note: It is recommended to use hl7v2:HL7Parser instead of this. This function is used by internal internal package framework
Return Type
- Parser - Return instance of hl7v2:Parser implementation
Constants
health.hl7v23: ACC_SEGMENT_NAME
health.hl7v23: ACK_MESSAGE_TYPE
health.hl7v23: ADD_SEGMENT_NAME
health.hl7v23: ADR_A19_MESSAGE_TYPE
health.hl7v23: ADT_A01_MESSAGE_TYPE
health.hl7v23: AIG_SEGMENT_NAME
health.hl7v23: AL1_SEGMENT_NAME
health.hl7v23: DB1_SEGMENT_NAME
health.hl7v23: DG1_SEGMENT_NAME
health.hl7v23: DRG_SEGMENT_NAME
health.hl7v23: ERR_SEGMENT_NAME
health.hl7v23: EVN_SEGMENT_NAME
health.hl7v23: MSA_SEGMENT_NAME
health.hl7v23: MSH_SEGMENT_NAME
health.hl7v23: NK1_SEGMENT_NAME
health.hl7v23: OBX_SEGMENT_NAME
health.hl7v23: PD1_SEGMENT_NAME
health.hl7v23: PID_SEGMENT_NAME
health.hl7v23: PR1_SEGMENT_NAME
health.hl7v23: PROCEDURE_SEGMENT_COMPONENT
health.hl7v23: PV1_SEGMENT_NAME
health.hl7v23: PV2_SEGMENT_NAME
health.hl7v23: QRD_SEGMENT_NAME
health.hl7v23: QRF_SEGMENT_NAME
health.hl7v23: QRY_A19_MESSAGE_TYPE
health.hl7v23: QUERY_RESPONSE_SEGMENT_COMPONENT
health.hl7v23: ROL_SEGMENT_NAME
health.hl7v23: VERSION
Records
health.hl7v23: ACC
The ACC segment contains patient information relative to an accident in which the patient has been involved.
Fields
- Fields Included from *Segment
- name string
- anydata...
- name string(default ACC_SEGMENT_NAME) - Segment Name
- acc1 TS(default {}) - Accident Date/Time
- acc2 CE(default {}) - Accident Code
- acc3 ST(default "") - Accident Location
- acc4 CE(default {}) - Auto Accident State
- acc5 ID(default "") - Accident Job Related Indicator
- acc6 ID(default "") - Accident Death Indicator
health.hl7v23: ACK
General acknowledgment message.
Fields
- Fields Included from *Message
- name string
- anydata...
- name string(default ACK_MESSAGE_TYPE) - Message name
- msh MSH - Message header segment
- msa MSA - Message acknowledgement segment
- err ERR? - Error segment
health.hl7v23: AD
Address details.
Fields
- Fields Included from *CompositeType
- anydata...
- ad1 ST(default "") - Street Address
- ad2 ST(default "") - Other Designation
- ad3 ST(default "") - City
- ad4 ST(default "") - State Or Province
- ad5 ST(default "") - Zip Or Postal Code
- ad6 ID(default "") - Country
- ad7 ID(default "") - Address Type
- ad8 ST(default "") - Other Geographic Designation
health.hl7v23: ADD
he ADD segment is used to define the continuation of the prior segment in a continuation message.
Fields
- Fields Included from *Segment
- name string
- anydata...
- name string(default ADD_SEGMENT_NAME) - Segment Name
- add1 ST(default "") - Addendum Continuation Pointer
health.hl7v23: ADR_A19
Patient query response message.
Fields
- Fields Included from *Message
- name string
- anydata...
- name string(default ADR_A19_MESSAGE_TYPE) - Message name
- msh MSH - Message header segment
- msa MSA - Message acknowledgement segment
- err ERR? - Error segment
- qrd QRD - Query definition segment
- qrf QRF? - Query filter segment
- query_response QUERY_RESPONSE[](default []) - Query Response
health.hl7v23: ADT_A01
Admit/visit notification.
Fields
- Fields Included from *Message
- name string
- anydata...
- name string(default ADT_A01_MESSAGE_TYPE) - Message name
- msh MSH - Message header segment
- evn EVN? - Event type
- pid PID - Patient Identification
- pd1 PD1? - Patient Demographic
- nk1 NK1[](default []) - Next of kin
- pv1 PV1? - Patient visit
- pv2 PV2? - Patient visit - additional information
- db1 DB1[](default []) - Disability Segment
- obx OBX[](default []) - Observation segment
- al1 AL1[](default []) - Patient Allergy Information
- dg1 DG1[](default []) - Diagnosis
- drg DRG? - Diagnosis Related Group
- procedure PROCEDURE[](default [{}]) - Procedures
health.hl7v23: AIG
Appointment Information.
Fields
- Fields Included from *Segment
- name string
- anydata...
- name string(default AIG_SEGMENT_NAME) - Segment name
- aig1 SI(default -1) - Set ID - AIG
- aig2 ID(default "") - Segment Action Code
- aig3 CE(default {}) - Resource ID
- aig4 CE(default {}) - Resource Type
- aig5 CE[](default []) - Resource Group
health.hl7v23: AL1
Patient Allergy Information.
Fields
- Fields Included from *Segment
- name string
- anydata...
- name string(default AL1_SEGMENT_NAME) - Segment name
- al11 SI(default -1) - Set ID - AL1
- al12 IS(default "") - Allergy Type
- al13 CE(default {}) - Allergy Code/Mnemonic/ Description
- al14 IS(default "") - Allergy Severity
- al15 ST(default "") - Allergy Reaction
- al16 DT(default "") - Identification Date
health.hl7v23: CE
This data type transmits codes and the text associated with the code.
To allow all six components of a CE data type to be valued, the maximum length of this data type must be at least 60
Fields
- Fields Included from *CompositeType
- anydata...
- ce1 ST(default "") - Identifier
- ce2 ST(default "") - Text
- ce3 ST(default "") - Name Of Coding System
- ce4 ST(default "") - Alternate Identifier
- ce5 ST(default "") - Alternate Text
- ce6 ST(default "") - Name Of Alternate Coding System
health.hl7v23: CF
Coded Element With Formatted Values. This data type transmits codes and the formatted text associated with the code.
Fields
- Fields Included from *CompositeType
- anydata...
- cf1 ID(default "") - Identifier
- cf2 FT(default "") - Formatted Text
- cf3 ST(default "") - Name Of Coding System
- cf4 ID(default "") - Alternate Identifier
- cf5 FT(default "") - Alternate Formatted Text
- cf6 ST(default "") - Name Of Alternate Coding System
health.hl7v23: CK
Composite ID with check digit.
Fields
- Fields Included from *CompositeType
- anydata...
- ck1 NM(default -1) - ID Number
- ck2 ST(default "") - Check Digit
- ck3 ID(default "") - Code Identifying The Check Digit Scheme Employed
- ck4 HD(default {}) - Assigning Authority
health.hl7v23: CM_DLD
Discharge Location.
Fields
- Fields Included from *CompositeType
- anydata...
- cm_dld1 ID(default "") - Discharge Location
- cm_dld2 TS(default {}) - Effective Date
health.hl7v23: CM_ELD
Error.
Fields
- Fields Included from *CompositeType
- anydata...
- cm_eld1 ST(default "") - Segment ID
- cm_eld2 NM(default -1) - Sequence
- cm_eld3 NM(default -1) - Field Position
- cm_eld4 CE(default {}) - Code Identifying Error
health.hl7v23: CM_MSG
Message Type.
Fields
- Fields Included from *CompositeType
- anydata...
- cm_msg1 ID(default "") - Message Type
- cm_msg2 ID(default "") - Trigger Event
health.hl7v23: CM_VR
Value qualifier.
Fields
- Fields Included from *CompositeType
- anydata...
- cm_vr1 ST(default "") - First Data Code Value
- cm_vr2 ST(default "") - Last Data Code Calue
health.hl7v23: CN
Composite ID Number And Name. A field identifying a person both as a coded value and with a text name.
Fields
- Fields Included from *CompositeType
- anydata...
- cn1 ST(default "") - ID Number
- cn2 ST(default "") - Family Name
- cn3 ST(default "") - Given Name
- cn4 ST(default "") - Middle Initial Or Name
- cn5 ST(default "") - Suffix
- cn6 ST(default "") - Prefix
- cn7 ST(default "") - Degree
- cn8 ID(default "") - Source Table
- cn9 ST(default "") - Assigning Authority
health.hl7v23: CNE
Coded with No Exceptions.
Fields
- Fields Included from *CompositeType
- anydata...
- cne1 ST(default "") - Identifier
- cne2 ST(default "") - Text
- cne3 ID(default "") - Name of Coding System
- cne4 ST(default "") - Alternate Identifier
- cne5 ST(default "") - Alternate Text
- cne6 ID(default "") - Name of Alternate Coding System
- cne7 ST(default "") - Coding System Version ID
- cne8 ST(default "") - Alternate Coding System Version ID
- cne9 ST(default "") - Original Text
health.hl7v23: CP
Composite Price.
Fields
- Fields Included from *CompositeType
- anydata...
- cp1 MO(default {}) - Price
- cp2 ID(default "") - Price Type
- cp3 NM(default -1) - From Value
- cp4 NM(default -1) - To Value
- cp5 CE(default {}) - Range Units
- cp6 ID(default "") - Range Type
health.hl7v23: CQ
Composite Quantity With Units.
Fields
- Fields Included from *CompositeType
- anydata...
- cq1 NM(default -1) - Quantity
- cq2 ST(default "") - Units
health.hl7v23: CX
Extended Composite ID With Check Digit.
Fields
- Fields Included from *CompositeType
- anydata...
- cx1 ST(default "") - ID
- cx2 ST(default "") - Check Digit
- cx3 ID(default "") - Code Identifying The Check Digit Scheme Employed
- cx4 HD(default {}) - Assigning Authority
- cx5 IS(default "") - Identifier Type Code
- cx6 HD(default {}) - Assigning Facility
health.hl7v23: DB1
Disability Segment.
Fields
- Fields Included from *Segment
- name string
- anydata...
- name string(default DB1_SEGMENT_NAME) - Segment name
- db11 SI(default -1) - Set ID - DB1
- db12 IS(default "") - Disabled person code
- db13 CX[](default [{}]) - Disabled person identifier
- db14 ID(default "") - Disabled Indicator
- db15 DT(default "") - Disability start date
- db16 DT(default "") - Disability end date
- db17 DT(default "") - Disability return to work date
- db18 DT(default "") - Disability unable to work date
health.hl7v23: DG1
Diagnosis.
Fields
- Fields Included from *Segment
- name string
- anydata...
- name string(default DG1_SEGMENT_NAME) - Segment name
- dg11 SI(default -1) - Set ID - Diagnosis
- dg12 ID(default "") - Diagnosis Coding Method
- dg13 CE(default {}) - Diagnosis Code
- dg14 ST(default "") - Diagnosis Description
- dg15 TS(default {}) - Diagnosis Date/Time
- dg16 IS(default "") - Diagnosis Type
- dg17 CE(default {}) - Major Diagnostic Category
- dg18 CE(default {}) - Diagnostic Related Group
- dg19 ID(default "") - DRG Approval Indicator
- dg110 IS(default "") - DRG Grouper Review Code
- dg111 CE(default {}) - Outlier Type
- dg112 NM(default -1) - Outlier Days
- dg113 CP(default {}) - Outlier Cost
- dg114 ST(default "") - Grouper Version and Type
- dg115 NM(default -1) - Diagnosis Priority
- dg116 XCN[](default [{}]) - Diagnosing Clinician
- dg117 IS(default "") - Diagnosis Classification
- dg118 ID(default "") - Confidential Indicator
- dg119 TS(default {}) - Attestation Date/Time
health.hl7v23: DLN
Driver's License Number.
Fields
- Fields Included from *CompositeType
- anydata...
- dln1 ST(default "") - Driver s License Number
- dln2 IS(default "") - Issuing State, Province, Country
- dln3 DT(default "") - Expiration Date
health.hl7v23: DR
Date Time Range.
Fields
- Fields Included from *CompositeType
- anydata...
- dr1 TS(default {}) - Range Start Date/time
- dr2 TS(default {}) - Range End Date/time
health.hl7v23: DRG
Diagnosis Related Group.
Fields
- Fields Included from *Segment
- name string
- anydata...
- name string(default DRG_SEGMENT_NAME) - Segment name
- drg1 CE(default {}) - Diagnostic Related Group
- drg2 TS(default {}) - DRG Assigned Date/Time
- drg3 ID(default "") - DRG Approval Indicator
- drg4 IS(default "") - DRG Grouper Review Code
- drg5 CE(default {}) - Outlier Type
- drg6 NM(default -1) - Outlier Days
- drg7 CP(default {}) - Outlier Cost
- drg8 IS(default "") - DRG Payor
- drg9 CP(default {}) - Outlier Reimbursement
- drg10 ID(default "") - Confidential Indicator
health.hl7v23: ED
Encapsulated Data.
Fields
- Fields Included from *CompositeType
- anydata...
- ed1 HD(default {}) - Source Application
- ed2 ID(default "") - Type Of Data
- ed3 ID(default "") - Data Subtype
- ed4 ID(default "") - Data Subtype
- ed5 ST(default "") - Data
health.hl7v23: EI
Entity Identifier.The entity identifier defines a given entity within a specified series of identifiers.
Fields
- Fields Included from *CompositeType
- anydata...
- ei1 ST(default "") - Entity Identifier
- ei2 IS(default "") - Namespace ID
- ei3 ST(default "") - Universal ID
- ei4 ID(default "") - Universal ID Type
health.hl7v23: ELD
Error.
Fields
- Fields Included from *CompositeType
- anydata...
- eld1 ST(default "") - Segment ID
- eld2 NM(default -1) - Sequence
- eld3 NM(default -1) - Field Position
- ei4 CE(default {}) - Code Identifying Error
health.hl7v23: ERR
Holds error comments to acknowledgment messages.
Fields
- Fields Included from *Segment
- name string
- anydata...
- name string(default ERR_SEGMENT_NAME) - Segment name
- err1 CM_ELD[](default [{}]) - Error Code and Location
health.hl7v23: EVN
Event type.
Fields
- Fields Included from *Segment
- name string
- anydata...
- name string(default EVN_SEGMENT_NAME) - Segment name
- evn1 ID(default "") - Event Type Code
- evn2 TS(default {}) - Recorded Date/Time
- evn3 TS(default {}) - Date/Time Planned Event
- evn4 IS(default "") - Event Reason Code
- evn5 XCN(default {}) - Operator ID
- evn6 TS(default {}) - Event Occurred
health.hl7v23: FC
Financial Class.
Fields
- Fields Included from *CompositeType
- anydata...
- fc1 IS(default "") - Financial Class
- fc2 TS(default {}) - Effective Date
health.hl7v23: FN
Family + Last Name Prefix.
Fields
- Fields Included from *CompositeType
- anydata...
- fn1 ST(default "") - Family Name
- fn2 ST(default "") - Last Name Prefix
health.hl7v23: GenericMessage
Represents a generic HL7 message.
Fields
- Fields Included from *Message
- name string
- anydata...
- name string? - Message name
- segments Segment[] - Array of segments
health.hl7v23: HD
The HD is designed to be a more powerful application identifier.
It is also designed to be used either as a local version of a site-defined application identifier or a publicly-assigned UID.
Fields
- Fields Included from *CompositeType
- anydata...
- hd1 IS(default "") - Namespace ID
- hd2 ST(default "") - Universal ID
- hd3 ID(default "") - Universal ID Type
health.hl7v23: JCC
Job Code Class.
Fields
- Fields Included from *CompositeType
- anydata...
- jcc1 IS(default "") - Job Code
- jss2 IS(default "") - Job Class
health.hl7v23: LA1
Location With Address Information (variant 1).
Fields
- Fields Included from *CompositeType
- anydata...
- la11 IS(default "") - Point Of Care
- la12 IS(default "") - Room
- la13 IS(default "") - Bed
- la14 HD(default {}) - Facility
- la15 IS(default "") - Location Status
- la16 IS(default "") - Person Location Type
- la17 IS(default "") - Building
- la18 IS(default "") - Floor
- la19 AD(default {}) - Address
health.hl7v23: LA2
Location With Address Information (variant 2).
Fields
- Fields Included from *CompositeType
- anydata...
- la21 IS(default "") - Point Of Care
- la22 IS(default "") - Room
- la23 IS(default "") - Bed
- la24 HD(default {}) - Facility
- la25 IS(default "") - Location Status
- la26 IS(default "") - Person Location Type
- la27 IS(default "") - Building
- la28 IS(default "") - Floor
- la29 ST(default "") - Street Address
- la210 ST(default "") - Other Designation
- la211 ST(default "") - City
- la212 ST(default "") - State Or Province
- la213 ST(default "") - Zip Or Postal Code
- la214 ID(default "") - Country
- la215 ID(default "") - Address Type
- la216 ST(default "") - Other Geographic Designation
health.hl7v23: MA
Multiplexed Array.
Fields
- Fields Included from *CompositeType
- anydata...
- ma1 NM(default -1) - Sample 1 From Channel 1
- ma2 NM(default -1) - Sample 1 From Channel 2
- ma3 NM(default -1) - Sample 1 From Channel 3
- ma4 NM(default -1) - Sample 2 From Channel 1
- ma5 NM(default -1) - Sample 2 From Channel 2
- ma6 NM(default -1) - Sample 2 From Channel 3
health.hl7v23: MO
Money.
Fields
- Fields Included from *CompositeType
- anydata...
- mo1 NM(default -1) - Quantity
- mo2 ID(default "") - Denomination
health.hl7v23: MSA
Message acknowledgement segment.
Fields
- Fields Included from *Segment
- name string
- anydata...
- name string(default MSA_SEGMENT_NAME) - Segment name
- msa1 ID(default "") - Acknowledgement code
- msa2 ST(default "") - Message Control ID
- msa3 ST(default "") - Text Message
- msa4 NM(default -1) - Expected Sequence Number
- msa5 ID(default "") - Delayed Acknowledgement Type
- msa6 CE(default {}) - Error Condition
health.hl7v23: MSH
The MSH segment defines the intent, source, destination, and some specifics of the syntax of a message.
Fields
- Fields Included from *Segment
- name string
- anydata...
- name string(default MSH_SEGMENT_NAME) - Segment name
- msh1 ST(default "|") - Field Separator
- msh2 ST(default "^~\\&") - Encoding Characters
- msh3 HD(default {}) - Sending Application
- msh4 HD(default {}) - Sending Facility
- msh5 HD(default {}) - Receiving Application
- msh6 HD(default {}) - Receiving Facility
- msh7 TS(default {}) - Date / Time of Message
- msh8 ST(default "") - Security
- msh9 CM_MSG(default {}) - Message Type
- msh10 ST(default "") - Message Control ID
- msh11 PT(default {}) - Processing ID
- msh12 ID(default "") - Version ID
- msh13 NM(default -1) - Sequence Number
- msh14 ST(default "") - Continuation Pointer
- msh15 ID(default "") - Accept Acknowledgement Type
- msh16 ID(default "") - Application Acknowledgement Type
- msh17 ID(default "") - Country Code
- msh18 ID(default "") - Character Set
- msh19 CE(default {}) - Principal Language of Message
health.hl7v23: NA
Numeric Array.
Fields
- Fields Included from *CompositeType
- anydata...
- na1 NM(default -1) - Value1
- na2 NM(default -1) - Value2
- na3 NM(default -1) - Value3
- na4 NM(default -1) - Value4
health.hl7v23: NK1
Next of kin.
Fields
- Fields Included from *Segment
- name string
- anydata...
- name string(default NK1_SEGMENT_NAME) - Segment name
- nk11 SI(default -1) - Set ID - Next of Kin
- nk12 XPN[](default [{}]) - NK Name
- nk13 CE(default {}) - Relationship
- nk14 XAD[](default [{}]) - Address
- nk15 XTN[](default [{}]) - Phone Number
- nk16 XTN[](default [{}]) - Business Phone Number
- nk17 CE(default {}) - Contact Role
- nk18 DT(default "") - Start Date
- nk19 DT(default "") - End Date
- nk110 ST(default "") - Next of Kin/Associated Parties Job Title
- nk111 JCC(default {}) - Next of Kin Job/Associated Parties Code/Class
- nk112 CX(default {}) - Next of Kin/Associated Parties Employee Number
- nk113 XON[](default [{}]) - Organization Name
- nk114 IS(default "") - Marital Status
- nk115 IS(default "") - Sex
- nk116 TS(default {}) - Date of Birth
- nk117 IS[](default [""]) - Living Dependency
- nk118 IS[](default [""]) - Ambulatory Status
- nk119 IS[](default [""]) - Citizenship
- nk120 CE(default {}) - Primary Language
- nk121 IS(default "") - Living Arrangement
- nk122 CE(default {}) - Publicity Indicator
- nk123 ID(default "") - Protection Indicator
- nk124 IS(default "") - Student Indicator
- nk125 IS(default "") - Religion
- nk126 XPN(default {}) - Mother s Maiden Name
- nk127 CN(default {}) - Nationality Code
- nk128 IS(default "") - Ethnic Group
- nk129 CE[](default [{}]) - Contact Reason
- nk130 XPN[](default [{}]) - Contact Person's Name
- nk131 XTN[](default [{}]) - Contact Person s Telephone Number
- nk132 XAD[](default [{}]) - Contact Person s Address
- nk133 CX[](default [{}]) - Next of kin/associated party identifiers
- nk134 IS(default "") - Job Status
- nk135 IS(default "") - Race
- nk136 IS(default "") - Handicap
- nk137 ST(default "") - Contact Person Social Security Number
health.hl7v23: OBX
Observation segment.
Fields
- Fields Included from *Segment
- name string
- anydata...
- name string(default OBX_SEGMENT_NAME) - Segment name
- obx1 SI(default -1) - Set ID - OBX
- obx2 ID(default "") - Value Type
- obx3 CE(default {}) - Observation Identifier
- obx4 ST(default "") - Observation Sub-ID
- obx5 VARIES[](default [""]) - Observation Value
- obx6 CE(default {}) - Units
- obx7 ST(default "") - References Range
- obx8 ID[](default [""]) - Abnormal Flags
- obx9 NM(default -1) - Probability
- obx10 ID[](default [""]) - Nature of Abnormal Test
- obx11 ID(default "") - Observ Result Status
- obx12 TS(default {}) - Date Last Obs Normal Values
- obx13 ST(default "") - User Defined Access Checks
- obx14 TS(default {}) - Date/Time of the Observation
- obx15 CE(default {}) - Producer's ID
- obx16 XCN(default {}) - Responsible Observer
- obx17 CE[](default [{}]) - Observation Method
health.hl7v23: PD1
Patient Demographic.
Fields
- Fields Included from *Segment
- name string
- anydata...
- name string(default PD1_SEGMENT_NAME) - Segment name
- pd11 IS[](default [""]) - Living Dependency
- pd12 IS(default "") - Living Arrangement
- pd13 XON[](default [{}]) - Patient Primary Facility
- pd14 XCN[](default [{}]) - Patient Primary Care Provider Name & ID No.
- pd15 IS(default "") - Student Indicator
- pd16 IS(default "") - Handicap
- pd17 IS(default "") - Living Will
- pd18 IS(default "") - Organ Donor
- pd19 ID(default "") - Separate Bill
- pd110 CX[](default [{}]) - Duplicate Patient
- pd111 CE(default {}) - Publicity Indicator
- pd112 ID(default "") - Protection Indicator
health.hl7v23: PID
The PID segment is used by all applications as the primary means of communicating patient identification information.
Fields
- Fields Included from *Segment
- name string
- anydata...
- name string(default PID_SEGMENT_NAME) - Segment name
- pid1 SI(default -1) - Set ID - Patient ID
- pid2 CX(default {}) - Patient ID (External ID)
- pid3 CX[](default [{}]) - Patient ID (Internal ID)
- pid4 CX[](default [{}]) - Alternate Patient ID
- pid5 XPN[](default [{}]) - Patient Name
- pid6 XPN(default {}) - Mother's Maiden Name
- pid7 TS(default {}) - Date of Birth
- pid8 IS(default "") - Sex
- pid9 XPN[](default [{}]) - Patient Alias
- pid10 IS(default "") - Race
- pid11 XAD[](default [{}]) - Patient Address
- pid12 IS(default "") - County Code
- pid13 XTN[](default [{}]) - Phone Number - Home
- pid14 XTN[](default [{}]) - Phone Number - Business
- pid15 CE(default {}) - Primary Language
- pid16 IS(default "") - Marital Status
- pid17 IS(default "") - Religion
- pid18 CX(default {}) - Patient Account Number
- pid19 ST(default "") - SSN Number - Patient
- pid20 DLN(default {}) - Driver's License Number
- pid21 CX[](default [{}]) - Mother's Identifier
- pid22 IS(default "") - Ethnic Group
- pid23 ST(default "") - Birth Place
- pid24 ID(default "") - Multiple Birth Indicator
- pid25 NM(default -1) - Birth Order
- pid26 IS[](default [""]) - Citizenship
- pid27 CE(default {}) - Veterans Military Status
- pid28 CE(default {}) - Nationality Code
- pid29 TS(default {}) - Patient Death Date and Time
- pid30 ID(default "") - Patient Death Indicator
health.hl7v23: PL
Person Location.
Fields
- Fields Included from *CompositeType
- anydata...
- pl1 IS(default "") - Point Of Care
- pl2 IS(default "") - Room
- pl3 IS(default "") - Bed
- pl4 HD(default {}) - Facility
- pl5 IS(default "") - Location Status
- pl6 IS(default "") - Person Location Type
- pl7 IS(default "") - Building
- pl8 IS(default "") - Floor
- pl9 ST(default "") - Location Type
health.hl7v23: PN
Person Name.
Fields
- Fields Included from *CompositeType
- anydata...
- pn1 ST(default "") - Family name
- pn2 ST(default "") - Given name
- pn3 ST(default "") - Middle initial or name
- pn4 ST(default "") - Suffix
- pn5 ST(default "") - Prefix
- pn6 ST(default "") - Degree
health.hl7v23: PPN
Performing Person Time Stamp.
Fields
- Fields Included from *CompositeType
- anydata...
- ppn1 ST(default "") - ID Number
- ppn2 ST(default "") - Family Name
- ppn3 ST(default "") - Given Name
- ppn4 ST(default "") - Middle Initial Or Name
- ppn5 ST(default "") - Suffix
- ppn6 ST(default "") - Prefix
- ppn7 ST(default "") - Degree
- ppn8 ID(default "") - Source Table
- ppn9 HD(default {}) - Assigning Authority
- ppn10 ID(default "") - Name Type Code
- ppn11 ST(default "") - Identifier Check Digit
- ppn12 ID(default "") - Code Identifying The Check Digit Scheme Employed
- ppn13 IS(default "") - Identifier Type Code
- ppn14 HD(default {}) - Assigning Facility
- ppn15 TS(default {}) - Date/Time Action Performed
health.hl7v23: PR1
Contains information relative to various types of procedures that can be performed on a patient.
Fields
- Fields Included from *Segment
- name string
- anydata...
- name string(default PR1_SEGMENT_NAME) - Segment name
- pr11 SI(default -1) - Set ID - Procedure
- pr12 IS(default "") - Procedure Coding Method
- pr13 CE(default {}) - Procedure Code
- pr14 ST(default "") - Procedure Description
- pr15 TS(default {}) - Procedure Date/Time
- pr16 IS(default "") - Procedure Type
- pr17 NM(default -1) - Procedure Minutes
- pr18 XCN(default {}) - Anesthesiologist
- pr19 IS(default "") - Anesthesia Code
- pr110 NM(default -1) - Anesthesia Minutes
- pr111 XCN(default {}) - Surgeon
- pr112 XCN(default {}) - Procedure Practitioner
- pr113 CE(default {}) - Consent Code
- pr114 NM(default -1) - Procedure Priority
- pr115 CE(default {}) - Associated Diagnosis Code
health.hl7v23: PROCEDURE
Procedure Segment Group
Fields
- Fields Included from *SegmentComponent
- name string(default PROCEDURE_SEGMENT_COMPONENT) - Segment group name
- isRequired boolean(default true) - Is segment group required
- pr1 PR1? - PR1 segment
- rol ROL[](default [{}]) - ROL segment array
health.hl7v23: PT
Processing Type.
Fields
- Fields Included from *CompositeType
- anydata...
- pt1 ST(default "") - Processing ID
- pt2 ST(default "") - Processing Mode
health.hl7v23: PV1
Patient visit.
Fields
- Fields Included from *Segment
- name string
- anydata...
- name string(default PV1_SEGMENT_NAME) - Segment name
- pv11 SI(default -1) - Set ID - Patient Visit
- pv12 ID(default "") - Patient Class
- pv13 PL(default {}) - Assigned Patient Location
- pv14 ID(default "") - Admission Type
- pv15 CX(default {}) - Preadmit Number
- pv16 PL(default {}) - Prior Patient Location
- pv17 XCN[](default [{}]) - Attending Doctor
- pv18 XCN[](default [{}]) - Referring Doctor
- pv19 XCN[](default [{}]) - Consulting Doctor
- pv110 IS(default "") - Hospital Service
- pv111 PL(default {}) - Temporary Location
- pv112 IS(default "") - Preadmit Test Indicator
- pv113 IS(default "") - Readmission Indicator
- pv114 IS(default "") - Admit Source
- pv115 IS[](default [""]) - Ambulatory Status
- pv116 IS(default "") - VIP Indicator
- pv117 XCN[](default [{}]) - Admitting Doctor
- pv118 IS(default "") - Patient Type
- pv119 CX(default {}) - Visit Number
- pv120 FC[](default [{}]) - Financial Class
- pv121 IS(default "") - Charge Price Indicator
- pv122 IS(default "") - Courtesy Code
- pv123 IS(default "") - Credit Rating
- pv124 IS[](default [""]) - Contract Code
- pv125 DT[](default [""]) - Contract Effective Date
- pv126 NM[](default [-1]) - Contract Amount
- pv127 NM[](default [-1]) - Contract Period
- pv128 IS(default "") - Interest Code
- pv129 IS(default "") - Transfer to Bad Debt Code
- pv130 DT(default "") - Transfer to Bad Debt Date
- pv131 IS(default "") - Bad Debt Agency Code
- pv132 NM(default -1) - Bad Debt Transfer Amount
- pv133 NM(default -1) - Bad Debt Recovery Amount
- pv134 IS(default "") - Delete Account Indicator
- pv135 DT(default "") - Delete Account Date
- pv136 IS(default "") - Discharge Disposition
- pv137 CM_DLD(default {}) - Discharged to Location
- pv138 IS(default "") - Diet Type
- pv139 IS(default "") - Servicing Facility
- pv140 IS(default "") - Bed Status
- pv141 IS(default "") - Account Status
- pv142 PL(default {}) - Pending Location
- pv143 PL(default {}) - Prior Temporary Location
- pv144 TS(default {}) - Admit Date/Time
- pv145 TS(default {}) - Discharge Date/Time
- pv146 NM(default -1) - Current Patient Balance
- pv147 NM(default -1) - Total Charges
- pv148 NM(default -1) - Total Adjustments
- pv149 NM(default -1) - Total Payments
- pv150 CX(default {}) - Alternate Visit ID
- pv151 IS(default "") - Visit Indicator
- pv152 XCN(default {}) - Other Healthcare Provider
health.hl7v23: PV2
Patient visit - additional information.
Fields
- Fields Included from *Segment
- name string
- anydata...
- name string(default PV2_SEGMENT_NAME) - Segment name
- pv21 PL(default {}) - Prior Pending Location
- pv22 CE(default {}) - Accommodation Code
- pv23 CE(default {}) - Admit Reason
- pv24 CE(default {}) - Transfer Reason
- pv25 ST(default "") - Patient Valuables
- pv26 ST(default "") - Patient Valuables Location
- pv27 IS(default "") - Visit User Code
- pv28 TS(default {}) - Expected Admit Date
- pv29 TS(default {}) - Expected Discharge Date
- pv210 NM(default -1) - Estimated Length of Inpatient Stay
- pv211 NM(default -1) - Actual Length of Inpatient Stay
- pv212 ST(default "") - Visit Description
- pv213 XCN(default {}) - Referral Source Code
- pv214 DT(default "") - Previous Service Date
- pv215 ID(default "") - Employment Illness Related Indicator
- pv216 IS(default "") - Purge Status Code
- pv217 DT(default "") - Purge Status Date
- pv218 IS(default "") - Special Program Code
- pv219 ID(default "") - Retention Indicator
- pv220 NM(default -1) - Expected Number of Insurance Plans
- pv221 IS(default "") - Visit Publicity Code
- pv222 ID(default "") - Visit Protection Indicator
- pv223 XON(default {}) - Clinic Organization Name
- pv224 IS(default "") - Patient Status Code
- pv225 IS(default "") - Visit Priority Code
- pv226 DT(default "") - Previous Treatment Date
- pv227 IS(default "") - Expected Discharge Disposition
- pv228 DT(default "") - Signature on File Date
- pv229 DT(default "") - First Similar Illness Date
- pv230 IS(default "") - Patient Charge Adjustment Code
- pv231 IS(default "") - Recurring Service Code
- pv232 ID(default "") - Billing Media Code
- pv233 TS(default {}) - Expected Surgery Date & Time
- pv234 ID(default "") - Military Partnership Code
- pv235 ID(default "") - Military Non-Availabiltiy Code
- pv236 ID(default "") - Newborn Baby Indicator
- pv237 ID(default "") - Baby Detained Indicator
health.hl7v23: QIP
Query Input Parameter List.
Fields
- Fields Included from *CompositeType
- anydata...
- qip1 ST(default "") - Field Name
- qip2 ST(default "") - Value1&value2&value3
health.hl7v23: QRD
The QRD segment is used to define a query.
Fields
- Fields Included from *Segment
- name string
- anydata...
- name string(default QRD_SEGMENT_NAME) - Segment Name
- qrd1 TS(default {}) - Query Date/Time
- qrd2 ID(default "") - Query Format Code
- qrd3 ID(default "") - Query Priority
- qrd4 ST(default "") - Query ID
- qrd5 ID(default "") - Deferred Response Type
- qrd6 TS(default {}) - Deferred Response Date/Time
- qrd7 CQ(default {}) - Quantity Limited Request
- qrd8 XCN[](default [{}]) - Who Subject Filter
- qrd9 CE[](default [{}]) - What Subject Filter
- qrd10 CE[](default [{}]) - What Department Data Code
- qrd11 CM_VR[](default [{}]) - What Data Code Value Qualifier
- qrd12 ID(default "") - Query Results Level
health.hl7v23: QRF
Query filter segment.
Fields
- Fields Included from *Segment
- name string
- anydata...
- name string(default QRF_SEGMENT_NAME) - Segment Name
- qrf1 ST[](default [""]) - Where Subject Filter
- qrf2 TS(default {}) - When Data Start Date/Time
- qrf3 TS(default {}) - When Data End Date/Time
- qrf4 ST[](default [""]) - What User Qualifier
- qrf5 ST[](default [""]) - Other QRY Subject Filter
- qrf6 ID[](default [""]) - Which Date/Time Qualifier
- qrf7 ID[](default [""]) - Which Date/Time Status Qualifier
- qrf8 ID[](default [""]) - Date/Time Selection Qualifier
- qrf9 TQ(default {}) - When Quantity/Timing Qualifier
health.hl7v23: QRY_A19
Patient query.
Fields
- Fields Included from *Message
- name string
- anydata...
- name string(default QRY_A19_MESSAGE_TYPE) - Message name
- msh MSH - Message header segment
- qrd QRD - Query definition segment
- qrf QRF? - Query filter segment
health.hl7v23: QSC
Query Selection Criteria.
Fields
- Fields Included from *CompositeType
- anydata...
- qsc1 ST(default "") - Name Of Field
- qsc2 ID(default "") - Relational Operator
- qsc3 ST(default "") - Value
- qsc4 ID(default "") - Relational Conjunction
health.hl7v23: QUERY_RESPONSE
QUERY_RESPONSE Segment Group
Fields
- Fields Included from *SegmentComponent
- name string(default QUERY_RESPONSE_SEGMENT_COMPONENT) - Segment Group Name
- isRequired boolean(default true) - Is Segment Group Required
- evn EVN? - ENV Segment
- pid PID? - PID Segment
- pd1 PD1? - PD1 Segment
- nk1 NK1[](default []) - NK1 Segment
- pv1 PV1? - PV1 Segment
- pv2 PV2? - PV2 Segment
- db1 DB1[](default []) - DB1 Segment
- obx OBX[](default []) - OBX Segment
- al1 AL1[](default []) - AL1 Segment
- dg1 DG1[](default []) - DG1 Segment
- drg DRG? - DRG Segment
- procedure PROCEDURE[](default []) - PROCEDURE Segment
- acc ACC? - ACC Segment
health.hl7v23: RCD
Row Column Definition.
Fields
- Fields Included from *CompositeType
- anydata...
- rcd1 ST(default "") - HL7 Item Number
- rcd2 ST(default "") - HL7 Date Type
- rcd3 NM(default -1) - Maximum Column Width
health.hl7v23: RI
Repeat Interval. This field contains the interval between repeating appointments.
Fields
- Fields Included from *CompositeType
- anydata...
- ri1 IS(default "") - Repeat Pattern
- ri2 ST(default "") - Explicit Time Interval
health.hl7v23: ROL
The role segment contains the data necessary to add, update, correct, and delete from the record persons involved
Fields
- Fields Included from *Segment
- name string
- anydata...
- name string(default ROL_SEGMENT_NAME) - Segment name
- rol1 EI(default {}) - Role Instance ID
- rol2 ID(default "") - Action Code
- rol3 CE(default {}) - Role
- rol4 XCN(default {}) - Role Person
- rol5 TS(default {}) - Role Begin Date/Time
- rol6 TS(default {}) - Role End Date/Time
- rol7 CE(default {}) - Role Duration
- rol8 CE(default {}) - Role Action
health.hl7v23: RP
Reference Pointer.
Fields
- Fields Included from *CompositeType
- anydata...
- rp1 ST(default "") - Pointer
- rp2 HD(default {}) - Application ID
- rp3 ID(default "") - Type Of Data
- rp4 ID(default "") - Subtype
health.hl7v23: SCV
Scheduling Class Value Pair.
Fields
- Fields Included from *CompositeType
- anydata...
- scv1 IS(default "") - Parameter Class
- scv2 ST(default "") - Parameter Value
health.hl7v23: SN
Structured Numeric.
Fields
- Fields Included from *CompositeType
- anydata...
- sn1 ST(default "") - Comparator
- sn2 NM(default -1) - Num1
- sn3 ST(default "") - Separator Or Suffix
- sn4 NM(default -1) - Num2
health.hl7v23: TQ
Quantity/timing.
Fields
- Fields Included from *CompositeType
- anydata...
- tq1 CQ(default {}) - Quantity
- tq2 RI(default {}) - Interval
- tq3 ST(default "") - Duration
- tq4 TS(default {}) - Start Date/time
- tq5 TS(default {}) - End Date/time
- tq6 ST(default "") - Priority
- tq7 ST(default "") - Condition
- tq8 TX(default "") - Text
- tq9 ST(default "") - Conjunction
health.hl7v23: TS
Time Stamp.
Fields
- Fields Included from *CompositeType
- anydata...
- ts1 ST(default "") - Time Of An Event
health.hl7v23: Type
Generic data type for HL7 messages.
health.hl7v23: VH
Visiting Hours.
Fields
- Fields Included from *CompositeType
- anydata...
- vh1 ID(default "") - Start Day Range
- vh2 ID(default "") - End Day Range
- vh3 TM(default "") - Start Hour Range
- vh4 TM(default "") - End Hour Range
health.hl7v23: VID
Version Identifier.
Fields
- Fields Included from *CompositeType
- anydata...
- vid1 ID(default "") - Version Id
- vid2 CE(default {}) - Internationalization Code
- vid3 CE(default {}) - International Version Id
health.hl7v23: XAD
Extended Address.
Fields
- Fields Included from *CompositeType
- anydata...
- xad1 ST(default "") - Street Address
- xad2 ST(default "") - Other Designation
- xad3 ST(default "") - City
- xad4 ST(default "") - State Or Province
- xad5 ST(default "") - Zip Or Postal Code
- xad6 ID(default "") - Country
- xad7 ID(default "") - Address Type
- xad8 ST(default "") - Other Geographic Designation
- xad9 IS(default "") - County/parish Code
- xad10 IS(default "") - Census Tract
health.hl7v23: XCN
Extended Composite ID Number And Name.
Fields
- Fields Included from *CompositeType
- anydata...
- xcn1 ST(default "") - ID Number
- xcn2 ST(default "") - Family Name
- xcn3 ST(default "") - Given Name
- xcn4 ST(default "") - Middle Initial Or Name
- xcn5 ST(default "") - Suffix
- xcn6 ST(default "") - Prefix
- xcn7 ST(default "") - Degree
- xcn8 IS(default "") - Source Table
- xcn9 HD(default {}) - Assigning Authority
- xcn10 ID(default "") - Name Type
- xcn11 ST(default "") - Identifier Check Digit
- xcn12 ID(default "") - Code Identifying The Check Digit Scheme Employed
- xcn13 IS(default "") - Identifier Type Code
- xcn14 HD(default {}) - Assigning Facility ID
health.hl7v23: XON
Extended Composite Name And ID For Organizations.
Fields
- Fields Included from *CompositeType
- anydata...
- xon1 ST(default "") - Organization Name
- xon2 IS(default "") - Organization Name Type Code
- xon3 NM(default -1) - ID Number
- xon4 ST(default "") - Check Digit
- xon5 ID(default "") - Code Identifying The Check Digit Scheme Employed
- xon6 HD(default {}) - Assigning Authority
- xon7 IS(default "") - Identifier Type Code
- xon8 HD(default {}) - Assigning Facility ID
health.hl7v23: XPN
Extended Person Name.
Fields
- Fields Included from *CompositeType
- anydata...
- xpn1 ST(default "") - Family Name
- xpn2 ST(default "") - Given Name
- xpn3 ST(default "") - Middle Initial Or Name
- xpn4 ST(default "") - Suffix
- xpn5 ST(default "") - Prefix
- xpn6 ST(default "") - Degree
- xpn7 ID(default "") - Name Type Code
- xpn8 ID(default "") - Name Representation Code
health.hl7v23: XTN
Extended Telecommunication Number.
Fields
- Fields Included from *CompositeType
- anydata...
- xtn1 TN(default "") - Telephone Number
- xtn2 ID(default "") - Telecommunication Use Code
- xtn3 ID(default "") - Telecommunication Equipment Type
- xtn4 ST(default "") - Email Address
- xtn5 NM(default -1) - Country Code
- xtn6 NM(default -1) - Area/city Code
- xtn7 NM(default -1) - Phone Number
- xtn8 NM(default -1) - Extension
- xtn9 ST(default "") - Any Text
Anydata types
health.hl7v23: VARIES
VARIES
Variable Datatype
String types
health.hl7v23: DT
DT
Date string
health.hl7v23: DTM
DTM
health.hl7v23: FT
FT
Formatted Text Data
health.hl7v23: ID
ID
health.hl7v23: IS
IS
health.hl7v23: ST
ST
health.hl7v23: TM
TM
Time Format: HH[MM[SS[.S[S[S[S]]]]]][+/-ZZZZ]
health.hl7v23: TN
TN
Telephone Number Format: [NN] [(999)]999-9999[X99999][B99999][C any text]n
health.hl7v23: TX
TX
Text Data String data meant for user display
Integer types
health.hl7v23: SI
SI
Import
import ballerinax/health.hl7v23;
Metadata
Released date: over 1 year ago
Version: 1.0.0
Compatibility
Platform: any
Ballerina version: 2201.4.1
GraalVM compatible: Yes
Pull count
Total: 57
Current verison: 2
Weekly downloads
Keywords
Healthcare
HL7
HL7v2.3
Contributors