Skip to main content

config_base

Shared base behaviour for step configs.

Classes

BlankableDefaultsConfig

class BlankableDefaultsConfig(**data: Any):

A step config where a blanked modeller variable uses the field default.

A template variable the modeller leaves blank arrives here as None. For a field whose "unused" state is None that needs no handling — the field is already optional and a None disables it. This base covers the other case: a field whose unused state is a concrete value (a boolean switch that is off at False, a policy that is permissive at True, a display bound that must stay numeric). Passing the None through would either fail the whole run at config-parse time or, worse, be read as a third state by code expecting two.

Subclasses list those fields in _BLANK_TO_DEFAULT_FIELDS. A null-valued key among them is dropped from the input, so the field's declared default applies. Dropping the key rather than substituting a value keeps one source of truth for the default (the field declaration itself), and leaves every other validation — type, range, requiredness — untouched.

A field whose None carries its own meaning must NOT be listed. The observation fields on EHRQueryConfig are the standing example: there None (unset) widens the fetch to every core FHIR category and [] is a deliberate opt-out, so rewriting the null would change behaviour.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Variables

  • static model_config