web stats
Using "Use Strict Parser" a hl7 message without PID doesn't rejected - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #1  
Old 12-11-2017, 09:08 AM
jasmine jasmine is offline
Mirth Newb
 
Join Date: Jun 2013
Posts: 9
jasmine is on a distinguished road
Default Using "Use Strict Parser" a hl7 message without PID doesn't rejected

Hi,
I'm very new with Mirth.
I'm using Mirth 3.5.1
I flagged the two options :
Use Strict Parser and Validate in Strict Parser
I sent a message ADT^A08^ADT_A01 without the PID segment,

I don't understand why the message is processed and I don't receive any parsing message error, but if i send the message with an incomplete MSH I receive a parsing error.

I would like to avoid to write a lot of filters to handle the mandatory segments.

Thank you
Reply With Quote
  #2  
Old 12-14-2017, 02:28 AM
siddharth siddharth is offline
Mirth Guru
 
Join Date: Feb 2013
Posts: 835
siddharth is on a distinguished road
Default

This is a surprise.

The validation is done using HL7 v2 XML schemas, which will work only uptil version 2.6. It starts to throw an error when using 2.7.

Per the v2 XML of ADT_A01 message( cos A01 shares the same structure as A08), PID is mandatory. I tried the same thing as you did but it does not throw an error for a missing PID. It however throws an error if MSH is missing the version.

So I concur with what you found, but don't know why this is happening.
__________________
HL7v2.7 Certified Control Specialist!
Reply With Quote
  #3  
Old 12-14-2017, 03:27 AM
odo odo is online now
OBX.3 Kenobi
 
Join Date: Feb 2017
Location: Luxembourg
Posts: 140
odo is on a distinguished road
Default

Quote:
Originally Posted by siddharth View Post
So I concur with what you found, but don't know why this is happening.
This sounds like just the segments themselves are checked (if mandatory fields are filled, if values correspond to reference tables) but not the message structure (meaning if the segment correspond to the message type/trigger event).
Reply With Quote
  #4  
Old 12-14-2017, 04:20 AM
siddharth siddharth is offline
Mirth Guru
 
Join Date: Feb 2013
Posts: 835
siddharth is on a distinguished road
Default

Yes. Here is a snippet from the Mirth user guide 3.5, which says it "allows" automatic validation. I don't know what purpose it would serve -

__________________
HL7v2.7 Certified Control Specialist!

Last edited by siddharth; 12-14-2017 at 04:22 AM. Reason: foo
Reply With Quote
  #5  
Old 12-18-2017, 02:23 AM
jasmine jasmine is offline
Mirth Newb
 
Join Date: Jun 2013
Posts: 9
jasmine is on a distinguished road
Default

Thank you for the answers.
just for completeness I'm using HL7 v. 2.5.
As Siddarth wrote, in the documentation is written:
" The strict mode parses messages into and from XML according to the official XSD, and allows automatic validation against the HL7 specification."
The official XSD the cardinality of the PID in a ADT_A01 structure is equal to 1

<xsd:complexType name="ADT_A01.CONTENT">
<xsd:sequence>
<xsd:element ref="MSH" minOccurs="1" maxOccurs="1"/>
<xsd:element ref="SFT" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element ref="EVN" minOccurs="1" maxOccurs="1"/>
<xsd:element ref="PID" minOccurs="1" maxOccurs="1”/>

there is somebody that have some suggestion form me?
Thank you
Reply With Quote
  #6  
Old 12-20-2017, 11:48 AM
Shamil Shamil is offline
OBX.3 Kenobi
 
Join Date: May 2013
Posts: 158
Shamil is on a distinguished road
Default

I wonder where did you get that official XSD? Mirth uses HAPI for strict parsing, which in it turns uses it's own default validator. Default validator is able to handle datatypes and that kind of thing but not the message structure.

See Validating Messages section at https://hapifhir.github.io/hapi-hl7v2/devbyexample.html

To perform message structure validation one needs to define conformance profile, which looks more like the one produced by MessagingWorkbench. And then apply HAPI validation with such profile in context.

To give a sense, this is the A31 profile available with HAPI source(significantly reduced, see my cuts):

Code:
<HL7v2xConformanceProfile HL7Version="2.4" ProfileType="HL7">
  <MetaData Name="update person information" OrgName="UHN" Version="HL7 2.4" Status="" Topics="confsig-UHN-2.4-profile-accNE_accAL-Deferred"/>
  <Encodings>
    <Encoding>ER7</Encoding>
  </Encodings>
  <DynamicDef AccAck="NE" AppAck="AL" MsgAckMode="Deferred"/>
  <HL7v2xStaticDef MsgType="ADT" EventType="A31" MsgStructID="ADT_A05" EventDesc="update person information" Role="Sender">
    <MetaData Name="update person information" OrgName="UHN" Version="HL7 2.4" Status="" Topics="confsig-UHN-2.4-static-ADT-A31-null-ADT_A05-HL7 2.4--Sender"/>
    <Segment Name="MSH" LongName="Message Header" Usage="R" Min="1" Max="1">
<!--snip-->
    </Segment>
    <Segment Name="EVN" LongName="Event Type" Usage="R" Min="1" Max="1">
<!--snip-->
    </Segment>
    <Segment Name="PID" LongName="Patient identification" Usage="R" Min="1" Max="1">
      <Field Name="Set ID - PID" Usage="X" Min="0" Max="*" Datatype="SI" Length="4" ItemNo="00104">
        <Reference>3.4.2.1</Reference>
      </Field>
      <Field Name="Patient ID" Usage="X" Min="0" Max="*" Datatype="CX" Length="20" ItemNo="00105">
        <Reference>3.4.2.2</Reference>
        <Component Name="ID" Usage="O" Datatype="ST" Length="3">
				</Component>
      </Field>
<!--snip-->

Last edited by Shamil; 12-20-2017 at 12:57 PM.
Reply With Quote
  #7  
Old 01-11-2018, 09:12 AM
jasmine jasmine is offline
Mirth Newb
 
Join Date: Jun 2013
Posts: 9
jasmine is on a distinguished road
Default

thank you,
but I continue to don't understand why Mirth accept message also without PID segment.
(in Strict Parser Mode)

I downloaded the official XSD from this link

http://www.hl7.org/implement/standar...product_id=214
Reply With Quote
  #8  
Old 01-11-2018, 02:18 PM
Shamil Shamil is offline
OBX.3 Kenobi
 
Join Date: May 2013
Posts: 158
Shamil is on a distinguished road
Default

"However the schema is not in itself a normative part of this specification.". There is no normative HL7v2 XML Schema.

Again, HAPI library does not validate the message structure (unless you use Conformance profiles). That's why Mirth cannot do the same.
Reply With Quote
Reply

Tags
segment, strict parser

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 01:08 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2019, vBulletin Solutions, Inc.
Mirth Corporation