Interface SearchQueryVisitor<T>
-
- All Known Implementing Classes:
SearchQueryRenderer
public interface SearchQueryVisitor<T>Used by theSearchQuerydomain 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 TaddChained(T currentSubQuery, QueryParameter currentParm)Add a chain subquery element as part of a chained parameter searchTaddCompositeParam(T query, QueryParameter queryParm)Add a composite query parameter filter to the queryTaddCompositeParam(T query, QueryParameter queryParm, boolean isMissing)Add a composite query which only tests missing/not missing, not the actual parameter valueTaddDateParam(T queryData, String resourceType, QueryParameter queryParm)Filter the query using the given date parametervoidaddFilter(T currentSubQuery, QueryParameter currentParm)Add a filter predicate to the given chained sub-query element.TaddIncludeFilter(T query, InclusionParameter inclusionParm, List<Long> logicalResourceIds)TaddInclusionParam(T query, String resourceType, QueryParameter queryParm)Special case to handle inclusion related to compartment-based searchesTaddLocationParam(T queryData, String resourceType, QueryParameter queryParm)Filter the query using the given location (lat/lng) paramTaddLocationPosition(T queryData, List<QueryParameter> queryParameters)TaddMissingParam(T query, QueryParameter queryParm, boolean isMissing)Add a missing (NOT EXISTS) parameter clause to the queryTaddNumberParam(T queryData, String resourceType, QueryParameter queryParm)Filter the query using the given number parameterTaddPagination(T query)Add pagination (LIMIT/OFFSET) to the queryTaddQuantityParam(T queryData, String resourceType, QueryParameter queryParm)Filter the query using the given quantity parameterTaddReferenceParam(T queryData, String resourceType, QueryParameter queryParm)Filter the query using the given reference parameterTaddReverseChained(T currentSubQuery, QueryParameter currentParm)Add a reverse chain subquery element as part of a chained parameter searchTaddRevIncludeFilter(T query, InclusionParameter inclusionParm, List<Long> logicalResourceIds)TaddSorting(T query, String lrAlias)Add sorting (order by) to the queryvoidaddSortParam(T queryData, String code, SearchConstants.Type type, Sort.Direction direction)Add the given sort parameter to the sort queryTaddStringParam(T query, String resourceType, QueryParameter queryParm)Filter the query using the given string parameterTaddTokenParam(T query, String resourceType, QueryParameter queryParm)Filter the query using the given parameter id and token valueTcountRoot(String rootResourceType)The root query (select statement) for a count queryTdataRoot(String rootResourceType)The root query (select statement) for the data queryTgetParameterBaseQuery(T queryData)Get the join to which we want to attach all the parameter tables.TincludeRoot(String rootResourceType)The root query (select statement) for the include query.TjoinResources(T queryData)Finish the data query by wrapping the root and joining the resources tableTsortRoot(String rootResourceType)The root of the FHIR search sort queryTwrapInclude(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
-
-