String wholeFieldNine; try { String[] fields = split(message.substring(0, Math.max(message.indexOf(SEGMENT_DELIMITER), message.length())), String.valueOf(ec.getFieldSeparator())); wholeFieldNine = fields[8]; String[] comps = split(wholeFieldNine, String.valueOf(ec.getComponentSeparator())); if (comps.length >= 3) { messageStructure = comps[2];
String wholeFieldNine; try { String[] fields = split(message.substring(0, Math.max(message.indexOf(SEGMENT_DELIMITER), message.length())), String.valueOf(ec.getFieldSeparator())); wholeFieldNine = fields[8]; String[] comps = split(wholeFieldNine, String.valueOf(ec.getComponentSeparator())); if (comps.length >= 3) { messageStructure = comps[2];
/** * Fills a field with values from an unparsed string representing the field. * * @param destinationField * the field Type * @param data * the field string (including all components and subcomponents; * not including field delimiters) * @param encodingCharacters * the encoding characters used in the message */ @Override public void parse(Type destinationField, String data, EncodingCharacters encodingCharacters) throws HL7Exception { String[] components = split(data, String.valueOf(encodingCharacters.getComponentSeparator())); for (int i = 0; i < components.length; i++) { String[] subcomponents = split(components[i], String.valueOf(encodingCharacters.getSubcomponentSeparator())); for (int j = 0; j < subcomponents.length; j++) { String val = subcomponents[j]; if (val != null) { val = getParserConfiguration().getEscaping().unescape(val, encodingCharacters); } Terser.getPrimitive(destinationField, i + 1, j + 1).setValue(val); } } }
/** * Fills a field with values from an unparsed string representing the field. * * @param destinationField * the field Type * @param data * the field string (including all components and subcomponents; * not including field delimiters) * @param encodingCharacters * the encoding characters used in the message */ @Override public void parse(Type destinationField, String data, EncodingCharacters encodingCharacters) throws HL7Exception { String[] components = split(data, String.valueOf(encodingCharacters.getComponentSeparator())); for (int i = 0; i < components.length; i++) { String[] subcomponents = split(components[i], String.valueOf(encodingCharacters.getSubcomponentSeparator())); for (int j = 0; j < subcomponents.length; j++) { String val = subcomponents[j]; if (val != null) { val = getParserConfiguration().getEscaping().unescape(val, encodingCharacters); } Terser.getPrimitive(destinationField, i + 1, j + 1).setValue(val); } } }
MessageIterator messageIter = new MessageIterator(message, structureDef, "MSH", true); String[] segments = split(string, SEGMENT_DELIMITER);
MessageIterator messageIter = new MessageIterator(message, structureDef, "MSH", true); String[] segments = split(string, SEGMENT_DELIMITER);