Skip to main content

HS.FHIRServer.Storage.Search

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

Property Inventory

Method Inventory

Parameters

parameter DEFAULTCHARSACCENTED = ÀÁÂÃÄÅÇÈÉÊËÌÍÎÏÑÒÓÔÕÖØÙÚÛÜÝàáâãäåçèéêëìíîïñòóôõöøùúûüýÿ;
parameter DEFAULTCHARSUNACCENTED = AAAAAACEEEEIIIINOOOOOOUUUUYaaaaaaceeeeiiiinoooooouuuuyy;

Properties

property queryLevel as %Integer;
Property methods: queryLevelDisplayToLogical(), queryLevelGet(), queryLevelIsValid(), queryLevelLogicalToDisplay(), queryLevelNormalize(), queryLevelSet()
Property methods: strategyGet(), strategyGetSwizzled(), strategyIsValid(), strategyNewObject(), strategySet()

Methods

classmethod DecrementDateTime(pDateTime As %String) as %String
Must be overridden by the subclass Returns true if the given search parameter on the given resource type searches of property of type Period, and false otherwise. pParamName must be the name of the search parameter as it appears in the parameter definition, *not* the param name normalized via NormalizeParamName(). ie, "date-recorded", not "dateRecorded". If a search parameter searches more than one property, this will return true if any of them is a Period. For example, the "date" parameter on Procedure searches two properties, performedDateTime and performedPeriod. performedPeriod is a Period, so this method returns true for that parameter. Given a date or date-time, decrement it by one of whatever the precision is. For example, "1932" returns "1931". "1985-01" returns "1984-12". "2000-05-25T15:45Z" returns "2000-05-25T15:44Z". Valid input formats are:
YYYY
YYYY-MM
YYYY-MM-DD
YYYY-MM-DDThh:mmZ
YYYY-MM-DDThh:mm:ssZ
pDateTime is assumed to be valid and in UTC when applicable. ie, should have already had ValidateDate() called on it.
method FindRevIncludedResources(pIncludeEntry As HS.FHIRServer.SearchParam, qlevel As %Integer, pTargetType As %String)
classmethod GetFirstInCollection(coll As %List) as %String [ SQLProc = ListFirst ]
Projected as the stored procedure: ListFirst
classmethod GetLastInCollection(coll As %List) as %String [ SQLProc = ListLast ]
Projected as the stored procedure: ListLast
classmethod GetPatientCompartmentId(compartments As %List) as %String [ SQLProc = MPIID ]
Projected as the stored procedure: MPIID
classmethod IncrementDateTime(pDateTime As %String) as %String
Given a date or date-time, increment it by one of whatever the precision is. For example, "1932" returns "1933". "1985-12" returns "1986-01". "2000-05-25T15:45Z" returns "2000-05-25T15:46Z". Valid input formats are:
YYYY
YYYY-MM
YYYY-MM-DD
YYYY-MM-DDThh:mmZ
YYYY-MM-DDThh:mm:ssZ
pDateTime is assumed to be valid and in UTC when applicable. ie, should have already had ValidateDate() called on it.
classmethod NormalizeAccents(pVal As %String) as %String
Inherited description: @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, ByRef pRevIncludeArr, ByRef pIncludeIterArr, ByRef pIterateConfig)
Inherited description: @API This method is called during Search processing, after the primary resource search is complete. It is responsible for finding and adding any included resources to the result set @Input pResultSet The result of the primary resource search to be enhanced with included resources @Input pIncludeArr A multidimensional structure describing the requested includes. The structure is pIncludeArr = # of entries pIncludeArr(n) An OREF of the 'reference' type SearchParam whose references will be included pIncludeArr(n, "targetType") The specific resource type to be included (if any, otherwise all referenced resources will be included) @Input pRevIncludeArr A multidimensional structure describing the requested reverse includes pRevIncludeArr = # of entries pRevIncludeArr(n) An OREF of the 'reference' type SearchParam that is referencing a primary resource @Input pIncludeIterArr A multidimensional structure describing the requested include:iterates. The structure is pIncludeIterArr = # of entries pIncludeIterArr(n) An OREF of the 'reference' type SearchParam whose references will be included pIncludeIterArr(n, "targetType") The specific resource type to be included (if any, otherwise all reference resources will be included) pIncludeIterArr("types") An array of those resource types which form the base for any include:iterate requests @Input pIterateConfig A multidimensional structure describing the configuration data needed to query for include:iterate requests
method WhereClause(pParentTableName As %String, pSearchColumn As HS.FHIRServer.Storage.Json.SearchColumn, pModifier As %String, pVals As HS.FHIRServer.API.SearchQueryParameter, ByRef pSQLParams, pBaseURL As %String = "") as %String
method WhereDate(pParentTableName As %String, pSearchColumn As HS.FHIRServer.Storage.Json.SearchColumn, pModifier As %String, pValue As HS.FHIRServer.API.SearchQueryParameter, ByRef pSQLParams) as %String
method WhereNumber(pParentTableName As %String, pSearchColumn As HS.FHIRServer.Storage.Json.SearchColumn, pModifier As %String, pValue As HS.FHIRServer.API.SearchQueryParameter, ByRef pSQLParams) as %String
method WhereQuantity(pParentTableName As %String, pSearchColumn As HS.FHIRServer.Storage.Json.SearchColumn, pModifier As %String, pValue As HS.FHIRServer.API.SearchQueryParameter, ByRef pSQLParams) as %String
method WhereReference(pParentTableName As %String, pSearchColumn As HS.FHIRServer.Storage.Json.SearchColumn, pModifier As %String, pValue As HS.FHIRServer.API.SearchQueryParameter, ByRef pSQLParams, pBaseURL As %String = "", pDisableAbsoluteRef As %Boolean = 0) as %String
WhereReference generates SQL query WHERE clause pieces for 'reference' type search parameters. http://hl7.org/fhir/search.html#reference

Handling of search by absolute URLs is included here, and can be toggled via the pDisableAbsoluteRef input parameter.
method WhereString(pParentTableName As %String, pSearchColumn As HS.FHIRServer.Storage.Json.SearchColumn, pModifier As %String, pValue As HS.FHIRServer.API.SearchQueryParameter, ByRef pSQLParams) as %String
method WhereToken(pParentTableName As %String, pSearchColumn As HS.FHIRServer.Storage.Json.SearchColumn, pModifier As %String, pValue As HS.FHIRServer.API.SearchQueryParameter, ByRef pSQLParams) as %String
method WhereURI(pParentTableName As %String, pSearchColumn As HS.FHIRServer.Storage.Json.SearchColumn, pModifier As %String, pValue As HS.FHIRServer.API.SearchQueryParameter, ByRef pSQLParams) as %String
abstract method findSearchColumn(resourceType As %String, paramName As %String) as HS.FHIRServer.Storage.Json.SearchColumn
abstract method getSearchColumn(resourceType As %String, paramName As %String) as HS.FHIRServer.Storage.Json.SearchColumn
abstract method getTableForResourceType(resourceType As %String) 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' 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 nextQueryLevel() as %Integer
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