june.groups.hospital.Hospital¶
-
class
june.groups.hospital.
Hospital
(n_beds: int, n_icu_beds: int, area: str = None, coordinates: Optional[Tuple[float, float]] = None, trust_code: str = None) The Hospital class represents a hospital and contains information about its patients and workers - the latter being the usual “people”.
We currently use three subgroups: 0 - workers (i.e. nurses, doctors, etc.), 1 - patients 2 - ICU patients
Create a Hospital given its description.
- n_beds:
total number of regular beds in the hospital
- n_icu_beds:
total number of ICU beds in the hospital
- area:
name of the super area the hospital belongs to
- coordinates:
latitude and longitude
-
class
SubgroupType
(value) An enumeration.
-
icu_patients
= 2
-
patients
= 1
-
workers
= 0
-
-
__init__
(n_beds: int, n_icu_beds: int, area: str = None, coordinates: Optional[Tuple[float, float]] = None, trust_code: str = None) Create a Hospital given its description.
- n_beds:
total number of regular beds in the hospital
- n_icu_beds:
total number of ICU beds in the hospital
- area:
name of the super area the hospital belongs to
- coordinates:
latitude and longitude
-
_collate_from_subgroups
(attribute: str) → List[june.demography.person.Person] Return a set of all of the people in the subgroups with a particular health status
- attribute
The name of the attribute in the subgroup, e.g. “in_hospital”
The union of all the sets with the given attribute name in all of the sub groups.
-
classmethod
_next_id
() → int Iterate an id for this class. Each group class has its own id iterator starting at 0
-
add
(person, subgroup_type=<SubgroupType.workers: 0>) Add a person to a given subgroup. For example, in a school a student is added to the subgroup matching their age.
- person
A person
group_type
-
add_to_icu
(person)
-
add_to_ward
(person)
-
allocate_patient
(person) Allocate a patient inside the hospital, in the ward, in the ICU, or transfer. To correctly log if the person has been just admitted, transfered, or released, we return a few flags: - “ward_admitted” : this person has been admitted to the ward. - “icu_admitted” : this person has been directly admitted to icu. - “ward_transferred” : this person has been transferred to ward (from icu) - “icu_transferred” : this person has been transferred to icu (from ward) - “no_change” : no change respect to last time step.
-
clear
()
-
get_spec
() → str Returns the speciailization of the group.
-
release_patient
(person) Releases patient from hospital.
-
remove_from_icu
(person)
-
remove_from_ward
(person)
-
remove_person
(person: june.demography.person.Person) Remove a person from this group by removing them from the subgroup to which they belong
- person
A person
-
_abc_impl
= <_abc_data object>
-
area
-
property
contains_people
Does this group contain at least one person?
-
coordinates
-
property
dead
-
external
= False
-
property
full
Check whether all regular beds are being used
-
property
full_ICU
Check whether all ICU beds are being used
-
property
icu
-
id
-
property
in_hospital
-
property
infected
-
property
must_timestep
-
n_beds
-
n_icu_beds
-
property
name
The name is computed on the fly to reduce memory footprint. It combines the name fo the class with the id of the instance.
-
property
people
All the people in this group
-
property
recovered
-
property
region
-
property
region_name
-
property
size
-
property
size_infected
-
property
size_recovered
-
property
size_susceptible
-
spec
-
subgroups
-
property
super_area
-
property
susceptible
-
trust_code
-
property
ward