Skip to content

Commit

Permalink
hs, brc, co: used_equipment renamed to EQUIPMENT; if equip always sam…
Browse files Browse the repository at this point in the history
…e for HSI - set in __init__, otherwise updated in apply
  • Loading branch information
EvaJanouskova committed Sep 12, 2023
1 parent 8d77e18 commit c1373e7
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
9 changes: 5 additions & 4 deletions src/tlo/methods/breast_cancer.py
Original file line number Diff line number Diff line change
Expand Up @@ -648,6 +648,8 @@ def __init__(self, module, person_id):
self.EXPECTED_APPT_FOOTPRINT = self.make_appt_footprint({"Over5OPD": 1, "Mammography": 1})
self.ACCEPTED_FACILITY_LEVEL = '3' # Mammography only available at level 3 and above.
# TODO: what this means, should be the mammography done within this event, or the biopsy, or both?
self.EQUIPMENT = {'Slice Master sample processing Unit', 'Paraffin Dispense', 'Whatever used with biopsy',
'Mammography maybe?'} # biopsy and ?mammography always performed with this HSI

def apply(self, person_id, squeeze_factor):
df = self.sim.population.props
Expand All @@ -668,8 +670,6 @@ def apply(self, person_id, squeeze_factor):

# Use a biopsy to diagnose whether the person has breast Cancer:
# todo: request consumables needed for this
self.used_equipment = {'Slice Master sample processing Unit', 'Paraffin Dispense', 'Whatever used with biopsy',
'Mammograph maybe?'}

dx_result = hs.dx_manager.run_dx_test(
dx_tests_to_run='biopsy_for_breast_cancer_given_breast_lump_discernible',
Expand Down Expand Up @@ -763,8 +763,9 @@ def apply(self, person_id, squeeze_factor):
df.at[person_id, "brc_date_treatment"] = self.sim.date
df.at[person_id, "brc_stage_at_which_treatment_given"] = df.at[person_id, "brc_status"]

# Record used equipment
self.used_equipment = {'Anything used for mastectomy as I guess this is about'}
# Update equipment used with treatment
# NB. read only with HSI run and healthsystem.summary logger set at the level INFO or higher
self.EQUIPMENT.update({'Anything used for mastectomy as I guess this is about'})

# Schedule a post-treatment check for 12 months:
hs.schedule_hsi_event(
Expand Down
7 changes: 4 additions & 3 deletions src/tlo/methods/contraception.py
Original file line number Diff line number Diff line change
Expand Up @@ -1289,11 +1289,12 @@ def apply(self, person_id, squeeze_factor):

_new_contraceptive = self.new_contraceptive

# Record used equipment when needed
# Update equipment when needed
# NB. read only with HSI run and healthsystem.summary logger set at the level of logger.INFO or higher
if _new_contraceptive == 'female_sterilization':
self.used_equipment = {'Smt used to sterilize a woman'}
self.EQUIPMENT.update({'Smt used to sterilize a woman'})
elif _new_contraceptive == 'IUD':
self.used_equipment = {'Equipment used when performing IUD'}
self.EQUIPMENT.update({'Equipment used when performing IUD'})

else:
_new_contraceptive = "not_using"
Expand Down
4 changes: 2 additions & 2 deletions src/tlo/methods/healthsystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ def __init__(self, module, *args, **kwargs):
self._received_info_about_bed_days = None
self.expected_time_requests = {}
self.facility_info = None
self.used_equipment = set()
self.EQUIPMENT = set()

@property
def bed_days_allocated_to_this_event(self):
Expand Down Expand Up @@ -1731,7 +1731,7 @@ def record_hsi_event(self, hsi_event, actual_appt_footprint=None, squeeze_factor
squeeze_factor=_squeeze_factor,
did_run=did_run,
priority=priority,
equipment=hsi_event.used_equipment,
equipment=hsi_event.EQUIPMENT,
)

def write_to_hsi_log(
Expand Down

0 comments on commit c1373e7

Please sign in to comment.