From: Bryan T. <bp...@gm...> - 2006-01-10 22:49:40
|
Yes, that would do it. Righteous ire might work, or if they don't respond well to that, all I can suggest is to hack something in to blank that field before the message is parsed. Let me know if you 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 specs? The messag= e > 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): > > MSH:;~\&:HBOC:A:HBOC:A:200512152351::ADT;A04;43:9007713:P:2.2:9007713::AL= :"" > : > ^ > ^ > As I understand it, field MSH-9 is a msg type, "Components: <message typ= e> > ^ <trigger event>", but the msg type sent is "ADT;A04;43", which is > incorrect according to the standards? In addition, there's an extra fiel= d > 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 i= s > 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 accordingly. But with > these msgs I'm being sent "instanceof" fails, due to the MSH-9-3 field be= ing > 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 mu= st > 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 > (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 GenericMessage class, and you should be able to tell what > > kind 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: " + > > > in.getClass().getName()); > > > System.out.println("\nmsg Version: " + > > > in.getVersion()); > > > System.out.println("\nmsg ?: " + > > > 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 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_idv37&alloc_id=16865&op=CCk > > _______________________________________________ > > Hl7api-devel mailing list > > Hl7...@li... > > https://lists.sourceforge.net/lists/listinfo/hl7api-devel > > > > > > > |