Skip to main content

Module params

Module params 

Source
Expand description

Shared SoF v2 $viewdefinition-run parameter extraction.

Both the REST handler in helios-rest and the standalone sof-server walk a FHIR Parameters body for the same set of operation parameters (_format, _limit, _since, patient, group, viewResource, viewReference, resource, header, plus the Parquet options). This module owns the field-name list and the accepted JSON shapes so a new parameter name only needs to be added in one place.

The extractor is permissive: missing / wrong-typed value[X] fields produce None/empty rather than an error. Strict callers (sof-server) run an additional validation pass on the same JSON for bounds checks (e.g. _limit upper bound, compression allowed values).

Structs§

ExtractedRunParams
SoF v2 $viewdefinition-run parameters lifted out of a JSON Parameters resource. Scalar fields hold the first occurrence; patient, group, inline_resources collect every entry (spec is 0..*).

Functions§

body_has_view_definition
Returns true when body carries a ViewDefinition the caller can run directly — either a bare ViewDefinition resource or a Parameters body with a viewResource or viewReference parameter.
extract_run_params_from_json
Walks a JSON Parameters body (or any object with a parameter array) and pulls every SoF v2 run-operation field into ExtractedRunParams.
split_csv_refs
Splits a comma-separated reference string into trimmed, non-empty entries. Used by both sof-server and HFS REST to lower a single ?group=Group/a,Group/b query value into the spec’s 0..* shape. Returns an empty Vec when the input is None or yields no non-empty entries.