Interface SearchQueryVisitor<T>
-
- All Known Implementing Classes:
SearchQueryRenderer
public interface SearchQueryVisitor<T>
Used by theSearchQuery
domain model to render the model into another form (such as a Select statement).
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description T
addChained(T currentSubQuery, QueryParameter currentParm)
Add a chain subquery element as part of a chained parameter searchT
addCompositeParam(T query, QueryParameter queryParm)
Add a composite query parameter filter to the queryT
addCompositeParam(T query, QueryParameter queryParm, boolean isMissing)
Add a composite query which only tests missing/not missing, not the actual parameter valueT
addDateParam(T queryData, String resourceType, QueryParameter queryParm)
Filter the query using the given date parametervoid
addFilter(T currentSubQuery, QueryParameter currentParm)
Add a filter predicate to the given chained sub-query element.T
addIncludeFilter(T query, InclusionParameter inclusionParm, List<Long> logicalResourceIds)
T
addInclusionParam(T query, String resourceType, QueryParameter queryParm)
Special case to handle inclusion related to compartment-based searchesT
addLocationParam(T queryData, String resourceType, QueryParameter queryParm)
Filter the query using the given location (lat/lng) paramT
addLocationPosition(T queryData, List<QueryParameter> queryParameters)
T
addMissingParam(T query, QueryParameter queryParm, boolean isMissing)
Add a missing (NOT EXISTS) parameter clause to the queryT
addNumberParam(T queryData, String resourceType, QueryParameter queryParm)
Filter the query using the given number parameterT
addPagination(T query)
Add pagination (LIMIT/OFFSET) to the queryT
addQuantityParam(T queryData, String resourceType, QueryParameter queryParm)
Filter the query using the given quantity parameterT
addReferenceParam(T queryData, String resourceType, QueryParameter queryParm)
Filter the query using the given reference parameterT
addReverseChained(T currentSubQuery, QueryParameter currentParm)
Add a reverse chain subquery element as part of a chained parameter searchT
addRevIncludeFilter(T query, InclusionParameter inclusionParm, List<Long> logicalResourceIds)
T
addSorting(T query, String lrAlias)
Add sorting (order by) to the queryvoid
addSortParam(T queryData, String code, SearchConstants.Type type, Sort.Direction direction)
Add the given sort parameter to the sort queryT
addStringParam(T query, String resourceType, QueryParameter queryParm)
Filter the query using the given string parameterT
addTokenParam(T query, String resourceType, QueryParameter queryParm)
Filter the query using the given parameter id and token valueT
countRoot(String rootResourceType)
The root query (select statement) for a count queryT
dataRoot(String rootResourceType)
The root query (select statement) for the data queryT
getParameterBaseQuery(T queryData)
Get the join to which we want to attach all the parameter tables.T
includeRoot(String rootResourceType)
The root query (select statement) for the include query.T
joinResources(T queryData)
Finish the data query by wrapping the root and joining the resources tableT
sortRoot(String rootResourceType)
The root of the FHIR search sort queryT
wrapInclude(T query)
-
-
-
Method Detail
-
countRoot
T countRoot(String rootResourceType)
The root query (select statement) for a count query- Parameters:
rootResourceType
-- Returns:
-
dataRoot
T dataRoot(String rootResourceType)
The root query (select statement) for the data query- Parameters:
rootResourceType
-- Returns:
-
joinResources
T joinResources(T queryData)
Finish the data query by wrapping the root and joining the resources table- Parameters:
queryData
-- Returns:
-
getParameterBaseQuery
T getParameterBaseQuery(T queryData)
Get the join to which we want to attach all the parameter tables. This makes it easier to build different styles of joins- Parameters:
queryData
-- Returns:
-
includeRoot
T includeRoot(String rootResourceType)
The root query (select statement) for the include query. This query is different than the data root because of the need to support version references for _include searches. For this, we join: xx_RESOURCES.LOGICAL_RESOURCE_ID = xx_LOGICAL_RESOURCES.LOGICAL_RESOURCE_ID and allow the filter to specify the version_id constraint. However, we still need to assert that the resource has not been deleted, so we keep: xx_LOGICAL_RESOURCES.IS_DELETED = 'N'- Parameters:
rootResourceType
-- Returns:
-
sortRoot
T sortRoot(String rootResourceType)
The root of the FHIR search sort query- Parameters:
rootResourceType
-- Returns:
-
addTokenParam
T addTokenParam(T query, String resourceType, QueryParameter queryParm) throws FHIRPersistenceException
Filter the query using the given parameter id and token value- Parameters:
query
-resourceType
-queryParm
-- Returns:
- Throws:
FHIRPersistenceException
-
addStringParam
T addStringParam(T query, String resourceType, QueryParameter queryParm) throws FHIRPersistenceException
Filter the query using the given string parameter- Parameters:
query
-resourceType
-queryParm
-- Returns:
- Throws:
FHIRPersistenceException
-
addNumberParam
T addNumberParam(T queryData, String resourceType, QueryParameter queryParm) throws FHIRPersistenceException
Filter the query using the given number parameter- Parameters:
queryData
-resourceType
-queryParm
-- Returns:
- Throws:
FHIRPersistenceException
-
addQuantityParam
T addQuantityParam(T queryData, String resourceType, QueryParameter queryParm) throws FHIRPersistenceException
Filter the query using the given quantity parameter- Parameters:
queryData
-resourceType
-queryParm
-- Returns:
- Throws:
FHIRPersistenceException
-
addDateParam
T addDateParam(T queryData, String resourceType, QueryParameter queryParm) throws FHIRPersistenceException
Filter the query using the given date parameter- Parameters:
queryData
-resourceType
-queryParm
-- Returns:
- Throws:
FHIRPersistenceException
-
addReferenceParam
T addReferenceParam(T queryData, String resourceType, QueryParameter queryParm) throws FHIRPersistenceException
Filter the query using the given reference parameter- Parameters:
queryData
-resourceType
-queryParm
-- Returns:
- Throws:
FHIRPersistenceException
-
addLocationParam
T addLocationParam(T queryData, String resourceType, QueryParameter queryParm) throws FHIRPersistenceException
Filter the query using the given location (lat/lng) param- Parameters:
queryData
-resourceType
-queryParm
-- Returns:
- Throws:
FHIRPersistenceException
-
addMissingParam
T addMissingParam(T query, QueryParameter queryParm, boolean isMissing) throws FHIRPersistenceException
Add a missing (NOT EXISTS) parameter clause to the query- Parameters:
query
-queryParm
-isMissing
- true if the condition should be that the parameter does not exist- Returns:
- Throws:
FHIRPersistenceException
-
addCompositeParam
T addCompositeParam(T query, QueryParameter queryParm) throws FHIRPersistenceException
Add a composite query parameter filter to the query- Parameters:
query
-queryParm
-- Returns:
- Throws:
FHIRPersistenceException
-
addCompositeParam
T addCompositeParam(T query, QueryParameter queryParm, boolean isMissing) throws FHIRPersistenceException
Add a composite query which only tests missing/not missing, not the actual parameter value- Parameters:
query
-queryParm
-isMissing
-- Returns:
- Throws:
FHIRPersistenceException
-
addInclusionParam
T addInclusionParam(T query, String resourceType, QueryParameter queryParm) throws FHIRPersistenceException
Special case to handle inclusion related to compartment-based searches- Parameters:
query
-resourceType
-queryParm
-- Returns:
- Throws:
FHIRPersistenceException
-
addSorting
T addSorting(T query, String lrAlias)
Add sorting (order by) to the query- Parameters:
query
-lrAlias
-- Returns:
-
addPagination
T addPagination(T query)
Add pagination (LIMIT/OFFSET) to the query- Parameters:
query
-- Returns:
-
addChained
T addChained(T currentSubQuery, QueryParameter currentParm) throws FHIRPersistenceException
Add a chain subquery element as part of a chained parameter search- Parameters:
currentSubQuery
-currentParm
-- Returns:
- Throws:
FHIRPersistenceException
-
addReverseChained
T addReverseChained(T currentSubQuery, QueryParameter currentParm) throws FHIRPersistenceException
Add a reverse chain subquery element as part of a chained parameter search- Parameters:
currentSubQuery
-currentParm
-- Returns:
- Throws:
FHIRPersistenceException
-
addFilter
void addFilter(T currentSubQuery, QueryParameter currentParm) throws FHIRPersistenceException
Add a filter predicate to the given chained sub-query element. This must be the last element of the chain.- Parameters:
currentSubQuery
-currentParm
-- Throws:
FHIRPersistenceException
-
addLocationPosition
T addLocationPosition(T queryData, List<QueryParameter> queryParameters) throws FHIRPersistenceException
- Parameters:
queryData
-queryParameters
-- Returns:
- Throws:
FHIRPersistenceException
-
addIncludeFilter
T addIncludeFilter(T query, InclusionParameter inclusionParm, List<Long> logicalResourceIds) throws FHIRPersistenceException
- Parameters:
query
-inclusionParm
-logicalResourceIds
-- Returns:
- Throws:
FHIRPersistenceException
-
addRevIncludeFilter
T addRevIncludeFilter(T query, InclusionParameter inclusionParm, List<Long> logicalResourceIds) throws FHIRPersistenceException
- Parameters:
query
-inclusionParm
-logicalResourceIds
-- Returns:
- Throws:
FHIRPersistenceException
-
addSortParam
void addSortParam(T queryData, String code, SearchConstants.Type type, Sort.Direction direction) throws FHIRPersistenceException
Add the given sort parameter to the sort query- Parameters:
queryData
-code
-type
-direction
-- Throws:
FHIRPersistenceException
-
-