Geeks With Blogs
Thomas Canter

Applies to: BizTalk Server with the HL7 Accelerator

  1. Outline of the problem
    1. Trailing Delimiters are empty values at the end of an object in a HL7 ER7 formatted message.
    2. Examples:
      1. Empty Field
        1. NTE|P|
        2. NTE|P||
      2. Empty component
        1. ORC|1|725^
      3. Empty Subcomponent
        1. ORC|1|||||27&
      4. Empty repeat
        1. OBR|1||||||||027~
    3. Trailing delimiters indicate the following object exists and is empty, which is quite different from null, null is an explicit value indicated by a pair of double quotes -> "".
    4. The BizTalk HL7 Accelerator by default does not allow trailing delimiters.
  2. There are three methods to allow trailing delimiters.

    NOTE: All Schemas always allow trailing delimiters in the MSH Segment

    1. Using party identifiers
      1. MSH3.1 – Receive/inbound processing, using this value as a party allows you to configure the system to allow inbound trailing delimiters.
      2. MSH5.1 – Send/outbound processing, using this value as a party allows you to configure the system to allow outbound trailing delimiters.
      3. Generally, if you allow inbound trailing delimiters, unless you are willing to programmatically remove all trailing delimiters, then you need to configure the send to allow trailing delimiters.
      4. Add the appropriate parties to the BizTalk Parties list from these two fields in your message stream.
      5. Open the BizTalk HL7 Configuration tool and for each party check the "Allow trailing delimiters (separators)" check box on the Validation tab.

      Disadvantage – Each MSH3.1 and MSH5.1 value must be represented in the parties list and configured.

      Advantage – granular control over system behavior for each inbound/outbound system.

    2. Using instance properties of a pipeline used in a send port or receive location.
      1. Open the BizTalk Server Administration console
      2. locate the send port or receive location that contains the BTAHL72XReceivePipeline or BTAHL72XSendPipeline pipeline.
      3. Open the properties
      4. To the right of the pipeline selected locate the […] ellipses button
      5. In the property list, locate the "TrailingDelimiterAllowed" property and set it to True.

      Advantage – All messages through a particular Send Port or Receive Location will allow trailing delimiters.

      Disadvantage – Must configure each Send Port or Receive Location. No granular control over which remote parties will send or receive messages with trailing delimiters.

    3. Using a custom pipeline that uses a pre-configured BTA HL7 Pipeline component.
      1. Use Visual Studio to construct a custom receive and send pipeline using the appropriate assembler or dissasembler.
      2. Set the component property to "TrailingDelimitersAllowed" to True
      3. Compile and deploy the custom pipeline
      4. Use the custom pipeline instead of the standard pipeline for all HL7 message processing

      Advantage – All messages using the custom pipeline will automatically allow trailing delimiters.

      Disadvantage – Requires custom coding and development to create and deploy the custom pipeline. No granular control over which remote parties will send or receive messages with trailing delimiters.

    4. What does a Trailing Delimiter do to the XML Schema?

      Allowing trailing delimiters does not have the impact often expected in the actual XML Schema.
      The Schema reproduces the message with no data loss.
      Thus, the message when represented in XML must contain the extra fields, in order to reproduce the outbound message.
      Thus, a trialing delimiter results in an empty XML field.
      Trailing Delmiters are not stripped from the inbound message.

      Example:
      44172
      9257 -> the original maximum number of repeats
      -> The empty repeated field

    5. Allowing trailing delimiters not remove the trailing delimiters from the message, it simply suppresses the check that will cause the message to fail parse with trailing delimiters.
  3. When can you not fix the problem by enabling trailing delimiters
    1. Each object in a message must have a location in the target BTAHL7 schema for its content to reside.
      If you have more objects in the message than are contained at that location, then enabling trailing delimiters will not resolve the problem. The schema must be extended to accommodate the empty message content.
      Examples:
      1. Extra Field

        NTE|P||||
        Only 4 fields in NTE Segment, the 4th field exists, but is empty.

      2. Extra component

        PID|1|1523|47^^^^^^^
        Only 5 components in a CX data type, the 5th component exists, but is empty

      3. Extra subcomponent

        ORC|1|||||27&&
        Only 2 subcomponents in a CQ data type, the 3rd subcomponent is empty, but exists.

      4. Extra Repeat

        PID|1||||||||||||||||||||4419~5217~
        Only 2 repeats allowed for the field "Mother's identifier", the repeat is empty, but exists.

    2. In each of these cases, you must locate the failing object and extend the type to allow an additional object of that type.
  • Field
    Add a field of ST to the end of the segment with a suitable name in the segments_nnn.xsd
  • Component

    Create a new Custom CX data type (i.e. CX_XtraComp) in the datatypes_nnn.xsd and add a new component to the custom CX data type. Update the field in the segments_nnn.xsd file to use the custom data type instead of the standard datatype.

  • Subcomponent

    Create a new Custom CQ data type that accepts an additional TS value at the end of the data type. Create a custom TQ data type that uses the new custom CQ data type as the first subcomponent. Modify the ORC segment to use the new CQ data type at ORC.7 instead of the standard CQ data type.

  • Repeat
    Modify the Field definition for PID.21 in the segments_nnn.xsd to allow more repeats in the field.

 

Posted on Wednesday, June 20, 2012 7:27 PM | Back to top


Comments on this post: Handling Trailing Delimiters in HL7 Messages

No comments posted yet.
Your comment:
 (will show your gravatar)


Copyright © Thomas Canter | Powered by: GeeksWithBlogs.net