Just note with regards to Terser and method based call -
When you know the location upfront and it is going to stay that way ..then use
the object.getXXX() semantics.
When the path for the location of data value is dynamic..Terser is your tool.
It is powerful.
So choose your tool.
Thanks for your interest in HAPI.
Thanks.
Regards
-Niranjan.
From: Éamonn Ó Nualláin [mailto:[email protected]]
Sent: Thursday, June 17, 2010 9:59 AM
To: christian ohr
Cc: [email protected]
Subject: Re: [HAPI-devel] HL7 parsing question
Thanks for that, it works (though PID-3 instead of PID-1) I'll use the terser
version,
On Thu, Jun 17, 2010 at 4:38 PM, christian ohr <[email protected]> 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-tp28914338p28916036.html
Sent from the hl7api-devel mailing list archive at Nabble.com.
------------------------------------------------------------------------------
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
------------------------------------------------------------------------------
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