Skip to content

Added task for regenerate visit note pdf when addendum note updates#7288

Open
FilinBrChaos wants to merge 7 commits intodevelopfrom
plyshnykov/otr-456-visit-note-pdf-updated-text-from-addendum-should-be-updated
Open

Added task for regenerate visit note pdf when addendum note updates#7288
FilinBrChaos wants to merge 7 commits intodevelopfrom
plyshnykov/otr-456-visit-note-pdf-updated-text-from-addendum-should-be-updated

Conversation

@FilinBrChaos
Copy link
Copy Markdown
Contributor

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-email and skips sending the completion email in that case.
  • Introduces getChartDataPostChangeTasks to centralize post-save/delete side-effect Task creation (currently addendum → regenerate visit note PDF).
  • Wires save-chart-data and delete-chart-data to 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.

Comment thread packages/zambdas/src/ehr/delete-chart-data/index.ts Outdated
Comment thread packages/zambdas/src/ehr/delete-chart-data/helpers.ts
Comment thread packages/zambdas/src/shared/chart-data/post-change-tasks.ts Outdated
Comment thread packages/zambdas/src/shared/chart-data/post-change-tasks.ts
Comment thread packages/zambdas/src/subscriptions/task/sub-visit-note-pdf-and-email/index.ts Outdated
Comment thread packages/zambdas/src/subscriptions/task/sub-visit-note-pdf-and-email/index.ts Outdated
Comment thread packages/zambdas/src/ehr/save-chart-data/index.ts Outdated
Comment thread packages/zambdas/src/ehr/delete-chart-data/index.ts Outdated
Comment thread packages/zambdas/src/ehr/delete-chart-data/index.ts Outdated
Comment thread packages/zambdas/src/ehr/save-chart-data/index.ts Outdated
Comment thread packages/zambdas/src/shared/chart-data/post-change-tasks.ts Outdated
Comment thread packages/zambdas/src/shared/chart-data/post-change-tasks.ts
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread packages/zambdas/src/shared/chart-data/post-change-tasks.ts Outdated
Comment thread packages/zambdas/src/subscriptions/task/sub-visit-note-pdf-and-email/index.ts Outdated
Comment thread packages/zambdas/src/subscriptions/task/sub-visit-note-pdf-and-email/index.ts Outdated
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.

3 participants