public class HL7Util extends Object
Modifier and Type | Field and Description |
---|---|
static String |
LOCAL_TIMEZONE_OFFSET |
Modifier and Type | Method and Description |
---|---|
static File |
getHl7ArchivesDirectory()
Gets the destination directory for hl7 archives.
|
protected static String |
getTimeZoneOffset(String fullString,
Date givenDate)
Gets the timezone string for this given fullString.
|
static Date |
parseHL7Date(String s)
Convenience method for parsing HL7 dates (treated just like a timestamp with only year,
month, and day specified)
|
static Date |
parseHL7Time(String s)
Converts an HL7 time into a java.util.Date object.
|
static Date |
parseHL7Timestamp(String s)
Converts an HL7 timestamp into a java.util.Date object.
|
public static final String LOCAL_TIMEZONE_OFFSET
public static Date parseHL7Timestamp(String s) throws ca.uhn.hl7v2.HL7Exception
s
- HL7 timestamp to be parsedca.uhn.hl7v2.HL7Exception
- Should fail on 78
Should handle 1978
Should fail on 19784
Should handle 197804
Should fail on 197841
Should handle 19780411
Should fail on 197804116
Should handle 1978041106
Should fail on 19780411065
Should handle 197804110615
Should fail on 1978041106153
Should handle 19780411061538
Should handle 19780411061538.1
Should handle 19780411061538.12
Should handle 19780411061538.123
Should handle 19780411061538.1234
Should fail on 197804110615-5
Should handle 197804110615-05
Should handle 197804110615-0200
Should not flub dst with 20091225123000protected static String getTimeZoneOffset(String fullString, Date givenDate)
fullString
- the hl7 string being parsedgivenDate
- the date that should be used if no timezone exists on the fullStringpublic static Date parseHL7Date(String s) throws ca.uhn.hl7v2.HL7Exception
ca.uhn.hl7v2.HL7Exception
parseHL7Timestamp(String)
public static Date parseHL7Time(String s) throws ca.uhn.hl7v2.HL7Exception
s
- HL7 time to be convertedca.uhn.hl7v2.HL7Exception
- Should fail on 197804110615
Should handle 0615
Should handle 061538
Should handle 061538.1
Should handle 061538.12
Should handle 061538.123
Should handle 061538.1234
Should handle 061538-0300public static File getHl7ArchivesDirectory() throws APIException
APIException
Copyright © 2024 OpenMRS Inc.. All rights reserved.