public abstract class BaseHapiFhirDao<T extends IBaseResource> extends Object implements IDao
| Modifier and Type | Field and Description |
|---|---|
static long |
INDEX_STATUS_INDEXED |
static long |
INDEX_STATUS_INDEXING_FAILED |
protected EntityManager |
myEntityManager |
protected IForcedIdDao |
myForcedIdDao |
static String |
NS_JPA_PROFILE |
static String |
OO_SEVERITY_ERROR |
static String |
OO_SEVERITY_INFO |
static String |
OO_SEVERITY_WARN |
static String |
UCUM_NS |
RESOURCE_PID| Constructor and Description |
|---|
BaseHapiFhirDao() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
clearRequestAsProcessingSubRequest(ServletRequestDetails theRequestDetails) |
protected void |
createForcedIdIfNeeded(ResourceTable theEntity,
IIdType theId) |
protected void |
extractResourceLinks(ResourceTable theEntity,
IBaseResource theResource,
Set<ResourceLink> theLinks,
Date theUpdateTime) |
protected Set<ResourceIndexedSearchParamCoords> |
extractSearchParamCoords(ResourceTable theEntity,
IBaseResource theResource) |
protected Set<ResourceIndexedSearchParamDate> |
extractSearchParamDates(ResourceTable theEntity,
IBaseResource theResource) |
protected Set<ResourceIndexedSearchParamNumber> |
extractSearchParamNumber(ResourceTable theEntity,
IBaseResource theResource) |
protected Set<ResourceIndexedSearchParamQuantity> |
extractSearchParamQuantity(ResourceTable theEntity,
IBaseResource theResource) |
protected Set<ResourceIndexedSearchParamString> |
extractSearchParamStrings(ResourceTable theEntity,
IBaseResource theResource) |
protected Set<BaseResourceIndexedSearchParam> |
extractSearchParamTokens(ResourceTable theEntity,
IBaseResource theResource) |
protected Set<ResourceIndexedSearchParamUri> |
extractSearchParamUri(ResourceTable theEntity,
IBaseResource theResource) |
protected DaoConfig |
getConfig() |
FhirContext |
getContext() |
FhirContext |
getContext(FhirVersionEnum theVersion) |
<R extends IBaseResource> |
getDao(Class<R> theType) |
RuntimeSearchParam |
getSearchParamByName(RuntimeResourceDefinition theResourceDef,
String theParamName) |
Collection<RuntimeSearchParam> |
getSearchParamsByResourceType(RuntimeResourceDefinition theResourceDef) |
protected TagDefinition |
getTag(TagTypeEnum theTagType,
String theScheme,
String theTerm,
String theLabel) |
protected TagList |
getTags(Class<? extends IBaseResource> theResourceType,
IIdType theResourceId) |
protected IBundleProvider |
history(String theResourceName,
Long theId,
Date theSince,
Date theUntil) |
void |
injectDependenciesIntoBundleProvider(PersistedJpaBundleProvider theProvider)
Populate all of the runtime dependencies that a bundle provider requires in order to work
|
protected boolean |
isLogicalReference(IIdType theId) |
protected static boolean |
isValidPid(IIdType theId) |
protected void |
markRequestAsProcessingSubRequest(ServletRequestDetails theRequestDetails) |
protected static IQueryParameterAnd<?> |
newInstanceAnd(String chain) |
protected static IQueryParameterType |
newInstanceType(String chain) |
static String |
normalizeString(String theString) |
protected void |
notifyInterceptors(RestOperationTypeEnum theOperationType,
IServerInterceptor.ActionRequestDetails theRequestDetails) |
String |
parseContentTextIntoWords(IBaseResource theResource) |
void |
populateFullTextFields(IBaseResource theResource,
ResourceTable theEntity) |
protected void |
populateResourceIntoEntity(IBaseResource theResource,
ResourceTable theEntity) |
protected void |
postPersist(ResourceTable theEntity,
T theResource)
Subclasses may override to provide behaviour.
|
protected void |
postUpdate(ResourceTable theEntity,
T theResource)
Subclasses may override to provide behaviour.
|
<R extends IBaseResource> |
processMatchUrl(String theMatchUrl,
Class<R> theResourceType) |
BaseHasResource |
readEntity(IIdType theValueId) |
void |
setConfig(DaoConfig theConfig) |
void |
setContext(FhirContext theContext) |
void |
setEntityManager(EntityManager theEntityManager) |
void |
setPlatformTransactionManager(org.springframework.transaction.PlatformTransactionManager thePlatformTransactionManager) |
protected boolean |
shouldDroppedTagBeRemovedOnUpdate(ResourceTable theEntity,
ResourceTag theTag)
This method is called when an update to an existing resource detects that the resource supplied for update is missing a tag/profile/security label that the currently persisted resource holds.
|
protected ResourceTable |
toEntity(IResource theResource) |
IBaseResource |
toResource(BaseHasResource theEntity,
boolean theForHistoryOperation) |
<R extends IBaseResource> |
toResource(Class<R> theResourceType,
BaseHasResource theEntity,
boolean theForHistoryOperation) |
protected String |
toResourceName(Class<? extends IBaseResource> theResourceType) |
protected String |
toResourceName(IBaseResource theResource) |
protected Long |
translateForcedIdToPid(String theResourceName,
String theResourceId) |
protected static Long |
translateForcedIdToPid(String theResourceName,
String theResourceId,
IForcedIdDao theForcedIdDao) |
protected List<Long> |
translateForcedIdToPids(IIdType theId) |
static SearchParameterMap |
translateMatchUrl(IDao theCallingDao,
FhirContext theContext,
String theMatchUrl,
RuntimeResourceDefinition resourceDef) |
protected static List<org.apache.http.NameValuePair> |
translateMatchUrl(String theMatchUrl) |
protected String |
translatePidIdToForcedId(String theResourceType,
Long theId) |
protected ResourceTable |
updateEntity(IBaseResource theResource,
ResourceTable theEntity,
Date theDeletedTimestampOrNull,
boolean thePerformIndexing,
boolean theUpdateVersion,
Date theUpdateTime) |
protected ResourceTable |
updateEntity(IBaseResource theResource,
ResourceTable entity,
Date theDeletedTimestampOrNull,
Date theUpdateTime) |
protected void |
validateDeleteConflictsEmptyOrThrowException(List<DeleteConflict> theDeleteConflicts) |
protected void |
validateResourceForStorage(T theResource,
ResourceTable theEntityToSave)
This method is invoked immediately before storing a new resource, or an update to an existing resource to allow the DAO to ensure that it is valid for persistence.
|
static void |
validateResourceType(BaseHasResource theEntity,
String theResourceName) |
public static final long INDEX_STATUS_INDEXED
public static final long INDEX_STATUS_INDEXING_FAILED
public static final String NS_JPA_PROFILE
public static final String OO_SEVERITY_ERROR
public static final String OO_SEVERITY_INFO
public static final String OO_SEVERITY_WARN
public static final String UCUM_NS
protected EntityManager myEntityManager
@Autowired protected IForcedIdDao myForcedIdDao
protected void clearRequestAsProcessingSubRequest(ServletRequestDetails theRequestDetails)
protected void createForcedIdIfNeeded(ResourceTable theEntity, IIdType theId)
protected void extractResourceLinks(ResourceTable theEntity, IBaseResource theResource, Set<ResourceLink> theLinks, Date theUpdateTime)
protected boolean isLogicalReference(IIdType theId)
protected Set<ResourceIndexedSearchParamCoords> extractSearchParamCoords(ResourceTable theEntity, IBaseResource theResource)
protected Set<ResourceIndexedSearchParamDate> extractSearchParamDates(ResourceTable theEntity, IBaseResource theResource)
protected Set<ResourceIndexedSearchParamNumber> extractSearchParamNumber(ResourceTable theEntity, IBaseResource theResource)
protected Set<ResourceIndexedSearchParamQuantity> extractSearchParamQuantity(ResourceTable theEntity, IBaseResource theResource)
protected Set<ResourceIndexedSearchParamString> extractSearchParamStrings(ResourceTable theEntity, IBaseResource theResource)
protected Set<BaseResourceIndexedSearchParam> extractSearchParamTokens(ResourceTable theEntity, IBaseResource theResource)
protected Set<ResourceIndexedSearchParamUri> extractSearchParamUri(ResourceTable theEntity, IBaseResource theResource)
protected DaoConfig getConfig()
public FhirContext getContext()
getContext in interface IDaopublic FhirContext getContext(FhirVersionEnum theVersion)
public <R extends IBaseResource> IFhirResourceDao<R> getDao(Class<R> theType)
public RuntimeSearchParam getSearchParamByName(RuntimeResourceDefinition theResourceDef, String theParamName)
getSearchParamByName in interface IDaopublic Collection<RuntimeSearchParam> getSearchParamsByResourceType(RuntimeResourceDefinition theResourceDef)
getSearchParamsByResourceType in interface IDaoprotected TagDefinition getTag(TagTypeEnum theTagType, String theScheme, String theTerm, String theLabel)
protected TagList getTags(Class<? extends IBaseResource> theResourceType, IIdType theResourceId)
protected IBundleProvider history(String theResourceName, Long theId, Date theSince, Date theUntil)
public void injectDependenciesIntoBundleProvider(PersistedJpaBundleProvider theProvider)
IDaoinjectDependenciesIntoBundleProvider in interface IDaoprotected void markRequestAsProcessingSubRequest(ServletRequestDetails theRequestDetails)
protected void notifyInterceptors(RestOperationTypeEnum theOperationType, IServerInterceptor.ActionRequestDetails theRequestDetails)
public String parseContentTextIntoWords(IBaseResource theResource)
public void populateFullTextFields(IBaseResource theResource, ResourceTable theEntity)
populateFullTextFields in interface IDaoprotected void populateResourceIntoEntity(IBaseResource theResource, ResourceTable theEntity)
protected void postPersist(ResourceTable theEntity, T theResource)
theEntity - The entity being updated (Do not modify the entity! Undefined behaviour will occur!)theTag - The tagprotected void postUpdate(ResourceTable theEntity, T theResource)
theEntity - The resourcetheResource - The resource being persistedpublic <R extends IBaseResource> Set<Long> processMatchUrl(String theMatchUrl, Class<R> theResourceType)
processMatchUrl in interface IDaopublic BaseHasResource readEntity(IIdType theValueId)
public void setConfig(DaoConfig theConfig)
@Autowired public void setContext(FhirContext theContext)
public void setEntityManager(EntityManager theEntityManager)
public void setPlatformTransactionManager(org.springframework.transaction.PlatformTransactionManager thePlatformTransactionManager)
protected boolean shouldDroppedTagBeRemovedOnUpdate(ResourceTable theEntity, ResourceTag theTag)
The default implementation removes any profile declarations, but leaves tags and security labels in place. Subclasses may choose to override and change this behaviour.
See Updates to Tags, Profiles, and Security Labels for a description of the logic that the default behaviour folows.
theEntity - The entity being updated (Do not modify the entity! Undefined behaviour will occur!)theTag - The tagtrue if the tag should be removedprotected ResourceTable toEntity(IResource theResource)
public IBaseResource toResource(BaseHasResource theEntity, boolean theForHistoryOperation)
toResource in interface IDaopublic <R extends IBaseResource> R toResource(Class<R> theResourceType, BaseHasResource theEntity, boolean theForHistoryOperation)
toResource in interface IDaoprotected String toResourceName(Class<? extends IBaseResource> theResourceType)
protected String toResourceName(IBaseResource theResource)
protected Long translateForcedIdToPid(String theResourceName, String theResourceId)
protected String translatePidIdToForcedId(String theResourceType, Long theId)
protected ResourceTable updateEntity(IBaseResource theResource, ResourceTable theEntity, Date theDeletedTimestampOrNull, boolean thePerformIndexing, boolean theUpdateVersion, Date theUpdateTime)
protected ResourceTable updateEntity(IBaseResource theResource, ResourceTable entity, Date theDeletedTimestampOrNull, Date theUpdateTime)
protected void validateDeleteConflictsEmptyOrThrowException(List<DeleteConflict> theDeleteConflicts)
protected void validateResourceForStorage(T theResource, ResourceTable theEntityToSave)
theResource - The resource that is about to be persistedtheEntityToSave - TODOprotected static boolean isValidPid(IIdType theId)
protected static IQueryParameterAnd<?> newInstanceAnd(String chain)
protected static IQueryParameterType newInstanceType(String chain)
protected static Long translateForcedIdToPid(String theResourceName, String theResourceId, IForcedIdDao theForcedIdDao)
public static SearchParameterMap translateMatchUrl(IDao theCallingDao, FhirContext theContext, String theMatchUrl, RuntimeResourceDefinition resourceDef)
protected static List<org.apache.http.NameValuePair> translateMatchUrl(String theMatchUrl)
public static void validateResourceType(BaseHasResource theEntity, String theResourceName)
Copyright © 2014–2017 University Health Network. All rights reserved.