Parser.assertVersionExists(version);
Parser.assertVersionExists(version);
/** * Given a concatenation of message type and event (e.g. ADT_A04), and the version, finds the * corresponding message structure (e.g. ADT_A01). This is needed because some events share * message structures, although it is not needed when the message structure is explicitly valued * in MSH-9-3. If no mapping is found, returns the original name. * * @throws HL7Exception if there is an error retrieving the map, or if the given version is * invalid * * @deprecated use {@link ModelClassFactory#getMessageStructureForEvent(String, Version)} */ public String getMessageStructureForEvent(String name, String version) throws HL7Exception { assertVersionExists(version); return getHapiContext().getModelClassFactory(). getMessageStructureForEvent(name, Version.versionOf(version)); }
/** * Given a concatenation of message type and event (e.g. ADT_A04), and the version, finds the * corresponding message structure (e.g. ADT_A01). This is needed because some events share * message structures, although it is not needed when the message structure is explicitly valued * in MSH-9-3. If no mapping is found, returns the original name. * * @throws HL7Exception if there is an error retrieving the map, or if the given version is * invalid * * @deprecated use {@link ModelClassFactory#getMessageStructureForEvent(String, Version)} */ public String getMessageStructureForEvent(String name, String version) throws HL7Exception { assertVersionExists(version); return getHapiContext().getModelClassFactory(). getMessageStructureForEvent(name, Version.versionOf(version)); }
/** * Parse a message using a specific model package instead of the default, using * {@link ModelClassFactory#getMessageClassInASpecificPackage(String, String, boolean, String)} * . * * <b>WARNING: This method is only implemented in some parser implementations</b>. Currently it * will only work with the PipeParser parser implementation. Use with caution. * * @param message message string * @param packageName name of the package of the models * @return parsed message * @throws HL7Exception if an error occurred while parsing */ public Message parseForSpecificPackage(String message, String packageName) throws HL7Exception { String encoding = getEncoding(message); if (!supportsEncoding(encoding)) { throw new EncodingNotSupportedException("Can't parse message beginning " + message.substring(0, Math.min(message.length(), 50))); } String version = getVersion(message); assertVersionExists(version); assertMessageValidates(message, encoding, version); Message result = doParseForSpecificPackage(message, version, packageName); assertMessageValidates(result); result.setParser(this); return result; }
/** * Parse a message using a specific model package instead of the default, using * {@link ModelClassFactory#getMessageClassInASpecificPackage(String, String, boolean, String)} * . * * <b>WARNING: This method is only implemented in some parser implementations</b>. Currently it * will only work with the PipeParser parser implementation. Use with caution. * * @param message message string * @param packageName name of the package of the models * @return parsed message * @throws HL7Exception if an error occurred while parsing */ public Message parseForSpecificPackage(String message, String packageName) throws HL7Exception { String encoding = getEncoding(message); if (!supportsEncoding(encoding)) { throw new EncodingNotSupportedException("Can't parse message beginning " + message.substring(0, Math.min(message.length(), 50))); } String version = getVersion(message); assertVersionExists(version); assertMessageValidates(message, encoding, version); Message result = doParseForSpecificPackage(message, version, packageName); assertMessageValidates(result); result.setParser(this); return result; }