Skip to content

Invoicing and invoiceable patients report features refactor#6073

Open
FilinBrChaos wants to merge 13 commits intodevelopfrom
plyshnykov/otr-1681-invoicing-and-invoiceable-patients-report-features-refactor
Open

Invoicing and invoiceable patients report features refactor#6073
FilinBrChaos wants to merge 13 commits intodevelopfrom
plyshnykov/otr-1681-invoicing-and-invoiceable-patients-report-features-refactor

Conversation

@FilinBrChaos
Copy link
Contributor

Copy link
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

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.

…able-patients-report-features-refactor

# Conflicts:
#	packages/zambdas/src/ehr/invoiceable-patients-report/index.ts
pageCount++;
} else {
console.log('⚠️ Unexpected response format or failed request on page', pageCount);
console.log('Response details:', JSON.stringify(inventoryResponse));
Copy link
Contributor

Choose a reason for hiding this comment

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

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 imbenham requested a review from rzinger February 17, 2026 00:37
@FilinBrChaos FilinBrChaos force-pushed the plyshnykov/otr-1681-invoicing-and-invoiceable-patients-report-features-refactor branch 3 times, most recently from 05388e4 to e5b3e8d Compare February 17, 2026 16:42
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.

2 participants