Package com.ibm.fhir.core
Class FHIRUtilities
- java.lang.Object
-
- com.ibm.fhir.core.FHIRUtilities
-
public class FHIRUtilities extends 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 Timestamp
convertToTimestamp(ZonedDateTime zdt)
For R4 model, generate a sql timestampstatic String
decode(String encodedString)
This function can be used to decode an xor-encoded value that was produced by the WebSphere Liberty 'securityUtility' command.static String
formatTimestamp(Date date)
static String
getObjectHandle(Object o)
Returns the specified object's handle in hex format.static boolean
isEncoded(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 String
stripNamespaceIfPresentInDiv(String str)
This function will remove any whitspace characters which appear in a '...' section within the specified string.static String
stripNewLineWhitespaceIfPresentInDiv(String str)
This function will remove any newlines which appear in a '...' section within the specified string.
-
-
-
Method Detail
-
getObjectHandle
public static String getObjectHandle(Object o)
Returns the specified object's handle in hex format.
-
stripNamespaceIfPresentInDiv
public static String stripNamespaceIfPresentInDiv(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 String stripNewLineWhitespaceIfPresentInDiv(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 String decode(String encodedString) throws Exception
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:
Exception
-
isEncoded
public static boolean isEncoded(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 Timestamp convertToTimestamp(ZonedDateTime zdt)
For R4 model, generate a sql timestamp- Parameters:
zdt
-- Returns:
-
-