Package com.ibm.fhir.persistence.util
Class AbstractQueryBuilder<T1>
- java.lang.Object
- 
- com.ibm.fhir.persistence.util.AbstractQueryBuilder<T1>
 
- 
- All Implemented Interfaces:
- QueryBuilder<T1>
 - Direct Known Subclasses:
- JDBCQueryBuilder
 
 public abstract class AbstractQueryBuilder<T1> extends Object implements QueryBuilder<T1> This class defines a reusable method structure and common functionality for a FHIR persistence query builder.
- 
- 
Constructor SummaryConstructors Constructor Description AbstractQueryBuilder()
 - 
Method SummaryAll Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract T1buildLocationQuerySegment(String parmName, List<Bounding> boundingAreas, String paramTableAlias)Builds a query segment for the passed parameter name using the geospatial data contained with the passed BoundingBoxprotected T1buildQueryParm(Class<?> resourceType, QueryParameter queryParm)Builds a query segment for the passed query parameter.static StringextractReferenceFromUrl(String parmValue)Examines the passed ParamaterValue, and checks to see if the value is a URL.static booleanisAbsoluteURL(String s)protected abstract T1processChainedReferenceParm(QueryParameter queryParm)Contains special logic for handling chained reference search parameters.protected abstract T1processCompositeParm(Class<?> resourceType, QueryParameter queryParm)Creates a query segment for a Composite type parameter.protected abstract T1processDateParm(Class<?> resourceType, QueryParameter queryParm)Creates a query segment for a Date type parameter.protected abstract T1processInclusionCriteria(QueryParameter queryParm)Contains special logic for handling Compartment based searches.protected T1processLocationPosition(List<QueryParameter> queryParameters, String paramTableAlias)This method executes special logic for a Token type query that maps to a LocationPosition data type.protected abstract T1processNumberParm(Class<?> resourceType, QueryParameter queryParm)Creates a query segment for a Number type parameter.protected abstract T1processQuantityParm(Class<?> resourceType, QueryParameter queryParm)Creates a query segment for a Quantity type parameter.protected abstract T1processReferenceParm(Class<?> resourceType, QueryParameter queryParm)Creates a query segment for a Reference type parameter.protected abstract T1processReverseChainedReferenceParm(Class<?> resourceType, QueryParameter queryParm)Contains special logic for handling reverse chained reference search parameters.protected abstract T1processStringParm(QueryParameter queryParm)Creates a query segment for a String type parameter.protected abstract T1processTokenParm(QueryParameter queryParm)Creates a query segment for a Token type parameter.protected abstract T1processUriParm(QueryParameter queryParm)Creates a query segment for a URI type parameter.- 
Methods inherited from class java.lang.Objectclone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 - 
Methods inherited from interface com.ibm.fhir.persistence.util.QueryBuilderbuildQuery
 
- 
 
- 
- 
- 
Method Detail- 
extractReferenceFromUrlpublic static String extractReferenceFromUrl(String parmValue) Examines the passed ParamaterValue, and checks to see if the value is a URL. If it is, the {ResourceType/id} part of the URL path is extracted and returned. For example: If the input value is http://localhost:8080/fhir/Patient/123, then Patient/123 is returned.- Parameters:
- parmValue- A valid String parameter value that may or may not contain a URL.
- Returns:
- String - The last 2 segments of the URL path is returned if the passed parmValue is a URL; otherwise, null is returned.
 
 - 
isAbsoluteURLpublic static boolean isAbsoluteURL(String s) 
 - 
buildQueryParmprotected T1 buildQueryParm(Class<?> resourceType, QueryParameter queryParm) throws Exception Builds a query segment for the passed query parameter.- Parameters:
- resourceType- - A valid FHIR Resource type
- queryParm- - A Parameter object describing the name, value and type of search parm.
- Returns:
- T1 - An object representing the selector query segment for the passed search parm.
- Throws:
- Exception
 
 - 
processStringParmprotected abstract T1 processStringParm(QueryParameter queryParm) throws FHIRPersistenceException Creates a query segment for a String type parameter.- Parameters:
- queryParm- - The query parameter.
- Returns:
- T1 - An object containing query segment.
- Throws:
- FHIRPersistenceException
 
 - 
processReferenceParmprotected abstract T1 processReferenceParm(Class<?> resourceType, QueryParameter queryParm) throws Exception Creates a query segment for a Reference type parameter.- Parameters:
- queryParm- - The query parameter.
- Returns:
- T1 - An object containing query segment.
- Throws:
- Exception
 
 - 
processChainedReferenceParmprotected abstract T1 processChainedReferenceParm(QueryParameter queryParm) throws Exception Contains special logic for handling chained reference search parameters.- Parameters:
- queryParm- - The query parameter.
- Returns:
- T1 - An object containing a query segment.
- Throws:
- FHIRPersistenceException
- Exception
 
 - 
processReverseChainedReferenceParmprotected abstract T1 processReverseChainedReferenceParm(Class<?> resourceType, QueryParameter queryParm) throws Exception Contains special logic for handling reverse chained reference search parameters.- Parameters:
- resourceType- - The resource type.
- queryParm- - The query parameter.
- Returns:
- T1 - An object containing a query segment.
- Throws:
- FHIRPersistenceException
- Exception
 
 - 
processInclusionCriteriaprotected abstract T1 processInclusionCriteria(QueryParameter queryParm) throws Exception Contains special logic for handling Compartment based searches.- Parameters:
- queryParm- - The query parameter.
- Returns:
- T1 - An object containing a query segment.
- Throws:
- FHIRPersistenceException
- Exception
 
 - 
processDateParmprotected abstract T1 processDateParm(Class<?> resourceType, QueryParameter queryParm) throws Exception Creates a query segment for a Date type parameter.- Parameters:
- queryParm- - The query parameter.
- Returns:
- T1 - An object containing query segment.
- Throws:
- Exception
 
 - 
processTokenParmprotected abstract T1 processTokenParm(QueryParameter queryParm) throws FHIRPersistenceException Creates a query segment for a Token type parameter.- Parameters:
- queryParm- - The query parameter.
- Returns:
- T1 - An object containing query segment.
- Throws:
- FHIRPersistenceException
 
 - 
processNumberParmprotected abstract T1 processNumberParm(Class<?> resourceType, QueryParameter queryParm) throws FHIRPersistenceException Creates a query segment for a Number type parameter.- Parameters:
- queryParm- - The query parameter.
- Returns:
- T1 - An object containing query segment.
- Throws:
- FHIRPersistenceException
 
 - 
processQuantityParmprotected abstract T1 processQuantityParm(Class<?> resourceType, QueryParameter queryParm) throws Exception Creates a query segment for a Quantity type parameter.- Parameters:
- queryParm- - The query parameter.
- Returns:
- T1 - An object containing query segment.
- Throws:
- Exception
 
 - 
processUriParmprotected abstract T1 processUriParm(QueryParameter queryParm) throws FHIRPersistenceException Creates a query segment for a URI type parameter.- Parameters:
- queryParm- - The query parameter.
- Returns:
- T1 - An object containing query segment.
- Throws:
- FHIRPersistenceException
 
 - 
processCompositeParmprotected abstract T1 processCompositeParm(Class<?> resourceType, QueryParameter queryParm) throws FHIRPersistenceException Creates a query segment for a Composite type parameter.- Parameters:
- queryParm- - The query parameter
- Returns:
- T1 - An object containing query segment
- Throws:
- FHIRPersistenceException
 
 - 
processLocationPositionprotected T1 processLocationPosition(List<QueryParameter> queryParameters, String paramTableAlias) throws FHIRPersistenceException This method executes special logic for a Token type query that maps to a LocationPosition data type.- Parameters:
- queryParameters- The entire collection of query input parameters
- Returns:
- T1 - A query segment related to a LocationPosition
- Throws:
- FHIRPersistenceException
 
 - 
buildLocationQuerySegmentprotected abstract T1 buildLocationQuerySegment(String parmName, List<Bounding> boundingAreas, String paramTableAlias) throws FHIRPersistenceException Builds a query segment for the passed parameter name using the geospatial data contained with the passed BoundingBox- Parameters:
- parmName- - The name of the search parameter
- boundingAreas- - Container for the geospatial data needed to construct the query segment.
- paramTableAlias- the alias name of the parameter table
- Returns:
- T1 - The query segment necessary for searching locations that are inside the bounding box.
- Throws:
- FHIRPersistenceException
 
 
- 
 
-