Consider the following PV1 segment in an HL7v2 message.
PV1|1|E|MYLOC||||55555^Doctor^Doc^D^^Dr^^DOCT|||||||HO||||ER||BC|||||||||||||||||||VALUE||REG|||201406270627||||||||55555^Doctor^Secondary^H^^Dr^^DOCT2|
There are 52 fields there. Our Meditech system always sends out field 52 (PV1_52_OtherHealthcareProvider) on this interface, which it represented here by 55555^Doctor^Secondary^H^^Dr^^DOCT2
. I have it set up so that Allow Trailing Delimiters is ON. As you can see there is a trailing delimiter in this segment, however this is after the final field in the segment, which happens to contain the data shown above.
This will always be the case, Meditech is always appending a trailing delimiter on this interface.
None of the other segments have data in the final field, so we haven't run into this issue with them, despite them having trailing delimiters. On PV1 segment we are receiving an error:
Error happened in body during parsing
Error # 1
Segment Id: PV1
Sequence Number: 1
Error Number: 100
Error Description: Segment sequence error (Unexpected end of message body found)
Encoding System: HL79999
It turns out this is due to the trailing delimiter, because manually removing the delimiter and resubmitting, the error does not occur. Also if I modify the schema to add a dummy (PV1_53_ExtraField) field, the message is allowed.
My question is this: What is the expected behaviour of allow trailing delimiters in this case? Is it supposed to allow a trailing delimiter in all cases, or does it only apply to segments where the final field is void of data (ie: extra fields at the end of the segment)?