Skip to content

Commit 238459b

Browse files
committed
hs, brc, co: used_equipment renamed to EQUIPMENT; if equip always same for HSI - set in __init__, otherwise updated in apply
1 parent 84c368b commit 238459b

File tree

3 files changed

+11
-9
lines changed

3 files changed

+11
-9
lines changed

src/tlo/methods/breast_cancer.py

+5-4
Original file line numberDiff line numberDiff line change
@@ -648,6 +648,8 @@ def __init__(self, module, person_id):
648648
self.EXPECTED_APPT_FOOTPRINT = self.make_appt_footprint({"Over5OPD": 1, "Mammography": 1})
649649
self.ACCEPTED_FACILITY_LEVEL = '3' # Mammography only available at level 3 and above.
650650
# TODO: what this means, should be the mammography done within this event, or the biopsy, or both?
651+
self.EQUIPMENT = {'Slice Master sample processing Unit', 'Paraffin Dispense', 'Whatever used with biopsy',
652+
'Mammography maybe?'} # biopsy and ?mammography always performed with this HSI
651653

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

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

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

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

769770
# Schedule a post-treatment check for 12 months:
770771
hs.schedule_hsi_event(

src/tlo/methods/contraception.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -1289,11 +1289,12 @@ def apply(self, person_id, squeeze_factor):
12891289

12901290
_new_contraceptive = self.new_contraceptive
12911291

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

12981299
else:
12991300
_new_contraceptive = "not_using"

src/tlo/methods/healthsystem.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ def __init__(self, module, *args, **kwargs):
182182
self._received_info_about_bed_days = None
183183
self.expected_time_requests = {}
184184
self.facility_info = None
185-
self.used_equipment = set()
185+
self.EQUIPMENT = set()
186186

187187
@property
188188
def bed_days_allocated_to_this_event(self):
@@ -1731,7 +1731,7 @@ def record_hsi_event(self, hsi_event, actual_appt_footprint=None, squeeze_factor
17311731
squeeze_factor=_squeeze_factor,
17321732
did_run=did_run,
17331733
priority=priority,
1734-
equipment=hsi_event.used_equipment,
1734+
equipment=hsi_event.EQUIPMENT,
17351735
)
17361736

17371737
def write_to_hsi_log(

0 commit comments

Comments
 (0)