BTAHL72X Flat File Processing

The following components in Microsoft BizTalk Accelerator for HL7 (BTAHL7) process HL7 2.X (HL7-encoded) messages:

  • Pipelines and core libraries: BTAHL7.PipelineCommon.dll and BTAHL7.PipelineMessageCore.dll

  • Assembler and disassembler libraries: BTAHL7.HL72fAsm.dll and BTAHL7.HL72fDAsm.dll

  • The acknowledgment (ACK) validation library used for the two-way MLLP send adapter: BTAHL7.HL7ACKHelper.dll

HL7 Message Modes

BTAHL7 supports the following message modes for 2.X messages:

  • Publisher-subscriber (pub-sub) mode

    The publisher broadcasts to a party of subscribers, either as declarative or an unsolicited update. BizTalk Server and BTAHL7 provide flexibility to this mode, since you can manage subscriptions and parties after design time.

  • Request-response mode

    An interrogative or query message exchange in which a specific request from a specific entity results in a responding message.

Flat File Parsing

BTAHL7 parses HL7 2.X multi-part messages into three parts:

  • Header-MSH part

  • Body part

  • Z part

HL7 Header Validation

The HL7 disassembler and assembler perform structural and schematic validation of the header of a 2.X message, in order to verify that it can process the message. BTAHL7 bases the schematic validation on the common header schema, MSH_25_GLO_DEF.

For instance, the parser determines that the MSH1 and MSH2 fields are well formed. MSH1 must have only one character. MSH2 must be between two and four characters, and no characters can repeat.

HL7 Body Validation

The HL7 disassembler and assembler perform basic structural validation of the body of a 2.X message, and schematic validation, if you enable it.

The basic structural validation of the body, which BTAHL7 always performs, includes verifying the following:

  • That there are three characters in segments

  • That the segment delimiter is <CR> or <CR><LF> (optional for the last segment)

  • That field delimiters are appropriate

  • That there are no declared segments (with a defined three-character segment tag) in an undeclared Z segment

    More extensive schema validation of the body includes the following:

  • Trailing-field delimiters

    In Header-MSH segment and body segments

  • Z segment

  • XSD-supported and custom data type

    XSD supported and non-XSD types (TS (Time Stamp), DT (date), TM (time), and TN (telephone number)

  • Enumerations

    ID (HL7-defined tables) and IS (user-defined tables)

  • Optionality

    Required and optional

  • Repetition

    Segment and field

  • Escape sequences

    Encoding characters, formatting, and character sets

    You enable or disable schematic validation for all messages received from or sent to a specific party (source party for the disassembler, destination party for the assembler). BTAHL7 uses the HL7 2.X schemas directly for this processing, as determined by the MSH9.3 message-structure header field, the MSH12 Version ID field (2.3.1, 2.4, or 2.5), and the namespace setting in BTAHL7 Configuration Explorer.

HL7 Disassembler Processing

The HL7 disassembler parses incoming HL7 messages into XML segments for processing. As it parses the messages, the disassembler performs the following tasks:

  • Handles escape sequences

  • Handles checks of the required/optional properties

  • Handles defined segments and undefined or unexpected Z segments (for a description of Z segments, see Customizing Messages through Z Objects).

  • Ignores unexpected segments at the end of an instance (which become undeclared Z segments)

Error Reporting

BTAHL7 reports most errors in standard HL7 error format, which include the segment, sequence, field, and error code. However, the error condition may be such that not all of these are available, for instance, if no schema is present. To handle such cases, BTAHL7 can report errors in an alternate BTAHL7 error format. The error segment in a message includes two parts: one for the HL7 error and one for the alternative BTAHL7 error.

ACK Generation

BTAHL7 supports the following types of acknowledgments (ACKs) for 2.X messages. Both the HL7 error type and the BTAHL7 (alternate) error type are used:

  • Mapping original message and ACK

  • HL7 original ACKs

  • HL7 enhanced ACKs

    Commit Accept and Application Accept

  • Static/proxy ACK

    ACK or NAK

Property Promotion

BTAHL7 supports promoting the following 2.X properties:

  • Property schema

  • MSH-header schema

In This Section

See Also

Message Processing
Processing HL7 Messages
Using HL7 2.X Schemas