@Transactional(propagation=REQUIRED) public abstract class BaseHapiFhirResourceDao<T extends IBaseResource> extends BaseHapiFhirDao<T> implements IFhirResourceDao<T>
| Modifier and Type | Field and Description |
|---|---|
protected org.springframework.transaction.PlatformTransactionManager |
myPlatformTransactionManager |
protected IResourceIndexedSearchParamUriDao |
myResourceIndexedSearchParamUriDao |
protected IResourceTableDao |
myResourceTableDao |
protected IFulltextSearchSvc |
mySearchDao |
protected ISearchResultDao |
mySearchResultDao |
protected IHapiTerminologySvc |
myTerminologySvc |
INDEX_STATUS_INDEXED, INDEX_STATUS_INDEXING_FAILED, myEntityManager, myForcedIdDao, NS_JPA_PROFILE, OO_SEVERITY_ERROR, OO_SEVERITY_INFO, OO_SEVERITY_WARN, UCUM_NSRESOURCE_PID| Constructor and Description |
|---|
BaseHapiFhirResourceDao() |
| Modifier and Type | Method and Description |
|---|---|
void |
addTag(IIdType theId,
TagTypeEnum theTagType,
String theScheme,
String theTerm,
String theLabel) |
DaoMethodOutcome |
create(T theResource)
Create a resource - Note that this variant of the method does not take in a
RequestDetails and
therefore can not fire any interceptors. |
DaoMethodOutcome |
create(T theResource,
RequestDetails theRequestDetails) |
DaoMethodOutcome |
create(T theResource,
String theIfNoneExist)
Create a resource - Note that this variant of the method does not take in a
RequestDetails and
therefore can not fire any interceptors. |
DaoMethodOutcome |
create(T theResource,
String theIfNoneExist,
boolean thePerformIndexing,
RequestDetails theRequestDetails) |
DaoMethodOutcome |
create(T theResource,
String theIfNoneExist,
RequestDetails theRequestDetails) |
IBaseOperationOutcome |
createErrorOperationOutcome(String theMessage,
String theCode) |
IBaseOperationOutcome |
createInfoOperationOutcome(String theMessage) |
protected abstract IBaseOperationOutcome |
createOperationOutcome(String theSeverity,
String theMessage,
String theCode) |
DaoMethodOutcome |
delete(IIdType theId)
Delete a resource - Note that this variant of the method does not take in a
RequestDetails and
therefore can not fire any interceptors. |
DaoMethodOutcome |
delete(IIdType theId,
List<DeleteConflict> deleteConflicts,
RequestDetails theRequestDetails)
This method does not throw an exception if there are delete conflicts, but populates them
in the provided list
|
DaoMethodOutcome |
delete(IIdType theId,
RequestDetails theRequestDetails)
This method throws an exception if there are delete conflicts
|
DeleteMethodOutcome |
deleteByUrl(String theUrl,
List<DeleteConflict> deleteConflicts,
RequestDetails theRequestDetails)
This method gets called by
deleteByUrl(String, List, RequestDetails) as well as by
transaction processors |
DeleteMethodOutcome |
deleteByUrl(String theUrl,
RequestDetails theRequestDetails)
This method throws an exception if there are delete conflicts
|
void |
detectSearchDaoDisabled() |
TagList |
getAllResourceTags(RequestDetails theRequestDetails) |
protected abstract List<Object> |
getIncludeValues(FhirTerser theTerser,
Include theInclude,
IBaseResource theResource,
RuntimeResourceDefinition theResourceDef) |
String |
getResourceName() |
Class<T> |
getResourceType() |
TagList |
getTags(IIdType theResourceId,
RequestDetails theRequestDetails) |
IBundleProvider |
history(Date theSince,
Date theUntil,
RequestDetails theRequestDetails) |
IBundleProvider |
history(IIdType theId,
Date theSince,
Date theUntil,
RequestDetails theRequestDetails) |
<MT extends IBaseMetaType> |
metaAddOperation(IIdType theResourceId,
MT theMetaAdd,
RequestDetails theRequestDetails)
Not supported in DSTU1!
|
<MT extends IBaseMetaType> |
metaDeleteOperation(IIdType theResourceId,
MT theMetaDel,
RequestDetails theRequestDetails)
Not supported in DSTU1!
|
<MT extends IBaseMetaType> |
metaGetOperation(Class<MT> theType,
IIdType theId,
RequestDetails theRequestDetails)
Not supported in DSTU1!
|
<MT extends IBaseMetaType> |
metaGetOperation(Class<MT> theType,
RequestDetails theRequestDetails)
Not supported in DSTU1!
|
DaoMethodOutcome |
patch(IIdType theId,
PatchTypeEnum thePatchType,
String thePatchBody,
RequestDetails theRequestDetails) |
void |
postConstruct() |
protected void |
preDelete(T theResourceToDelete,
ResourceTable theEntityToDelete)
Subclasses may override to provide behaviour.
|
protected void |
preProcessResourceForStorage(T theResource)
May be overridden by subclasses to validate resources prior to storage
|
Set<Long> |
processMatchUrl(String theMatchUrl) |
T |
read(IIdType theId)
Read a resource - Note that this variant of the method does not take in a
RequestDetails and
therefore can not fire any interceptors. |
T |
read(IIdType theId,
RequestDetails theRequestDetails) |
BaseHasResource |
readEntity(IIdType theId) |
BaseHasResource |
readEntity(IIdType theId,
boolean theCheckForForcedId) |
protected ResourceTable |
readEntityLatestVersion(IIdType theId) |
void |
reindex(T theResource,
ResourceTable theEntity)
Updates index tables associated with the given resource.
|
void |
removeTag(IIdType theId,
TagTypeEnum theTagType,
String theScheme,
String theTerm) |
void |
removeTag(IIdType theId,
TagTypeEnum theTagType,
String theScheme,
String theTerm,
RequestDetails theRequestDetails) |
IBundleProvider |
search(Map<String,IQueryParameterType> theParams) |
IBundleProvider |
search(SearchParameterMap theParams) |
IBundleProvider |
search(String theParameterName,
IQueryParameterType theValue) |
Set<Long> |
searchForIds(Map<String,IQueryParameterType> theParams) |
Set<Long> |
searchForIds(String theParameterName,
IQueryParameterType theValue) |
Set<Long> |
searchForIdsWithAndOr(SearchParameterMap theParams) |
void |
setResourceType(Class<? extends IBaseResource> theTableType) |
void |
setSecondaryPrimaryKeyParamName(String theSecondaryPrimaryKeyParamName)
If set, the given param will be treated as a secondary primary key, and multiple resources will not be able to share the same value.
|
protected <MT extends IBaseMetaType> |
toMetaDt(Class<MT> theType,
Collection<TagDefinition> tagDefinitions) |
void |
translateRawParameters(Map<String,List<String>> theSource,
SearchParameterMap theTarget)
Takes a map of incoming raw search parameters and translates/parses them into
appropriate
IQueryParameterType instances of the appropriate type
for the given param |
DaoMethodOutcome |
update(T theResource)
Update a resource - Note that this variant of the method does not take in a
RequestDetails and
therefore can not fire any interceptors. |
DaoMethodOutcome |
update(T theResource,
RequestDetails theRequestDetails) |
DaoMethodOutcome |
update(T theResource,
String theMatchUrl)
Update a resource - Note that this variant of the method does not take in a
RequestDetails and
therefore can not fire any interceptors. |
DaoMethodOutcome |
update(T theResource,
String theMatchUrl,
boolean thePerformIndexing,
RequestDetails theRequestDetails) |
DaoMethodOutcome |
update(T theResource,
String theMatchUrl,
RequestDetails theRequestDetails) |
protected void |
validateOkToDelete(List<DeleteConflict> theDeleteConflicts,
ResourceTable theEntity) |
clearRequestAsProcessingSubRequest, createForcedIdIfNeeded, extractResourceLinks, extractSearchParamCoords, extractSearchParamDates, extractSearchParamNumber, extractSearchParamQuantity, extractSearchParamStrings, extractSearchParamTokens, extractSearchParamUri, getConfig, getContext, getContext, getDao, getSearchParamByName, getSearchParamsByResourceType, getTag, getTags, history, injectDependenciesIntoBundleProvider, isLogicalReference, isValidPid, markRequestAsProcessingSubRequest, newInstanceAnd, newInstanceType, normalizeString, notifyInterceptors, parseContentTextIntoWords, populateFullTextFields, populateResourceIntoEntity, postPersist, postUpdate, processMatchUrl, setConfig, setContext, setEntityManager, setPlatformTransactionManager, shouldDroppedTagBeRemovedOnUpdate, toEntity, toResource, toResource, toResourceName, toResourceName, translateForcedIdToPid, translateForcedIdToPid, translateForcedIdToPids, translateMatchUrl, translateMatchUrl, translatePidIdToForcedId, updateEntity, updateEntity, validateDeleteConflictsEmptyOrThrowException, validateResourceForStorage, validateResourceTypeclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitvalidategetContext, getSearchParamByName, getSearchParamsByResourceType, injectDependenciesIntoBundleProvider, populateFullTextFields, processMatchUrl, toResource, toResource@Autowired protected org.springframework.transaction.PlatformTransactionManager myPlatformTransactionManager
@Autowired protected IResourceIndexedSearchParamUriDao myResourceIndexedSearchParamUriDao
@Autowired protected IResourceTableDao myResourceTableDao
@Autowired(required=false) protected IFulltextSearchSvc mySearchDao
@Autowired protected ISearchResultDao mySearchResultDao
@Autowired protected IHapiTerminologySvc myTerminologySvc
public void addTag(IIdType theId, TagTypeEnum theTagType, String theScheme, String theTerm, String theLabel)
addTag in interface IFhirResourceDao<T extends IBaseResource>public DaoMethodOutcome create(T theResource)
IFhirResourceDaoRequestDetails and
therefore can not fire any interceptors. Use only for internal system callscreate in interface IFhirResourceDao<T extends IBaseResource>public DaoMethodOutcome create(T theResource, RequestDetails theRequestDetails)
create in interface IFhirResourceDao<T extends IBaseResource>public DaoMethodOutcome create(T theResource, String theIfNoneExist)
IFhirResourceDaoRequestDetails and
therefore can not fire any interceptors. Use only for internal system callscreate in interface IFhirResourceDao<T extends IBaseResource>public DaoMethodOutcome create(T theResource, String theIfNoneExist, boolean thePerformIndexing, RequestDetails theRequestDetails)
create in interface IFhirResourceDao<T extends IBaseResource>thePerformIndexing - Use with caution! If you set this to false, you need to manually perform indexing or your resources
won't be indexed and searches won't work.theRequestDetails - TODOpublic DaoMethodOutcome create(T theResource, String theIfNoneExist, RequestDetails theRequestDetails)
create in interface IFhirResourceDao<T extends IBaseResource>public IBaseOperationOutcome createErrorOperationOutcome(String theMessage, String theCode)
public IBaseOperationOutcome createInfoOperationOutcome(String theMessage)
protected abstract IBaseOperationOutcome createOperationOutcome(String theSeverity, String theMessage, String theCode)
public DaoMethodOutcome delete(IIdType theId)
IFhirResourceDaoRequestDetails and
therefore can not fire any interceptors. Use only for internal system callsdelete in interface IFhirResourceDao<T extends IBaseResource>public DaoMethodOutcome delete(IIdType theId, List<DeleteConflict> deleteConflicts, RequestDetails theRequestDetails)
IFhirResourceDaodelete in interface IFhirResourceDao<T extends IBaseResource>theRequestDetails - TODOpublic DaoMethodOutcome delete(IIdType theId, RequestDetails theRequestDetails)
IFhirResourceDaodelete in interface IFhirResourceDao<T extends IBaseResource>public DeleteMethodOutcome deleteByUrl(String theUrl, List<DeleteConflict> deleteConflicts, RequestDetails theRequestDetails)
deleteByUrl(String, List, RequestDetails) as well as by
transaction processorsdeleteByUrl in interface IFhirResourceDao<T extends IBaseResource>public DeleteMethodOutcome deleteByUrl(String theUrl, RequestDetails theRequestDetails)
IFhirResourceDaodeleteByUrl in interface IFhirResourceDao<T extends IBaseResource>@PostConstruct public void detectSearchDaoDisabled()
public TagList getAllResourceTags(RequestDetails theRequestDetails)
getAllResourceTags in interface IFhirResourceDao<T extends IBaseResource>protected abstract List<Object> getIncludeValues(FhirTerser theTerser, Include theInclude, IBaseResource theResource, RuntimeResourceDefinition theResourceDef)
public String getResourceName()
public Class<T> getResourceType()
getResourceType in interface IFhirResourceDao<T extends IBaseResource>public TagList getTags(IIdType theResourceId, RequestDetails theRequestDetails)
getTags in interface IFhirResourceDao<T extends IBaseResource>public IBundleProvider history(Date theSince, Date theUntil, RequestDetails theRequestDetails)
history in interface IFhirResourceDao<T extends IBaseResource>public IBundleProvider history(IIdType theId, Date theSince, Date theUntil, RequestDetails theRequestDetails)
history in interface IFhirResourceDao<T extends IBaseResource>public <MT extends IBaseMetaType> MT metaAddOperation(IIdType theResourceId, MT theMetaAdd, RequestDetails theRequestDetails)
IFhirResourceDaometaAddOperation in interface IFhirResourceDao<T extends IBaseResource>theRequestDetails - TODOpublic <MT extends IBaseMetaType> MT metaDeleteOperation(IIdType theResourceId, MT theMetaDel, RequestDetails theRequestDetails)
IFhirResourceDaometaDeleteOperation in interface IFhirResourceDao<T extends IBaseResource>theRequestDetails - TODOpublic <MT extends IBaseMetaType> MT metaGetOperation(Class<MT> theType, IIdType theId, RequestDetails theRequestDetails)
IFhirResourceDaometaGetOperation in interface IFhirResourceDao<T extends IBaseResource>theRequestDetails - TODOpublic <MT extends IBaseMetaType> MT metaGetOperation(Class<MT> theType, RequestDetails theRequestDetails)
IFhirResourceDaometaGetOperation in interface IFhirResourceDao<T extends IBaseResource>theRequestDetails - TODOpublic DaoMethodOutcome patch(IIdType theId, PatchTypeEnum thePatchType, String thePatchBody, RequestDetails theRequestDetails)
patch in interface IFhirResourceDao<T extends IBaseResource>@PostConstruct public void postConstruct()
protected void preDelete(T theResourceToDelete, ResourceTable theEntityToDelete)
protected void preProcessResourceForStorage(T theResource)
theResource - The resource that is about to be storedpublic Set<Long> processMatchUrl(String theMatchUrl)
processMatchUrl in interface IFhirResourceDao<T extends IBaseResource>public T read(IIdType theId)
IFhirResourceDaoRequestDetails and
therefore can not fire any interceptors. Use only for internal system callsread in interface IFhirResourceDao<T extends IBaseResource>public T read(IIdType theId, RequestDetails theRequestDetails)
read in interface IFhirResourceDao<T extends IBaseResource>theRequestDetails - TODOpublic BaseHasResource readEntity(IIdType theId)
readEntity in interface IFhirResourceDao<T extends IBaseResource>readEntity in class BaseHapiFhirDao<T extends IBaseResource>public BaseHasResource readEntity(IIdType theId, boolean theCheckForForcedId)
readEntity in interface IFhirResourceDao<T extends IBaseResource>theCheckForForcedId - If true, this method should fail if the requested ID contains a numeric PID which exists, but is
obscured by a "forced ID" so should not exist as far as the outside world is concerned.protected ResourceTable readEntityLatestVersion(IIdType theId)
public void reindex(T theResource, ResourceTable theEntity)
IFhirResourceDaoreindex in interface IFhirResourceDao<T extends IBaseResource>public void removeTag(IIdType theId, TagTypeEnum theTagType, String theScheme, String theTerm)
removeTag in interface IFhirResourceDao<T extends IBaseResource>public void removeTag(IIdType theId, TagTypeEnum theTagType, String theScheme, String theTerm, RequestDetails theRequestDetails)
removeTag in interface IFhirResourceDao<T extends IBaseResource>public IBundleProvider search(Map<String,IQueryParameterType> theParams)
search in interface IFhirResourceDao<T extends IBaseResource>public IBundleProvider search(SearchParameterMap theParams)
search in interface IFhirResourceDao<T extends IBaseResource>public IBundleProvider search(String theParameterName, IQueryParameterType theValue)
search in interface IFhirResourceDao<T extends IBaseResource>public Set<Long> searchForIds(Map<String,IQueryParameterType> theParams)
searchForIds in interface IFhirResourceDao<T extends IBaseResource>public Set<Long> searchForIds(String theParameterName, IQueryParameterType theValue)
searchForIds in interface IFhirResourceDao<T extends IBaseResource>public Set<Long> searchForIdsWithAndOr(SearchParameterMap theParams)
searchForIdsWithAndOr in interface IFhirResourceDao<T extends IBaseResource>public void setResourceType(Class<? extends IBaseResource> theTableType)
public void setSecondaryPrimaryKeyParamName(String theSecondaryPrimaryKeyParamName)
protected <MT extends IBaseMetaType> MT toMetaDt(Class<MT> theType, Collection<TagDefinition> tagDefinitions)
public void translateRawParameters(Map<String,List<String>> theSource, SearchParameterMap theTarget)
IFhirResourceDaoIQueryParameterType instances of the appropriate type
for the given paramtranslateRawParameters in interface IFhirResourceDao<T extends IBaseResource>public DaoMethodOutcome update(T theResource)
IFhirResourceDaoRequestDetails and
therefore can not fire any interceptors. Use only for internal system callsupdate in interface IFhirResourceDao<T extends IBaseResource>public DaoMethodOutcome update(T theResource, RequestDetails theRequestDetails)
update in interface IFhirResourceDao<T extends IBaseResource>public DaoMethodOutcome update(T theResource, String theMatchUrl)
IFhirResourceDaoRequestDetails and
therefore can not fire any interceptors. Use only for internal system callsupdate in interface IFhirResourceDao<T extends IBaseResource>public DaoMethodOutcome update(T theResource, String theMatchUrl, boolean thePerformIndexing, RequestDetails theRequestDetails)
update in interface IFhirResourceDao<T extends IBaseResource>thePerformIndexing - Use with caution! If you set this to false, you need to manually perform indexing or your resources
won't be indexed and searches won't work.theRequestDetails - TODOpublic DaoMethodOutcome update(T theResource, String theMatchUrl, RequestDetails theRequestDetails)
update in interface IFhirResourceDao<T extends IBaseResource>protected void validateOkToDelete(List<DeleteConflict> theDeleteConflicts, ResourceTable theEntity)
Copyright © 2014–2017 University Health Network. All rights reserved.