3  Radiology Clinic

3.1 Data

Table 3.1: List of Global Variables
Name Description Initial Value
NextPatIdNum The Id number that will be assigned to the next patient 1
NextReceptionistIdNum The Id number that will be assigned to the next receptionist 1
NextCTMachineIdNum The Id number that will be assigned to the next CT Machine 1
\(P\) The set of all patients \(\emptyset\)
\(R\) The set of all receptionists \(\emptyset\)
\(C\) The set of all CT Machines \(\emptyset\)
Table 3.2: List of Data Modules
Name Source Model Type Input Output
PatientInterarrivalTime Problem Description Poisson Process Stochastic Mean interarrival time Sample from distribution
NumReceptionists Problem Description Constant Deterministic - Value
NumCTMachines Problem Description Constant Deterministic - Value
CheckInTime Problem Description Uniform Distribution Stochastic Min and max time Sample from distribution
ScanTime Problem Description Log-normal Distribution Stochastic Mean and std. dev. Sample from distribution

3.2 Components

Table 3.3: List of Entities
Entity Attributes
Patient ID
CurrentActivity
CurrentStart
Receptionist ID
CurrentActivity
CurrentStart
CT Machine ID
CurrentActivity
CurrentStart
Table 3.4: List of Transitions
Participant Name From Event To Event
Patient P.1 Arrive(P) Wait for check in.Start
P.2 Wait for check in.End Check in.Start
P.3 Check in.End Wait for scan.Start
P.4 Wait for scan.End Scan.Start
P.5 Scan.End Leave(P)
Receptionist R.1 Arrive(R) Wait for task(R).Start
R.2 Wait for task(R).End Check in.Start
R.3 Check in.End Wait for task(R).Start
R.4 Wait for task(R).End Leave(R)
CT Machine CT.1 Arrive(CT) Wait for task(CT).Start
CT.2 Wait for task(CT).End Scan.Start
CT.3 Scan.End Wait for task(CT).Start
CT.4 Wait for task(CT).End Leave(CT)
Table 3.5: Activities
Activity Participants Event Type State Change
Wait for Check In Patient (p) Start Scheduled
TRIGGER OnStartWaitForCheckIn WITH p
End Controlled
Check In Patient (p), Receptionist (r) Start Controlled
SCHEDULE Check In.End at TIME + CheckInTime()
End Scheduled
START Wait for Scan WITH p # TRANSITION P.3
START Wait for Task (R) WITH r # TRANSITION R.3
Wait for Scan Patient (p) Start Scheduled
End Controlled
TRIGGER OnStartWaitForScan WITH p
Scan Patient (p), CTMachine (c) Start Controlled
SCHEDULE Scan.End at TIME + ScanTime()
End Scheduled
START Leave (P) WITH p # TRANSITION P.5
START Wait for Task (CT) WITH c # TRANSITION CT.3
Wait for Task (R) Receptionist (r) Start Scheduled
TRIGGER OnStartWaitForTaskR WITH r
End Controlled
Wait for Task (CT) CTMachine (c) Start Scheduled
TRIGGER OnStartWaitForTaskCT WITH c
End Controlled
Table 3.6: Events
Event Participants Type State Change
Simulation Start - Scheduled
SCHEDULE Arrival (R) at TIME
SCHEDULE Arrival (CT) at TIME
SCHEDULE Arrival (P) at TIME + PatientInterArrival()
Arrival (P) Patient (p) Scheduled
p.ID = NextPatIDNum
NextPatIDNum = NextPatIDNum + 1
SCHEDULE Arrival (P) at TIME + PatientInterArrival()
START Wait for Check In WITH p # TRANSITION P.1
Leave (P) Patient (p) Scheduled
Calculate statistics for p
Arrival (R) Receptionist (r) Scheduled
r.ID = NextReceptionistIDNum
NextReceptionistIDNum = NextReceptionistIDNum + 1
IF NextReceptionistIDNum <= NumReceptionists THEN
    SCHEDULE Arrival (R) at TIME
END IF
START Wait for Task (R) WITH r # TRANSITION R.1
Leave (R) Receptionist (r) Scheduled
Calculate statistics for r
Arrival (CT) CT Machine (c) Scheduled
c.ID = NextCTMachineIDNum
NextCTMachineIDNum = NextCTMachineIDNum + 1
IF NextCTMachineIDNum <= NumCTMachines THEN
    SCHEDULE Arrival (CT) at TIME
END IF
START Wait for Task (CT) WITH c # TRANSITION CT.1
Leave (CT) CT Machine (c) Scheduled
Calculate statistics for c

3.3 Activity Diagrams

Figure 3.1: Patient Activity Diagram
Figure 3.2: Receptionist Activity Diagram
Figure 3.3: CT Activity Diagram

3.4 Logic

Table 3.7: OnStartWaitForCheckIn
Triggered by: Patient p
receps = {r FOR r IN R IF r.State = "Wait for task (R)"}
IF receps IS NOT empty THEN 
    r_hat = argmin{r.CurrentStart FOR r IN receps}
    START Check In WITH p, r_hat # TRANSITIONS P.2, R.2
END IF
Table 3.8: OnStartWaitForScan
Triggered by: Patient p
cts = {c FOR c IN C IF c.State = "Wait for task (C)"}
IF cts IS NOT empty THEN 
    c_hat = argmin{c.CurrentStart FOR c IN cts}
    START Scan WITH p, c_hat # TRANSITIONS P.4, CT.2
END IF
Table 3.9: OnStartWaitForTaskR
Triggered by: Receptionist r
patients = {p FOR p IN P IF p.State = "Wait for Check In"}
IF patients IS NOT empty THEN 
    p_hat = argmin{p.CurrentStart FOR p IN patients}
    START Check In WITH p_hat, r # TRANSITIONS P.2, R.2
END IF
Table 3.10: OnStartWaitForTaskCT
Triggered by: CTMachine c
patients = {p FOR p IN P IF p.State = "Wait for Scan"}
IF patients IS NOT empty THEN 
    p_hat = argmin{p.CurrentStart FOR p IN patients}
    START Scan WITH p_hat, c # TRANSITIONS P.4, CT.2
END IF