Skip to main content

HS.FHIRServer.Storage.JsonAdvSQL.Search

abstract class HS.FHIRServer.Storage.JsonAdvSQL.Search extends %Library.RegisteredObject, HS.FHIRServer.API.Interactions, HS.FHIRServer.Util.FHIRQueryUtils

Property Inventory

Method Inventory

Properties

property JSONSearchColumnContext [ MultiDimensional , Transient ];
Cache info about JSON Search columns needed to generate _revinclude=* queries
Property methods: JSONSearchColumnContextDisplayToLogical(), JSONSearchColumnContextGet(), JSONSearchColumnContextIsValid(), JSONSearchColumnContextLogicalToDisplay(), JSONSearchColumnContextLogicalToOdbc(), JSONSearchColumnContextNormalize(), JSONSearchColumnContextSet()
property SearchContext [ MultiDimensional , Transient ];
useful catch-all for SQL Queries, table aliases, which resource types have been 'included' via _include/_revinclude Structure: SearchContext("matchResourceType", ) = 1 ; used to track which resource types were found in the Match query, used by SearchInclude for wildcard searches SearchContext("includeResourceType", ) = 1 ; used to track which resource types have been included, for use by iterate to avoid unnecessary queries SearchContext("tableAlias") = ; counter that is incremented for each new alias that is created SearchContext("tableAlias", ) = ; cross reference for table names and their alias SearchContext("tableAlias", ) = SearchContext("searchParameters") = ; reference to the HS.FHIRServer.API.Data.QueryParameters passed into the Search() method SearchContext("SELECT") = SearchContext("FROM") = SearchContext("JOIN") = SearchContext("WHERE") = SearchContext("INCLUDE", , , "SELECT") = SearchContext("INCLUDE", , , "FROM") = SearchContext("INCLUDE", , , "JOIN") = SearchContext("INCLUDE", , , "WHERE") = SearchContext("sqlJOINparams") = SearchContext("sqlJOINparams", ) = SearchContext("sqlWHEREparams") = SearchContext("sqlWHEREparams", ) =
Property methods: SearchContextDisplayToLogical(), SearchContextGet(), SearchContextIsValid(), SearchContextLogicalToDisplay(), SearchContextLogicalToOdbc(), SearchContextNormalize(), SearchContextSet()
property isPreferStrictHandling as %Boolean;
Is 'handling=strict' from the Prefer http header
Property methods: isPreferStrictHandlingDisplayToLogical(), isPreferStrictHandlingGet(), isPreferStrictHandlingIsValid(), isPreferStrictHandlingLogicalToDisplay(), isPreferStrictHandlingNormalize(), isPreferStrictHandlingSet()
property queriedResourceTypes as %List;
Property methods: queriedResourceTypesGet(), queriedResourceTypesIsValid(), queriedResourceTypesLogicalToOdbc(), queriedResourceTypesOdbcToLogical(), queriedResourceTypesSet()
property queryLevel as %Integer;
for use when iterating on _include / _revinclude
Property methods: queryLevelDisplayToLogical(), queryLevelGet(), queryLevelIsValid(), queryLevelLogicalToDisplay(), queryLevelNormalize(), queryLevelSet()
Property methods: strategyGet(), strategyGetSwizzled(), strategyIsValid(), strategyNewObject(), strategySet()

Methods

method AddJoinParam(pParam As %String)
method AddQueriedResourceTypes(resourceType As %String)
Allows specific interactions to compile a list of all resource types which are queried for this request (regardless of whether any are actually returned).
method AddWhereParam(pParam As %String)
@API This method performs the requested search for resources and returns a HS.FHIRServer.Util.SearchResult with the selected resource information. If the query specifies _include or _revinclude parameters, then resources of type other than 'pResourceType' will be part of the result set. Included resources will be denoted in the result set 'Mode' column with the value 'include' @Input pResourceType The 'resourceType' of the resource to be searched @Input pCompartmentType If not "", indicates a compartment search of the specified Compartment Type and Id @Input pCompartmentId The ID of the resource comartment being searched @Input pParameters A HS.FHIRServer.API.Data.QueryParameters describing the query parameters specified for the search @Input pSortKeys (ByRef) A multi-dimensional structure describing any sorting to be performed on the result set. The structure of pSortKeys is an array of sort keys indexed 1-n: pSortKeys(n) = 1 for ascending, 0 for descending pSortKeys(n, "SearchParam") = An HS.FHIRServer.SearchParam object whose value is used to sort. @Return A HS.FHIRServer.Util.SearchResult object containing one row for each selected resource. @Throws The implementation must report errors via $$$ThrowStatus.
method SearchIncludes(pResultSet As HS.FHIRServer.Util.SearchResult, ByRef pIncludeArr As %Library.String, ByRef pRevIncludeArr As %Library.String, ByRef pIncludeIterArr As %Library.String, ByRef pIterateConfig As %Library.String)
Combines the queries generated by buildIncludeSelect() and buildRevIncludeSelect() and runs If we have 'iterate' modifier and included resources that match then run SearchIncludes()
method buildIncludeSelect(pResourceType As %String, pParameters As HS.FHIRServer.API.Data.QueryParameters = "")
Generates the SQL statements to select the _include resources
method buildRevIncludeSelect(pResourceType As %String, pParameters As HS.FHIRServer.API.Data.QueryParameters = "")
Generates the SQL statements to select the _revinclude resources
abstract method findSearchColumn(resourceType As %String, paramName As %String) as HS.FHIRServer.Storage.Json.SearchColumn
This method is in the subclass of this (part of the Interactions object)
abstract method getSearchColumn(resourceType As %String, paramName As %String) as HS.FHIRServer.Storage.Json.SearchColumn
abstract method getTableForResourceType(pResourceType As %String, pChildName As %String = "", pShortName As %Boolean = 0) as %String
method isSelectCountAllowed(pResourceType As %String, pCompartment As %String, pCompartmentId As %String, pParameters As HS.FHIRServer.API.Data.QueryParameters = "") as %Boolean
@API.Overridable
Return a Boolean value indicating whether SQL SELECT COUNT for _summary=count or _count=0 is allowed by this implementation.

The default implementation is to return True only if this is the base 'Json/JsonAdvSQL' strategy implementation. If the base implementation is overridden and customized, that implementation must OPT IN to allowing SELECT COUNT by overriding this method and adding their own desired heuristic.
@Input pResourceType The 'resourceType' of the resource to be searched
@Input pCompartmentType If not "", indicates a compartment search of the specified Compartment Type and Id
@Input pCompartmentId The ID of the resource comartment being searched
@Input pParameters A HS.FHIRServer.API.Data.QueryParameters describing the query parameters specified for the search
@Return Boolean value indicating whether using SQL SELECT COUNT is allowed.
method searchColumnFromSearchParam(searchParam As HS.FHIRServer.SearchParam) as HS.FHIRServer.Storage.Json.SearchColumn

Inherited Members

Inherited Properties

Inherited Methods

Subclasses

FeedbackOpens in a new tab