From: Steve P. <spr...@pe...> - 2006-01-11 07:28:05
|
Hi Nico, Bryan, Sounds reasonable to me! Not sure how easy that is to do, however. In PipeParser, check if it's vers 2.2, then if it's got an additional subcomponent (MSH-9-3) throw it out? Thanks, Steve > -----Original Message----- > From: Nico Vannieuwenhuyze [mailto:ni...@sk...]=20 > Sent: Tuesday, January 10, 2006 10:51 PM > To: spr...@po...; 'Bryan Tripp' > Cc: hl7...@li... > Subject: RE: [HAPI-devel] Detemining the Message type in=20 > Application.processMessage(...) >=20 >=20 > Hi Steve, Bryan, >=20 > I'm also afraid that you won't be able to force the 3rd party=20 > system to=20 > modify their hl7 message (unless they use a communications=20 > server of course). >=20 > Pure theoretically I think that the PipeParser class should=20 > be able to deal=20 > with this message (by ignoring MSH-9-3) since the messagestructure=20 > component was not yet defined in HL7 version 2.2 and in that=20 > case I think=20 > that HL7 expects you to ignore all additional non-expected=20 > components... >=20 > What do you think ? >=20 > Regards >=20 > Nico >=20 > At 11/01/2006, Steve Pringle wrote: > >Unfortunately righteous ire isn't working in this situation (big=20 > >hospital, little software group)... Are you suggesting I=20 > modify some=20 > >HAPI source (Parser, Application, Connection, or) in order=20 > to edit the=20 > >MSH message > >*before* it gets parsed and sent to=20 > Application.processMessage(Message in)? > > > >So yes, pointers would be appreciated! > > > >Thanks, > >Steve > > > > > -----Original Message----- > > > From: hl7...@li... > > > [mailto:hl7...@li...] On=20 > Behalf Of Bryan=20 > > > Tripp > > > Sent: Tuesday, January 10, 2006 2:50 PM > > > To: spr...@po... > > > Cc: hl7...@li... > > > Subject: Re: [HAPI-devel] Detemining the Message type in > > > Application.processMessage(...) > > > > > > > > > Yes, that would do it. Righteous ire might work, or if they don't=20 > > > respond well to that, all I can suggest is to hack=20 > something in to=20 > > > blank that field before the message is parsed. Let me know if you=20 > > > need pointers there. > > > > > > Bryan > > > > > > On 1/10/06, Steve Pringle <st...@pr...> wrote: > > > > It looks like the MSH I have does not meet the HL7 2.2=20 > specs? The=20 > > > > message type is in MSH-9, but there's also an int (43) in=20 > > > > 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:900771 > > > 3: > > > > :AL:"" > > > > : > > > > > > > ^ > > > > ^ > > > > As I understand it, field MSH-9 is a msg type, > > > "Components: <message type> > > > > ^ <trigger event>", but the msg type sent is=20 > "ADT;A04;43", which=20 > > > > is incorrect according to the standards? In addition, there's > > > an extra field > > > > after the msg type, it's either "43" or "9007713" > > > (depending on how the > > > > segment is parsed), before the processing ID (P). But it > > > 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 > > > approach to > > > > handling messages in my Application class, when a message > > > is sent via > > > > the "processMessage(Message in)" method, is to simply do an > > > "instance > > > > of" on the msg to determine it's type, then process the msg=20 > > > > accordingly. But with these msgs I'm being sent > > > "instanceof" fails, > > > > due to the MSH-9-3 field being present. If I remove the > > > MSH-9-3 field > > > > 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 > > > GenericMessage. Message > > > > must have a recognized structure. > > > > at=20 > 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 > > > Behalf Of Bryan > > > > > 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 > > > in field > > > > > MSH-9. Actually if they are there, HAPI should not use the=20 > > > > > GenericMessage class, and you should be able to tell=20 > what kind=20 > > > > > of message it is from the class. Maybe these data are > > > missing from the > > > > > 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=20 > Version: " +=20 > > > > > > in.getVersion()); > > > > > > System.out.println("\nmsg ?: " +=20 > > > > > > in.get("MSH").getName()); > > > > > > > > > > > > String[] names =3D in.getNames(); > > > > > > > > > > > > for (int i =3D 0; i <=20 > 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!=20 > > > > > > = 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 > > > grep through > > > > > log files for problems? Stop! Download the new AJAX > > > search engine > > > > > that makes searching your log files as easy as=20 > surfing the web.=20 > > > > > DOWNLOAD SPLUNK!=20 > http://ads.osdn.com/?ad_idv37&alloc_id865&op=CCk > > > > > _______________________________________________ > > > > > 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_id865&op=CCk > > > _______________________________________________ > > > 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 grep=20 > through log=20 > >files for problems? Stop! Download the new AJAX search engine that=20 > >makes searching your log files as easy as surfing the web. =20 > DOWNLOAD=20 > >SPLUNK! http://ads.osdn.com/?ad_idv37&alloc_id865&opick > >_______________________________________________ > >Hl7api-devel mailing list > >Hl7...@li... > >https://lists.sourceforge.net/lists/listinfo/hl7api-devel >=20 >=20 >=20 |