/** * <p> * Gets the string value of the field specified. See the class docs for syntax of the location * spec. * </p> * <p> * If a repetition is omitted for a repeating segment or field, the first rep is used. If the * component or subcomponent is not specified for a composite field, the first component is used * (this allows one to write code that will work with later versions of the HL7 standard). * * @param spec field specification * @return string value of the specified field * @throws HL7Exception if the primitive could not be obtained */ public String get(String spec) throws HL7Exception { StringTokenizer tok = new StringTokenizer(spec, "-", false); Segment segment = getSegment(tok.nextToken()); int[] ind = getIndices(spec); return get(segment, ind[0], ind[1], ind[2], ind[3]); }
/** * Sets the string value of the field specified. See class docs for location spec syntax. * * @param spec primitive path specification * @param value value to be set * @throws HL7Exception if the primitive does not exist */ public void set(String spec, String value) throws HL7Exception { StringTokenizer tok = new StringTokenizer(spec, "-", false); Segment segment = getSegment(tok.nextToken()); int[] ind = getIndices(spec); log.trace("Setting {} seg: {} ind: {} {} {} {}", new Object[] { spec, segment.getName(), ind[0], ind[1], ind[2], ind[3] }); set(segment, ind[0], ind[1], ind[2], ind[3], value); }
/** * Sets the string value of the field specified. See class docs for location spec syntax. * * @param spec primitive path specification * @param value value to be set * @throws HL7Exception if the primitive does not exist */ public void set(String spec, String value) throws HL7Exception { StringTokenizer tok = new StringTokenizer(spec, "-", false); Segment segment = getSegment(tok.nextToken()); int[] ind = getIndices(spec); log.trace("Setting {} seg: {} ind: {} {} {} {}", new Object[] { spec, segment.getName(), ind[0], ind[1], ind[2], ind[3] }); set(segment, ind[0], ind[1], ind[2], ind[3], value); }
/** * <p> * Gets the string value of the field specified. See the class docs for syntax of the location * spec. * </p> * <p> * If a repetition is omitted for a repeating segment or field, the first rep is used. If the * component or subcomponent is not specified for a composite field, the first component is used * (this allows one to write code that will work with later versions of the HL7 standard). * * @param spec field specification * @return string value of the specified field * @throws HL7Exception if the primitive could not be obtained */ public String get(String spec) throws HL7Exception { StringTokenizer tok = new StringTokenizer(spec, "-", false); Segment segment = getSegment(tok.nextToken()); int[] ind = getIndices(spec); return get(segment, ind[0], ind[1], ind[2], ind[3]); }
public Location getLocation(Message msg) throws HL7Exception { Terser t = new Terser(msg); StringTokenizer tok = new StringTokenizer(expression, "-", false); Segment segment = t.getSegment(tok.nextToken()); Location location = new Location() .withSegmentName(segment.getName()) .withFieldIndizes(Terser.getIndices(expression)); return location; }
public Location getLocation(Message msg) throws HL7Exception { Terser t = new Terser(msg); StringTokenizer tok = new StringTokenizer(expression, "-", false); Segment segment = t.getSegment(tok.nextToken()); Location location = new Location() .withSegmentName(segment.getName()) .withFieldIndizes(Terser.getIndices(expression)); return location; }
int[] indices = Terser.getIndices(thePathSpecs[i]); paths[i] = new DatumPath(); paths[i].add(segName).add(segRep);
int[] indices = Terser.getIndices(thePathSpecs[i]); paths[i] = new DatumPath(); paths[i].add(segName).add(segRep);