-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsimulation.py
More file actions
26 lines (21 loc) · 891 Bytes
/
simulation.py
File metadata and controls
26 lines (21 loc) · 891 Bytes
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
26
import random
from faker import Faker
fake = Faker()
from patient import Patient
from enums import Severity
CONDITIONS = {
Severity.MINOR: ["sprained ankle", "mild headache", "small laceration", "common cold"],
Severity.MODERATE: ["broken arm", "deep laceration", "high fever", "mild concussion"],
Severity.SERIOUS: ["pneumonia", "appendicitis", "severe infection", "fractured rib"],
Severity.CRITICAL: ["heart attack", "stroke", "severe trauma", "internal bleeding"],
Severity.FATAL: ["cardiac arrest", "massive stroke", "critical head trauma"],
}
def generate_patient():
name = fake.name()
age = random.randint(18, 90)
severity = random.choices(
list(Severity),
weights=[30, 25, 20, 15, 10]
)[0]
condition = random.choice(CONDITIONS[severity])
return Patient(name, age, condition, severity)