Search code examples
hl7mirth-connect

Strict validation in Mirth Connect


Within a Mirth Connect installation (version 3.5.1), I have setup a channel TCP (LLP) that receive a message HL7 and send an XML with the data of the PID segment (plus some of other useful informations about the HL7 message) to an external site.

I want to validate the message (if contains an error) and filtering the message according to some rules for the data of the segment PID (no name, no surname, etc). To accompish this requirement, I have write a simple javascript filter and set in the channel (from Summary tab) the strict validation.

But I have this behavior.

If I don't use the strict validation option for the messages, I get all the data of the segment PID within tags like PID.1, PID.2 etc (e.g. for the name I have the following XML structure <PID.5><PID.5.1>XXX</PID.5.1>....</PID.5>).

Instead, if I use the strict validation option the message (in the filter) became different and other tags are present (e.g. for the name I have the following XML structure <PID.5><XPN.1><FN.1>XXX</FN.1></XPN.1>....</PID.5>).

Someone know the why I have this behavior? It is caused by some misconfiguration? Or it is the normal behavior?

Thanks at all for the support.

UPDATE

I realized only now that the structures were not visible.

Now, yes.

Thanks again at all for the support.


Solution

  • This is normal behavior. The default parser is implemented in the mirth hl7v2 datatype itself. When you use the strict parser, it uses the HAPI parser which produces the alternate xml you are seeing that actually conforms to the hl7 specification.