I've run into a strange problem with an NTE segment in an HL7 message which I
think is malformed (but which I still have to be able to deal with). The
messages I'm receiving have an NTE segment after the PD1 segment, whereas I
think it should be after the MSH segment. HAPI chokes on it somewhat, in
that it knows it's there but doesn't deal with it right. In the code below,
nteRepCount is correctly set to 1, and ormMsg.getNTE(i) returns a non-null
NTE. But all the fields of the NTE are null. If I reformat the message so
that the NTE segment is where it should be, this gives me the data I'm
expecting.
int nteRepCount = ormMsg.getNTEReps();
for (int i = 0; i <= nteRepCount; i++) {
NTE nte = ormMsg.getNTE(i);
String value = nte.getComment(0).toString();
}
Now, I'm wondering how I can actually grab the real NTE segment even if it
is mislocated. Unfortunately I'm working with a big established hospital
system which isn't about to be changed merely because it's sending malformed
messages - it's something my code has to cope with. I was hoping I could use
the lower-level Terser to get the values but that still gives me a non-null
but empty NTE.
This is using HAPI 0.6 (I upgraded from 0.5.1).
--
View this message in context:
http://www.nabble.com/Problem-with-misplaced-NTE-segment-tp24808667p24808667.html
Sent from the hl7api-devel mailing list archive at Nabble.com.
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
Hl7api-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/hl7api-devel