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:codesearch values; resources matching any of them are returned. Cannot be combined with acodekey inparams.retry_without_params: Keys ofparamsthat may be dropped and the search retried without them if the server rejects them. Each must be one ofDROPPABLE_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: Whencodesis given andparamsalso hascode, or whenretry_without_paramsnames a param not inDROPPABLE_PARAMS.
Variables
-
codes : tuple[str, ...]
-
entered_in_error_hint : bool
-
missing_resource_as_empty : bool
-
params : Mapping[str, str | collections.abc.Sequence[str]]
-
resource_type : str
-
retry_without_params : tuple[str, ...]
-
search_failure_as_empty : bool