Skip to main content

search_spec

One FHIR search, as data.

Classes​

SearchSpec​

class SearchSpec(    resource_type: str,    params: Mapping[str, str | Sequence[str]],    codes: tuple[str, ...] = (),    retry_without_params: tuple[str, ...] = (),    entered_in_error_hint: bool = False,    missing_resource_as_empty: bool = False,    search_failure_as_empty: bool = False,):

One FHIR search, as data.

Arguments

  • resource_type: The type of FHIR resource to search for.
  • params: JSON-serializable search parameters.
  • codes: code search values; resources matching any of them are returned. Cannot be combined with a code key in params.
  • retry_without_params: Keys of params that may be dropped and the search retried without them if the server rejects them. Each must be one of DROPPABLE_PARAMS. A dropped parameter stays off later searches while the server's 4xx refusal of it stands; one dropped for any other failure stays off until its recheck is due (FIRST_RECHECK_AFTER).
  • entered_in_error_hint: Whether the caller filters out entered-in-error resources itself, so the search may ask the server to leave them out (status__not=entered-in-error) where the provider profile allows.
  • missing_resource_as_empty: Whether a 404 or an unsupported type answers an empty list instead of raising.
  • search_failure_as_empty: Whether a search that failed outright answers an empty list instead of raising. Pass it only where a partial result is the point, as in the JSON dump (produce_json_dump).

Raises

  • ValueError: When codes is given and params also has code, or when retry_without_params names a param not in DROPPABLE_PARAMS.

Variables​

  • codes : tuple[str, ...]
  • entered_in_error_hint : bool
  • missing_resource_as_empty : bool
  • resource_type : str
  • retry_without_params : tuple[str, ...]
  • search_failure_as_empty : bool