Invoicing and invoiceable patients report features refactor#6073
Open
FilinBrChaos wants to merge 14 commits intodevelopfrom
Open
Invoicing and invoiceable patients report features refactor#6073FilinBrChaos wants to merge 14 commits intodevelopfrom
FilinBrChaos wants to merge 14 commits intodevelopfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors the invoicing and invoiceable patients report system by transitioning from a file-based report generation approach to a real-time task-based invoice management system. The changes remove the batch report generation zambda and introduce dynamic task querying with pagination and filtering capabilities.
Changes:
- Removed invoiceable-patients-report zambda and get-patient-and-responsible-party-info zambda; added get-invoices-tasks and sub-refresh-invoice-task zambdas
- Refactored invoice task type definitions and status mappings from PrefilledInvoiceInfo to InvoiceTaskInput with display status helpers
- Updated frontend InvoiceablePatients page to use new API with pagination, filtering, and real-time task status display
Reviewed changes
Copilot reviewed 32 out of 32 changed files in this pull request and generated 12 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/zambdas/src/ehr/get-invoices-tasks/index.ts | New zambda for fetching invoice tasks with pagination and filtering |
| packages/zambdas/src/subscriptions/task/sub-refresh-invoice-task/index.ts | New subscription zambda to refresh invoice task with latest Candid data |
| packages/zambdas/src/subscriptions/task/sub-update-invoice-task/index.ts | Stub zambda with placeholder implementation |
| packages/zambdas/src/subscriptions/task/sub-send-invoice-to-patient/index.ts | Updated to use new status mapping and type names |
| packages/zambdas/src/ehr/update-invoice-task/index.ts | Updated to make invoiceTaskInput optional in validation |
| packages/zambdas/src/cron/create-invoices-tasks/index.ts | Removed logic for updating pending tasks; now only creates new tasks |
| packages/utils/lib/helpers/tasks/invoices-tasks.ts | Added status mapping functions and updated type names |
| packages/utils/lib/types/api/invoicing.types.ts | Consolidated invoice-related types into single file |
| packages/utils/lib/helpers/candidApi.ts | Added findClaimsBy and getCandidInventoryPages helper functions |
| apps/ehr/src/pages/reports/InvoiceablePatients.tsx | Complete refactor from DataGrid-based report to Table with pagination and filters |
| apps/ehr/src/components/dialogs/SendInvoiceToPatientDialog.tsx | Updated to use new report structure instead of separate props |
| apps/ehr/src/components/PatientEncountersGrid.tsx | Removed invoice column and send invoice functionality |
| config/oystehr/zambdas.json | Updated subscription criteria and added new zambdas configuration |
| config/oystehr/roles.json | Removed DENY rules for removed invoiceable-patients-report zambda |
| config/oystehr/buckets.json | Removed INVOICEABLE_PATIENTS_REPORTS bucket configuration |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
packages/zambdas/src/subscriptions/task/sub-refresh-invoice-task/index.ts
Outdated
Show resolved
Hide resolved
packages/zambdas/src/subscriptions/task/sub-update-invoice-task/index.ts
Outdated
Show resolved
Hide resolved
…able-patients-report-features-refactor # Conflicts: # packages/zambdas/src/ehr/invoiceable-patients-report/index.ts
imbenham
reviewed
Feb 17, 2026
imbenham
reviewed
Feb 17, 2026
| pageCount++; | ||
| } else { | ||
| console.log('⚠️ Unexpected response format or failed request on page', pageCount); | ||
| console.log('Response details:', JSON.stringify(inventoryResponse)); |
Contributor
There was a problem hiding this comment.
Is this just going to keep executing because the ids aren't removed from the leftToFindSet? Seems like maybe throwing an error might be better here.
imbenham
reviewed
Feb 17, 2026
imbenham
reviewed
Feb 17, 2026
packages/zambdas/src/subscriptions/task/sub-refresh-invoice-task/index.ts
Outdated
Show resolved
Hide resolved
05388e4 to
e5b3e8d
Compare
…able-patients-report-features-refactor
…able-patients-report-features-refactor
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-1681/invoicing-and-invoiceable-patients-report-features-refactor