Skip to content

Commit

Permalink
equip lookup fnc renamed to from_pkg_names()
Browse files Browse the repository at this point in the history
  • Loading branch information
EvaJanouskova committed May 29, 2024
1 parent 0c94641 commit 7745176
Show file tree
Hide file tree
Showing 10 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion src/tlo/methods/bladder_cancer.py
Original file line number Diff line number Diff line change
Expand Up @@ -883,7 +883,7 @@ def apply(self, person_id, squeeze_factor):

if cons_avail:
# If consumables are available and the treatment will go ahead - update the equipment
self.add_equipment(self.healthcare_system.equipment.lookup_item_codes_from_pkg_name('Major Surgery'))
self.add_equipment(self.healthcare_system.equipment.from_pkg_names('Major Surgery'))

# Record date and stage of starting treatment
df.at[person_id, "bc_date_treatment"] = self.sim.date
Expand Down
2 changes: 1 addition & 1 deletion src/tlo/methods/breast_cancer.py
Original file line number Diff line number Diff line change
Expand Up @@ -796,7 +796,7 @@ def apply(self, person_id, squeeze_factor):

if cons_available:
# If consumables are available and the treatment will go ahead - add the used equipment
self.add_equipment(self.healthcare_system.equipment.lookup_item_codes_from_pkg_name('Major Surgery'))
self.add_equipment(self.healthcare_system.equipment.from_pkg_names('Major Surgery'))

# Log the use of adjuvant chemotherapy
self.get_consumables(
Expand Down
2 changes: 1 addition & 1 deletion src/tlo/methods/cardio_metabolic_disorders.py
Original file line number Diff line number Diff line change
Expand Up @@ -1790,7 +1790,7 @@ def apply(self, person_id, squeeze_factor):
data=('This is HSI_CardioMetabolicDisorders_SeeksEmergencyCareAndGetsTreatment: '
f'The squeeze-factor is {squeeze_factor}.'),
)
self.add_equipment(self.healthcare_system.equipment.lookup_item_codes_from_pkg_name('ICU'))
self.add_equipment(self.healthcare_system.equipment.from_pkg_names('ICU'))

for _ev in self.events_to_investigate:
self.do_for_each_event_to_be_investigated(_ev)
Expand Down
2 changes: 1 addition & 1 deletion src/tlo/methods/contraception.py
Original file line number Diff line number Diff line change
Expand Up @@ -1206,7 +1206,7 @@ def apply(self, person_id, squeeze_factor):
self.add_equipment({
'Cusco’s/ bivalved Speculum (small, medium, large)', 'Lamp, Anglepoise'
})
self.add_equipment(self.healthcare_system.equipment.lookup_item_codes_from_pkg_name('Minor Surgery'))
self.add_equipment(self.healthcare_system.equipment.from_pkg_names('Minor Surgery'))
elif _new_contraceptive == 'IUD':
self.add_equipment({
'Cusco’s/ bivalved Speculum (small, medium, large)', 'Sponge Holding Forceps'
Expand Down
4 changes: 2 additions & 2 deletions src/tlo/methods/labour.py
Original file line number Diff line number Diff line change
Expand Up @@ -2128,7 +2128,7 @@ def surgical_management_of_pph(self, hsi_event):
if avail and sf_check:

# Add used equipment
hsi_event.add_equipment(self.healthcare_system.equipment.lookup_item_codes_from_pkg_name('Major Surgery'))
hsi_event.add_equipment(self.healthcare_system.equipment.from_pkg_names('Major Surgery'))

# determine if uterine preserving surgery will be successful
treatment_success_pph = params['success_rate_pph_surgery'] > self.rng.random_sample()
Expand Down Expand Up @@ -3234,7 +3234,7 @@ def apply(self, person_id, squeeze_factor):
elif (avail and sf_check) or (mni[person_id]['cs_indication'] == 'other'):

# If intervention is delivered - add used equipment
self.add_equipment(self.healthcare_system.equipment.lookup_item_codes_from_pkg_name('Major Surgery'))
self.add_equipment(self.healthcare_system.equipment.from_pkg_names('Major Surgery'))

person = df.loc[person_id]
logger.info(key='caesarean_delivery', data=person.to_dict())
Expand Down
2 changes: 1 addition & 1 deletion src/tlo/methods/oesophagealcancer.py
Original file line number Diff line number Diff line change
Expand Up @@ -784,7 +784,7 @@ def apply(self, person_id, squeeze_factor):

if cons_avail:
# If consumables are available and the treatment will go ahead - update the equipment
self.add_equipment(self.healthcare_system.equipment.lookup_item_codes_from_pkg_name('Major Surgery'))
self.add_equipment(self.healthcare_system.equipment.from_pkg_names('Major Surgery'))

# Log chemotherapy consumables
self.get_consumables(
Expand Down
2 changes: 1 addition & 1 deletion src/tlo/methods/other_adult_cancers.py
Original file line number Diff line number Diff line change
Expand Up @@ -772,7 +772,7 @@ def apply(self, person_id, squeeze_factor):

if cons_available:
# If consumables are available and the treatment will go ahead - update the equipment
self.add_equipment(self.healthcare_system.equipment.lookup_item_codes_from_pkg_name('Major Surgery'))
self.add_equipment(self.healthcare_system.equipment.from_pkg_names('Major Surgery'))

# Record date and stage of starting treatment
df.at[person_id, "oac_date_treatment"] = self.sim.date
Expand Down
2 changes: 1 addition & 1 deletion src/tlo/methods/prostate_cancer.py
Original file line number Diff line number Diff line change
Expand Up @@ -919,7 +919,7 @@ def apply(self, person_id, squeeze_factor):
if cons_available:

# If consumables are available and the treatment will go ahead - update the equipment
self.add_equipment(self.healthcare_system.equipment.lookup_item_codes_from_pkg_name('Major Surgery'))
self.add_equipment(self.healthcare_system.equipment.from_pkg_names('Major Surgery'))

# Record date and stage of starting treatment
df.at[person_id, "pc_date_treatment"] = self.sim.date
Expand Down
10 changes: 5 additions & 5 deletions src/tlo/methods/rti.py
Original file line number Diff line number Diff line change
Expand Up @@ -3205,7 +3205,7 @@ def apply(self, person_id, squeeze_factor):
road_traffic_injuries.rti_injury_diagnosis(person_id, self.EXPECTED_APPT_FOOTPRINT)

if 'DiagRadio' in list(self.EXPECTED_APPT_FOOTPRINT.keys()):
self.add_equipment(self.healthcare_system.equipment.lookup_item_codes_from_pkg_name('X-ray'))
self.add_equipment(self.healthcare_system.equipment.from_pkg_names('X-ray'))

elif 'Tomography' in list(self.EXPECTED_APPT_FOOTPRINT.keys()):
self.ACCEPTED_FACILITY_LEVEL = '3'
Expand Down Expand Up @@ -3512,7 +3512,7 @@ def apply(self, person_id, squeeze_factor):

if df.loc[person_id, 'rt_ISS_score'] > self.hdu_cut_off_iss_score:

self.add_equipment(self.healthcare_system.equipment.lookup_item_codes_from_pkg_name('ICU'))
self.add_equipment(self.healthcare_system.equipment.from_pkg_names('ICU'))

mean_icu_days = p['mean_icu_days']
sd_icu_days = p['sd_icu_days']
Expand Down Expand Up @@ -4092,7 +4092,7 @@ def apply(self, person_id, squeeze_factor):
data=f"Fracture casts available for person {person_id} {open_fracture_counts} open fractures"
)

self.add_equipment(self.healthcare_system.equipment.lookup_item_codes_from_pkg_name('Major Surgery'))
self.add_equipment(self.healthcare_system.equipment.from_pkg_names('Major Surgery'))

person = df.loc[person_id]
# update the dataframe to show this person is recieving treatment
Expand Down Expand Up @@ -4816,7 +4816,7 @@ def apply(self, person_id, squeeze_factor):

# TODO: @Joe to confirm major surgery pkg should be used here (as the original set of equipment here was not
# the full pkg)
self.add_equipment(self.healthcare_system.equipment.lookup_item_codes_from_pkg_name('Major Surgery'))
self.add_equipment(self.healthcare_system.equipment.from_pkg_names('Major Surgery'))

# ------------------------ Track permanent disabilities with treatment -------------------------------------
# --------------------------------- Perm disability from TBI -----------------------------------------------
Expand Down Expand Up @@ -5135,7 +5135,7 @@ def apply(self, person_id, squeeze_factor):
if request_outcome:
# TODO: @Joe to confirm major surgery pkg should be used here (as the original set of equipment here was not
# the full pkg)
self.add_equipment(self.healthcare_system.equipment.lookup_item_codes_from_pkg_name('Major Surgery'))
self.add_equipment(self.healthcare_system.equipment.from_pkg_names('Major Surgery'))

# create a dictionary to store the recovery times for each injury in days
minor_surg_recov_time_days = {
Expand Down
4 changes: 2 additions & 2 deletions src/tlo/methods/tb.py
Original file line number Diff line number Diff line change
Expand Up @@ -2055,7 +2055,7 @@ def apply(self, person_id, squeeze_factor):
dx_tests_to_run="tb_xray_smear_negative", hsi_event=self
)
if test_result is not None:
self.add_equipment(self.healthcare_system.equipment.lookup_item_codes_from_pkg_name('X-ray'))
self.add_equipment(self.healthcare_system.equipment.from_pkg_names('X-ray'))

# if consumables not available, refer to level 2
# return blank footprint as xray did not occur
Expand Down Expand Up @@ -2128,7 +2128,7 @@ def apply(self, person_id, squeeze_factor):
dx_tests_to_run="tb_xray_smear_negative", hsi_event=self
)
if test_result is not None:
self.add_equipment(self.healthcare_system.equipment.lookup_item_codes_from_pkg_name('X-ray'))
self.add_equipment(self.healthcare_system.equipment.from_pkg_names('X-ray'))

# if consumables not available, rely on clinical diagnosis
# return blank footprint as xray was not available
Expand Down

0 comments on commit 7745176

Please sign in to comment.