Package com.ibm.fhir.persistence.util
Class FHIRPersistenceUtil
- java.lang.Object
-
- com.ibm.fhir.persistence.util.FHIRPersistenceUtil
-
public class FHIRPersistenceUtil extends Object
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T extends Resource>
TcopyAndSetResourceMetaFields(T resource, String logicalId, int newVersionNumber, Instant lastUpdated)Creates and returns a copy of the passed resource with theResource.idResource.meta.versionId, andResource.meta.lastUpdatedelements replaced.static ResourcecreateDeletedResourceMarker(Resource deletedResource)Create a minimal deleted resource marker from the given resourcestatic InstantgetUpdateTime()Get the current UTC timestamp which can be used as a lastUpdated time when ingesting resources.static FHIRHistoryContextparseHistoryParameters(Map<String,List<String>> queryParameters, boolean lenient)static FHIRSystemHistoryContextparseSystemHistoryParameters(Map<String,List<String>> queryParameters, boolean lenient)
-
-
-
Method Detail
-
parseHistoryParameters
public static FHIRHistoryContext parseHistoryParameters(Map<String,List<String>> queryParameters, boolean lenient) throws FHIRPersistenceException
- Throws:
FHIRPersistenceException
-
parseSystemHistoryParameters
public static FHIRSystemHistoryContext parseSystemHistoryParameters(Map<String,List<String>> queryParameters, boolean lenient) throws FHIRPersistenceException
- Parameters:
queryParameters-lenient-- Returns:
- Throws:
FHIRPersistenceException
-
createDeletedResourceMarker
public static Resource createDeletedResourceMarker(Resource deletedResource)
Create a minimal deleted resource marker from the given resource- Parameters:
deletedResource-- Returns:
- deletedResourceMarker
-
getUpdateTime
public static Instant getUpdateTime()
Get the current UTC timestamp which can be used as a lastUpdated time when ingesting resources.- Returns:
-
copyAndSetResourceMetaFields
public static <T extends Resource> T copyAndSetResourceMetaFields(T resource, String logicalId, int newVersionNumber, Instant lastUpdated)
Creates and returns a copy of the passed resource with theResource.idResource.meta.versionId, andResource.meta.lastUpdatedelements replaced.- Parameters:
resource-logicalId-newVersionNumber-lastUpdated-- Returns:
- the updated resource
-
-