Patient status + snapshots
Two lightweight APIs: one row per patient snapshot (with SOC/discharge/referral dates) and one row per patient for their latest status. Use the links below to explore filters and schemas in Swagger, Redoc, or the browsable API.
Tip: hit the OPTIONS action on each endpoint to see the Django filterset and available query parameters.
Patient snapshots
Denormalized rows per admit with SOC/discharge/referral dates and discharge-by-death flags.
- Best for: outreach lists, SOC/discharge trend slices, date-windowed pulls.
- Filters: status (CSV or repeated), agency/team, discharge_by_death, missing/exclude phone, SOC/discharge/referral date ranges, pagination (UI caps at 500; API clients can request larger).
- Fields: patient_id/mrn, status, agency/team, location, dates, is_discharge_by_death, email/phone when available.
- Open browsable endpoint
Current patient status
One row per patient (latest admit) with status classification and facility/location context.
- Best for: current census, "who is Active/Discharged/NTUC", and MRN lookups.
- Filters: status (CSV or repeated), agency, patient_id (MRN), pagination (UI caps at 200; API clients can request larger).
- Fields: status + classification, NTU status (non-admit reason) when present, agency/team, location/county/facility, referral/admit/discharge dates, phone/email when present.
- Open browsable endpoint
How to explore
- Swagger & Redoc show schemas, security, and every filter/query param.
- Browsable API is fastest for live responses; use
OPTIONSthere for filterset details. - Auth: admins can browse while signed in; otherwise send
X-Api-Key: <raw_key>or?api_key=for UI-driven requests. - Create keys:
poetry run python manage.py create_api_key --name "analytics-client"and store the printed key securely. - Test keys: mark a key as test-only to cap sample responses (defaults to
200records, configurable viaAPI_TEST_MAX_RESULTS).
Snapshots are episode-level records with date filters; status collapses to one latest episode per MRN with a status classification.
Both endpoints publish Django filtersets, so the browsable API OPTIONS action and docs UIs will list the exact filters you can send.
Pick Swagger/Redoc for shapes, or jump straight into the browsable endpoints to try filters with your API key. Use pagination for larger pulls.