/** * As findSegment(), but will only return a group. */ public Group findGroup(String namePattern, int rep) throws HL7Exception { Structure s; do { s = findStructure(namePattern, rep); } while (!Group.class.isAssignableFrom(s.getClass())); return (Group) s; }
/** * As findSegment(), but will only return a group. */ public Group findGroup(String namePattern, int rep) throws HL7Exception { Structure s; do { s = findStructure(namePattern, rep); } while (!Group.class.isAssignableFrom(s.getClass())); return (Group) s; }
/** * Returns the first segment with a name that matches the given pattern, in a depth-first search. * Repeated searches are initiated from the location just AFTER where the last segment was found. * Call reset() is this is not desired. Note: this means that the current location will not be found. * @param namePattern the name of the segment to find. The wildcard * means any number * of arbitrary characters; the wildcard ? one arbitrary character * (eg "P*" or "*ID" or "???" or "P??" would match on PID). * @param rep the repetition of the segment to return */ public Segment findSegment(String namePattern, int rep) throws HL7Exception { Structure s = null; do { s = findStructure(namePattern, rep); } while (!Segment.class.isAssignableFrom(s.getClass())); return (Segment) s; }
/** * Returns the first segment with a name that matches the given pattern, in a depth-first search. * Repeated searches are initiated from the location just AFTER where the last segment was found. * Call reset() is this is not desired. Note: this means that the current location will not be found. * @param namePattern the name of the segment to find. The wildcard * means any number * of arbitrary characters; the wildcard ? one arbitrary character * (eg "P*" or "*ID" or "???" or "P??" would match on PID). * @param rep the repetition of the segment to return */ public Segment findSegment(String namePattern, int rep) throws HL7Exception { Structure s = null; do { s = findStructure(namePattern, rep); } while (!Segment.class.isAssignableFrom(s.getClass())); return (Segment) s; }