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
|
|
@ -274,6 +274,8 @@ export interface LabResultListParams {
|
|||
q?: string;
|
||||
test_code?: string;
|
||||
flag?: string;
|
||||
flags?: string[];
|
||||
without_flag?: boolean;
|
||||
from_date?: string;
|
||||
to_date?: string;
|
||||
latest_only?: boolean;
|
||||
|
|
@ -295,6 +297,10 @@ export function getLabResults(
|
|||
if (params.q) q.set("q", params.q);
|
||||
if (params.test_code) q.set("test_code", params.test_code);
|
||||
if (params.flag) q.set("flag", params.flag);
|
||||
if (params.flags?.length) {
|
||||
for (const flag of params.flags) q.append("flags", flag);
|
||||
}
|
||||
if (params.without_flag != null) q.set("without_flag", String(params.without_flag));
|
||||
if (params.from_date) q.set("from_date", params.from_date);
|
||||
if (params.to_date) q.set("to_date", params.to_date);
|
||||
if (params.latest_only != null) q.set("latest_only", String(params.latest_only));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue