private static void addSegments(final Group group, final Map<String, Segment> segments, final Map<String, Integer> segmentIndexes) throws HL7Exception { if (!isEmpty(group)) { for (final String name : group.getNames()) { for (final Structure structure : group.getAll(name)) { if (group.isGroup(name) && structure instanceof Group) { addSegments((Group) structure, segments, segmentIndexes); } else if (structure instanceof Segment) { addSegments((Segment) structure, segments, segmentIndexes); } } segmentIndexes.put(name, segmentIndexes.getOrDefault(name, 1) + 1); } } }
private void populateSegments(final Group group, final List<HL7Segment> segments) throws HL7Exception { for (final String structureName : group.getNames()) { final Structure[] structures = group.getAll(structureName); if (group.isGroup(structureName)) { for (final Structure structure : structures) { populateSegments((Group) structure, segments); } } else { for (final Structure structure : structures) { final Segment segment = (Segment) structure; final HapiSegment hapiSegment = new HapiSegment(segment); segments.add(hapiSegment); } } } }
public boolean isGroup(String name) throws HL7Exception { return getDelegate().isGroup(name); }
public boolean isGroup(String name) throws HL7Exception { return getDelegate().isGroup(name); }
if(groupObject.isGroup(nextChildName)) { childName = makeGroupElementName(groupObject.getMessage().getName(), nextChildName);
if(groupObject.isGroup(nextChildName)) { childName = makeGroupElementName(groupObject.getMessage().getName(), nextChildName);
haveEncounteredMandatorySegment |= nextNameIsRequired; if (nextNameIsRequired && !haveHadMandatorySegment) { if (!source.isGroup(nextName)) { firstMandatorySegmentName = nextName;
haveEncounteredMandatorySegment |= nextNameIsRequired; if (nextNameIsRequired && !haveHadMandatorySegment) { if (!source.isGroup(nextName)) { firstMandatorySegmentName = nextName;