-
Notifications
You must be signed in to change notification settings - Fork 0
/
patients.py
34 lines (28 loc) · 968 Bytes
/
patients.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
26
27
28
29
30
31
32
33
34
import random
import simpy
class Patient:
'''
Patient class defines a patient object with
arrival time, service time, CTAS level, and assigned bed number
'''
patient_count = 0
def __init__(self, arrival_time, leave_time=0, ctas_level=None, bed_assigned=None):
self.env = simpy.Environment()
Patient.patient_count += 1
self.id = Patient.patient_count
self.arrival_time = arrival_time
self.triage_waiting_time = 0
self.ed_waiting_time = 0
self.medication_waiting_time = 0
self.inpatient_waiting_time = 0
self.leave_time = leave_time
self.ctas_level = ctas_level
self.tests = []
self.bed_assigned = bed_assigned
def get_ctas_level(self):
if self.ctas_level >0:
return self.ctas_level
else:
return int(random.randint(1, 5))
def get_triage_treatment_review(self):
return random.randint(0, 1)