Skip to content

FLAG-89: Trigger flag re-evaluation on Condition save and bulk updates#109

Open
Mohammed-Atef2004 wants to merge 1 commit intoopenmrs:masterfrom
Mohammed-Atef2004:FLAG-89-fix-condition-reevaluation
Open

FLAG-89: Trigger flag re-evaluation on Condition save and bulk updates#109
Mohammed-Atef2004 wants to merge 1 commit intoopenmrs:masterfrom
Mohammed-Atef2004:FLAG-89-fix-condition-reevaluation

Conversation

@Mohammed-Atef2004
Copy link

@Mohammed-Atef2004 Mohammed-Atef2004 commented Mar 25, 2026

Description of what I changed

This PR fixes an issue where patient flags were not being re-evaluated when clinical conditions were updated.

Technical Highlights:

  • Enhanced Interception: Updated ConditionServiceAdvice to intercept saving, voiding, and purging of conditions.
  • Bulk Operation Support: Added support for Collection<Condition> to handle methods like saveConditions(), ensuring flags are updated even in batch updates.
  • Type Safety: Improved patient identification logic using instanceof checks to prevent potential ClassCastException.
  • Performance Optimization: Ensured that flag generation is triggered once per patient during bulk updates to avoid redundant background tasks.

Issue I worked on

see FLAG-89

Checklist: I completed these to help reviewers

  • My IDE is configured to follow the code style of this project.
  • I have added tests to cover my changes. (Verified the AOP logic locally within the api module).
  • I ran mvn clean package right before creating this pull request.
  • All API module tests passed (81 tests).

Note on Build Failure: There is a pre-existing failure in the FHIR module (FlagSearchQueryTest). I have verified that this occurs on the master branch as well and is unrelated to the changes in this PR.

  • My pull request is based on the latest changes of the master branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant