From: Scott A. <sa...@bj...> - 2005-11-28 15:25:54
|
I'm relatively new to using HAPI and I am having a rather troubling = problem. Quite a few different HL7 messages are being recognized as A01 = messages. I am unsure whether it is a problem with HAPI, a problem with = the format of the HL7 messages, or a problem with my understanding of how = to use HAPI. I am currently using HAPI 0.5 beta. Does anyone know how = HAPI decides what message to create? An example message (with fake data): [pre] MSH|^~\&|SYST12|100|SYST34|100|20050929132200||ADT^A08|00000000013443566|P|= 2.3 EVN|A08|20050929132157|||JOEYDIRT PID||000114333~454545|565656|~67676767|ROGERS^ROGER^C^^||19400610|F||W|4444= UNKNOWN RD^^SOMEWHERE^CA^22223^^^JAMES|JAMES|(555)555-5555|(555)555-5555||= M|NON|342342344|234234234 PD1||||08790^OKEEFE^MIKE^J^^ NK1|1|DEMORRO^PAT^D^^|D|4444 UNKNOWN RD^^SOMEWHERE^CA^22223^^^JAMES|(555)55= 5-5555|(555)555-5555|||||||ACME ROCKET COMPANY|M|F|19800412|||||||||NON||||= ||||000234234||W||867574856 PV1||O||3|||00333^LIVERS^SLIMEY^L|04360^ROGERS^ROGY^P||ANC||||1|||00333^GOE= RGE^MIKEY^A^^|B||4376|2|||||||||||||||3|||100|OCCPD||||200509211637|2005092= 11637|451.00|451.00 DG1|1|I9|V4545|SOME CRAZY EXAM||A|||||||||0 DG1|2|I9||SOME CRAZY EXAM||A|||||||||0 GT1|1|000767676|PERSON^ANOTHER^M^^|BLAHBLAH^TIMMY^Y^^|140 NORTH ST^^STAMPTO= N^CA^98765^^^BELGY|(555)444-4444|(555)444-4444|19740105|M||A|978567464||||T= RUE|^^^^||||||||||||34356|M||||||||Y|||NON||||||||||||||W IN1|1||8250|BLUE CROSS BLUE SHIELD|1201 CORD RD^^MEMPHIS^TN^56845-3467||(55= 5)888-8888|005894857485|||||||COM|ROGERS^ROGER^C^^|A|19400610|586 DUCK = RD^^STAMPTON^CA^95843^^^^|||1||||||||||||||TMF213A56843|||||||M|^^^^|N||||0= 00124677 IN2||999999999|40596^TRUE|||||||||||||||||||||||||||||||||Y|||NON|||W|M||||= ||||||||||||||||(555)444-3333||||||||W ZOR| [/pre] In the MSH segment, the Message Type.Trigger Event clearly specifies it is = an A08, yet it gets parsed by HAPI as an A01. A ran through the following message types: A01, A02, A03, A04, A05, A06, = A08, A13, A28, and A31. Only the A01, A02, A03, and A06 messages are = recognized for what they are. All other messages (A04, A05, A08, A28, and = A31) are parsed as A01. My code is similar to as follows (assume "msg" is a String variable = containing the example message): [pre] PipeParser pipeParser =3D new PipeParser(); Message m =3D pipeParser.parse(msg); if (m instanceof ADT_A01) { ADT_A01 a01 =3D (ADT_A01) m; String triggerEvent =3D a01.getMSH().getMessageType().getTriggerEvent()= .getValue(); if ("A08".equals(triggerEvent)) { System.out.println("Oops, this A01 looks like it should have been = an A08!"); } } [/pre] Thanks for any insight you can provide, Scott Arnold Analyst |