Package com.ibm.fhir.core
Class FHIRUtilities
- java.lang.Object
-
- com.ibm.fhir.core.FHIRUtilities
-
public class FHIRUtilities extends java.lang.Object
A collection of miscellaneous utility functions used by the various fhir-* projects.
-
-
Constructor Summary
Constructors Constructor Description FHIRUtilities()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.sql.Timestamp
convertToTimestamp(java.time.ZonedDateTime zdt)
For R4 model, generate a sql timestampstatic java.lang.String
decode(java.lang.String encodedString)
This function can be used to decode an xor-encoded value that was produced by the WebSphere Liberty 'securityUtility' command.static java.lang.String
formatTimestamp(java.util.Date date)
static java.lang.String
getObjectHandle(java.lang.Object o)
Returns the specified object's handle in hex format.static boolean
isEncoded(java.lang.String s)
Returns true if and only if the specified string 's' is an encoded value, which means it starts with the string "{xor}".static java.lang.String
stripNamespaceIfPresentInDiv(java.lang.String str)
This function will remove any whitspace characters which appear in a '...' section within the specified string.static java.lang.String
stripNewLineWhitespaceIfPresentInDiv(java.lang.String str)
This function will remove any newlines which appear in a '...' section within the specified string.
-
-
-
Method Detail
-
getObjectHandle
public static java.lang.String getObjectHandle(java.lang.Object o)
Returns the specified object's handle in hex format.
-
stripNamespaceIfPresentInDiv
public static java.lang.String stripNamespaceIfPresentInDiv(java.lang.String str)
This function will remove any whitspace characters which appear in a '...' section within the specified string.- Parameters:
str
- the string to process- Returns:
- the input string with the 'div' whitespace characters removed
-
stripNewLineWhitespaceIfPresentInDiv
public static java.lang.String stripNewLineWhitespaceIfPresentInDiv(java.lang.String str)
This function will remove any newlines which appear in a '...' section within the specified string.- Parameters:
str
- the string to process- Returns:
- the input string with the 'div' new lines removed
-
decode
public static java.lang.String decode(java.lang.String encodedString)
This function can be used to decode an xor-encoded value that was produced by the WebSphere Liberty 'securityUtility' command.- Parameters:
encodedString
- the encoded string to be decoded- Returns:
- the decoded version of the input string
- Throws:
java.lang.Exception
-
isEncoded
public static boolean isEncoded(java.lang.String s)
Returns true if and only if the specified string 's' is an encoded value, which means it starts with the string "{xor}".- Parameters:
s
- the string value to check
-
convertToTimestamp
public static java.sql.Timestamp convertToTimestamp(java.time.ZonedDateTime zdt)
For R4 model, generate a sql timestamp- Parameters:
zdt
-- Returns:
-
formatTimestamp
public static java.lang.String formatTimestamp(java.util.Date date)
-
-