reunion_get_pathology_prevalence
Retrieve prevalence rates and patient counts for pathologies in La Réunion, filtered by disease keyword, age, sex, and year. Sorted descending by patient count.
Instructions
Patient counts and prevalence rates by pathology, sex and age group in La Réunion, from the CNAM Cartographie des pathologies (built on Sniiram-DCIR claims data). Pathologies are organized in a 3-level taxonomy (e.g. Cardio-vasculaire > Maladies coronaires > Syndrome coronarien aigu). Returns: year, pathology levels 1/2/3, age class, sex, patient count (ntop), reference population (npop), prevalence rate. Sorted by patient count descending.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| pathology | No | Substring search across pathology levels 1/2/3 labels (in French). Examples: "diabète", "cancer", "cardiovasculaire", "psychiatrique", "Maladies du foie" | |
| age_label | No | Age-group label as published by CNAM. Examples: "Tous âges", "0-19 ans", "20-39 ans", "40-59 ans", "60-74 ans", "75 ans et +" | |
| sex_label | No | Sex label (lowercase): "hommes", "femmes", or "tous sexes" | |
| year | No | Year to filter on, 4 digits e.g. "2021". Data typically available 2015-2022 | |
| limit | No | Max rows to return (1-500, default 50) |
Implementation Reference
- src/modules/health.ts:139-181 (handler)Handler function that queries the CNAM pathology prevalence dataset (DATASET_PATHOLOGIES) via the OpenDataSoft API with optional filters (pathology substring, age, sex, year, limit), maps response fields to English-named output, and returns JSON result.
server.tool( 'reunion_get_pathology_prevalence', 'Patient counts and prevalence rates by pathology, sex and age group in La Réunion, from the CNAM Cartographie des pathologies (built on Sniiram-DCIR claims data). Pathologies are organized in a 3-level taxonomy (e.g. Cardio-vasculaire > Maladies coronaires > Syndrome coronarien aigu). Returns: year, pathology levels 1/2/3, age class, sex, patient count (ntop), reference population (npop), prevalence rate. Sorted by patient count descending.', { pathology: z.string().optional().describe('Substring search across pathology levels 1/2/3 labels (in French). Examples: "diabète", "cancer", "cardiovasculaire", "psychiatrique", "Maladies du foie"'), age_label: z.string().optional().describe('Age-group label as published by CNAM. Examples: "Tous âges", "0-19 ans", "20-39 ans", "40-59 ans", "60-74 ans", "75 ans et +"'), sex_label: z.string().optional().describe('Sex label (lowercase): "hommes", "femmes", or "tous sexes"'), year: z.string().optional().describe('Year to filter on, 4 digits e.g. "2021". Data typically available 2015-2022'), limit: z.number().int().min(1).max(500).default(50).describe('Max rows to return (1-500, default 50)'), }, async ({ pathology, age_label, sex_label, year, limit }) => { try { const data = await client.getRecords<RecordObject>(DATASET_PATHOLOGIES, { where: buildWhere([ pathology ? `(patho_niv1 LIKE ${quote(`%${pathology}%`)} OR patho_niv2 LIKE ${quote(`%${pathology}%`)} OR patho_niv3 LIKE ${quote(`%${pathology}%`)})` : undefined, age_label ? `libelle_classe_age = ${quote(age_label)}` : undefined, sex_label ? `libelle_sexe = ${quote(sex_label)}` : undefined, year ? `annee = date${quote(`${year}-01-01`)}` : undefined, ]), order_by: 'ntop DESC', limit, }); return jsonResult({ total_rows: data.total_count, rows: data.results.map((row) => ({ year: pickString(row, ['annee']), pathology_l1: pickString(row, ['patho_niv1']), pathology_l2: pickString(row, ['patho_niv2']), pathology_l3: pickString(row, ['patho_niv3']), age: pickString(row, ['libelle_classe_age']), sex: pickString(row, ['libelle_sexe']), patient_count: pickNumber(row, ['ntop']), population: pickNumber(row, ['npop']), prevalence: pickNumber(row, ['prev']), })), }); } catch (error) { return errorResult(error instanceof Error ? error.message : 'Failed to fetch pathology prevalence'); } } ); - src/modules/health.ts:142-148 (schema)Zod schema defining the tool's input parameters: pathology (optional string), age_label (optional string), sex_label (optional string), year (optional string), limit (number, default 50, min 1 max 500).
{ pathology: z.string().optional().describe('Substring search across pathology levels 1/2/3 labels (in French). Examples: "diabète", "cancer", "cardiovasculaire", "psychiatrique", "Maladies du foie"'), age_label: z.string().optional().describe('Age-group label as published by CNAM. Examples: "Tous âges", "0-19 ans", "20-39 ans", "40-59 ans", "60-74 ans", "75 ans et +"'), sex_label: z.string().optional().describe('Sex label (lowercase): "hommes", "femmes", or "tous sexes"'), year: z.string().optional().describe('Year to filter on, 4 digits e.g. "2021". Data typically available 2015-2022'), limit: z.number().int().min(1).max(500).default(50).describe('Max rows to return (1-500, default 50)'), }, - src/modules/health.ts:139-181 (registration)Tool registered with the MCP server via server.tool() in the registerHealthTools function, called from src/modules/index.ts registerAllTools -> registerHealthTools(server).
server.tool( 'reunion_get_pathology_prevalence', 'Patient counts and prevalence rates by pathology, sex and age group in La Réunion, from the CNAM Cartographie des pathologies (built on Sniiram-DCIR claims data). Pathologies are organized in a 3-level taxonomy (e.g. Cardio-vasculaire > Maladies coronaires > Syndrome coronarien aigu). Returns: year, pathology levels 1/2/3, age class, sex, patient count (ntop), reference population (npop), prevalence rate. Sorted by patient count descending.', { pathology: z.string().optional().describe('Substring search across pathology levels 1/2/3 labels (in French). Examples: "diabète", "cancer", "cardiovasculaire", "psychiatrique", "Maladies du foie"'), age_label: z.string().optional().describe('Age-group label as published by CNAM. Examples: "Tous âges", "0-19 ans", "20-39 ans", "40-59 ans", "60-74 ans", "75 ans et +"'), sex_label: z.string().optional().describe('Sex label (lowercase): "hommes", "femmes", or "tous sexes"'), year: z.string().optional().describe('Year to filter on, 4 digits e.g. "2021". Data typically available 2015-2022'), limit: z.number().int().min(1).max(500).default(50).describe('Max rows to return (1-500, default 50)'), }, async ({ pathology, age_label, sex_label, year, limit }) => { try { const data = await client.getRecords<RecordObject>(DATASET_PATHOLOGIES, { where: buildWhere([ pathology ? `(patho_niv1 LIKE ${quote(`%${pathology}%`)} OR patho_niv2 LIKE ${quote(`%${pathology}%`)} OR patho_niv3 LIKE ${quote(`%${pathology}%`)})` : undefined, age_label ? `libelle_classe_age = ${quote(age_label)}` : undefined, sex_label ? `libelle_sexe = ${quote(sex_label)}` : undefined, year ? `annee = date${quote(`${year}-01-01`)}` : undefined, ]), order_by: 'ntop DESC', limit, }); return jsonResult({ total_rows: data.total_count, rows: data.results.map((row) => ({ year: pickString(row, ['annee']), pathology_l1: pickString(row, ['patho_niv1']), pathology_l2: pickString(row, ['patho_niv2']), pathology_l3: pickString(row, ['patho_niv3']), age: pickString(row, ['libelle_classe_age']), sex: pickString(row, ['libelle_sexe']), patient_count: pickNumber(row, ['ntop']), population: pickNumber(row, ['npop']), prevalence: pickNumber(row, ['prev']), })), }); } catch (error) { return errorResult(error instanceof Error ? error.message : 'Failed to fetch pathology prevalence'); } } ); - src/modules/health.ts:12-13 (helper)Dataset ID constant for the pathology prevalence data source on data.regionreunion.com.
const DATASET_PATHOLOGIES = 'effectif-de-patients-par-pathologie-sexe-classe-d-age-a-la-reunion'; const DATASET_FINESS = 'etablissements-du-domaine-sanitaire-et-social-a-la-reunion';