/** * {@inheritDoc} */ public boolean isEmpty() throws HL7Exception { for (String name : getNames()) { if (!get(name).isEmpty()) return false; } return true; }
/** * {@inheritDoc} */ public boolean isEmpty() throws HL7Exception { for (String name : getNames()) { if (!get(name).isEmpty()) return false; } return true; }
protected void visitNestedStructures(MessageVisitor visitor, Location location) throws HL7Exception { for (String name : getNames()) { Structure[] structures = getAll(name); for (int j=0; j < structures.length; j++) { int rep = isRepeating(name) ? j : -1; Location nextLocation = structures[j].provideLocation(location, -1, rep); if (!structures[j].accept(visitor, nextLocation)) break; } } }
protected void visitNestedStructures(MessageVisitor visitor, Location location) throws HL7Exception { for (String name : getNames()) { Structure[] structures = getAll(name); for (int j=0; j < structures.length; j++) { int rep = isRepeating(name) ? j : -1; Location nextLocation = structures[j].provideLocation(location, -1, rep); if (!structures[j].accept(visitor, nextLocation)) break; } } }
/** * Expands the group definition to include a segment that is not defined by HL7 to be part of * this group (eg an unregistered Z segment). The new segment is slotted at the end of the * group. Thenceforward if such a segment is encountered it will be parsed into this location. * If the segment name is unrecognized a GenericSegment is used. The segment is defined as * repeating and not required. */ public String addNonstandardSegment(String name) throws HL7Exception { String version = this.getMessage().getVersion(); if (version == null) throw new HL7Exception("Need message version to add segment by name; message.getVersion() returns null"); Class<? extends Segment> c = myFactory.getSegmentClass(name, version); if (c == null) c = GenericSegment.class; int index = this.getNames().length; tryToInstantiateStructure(c, name); // may throw exception String newName = insert(c, false, true, index, name); if (this.nonStandardNames == null) { this.nonStandardNames = new HashSet<String>(); } this.nonStandardNames.add(newName); return newName; }
/** * Expands the group definition to include a segment that is not defined by HL7 to be part of * this group (eg an unregistered Z segment). The new segment is slotted at the end of the * group. Thenceforward if such a segment is encountered it will be parsed into this location. * If the segment name is unrecognized a GenericSegment is used. The segment is defined as * repeating and not required. */ public String addNonstandardSegment(String name) throws HL7Exception { String version = this.getMessage().getVersion(); if (version == null) throw new HL7Exception("Need message version to add segment by name; message.getVersion() returns null"); Class<? extends Segment> c = myFactory.getSegmentClass(name, version); if (c == null) c = GenericSegment.class; int index = this.getNames().length; tryToInstantiateStructure(c, name); // may throw exception String newName = insert(c, false, true, index, name); if (this.nonStandardNames == null) { this.nonStandardNames = new HashSet<String>(); } this.nonStandardNames.add(newName); return newName; }
for (String nextName : getNames()) {
for (String nextName : getNames()) {