Automated ICD-10 Coding for EMR Data

This microservice suite allows the submission of patient information—including chief complaints—and automatically returns the corresponding ICD-10 codes. The communication between the sender (EMR User Input) and the receiver (ICD-10 Processor) is handled via RabbitMQ.


Prerequisites

  • RabbitMQ: Install RabbitMQ locally or on a server.
  • Python Libraries: Install pika and requests via pip install pika requests

Communication Contract

Sending Data (EMR User Input)

Endpoint: RabbitMQ Queue – chief_complaints_queue
Payload: JSON object containing user information:

{
"name": "John Doe",
"dob": "1990-01-01",
"age": 32,
"gender": "M",
"chief_complaints": "Chest pain",
"vitals": {
	"hr": 75,
	"bp": "120/80",
	"rr": 18,
	"o2_saturation": 98,
	"temperature": 98.6
},
"eta": 15,
"los": "ALS"
}

Receiving Data (ICD-10 Processor)

Response:
The ICD-10 microservice prints the received chief complaint and its corresponding ICD-10 code:

[x] Received Chief Complaint: Chest pain
[x] Corresponding ICD-10 Code: I20.9

UML Sequence Diagram

UML Sequence Diagram
High-level UML sequence diagram showing data flow between the EMR User Input and ICD-10 Processor.

Example Call

  1. Send Patient Information (EMR User Input):
    Run emr-user-input.py and enter patient details as prompted. After entering all information, choose option 0 to submit. The patient data, including the chief complaint, is sent to the microservice via RabbitMQ.
  2. Receive and Process (ICD-10 Processor):
    Run receive.py. The microservice consumes messages from the RabbitMQ queue and prints the received chief complaint with its ICD-10 code.

Interest in More?

Source Code: Automated ICD-10 Coding for EMR Data