1

Is there any good parser which can parser HL7 V2.7 message using Java except HAPI. My goal is to convert the message into a XML file.

user1321939
  • 319
  • 2
  • 6
  • 18
  • I tried with Hapi but hapi don't have support for 2.7. It's throwing me exception. I have JL7 from google, but not usable. So could you please suggest some better tool. – user1321939 Aug 11 '14 at 09:56
  • 1
    Do you have already a communication partner using **HL7 V2.7**? with version specifics? If not, 2.7 is mostly compatible with prior versions. – sqlab Aug 11 '14 at 13:08
  • By Modifying some part of HAPI code I am able to convert some messages. So, could you please tell me what is the difference between 2.7 and 2.6 messages so that I can add validation features. I am new to health care domain so giving trouble. sorry for that. – user1321939 Aug 12 '14 at 08:59

2 Answers2

1

There is my own open source alternative called HL7X, which does work with any HL7v2 version. It converts your HL7 String into a XML String.

Example:

MSH|^~\&|||||20121116122025||ADT^A01|5730224|P|2.5||||||UNICODE UTF-8
EVN|A01|20130120151827
PID||0|123||Name^Firstname^^^^||193106170000|w
PV1||E|

Gets transformed to

<?xml version="1.0" encoding="UTF-8"?>
<HL7X>
<HL7X>
    <MSH>
        <MSH.1>^~\&amp;</MSH.1>
        <MSH.6>20121116122025</MSH.6>
        <MSH.8>
            <MSH.8.1>ADT</MSH.8.1>
            <MSH.8.2>A01</MSH.8.2>
        </MSH.8>
        <MSH.9>5730224</MSH.9>
        <MSH.10>P</MSH.10>
        <MSH.11>2.5</MSH.11>
        <MSH.17>UNICODE UTF-8</MSH.17>
    </MSH>
    <EVN>
        <EVN.1>A01</EVN.1>
        <EVN.2>20130120151827</EVN.2>
    </EVN>
    <PID>
        <PID.2>0</PID.2>
        <PID.3>123</PID.3>    
        <PID.5>
            <PID.5.1>Name</PID.5.1>
            <PID.5.2>Firstname</PID.5.2>
        </PID.5>
        <PID.7>193106170000</PID.7>
        <PID.8>F</PID.8>
    </PID>
    <PV1>
        <PV1.2>E</PV1.2>            
    </PV1>
</HL7X>

Philipp
  • 4,645
  • 3
  • 47
  • 80
0

this http://www.dcm4che.org/confluence/display/ee2/Home open source Java software can receive various HL7 messages through the MLLP protocol, convert them to XML, run through XSLT transformer and then load them into database and serve to DICOM clients as needed. In order to do this in the code base there is the HL7->XML code. Just find it, copy/paste it and use it.

Once I knew where exactly this code is as I was troubleshooting message character set problem. At that time I have found that the HL7 parser is rather simple-minded and can understand only 1 character set provided in the configuration. It does not read/use character set (MSH-18, Table 0211, Grahame Grieve's encoding tips) provided in the messages neither does it support switching character sets during the message decoding (see chapter "Escape sequences supporting multiple character sets" in HL7 specification).

So I know the parser code is there. It is in Java. It produces XML inputs for the customer-specific XSLT transformation script. It should be quite easy to reuse.

You should be able to find it by yourself. Otherwise your question would turn out as plain finding a tool §4 is an off-topic :)

Community
  • 1
  • 1
xmojmr
  • 8,073
  • 5
  • 31
  • 54
  • Thanks a lot. I like to play with dcm4che. Is it feasible for HL7 v2.7 messages also? – user1321939 Aug 18 '14 at 06:44
  • @user1321939 Sorry, I'm not sure about dcm4chee compatibility with HL7 v2.7. Either download & install it and try or ask at the development community. I think it should be compatible as it could read general HL7 v2 message format as of HL7 v2.5 and according to [New features of HL7 version 2.6](http://www.ringholm.de/docs/00720_en.htm) and [New features of HL7 version 2.7](http://www.ringholm.de/docs/00750_en_HL7_27_features.htm) it seems that the HL7 v2.7 message format remained almost backward compatible (..one of the original design goals..), if not then you should be able to hack it :) – xmojmr Aug 18 '14 at 15:52