/** * Returns the version ID (MSH-12) from the given message, without fully parsing the message. * The version is needed prior to parsing in order to determine the message class into which the * text of the message should be parsed. * * @throws HL7Exception if the version field can not be found. */ public String getVersion(String message) throws HL7Exception { return getAppropriateParser(message).getVersion(message); }
/** * Parses a message string and returns the corresponding Message object. * * @throws HL7Exception if the message is not correctly formatted. * @throws EncodingNotSupportedException if the message encoded is not supported by this parser. */ protected Message doParse(String message, String version) throws HL7Exception { return getAppropriateParser(message).doParse(message, version); }
/** * Parses a message string and returns the corresponding Message object. * * @throws HL7Exception if the message is not correctly formatted. * @throws EncodingNotSupportedException if the message encoded is not supported by this parser. */ protected Message doParse(String message, String version) throws HL7Exception { return getAppropriateParser(message).doParse(message, version); }
/** * Returns the version ID (MSH-12) from the given message, without fully parsing the message. * The version is needed prior to parsing in order to determine the message class into which the * text of the message should be parsed. * * @throws HL7Exception if the version field can not be found. */ public String getVersion(String message) throws HL7Exception { return getAppropriateParser(message).getVersion(message); }
/** * For response messages, returns the value of MSA-2 (the message ID of the message sent by the * sending system). This value may be needed prior to main message parsing, so that * (particularly in a multi-threaded scenario) the message can be routed to the thread that sent * the request. We need this information first so that any parse exceptions are thrown to the * correct thread. Implementers of Parsers should take care to make the implementation of this * method very fast and robust. Returns null if MSA-2 can not be found (e.g. if the message is * not a response message). */ public String getAckID(String message) { try { return getAppropriateParser(message).getAckID(message); } catch (HL7Exception e) { return null; } }
/** * For response messages, returns the value of MSA-2 (the message ID of the message sent by the * sending system). This value may be needed prior to main message parsing, so that * (particularly in a multi-threaded scenario) the message can be routed to the thread that sent * the request. We need this information first so that any parse exceptions are thrown to the * correct thread. Implementers of Parsers should take care to make the implementation of this * method very fast and robust. Returns null if MSA-2 can not be found (e.g. if the message is * not a response message). */ public String getAckID(String message) { try { return getAppropriateParser(message).getAckID(message); } catch (HL7Exception e) { return null; } }
/** * <p> * Returns a minimal amount of data from a message string, including only the data needed to * send a response to the remote system. This includes the following fields: * <ul> * <li>field separator</li> * <li>encoding characters</li> * <li>processing ID</li> * <li>message control ID</li> * </ul> * This method is intended for use when there is an error parsing a message, (so the Message * object is unavailable) but an error message must be sent back to the remote system including * some of the information in the inbound message. This method parses only that required * information, hopefully avoiding the condition that caused the original error. * </p> */ public Segment getCriticalResponseData(String message) throws HL7Exception { return getAppropriateParser(message).getCriticalResponseData(message); }
/** * <p> * Returns a minimal amount of data from a message string, including only the data needed to * send a response to the remote system. This includes the following fields: * <ul> * <li>field separator</li> * <li>encoding characters</li> * <li>processing ID</li> * <li>message control ID</li> * </ul> * This method is intended for use when there is an error parsing a message, (so the Message * object is unavailable) but an error message must be sent back to the remote system including * some of the information in the inbound message. This method parses only that required * information, hopefully avoiding the condition that caused the original error. * </p> */ public Segment getCriticalResponseData(String message) throws HL7Exception { return getAppropriateParser(message).getCriticalResponseData(message); }
/** * {@inheritDoc} */ @Override public Message parse(String theMessage) throws HL7Exception { Message retVal = super.parse(theMessage); Parser parser = getAppropriateParser(theMessage); retVal.setParser(parser); return retVal; }
/** * {@inheritDoc} */ @Override public Message parse(String theMessage) throws HL7Exception { Message retVal = super.parse(theMessage); Parser parser = getAppropriateParser(theMessage); retVal.setParser(parser); return retVal; }