location

package
v0.0.0-...-db2c1db Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 12, 2021 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package location provides functionality to manage locations.

Index

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

func NewManager(ctx context.Context, fileName string) (*Manager, error)

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

func (m *Manager) Matches(locationName string, pl *ir.PatientLocation) (bool, error)

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL