@@ -900,8 +900,11 @@ def kangaroo_mother_care(self, hsi_event):
900900 if (df .at [person_id , 'nb_low_birth_weight_status' ] != 'normal_birth_weight' ) or \
901901 (df .at [person_id , 'nb_low_birth_weight_status' ] != 'macrosomia' ):
902902
903+ kmc_delivered = pregnancy_helper_functions .check_int_deliverable (
904+ self , int_name = 'kmc' , hsi_event = hsi_event , q_param = [params ['prob_kmc_available' ]])
905+
903906 # Check KMC can be delivered
904- if self . rng . random_sample () < params [ 'prob_kmc_available' ] :
907+ if kmc_delivered :
905908 # Store treatment as a property of the newborn used to apply treatment effect
906909 df .at [person_id , 'nb_kangaroo_mother_care' ] = True
907910
@@ -952,42 +955,38 @@ def assessment_and_treatment_newborn_sepsis(self, hsi_event, facility_type):
952955 """
953956 df = self .sim .population .props
954957 person_id = int (hsi_event .target )
958+ l_params = self .sim .modules ['Labour' ].current_parameters
959+ pnc_location = 'hc' if facility_type == '1a' else 'hp'
955960
956961 # We assume that only hospitals are able to deliver full supportive care for neonatal sepsis, full supportive
957962 # care evokes a stronger treatment effect than injectable antibiotics alone
958963
959964 if df .at [person_id , 'nb_early_onset_neonatal_sepsis' ] or df .at [person_id , 'pn_sepsis_late_neonatal' ] or \
960965 df .at [person_id , 'pn_sepsis_early_neonatal' ]:
961966
962- # Run HCW check
963- sf_check = pregnancy_helper_functions .check_emonc_signal_function_will_run (self .sim .modules ['Labour' ],
964- sf = 'iv_abx' ,
965- hsi_event = hsi_event )
966967 if facility_type != '1a' :
967968
968- # check consumables
969- avail = pregnancy_helper_functions . return_cons_avail (
970- self , hsi_event ,
969+ neo_sepsis_treatment_delivered = pregnancy_helper_functions . check_int_deliverable (
970+ self , int_name = 'neo_sepsis_treatment_supp_care' , hsi_event = hsi_event ,
971+ q_param = [ l_params [ 'prob_hcw_avail_iv_abx' ], l_params [ f'mean_hcw_competence_ { pnc_location } ' ]] ,
971972 cons = self .item_codes_nb_consumables ['sepsis_supportive_care_core' ],
972- opt_cons = self .item_codes_nb_consumables ['sepsis_supportive_care_optional' ])
973+ opt_cons = self .item_codes_nb_consumables ['sepsis_supportive_care_optional' ],
974+ equipment = {'Drip stand' , 'Infusion pump' })
973975
974- # Then, if the consumables are available, treatment for sepsis is delivered
975- if avail and sf_check :
976+ if neo_sepsis_treatment_delivered :
976977 df .at [person_id , 'nb_supp_care_neonatal_sepsis' ] = True
977- pregnancy_helper_functions .log_met_need (self , 'neo_sep_supportive_care' , hsi_event )
978- hsi_event .add_equipment ({'Drip stand' , 'Infusion pump' })
979978
980979 # The same pattern is then followed for health centre care
981980 else :
982- avail = pregnancy_helper_functions .return_cons_avail (
983- self , hsi_event ,
981+ neo_sepsis_treatment_delivered = pregnancy_helper_functions .check_int_deliverable (
982+ self , int_name = 'neo_sepsis_treatment_abx' , hsi_event = hsi_event ,
983+ q_param = [l_params ['prob_hcw_avail_iv_abx' ], l_params [f'mean_hcw_competence_{ pnc_location } ' ]],
984984 cons = self .item_codes_nb_consumables ['sepsis_abx' ],
985- opt_cons = self .item_codes_nb_consumables ['iv_drug_equipment' ])
985+ opt_cons = self .item_codes_nb_consumables ['iv_drug_equipment' ],
986+ equipment = {'Drip stand' , 'Infusion pump' })
986987
987- if avail and sf_check :
988+ if neo_sepsis_treatment_delivered :
988989 df .at [person_id , 'nb_inj_abx_neonatal_sepsis' ] = True
989- pregnancy_helper_functions .log_met_need (self , 'neo_sep_abx' , hsi_event )
990- hsi_event .add_equipment ({'Drip stand' , 'Infusion pump' , 'Oxygen cylinder, with regulator' })
991990
992991 def link_twins (self , child_one , child_two , mother_id ):
993992 """
0 commit comments