Skip to content

FHIR-IQ/complexcareapp

Repository files navigation

MedReconcile

A medication reconciliation caregiving app with MCP (Model Context Protocol) server integration for Claude and ChatGPT.

Features

  • Medication Reconciliation: Compare medication lists from multiple sources (EHR, pharmacy, patient-reported)
  • Drug Interaction Checking: RxNorm-powered drug-drug interaction detection
  • Discrepancy Detection: Identify dose differences, missing medications, therapeutic duplicates
  • Timeline Tracking: Longitudinal view of medication history
  • Fill Adherence: Track expected vs actual medication fills
  • FHIR Compatible: Data models aligned with HL7 FHIR R4 standards
  • MCP Apps: Interactive UI components for Claude and ChatGPT

Architecture

packages/
├── shared/          # FHIR types, schemas, utilities
├── mcp-server/      # MCP server with medication tools
└── mcp-apps/        # Interactive UI components

Quick Start

Prerequisites

  • Node.js 20+
  • pnpm 9+

Installation

# Install dependencies
pnpm install

# Build all packages
pnpm build

Running the MCP Server

# STDIO transport (for Claude Desktop)
cd packages/mcp-server
node dist/index.js

# With HTTP transport (coming soon)
node dist/index.js --http --port=3000

Configuring Claude Desktop

Add to your Claude Desktop config (~/Library/Application Support/Claude/claude_desktop_config.json):

{
  "mcpServers": {
    "medreconcile": {
      "command": "node",
      "args": ["/path/to/complexcareapp/packages/mcp-server/dist/index.js"]
    }
  }
}

MCP Tools

Patient Management

  • create_patient - Create a new patient record
  • search / fetch - Search and retrieve resources (ChatGPT compatible)

Medication Management

  • create_medication - Add a medication for a patient
  • update_medication - Update medication status, dosage, notes
  • delete_medication - Soft delete (mark as entered-in-error)
  • list_medications - List all medications for a patient
  • normalize_medication - Normalize medication name using RxNorm

Reconciliation

  • check_drug_interactions - Check for drug-drug interactions
  • compare_medication_lists - Compare medication lists (coming soon)
  • get_medication_timeline - Get medication event timeline (coming soon)

Example Usage

Creating a Patient

User: Create a patient named John Smith, born January 15, 1955
Claude: [Uses create_patient tool]

Adding Medications

User: Add metformin 500mg twice daily for patient p-123, prescribed by Dr. Jones
Claude: [Uses create_medication tool with RxNorm normalization]

Checking Interactions

User: Check for drug interactions between warfarin and aspirin
Claude: [Uses check_drug_interactions tool]

Data Models

FHIR Resources

  • MedicationStatement - Medications patient is taking
  • MedicationRequest - Prescriptions/orders
  • Patient - Patient demographics

Reconciliation Types

  • MedicationList - Collection of medications from a source
  • ReconciliationComparison - Comparison results
  • DrugInteraction - Interaction warning
  • MedicationDiscrepancy - Discrepancy finding

API Integrations

API Status Features
RxNorm ✅ Active Medication normalization, basic interactions
OpenFDA 🔜 Planned Drug labels, adverse events
DrugBank 🔜 Planned Comprehensive interactions with severity

Development

# Run in development mode
pnpm dev

# Run tests
pnpm test

# Type checking
pnpm typecheck

# Linting
pnpm lint

Project Structure

complexcareapp/
├── packages/
│   ├── shared/
│   │   └── src/
│   │       ├── types/
│   │       │   ├── fhir/           # FHIR R4 type definitions
│   │       │   └── reconciliation/ # Reconciliation types
│   │       └── schemas/            # Zod validation schemas
│   │
│   ├── mcp-server/
│   │   └── src/
│   │       ├── db/                 # SQLite + Drizzle ORM
│   │       ├── integrations/       # External APIs (RxNorm)
│   │       ├── tools/              # MCP tool implementations
│   │       ├── server.ts           # MCP server setup
│   │       └── index.ts            # Entry point
│   │
│   └── mcp-apps/
│       └── src/apps/
│           ├── comparison-view/    # Medication comparison UI
│           ├── interaction-alert/  # Drug interaction alerts
│           └── timeline-chart/     # Medication timeline
│
├── specs/
│   └── mcp-tools.json              # Tool definitions (spec-driven)
│
└── docs/                           # Documentation

License

MIT License - see LICENSE

About

complex care

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages