Skip to content

Commit

Permalink
additions of equipment for PNC
Browse files Browse the repository at this point in the history
  • Loading branch information
joehcollins committed Oct 26, 2023
1 parent aebc896 commit 389a6e9
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 13 deletions.
7 changes: 3 additions & 4 deletions src/tlo/methods/care_of_women_during_pregnancy.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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'
Expand Down Expand Up @@ -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'],
Expand Down
51 changes: 42 additions & 9 deletions src/tlo/methods/labour.py
Original file line number Diff line number Diff line change
Expand Up @@ -2118,24 +2118,41 @@ 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,
'manual_removal_placenta')
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)
Expand All @@ -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)

Expand All @@ -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)
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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==================================
Expand Down
7 changes: 7 additions & 0 deletions src/tlo/methods/newborn_outcomes.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 389a6e9

Please sign in to comment.