Documentation ¶
Overview ¶
Package location provides functionality to manage locations.
Index ¶
- func IsBed(pl *ir.PatientLocation) bool
- type Manager
- func (m *Manager) FreeBed(pl *ir.PatientLocation) error
- func (m *Manager) GetAAndELocation() *ir.PatientLocation
- func (m *Manager) Matches(locationName string, pl *ir.PatientLocation) (bool, error)
- func (m *Manager) OccupyAvailableBed(locationName string) (*ir.PatientLocation, error)
- func (m *Manager) OccupySpecificBed(locationName string, bedName string) (*ir.PatientLocation, error)
- type RoomManager
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsBed ¶
func IsBed(pl *ir.PatientLocation) bool
IsBed returns whether the given location is a bed.
Types ¶
type Manager ¶
type Manager struct {
RoomManagers map[string]*RoomManager
}
Manager is a manager of locations that contains multiple room managers.
func NewManager ¶
NewManager returns a location Manager.
func (*Manager) FreeBed ¶
func (m *Manager) FreeBed(pl *ir.PatientLocation) error
FreeBed marks the bed given in the patient location as available. It returns an error if the patient location is not a bed.
func (*Manager) GetAAndELocation ¶
func (m *Manager) GetAAndELocation() *ir.PatientLocation
GetAAndELocation returns the ED location.
func (*Manager) Matches ¶
Matches returns whether the location name matches the patient location. If pl is nil, this method returns an error.
func (*Manager) OccupyAvailableBed ¶
func (m *Manager) OccupyAvailableBed(locationName string) (*ir.PatientLocation, error)
OccupyAvailableBed picks an available bed in the given location and occupies it. This would be equivalent to assigning a patient to a bed. Returns an error if the location doesn't exist.
func (*Manager) OccupySpecificBed ¶
func (m *Manager) OccupySpecificBed(locationName string, bedName string) (*ir.PatientLocation, error)
OccupySpecificBed occupies the given bed in the given location. Returns an error if the location doesn't exist, or the bed is already occupied.
type RoomManager ¶
type RoomManager struct { Poc string Facility string Building string Floor string Room string Type string // contains filtered or unexported fields }
RoomManager is a manager of rooms.
func (*RoomManager) OccupiedBeds ¶
func (r *RoomManager) OccupiedBeds() int
OccupiedBeds returns the number of beds that are currently occupied.