/** * Checks that the component at the given location exists, and that * all preceding components exist, creating any missing ones. */ private void ensureComponentAndPredecessorsExist(int comp) { for (int i = this.comps.size(); i <= comp; i++) { this.comps.add(new Varies(message)); } }
/** * Parses an XML element into a Varies by determining whether the element is primitive or * composite, calling setData() on the Varies with a new generic primitive or composite as * appropriate, and then calling parse again with the new Type object. */ private void parseVaries(Varies datatypeObject, Element datatypeElement) throws HL7Exception { // figure out what data type it holds // short nodeType = datatypeElement.getFirstChild().getNodeType(); if (!hasChildElement(datatypeElement)) { // it's a primitive datatypeObject.setData(new GenericPrimitive(datatypeObject.getMessage())); } else { // it's a composite ... almost know what type, except that we don't have the version // here datatypeObject.setData(new GenericComposite(datatypeObject.getMessage())); } parse(datatypeObject.getData(), datatypeElement); }
/** * Encodes a Varies type by extracting it's data field and encoding that. Returns true if the * data field (or one of its components) contains a value. */ private boolean encodeVaries(Varies datatypeObject, Element datatypeElement) throws DataTypeException { boolean hasData = false; if (datatypeObject.getData() != null) { hasData = encode(datatypeObject.getData(), datatypeElement); } return hasData; }
final Varies varies = (Varies) type; final GenericComposite comp2 = new GenericComposite(type.getMessage()); varies.setData(comp2); comp = getComponent(type, component); } catch (final DataTypeException de) {
/** * {@inheritDoc } */ public String encode() throws HL7Exception { return getMessage().getParser().doEncode(this, EncodingCharacters.getInstance(getMessage())); }
/** * Encodes a Varies type by extracting it's data field and encoding that. Returns true if the * data field (or one of its components) contains a value. */ private boolean encodeVaries(Varies datatypeObject, Element datatypeElement) throws DataTypeException { boolean hasData = false; if (datatypeObject.getData() != null) { hasData = encode(datatypeObject.getData(), datatypeElement); } return hasData; }
final Varies varies = (Varies) type; final GenericComposite comp2 = new GenericComposite(type.getMessage()); varies.setData(comp2); comp = getComponent(type, component); } catch (final DataTypeException de) {
/** * {@inheritDoc } */ public String encode() throws HL7Exception { return getMessage().getParser().doEncode(this, EncodingCharacters.getInstance(getMessage())); }
/** * Checks that the component at the given location exists, and that * all preceding components exist, creating any missing ones. */ private void ensureComponentAndPredecessorsExist(int comp) { for (int i = this.comps.size(); i <= comp; i++) { this.comps.add(new Varies(message)); } }
/** * Parses an XML element into a Varies by determining whether the element is primitive or * composite, calling setData() on the Varies with a new generic primitive or composite as * appropriate, and then calling parse again with the new Type object. */ private void parseVaries(Varies datatypeObject, Element datatypeElement) throws HL7Exception { // figure out what data type it holds // short nodeType = datatypeElement.getFirstChild().getNodeType(); if (!hasChildElement(datatypeElement)) { // it's a primitive datatypeObject.setData(new GenericPrimitive(datatypeObject.getMessage())); } else { // it's a composite ... almost know what type, except that we don't have the version // here datatypeObject.setData(new GenericComposite(datatypeObject.getMessage())); } parse(datatypeObject.getData(), datatypeElement); }
/** * Returns an array containing the subcomponents within the first component of this Varies * object only if there are more than one of them. Otherwise, returns null. */ private static Type[] getFirstComponentSubcomponentsOnlyIfMoreThanOne(Varies v) throws DataTypeException { if (v.getData() instanceof Composite) { Composite c = (Composite) v.getData(); Type firstComponent = c.getComponent(0); if (firstComponent instanceof Varies) { Varies firstComponentVaries = (Varies) firstComponent; if (firstComponentVaries.getData() instanceof Composite) { return ((Composite)firstComponentVaries.getData()).getComponents(); } } } return null; } }
obx.getObservationValue(0).setData(encapsuledData);
/** * {@inheritDoc } */ public void parse(String string) throws HL7Exception { if (data != null) { data.clear(); } getMessage().getParser().parse(this, string, EncodingCharacters.getInstance(getMessage())); }
/** * Returns the single component of this composite at the specified position (starting at 0) - * Creates it (and any nonexistent components before it) if necessary. */ public Type getComponent(int number) throws DataTypeException { for (int i = components.size(); i <= number; i++) { components.add(new Varies(message)); } return components.get(number); }
Varies v = (Varies) type; try { if (comp > 1 && GenericPrimitive.class.isAssignableFrom(v.getData().getClass())) v.setData(new GenericComposite(v.getMessage())); } catch (DataTypeException e) { throw new RuntimeException("Unexpected exception copying data to generic composite: " + e.getMessage(), return getComponent(v.getData(), comp);
/** * Returns an array containing the subcomponents within the first component of this Varies * object only if there are more than one of them. Otherwise, returns null. */ private static Type[] getFirstComponentSubcomponentsOnlyIfMoreThanOne(Varies v) throws DataTypeException { if (v.getData() instanceof Composite) { Composite c = (Composite) v.getData(); Type firstComponent = c.getComponent(0); if (firstComponent instanceof Varies) { Varies firstComponentVaries = (Varies) firstComponent; if (firstComponentVaries.getData() instanceof Composite) { return ((Composite)firstComponentVaries.getData()).getComponents(); } } } return null; } }
ce.getNameOfCodingSystem().setValue("SNM"); Varies value = obx.getObservationValue(0); value.setData(ce); ST extraSubcomponent = new ST(message); extraSubcomponent.setValue("MDT"); observationIdentifier.getExtraComponents().getComponent(0).setData(extraSubcomponent ); tx.setValue("MICROSCOPIC EXAM SHOWS HISTOLOGICALLY NORMAL GALLBLADDER TISSUE"); value = obx.getObservationValue(0); value.setData(tx);
/** * {@inheritDoc } */ public void parse(String string) throws HL7Exception { if (data != null) { data.clear(); } getMessage().getParser().parse(this, string, EncodingCharacters.getInstance(getMessage())); }
/** * Returns the single component of this composite at the specified position (starting at 0) - * Creates it (and any nonexistent components before it) if necessary. */ public Type getComponent(int number) throws DataTypeException { for (int i = components.size(); i <= number; i++) { components.add(new Varies(message)); } return components.get(number); }