# Medication Possession Ratio Calculator AI Agent Connect

> Medication Possession Ratio Calculator MCP automates the complex clinical math required to track patient adherence. It handles the heavy lifting of calculating covered days, managing early refill overlaps, and accounting for stockpiling or hospital stays. Your AI client uses these tools to turn raw pharmacy dispense records into actionable adherence insights.

## Overview
- **Category:** healthcare
- **Price:** Free
- **Endpoint:** https://edge.vinkius.com/vk_preview_3Qb7M2JiBthxwrTqxveyqgho80zcrsIyasO4Ckno/ai-agent-connect
- **Tags:** medication, adherence, mpr, clinical, pharmacy-analytics

## Description

You can stop manually calculating adherence ratios and dealing with messy pharmacy data. This MCP handles the clinical logic that makes MPR calculations difficult, such as adjusting for early refills and excluding periods where a patient was hospitalized. Instead of building custom spreadsheets, you just feed your dispense records to your AI client. 

It manages the math for covered days and identifies exactly when patients are missing doses. You can use it to validate that your dispensing data is clean before you run any reports. Whether you need a quick adherence score or a detailed breakdown of non-possession periods, your agent can pull those numbers in seconds. It's built to handle the edge cases like stockpiling rules that usually break simple calculators, ensuring your metrics stay clinically accurate.

## Tools

### get_refill_gap_analysis
Use this to identify specific timeframes where a patient had no medication possession.

### calculate_mpr
This tool computes the Medication Possession Ratio by calculating covered days and adherence ratios.

### summarize_adherence_metrics
This tool generates human-readable summaries of all calculated adherence data.

### validate_dispense_data
This tool checks dispensing records to ensure data integrity before you run calculations.

## Prompt Examples

**Prompt:** 
```
Calculate the MPR for medication ID 'MED123' from 2023-01-01 to 2023-03-31 with dispenses on 2023-01-01 (30 days) and 2023-01-25 (30 days), applying early refill rules.
```

**Response:** 
```
The patient has 55 covered days within the observation period, resulting in a capped ratio of 0.60.
```

**Prompt:** 
```
Analyze the refill gaps for medication 'INSULIN_01' between 2023-06-01 and 2023-07-01 with a dispense on 2023-06-05 for 30 days.
```

**Response:** 
```
There is 1 gap period identified from 2023-06-01 to 2023-06-04, totaling 4 days without medication.
```

**Prompt:** 
```
Validate these dispensing records: [{'date': '2023-01-01', 'quantity': 30, 'daysSupplied': 30}]
```

**Response:** 
```
The dispensing records are valid.
```

## Capabilities

### Clinical Logic Automation
Your agent applies complex rules for early refills and stockpiling automatically.

### Gap Identification
The AI finds specific dates where patients lacked medication possession.

### Data Integrity Checks
Your client validates dispense records to prevent calculation errors.

### Adherence Summarization
The tool converts raw mathematical ratios into readable summaries.

### Hospitalization Adjustments
It accounts for hospitalization exclusions to keep metrics accurate.

## Use Cases

### Patient Adherence Monitoring
Calculate MPR for specific patients to see if they are following their prescribed regimens.

### Pharmacy Data Auditing
Validate dispensing records to ensure they are formatted correctly for analysis.

### Gap Analysis
Find out exactly how many days a patient went without their medication between refills.

### Clinical Reporting
Generate human-readable summaries of adherence metrics for clinical reviews.

## Benefits

- Handles early refill and stockpiling logic automatically.
- Identifies specific dates of medication non-possession.
- Validates data integrity to ensure accurate clinical results.
- Excludes hospitalization periods from adherence calculations.

## How It Works

Connecting to this MCP gives your AI client immediate access to clinical adherence tools.

1. Connect your preferred MCP-compatible client to Vinkius.
2. Provide your pharmacy dispense data to your AI agent.
3. Ask the agent to calculate MPR or analyze refill gaps.
4. The MCP executes the clinical logic and returns the results.

## Frequently Asked Questions

**How does this MCP handle early refills?**
The tool includes built-in clinical logic to handle early refill overlaps, ensuring the MPR calculation remains accurate and doesn't overcount covered days.

**Can I use this with Claude or Cursor?**
Yes, you can connect this MCP to any MCP-compatible client like Claude, Cursor, or Windsurf through the Vinkius platform.

**Does it account for hospital stays?**
Yes, the calculation logic includes provisions for hospitalization exclusions to ensure the adherence metrics reflect true medication possession.

**What is the purpose of the gap analysis tool?**
The get_refill_gap_analysis tool identifies specific periods where a patient had no medication, helping you see exactly when they were non-adherent.

**Do I need to host the MCP myself?**
No, Vinkius hosts and manages the MCP for you. You just connect your client and start using the tools.

**How does the tool handle overlapping medication supplies?**
By using the `calculate_mpr` tool with the `applyEarlyRefillRule` set to true, the calculator ensures that overlapping days are not double-counted, accurately reflecting actual possession.

**Can I exclude periods where a patient was hospitalized?**
Yes. When calling `calculate_mpr`, you can provide `hospitalizationDates` to exclude those periods from the eligible days calculation.

**What is the difference between capped and uncapped ratios?**
The uncapped ratio can exceed 1.0 if a patient stockpiles medication. The capped ratio limits the possession days to the observation period, ensuring the result does not exceed 1.0.
