Package com.ibm.fhir.persistence
Class FHIRPersistenceSupport
- java.lang.Object
-
- com.ibm.fhir.persistence.FHIRPersistenceSupport
-
public class FHIRPersistenceSupport extends java.lang.Object
Collection of helper methods related to the persistence of FHIR resource payload data
-
-
Constructor Summary
Constructors Constructor Description FHIRPersistenceSupport()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Instant
getCurrentInstant()
Get the current time which can be used for the lastUpdated fieldstatic int
getMetaVersionId(Resource resource)
Obtain the versionId value from the Resource meta element, converting to an int for use by the persistence layerstatic <T extends Resource>
Tparse(java.lang.Class<T> resourceType, java.io.InputStream in, java.util.List<java.lang.String> elements, boolean uncompress)
Parse the given stream, using elements if neededstatic InputOutputByteStream
render(Resource resource, boolean compress)
Render the payload
-
-
-
Method Detail
-
render
public static InputOutputByteStream render(Resource resource, boolean compress) throws FHIRGeneratorException, java.io.IOException
Render the payload- Parameters:
resource
-compress
-- Returns:
- Throws:
FHIRGeneratorException
java.io.IOException
-
parse
public static <T extends Resource> T parse(java.lang.Class<T> resourceType, java.io.InputStream in, java.util.List<java.lang.String> elements, boolean uncompress) throws FHIRParserException, java.io.IOException
Parse the given stream, using elements if needed- Type Parameters:
T
-- Parameters:
resourceType
-in
-elements
-uncompress
-- Returns:
- Throws:
FHIRParserException
java.io.IOException
-
getCurrentInstant
public static Instant getCurrentInstant()
Get the current time which can be used for the lastUpdated field- Returns:
- current time in UTC
-
getMetaVersionId
public static int getMetaVersionId(Resource resource) throws FHIRPersistenceException
Obtain the versionId value from the Resource meta element, converting to an int for use by the persistence layer- Parameters:
resource
-- Returns:
- Throws:
FHIRPersistenceException
-
-