Skip to main content

search_plan

How a FHIR R4 search is to be run, decided before it is sent.

Module​

Functions​

search_filters​

def search_filters(    search_params: Mapping[str, str | Sequence[str]], codes: Sequence[str] | None,) ‑> SearchFilters:

Which of the searches for a resource type search_params make.

The same for every patient, so a search's timeouts can be counted across patients apart from the type's other searches. Every filter param counts by name; code and category count by value too, as they pick what a search is for. Droppable params are left out: dropping one retries the same search.

Arguments

  • search_params: The search's params.
  • codes: The search's code values, when passed separately.

Classes​

PlanAction​

class PlanAction(*args, **kwds):

What to do with a search.

Attributes

  • SKIP_UNSUPPORTED: Send nothing: the server does not serve the type.
  • SKIP_UNAVAILABLE: Send nothing: the search kept timing out and its recheck is not due. An answer already cached for params is still served, as that costs the server nothing.
  • SPLIT_CODES: Run one search per code: the provider rejects a list.
  • RUN: Send params.

Ancestors​

Variables​

  • static RUN
  • static SKIP_UNAVAILABLE
  • static SKIP_UNSUPPORTED
  • static SPLIT_CODES

SearchPlan​

class SearchPlan(    action: PlanAction,    filters: SearchFilters = (),    params: Mapping[str, str | Sequence[str]] = {},    droppable: tuple[str, ...] = (),    left_off: tuple[str, ...] = (),):

How a search is to be run.

Arguments

  • action: What to do with the search.
  • filters: Which of the type's searches it is (see search_filters); empty for a type skipped as unsupported.
  • params: What to send, for RUN; for SKIP_UNAVAILABLE, what would be sent.
  • droppable: The params, in the order to try them, that may be dropped and the search retried without them if it fails, for RUN and SKIP_UNAVAILABLE.
  • left_off: The droppable params left out of params because the server is known to reject them, for RUN and SKIP_UNAVAILABLE.

Variables​

  • droppable : tuple[str, ...]
  • filters : SearchFilters
  • left_off : tuple[str, ...]
  • params : Mapping[str, str | Sequence[str]]