Added task for regenerate visit note pdf when addendum note updates#7288
Open
FilinBrChaos wants to merge 7 commits intodevelopfrom
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds an automatic “regenerate visit note PDF” side-effect when an addendum note is updated on a finished encounter, and updates the visit-note PDF task handler to avoid sending completion emails during regenerations.
Changes:
- Detects “regeneration” runs in
sub-visit-note-pdf-and-emailand skips sending the completion email in that case. - Introduces
getChartDataPostChangeTasksto centralize post-save/delete side-effect Task creation (currently addendum → regenerate visit note PDF). - Wires
save-chart-dataanddelete-chart-datato create post-change Tasks, and ensures delete-chart-data resource fetch includes the Appointment.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/zambdas/src/subscriptions/task/sub-visit-note-pdf-and-email/index.ts | Adds regeneration detection (via existing DocRefs) and suppresses completion email when regenerating. |
| packages/zambdas/src/shared/chart-data/post-change-tasks.ts | New helper to compute post-change Tasks (addendum change → regeneration Task). |
| packages/zambdas/src/ehr/save-chart-data/index.ts | Creates post-change Tasks after the chart-data transaction commits. |
| packages/zambdas/src/ehr/delete-chart-data/index.ts | Creates post-change Tasks after the delete transaction commits. |
| packages/zambdas/src/ehr/delete-chart-data/helpers.ts | Includes Encounter:appointment in related-resource fetch to support post-change Task creation. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
https://linear.app/zapehr/issue/OTR-456/visit-note-pdf-updated-text-from-addendum-should-be-updated-in-visit