use of ca.uhn.hl7v2.util.SegmentFinder in project pentaho-kettle by pentaho.
the class HL7KettleParser method extractValues.
public static List<HL7Value> extractValues(Message message) throws Exception {
Terser terser = new Terser(message);
SegmentFinder finder = terser.getFinder();
List<HL7Value> values = new ArrayList<HL7Value>();
int childNr = 1;
while (finder.hasNextChild()) {
// next group in the message (MSH, PID, EVN and so on)
//
finder.nextChild();
Structure[] structures = finder.getCurrentChildReps();
for (int i = 0; i < structures.length; i++) {
Structure structure = structures[i];
parseStructure(values, message, terser, structure, Integer.toString(childNr));
}
childNr++;
}
return values;
}
Aggregations