From: Steve P. <st...@pr...> - 2006-01-10 23:16:37
|
Unfortunately righteous ire isn't working in this situation (big = hospital, little software group)... Are you suggesting I modify some HAPI source (Parser, Application, Connection, or) in order to edit the MSH message *before* it gets parsed and sent to Application.processMessage(Message = in)? So yes, pointers would be appreciated! Thanks, Steve > -----Original Message----- > From: hl7...@li...=20 > [mailto:hl7...@li...] On Behalf=20 > Of Bryan Tripp > Sent: Tuesday, January 10, 2006 2:50 PM > To: spr...@po... > Cc: hl7...@li... > Subject: Re: [HAPI-devel] Detemining the Message type in=20 > Application.processMessage(...) >=20 >=20 > Yes, that would do it. Righteous ire might work, or if they=20 > don't respond well to that, all I can suggest is to hack=20 > something in to blank that field before the message is=20 > parsed. Let me know if you need pointers there. >=20 > Bryan >=20 > On 1/10/06, Steve Pringle <st...@pr...> wrote: > > It looks like the MSH I have does not meet the HL7 2.2 specs? The=20 > > message type is in MSH-9, but there's also an int (43) in MSH-9-3... > > > > Here's the ADT A04 sample msg I have (header only): > > > >=20 > MSH:;~\&:HBOC:A:HBOC:A:200512152351::ADT;A04;43:9007713:P:2.2:9007713: > > :AL:"" > > : > > =20 > ^ > > ^ > > As I understand it, field MSH-9 is a msg type, =20 > "Components: <message type> > > ^ <trigger event>", but the msg type sent is "ADT;A04;43", which is > > incorrect according to the standards? In addition, there's=20 > an extra field > > after the msg type, it's either "43" or "9007713"=20 > (depending on how the > > segment is parsed), before the processing ID (P). But it=20 > seems 9007713 is > > the sequence #, so why two of them? > > > > 9 7 CM R 0076 00009 Message type > > 10 20 ST R 00010 Message control ID > > 11 1 ID R 0103 00011 Processing ID > > 12 8 ID R 0104 00012 Version ID > > > > Any suggestions on how to deal with this? It seems a good=20 > approach to=20 > > handling messages in my Application class, when a message=20 > is sent via=20 > > the "processMessage(Message in)" method, is to simply do an=20 > "instance=20 > > of" on the msg to determine it's type, then process the msg=20 > > accordingly. But with these msgs I'm being sent=20 > "instanceof" fails,=20 > > due to the MSH-9-3 field being present. If I remove the=20 > MSH-9-3 field=20 > > it parses properly, as an ADT_A04. > > > > Here's output from parsing the original msg: > > > > msg Name: GenericMessage$V22 > > > > msg Name: ca.uhn.hl7v2.model.GenericMessage$V22 > > > > msg Version: 2.2 > > > > msg ?: MSH > > ** MSH-9-1 is: ADT > > ** MSH-9-2 is: A04 > > ** MSH-9-3 is: 43 > > ** MSH-10 is: 9007713 > > ** MSH-11 is: P > > ** MSH-12 is: 2.2 > > ** MSH-13 is: 9007713 > > ** MSH-14 is: null > > ** MSH > > ** EVN > > ca.uhn.hl7v2.HL7Exception: Can't XML-encode a=20 > GenericMessage. Message=20 > > must have a recognized structure. > > at ca.uhn.hl7v2.parser.XMLParser.doEncode(XMLParser.java:251) > > at ca.uhn.hl7v2.parser.Parser.encode(Parser.java:221) > > at ABParse.main(ABParse.java:79) > > > > And here's output from parsing the modified msg > >=20 > (MSH:;~\&:HBOC:A:HBOC:A:200512152351::ADT;A04:43:P:2.2:9007713::AL:"": > > ) > > > > msg Name: ADT_A04 > > > > msg Name: ca.uhn.hl7v2.model.v22.message.ADT_A04 > > > > msg Version: 2.2 > > > > msg ?: MSH > > ** MSH-9-1 is: ADT > > ** MSH-9-2 is: A04 > > ** MSH-9-3 is: null > > ** MSH-10 is: 43 > > ** MSH-11 is: P > > ** MSH-12 is: 2.2 > > ** MSH-13 is: 9007713 > > ** MSH-14 is: null > > ** MSH > > ** EVN > > ** PID > > ** NK1 > > ** PV1 > > ** PV2 > > ** OBX > > ** AL1 > > ** DG1 > > ** PR1 > > ** GT1 > > ** INSURANCE > > ** ACC > > ** UB1 > > ** UB2 > > message is instanceof ADT_A04 > > <?xml version=3D"1.0"?> > > <ADT_A04 xmlns=3D"urn:hl7-org:v2xml"> > > <MSH> > > <MSH.1>:</MSH.1> > > <MSH.2>;~\&</MSH.2> > > <MSH.3>HBOC</MSH.3> > > <MSH.4>A</MSH.4> > > <MSH.5>HBOC</MSH.5> > > <MSH.6>A</MSH.6> > > <MSH.7> > > <TS.1>200512152351</TS.1> > > </MSH.7> > > <MSH.9> > > <CM_MSG.1>ADT</CM_MSG.1> > > <CM_MSG.2>A04</CM_MSG.2> > > </MSH.9> > > <MSH.10>43</MSH.10> > > <MSH.11>P</MSH.11> > > <MSH.12>2.2</MSH.12> > > <MSH.13>9007713</MSH.13> > > <MSH.15>AL</MSH.15> > > <MSH.16>""</MSH.16> > > </MSH> > > <EVN> > > <EVN.1>A04</EVN.1> > > <EVN.2> > > <TS.1>200512152351</TS.1> > > </EVN.2> > > </EVN> > > </ADT_A04> > > > > > > > > > -----Original Message----- > > > From: hl7...@li... > > > [mailto:hl7...@li...] On=20 > Behalf Of Bryan=20 > > > Tripp > > > Sent: Tuesday, January 10, 2006 1:27 PM > > > To: spr...@po... > > > Cc: hl7...@li... > > > Subject: Re: [HAPI-devel] Detemining the Message type in > > > Application.processMessage(...) > > > > > > > > > Hi Steve, > > > > > > The message type, event, and possibly structure should be=20 > in field=20 > > > MSH-9. Actually if they are there, HAPI should not use the=20 > > > GenericMessage class, and you should be able to tell what kind of=20 > > > message it is from the class. Maybe these data are=20 > missing from the=20 > > > message? > > > > > > Bryan > > > > > > On 1/9/06, Steve Pringle <st...@pr...> wrote: > > > > Could someone please tell me how one goes about determining > > > what type > > > > of message has been received in the > > > Application.processMessage(Message > > > > in) method? > > > > > > > > Here's a code snippet, which is being sent an ADT_A01 msg, > > > but I have > > > > no idea how to determine that it is an ADT_A01. All I want > > > to do is > > > > determine which message type was sent, get the data I need, > > > then send > > > > an ACK. > > > > > > > > public class ABApplication implements Application > > > > { > > > > ... > > > > public Message processMessage(Message in) throws > > > ApplicationException > > > > { > > > > Message out =3D null; > > > > PipeParser parser =3D new PipeParser(); > > > > > > > > try > > > > { > > > > System.out.println("\nmsg Name: " + > > > in.getName()); > > > > System.out.println("\nmsg Name: " +=20 > > > > in.getClass().getName()); > > > > System.out.println("\nmsg Version: " +=20 > > > > in.getVersion()); > > > > System.out.println("\nmsg ?: " +=20 > > > > in.get("MSH").getName()); > > > > > > > > String[] names =3D in.getNames(); > > > > > > > > for (int i =3D 0; i < names.length; i++) > > > > System.out.println("** " + > > > names[i]); > > > > ... > > > > > > > > Here's the output: > > > > > > > > msg Name: GenericMessage$V22 > > > > > > > > msg Name: ca.uhn.hl7v2.model.GenericMessage$V22 > > > > > > > > msg Version: 2.2 > > > > > > > > msg ?: MSH > > > > ** MSH > > > > ** EVN > > > > ** PID > > > > ** NK1 > > > > ** PV1 > > > > > > > > Thanks, > > > > Steve PRingle > > > > > > > > > > > > > > > > > > > > ------------------------------------------------------- > > > > This SF.net email is sponsored by: Splunk Inc. Do you grep > > > through log > > > > files for problems? Stop! Download the new AJAX search > > > engine that > > > > makes searching your log files as easy as surfing the web. > > > DOWNLOAD > > > > SPLUNK! = http://ads.osdn.com/?ad_id=3D7637&alloc_id=3D16865&op=3Dclick > > > > _______________________________________________ > > > > Hl7api-devel mailing list Hl7...@li... > > > > https://lists.sourceforge.net/lists/listinfo/hl7api-devel > > > > > > > > > > > > > ------------------------------------------------------- > > > This SF.net email is sponsored by: Splunk Inc. Do you=20 > grep through=20 > > > log files for problems? Stop! Download the new AJAX=20 > search engine=20 > > > that makes searching your log files as easy as surfing the web. =20 > > > DOWNLOAD SPLUNK! = http://ads.osdn.com/?ad_idv37&alloc_id=16865&op=CCk > > > _______________________________________________ > > > Hl7api-devel mailing list > > > Hl7...@li... > > > https://lists.sourceforge.net/lists/listinfo/hl7api-devel > > > > > > > > > > > > >=20 >=20 > ------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. Do you grep=20 > through log files for problems? Stop! Download the new AJAX=20 > search engine that makes searching your log files as easy as=20 > surfing the web. DOWNLOAD SPLUNK!=20 > http://ads.osdn.com/?ad_idv37&alloc_id=16865&op=CCk > _______________________________________________ > Hl7api-devel mailing list > Hl7...@li... > https://lists.sourceforge.net/lists/listinfo/hl7api-devel >=20 >=20 |