The Terser cannot be used to determine the number of repetitions of a message element. According to the spec, ORC and OBR may appear just once in each ORU_R01_ORDER_OBSERVATION group. So I guess you are referring to the number of ORU_R01_ORDER_OBSERVATION groups in the ORU message?
Maybe you can then use something like int count = oruMsg.getPATIENT_RESULT(0).getORDER_OBSERVATIONReps() This should also be stable across hl7 versions. cheers Christian Carlos Oliva-3 wrote: > > How can the Terser obtain the total number of ORC and OBR segments in an > ORU message? I know how to use the Terser to get values from elements, > components, and subcomponents of individual ORC and OBR segments by > appending the number of the segment to the name of the segment. > Nevertheless, before loopingover these segments, I imagine that I would > need to know how many of these segments are in the message. > > Moreover, if a message has several ORC segments, how can the Terser > traverse the ORC and its associated OBR segments? > > I need to use the Terser because my application receives messages in > several versions of HL7 and casting the messages to a higher version > often fails due to some data that fails to follow the standard. > > > > > > ------------------------------------------------------------------------------ > Monitor your physical, virtual and cloud infrastructure from a single > web console. Get in-depth insight into apps, servers, databases, vmware, > SAP, cloud infrastructure, etc. Download 30-day Free Trial. > Pricing starts from $795 for 25 servers or applications! > http://p.sf.net/sfu/zoho_dev2dev_nov > _______________________________________________ > Hl7api-devel mailing list > Hl7api-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/hl7api-devel > > -- View this message in context: http://old.nabble.com/Terser-to-get-data-from-several-ORC-and-OBR-segments-tp34723309p34731514.html Sent from the hl7api-devel mailing list archive at Nabble.com. ------------------------------------------------------------------------------ Keep yourself connected to Go Parallel: INSIGHTS What's next for parallel hardware, programming and related areas? Interviews and blogs by thought leaders keep you ahead of the curve. http://goparallel.sourceforge.net _______________________________________________ Hl7api-devel mailing list Hl7api-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/hl7api-devel