I have an application that is focused on processing messages segment by
segment, it  is largely agnostic to the type of message. For example if we
get a message with an IN1 segment, the application will capture insurance
data.



I am trying to do this with:

protected int getSegmentCount(String segment) {

        try {

            return getMessage().getAll(segment).length;

        } catch (HL7Exception e) {

            log.warning("Found no segments for:" + segment, e);

            return 0;

        }

    }



However if I send an ADT_A08 message I get:

ca.uhn.hl7v2.HL7Exception: The structure IN1 does not exist in the group
ca.uhn.hl7v2.model.v25.message.ADT_A01

                at
ca.uhn.hl7v2.model.AbstractGroup.getAll(AbstractGroup.java:335)



This is odd for two reasons, it’s not an ADT_A01 and despite its message
type this particular sample has two IN1 segments.



Is there a better way to count the number of segments in a message?
------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2 & L3.
Spend less time writing and  rewriting code and more time creating great
experiences on the web. Be a part of the beta today.
http://p.sf.net/sfu/beautyoftheweb
_______________________________________________
Hl7api-devel mailing list
Hl7api-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/hl7api-devel

Reply via email to