Skip to content

A modern web application for browsing and searching the International Classification of Diseases (ICD-10/MKB-10) and Oncology (ICD-O/MKB-O) databases.

Notifications You must be signed in to change notification settings

sinyawskiy/icd_django

Repository files navigation

MKB-10 and MKB-O Reference Application

A modern web application for browsing and searching the International Classification of Diseases (ICD-10/MKB-10) and Oncology (ICD-O/MKB-O) databases.

Features

  • MKB-10 Tree View: Browse the hierarchical structure of MKB-10 classifications
  • MKB-10 Search: Search for specific disease codes by name or code
  • MKB-O Tree View: Browse the oncology classifications with category indicators
  • MKB-O Search: Search for oncology-specific classifications
  • Responsive Interface: Modern UI built with React and Material UI
  • RESTful API: Django REST Framework backend with clean API endpoints

Technology Stack

Backend

  • Django: Web framework for the backend API
  • Django REST Framework: For building the RESTful API
  • SQLite: Database for development (can be configured for PostgreSQL in production)

Frontend

  • React: JavaScript library for building the user interface
  • Material UI: React component library implementing Google's Material Design
  • React Router: For handling client-side routing
  • Axios: HTTP client for API requests

Installation

Prerequisites

  • Python 3.8+
  • Node.js 14+
  • npm 6+

Backend Setup

  1. Clone the repository:

    git clone https://github.com/your-username/mkb-django-react.git
    cd mkb-django-react
  2. Create and activate a virtual environment:

    python -m venv venv
    source venv/bin/activate  # On Windows: venv\Scripts\activate
  3. Install dependencies:

    pip install -r requirements.txt
  4. Apply migrations:

    python manage.py migrate
  5. Load MKB-10 and MKB-O data:

    python manage.py load_mkb10 path/to/mkb10.csv
    python manage.py load_mkbo path/to/mkbo.csv

Frontend Setup

  1. Navigate to the frontend directory:

    cd frontend
  2. Install dependencies:

    npm install
  3. Build the frontend:

    npm run build

Running the Application

Development Mode

  1. Start the Django development server:

    python manage.py runserver
  2. In a separate terminal, start the React development server:

    cd frontend
    npm start
  3. Access the application:

Production Mode

  1. Build the React frontend:

    cd frontend
    npm run build
  2. Collect static files:

    python manage.py collectstatic
  3. Run the Django server:

    python manage.py runserver
  4. Access the application at http://localhost:8000/

API Documentation

API Endpoints

The application provides the following API endpoints:

MKB-10 & MKB-O Search and Lookup

Fetch codes by code value
  • URL: /api/find/fetch
  • Method: GET
  • Args:
    • codes: Comma-separated list of codes to fetch
  • Example: /api/find/fetch?codes=A00,A01
  • Response:
[
  {
    "code": "A00",
    "name": "Холера"
  },
  {
    "code": "A01",
    "name": "Тиф и паратиф"
  }
]
  • Alternative Method: POST with JSON array
  • Example:
curl -H "Content-Type: application/json" -X POST -d '["A00","A01"]' http://localhost:8000/api/find/fetch
Search codes by name or code
  • URL: /api/find/lookup
  • Method: GET
  • Args:
    • q: Search query (required). If the query starts with a letter [a-z], search is performed on codes, otherwise on names
    • limit: Maximum number of results to return (default: 50)
  • Example: /api/find/lookup?q=pneumonia&limit=20
  • Response:
[
  {
    "code": "J18",
    "name": "Пневмония без уточнения возбудителя"
  },
  ...
]

MKB-10 Tree View

  • URL: /api/tree/mkb10
  • Method: GET
  • Args:
    • parent_id: Optional ID of the parent node
  • Example: /api/tree/mkb10 (root level) or /api/tree/mkb10?parent_id=123
  • Response:
[
  {
    "id": 1,
    "name": "НЕКОТОРЫЕ ИНФЕКЦИОННЫЕ И ПАРАЗИТАРНЫЕ БОЛЕЗНИ (A00-B99)",
    "code": null,
    "has_children": true
  },
  ...
]

MKB-O Tree View

  • URL: /api/tree/mkbo
  • Method: GET
  • Args:
    • parent_id: Optional ID of the parent node
  • Example: /api/tree/mkbo (root level) or /api/tree/mkbo?parent_id=456
  • Response:
[
  {
    "id": 1,
    "name": "800 Новообразования, БДУ",
    "code": null,
    "level": "2",
    "has_children": true
  },
  ...
]

Configuration

  • Edit mkb_project/settings.py to configure database settings, static files, etc.
  • For production deployment, make sure to set DEBUG = False and configure proper security settings.

Data Files

The application requires two data files for initializing the database:

  • mkb10.csv: Contains all MKB-10 (ICD-10) codes and their hierarchy
  • mkbo.csv: Contains all MKB-O (ICD-O) oncology codes and their classification

These files should be loaded into the database using the provided management commands.

Project Structure

mkb-django-react/
├── mkb_project/            # Django project settings
├── mkb_api/                # Django app for MKB functionality
│   ├── management/         # Management commands
│   │   └── commands/       # Custom commands for data loading
│   ├── migrations/         # Database migrations
│   ├── models.py           # Database models
│   ├── serializers.py      # DRF serializers
│   ├── urls.py             # API URL configuration
│   └── views.py            # API views
├── frontend/               # React frontend
│   ├── public/             # Static files
│   └── src/                # React source files
│       ├── components/     # React components
│       └── services/       # API services
└── manage.py               # Django management script

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgements

  • Original data source: WHO International Classification of Diseases

About

A modern web application for browsing and searching the International Classification of Diseases (ICD-10/MKB-10) and Oncology (ICD-O/MKB-O) databases.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published