Skip to content
 
 

Repository files navigation

NAMASTE to ICD-11 Mapping API

A FastAPI-based service that maps traditional medical terms to ICD-11 codes through the NAMASTE (National Ayurveda, Siddha, Unani, and Traditional Medicine) system.

Features

  • Traditional Term Lookup: Search for traditional medical terms and get their ICD-11 mappings
  • Multi-System Support: Supports Ayurveda, Siddha, and Unani medical systems
  • Comprehensive Mapping: Maps traditional terms through NAMASTE codes to ICD-11 codes
  • Partial Search: Search for terms with partial matching
  • Detailed Response: Returns complete mapping information including confidence scores

API Endpoints

1. POST /lookup

Look up a traditional term and get its complete ICD-11 mapping details.

Request Body:

{
  "traditional_term": "Jwara"
}

Response:

{
  "traditional_term": "Jwara",
  "namaste_code": "NAMASTE_AY_001",
  "english_translation": "Fever",
  "medical_system": "Ayurveda",
  "category": "General fever conditions",
  "icd11_tm2_code": "XM01A0",
  "icd11_biomedicine_code": "8A43",
  "mapping_type": "Exact",
  "confidence_score": 0.77,
  "icd11_details": {
    "title": "Fever pattern in traditional medicine",
    "module": "TM2",
    "category": "General symptoms",
    "code_type": "Traditional_Medicine",
    "parent_code": "XM00",
    "dual_code_partner": "8A43"
  }
}

2. GET /search/{term}

Search for traditional terms with partial matching.

Example: GET /search/jwara

3. GET /health

Health check endpoint.

4. GET /

API information and available endpoints.

Installation

  1. Clone or download the project files

  2. Install dependencies:

    pip install -r requirements.txt
  3. Ensure CSV files are in the correct location:

    • Datasets/namaste_100_dataset.csv
    • Datasets/namaste_icd11_100_mapping.csv
    • Datasets/icd11_100_dataset.csv
  4. Run the API:

    python main.py

    Or using uvicorn directly:

    uvicorn main:app --host 0.0.0.0 --port 8000 --reload

Usage Examples

Using curl:

# Look up a traditional term
curl -X POST "http://localhost:8000/lookup" \
     -H "Content-Type: application/json" \
     -d '{"traditional_term": "Jwara"}'

# Search for partial matches
curl "http://localhost:8000/search/kasa"

# Health check
curl "http://localhost:8000/health"

Using Python requests:

import requests

# Look up a traditional term
response = requests.post(
    "http://localhost:8000/lookup",
    json={"traditional_term": "Jwara"}
)
print(response.json())

# Search for partial matches
response = requests.get("http://localhost:8000/search/kasa")
print(response.json())

Data Structure

The API uses three CSV files:

  1. namaste_100_dataset.csv: Contains traditional terms with their NAMASTE codes
  2. namaste_icd11_100_mapping.csv: Maps NAMASTE codes to ICD-11 codes
  3. icd11_100_dataset.csv: Contains detailed ICD-11 code information

Error Handling

The API returns appropriate HTTP status codes:

  • 200: Success
  • 400: Bad request (empty term)
  • 404: No match found
  • 500: Internal server error

Supported Medical Systems

  • Ayurveda: Traditional Indian medicine
  • Siddha: Tamil traditional medicine
  • Unani: Greco-Arabic traditional medicine

API Documentation

Once the server is running, visit:

Example Traditional Terms

  • Ayurveda: Jwara (Fever), Kasa (Cough), Shwasa (Dyspnea)
  • Siddha: Suram (Fever), Irumal (Cough), Moolam (Hemorrhoids)
  • Unani: Humma (Fever), Sual (Cough), Zeequnnafs (Dyspnea)

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages