public final class Hl7Util extends Object
Modifier and Type | Field and Description |
---|---|
static Map<Character,String> |
CHARACTER_REPLACEMENTS |
static String |
EMPTY_REPLACEMENT_VALUE |
static String |
NULL_REPLACEMENT_VALUE |
static SimpleDateFormat |
TIMESTAMP_FORMAT |
Modifier and Type | Method and Description |
---|---|
static void |
appendBytesAsPrintFriendlyString(StringBuilder builder,
byte[] phiBytes) |
static void |
appendBytesAsPrintFriendlyString(StringBuilder builder,
byte[] phiBytes,
int startPosition,
int endPosition)
Append a PHI byte[] to a StringBuilder, replacing specific non-printable characters with readable strings.
|
static StringBuilder |
bytesToPrintFriendlyStringBuilder(byte[] phiBytes)
Convert a PHI byte[] to a StringBuilder, replacing specific non-printable characters with readable strings.
|
static StringBuilder |
bytesToPrintFriendlyStringBuilder(byte[] phiBytes,
int startPosition,
int endPosition)
Convert a PHI byte[] to a StringBuilder, replacing specific non-printable characters with readable strings.
|
static String |
convertToPrintFriendlyString(byte[] phiBytes) |
static String |
convertToPrintFriendlyString(byte[] phiBytes,
int startPosition,
int endPosition)
Convert a PHI byte[] to a String, replacing specific non-printable characters with readable strings.
|
static String |
convertToPrintFriendlyString(String phiString) |
static List<Integer> |
findFieldSeparatorIndicesInSegment(byte[] hl7MessageBytes,
int startingIndex)
Find the field separator indices in the Segment.
|
static String |
findMsh18(byte[] hl7Message)
Find the String value of MSH-18 (Character set).
|
static void |
generateAcknowledgementPayload(MllpSocketBuffer mllpSocketBuffer,
byte[] hl7MessageBytes,
String acknowledgementCode) |
static void |
generateAcknowledgementPayload(MllpSocketBuffer mllpSocketBuffer,
byte[] hl7MessageBytes,
String acknowledgementCode,
String msa3) |
static String |
generateInvalidPayloadExceptionMessage(byte[] hl7Bytes) |
static String |
generateInvalidPayloadExceptionMessage(byte[] hl7Bytes,
int length)
Verifies that the HL7 payload array
|
static String |
getCharacterAsPrintFriendlyString(char c) |
public static final String NULL_REPLACEMENT_VALUE
public static final String EMPTY_REPLACEMENT_VALUE
public static final SimpleDateFormat TIMESTAMP_FORMAT
public static String generateInvalidPayloadExceptionMessage(byte[] hl7Bytes)
public static String generateInvalidPayloadExceptionMessage(byte[] hl7Bytes, int length)
The MLLP protocol does not allow embedded START_OF_BLOCK or END_OF_BLOCK characters. The END_OF_DATA character is allowed (and expected) because it is also the segment delimiter for an HL7 message
hl7Bytes
- the HL7 payload to validatepublic static List<Integer> findFieldSeparatorIndicesInSegment(byte[] hl7MessageBytes, int startingIndex)
hl7MessageBytes
- the HL7 binary messagestartingIndex
- index of the beginning of the HL7 Segmentpublic static String findMsh18(byte[] hl7Message)
hl7Message
- the HL7 binary data to searchpublic static void generateAcknowledgementPayload(MllpSocketBuffer mllpSocketBuffer, byte[] hl7MessageBytes, String acknowledgementCode) throws MllpAcknowledgementGenerationException
public static void generateAcknowledgementPayload(MllpSocketBuffer mllpSocketBuffer, byte[] hl7MessageBytes, String acknowledgementCode, String msa3) throws MllpAcknowledgementGenerationException
public static String convertToPrintFriendlyString(byte[] phiBytes)
public static String convertToPrintFriendlyString(byte[] phiBytes, int startPosition, int endPosition)
phiBytes
- the PHI byte[] to logstartPosition
- the starting position/index of the dataendPosition
- the ending position/index of the data - will not be included in Stringpublic static StringBuilder bytesToPrintFriendlyStringBuilder(byte[] phiBytes)
phiBytes
- the PHI byte[] to logpublic static StringBuilder bytesToPrintFriendlyStringBuilder(byte[] phiBytes, int startPosition, int endPosition)
phiBytes
- the PHI byte[] to logstartPosition
- the starting position/index of the dataendPosition
- the ending position/index of the data - will not be included in StringBuilderpublic static void appendBytesAsPrintFriendlyString(StringBuilder builder, byte[] phiBytes)
public static void appendBytesAsPrintFriendlyString(StringBuilder builder, byte[] phiBytes, int startPosition, int endPosition)
phiBytes
- the PHI byte[] to logstartPosition
- the starting position/index of the dataendPosition
- the ending position/index of the data - will not be included in Stringpublic static String getCharacterAsPrintFriendlyString(char c)
Apache Camel