/** * {@inheritDoc } */ public String encode() throws HL7Exception { return getParser().encode(this); }
/** * {@inheritDoc } */ public String encode() throws HL7Exception { return getParser().encode(this); }
/** * Returns the set of validation rules that applied to this message. If the parser * was set to "not-validating", this method returns null * * @return the set of validation rules that applied to this message */ public ValidationContext getValidationContext() { if (getParser() == null || !getParser().getParserConfiguration().isValidating()) return null; return getParser().getHapiContext().getValidationContext(); }
/** * Returns the set of validation rules that applied to this message. If the parser * was set to "not-validating", this method returns null * * @return the set of validation rules that applied to this message */ public ValidationContext getValidationContext() { if (getParser() == null || !getParser().getParserConfiguration().isValidating()) return null; return getParser().getHapiContext().getValidationContext(); }
/** * {@inheritDoc } */ public void parse(String string) throws HL7Exception { clear(); getParser().parse(this, string); }
/** * {@inheritDoc } */ public void parse(String string) throws HL7Exception { clear(); getParser().parse(this, string); }
/** * {@inheritDoc } */ public Message generateACK(AcknowledgmentCode theAcknowledgementCode, HL7Exception theException) throws HL7Exception, IOException { if (theException != null && theException.getResponseMessage() != null) { return theException.getResponseMessage(); } Message out = instantiateACK(); out.setParser(getParser()); fillResponseHeader(out, theAcknowledgementCode); if (theException != null) { theException.populateResponse(out, theAcknowledgementCode, 0); } return out; }
/** * {@inheritDoc } */ public Message generateACK(AcknowledgmentCode theAcknowledgementCode, HL7Exception theException) throws HL7Exception, IOException { if (theException != null && theException.getResponseMessage() != null) { return theException.getResponseMessage(); } Message out = instantiateACK(); out.setParser(getParser()); fillResponseHeader(out, theAcknowledgementCode); if (theException != null) { theException.populateResponse(out, theAcknowledgementCode, 0); } return out; }
private Message instantiateACK() throws HL7Exception { ModelClassFactory mcf = getParser() != null ? getParser().getFactory() : new DefaultModelClassFactory(); Version version = Version.versionOf(getVersion()); Message out = null; if (version != null && version.available()) { Class<? extends Message> clazz = mcf.getMessageClass("ACK", version.getVersion(), false); if (clazz != null) { out = ReflectionUtil.instantiateMessage(clazz, mcf); } } if (out == null) { out = new GenericMessage.UnknownVersion(mcf); } if (out instanceof GenericMessage) { if (!ArrayUtil.contains(out.getNames(), "MSA")) { out.addNonstandardSegment("MSA"); } if (!ArrayUtil.contains(out.getNames(), "ERR")) { out.addNonstandardSegment("ERR"); } } return out; }
private Message instantiateACK() throws HL7Exception { ModelClassFactory mcf = getParser() != null ? getParser().getFactory() : new DefaultModelClassFactory(); Version version = Version.versionOf(getVersion()); Message out = null; if (version != null && version.available()) { Class<? extends Message> clazz = mcf.getMessageClass("ACK", version.getVersion(), false); if (clazz != null) { out = ReflectionUtil.instantiateMessage(clazz, mcf); } } if (out == null) { out = new GenericMessage.UnknownVersion(mcf); } if (out instanceof GenericMessage) { if (!ArrayUtil.contains(out.getNames(), "MSA")) { out.addNonstandardSegment("MSA"); } if (!ArrayUtil.contains(out.getNames(), "ERR")) { out.addNonstandardSegment("ERR"); } } return out; }
Terser.set(msh, 9, 0, 1, 1, messageCode); Terser.set(msh, 9, 0, 2, 1, messageTriggerEvent); Terser.set(msh, 10, 0, 1, 1, getParser().getParserConfiguration().getIdGenerator().getID()); Terser.set(msh, 11, 0, 1, 1, processingId); Terser.set(msh, 12, 0, 1, 1, getVersion());
Terser.set(msh, 9, 0, 1, 1, messageCode); Terser.set(msh, 9, 0, 2, 1, messageTriggerEvent); Terser.set(msh, 10, 0, 1, 1, getParser().getParserConfiguration().getIdGenerator().getID()); Terser.set(msh, 11, 0, 1, 1, processingId); Terser.set(msh, 12, 0, 1, 1, getVersion());