Hi Mike,

You're pretty close actually. To get the NTE object, you actually need to
retrieve it by climbing through the ORU_R01 structure, by calling it's
getRESPONSE() message, and going down the various levels of the structure
until you reach the NTE segment. You can call
System.out.println(hapiMsg.printStructure()); to find out where the NTE
segment is within the structure.

Good luck!

Cheers,
James


On Mon, Sep 19, 2011 at 3:07 PM, Gopi Krishna Meka <[email protected]> wrote:

> static int getNTEReps(String hl7Message)throws Exception{
>
>          Message hapiMsg = null;
>          Parser p = new GenericParser();
>          p.setValidationContext(null);
>          try {
>              hapiMsg = p.parse(hl7Message);
>              } catch (Exception e) {
>                  e.printStackTrace();
>              }
>              Terser terser = new Terser(hapiMsg);
>              try {
>                  ORU_R01 getNte = (ORU_R01)hapiMsg;
>
>                  NTE nte = new NTE(getNte, null);
>                  int reps=nte.getNte3_CommentReps();
>
>                  String comment = nte.getNte3_Comment(0).getValue();
>
>              } catch (Exception e) {
>                  Logger.fatal(e);
>              }
>              return reps;
>         }
>
> *HL7 Message:*
> MSH|^~\&|SITE|212121|MYSITE|29992|20110916104341.796||ORU^R01|51582|T|2.3|1|||
> PID|1|PID3|T837719||CELTEST^ALPHA||19820601000000.000|M||||||||||PID3
> ORC|RE|BH006116A|B11003150||CM||||20110914080000.000|||1234567893^COLMENAR^ANTONIO^^^^^^^^^^NPI
> OBR|1|BH006116A|B11003150|64^LPA
> WB^BHL||20110914080000.000|20110914080000.000|20110914080000.000||||||20110915090000.000||1234567893^COLMENAR^ANTONIO^^^^^^^^^^NPI||||||20110915074501.004|||F
> OBX|1|ST|67^LPA-Aspirin
> Genotype^BHL^X-64-67^LPA^LN|1|ile/ile|Genotype|Note||||F|||20110914080000.000|||||20110915074236.048
> NTE|1|L|This patient is homozygous for 4399Ile in the LPA NTE|2|L|gene and
> does not carry the 4399Met polymorphism. The NTE|3|L|4399Ile/Ile genotype is
> observed in approximately 96% of NTE|4|L|the BHL patient population.  The
> LPA gene encodes NTE|5|L|apolipoprotein(a), a component of plasma
> lipoprotein Lp(a). NTE|6|L| The 4399Met polymorphism (rs3798220) [Human
> Genome NTE|7|L| Variation Society nucleotide position NTE|8|L|
> NM_005577.2:c.5673A>G] has been associated with elevated
> NTE|9|L| Lp(a) levels and cardiovascular disease (CVD). Position
> NTE|10|L| 4399 of the LPA gene is also referred to as
> NTE|11|L| position 1891 in public genome databases. In the
> Women\xE2\x80\x99s
> NTE|12|L| Health Study, the CVD risk associated with the 4399Met
> NTE|13|L| polymorphism was ameliorated by low-dose aspirin therapy.
> NTE|14|L| Of note, the CVD risk associated with the 4399Met
> NTE|15|L| polymorphism and the amelioration by aspirin therapy has
> NTE|16|L| thus far only been observed in a Caucasian population.
> NTE|17|L|
> NTE|18|L|Non genetic factors contribute to coronary heart disease
> NTE|19|L|(CHD), cardiovascular disease (CVD), or myocardial
> NTE|20|L|infraction (MI) risk. Examples of such factors include
> NTE|21|L|smoking, hypertension, age, diabetes, elevated blood lipid
> NTE|22|L|levels, obesity and sedentary lifestyle.
> NTE|23|L|
> NTE|24|L|Other genetic factors (e.g. family history of heart
> NTE|25|L|disease) may contribute to CHD, CVD, or MI
>
>
> On Mon, Sep 19, 2011 at 11:52 AM, James Agnew <[email protected]> wrote:
>
>> Hi Mike,
>>
>> (Mike, sorry, I'm reposting this a second time because I forgot to cc the
>> list itself. Please reply to this message)
>>
>>
>> Would you be able to post a complete code sample illustrating what is not
>> working? It sounds like you're doing the right thing.
>>
>> Cheers,
>> James
>>
>> On Mon, Sep 19, 2011 at 1:16 PM, Gopi Krishna Meka <[email protected]>wrote:
>>
>>> Hi all,
>>>
>>> My Name is mike. I am totally new to HL7 standards.
>>> I am using this methods to get repetitions of comment in NTE-03. Even
>>> there is multiple NTE's it return 0.
>>>
>>> My requirement is to get the NTE repetetions and check each for if any
>>> blank comments(if NTE_03 is blank) add a string "Intentionally Left Blank".
>>> can some Help me with this. I'm using ORM_R01 2.3 version.
>>> Any suggestions is greatly appreciated
>>>
>>>
>>> -- Thanks,
>>> Mike
>>>
>>>
>>>
>>>
>>>
>>> ------------------------------------------------------------------------------
>>> BlackBerry&reg; DevCon Americas, Oct. 18-20, San Francisco, CA
>>> Learn about the latest advances in developing for the
>>> BlackBerry&reg; mobile platform with sessions, labs & more.
>>> See new tools and technologies. Register for BlackBerry&reg; DevCon
>>> today!
>>> http://p.sf.net/sfu/rim-devcon-copy1
>>> _______________________________________________
>>> Hl7api-devel mailing list
>>> [email protected]
>>> https://lists.sourceforge.net/lists/listinfo/hl7api-devel
>>>
>>>
>>
>
>
> --
>
>
> Regards,
> Gopi Krishna Meka,
> +(484)-238-4139
>
>
>
------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2dcopy1
_______________________________________________
Hl7api-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/hl7api-devel

Reply via email to