Module schema_manager
pull contents of shared.facility_info from DB and update schema objects
Functions
def format_flattened_summary_values(flat_summary: dict[str, dict[str, vStr]]) ‑> dict[str, dict[str, vStr]]
-
Applies formatting specified in schemaops models to values in a flattened summary object, e.g. an extracted schedule/demographics reference.
Args
flat_summary
- dict of
{'<patient identifier>': {'<jmespath key>': '<value>'}, ...}
Returns
flat_summary with all values properly formatted.
Classes
class FacilityStoreTuple (client_name: str, facility: str, data_entry_fields_config: dict[str, dict[str, typing.Any]], custom_fields_config: list[dict[str, typing.Any]])
-
NamedTuple representation for rows returned by the simple_select() call in SchemaManager.db_pull_overrides()
Ancestors
- builtins.tuple
Instance variables
var client_name : str
-
Alias for field number 0
var custom_fields_config : list[dict[str, typing.Any]]
-
Alias for field number 3
var data_entry_fields_config : dict[str, dict[str, typing.Any]]
-
Alias for field number 2
var facility : str
-
Alias for field number 1
class SchemaManager
-
Pulls shared.facility_info.config from remote DB for current client/facility and updates default schema objects accordingly.
Class variables
var client_name : str
var overrides_applied : str
var overrides_by_facility : dict[str, schema_manager._OverrideEntry]
Methods
def apply_overrides(self, facility: str)
-
update defaults in schemaops.DEFAULT_VALIDATOR for data_entry_fields
def db_pull_overrides(self)
-
update overrides_by_facility and client_name for current client