Product User Guide

Documentation and help for Medaius Clinic System

Sponsor Code System Domain

A comprehensive guide to the sponsor/coverage system that enables NGO, government, insurance, and employer healthcare coverage.


The Big Picture

Healthcare in developing countries often involves multiple payers beyond the patient themselves. NGOs provide free or subsidized care, governments run public health programs, employers offer health plans, and insurance companies provide coverage. The Sponsor Code System provides a unified way to handle all these payment sources.

At its core, the system is simple: someone gives the patient a code, the clinic applies the code, and the sponsor covers part or all of the bill.


Core Concepts

Sponsor

A Sponsor is any entity that pays for patient care. This could be:

TypeExamples
NGORed Cross, MSF, local charities
GovernmentMinistry of Health, public health programs
InsurancePrivate insurance companies
EmployerCorporate health plans, union coverage

Each sponsor has contact information, contract details, and can have multiple codes with different coverage rules.

Sponsor Code

A Sponsor Code is what patients present to receive coverage. Each code has:

  • Discount Rules - How much is covered (percentage, fixed amount, or full coverage)
  • Usage Limits - Maximum number of times the code can be used
  • Balance Limits - Maximum total amount the sponsor will cover
  • Validity Period - When the code is active
  • Patient Assignment - Optionally assigned to a specific patient

Sponsor Service Rates (Fee Schedule)

NGOs and sponsors often negotiate fixed rates per service. For example:

ServiceClinic PriceNGO Rate
Consultation15,000 MMK10,000 MMK
Lab - Malaria8,000 MMK8,000 MMK
X-Ray25,000 MMK20,000 MMK

When a service rate exists, the sponsor pays exactly that amount regardless of the clinic's standard price.

Sponsor Claims

Every time a sponsor code is applied, a claim is created. Claims track:

  • How much was billed
  • How much the sponsor covered
  • How much the patient paid
  • Status for reconciliation (recorded → submitted → approved → paid)

Discount Types

TypeHow It WorksExample
PercentageSponsor pays X% of the bill80% → Sponsor pays 8,000 of 10,000
Fixed AmountSponsor pays exactly X amount5,000 off → Sponsor pays 5,000 of 10,000
Full CoverageSponsor pays 100%Patient pays nothing

When a service rate exists for the specific service, that takes priority over the code's general discount.


Workflow

1. Setup (Administrator)

Clinic Admin creates:
    ↓
1. Sponsor (e.g., "Red Cross Myanmar")
    ↓
2. Sponsor Codes (e.g., "RC-2024-001" with 100% coverage, 10 uses)
    ↓
3. Service Rates (optional - fixed prices per service)

2. At Point of Care

Patient presents code "RC-2024-001"
    ↓
Front desk enters code in system
    ↓
System validates:
    ├── Code exists? ✓
    ├── Status active? ✓
    ├── Not expired? ✓
    ├── Usage limit not exceeded? ✓
    └── (If assigned) Correct patient? ✓
    ↓
Proceed with visit, coverage noted

3. Billing

Finalize encounter → Generate invoice
    ↓
Apply sponsor code to invoice
    ↓
System calculates:
    ├── Check for service rates (fixed amounts)
    ├── Otherwise apply code's discount
    ├── Respect balance limits
    └── Create claim record
    ↓
Invoice shows breakdown:
    ├── Total: 50,000 MMK
    ├── Sponsor Covers: 40,000 MMK
    └── Patient Pays: 10,000 MMK

4. Reconciliation

Monthly/weekly:
    ↓
Admin reviews claims for sponsor
    ↓
Submit claims to sponsor (mark as "submitted")
    ↓
Sponsor approves and pays
    ↓
Mark claims as "paid"

Coverage Calculation

def calculate_coverage(bill_amount, sponsor_code, service_code=None):
    # 1. Check for fee schedule rate first
    if service_code and sponsor_has_rate(service_code):
        sponsor_rate = get_rate(service_code)
        sponsor_covers = min(sponsor_rate, bill_amount)
        patient_pays = bill_amount - sponsor_covers
        return (sponsor_covers, patient_pays)
    
    # 2. Apply code's general discount
    if code.discount_type == "full_coverage":
        return (bill_amount, 0)
    
    elif code.discount_type == "percentage":
        discount = bill_amount * (code.discount_value / 100)
        return (discount, bill_amount - discount)
    
    elif code.discount_type == "fixed_amount":
        discount = min(code.discount_value, bill_amount)
        return (discount, bill_amount - discount)

Database Schema

sponsors

ColumnTypeDescription
idVARCHAR (PK)Sponsor ID (spo prefix)
organization_idVARCHAR (FK)Clinic/organization
nameVARCHARSponsor name
sponsor_typeENUMngo, government, insurance, employer
contact_nameVARCHARContact person
contact_phoneVARCHARPhone
contact_emailVARCHAREmail
is_activeBOOLEANActive status

sponsor_codes

ColumnTypeDescription
idVARCHAR (PK)Code ID (spc prefix)
sponsor_idVARCHAR (FK)Parent sponsor
codeVARCHARThe code patients present
discount_typeENUMpercentage, fixed_amount, full_coverage
discount_valueDECIMALDiscount amount/percentage
usage_limitINTEGERMax uses (null = unlimited)
times_usedINTEGERCurrent usage count
balance_limitDECIMALMax amount (null = unlimited)
balance_usedDECIMALAmount already claimed
valid_untilDATEExpiry date
patient_idVARCHAR (FK)If assigned to specific patient
statusENUMactive, exhausted, expired, revoked

sponsor_service_rates

ColumnTypeDescription
idVARCHAR (PK)Rate ID (ssr prefix)
sponsor_idVARCHAR (FK)Parent sponsor
service_codeVARCHARService identifier
service_nameVARCHARService display name
sponsor_rateDECIMALFixed amount sponsor pays

sponsor_claims

ColumnTypeDescription
idVARCHAR (PK)Claim ID (scl prefix)
sponsor_code_idVARCHAR (FK)Code used
patient_idVARCHAR (FK)Patient
invoice_idVARCHAR (FK)Related invoice
original_amountDECIMALBill before discount
sponsor_coversDECIMALAmount sponsor pays
patient_paysDECIMALAmount patient pays
statusENUMrecorded, submitted, approved, paid, rejected

API Endpoints

Sponsor Management

POST   /api/sponsors              # Create sponsor
GET    /api/sponsors              # List sponsors
GET    /api/sponsors/{id}         # Get sponsor
PATCH  /api/sponsors/{id}         # Update sponsor
GET    /api/sponsors/{id}/summary # Get sponsor stats

Sponsor Codes

POST   /api/sponsors/codes               # Create code
GET    /api/sponsors/codes               # List codes
GET    /api/sponsors/codes/{id}          # Get code by ID
GET    /api/sponsors/codes/lookup/{code} # Lookup by code string
PATCH  /api/sponsors/codes/{id}          # Update code

Code Validation & Application

POST   /api/sponsors/codes/validate  # Check if code is valid
POST   /api/sponsors/codes/apply     # Apply code to invoice

Service Rates

POST   /api/sponsors/{id}/rates      # Add service rate
GET    /api/sponsors/{id}/rates      # List rates for sponsor
PATCH  /api/sponsors/rates/{id}      # Update rate
DELETE /api/sponsors/rates/{id}      # Remove rate

Claims

GET    /api/sponsors/claims                  # List claims
PATCH  /api/sponsors/claims/{id}/status      # Update claim status

Permissions

PermissionDescriptionRoles
sponsor.manageCreate/edit sponsors, codes, ratesSUPERUSER, ADMIN, MANAGER
sponsor.code.applyValidate and apply codes at billingSUPERUSER, ADMIN, MANAGER, DOCTOR, NURSE, RECEPTIONIST
sponsor.claims.viewView and manage claim recordsSUPERUSER, ADMIN, MANAGER, DOCTOR

Integration with Billing

The sponsor system integrates with the existing billing module:

  1. Invoice - Can reference a sponsor code and track sponsor discount
  2. Payment - Patient portion is collected as a normal payment
  3. Transaction Ledger - Records both sponsor coverage and patient payment

Example Scenarios

Scenario 1: NGO Full Coverage

  1. Red Cross creates code "RC-FREE-001" with full coverage, 50 uses
  2. Patient presents code at clinic
  3. Clinic validates code → Valid, 45 uses remaining
  4. Visit completed, invoice generated: 25,000 MMK
  5. Code applied: Sponsor covers 25,000, Patient pays 0
  6. Claim recorded for Red Cross reconciliation

Scenario 2: Insurance with 80% Coverage

  1. Insurance company creates code "INS-GOLD-999" with 80% coverage
  2. Patient has bill of 100,000 MMK
  3. Code applied: Sponsor covers 80,000, Patient pays 20,000
  4. Patient pays their 20,000 copay
  5. Clinic submits claim to insurance for 80,000

Scenario 3: NGO with Fee Schedule

  1. MSF negotiates rates: Consultation = 10,000, Lab = 5,000
  2. Patient uses MSF code, gets consultation (clinic price 15,000) + lab (8,000)
  3. Coverage calculation:
    • Consultation: MSF pays 10,000 (rate), patient pays 5,000
    • Lab: MSF pays 5,000 (rate), patient pays 3,000
    • Total: MSF pays 15,000, Patient pays 8,000

Key Takeaways

  1. Simple but Extensible - Three discount types cover most use cases, with fee schedules for complex negotiations
  2. Usage Tracking - Every code application is logged with full amounts for reconciliation
  3. Multi-Payer Ready - Supports NGO, government, insurance, and employer payers under one system
  4. Billing Integration - Works seamlessly with existing invoice and payment workflows
  5. Permission-Based - Different roles have appropriate access to manage vs. apply codes

Document created: December 2025