feat: add get_alerts query to LabResultWatcherWorkflow
Build Agents Runtime / build (push) Successful in 1m26s
Details
Build Agents Runtime / build (push) Successful in 1m26s
Details
This commit is contained in:
parent
a3b214855d
commit
fe73cad4e8
|
|
@ -58,6 +58,7 @@ class LabResultWatcherWorkflow:
|
|||
def __init__(self) -> None:
|
||||
self._pending_lab_results = []
|
||||
self._is_discharged = False
|
||||
self._alerts = []
|
||||
|
||||
@workflow.signal
|
||||
def add_lab_result(self, result: str) -> None:
|
||||
|
|
@ -67,6 +68,10 @@ class LabResultWatcherWorkflow:
|
|||
def discharge_patient(self) -> None:
|
||||
self._is_discharged = True
|
||||
|
||||
@workflow.query
|
||||
def get_alerts(self) -> list:
|
||||
return self._alerts
|
||||
|
||||
@workflow.run
|
||||
async def run(self, baseline_data: dict) -> dict:
|
||||
"""
|
||||
|
|
@ -103,6 +108,7 @@ class LabResultWatcherWorkflow:
|
|||
anomaly_report,
|
||||
start_to_close_timeout=timedelta(minutes=1)
|
||||
)
|
||||
self._alerts.append(anomaly_report)
|
||||
alerts_triggered += 1
|
||||
|
||||
return {
|
||||
|
|
|
|||
Loading…
Reference in New Issue