-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathHospital_Dict.py
More file actions
20 lines (17 loc) · 795 Bytes
/
Hospital_Dict.py
File metadata and controls
20 lines (17 loc) · 795 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#Staff & Patient Records -Key-value pairs for instant lookups
# Staff Directory (ID → Details)
staff = {
101: {"name": "Dr. Smith", "role": "Cardiologist", "station": "ER"},
202: {"name": "Nurse Lee", "role": "ICU", "station": "Ward 3B"},
303: {"name": "Dr. Patel", "role": "Radiologist", "station": "Lab 2"}
}
# Patient Records (ID → Medical History)
patients = {
"P881": {"name": "John Munae", "allergies": ["Penicillin"], "ward": "ICU"},
"P882": {"name": "Maria Garcia", "allergies": ["Smoke"], "ward": "Ward 4A"}
}
# Access data
print("Cardiologist on duty:", staff[101]['name']) # Dr. Smith
print("John's allergies:", patients["P881"]["allergies"]) # ['Penicillin']
# Add new patient
patients["P883"] = {"name": "Alex Kim", "allergies": ["Latex"], "ward": "ER"}