tlo.methods.healthsystem module =============================== .. automodule:: tlo.methods.healthsystem .. autoclass:: HSI_Event **Class attributes:** bed_days_allocated_to_this_event : **Functions (defined or overridden in class HSI_Event):** .. automethod:: __init__ .. automethod:: apply .. automethod:: did_not_run .. automethod:: never_ran .. automethod:: post_apply_hook .. automethod:: run .. automethod:: get_consumables .. automethod:: make_beddays_footprint .. automethod:: is_all_beddays_allocated .. automethod:: make_appt_footprint .. automethod:: initialise .. automethod:: _check_if_appt_footprint_can_run .. automethod:: as_namedtuple .. autoclass:: HSIEventWrapper Bases: :class:`tlo.events.Event` **Functions (defined or overridden in class HSIEventWrapper):** .. automethod:: __init__ .. automethod:: run .. autoclass:: HealthSystem Bases: :class:`tlo.core.Module` **PARAMETERS:** .. list-table:: :widths: 25 25 50 :header-rows: 1 * - Item - Type - Description * - Master_Facilities_List - DATA_FRAME - Listing of all health facilities. * - Officer_Types_Table - DATA_FRAME - The names of the types of health workers ("officers") * - Appt_Types_Table - DATA_FRAME - The names of the type of appointments with the health system * - Appt_Offered_By_Facility_Level - DATA_FRAME - Table indicating whether or not each appointment is offered at each facility level. * - Appt_Time_Table - DATA_FRAME - The time taken for each appointment, according to officer and facility type. * - Daily_Capabilities_actual - DATA_FRAME - The capabilities (minutes of time available of each type of officer in each facility) based on the _estimated current_ number and distribution of staff estimated. * - Daily_Capabilities_funded - DATA_FRAME - The capabilities (minutes of time available of each type of officer in each facility) based on the _potential_ number and distribution of staff estimated (i.e. those positions that can be funded). * - Daily_Capabilities_funded_plus - DATA_FRAME - The capabilities (minutes of time available of each type of officer in each facility) based on the _potential_ number and distribution of staff estimated, with adjustments to permit each appointment type that should be run at facility level to do so in every district. * - use_funded_or_actual_staffing - STRING - If `actual`, then use the numbers and distribution of staff estimated to be available currently; If `funded`, then use the numbers and distribution of staff that are potentially available. If 'funded_plus`, then use a dataset in which the allocation of staff to facilities is tweaked so as to allow each appointment type to run at each facility_level in each district for which it is defined. N.B. This parameter is over-ridden if an argument is provided to the module initialiser. * - item_and_package_code_lookups - DATA_FRAME - Data imported from the OneHealth Tool on consumable items, packages and costs. * - availability_estimates - DATA_FRAME - Estimated availability of consumables in the LMIS dataset. * - cons_availability - STRING - Availability of consumables. If 'default' then use the availability specified in the ResourceFile; if 'none', then let no consumable be ever be available; if 'all', then all consumables are always available. When using 'all' or 'none', requests for consumables are not logged. NB. This parameter is over-riddenif an argument is provided to the module initialiser. * - BedCapacity - DATA_FRAME - Data on the number of beds available of each type by facility_id * - beds_availability - STRING - Availability of beds. If 'default' then use the availability specified in the ResourceFile; if 'none', then let no beds be ever be available; if 'all', then all beds are always available. NB. This parameter is over-ridden if an argument is provided to the module initialiser. * - Service_Availability - LIST - List of services to be available. NB. This parameter is over-ridden if an argument is provided to the module initialiser. * - policy_name - STRING - Name of priority policy adopted * - year_mode_switch - INT - Year in which mode switch in enforced * - priority_rank - DICT - Data on the priority ranking of each of the Treatment_IDs to be adopted by the queueing system under different policies, where the lower the number the higher the priority, and on which categories of individuals classify for fast-tracking for specific treatments * - const_HR_scaling_table - DICT - Factors by which capabilities of medical officer categories at different levels will bescaled at the start of the simulation to simulate a number of effects (e.g. absenteeism,boosting of specific medical cadres, etc). This is the imported from anExcel workbook: keys are the worksheet names and values are the worksheets in the format of pd.DataFrames. * - const_HR_scaling_mode - STRING - Mode of HR scaling considered at the start of the simulation. Options are default (capabilities are scaled by a constaint factor of 1), data (factors informed by survey data),and custom (user can freely set these factors as parameters in the analysis). * - dynamic_HR_scaling_factor - REAL - Factor by which HR capabilities are scaled at regular intervals of 1 year (in addition to the [optional] scaling with population size (controlled by `scale_HR_by_popsize` * - scale_HR_by_popsize - BOOL - Decide whether to scale HR capabilities by population size every year. Can be used as well as the dynamic_HR_scaling_factor * - tclose_overwrite - INT - Decide whether to overwrite tclose variables assigned by disease modules * - tclose_days_offset_overwrite - INT - Offset in days from topen at which tclose will be set by the healthsystem for all HSIsif tclose_overwrite is set to True. * - mode_appt_constraints - INT - Integer code in `{0, 1, 2}` determining mode of constraints with regards to officer numbers and time - 0: no constraints, all HSI events run with no squeeze factor, 1: elastic constraints, all HSI events run with squeeze factor, 2: hard constraints, only HSI events with no squeeze factor run. N.B. This parameter is over-ridden if an argument is provided to the module initialiser. * - mode_appt_constraints_postSwitch - INT - Mode considered after a mode switch in year_mode_switch. **PROPERTIES:** .. list-table:: :widths: 25 25 50 :header-rows: 1 * - Item - Type - Description * - hs_is_inpatient - BOOL - Whether or not the person is currently an in-patient at any medical facility **Class attributes:** INIT_DEPENDENCIES : {'Demography'} capabilities_today : hsi_event_counts : never_ran_hsi_event_counts : **Functions (defined or overridden in class HealthSystem):** .. automethod:: __init__ .. automethod:: read_parameters .. automethod:: pre_initialise_population .. automethod:: initialise_population .. automethod:: initialise_simulation .. automethod:: on_birth .. automethod:: on_simulation_end .. automethod:: setup_priority_policy .. automethod:: process_human_resources_files .. automethod:: adjust_for_const_HR_scaling .. automethod:: format_daily_capabilities .. automethod:: update_consumables_availability_to_represent_merging_of_levels_1b_and_2 .. automethod:: get_service_availability .. automethod:: get_cons_availability .. automethod:: get_beds_availability .. automethod:: schedule_to_call_never_ran_on_date .. automethod:: get_mode_appt_constraints .. automethod:: get_use_funded_or_actual_staffing .. automethod:: get_priority_policy_initial .. automethod:: load_priority_policy .. automethod:: schedule_hsi_event .. automethod:: _add_hsi_event_queue_item_to_hsi_event_queue .. automethod:: enforce_priority_policy .. automethod:: check_hsi_event_is_valid .. automethod:: is_treatment_id_allowed .. automethod:: schedule_batch_of_individual_hsi_events .. automethod:: appt_footprint_is_valid .. automethod:: get_blank_appt_footprint .. automethod:: get_facility_info .. automethod:: get_appt_footprint_as_time_request .. automethod:: get_squeeze_factors .. automethod:: record_hsi_event .. automethod:: write_to_hsi_log .. automethod:: call_and_record_never_ran_hsi_event .. automethod:: write_to_never_ran_hsi_log .. automethod:: log_current_capabilities_and_usage .. automethod:: remove_beddays_footprint .. automethod:: find_events_for_person .. automethod:: reset_queue .. automethod:: get_item_codes_from_package_name .. automethod:: get_item_code_from_item_name .. automethod:: override_availability_of_consumables .. automethod:: _write_hsi_event_counts_to_log_and_reset .. automethod:: _write_never_ran_hsi_event_counts_to_log_and_reset .. automethod:: on_end_of_day .. automethod:: on_end_of_month .. automethod:: on_end_of_year .. automethod:: run_population_level_events .. automethod:: run_individual_level_events_in_mode_0_or_1 .. autoclass:: HealthSystemScheduler Bases: :class:`tlo.events.RegularEvent`, :class:`tlo.events.Event`, :class:`tlo.events.PopulationScopeEventMixin` **Class attributes:** __annotations__ : {} **Functions (defined or overridden in class HealthSystemScheduler):** .. automethod:: __init__ .. automethod:: _is_last_day_of_the_year .. automethod:: _is_last_day_of_the_month .. automethod:: _get_events_due_today .. automethod:: process_events_mode_0_and_1 .. automethod:: process_events_mode_2 .. automethod:: apply .. autoclass:: HealthSystemChangeParameters Bases: :class:`tlo.events.Event`, :class:`tlo.events.PopulationScopeEventMixin` **Class attributes:** __annotations__ : {} **Functions (defined or overridden in class HealthSystemChangeParameters):** .. automethod:: __init__ .. automethod:: apply .. autoclass:: DynamicRescalingHRCapabilities Bases: :class:`tlo.events.RegularEvent`, :class:`tlo.events.Event`, :class:`tlo.events.PopulationScopeEventMixin` **Class attributes:** __annotations__ : {} current_pop_size : **Functions (defined or overridden in class DynamicRescalingHRCapabilities):** .. automethod:: __init__ .. automethod:: apply .. autoclass:: HealthSystemChangeMode Bases: :class:`tlo.events.RegularEvent`, :class:`tlo.events.Event`, :class:`tlo.events.PopulationScopeEventMixin` **Class attributes:** __annotations__ : {} **Functions (defined or overridden in class HealthSystemChangeMode):** .. automethod:: __init__ .. automethod:: apply