From 389a6e9bba85d30ef3d7075c283b72cc39ace633 Mon Sep 17 00:00:00 2001 From: joehcollins Date: Thu, 26 Oct 2023 13:49:30 +0100 Subject: [PATCH] additions of equipment for PNC --- .../methods/care_of_women_during_pregnancy.py | 7 ++- src/tlo/methods/labour.py | 51 +++++++++++++++---- src/tlo/methods/newborn_outcomes.py | 7 +++ 3 files changed, 52 insertions(+), 13 deletions(-) diff --git a/src/tlo/methods/care_of_women_during_pregnancy.py b/src/tlo/methods/care_of_women_during_pregnancy.py index dec3b72e66..095e37b5cc 100644 --- a/src/tlo/methods/care_of_women_during_pregnancy.py +++ b/src/tlo/methods/care_of_women_during_pregnancy.py @@ -735,6 +735,7 @@ def screening_interventions_delivered_at_every_contact(self, hsi_event): # Delivery of the intervention is conditioned on a random draw against a probability that the intervention # would be delivered (used to calibrate to SPA data- acts as proxy for clinical quality) if self.rng.random_sample() < params['prob_intervention_delivered_urine_ds']: + hsi_event.EQUIPMENT.update({'Urine dip Stick'}) # check consumables avail = pregnancy_helper_functions.return_cons_avail( @@ -748,16 +749,15 @@ def screening_interventions_delivered_at_every_contact(self, hsi_event): # We use a temporary variable to store if proteinuria is detected proteinuria_diagnosed = True logger.info(key='anc_interventions', data={'mother': person_id, 'intervention': 'dipstick'}) - hsi_event.EQUIPMENT.update({'Urine dip Stick'}) # The process is repeated for blood pressure monitoring if self.rng.random_sample() < params['prob_intervention_delivered_bp']: + hsi_event.EQUIPMENT.update({'Sphygmomanometer'}) if self.sim.modules['HealthSystem'].dx_manager.run_dx_test(dx_tests_to_run='blood_pressure_measurement', hsi_event=hsi_event): hypertension_diagnosed = True logger.info(key='anc_interventions', data={'mother': person_id, 'intervention': 'bp_measurement'}) - hsi_event.EQUIPMENT.update({'Sphygmomanometer'}) if not df.at[person_id, 'ac_gest_htn_on_treatment'] and\ (df.at[person_id, 'ps_htn_disorders'] != 'none') and pd.isnull(mni[person_id]['hypertension' @@ -2626,8 +2626,7 @@ def apply(self, person_id, squeeze_factor): self.module, self, self.module.item_codes_preg_consumables, core='post_abortion_care_core', optional='post_abortion_care_optional') - # TODO: equipment set for dilation and cutterage? oxygen? - self.EQUIPMENT.update({'Manual Vacuum aspiration Set', 'Drip stand', 'Infusion pump'}) + self.EQUIPMENT.update({'D&C set', 'Suction Curettage machine', 'Drip stand', 'Infusion pump'}) # Check HCW availability to deliver surgical removal of retained products sf_check = pregnancy_helper_functions.check_emonc_signal_function_will_run(self.sim.modules['Labour'], diff --git a/src/tlo/methods/labour.py b/src/tlo/methods/labour.py index 270454f93d..a6744ca1af 100644 --- a/src/tlo/methods/labour.py +++ b/src/tlo/methods/labour.py @@ -2118,17 +2118,29 @@ def surgical_management_of_pph(self, hsi_event): if not mni[person_id]['retained_placenta']: - # We apply a probability that surgical techniques will be effective - treatment_success_pph = params['success_rate_pph_surgery'] > self.rng.random_sample() + if avail and sf_check: + + # Log equipment + # Todo: link to surgical equipment package when that exsists + hsi_event.EQUIPMENT.update( + {'Infusion pump', 'Drip stand', 'Laparotomy Set', 'Blood pressure machine', 'Pulse oximeter'}) + + # We apply a probability that surgical techniques will be effective + treatment_success_pph = params['success_rate_pph_surgery'] > self.rng.random_sample() - # And store the treatment which will dramatically reduce risk of death - if treatment_success_pph and avail and sf_check: - self.pph_treatment.set(person_id, 'surgery') + # And store the treatment which will dramatically reduce risk of death + if treatment_success_pph: + self.pph_treatment.set(person_id, 'surgery') + else: + # If the treatment is unsuccessful then women will require a hysterectomy to stop the bleeding + + # Log equipment + # Todo: link to surgical equipment package when that exsists + hsi_event.EQUIPMENT.update( + {'Hysterectomy set'}) - # If the treatment is unsuccessful then women will require a hysterectomy to stop the bleeding - elif not treatment_success_pph and avail and sf_check: - self.pph_treatment.set(person_id, 'hysterectomy') - df.at[person_id, 'la_has_had_hysterectomy'] = True + self.pph_treatment.set(person_id, 'hysterectomy') + df.at[person_id, 'la_has_had_hysterectomy'] = True # Next we apply the effect of surgical treatment for women with retained placenta elif (mni[person_id]['retained_placenta'] and not self.pph_treatment.has_all(person_id, @@ -2136,6 +2148,11 @@ def surgical_management_of_pph(self, hsi_event): and sf_check and avail): self.pph_treatment.set(person_id, 'surgery') + # Log equipment + # Todo: link to surgical equipment package when that exsists + hsi_event.EQUIPMENT.update( + {'Infusion pump', 'Drip stand', 'Laparotomy Set', 'Blood pressure machine', 'Pulse oximeter'}) + # log intervention delivery if self.pph_treatment.has_all(person_id, 'surgery') or df.at[person_id, 'la_has_had_hysterectomy']: pregnancy_helper_functions.log_met_need(self, 'pph_surg', hsi_event) @@ -2162,6 +2179,8 @@ def blood_transfusion(self, hsi_event): hsi_event=hsi_event) if avail and sf_check: + hsi_event.EQUIPMENT.update({'Drip stand', 'Infusion pump'}) + mni[person_id]['received_blood_transfusion'] = True pregnancy_helper_functions.log_met_need(self, 'blood_tran', hsi_event) @@ -2185,6 +2204,9 @@ def assessment_and_treatment_of_anaemia(self, hsi_event): mother = df.loc[person_id] mni = self.sim.modules['PregnancySupervisor'].mother_and_newborn_info + # Log equipment + hsi_event.EQUIPMENT.update({'Analyser, Haematology'}) + # Use dx_test function to assess anaemia status test_result = self.sim.modules['HealthSystem'].dx_manager.run_dx_test( dx_tests_to_run='full_blood_count_hb_pn', hsi_event=hsi_event) @@ -2853,6 +2875,7 @@ def __init__(self, module, person_id, facility_level_of_this_hsi): self.EXPECTED_APPT_FOOTPRINT = self.make_appt_footprint({'NormalDelivery': 1}) self.ACCEPTED_FACILITY_LEVEL = facility_level_of_this_hsi self.BEDDAYS_FOOTPRINT = self.make_beddays_footprint({'maternity_bed': 2}) + self.EQUIPMENT = set() def apply(self, person_id, squeeze_factor): mni = self.sim.modules['PregnancySupervisor'].mother_and_newborn_info @@ -3033,6 +3056,7 @@ def __init__(self, module, person_id): self.TREATMENT_ID = 'PostnatalCare_Maternal' self.EXPECTED_APPT_FOOTPRINT = self.make_appt_footprint({'Over5OPD': 1}) self.ACCEPTED_FACILITY_LEVEL = self._get_facility_level_for_pnc(person_id) + self.EQUIPMENT = set() def apply(self, person_id, squeeze_factor): mni = self.sim.modules['PregnancySupervisor'].mother_and_newborn_info @@ -3160,6 +3184,7 @@ def __init__(self, module, person_id, timing): self.EXPECTED_APPT_FOOTPRINT = self.make_appt_footprint({'MajorSurg': 1}) self.ACCEPTED_FACILITY_LEVEL = '1b' self.timing = timing + self.EQUIPMENT = set() def apply(self, person_id, squeeze_factor): df = self.sim.population.props @@ -3190,6 +3215,12 @@ def apply(self, person_id, squeeze_factor): hsi_event=self) if avail and sf_check or (mni[person_id]['cs_indication'] == 'other'): + + # If intervention is delivered - log equipment + # Todo: link to surgical equipment package when that exsists + self.EQUIPMENT.update( + {'Infusion pump', 'Drip stand', 'Laparotomy Set', 'Blood pressure machine', 'Pulse oximeter'}) + person = df.loc[person_id] logger.info(key='caesarean_delivery', data=person.to_dict()) logger.info(key='cs_indications', data={'id': person_id, @@ -3223,6 +3254,8 @@ def apply(self, person_id, squeeze_factor): # Unsuccessful repair will lead to this woman requiring a hysterectomy. Hysterectomy will also reduce # risk of death from uterine rupture but leads to permanent infertility in the simulation else: + self.EQUIPMENT.update( + {'Hysterectomy set'}) df.at[person_id, 'la_has_had_hysterectomy'] = True # ============================= SURGICAL MANAGEMENT OF POSTPARTUM HAEMORRHAGE================================== diff --git a/src/tlo/methods/newborn_outcomes.py b/src/tlo/methods/newborn_outcomes.py index 1905ac1d9f..604c613c49 100644 --- a/src/tlo/methods/newborn_outcomes.py +++ b/src/tlo/methods/newborn_outcomes.py @@ -1008,6 +1008,9 @@ def assessment_and_treatment_newborn_sepsis(self, hsi_event, facility_type): df.at[person_id, 'nb_supp_care_neonatal_sepsis'] = True pregnancy_helper_functions.log_met_need(self, 'neo_sep_supportive_care', hsi_event) + # Log equipment + hsi_event.EQUIPMENT.update({'Drip stand', 'Infusion pump'}) + # The same pattern is then followed for health centre care else: avail = pregnancy_helper_functions.return_cons_avail( @@ -1018,6 +1021,9 @@ def assessment_and_treatment_newborn_sepsis(self, hsi_event, facility_type): df.at[person_id, 'nb_inj_abx_neonatal_sepsis'] = True pregnancy_helper_functions.log_met_need(self, 'neo_sep_abx', hsi_event) + # Log equipment + hsi_event.EQUIPMENT.update({'Drip stand', 'Infusion pump', 'Oxygen cylinder, with regulator'}) + def link_twins(self, child_one, child_two, mother_id): """ This function links twin pairs via sibling IDs and is called by the BirthEvent in the Labour module @@ -1382,6 +1388,7 @@ def __init__(self, module, person_id): self.TREATMENT_ID = 'PostnatalCare_Neonatal' self.EXPECTED_APPT_FOOTPRINT = self.make_appt_footprint({'Under5OPD': 1}) self.ACCEPTED_FACILITY_LEVEL = self._get_facility_level_for_pnc(person_id) + self.EQUIPMENT = set() def apply(self, person_id, squeeze_factor): nci = self.module.newborn_care_info