Class SearchQueryRenderer
- java.lang.Object
-
- com.ibm.fhir.persistence.jdbc.domain.SearchQueryRenderer
-
- All Implemented Interfaces:
SearchQueryVisitor<QueryData>
public class SearchQueryRenderer extends Object implements SearchQueryVisitor<QueryData>
Used to render the domain model into a physical, executable query modeled as a Select statement. The domain model knows about resources and parameters. This class is used to translate the logical structure of the query into a physical one, using the correct table names, join predicates and filter expressions.
-
-
Constructor Summary
Constructors Constructor Description SearchQueryRenderer(JDBCIdentityCache identityCache, int rowOffset, int rowsPerPage)Public constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description QueryDataaddCanonicalParam(QueryData queryData, String resourceType, QueryParameter queryParm)Filter the query using the given canonical parameterQueryDataaddChained(QueryData queryData, QueryParameter currentParm)Add a chain subquery element as part of a chained parameter searchQueryDataaddCompositeParam(QueryData queryData, QueryParameter queryParm)Add a composite query parameter filter to the queryQueryDataaddCompositeParam(QueryData queryData, QueryParameter queryParm, boolean isMissing)Add a composite query which only tests missing/not missing, not the actual parameter valueQueryDataaddDateParam(QueryData queryData, String resourceType, QueryParameter queryParm)Filter the query using the given date parametervoidaddFilter(QueryData queryData, String resourceType, QueryParameter currentParm)Add a filter predicate to the given chained sub-query element.protected voidaddIdFilter(QueryData queryData, String resourceType, QueryParameter queryParm)Add a filter on the LOGICAL_ID for the given query parameter valuesQueryDataaddIncludeFilter(QueryData queryData, InclusionParameter inclusionParm, List<Long> logicalResourceIds)QueryDataaddInclusionParam(QueryData queryData, String resourceType, QueryParameter queryParm)Special case to handle inclusion related to compartment-based searchesQueryDataaddLocationParam(QueryData queryData, String resourceType, QueryParameter queryParm)Filter the query using the given location (lat/lng) paramQueryDataaddLocationPosition(QueryData queryData, List<QueryParameter> queryParameters)QueryDataaddMissingParam(QueryData queryData, QueryParameter queryParm, boolean isMissing)Add a missing (NOT EXISTS) parameter clause to the queryQueryDataaddNumberParam(QueryData queryData, String resourceType, QueryParameter queryParm)Filter the query using the given number parameterQueryDataaddPagination(QueryData queryData)Add pagination (LIMIT/OFFSET) to the queryQueryDataaddQuantityParam(QueryData queryData, String resourceType, QueryParameter queryParm)Filter the query using the given quantity parameterQueryDataaddReferenceParam(QueryData queryData, String resourceType, QueryParameter queryParm)Filter the query using the given reference parameterQueryDataaddReverseChained(QueryData queryData, QueryParameter currentParm)Add a reverse chain subquery element as part of a chained parameter searchQueryDataaddRevIncludeFilter(QueryData queryData, InclusionParameter inclusionParm, List<Long> logicalResourceIds)QueryDataaddSecurityParam(QueryData queryData, String resourceType, QueryParameter queryParm)Filter the query using the given security query parameterQueryDataaddSorting(QueryData queryData, String lrAlias)Add sorting (order by) to the queryvoidaddSortParam(QueryData queryData, String code, SearchConstants.Type type, Sort.Direction direction)Add the given sort parameter to the sort queryQueryDataaddStringParam(QueryData queryData, String resourceType, QueryParameter queryParm)Filter the query using the given string parameterQueryDataaddTagParam(QueryData queryData, String resourceType, QueryParameter queryParm)Filter the query using the given tag query parameterQueryDataaddTokenParam(QueryData queryData, String resourceType, QueryParameter queryParm)Filter the query using the given parameter id and token valueQueryDataaddWholeSystemDataFilter(QueryData queryData, String resourceType, List<Long> logicalResourceIds)QueryDataaddWholeSystemResourceTypeFilter(QueryData queryData, List<Integer> resourceTypeIds)QueryDataaddWholeSystemSorting(QueryData queryData, List<DomainSortParameter> sortParms, String lrAlias)Add sorting (order by) for whole-system search to the queryQueryDatacountRoot(String rootResourceType)The root query (select statement) for a count queryQueryDatadataRoot(String rootResourceType)The root query (select statement) for the data queryprotected intgetCanonicalId(String canonicalValue)Get the id for the given canonicalValue (cache lookup).protected intgetCodeSystemId(String codeSystemName)Get the id for the given code system name (cache lookup)protected LonggetCommonTokenValueId(String system, String code)Get the common token value id matching the unique tuple {system, code}protected List<Long>getCommonTokenValueIdList(String code)Get a list of common token values matching the given codeprotected WhereFragmentgetDateFilter(QueryParameter queryParm, String paramAlias)Add a filter predicate to the given exists sub-queryprotected WhereFragmentgetFilterPredicate(QueryData queryData, QueryParameter queryParm)Get a simple filter predicate which can be used in the WHERE clause of a search query.protected WhereFragmentgetLocationFilter(QueryParameter queryParm, String paramAlias)Add a filter predicate to the given exists sub-queryprotected StringgetLRAlias(int aliasIndex)Get the string to use as a logical resource alias for the given aliasIndex valueprotected intgetNextAliasIndex()Get the next index number to use as a parameter table aliasprotected WhereFragmentgetNumberFilter(QueryParameter queryParm, String paramAlias)Get a filter predicate for the given number query parameterprotected OperatorgetOperator(QueryParameter queryParameter)Get the operator we need to use for matching values for this parameterprotected OperatorgetOperator(QueryParameter queryParm, String defaultOverride)Map the Modifier in the passed Parameter to a supported query operator.protected StringgetParamAlias(int aliasIndex)Get the string to use as a parameter table alias for the given aliasIndex valueQueryDatagetParameterBaseQuery(QueryData parent)Get the join to which we want to attach all the parameter tables.protected intgetParameterNameId(String parameterName)Get the id for the given parameter name (cache lookup)protected WhereFragmentgetQuantityFilter(QueryParameter queryParm, String paramAlias)Add a filter predicate to the given exists sub-queryprotected WhereFragmentgetReferenceFilter(QueryParameter queryParm, String paramAlias)Create a filter predicate for the given reference query parameterprotected StringgetSortParameterTableName(String resourceType, String code, SearchConstants.Type type)Returns the name of the database table corresponding to the code and type of the passed sort parameter.protected WhereFragmentgetStringFilter(QueryParameter queryParm, String paramAlias)Add a filter expression to the given parameter sub-query (which is used as an EXISTS clause)protected WhereFragmentgetTokenFilter(QueryParameter queryParm, String paramAlias)Get the filter predicate for the given token query parameter.protected StringgetTokenParamTable(ExpNode filter, String resourceType, String paramAlias)Compute the token parameter table name we want to use to join with.QueryDataincludeRoot(String rootResourceType)The root query (select statement) for the include query.QueryDatajoinResources(QueryData queryData)Finish the data query by wrapping the root and joining the resources tableprotected intnullCheck(Integer value)Use -1 as a simple substitute for null literal ids because we know -1 will never exist as a value in the database (for fields populated by sequence values).protected longnullCheck(Long value)Use -1 as a simple substitute for null literal ids because we know -1 will never exist as a value in the database (for fields populated by sequence values).protected WhereFragmentparamFilter(QueryParameter queryParm, String paramTableAlias)Get the filter predicate expression for the given query parameter taking into account its type, modifiers etc.StringparamValuesColumnName(SearchConstants.Type paramType)Get the column name to use for the given paramTypeStringparamValuesTableName(String resourceType, QueryParameter queryParm)Get the parameter values table name (e.g.protected StringresourceLogicalResources(String resourceType)Get the table name for the xx_logical_resources table where xx is the resource type nameprotected StringresourceResources(String resourceType)Get the table name for the xx_resources table where xx is the resource type nameQueryDatasortRoot(String rootResourceType)The root of the FHIR search sort queryQueryDatawholeSystemDataRoot(String rootResourceType)The root of the FHIR whole-system data search queryQueryDatawholeSystemFilterRoot()The root of the FHIR whole-system filter search queryQueryDatawrapInclude(QueryData query)QueryDatawrapWholeSystem(List<QueryData> queries, boolean isCountQuery)The wrapper for whole-system search
-
-
-
Constructor Detail
-
SearchQueryRenderer
public SearchQueryRenderer(JDBCIdentityCache identityCache, int rowOffset, int rowsPerPage)
Public constructor- Parameters:
identityCache-rowOffset-rowsPerPage-
-
-
Method Detail
-
getNextAliasIndex
protected int getNextAliasIndex()
Get the next index number to use as a parameter table alias- Returns:
-
resourceLogicalResources
protected String resourceLogicalResources(String resourceType)
Get the table name for the xx_logical_resources table where xx is the resource type name- Parameters:
resourceType-- Returns:
- the table name
-
resourceResources
protected String resourceResources(String resourceType)
Get the table name for the xx_resources table where xx is the resource type name- Parameters:
resourceType-- Returns:
-
getParameterNameId
protected int getParameterNameId(String parameterName) throws FHIRPersistenceException
Get the id for the given parameter name (cache lookup)- Parameters:
parameterName-- Returns:
- Throws:
FHIRPersistenceException
-
getCommonTokenValueId
protected Long getCommonTokenValueId(String system, String code) throws FHIRPersistenceException
Get the common token value id matching the unique tuple {system, code}- Parameters:
system-code-- Returns:
- Throws:
FHIRPersistenceException
-
getCommonTokenValueIdList
protected List<Long> getCommonTokenValueIdList(String code) throws FHIRPersistenceException
Get a list of common token values matching the given code- Parameters:
code-- Returns:
- Throws:
FHIRPersistenceException
-
getCodeSystemId
protected int getCodeSystemId(String codeSystemName) throws FHIRPersistenceException
Get the id for the given code system name (cache lookup)- Parameters:
codeSystemName-- Returns:
- Throws:
FHIRPersistenceException
-
getCanonicalId
protected int getCanonicalId(String canonicalValue) throws FHIRPersistenceException
Get the id for the given canonicalValue (cache lookup).- Parameters:
canonicalValue-- Returns:
- the database id, or -1 if the value does not exist
- Throws:
FHIRPersistenceException
-
countRoot
public QueryData countRoot(String rootResourceType)
Description copied from interface:SearchQueryVisitorThe root query (select statement) for a count query- Specified by:
countRootin interfaceSearchQueryVisitor<QueryData>- Returns:
-
dataRoot
public QueryData dataRoot(String rootResourceType)
Description copied from interface:SearchQueryVisitorThe root query (select statement) for the data query- Specified by:
dataRootin interfaceSearchQueryVisitor<QueryData>- Returns:
-
getParameterBaseQuery
public QueryData getParameterBaseQuery(QueryData parent)
Description copied from interface:SearchQueryVisitorGet the join to which we want to attach all the parameter tables. This makes it easier to build different styles of joins- Specified by:
getParameterBaseQueryin interfaceSearchQueryVisitor<QueryData>- Returns:
-
joinResources
public QueryData joinResources(QueryData queryData)
Description copied from interface:SearchQueryVisitorFinish the data query by wrapping the root and joining the resources table- Specified by:
joinResourcesin interfaceSearchQueryVisitor<QueryData>- Returns:
-
includeRoot
public QueryData includeRoot(String rootResourceType)
Description copied from interface:SearchQueryVisitorThe 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'- Specified by:
includeRootin interfaceSearchQueryVisitor<QueryData>- Returns:
-
wrapInclude
public QueryData wrapInclude(QueryData query)
- Specified by:
wrapIncludein interfaceSearchQueryVisitor<QueryData>- Returns:
-
sortRoot
public QueryData sortRoot(String rootResourceType)
Description copied from interface:SearchQueryVisitorThe root of the FHIR search sort query- Specified by:
sortRootin interfaceSearchQueryVisitor<QueryData>- Returns:
-
wholeSystemFilterRoot
public QueryData wholeSystemFilterRoot()
Description copied from interface:SearchQueryVisitorThe root of the FHIR whole-system filter search query- Specified by:
wholeSystemFilterRootin interfaceSearchQueryVisitor<QueryData>- Returns:
-
wholeSystemDataRoot
public QueryData wholeSystemDataRoot(String rootResourceType)
Description copied from interface:SearchQueryVisitorThe root of the FHIR whole-system data search query- Specified by:
wholeSystemDataRootin interfaceSearchQueryVisitor<QueryData>- Returns:
-
wrapWholeSystem
public QueryData wrapWholeSystem(List<QueryData> queries, boolean isCountQuery)
Description copied from interface:SearchQueryVisitorThe wrapper for whole-system search- Specified by:
wrapWholeSystemin interfaceSearchQueryVisitor<QueryData>- Returns:
-
getTokenFilter
protected WhereFragment getTokenFilter(QueryParameter queryParm, String paramAlias) throws FHIRPersistenceException
Get the filter predicate for the given token query parameter.- Parameters:
queryParm- the token query parameterparamAlias- the alias used for the token values table- Throws:
FHIRPersistenceException
-
getStringFilter
protected WhereFragment getStringFilter(QueryParameter queryParm, String paramAlias) throws FHIRPersistenceException
Add a filter expression to the given parameter sub-query (which is used as an EXISTS clause)- Parameters:
paramExists- the query statement to which we need to add the filter predicatequeryParm- the query parameter for which we need to compute and add the filter predicateparamAlias- the alias for the query parameter table- Returns:
- Throws:
FHIRPersistenceException
-
addSorting
public QueryData addSorting(QueryData queryData, String lrAlias)
Description copied from interface:SearchQueryVisitorAdd sorting (order by) to the query- Specified by:
addSortingin interfaceSearchQueryVisitor<QueryData>- Returns:
-
addWholeSystemSorting
public QueryData addWholeSystemSorting(QueryData queryData, List<DomainSortParameter> sortParms, String lrAlias)
Description copied from interface:SearchQueryVisitorAdd sorting (order by) for whole-system search to the query- Specified by:
addWholeSystemSortingin interfaceSearchQueryVisitor<QueryData>- Returns:
-
addPagination
public QueryData addPagination(QueryData queryData)
Description copied from interface:SearchQueryVisitorAdd pagination (LIMIT/OFFSET) to the query- Specified by:
addPaginationin interfaceSearchQueryVisitor<QueryData>- Returns:
-
paramValuesTableName
public String paramValuesTableName(String resourceType, QueryParameter queryParm)
Get the parameter values table name (e.g. Patient_STR_VALUES) for the given resource and parameter type. Note that this is now different from the original QuerySegmentAggregator implementation - it does not differentiate on chaining...that is left up to the building logic.- Parameters:
resourceType-paramType-- Returns:
-
paramValuesColumnName
public String paramValuesColumnName(SearchConstants.Type paramType)
Get the column name to use for the given paramType- Parameters:
paramType-- Returns:
-
getFilterPredicate
protected WhereFragment getFilterPredicate(QueryData queryData, QueryParameter queryParm) throws FHIRPersistenceException
Get a simple filter predicate which can be used in the WHERE clause of a search query. This is used at the "leaf level" of parameter processing, where the queryParm relates to a single parameter (i.e. it is the caller's responsibility to handle chaining and other more complex behavior.- Parameters:
queryData-queryParm-- Returns:
- Throws:
FHIRPersistenceException
-
addIdFilter
protected void addIdFilter(QueryData queryData, String resourceType, QueryParameter queryParm) throws FHIRPersistenceException
Add a filter on the LOGICAL_ID for the given query parameter values- Parameters:
queryData-resourceType-queryParm-- Throws:
FHIRPersistenceException
-
getNumberFilter
protected WhereFragment getNumberFilter(QueryParameter queryParm, String paramAlias) throws FHIRPersistenceException
Get a filter predicate for the given number query parameter- Parameters:
queryParm-paramAlias-- Throws:
FHIRPersistenceException
-
getQuantityFilter
protected WhereFragment getQuantityFilter(QueryParameter queryParm, String paramAlias) throws FHIRPersistenceException
Add a filter predicate to the given exists sub-query- Parameters:
queryParm-paramAlias-- Throws:
FHIRPersistenceException
-
getDateFilter
protected WhereFragment getDateFilter(QueryParameter queryParm, String paramAlias)
Add a filter predicate to the given exists sub-query- Parameters:
queryParm-paramAlias-
-
getLocationFilter
protected WhereFragment getLocationFilter(QueryParameter queryParm, String paramAlias) throws FHIRPersistenceException
Add a filter predicate to the given exists sub-query- Parameters:
queryParm-paramAlias-- Throws:
FHIRPersistenceException
-
getParamAlias
protected String getParamAlias(int aliasIndex)
Get the string to use as a parameter table alias for the given aliasIndex value- Parameters:
aliasIndex-- Returns:
-
getLRAlias
protected String getLRAlias(int aliasIndex)
Get the string to use as a logical resource alias for the given aliasIndex value- Parameters:
aliasIndex-- Returns:
-
getTokenParamTable
protected String getTokenParamTable(ExpNode filter, String resourceType, String paramAlias)
Compute the token parameter table name we want to use to join with. This method inspects the content of the given filterExpNode. If the filter contains a reference to the TOKEN_VALUE column, the returned table name will be based on xx_TOKEN_VALUES_V, otherwise it will be based on xx_RESOURCE_TOKEN_REFS. The latter is preferable because it eliminates an unnecessary join, improves cardinality estimation and (usually) results in a better execution plan.- Parameters:
filter-resourceType-paramAlias-- Returns:
-
getReferenceFilter
protected WhereFragment getReferenceFilter(QueryParameter queryParm, String paramAlias) throws FHIRPersistenceException
Create a filter predicate for the given reference query parameter- Parameters:
queryParm-paramAlias-- Throws:
FHIRPersistenceException
-
nullCheck
protected int nullCheck(Integer value)
Use -1 as a simple substitute for null literal ids because we know -1 will never exist as a value in the database (for fields populated by sequence values).- Parameters:
value-- Returns:
-
nullCheck
protected long nullCheck(Long value)
Use -1 as a simple substitute for null literal ids because we know -1 will never exist as a value in the database (for fields populated by sequence values).- Parameters:
value-- Returns:
-
getOperator
protected Operator getOperator(QueryParameter queryParameter)
Get the operator we need to use for matching values for this parameter- Parameters:
queryParameter-- Returns:
-
getOperator
protected Operator getOperator(QueryParameter queryParm, String defaultOverride)
Map the Modifier in the passed Parameter to a supported query operator. If the mapping results in the default operator, override the default operator with the passed operator if the passed operator is not null.- Parameters:
queryParm- - A valid query Parameter.defaultOverride- - An operator that should override the default operator.- Returns:
- A supported operator.
-
paramFilter
protected WhereFragment paramFilter(QueryParameter queryParm, String paramTableAlias) throws FHIRPersistenceException
Get the filter predicate expression for the given query parameter taking into account its type, modifiers etc.- Parameters:
paramTableAlias-queryParm-- Returns:
- a valid expression
- Throws:
FHIRPersistenceException
-
addLocationPosition
public QueryData addLocationPosition(QueryData queryData, List<QueryParameter> queryParameters) throws FHIRPersistenceException
- Specified by:
addLocationPositionin interfaceSearchQueryVisitor<QueryData>- Returns:
- Throws:
FHIRPersistenceException
-
addInclusionParam
public QueryData addInclusionParam(QueryData queryData, String resourceType, QueryParameter queryParm) throws FHIRPersistenceException
Description copied from interface:SearchQueryVisitorSpecial case to handle inclusion related to compartment-based searches- Specified by:
addInclusionParamin interfaceSearchQueryVisitor<QueryData>- Returns:
- Throws:
FHIRPersistenceException
-
addIncludeFilter
public QueryData addIncludeFilter(QueryData queryData, InclusionParameter inclusionParm, List<Long> logicalResourceIds) throws FHIRPersistenceException
- Specified by:
addIncludeFilterin interfaceSearchQueryVisitor<QueryData>- Returns:
- Throws:
FHIRPersistenceException
-
addRevIncludeFilter
public QueryData addRevIncludeFilter(QueryData queryData, InclusionParameter inclusionParm, List<Long> logicalResourceIds) throws FHIRPersistenceException
- Specified by:
addRevIncludeFilterin interfaceSearchQueryVisitor<QueryData>- Returns:
- Throws:
FHIRPersistenceException
-
addWholeSystemDataFilter
public QueryData addWholeSystemDataFilter(QueryData queryData, String resourceType, List<Long> logicalResourceIds) throws FHIRPersistenceException
- Specified by:
addWholeSystemDataFilterin interfaceSearchQueryVisitor<QueryData>- Returns:
- Throws:
FHIRPersistenceException
-
addWholeSystemResourceTypeFilter
public QueryData addWholeSystemResourceTypeFilter(QueryData queryData, List<Integer> resourceTypeIds) throws FHIRPersistenceException
- Specified by:
addWholeSystemResourceTypeFilterin interfaceSearchQueryVisitor<QueryData>- Returns:
- Throws:
FHIRPersistenceException
-
addTokenParam
public QueryData addTokenParam(QueryData queryData, String resourceType, QueryParameter queryParm) throws FHIRPersistenceException
Description copied from interface:SearchQueryVisitorFilter the query using the given parameter id and token value- Specified by:
addTokenParamin interfaceSearchQueryVisitor<QueryData>- Returns:
- Throws:
FHIRPersistenceException
-
addTagParam
public QueryData addTagParam(QueryData queryData, String resourceType, QueryParameter queryParm) throws FHIRPersistenceException
Description copied from interface:SearchQueryVisitorFilter the query using the given tag query parameter- Specified by:
addTagParamin interfaceSearchQueryVisitor<QueryData>- Returns:
- Throws:
FHIRPersistenceException
-
addSecurityParam
public QueryData addSecurityParam(QueryData queryData, String resourceType, QueryParameter queryParm) throws FHIRPersistenceException
Description copied from interface:SearchQueryVisitorFilter the query using the given security query parameter- Specified by:
addSecurityParamin interfaceSearchQueryVisitor<QueryData>- Returns:
- Throws:
FHIRPersistenceException
-
addStringParam
public QueryData addStringParam(QueryData queryData, String resourceType, QueryParameter queryParm) throws FHIRPersistenceException
Description copied from interface:SearchQueryVisitorFilter the query using the given string parameter- Specified by:
addStringParamin interfaceSearchQueryVisitor<QueryData>- Returns:
- Throws:
FHIRPersistenceException
-
addCanonicalParam
public QueryData addCanonicalParam(QueryData queryData, String resourceType, QueryParameter queryParm) throws FHIRPersistenceException
Description copied from interface:SearchQueryVisitorFilter the query using the given canonical parameter- Specified by:
addCanonicalParamin interfaceSearchQueryVisitor<QueryData>- Returns:
- Throws:
FHIRPersistenceException
-
addMissingParam
public QueryData addMissingParam(QueryData queryData, QueryParameter queryParm, boolean isMissing) throws FHIRPersistenceException
Description copied from interface:SearchQueryVisitorAdd a missing (NOT EXISTS) parameter clause to the query- Specified by:
addMissingParamin interfaceSearchQueryVisitor<QueryData>isMissing- true if the condition should be that the parameter does not exist- Returns:
- Throws:
FHIRPersistenceException
-
addChained
public QueryData addChained(QueryData queryData, QueryParameter currentParm) throws FHIRPersistenceException
Description copied from interface:SearchQueryVisitorAdd a chain subquery element as part of a chained parameter search- Specified by:
addChainedin interfaceSearchQueryVisitor<QueryData>- Returns:
- Throws:
FHIRPersistenceException
-
addFilter
public void addFilter(QueryData queryData, String resourceType, QueryParameter currentParm) throws FHIRPersistenceException
Description copied from interface:SearchQueryVisitorAdd a filter predicate to the given chained sub-query element. This must be the last element of the chain.- Specified by:
addFilterin interfaceSearchQueryVisitor<QueryData>- Throws:
FHIRPersistenceException
-
addReverseChained
public QueryData addReverseChained(QueryData queryData, QueryParameter currentParm) throws FHIRPersistenceException
Description copied from interface:SearchQueryVisitorAdd a reverse chain subquery element as part of a chained parameter search- Specified by:
addReverseChainedin interfaceSearchQueryVisitor<QueryData>- Returns:
- Throws:
FHIRPersistenceException
-
addNumberParam
public QueryData addNumberParam(QueryData queryData, String resourceType, QueryParameter queryParm) throws FHIRPersistenceException
Description copied from interface:SearchQueryVisitorFilter the query using the given number parameter- Specified by:
addNumberParamin interfaceSearchQueryVisitor<QueryData>- Returns:
- Throws:
FHIRPersistenceException
-
addQuantityParam
public QueryData addQuantityParam(QueryData queryData, String resourceType, QueryParameter queryParm) throws FHIRPersistenceException
Description copied from interface:SearchQueryVisitorFilter the query using the given quantity parameter- Specified by:
addQuantityParamin interfaceSearchQueryVisitor<QueryData>- Returns:
- Throws:
FHIRPersistenceException
-
addDateParam
public QueryData addDateParam(QueryData queryData, String resourceType, QueryParameter queryParm) throws FHIRPersistenceException
Description copied from interface:SearchQueryVisitorFilter the query using the given date parameter- Specified by:
addDateParamin interfaceSearchQueryVisitor<QueryData>- Returns:
- Throws:
FHIRPersistenceException
-
addLocationParam
public QueryData addLocationParam(QueryData queryData, String resourceType, QueryParameter queryParm) throws FHIRPersistenceException
Description copied from interface:SearchQueryVisitorFilter the query using the given location (lat/lng) param- Specified by:
addLocationParamin interfaceSearchQueryVisitor<QueryData>- Returns:
- Throws:
FHIRPersistenceException
-
addReferenceParam
public QueryData addReferenceParam(QueryData queryData, String resourceType, QueryParameter queryParm) throws FHIRPersistenceException
Description copied from interface:SearchQueryVisitorFilter the query using the given reference parameter- Specified by:
addReferenceParamin interfaceSearchQueryVisitor<QueryData>- Returns:
- Throws:
FHIRPersistenceException
-
addCompositeParam
public QueryData addCompositeParam(QueryData queryData, QueryParameter queryParm) throws FHIRPersistenceException
Description copied from interface:SearchQueryVisitorAdd a composite query parameter filter to the query- Specified by:
addCompositeParamin interfaceSearchQueryVisitor<QueryData>- Returns:
- Throws:
FHIRPersistenceException
-
addCompositeParam
public QueryData addCompositeParam(QueryData queryData, QueryParameter queryParm, boolean isMissing) throws FHIRPersistenceException
Description copied from interface:SearchQueryVisitorAdd a composite query which only tests missing/not missing, not the actual parameter value- Specified by:
addCompositeParamin interfaceSearchQueryVisitor<QueryData>- Returns:
- Throws:
FHIRPersistenceException
-
addSortParam
public void addSortParam(QueryData queryData, String code, SearchConstants.Type type, Sort.Direction direction) throws FHIRPersistenceException
Description copied from interface:SearchQueryVisitorAdd the given sort parameter to the sort query- Specified by:
addSortParamin interfaceSearchQueryVisitor<QueryData>- Throws:
FHIRPersistenceException
-
getSortParameterTableName
protected String getSortParameterTableName(String resourceType, String code, SearchConstants.Type type) throws FHIRPersistenceException
Returns the name of the database table corresponding to the code and type of the passed sort parameter.- Parameters:
code- A SortParameter codetype- A SortParameter type- Returns:
- String - A database table name
- Throws:
FHIRPersistenceException
-
-