Interface SearchQueryVisitor<T>

  • All Known Implementing Classes:
    SearchQueryRenderer

    public interface SearchQueryVisitor<T>
    Used by the SearchQuery domain model to render the model into another form (such as a Select statement).
    • Method Detail

      • countRoot

        T countRoot​(java.lang.String rootResourceType)
        The root query (select statement) for a count query
        Parameters:
        rootResourceType -
        Returns:
      • dataRoot

        T dataRoot​(java.lang.String rootResourceType,
                   int resourceTypeId)
        The root query (select statement) for the data query
        Parameters:
        rootResourceType -
        resourceTypeId -
        Returns:
      • joinResources

        T joinResources​(T queryData,
                        boolean includeResourceTypeId)
        Finish the data query by wrapping the root and joining the resources table
        Parameters:
        queryData -
        includeResourceTypeId - include the resource_type_id in the select column list
        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​(java.lang.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:
      • wrapInclude

        T wrapInclude​(T query)
        Parameters:
        query -
        Returns:
      • sortRoot

        T sortRoot​(java.lang.String rootResourceType)
        The root of the FHIR search sort query
        Parameters:
        rootResourceType -
        Returns:
      • wholeSystemFilterRoot

        T wholeSystemFilterRoot()
        The root of the FHIR whole-system filter search query
        Returns:
      • wholeSystemDataRoot

        T wholeSystemDataRoot​(java.lang.String rootResourceType,
                              int rootResourceTypeId)
        The root of the FHIR whole-system data search query
        Parameters:
        rootResourceType -
        rootResourceTypeId -
        Returns:
      • wrapWholeSystem

        T wrapWholeSystem​(java.util.List<T> queries,
                          boolean isCountQuery)
        The wrapper for whole-system search
        Parameters:
        queries -
        isCountQuery -
        Returns:
      • 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
      • addSorting

        T addSorting​(T query,
                     java.lang.String lrAlias)
        Add sorting (order by) to the query
        Parameters:
        query -
        lrAlias -
        Returns:
      • addWholeSystemSorting

        T addWholeSystemSorting​(T query,
                                java.util.List<DomainSortParameter> sortParms,
                                java.lang.String lrAlias)
        Add sorting (order by) for whole-system search to the query
        Parameters:
        query -
        sortParms -
        lrAlias -
        Returns:
      • addPagination

        T addPagination​(T query)
        Add pagination (LIMIT/OFFSET) to the query
        Parameters:
        query -
        Returns:
      • addFilter

        void addFilter​(T currentSubQuery,
                       java.lang.String resourceType,
                       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 -
        resourceType -
        currentParm -
        Throws:
        FHIRPersistenceException
      • addWholeSystemDataFilter

        T addWholeSystemDataFilter​(T query,
                                   java.lang.String resourceType,
                                   java.util.List<java.lang.Long> logicalResourceIds)
                            throws FHIRPersistenceException
        Parameters:
        query -
        resourceType -
        logicalResourceIds -
        Returns:
        Throws:
        FHIRPersistenceException