Safely catch HSIs with different officers required for actual_appt_footprint in mode_appt_constraints = 2 #1091
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #1089
The HSI likely to have caused issue #1089 has been identified in issue #1090, and this is currently being addressed. However more HSIs - whether already in the code or introduced in the future by new modules - may similarly clash with mode_appt_constraints = 2 and lead to a KeyError if their actual_appt_footprint requires different medical officers than their expected one. Because this clash will only manifest itself under specific and random circumstances (i.e. all officers required for the expected_footprint still have capabilities but those for the actual_footprint do not), some such HSIs may go undetected for a long time. It would therefore be preferable to ensure that these can be safely identified in future runs in mode_appt_constraints = 2 without leading to error, but flagging the issue as a warning, as done in this PR. As the incidence of this error at present appears to be very low, this is unlikely to significantly affect results relying on this warning.