An AI-powered healthcare claims processing system that predicts claim outcomes, provides billing guidance, and applies automated corrections using LangChain and Microsoft Dataverse.
- Claim Prediction: AI-powered prediction of claim approval/denial with confidence scores
- Billing Guidance: Interactive copilot for billing SOP queries
- Auto-Correction: Rule-based claim correction engine
- Analytics Dashboard: Visual insights into claim patterns and trends
- Microsoft Authentication: Secure Dataverse integration via MSAL
- Python 3.x with FastAPI
- LangChain for LLM orchestration
- OpenAI GPT-4.1-nano for predictions
- Microsoft Dataverse for claim data storage
- Azure Identity for authentication
- React with Vite
- TailwindCSS for styling
- MSAL React for Microsoft authentication
- Axios for API communication
- Python 3.8+
- Node.js 16+
- OpenAI API key
- Microsoft Dataverse instance
- Azure AD app registration (for MSAL)
-
Clone the repository
git clone <repository-url> cd claimopsagent
-
Create virtual environment
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install dependencies
pip install -r requirements.txt
-
Configure environment variables
cp .env.example .env
Edit
.envand add your credentials:OPENAI_API_KEY=your-openai-api-key DATAVERSE_URL=https://your-org.crm.dynamics.com LANGCHAIN_TRACING_V2=false MOCK_MODE=true # Set to false for production💡 Mock Mode: When
MOCK_MODE=true, the application returns mock data without making real API calls to Dataverse or OpenAI. Perfect for local testing! -
Run the backend
uvicorn app.api:app --reload --port 8000
-
Navigate to UI directory
cd ui -
Install dependencies
npm install
-
Configure environment variables
cp .env.example .env
Edit
ui/.envand add your MSAL configuration:VITE_MSAL_CLIENT_ID=your-azure-app-client-id VITE_MSAL_AUTHORITY=https://login.microsoftonline.com/your-tenant-id VITE_DATAVERSE_SCOPE=https://your-org.crm.dynamics.com/.default -
Run the frontend
npm run dev
-
Access the application Open http://localhost:5173 in your browser
claimopsagent/
├── app/
│ ├── api.py # FastAPI endpoints
│ ├── chains/ # LangChain processing chains
│ │ ├── prediction.py # Claim outcome prediction
│ │ ├── correction.py # Auto-correction logic
│ │ ├── guidance.py # Billing guidance copilot
│ │ └── analytics.py # Analytics generation
│ ├── dataverse/ # Dataverse integration
│ │ ├── client.py # Dataverse API client
│ │ └── tools.py # LangChain tools
│ ├── engine/ # Business logic
│ │ └── rules_engine.py # Correction rules
│ └── core/ # Core utilities
│ ├── config.py # Configuration
│ └── telemetry.py # Observability
├── ui/ # React frontend
│ ├── src/
│ │ ├── pages/ # Page components
│ │ ├── components/ # Reusable components
│ │ └── authConfig.js # MSAL configuration
│ └── package.json
├── requirements.txt # Python dependencies
└── .env.example # Environment template
- Sign in with your Microsoft account
- Navigate to "Claim View"
- Enter a claim ID (UUID or string format)
- Click "Analyze Claim" to get AI predictions
- Apply auto-corrections if needed
- Navigate to "Copilot"
- Ask questions about billing procedures
- Get instant SOP guidance
- Navigate to "Dashboard"
- View claim trends and insights
- Export reports as needed
For local development and testing without real API connections:
- Set
MOCK_MODE=truein.env - Mock data will be returned for Dataverse queries
- OpenAI calls will be skipped with mock predictions
- Perfect for testing the UI and workflows
Note: You can still use a dummy Dataverse URL if needed, but MOCK_MODE is the recommended way to enable mock responses.
pytest tests/- Never commit
.envfiles - they contain sensitive credentials - Use
.env.exampleas a template - All secrets should be stored in environment variables
- MSAL tokens are handled securely by the browser
[Your License Here]
[Your Contributing Guidelines Here]