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

Safely catch HSIs with different officers required for actual_appt_footprint in mode_appt_constraints = 2 #1091

Merged
merged 1 commit into from
Sep 12, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion src/tlo/methods/healthsystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -2456,7 +2456,14 @@ def process_events_mode_2(self, hold_over: List[HSIEventQueueItem]) -> None:
# remove them from list of available officers.
for officer, call in updated_call.items():
if capabilities_monitor[officer] <= 0:
set_capabilities_still_available.remove(officer)
if officer in set_capabilities_still_available:
set_capabilities_still_available.remove(officer)
else:
logger.warning(
key="message",
data=(f"{event.TREATMENT_ID} actual_footprint requires different"
f"officers than expected_footprint.")
)

# Update today's footprint based on actuall call and squeeze factor
self.module.running_total_footprint -= original_call
Expand Down