Class SearchParameterMap

java.lang.Object
ca.uhn.fhir.jpa.searchparam.SearchParameterMap
All Implemented Interfaces:
Serializable

public class SearchParameterMap extends Object implements Serializable
See Also:
  • Field Details

  • Constructor Details

  • Method Details

    • clone

      Creates and returns a copy of this map
      Overrides:
      clone in class Object
    • getSummaryMode

      public ca.uhn.fhir.rest.api.SummaryEnum getSummaryMode()
    • setSummaryMode

      public void setSummaryMode(ca.uhn.fhir.rest.api.SummaryEnum theSummaryMode)
    • getSearchTotalMode

      public ca.uhn.fhir.rest.api.SearchTotalModeEnum getSearchTotalMode()
    • setSearchTotalMode

      public void setSearchTotalMode(ca.uhn.fhir.rest.api.SearchTotalModeEnum theSearchTotalMode)
    • add

      public SearchParameterMap add(String theName, ca.uhn.fhir.rest.param.DateParam theDateParam)
    • add

      public SearchParameterMap add(String theName, ca.uhn.fhir.model.api.IQueryParameterAnd<?> theAnd)
    • add

      public SearchParameterMap add(String theName, ca.uhn.fhir.model.api.IQueryParameterOr<?> theOr)
    • values

      public Collection<List<List<ca.uhn.fhir.model.api.IQueryParameterType>>> values()
    • add

      public SearchParameterMap add(String theName, ca.uhn.fhir.model.api.IQueryParameterType theParam)
    • addInclude

      public SearchParameterMap addInclude(ca.uhn.fhir.model.api.Include theInclude)
    • addRevInclude

      public SearchParameterMap addRevInclude(ca.uhn.fhir.model.api.Include theInclude)
    • getCount

      public Integer getCount()
    • setCount

      public SearchParameterMap setCount(Integer theCount)
    • getOffset

      public Integer getOffset()
    • setOffset

      public void setOffset(Integer theOffset)
    • getEverythingMode

    • setEverythingMode

      public void setEverythingMode(SearchParameterMap.EverythingModeEnum theConsolidateMatches)
    • getIncludes

      public Set<ca.uhn.fhir.model.api.Include> getIncludes()
    • setIncludes

      public void setIncludes(Set<ca.uhn.fhir.model.api.Include> theIncludes)
    • getLastUpdated

      public ca.uhn.fhir.rest.param.DateRangeParam getLastUpdated()
      Returns null if there is no last updated value
    • setLastUpdated

      public void setLastUpdated(ca.uhn.fhir.rest.param.DateRangeParam theLastUpdated)
    • getLoadSynchronousUpTo

      If set, tells the server to load these results synchronously, and not to load more than X results
    • setLoadSynchronousUpTo

      public SearchParameterMap setLoadSynchronousUpTo(Integer theLoadSynchronousUpTo)
      If set, tells the server to load these results synchronously, and not to load more than X results. Note that setting this to a value will also set setLoadSynchronous(boolean) to true
    • getRevIncludes

      public Set<ca.uhn.fhir.model.api.Include> getRevIncludes()
    • setRevIncludes

      public void setRevIncludes(Set<ca.uhn.fhir.model.api.Include> theRevIncludes)
    • getSort

      public ca.uhn.fhir.rest.api.SortSpec getSort()
    • setSort

      public SearchParameterMap setSort(ca.uhn.fhir.rest.api.SortSpec theSort)
    • isLoadSynchronous

      public boolean isLoadSynchronous()
      If set, tells the server to load these results synchronously, and not to load more than X results
    • setLoadSynchronous

      public SearchParameterMap setLoadSynchronous(boolean theLoadSynchronous)
      If set, tells the server to load these results synchronously, and not to load more than X results
    • isLastN

      public boolean isLastN()
      If set, tells the server to use an Elasticsearch query to generate a list of Resource IDs for the LastN operation
    • setLastN

      public SearchParameterMap setLastN(boolean theLastN)
      If set, tells the server to use an Elasticsearch query to generate a list of Resource IDs for the LastN operation
    • getLastNMax

      public Integer getLastNMax()
      If set, tells the server the maximum number of observations to return for each observation code in the result set of a lastn operation
    • setLastNMax

      public SearchParameterMap setLastNMax(Integer theLastNMax)
      If set, tells the server the maximum number of observations to return for each observation code in the result set of a lastn operation
    • toNormalizedQueryString

      public String toNormalizedQueryString(ca.uhn.fhir.context.FhirContext theCtx)
      This method creates a URL query string representation of the parameters in this object, excluding the part before the parameters, e.g.

      ?name=smith&_sort=Patient:family

      This method excludes the _count parameter, as it doesn't affect the substance of the results returned

    • hasIncludes

      public boolean hasIncludes()
      Since:
      5.5.0
    • hasRevIncludes

      public boolean hasRevIncludes()
      Since:
      6.2.0
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • clean

      public void clean()
    • getNearDistanceParam

      public ca.uhn.fhir.rest.param.QuantityParam getNearDistanceParam()
    • setNearDistanceParam

      public void setNearDistanceParam(ca.uhn.fhir.rest.param.QuantityParam theQuantityParam)
    • isWantOnlyCount

      public boolean isWantOnlyCount()
    • isDeleteExpunge

      public boolean isDeleteExpunge()
    • setDeleteExpunge

      public SearchParameterMap setDeleteExpunge(boolean theDeleteExpunge)
    • get

      public List<List<ca.uhn.fhir.model.api.IQueryParameterType>> get(String theName)
    • put

      public void put(String theName, List<List<ca.uhn.fhir.model.api.IQueryParameterType>> theParams)
    • containsKey

      public boolean containsKey(String theName)
    • keySet

      public Set<String> keySet()
    • isEmpty

      public boolean isEmpty()
    • entrySet

      public Set<Map.Entry<String,List<List<ca.uhn.fhir.model.api.IQueryParameterType>>>> entrySet()
    • remove

      public List<List<ca.uhn.fhir.model.api.IQueryParameterType>> remove(String theName)
    • removeByNameUnmodified

      public List<List<ca.uhn.fhir.model.api.IQueryParameterType>> removeByNameUnmodified(String theName)
      Variant of removeByNameAndModifier for unmodified params.
      Parameters:
      theName - the query parameter key
      Returns:
      an And/Or List of Query Parameters matching the name with no modifier.
    • removeByNameAndModifier

      public List<List<ca.uhn.fhir.model.api.IQueryParameterType>> removeByNameAndModifier(String theName, String theModifier)
      Given a search parameter name and modifier (e.g. :text), get and remove all Search Parameters matching this name and modifier
      Parameters:
      theName - the query parameter key
      theModifier - the qualifier you want to remove - nullable for unmodified params.
      Returns:
      an And/Or List of Query Parameters matching the qualifier.
    • removeByNameAndModifier

      public List<List<ca.uhn.fhir.model.api.IQueryParameterType>> removeByNameAndModifier(String theName, @Nonnull ca.uhn.fhir.rest.param.TokenParamModifier theModifier)
    • removeByQualifier

      public Map<String,List<List<ca.uhn.fhir.model.api.IQueryParameterType>>> removeByQualifier(String theQualifier)
      For each search parameter in the map, extract any which have the given qualifier. e.g. Take the url: Observation?code:text=abcinvalid input: '&code'=123invalid input: '&code':text=definvalid input: '&reason':text=somereason

      If we call this function with `:text`, it will return a map that looks like:

      code -> [[code:text=abc], [code:text=def]] reason -> [[reason:text=somereason]]

      and the remaining search parameters in the map will be:

      code -> [[code=123]]

      Parameters:
      theQualifier -
      Returns:
    • removeByQualifier

      public Map<String,List<List<ca.uhn.fhir.model.api.IQueryParameterType>>> removeByQualifier(@Nonnull ca.uhn.fhir.rest.param.TokenParamModifier theModifier)
    • size

      public int size()
    • getSearchContainedMode

      public ca.uhn.fhir.rest.api.SearchContainedModeEnum getSearchContainedMode()
    • setSearchContainedMode

      public void setSearchContainedMode(ca.uhn.fhir.rest.api.SearchContainedModeEnum theSearchContainedMode)
    • isOffsetQuery

      public boolean isOffsetQuery()
      Returns true if getOffset() and getCount() both return a non null response
      Since:
      5.5.0
    • newSynchronous

    • newSynchronous

      public static SearchParameterMap newSynchronous(String theName, ca.uhn.fhir.model.api.IQueryParameterType theParam)
    • getAllChainsInOrder

      public List<ca.uhn.fhir.rest.api.SortSpec> getAllChainsInOrder()