Hi Depeche,
A24 is kind of a weird message structure, in that it has two distinct PID
segments in the same group. To access the second one, use "/PID2-x-x"
instead of "/PID-x-x" in your terser paths.
Note that you can find the appropriate value to use in situations like this
using the HAPI Xref <http://hapi-xref.appspot.com/#V26_MSG_ADT%5EA24> and
clicking on the little "plus" icon next to the segment you need a terser
path for.
James
On Tue, Aug 3, 2010 at 4:51 AM, depeche007 <[email protected]>wrote:
>
> Hi,
> I am using HAPI to parse a Link Patient Information (Event A24) message.
> In order to set PID 3.1 and PID 3.4 of Patient (1) Identification as
> well as to set PID 3.1 and PID 3.4 of Patient (2) Identification, what
> shall
> I use?
>
> MSH|^~\&|AAA|BBB|CCC|DDD|20100617093730||ADT^A24|MSG00001|P|2.3.1||||||
> EVN||20100617095832
> PID|22222222||PATIENT-ID123||SURNAME^FIRSTNAME
> PID|11111111||PATIENT-ID999||SURNAME^FIRSTNAME
>
> Following is the piece of code:
> Parser p = new GenericParser();
> Message hapiMsg = p.parse(msg); //ADT_A24 hapiMsg =
> (ADT_A24)p.parse(msg);
> Terser terser = new Terser(hapiMsg);
>
> I tried using:
> terser.get("/PATIENT(0)/PID-3-1")
> terser.get("/PATIENT(1)/PID-3-1")
>
> I got the following exception:
> Exception : ca.uhn.hl7v2.HL7Exception: Can't find PATIENT as a direct child
>
> Thanks & regards,
> depeche
>
>
> christian ohr wrote:
> >
> > Hi
> >
> > try
> >
> > String value = terser.get("/PATIENT(0)/PID-1") // 22222222
> > value = terser.get("/PATIENT(0)/MRG-1") // 11111111
> >
> > cheers
> > Christian
> >
> >
> > Éamonn Ó Nualláin wrote:
> >>
> >> Hi,
> >>
> >> I'm using HAPI1-0 and am trying to parse a 'merge patient' message. How
> >> can
> >> I get the PID and MGR from the following?
> >>
> >>
> MSH|^~\&|AAA|BBB|CCC|DDD|20100617093730||ADT^A40|MSG00001|P|2.4||||||UNICODE
> >> UTF-8
> >> EVN||20100617095832
> >> PID|22222222||PATIENT-ID123||SURNAME^FIRSTNAME
> >> MRG|11111111
> >>
> >> I've been trying the following to get at the PID (22222222 in this case)
> >> no
> >> avail,
> >> I'm also stuch with the MRG field (get at 11111111)
> >>
> >> Parser parser = new GenericParser();
> >> Message message = parser.parse(<above HL7 block>);
> >> Terser terser = new Terser(message);
> >> String value = terser.get("ADT_A40.PATIENT_ID");
> >> Any tip appreciated!
> >>
> >> Thanks
> >>
> >>
> ------------------------------------------------------------------------------
> >> ThinkGeek and WIRED's GeekDad team up for the Ultimate
> >> GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
> >> lucky parental unit. See the prize list and enter to win:
> >> http://p.sf.net/sfu/thinkgeek-promo
> >> _______________________________________________
> >> Hl7api-devel mailing list
> >> [email protected]
> >> https://lists.sourceforge.net/lists/listinfo/hl7api-devel
> >>
> >>
> >
> >
>
> --
> View this message in context:
> http://old.nabble.com/HL7-parsing-question-tp28914338p29333196.html
> Sent from the hl7api-devel mailing list archive at Nabble.com.
>
>
>
> ------------------------------------------------------------------------------
> The Palm PDK Hot Apps Program offers developers who use the
> Plug-In Development Kit to bring their C/C++ apps to Palm for a share
> of $1 Million in cash or HP Products. Visit us here for more details:
> http://p.sf.net/sfu/dev2dev-palm
> _______________________________________________
> Hl7api-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/hl7api-devel
>
------------------------------------------------------------------------------
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share
of $1 Million in cash or HP Products. Visit us here for more details:
http://p.sf.net/sfu/dev2dev-palm
_______________________________________________
Hl7api-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/hl7api-devel