0

I am trying to get the value in ORC-21:

//--------------    
ORC orcObj = messageObj.getCOMMON_ORDER().getORC();

String result = orcObj.getOrc21_OrderingFacilityName(0).getOrganizationName().getValue();

//-------------- 

But it turns out that I have to put the ORC field between PID and FT1, as a "global ORC". Otherwise, the return is null.

Does anyone know how to fix this? I use PipeParser()

DT7
  • 1,615
  • 14
  • 26

1 Answers1

0

HL7 standard is mainly based on the correct order of segments in a message and fields in a segment.

What type of message are You trying to parse? Chances are, that the HL7 standard specifies the message order and HAPI in its object model follows the standard precisely. Any non-standard segments or unexpected segments in wrong order are ingored by the parser.

If You are dealing with a 3rd party source of messages and You have no way of making the input messages standards compliant, then You might have to modify the existing HAPI message types to accept Your own order of segments. A simple example is available on HAPI website - have a look!. Based on this example I added custom Z-segment mappings in an application I developed recently. It might also help You!

Tarmo R
  • 1,123
  • 7
  • 15