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 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