/** * As getSegment() but will only return a group. */ public Group getGroup(String namePattern, int rep) throws HL7Exception { Structure s = getStructure(namePattern, rep); if (!Group.class.isAssignableFrom(s.getClass())) { throw new HL7Exception(s.getName() + " is not a group"); } return (Group) s; }
/** * As getSegment() but will only return a group. */ public Group getGroup(String namePattern, int rep) throws HL7Exception { Structure s = getStructure(namePattern, rep); if (!Group.class.isAssignableFrom(s.getClass())) { throw new HL7Exception(s.getName() + " is not a group"); } return (Group) s; }
/** * Returns the first segment with a name matching the given pattern that is a sibling of * the structure at the current location. Other parts of the message are * not searched (in contrast to findSegment). * As a special case, if the pointer is at the root, the children of the root * are searched. * @param namePattern the name of the segment to get. The wildcad * means any number * of arbitrary characters; the wildard ? 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 getSegment(String namePattern, int rep) throws HL7Exception { Structure s = getStructure(namePattern, rep); if (!Segment.class.isAssignableFrom(s.getClass())) { throw new HL7Exception(s.getName() + " is not a segment"); } return (Segment) s; }
/** * Returns the first segment with a name matching the given pattern that is a sibling of * the structure at the current location. Other parts of the message are * not searched (in contrast to findSegment). * As a special case, if the pointer is at the root, the children of the root * are searched. * @param namePattern the name of the segment to get. The wildcad * means any number * of arbitrary characters; the wildard ? 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 getSegment(String namePattern, int rep) throws HL7Exception { Structure s = getStructure(namePattern, rep); if (!Segment.class.isAssignableFrom(s.getClass())) { throw new HL7Exception(s.getName() + " is not a segment"); } return (Segment) s; }