Hi Paolo,

Looks like you've found a bug in HAPI's structures.

You're right, according to HL7 2.5 the ORDER_DETAIL structure can start
with any one of a number of segments but should only have one of them. HAPI
shows them all as mandatory, which is why your code only works if the first
mandatory one is present (OBR).

I've filed a bug on this so we can fix it in a future release of HAPI:
https://sourceforge.net/tracker/?func=detail&aid=3553167&group_id=38899&atid=423835

In the meantime, your RXO and NTE segments aren't "lost", but HAPI has
parsed them into message structure because it think that they don't belong
in the order group. You can retrieve them by doing this:

NTE nte = (NTE)message.get("NTE");
RXO rxo = (RXO)message.get("RXO");

Hopefully this helps. I'd suggest putting a unit test on your code that
checks this behaviour, since it will change when the structure definition
is fixed in a future release of HAPI.

Cheers,
James

On Wed, Aug 1, 2012 at 7:10 AM, Paulo Ferreira <ferreira.rob...@gmail.com>wrote:

> Hi,
>
> Hi have this message:
>
> MSH|^~\&|SINUS|1030101^AMARES|PDS|PDS|20120712145441.837+0100||ORM^O01|MSG00001|P|2.5||||||UNICODE
> UTF-8
> PID|||193661868||ANTONIO^LOPES^GOMES||19421220|M|||Rua do Bom
> Jardim^^Porto^^4420-554^PT||+351965546354|||||3
>
> ORC|RE|0|75430^MED_MEDICACAO_CRONICA||||1^^^20070228^20120411||20120712145441.837+0100|39389^MELO^CLAUDIA^^^^MD|||||||1030101^AMARES
> RXO|5869^Fositen^INFARMED^597^Fosinopril^DCIPT||||20 mg|^1+0+0|||N
> NTE|1|P|C09AA09~FOSINOPRIL~WC|PI^Patient Instructions^^1^ATC_CODE
>
> I can't read the segment NTE, because HAPI don“t read it:
>
> [EMPTY LIST]
> ((ORM_O01) obj).getORDER(0).getORDER_DETAIL().getNTEAll();
>
> If I put a dummy OBR segment like this i get the NTE, but the problem is
> that the ORM^O01 message structure are invalid according with 2.5
> specification:
>
> MSH|^~\&|SINUS|1030101^AMARES|PDS|PDS|20120712145441.837+0100||ORM^O01|MSG00001|P|2.5||||||UNICODE
> UTF-8
> PID|||193661868||ANTONIO^LOPES^GOMES||19421220|M|||Rua do Bom
> Jardim^^Porto^^4420-554^PT||+351965546354|||||3
>
> ORC|RE|0|75430^MED_MEDICACAO_CRONICA||||1^^^20070228^20120411||20120712145441.837+0100|39389^MELO^CLAUDIA^^^^MD|||||||1030101^AMARES
> *OBR|5342342|||5869*
> RXO|5869^Fositen^INFARMED^597^Fosinopril^DCIPT||||20 mg|^1+0+0|||N
> NTE|1|P|C09AA09~FOSINOPRIL~WC|PI^Patient Instructions^^1^ATC_CODE
>
> Can you help me? Best regards,
> Paulo Ferreira.
>
> **
> **
> **
>
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and
> threat landscape has changed and how IT managers can respond. Discussions
> will include endpoint security, mobile security and the latest in malware
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> _______________________________________________
> Hl7api-devel mailing list
> Hl7api-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/hl7api-devel
>
>
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Hl7api-devel mailing list
Hl7api-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/hl7api-devel

Reply via email to