Handling Undeclared Z Segments

There are two types of Z segments: declared Z segments and undeclared Z segments. While they are similar in that you use them for local purposes, they are very different in how you use them.

You include the definition of a declared Z segment in a message schema, and Microsoft BizTalk Accelerator for HL7 (BTAHL7) uses it to process a message, just like a schema defined by the HL7 standard. No schema defines an undeclared Z segment. You include an undeclared Z segment at the end of a message, and BTAHL7 passes through without processing it against a schema. The parser and serializer do not validate it. BTAHL7 treats it as a binary large object (BLOB). The only check that BTAHL7 does on an undeclared Z segment is verifying that the BLOB does not include any existing three-character schema tag.

You include the undeclared Z segment as the third part, or Z part, of a multi-part message. The message includes the header, the body, and the Z part. The Z part has a segment ID starting with the letter "Z".

Note

The Zpart must always contain data. Specifying null for the stream results in an error condition. If no data is included in the Zpart, BTAHL7 inserts the word "Empty" in the Zpart. BTAHL7 uses the context property ZPartPresent to determine whether to serialize the Z part.

Caution

Microsoft has tested Zsegments with ANSI character sets, with the result that Zsegment behavior with ANSI characters is predictable. However, using other character sets in Zsegments may result in unpredictable behavior.

See Also

Extending HL7 2.X Schemas with Z Objects
Creating Declared Z Segments
Creating Custom Data Types in Schemas
Creating Custom Tables in Schemas