Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EmergencyRoom ¶
type EmergencyRoom struct {
// contains filtered or unexported fields
}
func NewEmergencyRoom ¶
func NewEmergencyRoom() *EmergencyRoom
func (*EmergencyRoom) AdmitPatient ¶
func (er *EmergencyRoom) AdmitPatient(patient interface{})
AdmitPatient adds new patients in ER's priority queue
func (*EmergencyRoom) HandleNextPatient ¶
func (er *EmergencyRoom) HandleNextPatient() *Patient
HandleNextPatient remove highest prio from the patients queue
func (*EmergencyRoom) UpdatePatientStatus ¶
func (er *EmergencyRoom) UpdatePatientStatus(patient *Patient, newStatus SeverityStatus)
type PatientsQueue ¶
type PatientsQueue []*Patient
func (PatientsQueue) Less ¶
func (pq PatientsQueue) Less(a, b int) bool
Less required by the sort.Interface we flip the comparer (to greater than) because we need the comparer to sort by highest prio, not lowest
func (*PatientsQueue) Pop ¶
func (pq *PatientsQueue) Pop() interface{}
Pop required by the heap.Interface
func (*PatientsQueue) Push ¶
func (pq *PatientsQueue) Push(patientData interface{})
Push required by the heap.Interface
func (PatientsQueue) Swap ¶
func (pq PatientsQueue) Swap(a, b int)
Swap required by the sort.Interface
type SeverityStatus ¶
type SeverityStatus int
const ( Mild SeverityStatus = iota Moderate Critical )
Click to show internal directories.
Click to hide internal directories.