Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

equipment: integration into modules #1124

Draft
wants to merge 409 commits into
base: master
Choose a base branch
from

Conversation

EvaJanouskova
Copy link
Collaborator

@EvaJanouskova EvaJanouskova commented Sep 20, 2023

Within this PR, used equipment is integrated for each HSI event that requires some (only non-general/specific equipment to that event, so no chairs etc).

How:

  1. Always declare equipment essential for the HSI event to run in __init__, eg:

if some equipment essential for the HSI event to run:

class HSI_Mod_name_of_the_event(HSI_Event, IndividualScopeEventMixin):

def __init__(
        self, module, person_id, do_not_refer_if_neg=False, suppress_footprint=False, referred_from=None,
    ):
        super().__init__(module, person_id=person_id)

... (some asserts and setups)

        # Define the necessary information for an HSI
        self.TREATMENT_ID = "Mod_Treament_name"
        self.EXPECTED_APPT_FOOTPRINT = self.make_appt_footprint({"Footprint_name": 1})
        self.ACCEPTED_FACILITY_LEVEL = '1a'
        self.set_equipment_essential_to_run_event({'item1', 'item2'})

If equipment checks enabled, and any of the items not available, the HSI event will not run.

if no equipment is essential for the HSI event to run:

class HSI_Mod_name_of_the_event(HSI_Event, IndividualScopeEventMixin):

def __init__(
        self, module, person_id, do_not_refer_if_neg=False, suppress_footprint=False, referred_from=None,
    ):
        super().__init__(module, person_id=person_id)

... (some asserts and setups)

        # Define the necessary information for an HSI
        self.TREATMENT_ID = "Mod_Treament_name"
        self.EXPECTED_APPT_FOOTPRINT = self.make_appt_footprint({"Footprint_name": 1})
        self.ACCEPTED_FACILITY_LEVEL = '1a'
        self.set_equipment_essential_to_run_event({''})

By doing that, you are showing that you've thought through the equipment for the particular event.

  1. Whenever the equipment is used during the HSI event defined in apply function, add the equipment (including the essential equipment as it is not added automatically):
# Add used equipment by item name(s)
self.add_equipment({'First item', 'Second item', 'Last item'})
# and/or by pkg name(s)
self.add_equipment_from_pkg({'First pkg', 'Second pkg'})

Think thoroughly about whether the equipment is used only when consumables are available or if any other conditions are satisfied.

Sources where to look up equipment needed for the HSI events:

  1. Use only item names or pkg names included in the ResourceFile_Equipment.csv located in resources/healthsystem/infrastructure_and_equipment/. If the item you need to add is not present in the RF, it should be added there first.

  2. The original source of the items contained in the ResourceFile_Equipment.csv, is the HSSP III Equipment Costing (SEL Costing Sheet). You can find additional information there, including department and ward/room where the item is used.
    (note: If you can't find the exact item name, taken from ResourceFile_Equipment.csv, in the original SEL Costing Sheet, you can also try searching for one of the alternative names. If I've adjusted the item name, I've included the original name as an alternative name, including original names with a typo.)

  3. If you are not sure which equipment should be used with your HSI events, following sources may be helpful:

Module equipment integration assignees

TLO modules with HSI events & module leaders

TODO

  • decide on empty declaration appearance
  • logging of equipment counts of use by HSI event & facility level
  • script to catalogue equipment associated with each HSI event & catalogue equipment by treatment id and facility levels
  • add item codes to RF
  • resolve overlap of equipment and consumables (issue Overlap between certain pieces of equipment and consumables #1223)
  • finalise the RF_Equipment (issue Queries related to equipment  #1147)
  • module leaders to check the hsi-equip-catalogue (maybe add notes if some equipment used only in some circumstances, to be then verified by a health professional)
  • health professional to check the hsi-equip-catalogue
  • create equipment packages (surgery, x-ray, laboratory) (issue Queries related to equipment  #1147)
  • add instructions for equipment integration to the wiki
  • clean the code

@EvaJanouskova EvaJanouskova changed the title Equipment/integration in modules equipment: integration in modules Sep 20, 2023
@EvaJanouskova EvaJanouskova changed the title equipment: integration in modules equipment: integration into modules Sep 20, 2023
@EvaJanouskova EvaJanouskova marked this pull request as draft September 20, 2023 18:05
@EvaJanouskova EvaJanouskova force-pushed the EvaJ/equipment/structure_ToRunSim branch from 901419c to dbe3043 Compare September 24, 2023 23:17
@joehcollins

This comment was marked as resolved.

@joehcollins

This comment was marked as resolved.

@EvaJanouskova EvaJanouskova force-pushed the equipment/integration_in_modules branch 3 times, most recently from 358f787 to 48b8d6f Compare September 29, 2023 10:07
@EvaJanouskova

This comment was marked as resolved.

@EvaJanouskova EvaJanouskova force-pushed the EvaJ/equipment/structure_ToRunSim branch from ed64e6a to ebe0b6a Compare September 29, 2023 10:09
@joehcollins

This comment was marked as resolved.

@tdm32

This comment was marked as resolved.

@tdm32

This comment was marked as resolved.

@joehcollins

This comment was marked as resolved.

@andrew-phillips-1

This comment was marked as resolved.

@EvaJanouskova EvaJanouskova force-pushed the equipment/integration_in_modules branch 2 times, most recently from c2a84de to 3ba42c7 Compare October 11, 2023 16:39
@matt-graham

This comment was marked as outdated.

@EvaJanouskova EvaJanouskova force-pushed the EvaJ/equipment/structure_ToRunSim branch from 76b9bd6 to f1aa86c Compare October 24, 2023 22:03
@EvaJanouskova EvaJanouskova force-pushed the EvaJ/equipment/structure_ToRunSim branch from 04670e4 to 0bda4d0 Compare March 5, 2024 17:06
@EvaJanouskova
Copy link
Collaborator Author

EvaJanouskova commented Mar 5, 2024

Hi @EvaJanouskova. I have now incorporated the following changes discussed in (issue #1223)

  1. Added three consumables (endoscope, prostate specific antigen test, and cystoscope) to ResourceFile_Consumables_Items_and_Packages.csv using the generate_consumables_item_codes_and_packages.py script

Hi @sakshimohan, because we haven't updated the generate_consumables_item_codes_and_packages script yet, as we planned to do when we find time to do so (see issue #1274), and since you've now added the consumables using this script, it overwrote back the changes done manually, which we don't want to happen. I did revert the changes in the ResourceFile_Consumables_Items_and_Packages.csv and added these three consumables manually (which will also have to be addressed for the issue #1274).
Sorry about that, I didn't think it through that we actually can't do it the right way yet.

@joehcollins, could you now add these as consumables whenever you wanted to add those?

…ration_in_modules

# Conflicts:
#	resources/healthsystem/consumables/ResourceFile_Consumables_availability_small.csv
#	resources/healthsystem/infrastructure_and_equipment/ResourceFile_Equipment.csv
#	src/scripts/healthsystem/equipment/equipment_catalogue.py
#	src/tlo/methods/alri.py
#	src/tlo/methods/breast_cancer.py
#	src/tlo/methods/care_of_women_during_pregnancy.py
#	src/tlo/methods/contraception.py
#	src/tlo/methods/healthsystem.py
#	src/tlo/methods/labour.py
#	src/tlo/methods/newborn_outcomes.py
@EvaJanouskova
Copy link
Collaborator Author

EvaJ/equipment/structure_ToRunSim branch rebased on master and merged in here

@marghe-molaro
Copy link
Collaborator

marghe-molaro commented Apr 18, 2024

Hi @joehcollins @EvaJanouskova, naive question about how this PR deals with module parameters which already embed assumptions about equipment availability. To give a concrete example: the probability that a woman receives blood pressure measurement during an ANC appt is based on observed data, and hence already includes assumptions about equipment availability. If we wanted to self-consistently capture the effect of equipment availability, this probability should therefore increase (and if so, by how much?) if equipment is established as being present for the appt. Is this (or a similar logic) already included in the PR?

@joehcollins
Copy link
Collaborator

Hi @joehcollins @EvaJanouskova, naive question about how this PR deals with module parameters which already embed assumptions about equipment availability. To give a concrete example: the probability that a woman receives blood pressure measurement during an ANC appt is based on observed data, and hence already includes assumptions about equipment availability. If we wanted to model the effect of equipment availability, this probability should increase (and if so, by how much?) if equipment is established as being present for the appt. Is this (or a similar logic) already included in the PR?

Hi @marghe-molaro - at present equipment availability wont effect individual interventions within a HSI but rather will determine if an entire HSI will run (only if the module has determined such a piece of equipment exists that would prevent the entire appointment from running). I dont believe availability will be probabilistic for each HSI either, it either is or isnt available in a binary sense.

I get what you mean for certain in-module parameters that i have in the ANC module. Previously ive tried to adjust these so that they account for the average consumable availability for a given intervention to lead to intervention coverage from the observed data - if that makes sense.

@marghe-molaro
Copy link
Collaborator

Thanks for the clarification @joehcollins,

I dont believe availability will be probabilistic for each HSI either, it either is or isnt available in a binary sense.
Absolutely, what I mean is that if the equipment is deemed to be available, then probabilities within the HSIs that implicitly included info on availability should be changed. E.g. if before the probability of blood pressure measurement was 0.55, it should be 1 if the HSI is allowed to go ahead by the equipment check.
I get what you mean for certain in-module parameters that i have in the ANC module. Previously ive tried to adjust these so that they account for the average consumable availability for a given intervention to lead to intervention coverage from the observed data - if that makes sense.
Yes that makes sense, the only issue I see with this is that in some cases we won't want to reproduce the data, but investigate hypothetical scenarios

@joehcollins
Copy link
Collaborator

@marghe-molaro - i suppose with your BP check example that assumes the probability represents the total probability of intervention delivery. In my modules it often represents the probability the intervention will be delivered because the HCW knows they should deliver the intervention i.e. clinical competence. So p(intervention_delivered) = p(consumables) * p(competence)

@joehcollins
Copy link
Collaborator

joehcollins commented Apr 18, 2024

Agree we should maybe think more on this model wide though...

@marghe-molaro
Copy link
Collaborator

Agree we should maybe think more on this model wide though...

Agreed, only reason I brought up ANC is that I knew at least of this specific example and was wondering if you were already addressing this. As you say this is likely affecting a lot more modules, so @EvaJanouskova would be good to think about how to ensure this is consistently addressed.

@tbhallett tbhallett added this to In progress in PR priorities via automation May 9, 2024
@tbhallett tbhallett moved this from In progress to Ready for EM review in PR priorities May 9, 2024
# Conflicts:
#	src/tlo/methods/healthsystem.py
#	src/tlo/methods/hsi_generic_first_appts.py
@tbhallett tbhallett marked this pull request as ready for review May 13, 2024 10:25
@tbhallett tbhallett marked this pull request as draft May 13, 2024 10:27
@tbhallett
Copy link
Collaborator

tbhallett commented May 13, 2024

We're continuing the work on this in #1341

@tbhallett tbhallett removed this from Ready for EM review in PR priorities May 13, 2024
Base automatically changed from EvaJ/equipment/structure_ToRunSim to master May 16, 2024 11:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

10 participants