Mailed statements report and cron synchronization with postgrid#7377
Open
Mailed statements report and cron synchronization with postgrid#7377
Conversation
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <copilot@github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Adds an EHR report and supporting zambdas to list mailed patient statements (PostGrid) over a date range, plus on-demand and scheduled syncing of vendor mail statuses back into FHIR Communication resources.
Changes:
- Persist statement HTML as a
text/htmlattachment in mailed-statementCommunication.payloadfor later preview. - Add zambdas for (1) generating a mailed-statements report and (2) syncing PostGrid letter statuses (HTTP + cron).
- Add an EHR “Mailed Statements” report page, API wiring, and unit tests for the new functionality.
Reviewed changes
Copilot reviewed 22 out of 22 changed files in this pull request and generated 11 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/zambdas/src/subscriptions/task/sub-send-patient-statement-by-mail/index.ts | Stores statement HTML into the mailed Communication payload. |
| packages/zambdas/src/shared/sync-mailed-statement-statuses.ts | Implements PostGrid → FHIR status synchronization for mailed statements. |
| packages/zambdas/src/shared/postgrid.ts | Extends PostGrid letter shape to include additional metadata fields. |
| packages/zambdas/src/shared/index.ts | Re-exports the new sync helper. |
| packages/zambdas/src/ehr/mailed-statements-report/index.ts | New HTTP zambda to fetch and map mailed statement Communications into a report payload. |
| packages/zambdas/src/ehr/mailed-statements-report/validateRequestParameters.ts | Validates report request body + secrets. |
| packages/zambdas/src/ehr/sync-mailed-statement-statuses/index.ts | New HTTP zambda wrapper to run sync on-demand. |
| packages/zambdas/src/ehr/sync-mailed-statement-statuses/validateRequestParameters.ts | Validates sync request secrets. |
| packages/zambdas/src/cron/sync-mailed-statement-statuses/index.ts | New cron zambda wrapper to run sync on a schedule. |
| packages/utils/lib/types/api/mailed-statements-report.types.ts | Adds shared API types for report + sync outputs. |
| packages/utils/lib/types/api/index.ts | Exports the new API types. |
| config/oystehr-core/zambdas.json | Registers the new report and sync zambdas (HTTP + cron). |
| apps/ehr/src/api/api.ts | Adds client calls for the new report + sync zambdas. |
| apps/ehr/src/pages/reports/MailedStatements.tsx | New EHR report UI with grid, preview, and “sync statuses” action. |
| apps/ehr/src/pages/reports/index.ts | Exports the new report page. |
| apps/ehr/src/pages/Reports.tsx | Adds a Reports tile entry for Mailed Statements. |
| apps/ehr/src/App.tsx | Adds route for the new report page. |
| packages/zambdas/test/unit/*.test.ts | Adds unit tests for PostGrid fetch, sync behavior, and report mapping/validation. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <copilot@github.com>
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.
No description provided.