Skip to content

About

A working demo of a HIPAA-conscious Provider Operations Platform for a Medicaid provider agency, built to replace manual spreadsheet and email based billing approval with one auditable system.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Provider Ops: Provider Operations Platform

A working demo of a HIPAA-conscious Provider Operations Platform for a Medicaid provider agency, built to replace manual spreadsheet and email based billing approval with one auditable system.

Demo video

A captioned, end to end walkthrough of the full workflow, roughly 105 seconds. Billing Staff imports a batch from CSV, QP reviews and approves, Program Director gives secondary approval, Billing Staff runs the billing and payroll exports, and Admin checks the audit log, users, and members, with a light/dark theme toggle at the end.

The inline player above points at the file's raw.githubusercontent.com URL rather than a repo-relative path: GitHub's README renderer resolves a relative src to the file's /blob/ page (an HTML wrapper, not the video itself), which a <video> tag can't play, while the raw URL serves the actual video/mp4 content GitHub's player can stream. It plays on GitHub once pushed to the main branch, and in local Markdown viewers that render raw HTML (VS Code's preview, most static-site generators) as long as there's network access to fetch it.

See SPEC.md for the full domain specification, SOLUTION_REPORT.md for the narrative writeup of what was built and why, HIPAA_COMPLIANCE.md for what's actually implemented against the HIPAA Security Rule versus what remains a deployment or organizational responsibility, and CLOUD_HOSTING.md for the recommended AWS deployment architecture.

What this is

The platform takes weekly Therap billing data through the full operational lifecycle: import, member and authorization matching, automated compliance checks, Qualified Professional review and correction, tiered approval, and billing/payroll export, with a complete, immutable audit trail at every step.

This is a demo scoped to prove out that workflow end to end, built to the same standard the production system would need, not a throwaway prototype.

Stack

Layer Technology
Frontend Next.js (App Router), TypeScript, Tailwind CSS, shadcn/ui, next-themes
Backend FastAPI, Python 3.12, Pydantic, Motor (async MongoDB driver)
Database MongoDB
Auth OAuth2 password flow issuing JWT bearer tokens, role based access control
Tooling uv, ruff, mypy (strict), pytest, pnpm, Prettier

Project layout

backend/     FastAPI application, uv managed
  app/
    core/          settings, security (JWT, password hashing), logging
    db/             Mongo connection
    models/         domain models, each with a query safe Field enum
    repositories/    one per Mongo collection
    services/        business logic: compliance rules, billing workflow, audit
    api/             routes and dependency wiring
  tests/
    unit_tests/          pure logic, no I/O
    integration_tests/   full HTTP + real MongoDB, per SPEC section 5 workflow

frontend/    Next.js application, pnpm managed
  src/
    app/            routes
    components/      UI, including the themed app shell

Getting started

Backend

cd backend
uv sync
cp .env.example .env   # point at your MongoDB instance
uv run uvicorn app.main:app --reload --port 8080

API docs are served at http://localhost:8080/docs once running.

A fresh database has no users to log in with. Seed one per role:

uv run python -m scripts.seed_demo_data

This drops and recreates the whole configured database (MONGODB_DB_NAME), so it always leaves a clean, known demo state; re-run it anytime to reset (including to clear an account lockout from testing). Only point it at a local/demo MongoDB instance. See backend/README.md for the seeded accounts.

Run the checks:

uv run ruff check .
uv run mypy .
uv run pytest

The integration test suite exercises the API against a real MongoDB instance (a throwaway database per test run, dropped afterward), so a MongoDB server reachable at the configured URI is required.

Frontend

cd frontend
pnpm install
pnpm dev
pnpm lint
pnpm format:check
pnpm build

Docker

To run the whole stack (MongoDB, backend, frontend) without installing anything locally:

docker compose up --build

The backend is served at http://localhost:8080 (docs at /docs) and the frontend at http://localhost:3000. Each service also has its own standalone Dockerfile (backend/Dockerfile, frontend/Dockerfile) for deploying independently. docker-compose.yml wires them together for local use only; it is not a production deployment topology (no TLS termination, secrets management, or managed MongoDB).

Why FastAPI and Next.js

The agency's original technology direction (Next.js, TypeScript, Node.js/NestJS, PostgreSQL) is a fully valid path, and the data model and API contracts in this repository are portable to that stack without changes to the domain design. FastAPI and MongoDB are proposed here as an alternative worth evaluating during the demo phase: native async I/O for concurrent billing imports, automatic OpenAPI documentation kept in sync with the code, Pydantic validation as strict as TypeScript's at the API boundary, and a document model that absorbs the real variability in billing, authorization, and consent records without constant migrations. See SOLUTION_REPORT.md for the fuller comparison against NestJS.

Whichever backend framework is ultimately chosen, the RBAC model, audit trail design, and compliance rules in this repository hold.

Engineering approach

A few things worth noting about how this demo was built, since they are the parts that carry over into production:

  • Every mutating action is audited. Corrections, approvals, secondary approvals, and exports all write an immutable audit log entry, and original imported billing data is never overwritten.
  • Access control is enforced twice. Role checks gate each route, and query level scoping (caseload for QPs, team for Program Directors, billing ready records only for Billing Staff) is applied independently, so a scoping bug in one layer does not expose PHI through the other.
  • Accounts lock out after repeated failed logins, and the frontend force signs-out the moment any request comes back 401, rather than leaving a stale session on screen.
  • Email based MFA on login, toggled with MFA_ENABLED (off by default for the demo). A correct password is followed by a time-limited, single-use code sent to the account's email before a token is issued.
  • The app refuses to boot with the placeholder secret key outside ENVIRONMENT=development; see app/core/config.py.
  • Type safety end to end. mypy --strict on the backend, TypeScript on the frontend, and Pydantic models with a query safe Field enum per collection instead of string literals in database queries.
  • Tests exercise real behavior. The integration suite runs the actual workflow (import, matching, correction, primary and secondary approval, export) against a real MongoDB instance, not mocks, so passing tests reflect a working system.

See HIPAA_COMPLIANCE.md for the full picture, including what is explicitly not done yet (moving the session token out of localStorage, TLS termination) so nothing here is overstated.

About

A working demo of a HIPAA-conscious Provider Operations Platform for a Medicaid provider agency, built to replace manual spreadsheet and email based billing approval with one auditable system.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages