/** * Returns given segment serialized as a pipe-encoded string. * * @param source segment to be encoded * @param encodingChars encoding characters to be used * @return encoded group */ public static String encode(Segment source, EncodingCharacters encodingChars) { return encode(source, encodingChars, source.getMessage().getParser().getParserConfiguration(), null); }
/** * Encodes the given Type, using the given encoding characters. It is * assumed that the Type represents a complete field rather than a * component. * * @param source type to be encoded * @param encodingChars encoding characters to be used * @return encoded type */ public static String encode(Type source, EncodingCharacters encodingChars) { return encode(source, encodingChars, source.getMessage().getParser().getParserConfiguration(), null); }
/** * Returns given group serialized as a pipe-encoded string - this method is * called by encode(Message source, String encoding). * * @param source group to be encoded * @param encodingChars encoding characters to be used * @throws HL7Exception if an error occurred while encoding * @return encoded group */ public static String encode(Group source, EncodingCharacters encodingChars) throws HL7Exception { return encode(source, encodingChars, source.getMessage().getParser().getParserConfiguration(), ""); }
/** * Returns given segment serialized as a pipe-encoded string. * * @param source segment to be encoded * @param encodingChars encoding characters to be used * @return encoded group */ public static String encode(Segment source, EncodingCharacters encodingChars) { return encode(source, encodingChars, source.getMessage().getParser().getParserConfiguration(), null); }
/** * Encodes the given Type, using the given encoding characters. It is * assumed that the Type represents a complete field rather than a * component. * * @param source type to be encoded * @param encodingChars encoding characters to be used * @return encoded type */ public static String encode(Type source, EncodingCharacters encodingChars) { return encode(source, encodingChars, source.getMessage().getParser().getParserConfiguration(), null); }
/** * Returns given group serialized as a pipe-encoded string - this method is * called by encode(Message source, String encoding). * * @param source group to be encoded * @param encodingChars encoding characters to be used * @throws HL7Exception if an error occurred while encoding * @return encoded group */ public static String encode(Group source, EncodingCharacters encodingChars) throws HL7Exception { return encode(source, encodingChars, source.getMessage().getParser().getParserConfiguration(), ""); }
/** * <p> * Sets the data type of field 5 in the given OBX segment to the value of OBX-2. The argument * is a Segment as opposed to a particular OBX because it is meant to work with any version. * </p> * <p> * Note that if no value is present in OBX-2, or an invalid value is present in * OBX-2, this method will throw an error. This behaviour can be corrected by using the * following system properties: {@link #DEFAULT_OBX2_TYPE_PROP} and {@link #INVALID_OBX2_TYPE_PROP}, * or by using configuration in {@link ParserConfiguration} * </p> * * @param segment OBX segment instance to be modified * @param factory ModelClassFactory to be used * @throws HL7Exception if the operation fails * @deprecated use FixOBX5#fixOBX5 */ public static void fixOBX5(Segment segment, ModelClassFactory factory) throws HL7Exception { FixFieldDataType.fixOBX5(segment, factory, segment.getMessage().getParser().getParserConfiguration()); }
/** * <p> * Sets the data type of field 5 in the given OBX segment to the value of OBX-2. The argument * is a Segment as opposed to a particular OBX because it is meant to work with any version. * </p> * <p> * Note that if no value is present in OBX-2, or an invalid value is present in * OBX-2, this method will throw an error. This behaviour can be corrected by using the * following system properties: {@link #DEFAULT_OBX2_TYPE_PROP} and {@link #INVALID_OBX2_TYPE_PROP}, * or by using configuration in {@link ParserConfiguration} * </p> * * @param segment OBX segment instance to be modified * @param factory ModelClassFactory to be used * @throws HL7Exception if the operation fails * @deprecated use FixOBX5#fixOBX5 */ public static void fixOBX5(Segment segment, ModelClassFactory factory) throws HL7Exception { FixFieldDataType.fixOBX5(segment, factory, segment.getMessage().getParser().getParserConfiguration()); }
if (!getParserConfiguration().isAllowUnknownVersions()) { assertVersionExists(version);
Group parentStructure; switch (myMessage.getParser().getParserConfiguration().getUnexpectedSegmentBehaviour()) { case ADD_INLINE: default:
if (!getParserConfiguration().isAllowUnknownVersions()) { assertVersionExists(version);
Group parentStructure; switch (myMessage.getParser().getParserConfiguration().getUnexpectedSegmentBehaviour()) { case ADD_INLINE: default:
/** * 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(); }
String escaped = getMessage().getParser().getParserConfiguration() .getEscaping().unescape(string, encodingCharacters); setValue(escaped);
String escaped = getMessage().getParser().getParserConfiguration() .getEscaping().unescape(string, encodingCharacters); setValue(escaped);
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());
@Override public void initialize(Arguments args) throws DirectiveParseException { this.column = ((ColumnName) args.value("column")).value(); if (args.contains("depth")) { this.depth = ((Numeric) args.value("depth")).value().intValue(); } else { this.depth = Integer.MAX_VALUE; } context = new DefaultHapiContext(); context.setValidationContext(new NoValidation()); ModelClassFactory modelClassFactory = new GenericModelClassFactory(); parser = new PipeParser(modelClassFactory); parser.getParserConfiguration().setAllowUnknownVersions(true); }
Terser.set(mshOut, 10, 0, 1, 1, mshIn.getMessage().getParser().getParserConfiguration().getIdGenerator().getID()); Terser.set(mshOut, 11, 0, 1, 1, procID);
Terser.set(mshOut, 10, 0, 1, 1, mshIn.getMessage().getParser().getParserConfiguration().getIdGenerator().getID()); Terser.set(mshOut, 11, 0, 1, 1, procID);