How ckwan/note_loop works
NoteLoop is a therapist-facing SOAP progress-note application. A therapist selects a scheduled session, drafts a note from rough notes, edits or requests wording suggestions, reviews and compares the text, then signs; signing locks the note and starts claim processing. The README also documents a parallel pre-sign review workflow and batch resubmission. Those capabilities are represented from documentation where implementation excerpts were unavailable; no review-specific source file appears in the supplied tree. The review and integrations are therefore shown with documented, dashed links where source evidence is absent.
Main entry points: NoteWorkspace.tsx Note workspace · routes.py FastAPI routes · notes.py Note service · llm.py LLM provider and validation
Components 24
Therapist workspace
- Session schedule
web/components/ScheduleList.tsx - Note workspace
web/components/NoteWorkspace.tsx - SOAP editor
web/components/NoteEditor.tsx - Draft comparison
web/components/DiffView.tsx - Audit trail view
web/components/AuditTrail.tsx - Claim status view
web/components/ClaimStatus.tsx - Note status badge
web/components/StatusBadge.tsx - Web API client
web/lib/api.ts
API and note services
- FastAPI routes
backend/app/routes.py - Note service
backend/app/services/notes.py - LLM provider and validation
backend/app/llm.py - Request and note schemas
backend/app/schemas.py - Idempotent signing
backend/app/idempotency.py - Request rate limits
backend/app/ratelimit.py - Pre-sign review
backend/app
Persistent state
- Redis controls
backend/app/redis_client.py - Postgres records
backend/app/models.py
Claim workflows
- Temporal workflows
backend/app/workflows/workflows.py - Workflow starter
backend/app/workflows/starter.py - Claim activities
backend/app/workflows/activities.py - Workflow worker
backend/app/worker.py
External services
- Simulated payer
- LLM service
Other components
- Therapist
Connections 29
- Therapist → Session schedule: opens sessions
README.md - Session schedule → Web API client: loads schedule
- Note workspace → Web API client: requests note actions
web/components/NoteWorkspace.tsx - Note workspace → SOAP editor: renders
web/components/NoteWorkspace.tsx - Note workspace → Draft comparison: renders
web/components/NoteWorkspace.tsx - Note workspace → Audit trail view: renders
web/components/NoteWorkspace.tsx - Note workspace → Claim status view: renders
web/components/NoteWorkspace.tsx - Note workspace → Note status badge: renders
web/components/NoteWorkspace.tsx - Web API client → FastAPI routes: sends API requests
- FastAPI routes → Note service: delegates note actions
backend/app/routes.py - FastAPI routes → Idempotent signing: runs sign once
backend/app/routes.py - FastAPI routes → Request rate limits: checks request limits
backend/app/routes.py - Request rate limits → Redis controls: uses counters
backend/app/routes.py - Note service → LLM provider and validation: requests and parses text
backend/app/services/notes.py - LLM provider and validation → Request and note schemas: validates SOAP reply
backend/app/llm.py - LLM provider and validation → LLM service: calls model
- Note service → Postgres records: reads and writes notes
backend/app/services/notes.py - Idempotent signing → Note service: performs sign transaction
backend/app/idempotency.py - Therapist → Pre-sign review: reviews proposed fixes
README.md - FastAPI routes → Pre-sign review: runs pre-sign review
README.md - Pre-sign review → LLM provider and validation: requests reviewers and fixes
README.md - Pre-sign review → Postgres records: saves checkpoints
README.md - FastAPI routes → Workflow starter: starts signed or batch run
backend/app/routes.py - Workflow starter → Temporal workflows: starts workflow
backend/app/workflows/starter.py - Workflow worker → Temporal workflows: registers workflows
backend/app/worker.py - Temporal workflows → Claim activities: executes activities
backend/app/workflows/workflows.py - Claim activities → Postgres records: updates claims and audit
backend/app/workflows/activities.py - Claim activities → Simulated payer: submits claim
backend/app/workflows/activities.py - Temporal workflows → Claim activities: fetches failed claims
backend/app/workflows/workflows.py