
org.openehealth.ipf.modules.hl7.parser.DefaultEscaping Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ipf-modules-hl7 Show documentation
Show all versions of ipf-modules-hl7 Show documentation
HL7 extensions and HL7 DSL support
package org.openehealth.ipf.modules.hl7.parser;
import ca.uhn.hl7v2.parser.EncodingCharacters;
/**
* Fixes https://github.com/hapifhir/hapi-hl7v2/issues/7, which misses to properly encode segment
* terminator characters.
*
* @author Christian Ohr
*/
public class DefaultEscaping extends ca.uhn.hl7v2.parser.DefaultEscaping {
public static final DefaultEscaping INSTANCE = new DefaultEscaping();
@Override
public String escape(String text, EncodingCharacters encChars) {
var fixed = text.replace("\r", "\\X000d\\");
return super.escape(fixed, encChars);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy