RehabPulse

Health

Original Idea

Physical Therapy Home Plan A mobile app with exercise videos, rep timers, and progress streaks for home rehab.

Product Requirements Document (PRD): RehabPulse

1. Executive Summary

RehabPulse is an enterprise-grade mobile platform designed to revolutionize Physical Therapy Home Exercise Programs (HEPs). By bridging the gap between clinical visits and home recovery, RehabPulse leverages 2026-standard AI pose estimation for real-time form correction, gamified adherence triggers, and a HIPAA-compliant data pipeline. The app empowers patients to recover faster with clinical precision while providing therapists with the "operationalized security" and data-driven insights required for modern value-based healthcare.

2. Problem Statement

Patients undergoing physical therapy face a "feedback vacuum" between weekly appointments. Lack of real-time guidance leads to incorrect form, while low engagement results in a 70% non-adherence rate for home plans. Consequently, recovery times are extended, insurance providers face higher costs due to re-injury, and therapists lack the data necessary to adjust treatments effectively.

3. Goals & Success Metrics

  • Patient Adherence: Achieve a >80% weekly completion rate of prescribed exercises.
  • Clinical Accuracy: Maintain <30ms latency for AI pose estimation with >95% accuracy in 3D joint angle detection.
  • Operational Efficiency: Reduce therapist manual documentation time by 40% via automated progress reports.
  • Security Compliance: 100% adherence to the 2026 HIPAA "15-day Right of Access" mandate.

4. User Personas

4.1. Recovering Alex (Patient)

  • Profile: 34-year-old post-operative ACL patient.
  • Needs: Clear instructional feedback, motivation to push through pain, and evidence that he is progressing.
  • Pain Points: Not knowing if he’s doing a squat correctly; forgetting his rep counts.

4.2. Therapist Sarah (Provider)

  • Profile: Senior DPT managing 45 active patients.
  • Needs: A way to monitor patient compliance remotely and adjust plans without a phone call.
  • Pain Points: Spending hours on insurance reimbursement paperwork; patients lying about their "daily" exercises.

4.3. Clinic Admin Mark (Compliance Officer)

  • Profile: Focuses on HIPAA standards and billing.
  • Needs: Immutable audit logs and FHIR-compliant data portability.

5. User Stories

  • As a Patient, I want real-time audio feedback on my knee angle so that I don't overextend my joint during recovery.
  • As a Patient, I want to download my exercises for the week so I can perform them at the gym without using cellular data.
  • As a Therapist, I want to see a "Red Flag" alert on my dashboard if a patient’s pain levels spike for three consecutive days.
  • As a Therapist, I want to generate a signed PDF of a patient's 30-day progress so I can secure insurance reimbursement faster.

6. Functional Requirements

6.1. AI-Powered Movement Tracking

  • Real-time Rep Counter: Automated counting using peak detection algorithms.
  • Pose Correction: Visual 3D "skeleton" overlay using 33 3D points to detect joint deviations.
  • Angle Analysis: Automated calculation of Range of Motion (ROM) for joints (e.g., elbow flexion, knee extension).

6.2. Smart Home Exercise Plan (HEP)

  • HLS Video Streaming: Adaptive bitrate streaming for instructional videos.
  • Offline Mode: Persistent storage of HLS segments using the Widlarz Offline SDK.
  • Variable Reward System: "Aura" points and digital garden growth based on session consistency.

6.3. Clinical Dashboard

  • Adherence Ratio: Calculation of (Actual Reps / Prescribed Reps).
  • Pain Logging: Visualizing NRS Pain Scale trends (0-10) over time.
  • FHIR API Export: Exporting patient data in standardized JSON for interoperability.

7. Technical Requirements

7.1. Tech Stack (2026 Standards)

  • Frontend: React Native v0.83.1 (using Fabric, TurboModules, and React 19).
  • Backend: NestJS v11.1.12 (Express v5, Node.js v22 LTS).
  • Database: PostgreSQL 17 with TimescaleDB for time-series log optimization.
  • AI Engine: VisionCamera V4 + MediaPipe BlazePose (on-device processing).
  • Security: TLS 1.3 only; AES-256 for at-rest encryption.

7.2. Infrastructure (AWS HIPAA-Eligible)

  • Compute: Elastic Beanstalk (Amazon Linux 2023) with Managed Platform Updates.
  • Database: AWS RDS PostgreSQL (Multi-AZ, KMS Encrypted, rds.force_ssl=1).
  • Storage: S3 with BAA and AES-256 server-side encryption.
  • Integration: Apple HealthKit & Google Health Connect for background movement sync.

8. Data Model (PostgreSQL 17)

| Entity | Key Attributes | Relationships | | :--- | :--- | :--- | | User | userId (UUID), role, encrypted_phi | 1:N with TreatmentPlan | | Exercise | exerciseId, videoUrl, target_angles | N:M with TreatmentPlan | | TreatmentPlan| planId, patientId, practitionerId | 1:N with PlanPhase | | ExerciseLog | logId, prescribedExId, actual_reps, pain_score | 1:1 with SessionInstance | | AuditLog | id, actorId, action, timestamp | Immutable, hash-chained |

9. API Specification (Partial)

9.1. POST /v1/sessions/log

  • Request: JSON { prescribedExId: UUID, reps: INT, painLevel: INT, duration: SEC }
  • Response: 201 Created + AuraPointsEarned: INT.

9.2. GET /v1/patients/:id/report

  • Request: Requires Role: Therapist.
  • Response: StreamableFile (Signed PDF/A-1b).

10. UI/UX Requirements

  • The "Curtain" View: The app must display a blurred privacy screen when moved to the background (task switcher) to hide PHI.
  • High-Contrast UI: WCAG 2.1 compliant colors for elderly patients with visual impairments.
  • Haptic Pulse: A subtle 50ms vibration when the AI detects incorrect form, followed by an audio correction.

11. Non-Functional Requirements

  • Compliance: 100% HIPAA BAA for all sub-processors.
  • Performance: UI must maintain 60 FPS during AI-assisted sessions.
  • Availability: 99.9% uptime for the clinical dashboard (Multi-AZ RDS).
  • Latency: On-device AI processing latency must stay below 30ms.

12. Out of Scope

  • Direct billing/payment processing between patient and therapist.
  • Live 1-on-1 telehealth video calls (v2.0 requirement).
  • Integration with legacy EMRs beyond FHIR standard export.

13. Risks & Mitigations

  • Risk: Device fragmentation causing AI lag on older Android phones.
    • Mitigation: Fallback to simple timer-based tracking for devices with low NPU scores.
  • Risk: PHI Leakage via Push Notifications.
    • Mitigation: Zero-PHI payloads; notifications only prompt the user to open the secure app.
  • Risk: AI Hallucination in joint detection.
    • Mitigation: User-confirmed rep counting; AI serves as a "suggestion" rather than an absolute medical truth.

14. Implementation Tasks

Phase 1: Project Setup & Compliance

  • [ ] Execute AWS BAA via AWS Artifact.
  • [ ] Initialize React Native v0.83.1 project with New Architecture enabled.
  • [ ] Initialize NestJS v11.1.12 with Express v5 and TypeScript 5.x.
  • [ ] Configure PostgreSQL 17 with pgcrypto and pgAudit.
  • [ ] Set up TLS 1.3 enforced security policy on AWS ALB.

Phase 2: Core Data & Authentication

  • [ ] Implement Firebase Auth with MFA and HIPAA-compliant session timeout (15 mins).
  • [ ] Create "Template-Instance" PostgreSQL schema.
  • [ ] Build global NestJS AuditInterceptor for PHI access logging.
  • [ ] Implement RBAC (Role-Based Access Control) using NestJS Guards and @Casl/ability.

Phase 3: AI Movement Engine

  • [ ] Integrate VisionCamera V4 with react-native-worklets-core.
  • [ ] Implement MediaPipe BlazePose for 3D landmark extraction.
  • [ ] Build angle calculation logic (Law of Cosines) for Knee and Elbow joints.
  • [ ] Create Angle-Based State Machine for automated rep counting.
  • [ ] Add react-native-skia for skeleton overlay visualization.

Phase 4: Video & Offline Strategy

  • [ ] Set up HLS transcoding pipeline via AWS Elemental MediaConvert.
  • [ ] Integrate react-native-video v7 for adaptive bitrate playback.
  • [ ] Implement Widlarz Offline Video SDK for segment-based downloads.
  • [ ] Build LRU (Least Recently Used) cache cleanup logic for downloaded videos.

Phase 5: Gamification & Engagement

  • [ ] Develop "Aura" point calculation service in NestJS.
  • [ ] Build "Daily Streak" logic with timezone-aware persistence.
  • [ ] Implement react-native-haptics for real-time form correction alerts.
  • [ ] Design and build the "Digital Garden" visual progress component using SVG.

Phase 6: Reporting & Interoperability

  • [ ] Build PDF/A-1b generation service using PDFKit and pdf-lib.
  • [ ] Implement cryptographic document signing with @signpdf/signpdf.
  • [ ] Create FHIR R4 Facade for patient data export (Right of Access).
  • [ ] Build Therapist Dashboard adherence charts using TimescaleDB hyper-tables.

Phase 7: Final Polish & Audit

  • [ ] Implement "Privacy Curtain" screen for background task protection.
  • [ ] Conduct end-to-end pen testing for TLS 1.3 and SQL injection.
  • [ ] Validate 15-day data access fulfillment workflow.
  • [ ] Verify Apple HealthKit / Health Connect background sync stability.