tlo.methods.hsi_generic_first_appts module

The file contains the event HSI_GenericFirstApptAtFacilityLevel1, which describes the first interaction with the health system following the onset of acute generic symptoms.

This file contains the HSI events that represent the first contact with the Health System, which are triggered by the onset of symptoms. Non-emergency symptoms lead to HSI_GenericFirstApptAtFacilityLevel0 and emergency symptoms lead to HSI_GenericEmergencyFirstApptAtFacilityLevel1.

class HSI_BaseGenericFirstAppt(module, person_id)[source]

Bases: tlo.methods.hsi_event.HSI_Event, tlo.events.IndividualScopeEventMixin

Class attributes:

__annotations__ : {‘MODULE_METHOD_ON_APPLY’: “Literal[‘do_at_generic_first_appt’, ‘do_at_generic_first_appt_emergency’]”}

Functions (defined or overridden in class HSI_BaseGenericFirstAppt):

__init__(module, person_id) None[source]

Create a new event.

Note that just creating an event does not schedule it to happen; that must be done by calling Simulation.schedule_event.

Parameters:

module – the module that created this event. All subclasses of Event take this as the first argument in their constructor, but may also take further keyword arguments.

_diagnosis_function(tests, use_dict: bool = False, report_tried: bool = False) DiagnosisTestReturnType[source]

Passed to modules when determining HSI_Events to be scheduled based on this generic appointment. Intended as the diagnosis_function argument to the Module.do_at_generic_{non_}_emergency.

Class-level definition avoids the need to redefine this method each time the .apply() method is called.

Parameters:
  • tests – The name of the test(s) to run via the diagnosis manager.

  • use_dict_for_single – If True, the return type will be a dictionary

even if only one test was requested. :param report_dxtest_tried: Report if a test was attempted but could not be carried out due to EG lack of consumables, etc. :returns: Test results as dictionary key/value pairs.

_do_on_generic_first_appt(squeeze_factor: float = 0.0) None[source]
apply(person_id, squeeze_factor=0.0) None[source]

Run the actions required during the HSI.

TODO: person_id is not needed any more - but would have to go through the whole codebase to manually identify instances of this class to change call syntax, and leave other HSI_Event-derived classes alone.

class HSI_GenericNonEmergencyFirstAppt(module, person_id, facility_level='0')[source]

This is a Health System Interaction Event that represents the first interaction with the health system following the onset of non-emergency symptom(s).

It is generated by the HealthSeekingBehaviour module.

By default, it occurs at level ‘0’ but it could occur also at other levels.

It uses the non-emergency generic first appointment methods of the disease modules to determine any follow-up events that need to be scheduled.

Bases: tlo.methods.hsi_generic_first_appts.HSI_BaseGenericFirstAppt, tlo.methods.hsi_event.HSI_Event, tlo.events.IndividualScopeEventMixin

Class attributes:

MODULE_METHOD_ON_APPLY : do_at_generic_first_appt

__annotations__ : {}

Functions (defined or overridden in class HSI_GenericNonEmergencyFirstAppt):

__init__(module, person_id, facility_level='0')[source]

Create a new event.

Note that just creating an event does not schedule it to happen; that must be done by calling Simulation.schedule_event.

Parameters:

module – the module that created this event. All subclasses of Event take this as the first argument in their constructor, but may also take further keyword arguments.

class HSI_GenericEmergencyFirstAppt(module, person_id)[source]

This is a Health System Interaction Event that represents the generic appointment which is the first interaction with the health system following the onset of emergency symptom(s).

It uses the emergency generic first appointment methods of the disease modules to determine any follow-up events that need to be scheduled.

Bases: tlo.methods.hsi_generic_first_appts.HSI_BaseGenericFirstAppt, tlo.methods.hsi_event.HSI_Event, tlo.events.IndividualScopeEventMixin

Class attributes:

MODULE_METHOD_ON_APPLY : do_at_generic_first_appt_emergency

__annotations__ : {}

Functions (defined or overridden in class HSI_GenericEmergencyFirstAppt):

__init__(module, person_id)[source]

Create a new event.

Note that just creating an event does not schedule it to happen; that must be done by calling Simulation.schedule_event.

Parameters:

module – the module that created this event. All subclasses of Event take this as the first argument in their constructor, but may also take further keyword arguments.

class HSI_EmergencyCare_SpuriousSymptom(module, person_id, accepted_facility_level='1a')[source]

This is an HSI event that provides Accident & Emergency Care for a person that has spurious emergency symptom.

Bases: tlo.methods.hsi_event.HSI_Event, tlo.events.IndividualScopeEventMixin

Class attributes:

__annotations__ : {}

Functions (defined or overridden in class HSI_EmergencyCare_SpuriousSymptom):

__init__(module, person_id, accepted_facility_level='1a')[source]

Create a new event.

Note that just creating an event does not schedule it to happen; that must be done by calling Simulation.schedule_event.

Parameters:

module – the module that created this event. All subclasses of Event take this as the first argument in their constructor, but may also take further keyword arguments.

apply(person_id, squeeze_factor)[source]

Apply this event to the population.

Must be implemented by subclasses.