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

Decouple ANC logic from tclose #1027

Merged
merged 18 commits into from
Aug 15, 2023
Merged

Conversation

marghe-molaro
Copy link
Collaborator

  • This PR seeks to decouple the logic implemented in PR New t-close dates for maternal HSIs to allow for prioritisation logic #984 from tclose;
  • Required changes have been implemented on the first three HSIs listed below;
  • Inside the HSI, a check is enforced whereby if more than 2 days have passed, the footprint is unchanged but no action is taken. This is consistent with the “tclose= +2days” logic we had previously enforced, although ideally use of consumables should be logged (HSI should still be performed, but wouldn’t be effective at all).

As a separate note: in some of these HSIs, upon checking whether the person is no longer alive, the returned footprint should be blank, rather than unchanged.

HSI_CareOfWomenDuringPregnancy_PostAbortionCaseManagement
“t open” – abortion_onset (mni dictionary)
HSI_Labour_ReceivesSkilledBirthAttendanceDuringLabour
“t open” – la_due_date_current_pregnancy
HSI_Labour_ReceivesComprehensiveEmergencyObstetricCare
“t open” – la_due_date_current_pregnancy (check)
Some changes needed:
HSI_CareOfWomenDuringPregnancy_AntenatalWardInpatientCare
“t open” – Complication onset which needs to be added.
HSI_Labour_ReceivesPostnatalCheck
Depends on if its ‘early’ or ‘late’ PNC…
HSI_NewbornOutcomes_ReceivesPostnatalCheck
Depends on if its ‘early’ or ‘late’ PNC…
HSI_CareOfWomenDuringPregnancy_TreatmentForEctopicPregnancy
Depends if pre or post rupture…

…nancy_PostAbortionCaseManagement, HSI_Labour_ReceivesSkilledBirthAttendanceDuringLabour, HSI_Labour_ReceivesComprehensiveEmergencyObstetricCare
@joehcollins
Copy link
Collaborator

joehcollins commented Jul 20, 2023

To do:

  • Fixes for failing maternal health tests
  • Add logic to reset any of the new 'topen' dates if the event cant run due to constraints
  • Add logic for 'late' PNC issue (newborns and mothers)
  • Also adding in some more error logging
  • Might be good to do a big population run to check if errors are being thrown up

Copy link
Collaborator

@joehcollins joehcollins left a comment

Choose a reason for hiding this comment

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

@marghe-molaro - I think this is done now. If I had more time i'd re-run all the calibrations etc but I think the logic makes sense now. Would you be able to have a look and see what you think? would be good to simplify when we have more time

@marghe-molaro
Copy link
Collaborator Author

Thank you so much @joehcollins !! Just one last thing - it seems that there are still some errors in test_newborn_outcomes.py? Just wanted to check if you had spotted that?

@joehcollins
Copy link
Collaborator

Ahh annoying!! i blindly submitted and hoped for the best!! I'll have a look

(also latest master isnt merged in yet)

@joehcollins
Copy link
Collaborator

Ok fixed - just waiting for confirmation on github

@marghe-molaro
Copy link
Collaborator Author

Great, seems to be passing all tests now! Will review later today and give you any feedback asap!

@tbhallett tbhallett marked this pull request as ready for review August 3, 2023 16:09
src/tlo/methods/care_of_women_during_pregnancy.py Outdated Show resolved Hide resolved
Comment on lines 3021 to 3022
def not_available(self):
self.module.run_if_receives_skilled_birth_attendance_cant_run(self)
Copy link
Collaborator

Choose a reason for hiding this comment

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

don't see how not_available is ever called.

Comment on lines 2727 to 2728
def not_available(self):
self.module.ectopic_pregnancy_treatment_doesnt_run(self)
Copy link
Collaborator

Choose a reason for hiding this comment

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

never called not_available `: delete?

@tbhallett
Copy link
Collaborator

Thanks @joehcollins and @marghe-molaro for this.

It seems fine to me.

I noticed that there were these definitions of not_available throughout the HSI, but I don't think they were ever being called by anything. Let me know if you think I missed something though (and revert that commit if it was planned to be used for something in the future and you'd like to keep them in.)

@joehcollins
Copy link
Collaborator

hi @tbhallett - thanks for reviewing. I can't remember any reason for those functions being used so fine to be removed!!

@tbhallett tbhallett merged commit bbf33e2 into master Aug 15, 2023
55 checks passed
tbhallett added a commit that referenced this pull request Sep 28, 2023
This reverts commit bbf33e2  **** & subsequent changes
tbhallett added a commit that referenced this pull request Oct 2, 2023
* Revert "Decouple ANC logic from tclose (#1027)"

This reverts commit bbf33e2  **** & subsequent changes

* removed old logic relating to pnc_date that should have been rolled back

---------

Co-authored-by: joehcollins <[email protected]>
tbhallett added a commit that referenced this pull request Oct 3, 2023
* Revert "Decouple ANC logic from tclose (#1027)"

This reverts commit bbf33e2  **** & subsequent changes

* Enforce expeption for anc modules during tclose overwriting

* removed old logic relating to pnc_date that should have been rolled back

* Style fixes

* Create scenario file to test if error in anc modules has been solved when overwriting tclose to 10 days

* Increase population size

* Correct CareOfWomenDuringPregnancy

* check module name against a tuple of name of modules

* factorize for DEFAULT_DAYS_OFFSET_VALUE_FOR_TCLOSE_IF_NONE_SPECIFIED

---------

Co-authored-by: Tim Hallett <[email protected]>
Co-authored-by: joehcollins <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants