flip_api.cohort_services.get_cohort_query_results
Attributes
Functions
|
Retrieve the aggregated results of a cohort query. |
Module Contents
- flip_api.cohort_services.get_cohort_query_results.router
- flip_api.cohort_services.get_cohort_query_results.get_cohort_query_results(query_id: uuid.UUID = Path(..., description='Unique identifier of the cohort query'), db: sqlmodel.Session = Depends(get_session), user_id: uuid.UUID = Depends(verify_token)) flip_api.domain.schemas.cohort.OmopCohortResultsResponse | fastapi.responses.JSONResponse
Retrieve the aggregated results of a cohort query.
Cohort queries are async: the hub queues tasks for all trusts, each trust runs the query against its OMOP database and posts results back. Until the first trust responds, the query exists but has no stats. This endpoint distinguishes three states:
200 — stats are populated, return them.
202 — query is known but still pending trust responses.
404 — query id is unknown (or access-layer denies it).
- Parameters:
query_id (UUID) – Unique identifier of the cohort query.
db (Session) – Database session dependency.
user_id (UUID) – ID of the user making the request, obtained from authentication.
- Returns:
Results (200) or a pending marker (202).
- Return type:
OmopCohortResultsResponse | JSONResponse