A modern web application for browsing and searching the International Classification of Diseases (ICD-10/MKB-10) and Oncology (ICD-O/MKB-O) databases.
- 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
- 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)
- 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
- Python 3.8+
- Node.js 14+
- npm 6+
-
Clone the repository:
git clone https://github.com/your-username/mkb-django-react.git cd mkb-django-react
-
Create and activate a virtual environment:
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install dependencies:
pip install -r requirements.txt
-
Apply migrations:
python manage.py migrate
-
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
-
Navigate to the frontend directory:
cd frontend
-
Install dependencies:
npm install
-
Build the frontend:
npm run build
-
Start the Django development server:
python manage.py runserver
-
In a separate terminal, start the React development server:
cd frontend npm start
-
Access the application:
- Backend API: http://localhost:8000/api/
- Frontend (when running React dev server): http://localhost:3000/
-
Build the React frontend:
cd frontend npm run build
-
Collect static files:
python manage.py collectstatic
-
Run the Django server:
python manage.py runserver
-
Access the application at http://localhost:8000/
The application provides the following API endpoints:
- 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
- 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 nameslimit
: Maximum number of results to return (default: 50)
- Example:
/api/find/lookup?q=pneumonia&limit=20
- Response:
[
{
"code": "J18",
"name": "Пневмония без уточнения возбудителя"
},
...
]
- 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
},
...
]
- 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
},
...
]
- 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.
The application requires two data files for initializing the database:
mkb10.csv
: Contains all MKB-10 (ICD-10) codes and their hierarchymkbo.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.
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
This project is licensed under the MIT License - see the LICENSE file for details.
- Original data source: WHO International Classification of Diseases