Print Page as PDF
HL7 MESSAGE PARSING APIs (PRE-HLO) ICR (4742)

HL7 MESSAGE PARSING APIs (PRE-HLO)    ICR (4742)

Name Value
NUMBER 4742
IA # 4742
DATE CREATED 2005/08/29
CUSTODIAL PACKAGE HEALTH LEVEL SEVEN
USAGE Controlled Subscription
TYPE Routine
DBIC APPROVAL STATUS APPROVED
ROUTINE HLPRS
NAME HL7 MESSAGE PARSING APIs (PRE-HLO)
GENERAL DESCRIPTION
These API's are to be used by applications that were
developed with the HL7 messaging engine that preceded the newer HL7 Optimized
messaging engine that was released in patch HL*1.6*126.

The API's provide support for applications in parsing messages. HL7 escape
sequences are decoded.

STATUS Active
DURATION Till Otherwise Agreed
ID HLPRS
COMPONENT/ENTRY POINT
COMPONENT/ENTRY POINT COMPONENT DESCRIPTION VARIABLES
$$STARTMSG(.HLMSG,IEN,.HEADER)
This function begins the parsing of the message,
parsing the header and returning the individual values in the array HEADER().

VARIABLES TYPE VARIABLES DESCRIPTION
HLMSG Output
(pass by reference, required) This array is used by
the HL7 package to track the progress of parsing the message.  The application
MUST NOT touch it!

IEN Input
(REQUIRED)

Internal Entry Number (IEN) of the message in the HL7 MESSAGE ADMINISTRATION
file (#773)

HEADER Output
(pass by reference, optional)

This array will return the results of parsing the message header. The array
subscripts are:

** Message Header, MSH Segment ** Sequence       Description/Comment

HEADER("SEGMENT TYPE )= "MSH    SEQ1   HEADER("FIELD SEPARATOR )
The field separator.  SEQ2                                   The four other
encoding characters.
HEADER("COMPONENT SEPARATOR )
HEADER("SUBCOMPONENT SEPARATOR )
HEADER("REPETITION SEPARATOR )
HEADER("ESCAPE CHARACTER )      SEQ3   HEADER("SENDING APPLICATION )
SEQ4   HEADER("SENDING FACILITY ,1)    First Component
HEADER("SENDING FACILITY ,2)    Second Component
HEADER("SENDING FACILITY ,3)    Third Component SEQ5
HEADER("RECEIVING APPLICATION ) SEQ6   HEADER("RECEIVING FACILITY ,1)  First
Component
HEADER("RECEIVING FACILITY ,2)  Second Component
HEADER("RECEIVING FACILITY ,3)  Third Component SEQ7   HEADER("DT/TM OF
MESSAGE )      Converted to FileMan format.  SEQ8   HEADER("SECURITY )
SEQ9   HEADER ("MESSAGE TYPE )         First Component
HEADER("EVENT )                 Second Component
HEADER("MESSAGE STRUCTURE )     Third Component SEQ10  HEADER("MESSAGE
CONTROL ID )    Message control ID.  SEQ11  HEADER("PROCESSING ID )
First Component
HEADER("PROCESSING MODE )       Second Component SEQ12  HEADER("VERSION
)       SEQ14  HEADER("CONTINUATION POINTER )  MESSAGE CONTROL ID of the
message that this one continues.  SEQ15  HEADER("ACCEPT ACK TYPE )
ACCEPT ACKNOWLEDGMENT TYPE, <AL or NE> SEQ16  HEADER("APP ACK TYPE )
APPLICATION ACKNOWLEDGMENT TYPE, <AL or NE> SEQ17  HEADER("COUNTRY )
COUNTRY CODE


** Message Header, BHS Segment ** Sequence       Description/Comment

HEADER("SEGMENT TYPE )= "BHS    SEQ1   HEADER("FIELD SEPARATOR )
The field separator.  SEQ2                                   The four other
encoding characters.
HEADER("COMPONENT SEPARATOR )
HEADER("SUBCOMPONENT SEPARATOR )
HEADER("REPETITION SEPARATOR )
HEADER("ESCAPE CHARACTER )      SEQ3   HEADER("SENDING APPLICATION )
SEQ4                                    Sending Facility
HEADER("SENDING FACILITY ,1)    First Component
HEADER("SENDING FACILITY ,2)    Second Component
HEADER("SENDING FACILITY ,3)    Third Component SEQ5
HEADER("RECEIVING APPLICATION ) SEQ6
Receiving Facility
HEADER("RECEIVING FACILITY ,1)  First Component
HEADER("RECEIVING FACILITY ,2)  Second Component
HEADER("RECEIVING FACILITY ,3)  Third Component SEQ7   HEADER("DT/TM OF
MESSAGE )      Converted to FileMan Format.  SEQ8   HEADER("SECURITY ) SEQ9
HEADER("BATCH NAME/ID/TYPE ) These fields are not defined by the standard
within the BHS segment, but they are needed and are encoded in SEQ 9 by the
VistA HL7 package:
HEADER("PROCESSING ID )
HEADER("ACCEPT ACK TYPE )
HEADER("APP ACK TYPE ) SEQ10  HEADER("BATCH COMMENT ) The VistA HL7
package, Version 1.6, Pre-HLO, currently requires that an application
designate a batch message as being of a particular message type, event type,
and version, and this information is encoded as components of SEQ10
HEADER("MESSAGE TYPE )
HEADER("EVENT )
HEADER("VERSION ) SEQ11  HEADER("BATCH CONTROL ID )      SEQ12
HEADER("REFERENCE BATCH CONTROL ID )

$$STARTMSG Output
Function returns 1 on success, 0 on failure. Failure
would indicate that the message was not found.

$$NEXTSEG(.HLMSG,.SEGMENT)
This function advances parsing to the next segment.

VARIABLES TYPE VARIABLES DESCRIPTION
$$NEXTSEG Output
Function returns 1 on success, 0 if there are no more
segments in this message.  For batch messages, a return value of 0 does not
preclude the possibility that there are additional individual messages within
the batch.

HLMSG Both
(pass by reference, required)

This array is used by the HL7 package to track the current position in the
message.  The application MUST NOT touch it!

SEGMENT Output
(pass by reference, required)

The segment is returned in this array. SEGMENT("SEGMENT TYPE") is returned
with the 3 letter HL7 segment type that always begins a segment.

The structure is not further described here because it should not be accessed
directly by the application developer. Use $$GET to obtain individual segment
values.  As a shortcut, $$GET^HLOPRS(0) may be used to return the segment
type.

$$NEXTMSG(.HLMSG,.MSH)
Advances to the next message within the batch, with
the MSH segment returned.

VARIABLES TYPE VARIABLES DESCRIPTION
$$NEXTMSG Output
Function returns 1 on success, 0 if there are no more
messages.

HLMSG Both
(pass by reference, required)

This array is used by the HL7 package to track the current position in the
message.  The application MUST NOT touch it!

MSH Output
(pass by reference, required)

This array returns the MSH segement of the next message in the batch  in the
same format as the $$STARTMSG API.

SUBSCRIBING PACKAGE
SUBSCRIBING PACKAGE SUBSCRIBING DETAILS
INTEGRATED BILLING
The IB package is granted authority to use these new
APIs for the PFSS project.

REGISTRATION
The DG package is granted authority to use these new
APIs for the PFSS project.

CONTROLLED SUBSTANCES
IFCAP
added 6/1/2010
INPATIENT MEDICATIONS
3/2/16-Inpatient Meds added as a subscriber for
Pharmacy Interface (PIA) Automation project.