Class SearchQuery
- java.lang.Object
-
- org.linuxforhealth.fhir.persistence.jdbc.domain.SearchQuery
-
- Direct Known Subclasses:
SearchCountQuery
,SearchDataQuery
,SearchIncludeQuery
,SearchSortQuery
,SearchWholeSystemDataQuery
,SearchWholeSystemFilterQuery
,SearchWholeSystemQuery
public abstract class SearchQuery extends java.lang.Object
Abstract model of a FHIR search query we intend to build. The purpose of this class and its sub-classes is to drive calls to aSearchQueryVisitor
implementation to render a runnable SQL statement.
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.List<SearchExtension>
extensions
static boolean
INCLUDE_RESOURCE_TYPE_ID
-
Constructor Summary
Constructors Constructor Description SearchQuery(java.lang.String rootResourceType)
Public constructor
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
add(SearchExtension ext)
Add the search extension to the modelvoid
add(SearchParam sp)
Add the search parameter to the modelabstract <T> T
getRoot(SearchQueryVisitor<T> visitor)
Process the logical query definition through the visitorjava.lang.String
getRootResourceType()
Getter for the root resource type for this search query<T> T
visit(SearchQueryVisitor<T> visitor)
Get the root query and attach the parameter filters to it<T> void
visitExtensions(T query, SearchQueryVisitor<T> visitor)
Visit each of the extensions configured for this queryprotected <T> void
visitSearchParams(T query, SearchQueryVisitor<T> visitor)
Visit each of the search parameters
-
-
-
Field Detail
-
INCLUDE_RESOURCE_TYPE_ID
public static final boolean INCLUDE_RESOURCE_TYPE_ID
- See Also:
- Constant Field Values
-
extensions
protected final java.util.List<SearchExtension> extensions
-
-
Method Detail
-
getRootResourceType
public java.lang.String getRootResourceType()
Getter for the root resource type for this search query- Returns:
-
add
public void add(SearchParam sp)
Add the search parameter to the model- Parameters:
sp
-
-
add
public void add(SearchExtension ext)
Add the search extension to the model- Parameters:
ext
-
-
visit
public <T> T visit(SearchQueryVisitor<T> visitor) throws FHIRPersistenceException
Get the root query and attach the parameter filters to it- Type Parameters:
T
-- Parameters:
visitor
-- Returns:
- Throws:
FHIRPersistenceException
-
visitExtensions
public <T> void visitExtensions(T query, SearchQueryVisitor<T> visitor) throws FHIRPersistenceException
Visit each of the extensions configured for this query- Type Parameters:
T
-- Parameters:
query
-visitor
-- Throws:
FHIRPersistenceException
-
getRoot
public abstract <T> T getRoot(SearchQueryVisitor<T> visitor)
Process the logical query definition through the visitor- Type Parameters:
T
-- Parameters:
visitor
-- Returns:
-
visitSearchParams
protected <T> void visitSearchParams(T query, SearchQueryVisitor<T> visitor) throws FHIRPersistenceException
Visit each of the search parameters- Type Parameters:
T
-- Parameters:
query
-visitor
-- Throws:
FHIRPersistenceException
-
-