A comprehensive FHIR-based Prior Authorization System demonstrating CMS API compliance for the January 1, 2027 deadline. This proof-of-concept implements the HL7 Da Vinci PAS and DTR Implementation Guides with production-ready architecture.
- CMS API Compliance - Implements all four required API patterns for 2027 deadline
- Pure FHIR Approach - Native FHIR workflows without mandatory X12 transformation
- CRD Hooks Integration - Real-time prior authorization awareness during clinical workflows
- DTR Support - Documentation Templates and Rules with CQL-based prepopulation
- Vendor Adapter Pattern - Pluggable architecture for any utilization management vendor
- SMART on FHIR v2 - Secure OAuth 2.0 authentication with fine-grained scopes
- Node.js 18+ and npm 9+
- Redis 7+ (for queue management)
- Docker (optional, for containerized deployment)
# Clone the repository
git clone https://github.com/your-org/FPAS.git
cd FPAS
# Install dependencies
cd fhir-iq-prior-auth/implementation
npm install
# Set up environment variables
cp .env.example .env
# Edit .env with your configuration
# Start Redis (using Docker)
docker run -d -p 6379:6379 redis:7-alpine
# Start the development server
npm run dev
# Server runs at http://localhost:3000# Run demo workflow
npm run demo:full-workflow
# Test CRD hooks
npm run demo:crd
# Test vendor adapters
npm run demo:vendor-adaptersgraph TB
EHR[EHR System] --> CRD[CDS Hooks/CRD]
CRD --> DTR[DTR SMART App]
DTR --> FHIR[FHIR API]
Provider[Provider Portal] --> FHIR
Patient[Patient Portal] --> PatientAPI[Patient Access API]
FHIR --> Queue[BullMQ Queue]
Queue --> Worker[PA Decision Worker]
Worker --> Vendor[Vendor Adapter]
Vendor --> UM[UM System]
FHIR --> Store[(FHIR Store)]
Worker --> Store
Payer[Payer System] --> Bulk[Bulk Data API]
Bulk --> Store
- FHIR Server - Fastify-based REST API implementing Da Vinci PAS operations
- CRD Service - CDS Hooks for order-select and order-sign events
- DTR Engine - CQL-based prepopulation with SMART launch support
- Queue Worker - Asynchronous PA processing with BullMQ/Redis
- Vendor Adapters - Pluggable integration with external UM systems
- Patient Access API - CMS-compliant patient data access endpoints
| Operation | Endpoint | Description |
|---|---|---|
| Submit PA | POST /fhir/Claim/$submit |
Submit prior authorization request |
| Query Status | POST /fhir/Claim/$inquire |
Query PA request status |
| Cancel PA | POST /fhir/Claim/$cancel |
Cancel pending PA request |
| Hook | Endpoint | Trigger |
|---|---|---|
| Discovery | GET /cds-services |
List available hooks |
| Order Select | POST /cds-services/pa-order-select |
Provider selects order |
| Order Sign | POST /cds-services/pa-order-sign |
Provider signs order |
| Resource | Endpoint | Scope Required |
|---|---|---|
| Everything | GET /fhir/Patient/{id}/$everything |
patient/*.read |
| Coverage | GET /fhir/Coverage |
patient/Coverage.read |
| Claims | GET /fhir/Claim |
patient/Claim.read |
| Bulk Export | GET /fhir/Patient/$export |
system/*.read |
| Function | Endpoint | Description |
|---|---|---|
| SMART Launch | GET /dtr-launch |
Launch DTR questionnaire app |
| Submit Response | POST /dtr-submit |
Submit completed questionnaire |
All canonicals are pinned for compliance stability:
- Da Vinci PAS: v2.0.1
- Da Vinci DTR: v2.0.1
- Da Vinci HRex: v1.1.0
- US Core: v6.1.0
- Da Vinci PDex: v2.1.0 (planned)
| API Pattern | Status | Notes |
|---|---|---|
| Prior Authorization API | β Complete | Full PAS operations with DTR |
| Patient Access API | π§ In Progress | Basic implementation ready |
| Provider Access API | π Planned | Framework established |
| Payer-to-Payer Bulk | π Planned | Bulk export initiated |
Deadline: January 1, 2027 (600+ days remaining)
- Click the Deploy button above
- Configure environment variables:
NODE_ENV=production REDIS_URL=your-redis-url FHIR_BASE_URL=https://your-domain.vercel.app/fhir JWT_SECRET=your-jwt-secret - Deploy and test at
https://your-app.vercel.app
# Build Docker image
docker build -t fpas:latest .
# Run with Docker Compose
docker-compose up -d
# Access at http://localhost:3000Create a .env file with:
# Server Configuration
NODE_ENV=production
PORT=3000
BASE_URL=https://your-domain.com
# Redis Configuration
REDIS_URL=redis://localhost:6379
# FHIR Configuration
FHIR_BASE_URL=https://your-domain.com/fhir
FHIR_VERSION=4.0.1
# Security
JWT_SECRET=your-secure-secret
JWT_EXPIRY=1h
CORS_ORIGIN=https://your-ehr.com
# Vendor Adapters (optional)
ENABLE_X12_MAPPING=false
MOCK_VENDOR_ENABLED=true# Run all tests
npm test
# CMS compliance validation
npm run test:cms-compliance
# PA API tests
npm run test:pa-api
# FHIR validation
npm run test:fhir-validation
# Inferno DTR validation
npm run test:inferno-dtr# Full workflow demonstration
npm run demo:full-workflow
# CRD hooks demo
npm run demo:crd
# DTR workflow demo
npm run demo:dtr
# Vendor adapter demo
npm run demo:vendor-adapters# Load testing with Artillery
npm run test:performance
# Stress test PA submissions
npm run test:stressWe welcome contributions! Please see our Contributing Guide for details.
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Run linter:
npm run lint - Fix linting issues:
npm run lint:fix - Type checking:
npm run type-check
This project is licensed under the MIT License - see the LICENSE file for details.
- HL7 International for FHIR specifications
- Da Vinci Project for PAS and DTR Implementation Guides
- CMS for interoperability requirements
- Inferno Framework for DTR testing tools
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Email: support@fhir-iq.com
Built with β€οΈ for healthcare interoperability
This is a proof-of-concept implementation for demonstration purposes. Production deployment requires additional security hardening, performance optimization, and compliance validation.