-
Notifications
You must be signed in to change notification settings - Fork 0
/
DiabetesEDVisits.py
25 lines (19 loc) · 1.1 KB
/
DiabetesEDVisits.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import pandas as pd
import numpy as np
# Read the baseline dataset from the Illinois iQuery.
df = pd.read_csv("illinois_iquery.csv")
# Identify the individuals who had diabetic related emergencies.
diabetic_emergencies = df[df["icd_10_code"].str.contains("E11")]
# Extract the patient's medical records and records from their previous visits to the emergency department.
medical_records = diabetic_emergencies["medical_records"]
previous_visits = diabetic_emergencies["previous_visits"]
# Code for ICD 10 codes using the patient's medical records and records from their previous visits to the emergency department.
icd_10_codes = []
for record in medical_records:
icd_10_codes.append(record["icd_10_code"])
for record in previous_visits:
icd_10_codes.append(record["icd_10_code"])
# Compare the ICD 10 codes from the patient's medical records and records from their previous visits to the emergency department in order to determine if they are related to diabetes.
is_diabetic_emergency = np.array_equal(icd_10_codes, icd_10_codes)
# Print the results.
print("Is diabetic emergency?", is_diabetic_emergency)