Class FHIRPersistenceUtil
- java.lang.Object
-
- org.linuxforhealth.fhir.persistence.util.FHIRPersistenceUtil
-
public class FHIRPersistenceUtil extends java.lang.Object
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T extends Resource>
TcopyAndSetResourceMetaFields(T resource, java.lang.String logicalId, int newVersionNumber, Instant lastUpdated)
Creates and returns a copy of the passed resource with theResource.id
Resource.meta.versionId
, andResource.meta.lastUpdated
elements replaced.static ResourceResult<Resource>
createDeletedResourceResultMarker(java.lang.String resourceType, java.lang.String logicalId, int version, java.time.Instant lastUpdated)
Create a newResourceResult
instance to represent a deleted or partially erased resourcestatic Instant
getUpdateTime()
Get the current UTC timestamp which can be used as a lastUpdated time when ingesting resources.static FHIRHistoryContext
parseHistoryParameters(java.util.Map<java.lang.String,java.util.List<java.lang.String>> queryParameters, boolean lenient)
static FHIRSystemHistoryContext
parseSystemHistoryParameters(java.util.Map<java.lang.String,java.util.List<java.lang.String>> queryParameters, boolean lenient, ResourcesConfigAdapter resourcesConfig)
Parse history parameters into a FHIRHistoryContext using the passed ResourcesConfigAdapter
-
-
-
Method Detail
-
parseHistoryParameters
public static FHIRHistoryContext parseHistoryParameters(java.util.Map<java.lang.String,java.util.List<java.lang.String>> queryParameters, boolean lenient) throws FHIRPersistenceException
- Throws:
FHIRPersistenceException
-
parseSystemHistoryParameters
public static FHIRSystemHistoryContext parseSystemHistoryParameters(java.util.Map<java.lang.String,java.util.List<java.lang.String>> queryParameters, boolean lenient, ResourcesConfigAdapter resourcesConfig) throws FHIRPersistenceException
Parse history parameters into a FHIRHistoryContext using the passed ResourcesConfigAdapter- Parameters:
queryParameters
-lenient
-resourcesConfig
-- Returns:
- Throws:
FHIRPersistenceException
-
createDeletedResourceResultMarker
public static ResourceResult<Resource> createDeletedResourceResultMarker(java.lang.String resourceType, java.lang.String logicalId, int version, java.time.Instant lastUpdated)
Create a newResourceResult
instance to represent a deleted or partially erased resource- Parameters:
resourceType
-logicalId
-version
-lastUpdated
-- Returns:
-
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, java.lang.String logicalId, int newVersionNumber, Instant lastUpdated)
Creates and returns a copy of the passed resource with theResource.id
Resource.meta.versionId
, andResource.meta.lastUpdated
elements replaced.- Parameters:
resource
-logicalId
-newVersionNumber
-lastUpdated
-- Returns:
- the updated resource
-
-