/** * <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 * @param parserConfiguration configuration that influences setting OBX-5 * @throws HL7Exception if the operation fails * @deprecated use FixOBX5#fixOBX5 */ public static void fixOBX5(Segment segment, ModelClassFactory factory, ParserConfiguration parserConfiguration) throws HL7Exception { FixFieldDataType.fixOBX5(segment, factory, parserConfiguration); }
private static void setFirstComponentPrimitiveValue(Varies v, String theValue) throws DataTypeException { Composite c = (Composite) v.getData(); Type firstComponent = c.getComponent(0); setFirstComponentPrimitiveValue(firstComponent, theValue); }
escapeSubcomponentDelimInPrimitive(); Type[] subComponentsInFirstField = getFirstComponentSubcomponentsOnlyIfMoreThanOne(v); if (subComponentsInFirstField != null) { setFirstComponentPrimitiveValue(v, firstComponentValue.toString());
fix(segment, 2, 5, defaultOBX2Type, invalidOBX2Type, factory, parserConfiguration);
escapeSubcomponentDelimInPrimitive(); Type[] subComponentsInFirstField = getFirstComponentSubcomponentsOnlyIfMoreThanOne(v); if (subComponentsInFirstField != null) { setFirstComponentPrimitiveValue(v, firstComponentValue.toString());
public static void fixMFE4(Segment segment, ModelClassFactory factory, ParserConfiguration parserConfiguration) throws HL7Exception { if (!(segment.getName().contains("MFE")) && Version.versionOf(segment.getMessage().getVersion()).isGreaterThan(Version.V23)) { throw new IllegalArgumentException("Expected MFE segment, but was: " + segment.getName()); } fix(segment, 5, 4, null, null, factory, parserConfiguration); }
/** * <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 * @param parserConfiguration configuration that influences setting OBX-5 * @throws HL7Exception if the operation fails * @deprecated use FixOBX5#fixOBX5 */ public static void fixOBX5(Segment segment, ModelClassFactory factory, ParserConfiguration parserConfiguration) throws HL7Exception { FixFieldDataType.fixOBX5(segment, factory, parserConfiguration); }
private static void setFirstComponentPrimitiveValue(Varies v, String theValue) throws DataTypeException { Composite c = (Composite) v.getData(); Type firstComponent = c.getComponent(0); setFirstComponentPrimitiveValue(firstComponent, theValue); }
public static void fixMFE4(Segment segment, ModelClassFactory factory, ParserConfiguration parserConfiguration) throws HL7Exception { if (!(segment.getName().contains("MFE")) && Version.versionOf(segment.getMessage().getVersion()).isGreaterThan(Version.V23)) { throw new IllegalArgumentException("Expected MFE segment, but was: " + segment.getName()); } fix(segment, 5, 4, null, null, factory, parserConfiguration); }
/** * <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()); }
private static void setFirstComponentPrimitiveValue(Type theFirstComponent, String theValue) throws DataTypeException { if (theFirstComponent instanceof Varies) { Varies firstComponentVaries = (Varies)theFirstComponent; if (((Varies) theFirstComponent).getData() instanceof Composite) { Type[] subComponents = ((Composite)firstComponentVaries.getData()).getComponents(); setFirstComponentPrimitiveValue(subComponents[0], theValue); for (int i = 1; i < subComponents.length; i++) { setFirstComponentPrimitiveValue(subComponents[i], ""); } } else { Primitive p = (Primitive) firstComponentVaries.getData(); p.setValue(theValue); } } else if (theFirstComponent instanceof Composite) { Type[] subComponents = ((Composite)theFirstComponent).getComponents(); setFirstComponentPrimitiveValue(subComponents[0], theValue); for (int i = 1; i < subComponents.length; i++) { setFirstComponentPrimitiveValue(subComponents[i], ""); } } else { ((Primitive)theFirstComponent).setValue(theValue); } }
fix(segment, 2, 5, defaultOBX2Type, invalidOBX2Type, factory, parserConfiguration);
/** * <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()); }
private static void setFirstComponentPrimitiveValue(Type theFirstComponent, String theValue) throws DataTypeException { if (theFirstComponent instanceof Varies) { Varies firstComponentVaries = (Varies)theFirstComponent; if (((Varies) theFirstComponent).getData() instanceof Composite) { Type[] subComponents = ((Composite)firstComponentVaries.getData()).getComponents(); setFirstComponentPrimitiveValue(subComponents[0], theValue); for (int i = 1; i < subComponents.length; i++) { setFirstComponentPrimitiveValue(subComponents[i], ""); } } else { Primitive p = (Primitive) firstComponentVaries.getData(); p.setValue(theValue); } } else if (theFirstComponent instanceof Composite) { Type[] subComponents = ((Composite)theFirstComponent).getComponents(); setFirstComponentPrimitiveValue(subComponents[0], theValue); for (int i = 1; i < subComponents.length; i++) { setFirstComponentPrimitiveValue(subComponents[i], ""); } } else { ((Primitive)theFirstComponent).setValue(theValue); } }
FixFieldDataType.fixOBX5(destination, getFactory(), getHapiContext().getParserConfiguration());
FixFieldDataType.fixOBX5(destination, getFactory(), getHapiContext().getParserConfiguration());