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

Fixing recurrence of HSIs in RTI #1408

Merged
merged 6 commits into from
Jul 10, 2024
Merged

Fixing recurrence of HSIs in RTI #1408

merged 6 commits into from
Jul 10, 2024

Conversation

thewati
Copy link
Collaborator

@thewati thewati commented Jul 1, 2024

Fixing recurring HSI_Events of RTI module. Reworked logic #1403

@thewati thewati self-assigned this Jul 1, 2024
@thewati thewati linked an issue Jul 1, 2024 that may be closed by this pull request
@tbhallett tbhallett added this to In progress in PR priorities via automation Jul 1, 2024
@tbhallett tbhallett moved this from In progress to Ready for EM review in PR priorities Jul 1, 2024
Copy link
Collaborator

@tbhallett tbhallett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GREAT work, thanks very much.

src/tlo/methods/rti.py Outdated Show resolved Hide resolved
src/tlo/methods/rti.py Outdated Show resolved Hide resolved
src/tlo/methods/rti.py Show resolved Hide resolved
src/tlo/methods/rti.py Outdated Show resolved Hide resolved
src/tlo/methods/rti.py Outdated Show resolved Hide resolved
src/tlo/methods/rti.py Outdated Show resolved Hide resolved
Comment on lines 4481 to 4482
if pd.isnull(df.loc[person_id, 'rt_date_death_no_med']):
df.loc[person_id, 'rt_date_death_no_med'] = self.sim.date + DateOffset(days=7)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same comment as above about moving this outside the new clause.

src/tlo/methods/rti.py Outdated Show resolved Hide resolved
resources/ResourceFile_RTI.xlsx Outdated Show resolved Hide resolved
src/tlo/methods/rti.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@tbhallett tbhallett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks again @thewati

I just made those few other changes about the positioning of some of those places where there is writing the sim.populations.props dataframe. I think these changes ensure that we preserve the logic that was originally intended. Let me know if it looks right to you....?

src/tlo/methods/rti.py Outdated Show resolved Hide resolved
src/tlo/methods/rti.py Outdated Show resolved Hide resolved
Comment on lines 4247 to 4250
if self._number_of_times_this_event_has_run < self._maximum_number_times_event_should_run:
self.sim.modules['RTI'].schedule_hsi_event_for_tomorrow(self)
if pd.isnull(df.loc[person_id, 'rt_date_death_no_med']):
df.loc[person_id, 'rt_date_death_no_med'] = self.sim.date + DateOffset(days=7)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if self._number_of_times_this_event_has_run < self._maximum_number_times_event_should_run:
self.sim.modules['RTI'].schedule_hsi_event_for_tomorrow(self)
if pd.isnull(df.loc[person_id, 'rt_date_death_no_med']):
df.loc[person_id, 'rt_date_death_no_med'] = self.sim.date + DateOffset(days=7)
if self._number_of_times_this_event_has_run < self._maximum_number_times_event_should_run:
self.sim.modules['RTI'].schedule_hsi_event_for_tomorrow(self)
if pd.isnull(df.loc[person_id, 'rt_date_death_no_med']):
df.loc[person_id, 'rt_date_death_no_med'] = self.sim.date + DateOffset(days=7)

src/tlo/methods/rti.py Outdated Show resolved Hide resolved
src/tlo/methods/rti.py Outdated Show resolved Hide resolved
@tbhallett tbhallett removed the request for review from sakshimohan July 3, 2024 21:58
@tbhallett tbhallett moved this from Ready for EM review to Ready to merge in PR priorities Jul 8, 2024
@tbhallett
Copy link
Collaborator

Thanks again @thewati -- this looks good to me now.

@tbhallett tbhallett merged commit 5920f51 into master Jul 10, 2024
59 checks passed
@tbhallett tbhallett deleted the wati/rti_hsi_recurrence branch July 10, 2024 06:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
PR priorities
Ready to merge
Development

Successfully merging this pull request may close these issues.

Recurrence of HSI_Events in RTI module when consumables not available
2 participants