-
Notifications
You must be signed in to change notification settings - Fork 16
Description
There appear to be an inconsistency within the HSI HSI_CardioMetabolicDisorders_Refill_Medication.
As per the HSI description,
TLOmodel/src/tlo/methods/cardio_metabolic_disorders.py
Lines 1664 to 1665 in e371450
| If the person is flagged as not being on medication, then the event does nothing and returns a blank footprint. | |
| If it does not run, then person ceases to be on medication and no further refill HSI are scheduled. |
the HSI ensures that if a person is not on treatment, the appt footprint is returned as blank, no further HSIs are scheduled, and the rest of the HSI doesn't run.
TLOmodel/src/tlo/methods/cardio_metabolic_disorders.py
Lines 1693 to 1696 in e371450
| if not person[f'nc_{self.condition}_on_medication']: | |
| # This person is not on medication so will not have this HSI | |
| # Return the blank_appt_footprint() so that this HSI does not occupy any time resources | |
| return self.sim.modules['HealthSystem'].get_blank_appt_footprint() |
If, on the other hand, a person is on treatment, the HSI goes ahead and checks whether relevant consumables are available.
If these are not available, it is assumed that the person will come back again the next day to get a refill with a probability controlled by parameter pr_seeking_further_appt_if_drug_not_available which
TLOmodel/src/tlo/methods/cardio_metabolic_disorders.py
Lines 1723 to 1733 in e371450
| # If person 'decides to' seek another appointment, schedule a new HSI appointment for tomorrow. | |
| # NB. With a probability of 1.0, this will keep occurring, and the person will never give-up coming back to | |
| # pick-up medication. | |
| if (m.rng.random_sample() < | |
| m.parameters[f'{self.condition}_hsi'].get('pr_seeking_further_appt_if_drug_not_available')): | |
| self.sim.modules['HealthSystem'].schedule_hsi_event( | |
| hsi_event=self, | |
| topen=self.sim.date + pd.DateOffset(days=1), | |
| tclose=self.sim.date + pd.DateOffset(days=15), | |
| priority=1 | |
| ) |
For all conditions except lower back pain, is quite high (80%)
./cmd/ResourceFile_cmd_condition_hsi/hypertension.csv:pr_seeking_further_appt_if_drug_not_available,0.8,,
./cmd/ResourceFile_cmd_condition_hsi/chronic_kidney_disease.csv:pr_seeking_further_appt_if_drug_not_available,0.8,,
./cmd/ResourceFile_cmd_condition_hsi/chronic_lower_back_pain.csv:pr_seeking_further_appt_if_drug_not_available,0.1,,
./cmd/ResourceFile_cmd_condition_hsi/diabetes.csv:pr_seeking_further_appt_if_drug_not_available,0.8,,
./cmd/ResourceFile_cmd_condition_hsi/chronic_ischemic_hd.csv:pr_seeking_further_appt_if_drug_not_available,0.8,,
However, because the treatment status in this case is set to False, when the person comes back the following day they immediately fall off treatment (as described above), and will have no opportunity to seek further appts, despite initially assuming that this should happen with 80% probability.
TLOmodel/src/tlo/methods/cardio_metabolic_disorders.py
Lines 1721 to 1722 in e371450
| # If medication was not available, the person ceases to be taking medication | |
| df.at[person_id, f'nc_{self.condition}_on_medication'] = False |
Unless we are missing something, this suggests an inconsistency in the HSI logic.
Because the HSI's did_not_run also sets the treatment status to False, this also means that any delays in the HSI also cause the person to immediately fall off treatment, as described in Issue #1632