feat(frontend): improve lab result filter ergonomics
This commit is contained in:
parent
ed547703ad
commit
157cbc425e
7 changed files with 221 additions and 48 deletions
|
|
@ -265,6 +265,7 @@ def list_lab_results(
|
|||
test_code: Optional[str] = None,
|
||||
flag: Optional[ResultFlag] = None,
|
||||
flags: list[ResultFlag] = Query(default_factory=list),
|
||||
without_flag: bool = False,
|
||||
from_date: Optional[datetime] = None,
|
||||
to_date: Optional[datetime] = None,
|
||||
latest_only: bool = False,
|
||||
|
|
@ -287,6 +288,8 @@ def list_lab_results(
|
|||
filters.append(LabResult.flag == flag)
|
||||
if flags:
|
||||
filters.append(col(LabResult.flag).in_(flags))
|
||||
if without_flag:
|
||||
filters.append(col(LabResult.flag).is_(None))
|
||||
if from_date is not None:
|
||||
filters.append(LabResult.collected_at >= from_date)
|
||||
if to_date is not None:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue