Core completion calculation needs to take into consideration whether a donor has a MissingEntityException. If they do, then the Treatment and Follow-up entities are not required to be core complete.
The mechanism for calculating core completion stats has been standardized - there are no longer different calculation cases that behave differently based on overrides or completion state. Now, core completion calculation will always result in the same result for a given donor.
Core-Completion is triggered by:
Data registration
Data submission
Dictionary migration
This removes the patch endpoint that allows admin to "override" core calculation stats. The CompletionStats object has had this override property removed and all the calculation logic that used these overrides are removed. A migration is included to remove all overrides from teh database. It has been checked that this feature was never used in the current ARGO data set so this migration is added to ensure consistency, though we don't expect to have any actual cases to update.
A caching utility for MissingEntityExceptions was created as a performance consideration to help when fetching exceptions for many donors. Using this cache to access the MissingEntityException repo will prevent repeatedly fetching exceptions for the same program when you are fetching exceptions for a long list of donors.
[x] Remove core completion override logic, including Admin patch endpoint to override core completion stats
[x] Migration added to remove all references to override
[x] Update core-completion logic to always be consistent (no calculate if flags)
[x] Centralize code that calls for core completion updates
[x] Add missing-entity-exceptions into core completion logic
Checklist
Type of Change
[ ] Bug
[x] Refactor
[x] New Feature
[ ] Release Candidate
Checklist before requesting review:
[x] Check branch (code change PRs go to develop not master) (intentionally into feature branch)
[x] Check copyrights for new files
[ ] Manual testing
[ ] Regression tests completed and passing (double check number of tests).
[x] Spelling has been checked.
[x] Updated swagger docs accordingly (check it's still valid)
[ ] Set validationDependency in meta tag for Argo Dictionary fields used in code
Link to Issue
Description
Core completion calculation needs to take into consideration whether a donor has a MissingEntityException. If they do, then the Treatment and Follow-up entities are not required to be core complete.
The mechanism for calculating core completion stats has been standardized - there are no longer different calculation cases that behave differently based on overrides or completion state. Now, core completion calculation will always result in the same result for a given donor.
Core-Completion is triggered by:
This removes the patch endpoint that allows admin to "override" core calculation stats. The CompletionStats object has had this override property removed and all the calculation logic that used these overrides are removed. A migration is included to remove all overrides from teh database. It has been checked that this feature was never used in the current ARGO data set so this migration is added to ensure consistency, though we don't expect to have any actual cases to update.
A caching utility for MissingEntityExceptions was created as a performance consideration to help when fetching exceptions for many donors. Using this cache to access the MissingEntityException repo will prevent repeatedly fetching exceptions for the same program when you are fetching exceptions for a long list of donors.
Checklist
Type of Change
Checklist before requesting review:
(code change PRs go to(intentionally into feature branch)develop
not master)validationDependency
in meta tag for Argo Dictionary fields used in code