The hospital test follows the Gobernanza buttons: analyze, train, promote, score, then checks the risk analyses

This commit is contained in:
2026-12-01 17:48:03 -06:00
parent c326f4901d
commit 9b631928ad
+8 -2
View File
@@ -59,7 +59,7 @@ def _sensor_run(api: httpx.Client, seconds: int = 300) -> str:
def _train_tea(api: httpx.Client) -> None: def _train_tea(api: httpx.Client) -> None:
_wait(api, _ok(api.post("/tea/eegs/analyze", json={}))["run_id"]) _wait(api, _ok(api.post("/models/tea/analyze", json={}))["run_id"])
for names in (list(MODELS), [ASSOCIATION]): for names in (list(MODELS), [ASSOCIATION]):
training = _ok( training = _ok(
api.post( api.post(
@@ -88,7 +88,13 @@ def _train_tea(api: httpx.Client) -> None:
v["version"] == version and v["status"] == "champion" v["version"] == version and v["status"] == "champion"
for v in _ok(api.get(versions)) for v in _ok(api.get(versions))
), name ), name
_wait(api, _ok(api.post("/tea/eegs/analyze", json={}))["run_id"]) _wait(api, _ok(api.post("/models/tea/score"))["run_id"])
risks = _ok(
api.get(
"/tea/fhir/Patient", params={"_revinclude": "RiskAssessment:subject", "_count": 500}
)
)
assert any(e["resource"]["resourceType"] == "RiskAssessment" for e in risks["entry"])
@contextmanager @contextmanager