Blog/Platform Updates

Medical Coding 101, Automated: CCIR/CCSR Classification for Conditions

Automatically classify conditions as chronic or acute, and group them by body system. No medical coding expertise required. CCIR/CCSR enrichment makes ICD-10 codes understandable.

April 21, 2026Team Flexpa
Medical Coding 101, Automated: CCIR/CCSR Classification for Conditions

Yesterday, Sarah discovered who's treating her: names, specialties, and contact details, all pulled from raw NPI codes.

Today, she wants to understand what they're treating.

She opens her medical records and sees:

Insurance portal showing health conditions as cryptic ICD-10 codes

Screenshot shown for demonstrative purposes only.

These codes mean nothing to her. She can guess "diabetes" and "asthma" from the descriptions, but she has questions:

  • Are these chronic conditions, or temporary ones?
  • Which body systems are affected?
  • Should she prioritize managing diabetes over hypertension?
  • How many of her conditions are related to each other?

Without medical coding expertise, Sarah can't answer these questions. She's stuck with cryptic ICD-10 codes designed for billing, not patient understanding.

For developers, this problem is worse. You need to help users understand their health, but you're given 70,000+ ICD-10 codes with no built-in classification. Building condition grouping, chronicity detection, and body system categorization requires medical expertise and constant maintenance.


Don't feel like reading? Watch the video summary:


The Problem

ICD-10 is the global standard for medical diagnosis codes. Every condition, symptom, and injury has a code. But there are over 70,000 of them.

Without additional classification, these codes are nearly impossible to work with:

  • No chronicity information: Is E11.9 (diabetes) a chronic disease requiring ongoing management, or an acute issue that will resolve? You can't tell from the code alone.
  • No body system grouping: Is I10 (hypertension) related to the heart? The kidneys? The endocrine system? ICD-10 doesn't group codes by body system.
  • Medical expertise required: Developers shouldn't need a medical degree to understand that J45.909 (asthma) is a chronic respiratory condition.

The Solution

Every Condition resource with ICD-10-CM codes in Flexpa's API is automatically enriched with CCIR (Chronic Condition Indicator - Revised) and CCSR (Clinical Classifications Software Refined) classifications from AHRQ (Agency for Healthcare Research and Quality).

CCIR and CCSR are designed for ICD-10-CM codes, which are the standard for insurance claims and billing. Conditions coded with other systems (like SNOMED CT from clinical records) will be marked as "Unknown" until additional classification mappings are added.

Implementation Details

Our classification pipeline runs on every Condition resource during FHIR transformation:

1. ICD-10-CM Code Extraction

We scan Condition.code.coding[] for ICD-10-CM codes (system http://hl7.org/fhir/sid/icd-10-cm, http://hl7.org/fhir/sid/icd-10, or OID urn:oid:2.16.840.1.113883.6.90).

2. CCIR Lookup

We query our CCIR database (updated quarterly from AHRQ) to determine if the code represents:

  • C (Chronic): Requires at least 12 months of ongoing management
  • NC (Not Chronic): Temporary, self-limiting condition
  • U (Unknown): No classification available (e.g., SNOMED codes)

3. CCSR Categorization

We query our CCSR database (updated quarterly from AHRQ) to assign the condition to one or more of 552 clinical categories across 22 major body systems:

  • Infectious diseases
  • Neoplasms
  • Blood diseases
  • Endocrine, nutritional, and metabolic diseases
  • Mental disorders
  • Nervous system
  • Eye
  • Ear
  • Circulatory system
  • Respiratory system
  • Digestive system
  • Dental Conditions
  • Skin
  • Musculoskeletal
  • Genitourinary system
  • Pregnancy
  • Perinatal conditions
  • Congenital anomalies
  • Symptoms/signs
  • Injury
  • External causes
  • Health status/contact

4. FHIR Extension and Category Embedding

CCIR is added as a condition-related extension. CCSR is embedded in both Condition.code.coding[] (as an additional coding) and Condition.category[] for easy filtering.

The result:

Health app showing conditions automatically classified by chronicity and body system powered by Flexpa

This UI is for demonstrative purposes only and does not reference any real application. It serves as inspiration for what you can build with Flexpa.

Now Sarah understands: she has three chronic conditions affecting three different body systems — endocrine, circulatory, respiratory — plus two acute respiratory infections flagged for follow-up. She needs ongoing management for her chronic diseases and should coordinate care across specialties.

API Usage

Every Condition includes CCIR (chronicity) data automatically. CCSR (body system classification) is only added for Conditions with ICD-10-CM codes; Conditions coded with other systems (like SNOMED CT) will have chronicity marked as "Unknown" but no CCSR enrichment:

// Example Condition resource with CCIR/CCSR enrichment
{
  "resourceType": "Condition",
  "id": "condition-123",
  "code": {
    "coding": [{
      "system": "http://hl7.org/fhir/sid/icd-10-cm",
      "code": "E11.9",
      "display": "Type 2 diabetes mellitus without complications"
    }, {
      "system": "https://hcup-us.ahrq.gov/toolssoftware/ccsr/ccs_refined.jsp",
      "code": "END002",
      "display": "Diabetes mellitus without complication"
    }, {
      "system": "https://hcup-us.ahrq.gov/toolssoftware/ccsr/ccs_refined.jsp",
      "code": "END005",
      "display": "Diabetes mellitus, Type 2"
    }]
  },
  "extension": [
    {
      "url": "http://hl7.org/fhir/StructureDefinition/condition-related",
      "valueCoding": {
        "system": "https://api.flexpa.com/fhir/StructureDefinition/condition-chronicity",
        "code": "C",
        "display": "Chronic"
      }
    }
  ],
  "category": [
    {
      "coding": [{
        "system": "https://hcup-us.ahrq.gov/toolssoftware/ccsr/ccs_refined.jsp",
        "code": "END",
        "display": "Endocrine, nutritional, and metabolic diseases"
      }],
      "text": "Endocrine, nutritional, and metabolic diseases"
    }
  ]
}

Filter and query by chronicity or body system:

// Get all conditions
const response = await fetch(
  'https://api.flexpa.com/fhir/Condition',
  {
    headers: { 'Authorization': `Bearer ${accessToken}` }
  }
);

// Parse the JSON bundle
const bundle = await response.json();
const entries = bundle.entry ?? [];

// Filter chronic conditions client-side
const chronicConditions = entries.filter(({ resource }) =>
  resource.extension?.some(ext =>
    ext.url === 'http://hl7.org/fhir/StructureDefinition/condition-related' &&
    ext.valueCoding?.code === 'C'
  )
);

// Group conditions by body system from category
// Note: A condition can appear in multiple groups if it has multiple body systems
const groupedConditions = entries.reduce((groups, { resource }) => {
  const bodySystems = resource.category?.filter(cat =>
    cat.coding?.some(c => c.system === 'https://hcup-us.ahrq.gov/toolssoftware/ccsr/ccs_refined.jsp')
  ) ?? [];

  if (bodySystems.length === 0) {
    // No CCSR categories, put in 'Other'
    groups['Other'] = groups['Other'] || [];
    groups['Other'].push(resource);
  } else {
    // Add to each matching body system group
    for (const cat of bodySystems) {
      const systemName = cat.text || 'Other';
      groups[systemName] = groups[systemName] || [];
      groups[systemName].push(resource);
    }
  }

  return groups;
}, {});

// Result:
// {
//   "Endocrine, nutritional, and metabolic diseases": [diabetes],
//   "Circulatory system": [hypertension, atrial fibrillation],
//   "Respiratory system": [asthma, COPD]
// }

Get Started

CCIR/CCSR classification is live for all Flexpa customers. Every Condition resource includes chronicity data automatically. CCSR (body system classification) is added for ICD-10-CM coded Conditions; non-ICD-10 Conditions receive chronicity='U' without body system enrichment.


This is Day 2 of Flexpa Flux Launch Week. Yesterday: Putting names and faces to provider data. Tomorrow: Building your complete healthcare timeline with Claims to Clinical.

Get fresh insights on patient access

Unsubscribe anytime

Newsletter illustration