Structure subStructure = group.get( name ); parseStructure( values, message, terser, subStructure, structureNumber + "." + n );
/** * Returns the given rep of the structure at the current location. * If at root, always returns the root (the rep is ignored). */ public Structure getCurrentStructure(int rep) throws HL7Exception { if (this.currentChild != -1) { String childName = this.childNames[this.currentChild]; return this.currentGroup.get(childName, rep); } return this.currentGroup; }
/** * Drills down into the group at the given index within the current * group -- ie sets the location pointer to the first structure within the child * @param childNumber the index of the group child into which to drill * @param rep the group repetition into which to drill */ public void drillDown(int childNumber, int rep) throws HL7Exception { if (childNumber != -1) { Structure s = currentGroup.get(childNames[childNumber], rep); if (!(s instanceof Group)) { throw new HL7Exception("Can't drill into segment"); } Group group = (Group) s; //stack the current group and location GroupContext gc = new GroupContext(this.currentGroup, this.currentChild); this.ancestors.push(gc); this.currentGroup = group; } this.currentChild = 0; this.childNames = this.currentGroup.getNames(); }
Structure s = pos.parent.get(pos.index.name, pos.index.rep); matchExists = contains(s, name, firstDescendentsOnly, upToFirstRequired); for (int i = 0; i < siblings.length && !matchExists; i++) { if (after) { matchExists = contains(pos.parent.get(siblings[i]), name, firstDescendentsOnly, upToFirstRequired); if (upToFirstRequired && pos.parent.isRequired(siblings[i])) break;
if (parentRepeats && contains(parentPos.parent.get(parentPos.index.name, 0), direction, false, true)) { nextRep(parentPos); } else {
/** * Drills down into the group at the given index within the current * group -- ie sets the location pointer to the first structure within the child * @param childNumber the index of the group child into which to drill * @param rep the group repetition into which to drill */ public void drillDown(int childNumber, int rep) throws HL7Exception { if (childNumber != -1) { Structure s = currentGroup.get(childNames[childNumber], rep); if (!(s instanceof Group)) { throw new HL7Exception("Can't drill into segment"); } Group group = (Group) s; //stack the current group and location GroupContext gc = new GroupContext(this.currentGroup, this.currentChild); this.ancestors.push(gc); this.currentGroup = group; } this.currentChild = 0; this.childNames = this.currentGroup.getNames(); }
Structure s = pos.parent.get(pos.index.name, pos.index.rep); matchExists = contains(s, name, firstDescendentsOnly, upToFirstRequired); for (int i = 0; i < siblings.length && !matchExists; i++) { if (after) { matchExists = contains(pos.parent.get(siblings[i]), name, firstDescendentsOnly, upToFirstRequired); if (upToFirstRequired && pos.parent.isRequired(siblings[i])) break;
/** * Returns the given rep of the structure at the current location. * If at root, always returns the root (the rep is ignored). */ public Structure getCurrentStructure(int rep) throws HL7Exception { if (this.currentChild != -1) { String childName = this.childNames[this.currentChild]; return this.currentGroup.get(childName, rep); } return this.currentGroup; }
if (parentRepeats && contains(parentPos.parent.get(parentPos.index.name, 0), direction, false, true)) { nextRep(parentPos); } else {
for (int i = 0; i < names.length && !contains; i++) { try { contains = contains(g.get(names[i], 0), name, firstDescendentsOnly, upToFirstRequired); if (firstDescendentsOnly) break; if (upToFirstRequired && g.isRequired(names[i])) break;
parseRep(reps.get(i), groupObject.get(childIndexName, i)); parseRep(reps.get(0), groupObject.get(childIndexName, 0)); for (i = 1; i < reps.size(); i++) { newIndexName = childName+(i+1); Structure st = groupObject.get(newIndexName); parseRep(reps.get(i), st); newIndexName = groupObject.addNonstandardSegment(childName); for (int j = i; j < reps.size(); j++) { parseRep(reps.get(j), groupObject.get(newIndexName, j-i));
for (int i = 0; i < names.length && !contains; i++) { try { contains = contains(g.get(names[i], 0), name, firstDescendentsOnly, upToFirstRequired); if (firstDescendentsOnly) break; if (upToFirstRequired && g.isRequired(names[i])) break;
parseRep(reps.get(i), groupObject.get(childIndexName, i)); parseRep(reps.get(0), groupObject.get(childIndexName, 0)); for (i = 1; i < reps.size(); i++) { newIndexName = childName+(i+1); Structure st = groupObject.get(newIndexName); parseRep(reps.get(i), st); newIndexName = groupObject.addNonstandardSegment(childName); for (int j = i; j < reps.size(); j++) { parseRep(reps.get(j), groupObject.get(newIndexName, j-i));
Structure nextChild = group.get(nextName); StructureDefinition structureDefinition = createStructureDefinition(nextChild, thePreviousLeaf, theStructureName); structureDefinition.setNameAsItAppearsInParent(nextName);
private Structure navigateToStructure(List<Position> theDefinitionPath) throws Error { Structure currentStructure = null; for (Position next : theDefinitionPath) { if (currentStructure == null) { currentStructure = myMessage; } else { try { IStructureDefinition structureDefinition = next.getStructureDefinition(); Group currentStructureGroup = (Group) currentStructure; String nextStructureName = structureDefinition.getNameAsItAppearsInParent(); currentStructure = currentStructureGroup.get(nextStructureName, next.getRepNumber()); } catch (HL7Exception e) { throw new Error("Failed to retrieve structure: ", e); } } } return currentStructure; }
private Structure navigateToStructure(List<Position> theDefinitionPath) throws Error { Structure currentStructure = null; for (Position next : theDefinitionPath) { if (currentStructure == null) { currentStructure = myMessage; } else { try { IStructureDefinition structureDefinition = next.getStructureDefinition(); Group currentStructureGroup = (Group) currentStructure; String nextStructureName = structureDefinition.getNameAsItAppearsInParent(); currentStructure = currentStructureGroup.get(nextStructureName, next.getRepNumber()); } catch (HL7Exception e) { throw new Error("Failed to retrieve structure: ", e); } } } return currentStructure; }
this.currentStructure = next.parent.get(next.index.name, next.index.rep); } catch (HL7Exception e) { throw new NoSuchElementException("HL7Exception: " + e.getMessage());
this.currentStructure = next.parent.get(next.index.name, next.index.rep); } catch (HL7Exception e) { throw new NoSuchElementException("HL7Exception: " + e.getMessage());
start = this.currentGroup; } else { start = (this.currentGroup.get(this.childNames[this.currentChild]));
start = this.currentGroup; } else { start = (this.currentGroup.get(this.childNames[this.currentChild]));