Question
· Nov 3, 2017

Out of sequence Z segments in HL7

Hi-  I have a HL7 message ADT_A01 (Admit) that contains several Z segments, which don't necessarily all appear at the end of the document, like normal.  See below...

  1    MSH ^ ~|\& ^ VAFC PIMS ^ 500 ^ HEALTHSHARE ^ 500 ^ 20171103154747-0500 ^  · ^ ADT ~ A01 ^ 50019000 ^ T ^ 2.3 ^  · ^  · ^  · ^ NE ^ USA 
 
  2    EVN ^ A01 ^ 20171103154701-0500 ^  · ^ 05 
 
  3    PID ^ 1 ^ 5000000351V802052 ^ 100853 ~ 1 ~ M10 ^ 3333 ^ POINDEXTER ~ KENNETH ^ "" ^ 19690117 ^ M ^  · ^ "" ~  · ~ 0005 ~ "" ~  · ~ CDC ^ "" ~ "" ~ "" ~ "" ~ "" ~  · ~ P ~ "" ~ "" | "" ~ "" ~ "" ~ "" ~ "" ~  · ~ VACAE ~ "" ~ "" ~  · ~  · ~ "" & "" | "" ~ "" ~ "" ~ "" ~ "" ~  · ~ VACAA ~ "" ~ "" ~  · ~  · ~ "" & "" | "" ~ "" ~ "" ~ "" ~ "" ~  · ~ VACAC ~ "" ~ "" ~  · ~  · ~ "" & "" | "" ~ "" ~ "" ~ "" ~ "" ~  · ~ VACAM ~ "" ~ "" ~  · ~  · ~ "" & "" | "" ~ "" ~ "" ~ "" ~ "" ~  · ~ VACAO ~ "" ~ "" ~  · ~  · ~ "" & "" ^  · ^ "" ^ "" ^  · ^ "" ^ 29 ^  · ^ 555443333 ^  · ^  · ^ "" ~  · ~ 0189 ~ "" ~  · ~ CDC ^   
 
  4    PD1 ^  · ^  · ^ CAMP MASTER ~  · ~ 500 ^ "" 
 
  5    ZPD ^ 1 ^ "" ^ "" ^ "" ^ "" ^ "" ^ "" ^ "" ^ "" ^ "" ^ 0 ^ "" ^ "" ^ "" ^ "" ^ 0 ^ "" ^ 0 ^ "" ^ "" ^ "" 
 
  6    PV1 ^ 1 ^ I ^ 7B ~ "" ~ "" ^  · ^  · ^  · ^ 1002 ~ PROVIDER ~ EIGHTEEN ^  · ^  · ^ 94 ^  · ^  · ^  · ^  · ^  · ^  · ^  · ^ EMPLOYEE ^  · ^  · ^ 1 ^  · ^  · ^  · ^  · ^  · ^  · ^  · ^  · ^  · ^  · ^  · ^  · ^  · ^  · ^  · ^  · ^  · ^  · ^  · ^  · ^  · ^  · ^ 20171103154701-0500 ^ "" ^  · ^  · ^  · ^  · ^ 13976 
 
  7    ROL ^ 13976-1002*1 ^ CO ^ V110000 ~ Physicians (M.D. and D.O.) & Physician/Osteopath & "" ~ VA8932.1 ~ T ~ "" ~ VA01 ^ 1002 & 500 ~ PROVIDER ~ EIGHTEEN ~ "" ~ "" ~ "" ~ "" ~ VA200 | "" ~ "" ~ "" ~ "" ~ "" ~ "" ~ "" ~ "" ~ SSA 
 
  8    ROL ^ 13976-991*2 ^ CO ^ V110000 ~ Physicians (M.D. and D.O.) & Physician/Osteopath & "" ~ VA8932.1 ~ A ~ "" ~ VA01 ^ 991 & 500 ~ PROVIDER ~ EIGHT ~ "" ~ "" ~ "" ~ "" ~ VA200 | "" ~ "" ~ "" ~ "" ~ "" ~ "" ~ "" ~ "" ~ SSA 
 
  9    DG1 ^ 1 ^  · ^  · ^ PSYCHOSIS 
 
  10    ZSP ^ 1 ^ 0 ^ "" ^ "" ^ "" ^ "" ^ "" ^ "" ^  · ^ "" ^ "" 
 
  11    ZEL ^ 1 ^ "" ^ "" ^ "" ^ "" ^ "" ^ "" ^ 0 ^ EMPLOYEE ^ "" ^ "" ^ "" ^ "" ^ "" ^ "" ^ "" ^ "" ^ "" ^ "" ^ "" ^ "" ^ "" 
 
  12    ZCT ^ 1 ^ 1 ^ "" ^ "" ^ "" ^ "" ^ "" ^ "" ^ "" 
 
  13    ZEM ^ 1 ^ 1 ^ "" ^ "" ^ "" ^ "" ^ "" ^ "" ^  · 
 
  14    ZIR ^  · 
 
  15    ZEN ^ 1 
 

My HL7 Router is sending this message to the bad message handler even though my Validation setting on the router is 1.  It's complaining because there is a Z segment that appears before the PV1 segment.  I have no control over the source system and am wondering if there is any way to have this message go through as-is without having to create a custom schema?

If I need to, I can create the custom schema, however, would like to not have to do that if there is a way to just have this message go through without it.

Thanks

Discussion (1)1
Log in or sign up to continue

Do you need to route the message based on criteria supplied in HL7 field values? Is any transformation required?

If the answer to both of those questions is "no," then you really don't need a router ... you can specify the operation(s) in the target config name field for the business service that receives the messages.

If you need to route, though, you'll want to disable BuildMap segment mapping error validation in the routing rule. That's enabled when using 1 as the validation selection. Try "d-m-z" instead, assuming you still want to validate that the messages have a DocType assigned.

Note that you won't be able to (easily) specify routing criteria based on fields in segments starting with the first segment that doesn't match the schema, or (again, easily) work with those segments in DTLs.

If flexibility and maintainability are a requirement, I'd recommend you go ahead and create a custom schema.