PMSG Platform

Pain Management Support Group Platform

A comprehensive full-stack application for managing an 8-week evidence-based chronic pain management program.

๐ŸŽฏ Project Overview

The PMSG Platform provides: - Patient enrollment and demographic tracking - Evidence-based 8-week curriculum delivery - Validated pain assessments (BPI, ODI) - Session scheduling and attendance management - Longitudinal outcome tracking and analytics - RAG-powered clinical knowledge base

๐Ÿ—๏ธ Architecture

Technology Stack

  • Backend: FastAPI (Python 3.9+), SQLAlchemy, PostgreSQL
  • Frontend: React 18+, Lucide Icons
  • Vector Store: ChromaDB + LangChain
  • Authentication: JWT with bcrypt
  • Deployment: Docker, Google Cloud Platform

Key Components

  1. RESTful API - 45+ endpoints for complete CRUD operations
  2. Clinical Assessments - Automated BPI/ODI scoring
  3. Analytics Engine - Pain trends, outcomes, medication patterns
  4. RAG System - Evidence-based clinical decision support
  5. Role-Based Access - Admin, Facilitator, Participant roles

๐Ÿ“ Project Structure

pmsg-platform/
โ”œโ”€โ”€ backend/                  # FastAPI application
โ”‚   โ”œโ”€โ”€ api/                 # API route handlers
โ”‚   โ”œโ”€โ”€ models/              # SQLAlchemy ORM models
โ”‚   โ”œโ”€โ”€ schemas/             # Pydantic validation schemas
โ”‚   โ”œโ”€โ”€ services/            # Business logic layer
โ”‚   โ””โ”€โ”€ tests/               # Backend test suite
โ”‚
โ”œโ”€โ”€ frontend/                # React application
โ”‚   โ””โ”€โ”€ src/
โ”‚       โ”œโ”€โ”€ components/      # React components
โ”‚       โ”œโ”€โ”€ services/        # API client
โ”‚       โ””โ”€โ”€ utils/           # Helper functions
โ”‚
โ”œโ”€โ”€ docs/                    # Documentation
โ”‚   โ”œโ”€โ”€ curriculum/          # 8-week program content
โ”‚   โ””โ”€โ”€ technical/           # Technical specifications
โ”‚
โ””โ”€โ”€ deployment/              # Infrastructure configs
    โ”œโ”€โ”€ docker/              # Docker compose
    โ””โ”€โ”€ kubernetes/          # K8s manifests

๐Ÿš€ Quick Start

Prerequisites

Python 3.9+
Node.js 16+
PostgreSQL 12+
Docker (optional)

Backend Setup

cd backend
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt
cp .env.example .env  # Configure your environment
python init_db.py     # Initialize database with sample data
python main.py        # Start API server

Access API documentation: http://localhost:8000/api/docs

Frontend Setup

cd frontend
npm install
npm start

Access application: http://localhost:3000

Docker Setup

cd deployment/docker
docker-compose up -d

๐Ÿ“Š Database Schema

Core Tables

  • users - System users with role-based permissions
  • participants - Patient enrollment and demographics
  • bpi_assessments - Brief Pain Inventory scores
  • odi_assessments - Oswestry Disability Index scores
  • sessions - Group session scheduling
  • attendance_records - Session attendance tracking
  • medications - Medication usage tracking

๐Ÿ”Œ API Endpoints

Authentication

  • POST /api/auth/register - User registration
  • POST /api/auth/login - Login and JWT token
  • GET /api/auth/me - Current user info

Participants

  • GET /api/participants - List participants
  • POST /api/participants - Create participant
  • GET /api/participants/{id} - Get participant
  • PUT /api/participants/{id} - Update participant
  • GET /api/participants/{id}/progress - Progress summary

Assessments

  • POST /api/assessments/bpi - Submit BPI assessment
  • POST /api/assessments/odi - Submit ODI assessment
  • GET /api/assessments/participant/{id}/history - Assessment history

Sessions

  • GET /api/sessions - List sessions
  • POST /api/sessions - Create session
  • POST /api/sessions/{id}/attendance - Record attendance

Analytics

  • GET /api/analytics/cohort/{id}/summary - Cohort statistics
  • GET /api/analytics/pain-trends - Pain trend analysis
  • GET /api/analytics/participant/{id}/outcomes - Individual outcomes

๐ŸŽ“ Clinical Program

8-Week Curriculum Structure

  • Week 1: Pain Neurophysiology & Assessment
  • Week 2: Pharmacological Management
  • Week 3: Physical Activity & Exercise
  • Week 4: Cognitive-Behavioral Techniques
  • Week 5: Complementary & Alternative Therapies
  • Week 6: Sleep & Lifestyle Modifications
  • Week 7: Social Support & Communication
  • Week 8: Long-term Management & Maintenance

Each week includes: - 2 group sessions (2 hours each) - Educational materials - Take-home exercises - Progress assessments

๐Ÿ” Security Features

  • JWT-based authentication
  • Role-based access control (Admin, Facilitator, Participant)
  • Password hashing with bcrypt
  • CORS protection
  • SQL injection prevention via ORM
  • HIPAA-compliant audit logging

๐Ÿ“ˆ Analytics Capabilities

  • Longitudinal pain tracking (BPI scores over time)
  • Functional outcome measurement (ODI trends)
  • Medication utilization patterns
  • Program completion rates
  • Cohort comparison analysis
  • Predictive outcome modeling

๐Ÿ“š Documentation

Detailed documentation available in: - /docs/technical/ - Technical specifications - /docs/curriculum/ - Clinical program content - IMPORT_GUIDE.md - How to import existing code - Backend README.md - API documentation - Frontend README.md - Component documentation

๐Ÿงช Testing

# Backend tests
cd backend
pytest

# Frontend tests
cd frontend
npm test

๐Ÿšข Deployment

Docker Deployment

cd deployment/docker
docker-compose up -d

GCP Deployment

cd deployment/gcp
./deploy.sh

๐Ÿ“ Development Status

Completed โœ…

  • Complete database schema (7+ tables)
  • FastAPI backend (45+ endpoints)
  • JWT authentication with RBAC
  • Automated assessment scoring (BPI/ODI)
  • React frontend components
  • 8-week curriculum content
  • Docker configuration

In Progress ๐Ÿ”„

  • ChromaDB RAG integration
  • R Bookdown technical manual
  • Comprehensive test suite
  • GCP deployment automation

Planned ๐Ÿ“‹

  • Mobile app (React Native)
  • Telehealth integration
  • ML prediction models
  • Automated reporting system

๐Ÿค Contributing

This is a clinical research and development project. Contact the project lead for collaboration opportunities.

๐Ÿ“„ License

Copyright ยฉ 2024-2025 PMSG Platform. All rights reserved.

๐Ÿ“ž Contact

Darrell - Familcd backend python -m venv venv source venv/bin/activate pip install -r requirements.txt cp .env.example .env # Configure your environment python init_db.py # Initialize database with sample data python main.py # Start API servery Practice Physician (14 years clinical experience) - MSCIS, Boston University - Behavioral Health, Clinical Data Scientist, AI Engineer - Machine Learning Engineer