Home Health Management API

Smarrtpad Home Health Management API

A Django REST Framework API for a home health agency: caregiver and patient records, visit scheduling with task checklists, medication tracking, a GeoDjango-backed caregiver-matching engine, geofenced mobile check-in/check-out with vitals and ADL capture, caregiver payroll, billing and A/R with payer scorecard reporting, caregiver productivity reporting, and office-to-caregiver messaging with push notifications.

What the API supports

Every area below is fully documented (fields, choices, request/response shapes) in Swagger — this page covers the why and the recommended flow.

Caregiver & Patient Records

Full CRUD for caregiver and patient profiles plus their lookup tables — certifications, skills, languages, ADL definitions, medications, insurance, emergency contacts, and more.

/api/caregiver/* /api/patient/*

Caregiver Matching Engine

Ranks qualifying caregivers for a patient by proximity, availability, and preference fit. Hard filters (active, territory, availability overlap) run first; a transparent 5-factor, 100-point score ranks the rest. Race, ethnicity, and nationality are deliberately excluded from scoring.

GET /api/scheduling/patients/<id>/match-caregivers/

Visit Check-In / Check-Out & Geofencing

Turns a scheduled visit into a GPS-verified worked shift. Idempotent via a client-generated event id; out-of-geofence readings are soft-flagged, never hard-blocked, and held out of payroll until staff review.

POST /api/scheduling/visits/<id>/check-in/ POST /api/scheduling/visits/<id>/check-out/ POST /api/scheduling/visits/<id>/review-geofence/

Vitals & ADL Capture

Structured vitals readings and ADL-performed outcomes logged against a visit, separate from the freeform task checklist. Abnormal vitals are flagged automatically.

/api/scheduling/vitals/ /api/scheduling/visit-adl-results/

Payroll

System-of-record for hours worked and gross pay: caregiver pay rates, per-caregiver timesheets with an approve/adjust/dispute workflow, and a CSV export for an external payroll processor.

/api/payroll/pay-rates/ /api/payroll/pay-periods/ /api/payroll/timesheets/ /api/payroll/timesheet-entries/

Billing & A/R

System-of-record for charges, claims, and payments — not a clearinghouse. Charges generate from completed visits, bundle into claims, and export as CSV; payments/denials/appeals resolve A/R, tracked via an aging report and a per-payer scorecard.

/api/billing/charges/ /api/billing/claims/ /api/billing/payments/ /api/billing/ar-aging/ /api/billing/payer-scorecard/

Reporting

Cross-visit caregiver productivity metrics — no data model of its own, purely aggregation over existing scheduling/payroll data (visits, tasks, vitals, ADLs, check events, timesheets, match-log shortlists).

GET /api/reporting/caregiver-productivity/

Messaging

Office-to-caregiver chat over plain REST + polling, with Firebase push notifications on every new message so clients don’t need to poll aggressively.

/api/messaging/conversations/ /api/messaging/messages/ /api/auth/device-tokens/

Authentication

Stateless JWT (djangorestframework-simplejwt) — a Bearer token, not cookies/sessions. Every endpoint except the token endpoint requires it.

  1. Get a tokenPOST /api/auth/token/ with a username/password, get back a 30-minute access and a 14-day refresh token.
  2. Use it — send Authorization: Bearer <access> on every request. Refresh via POST /api/auth/token/refresh/ when it expires.
  3. Check who you areGET /api/auth/me/ returns your profile, groups, and derived role (caregiver / patient / staff).
POST /api/auth/token/
Content-Type: application/json

{"username": "danielle.johnson", "password": "TestPass123!"}

→ {"refresh": "eyJhbGci...", "access": "eyJhbGci..."}

GET /api/caregiver/caregivers/
Authorization: Bearer <access>

No client needed to try it live — Swagger UI at /api/docs/ has its own "Authorize" button that applies a Bearer token to every "Try it out" call on the page.

Guides

Deep-dive documentation for the less obvious parts of the system.

Caregiver Matching Engine Hard filters, the 5-factor scoring breakdown, and what’s deliberately excluded from ranking.
Visit Check-In / Check-Out & Geofencing The recommended mobile flow, idempotency, and why geofence breaches are a soft flag.
Vitals & ADL Capture Structured clinical capture during an in-progress visit.
Payroll: Pay Rates, Timesheets & Export From rate to approved timesheet to CSV handoff, and who can see what.
Billing & A/R Charge generation, claim bundling/submission, payments/denials/appeals, A/R aging, and the payer scorecard — plus the deliberate v1 simplifications.
Reporting: Caregiver Productivity A pure aggregation endpoint over existing visit/task/vitals/payroll data — no new models.
Messaging: Office Chat Push registration, starting a conversation, and sending messages the right way.