Skip to content

fix credit card on file indicator and adjust insurance/self-pay toggle#6802

Merged
rzinger merged 8 commits intorelease/1.31from
rzinger/otr-2148-rcm-ehr-on-visit-details-screen-credit-card-on-file
Apr 2, 2026
Merged

fix credit card on file indicator and adjust insurance/self-pay toggle#6802
rzinger merged 8 commits intorelease/1.31from
rzinger/otr-2148-rcm-ehr-on-visit-details-screen-credit-card-on-file

Conversation

@rzinger
Copy link
Copy Markdown
Contributor

@rzinger rzinger commented Apr 1, 2026

…e visually some

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

This PR updates the EHR patient payments UI to keep the “card on file” indicator in sync after payment-related actions and refines the payer (insurance/self-pay/employer) toggle styling/behavior.

Changes:

  • Added a refresh mechanism to re-fetch card-on-file status after closing the payment dialog and after successful payments.
  • Adjusted post-payment flow to close the payment dialog once the payment appears, while receipt creation continues asynchronously.
  • Updated the payer toggle button group styling and accessibility labeling.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread apps/ehr/src/components/PatientPaymentsList.tsx
Comment thread apps/ehr/src/components/PatientPaymentsList.tsx
Comment thread apps/ehr/src/components/PatientPaymentsList.tsx Outdated
@rzinger rzinger changed the base branch from develop to release/1.31 April 1, 2026 21:31
Comment thread apps/ehr/src/components/PatientPaymentsList.tsx Outdated
Comment thread apps/ehr/src/components/PatientPaymentsList.tsx Outdated
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 1 out of 1 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread apps/ehr/src/components/PatientPaymentsList.tsx
Comment thread apps/ehr/src/components/PatientPaymentsList.tsx Outdated
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 1 out of 1 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread apps/ehr/src/components/PatientPaymentsList.tsx Outdated
Comment thread apps/ehr/src/components/PatientPaymentsList.tsx Outdated
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 1 out of 1 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread apps/ehr/src/components/PatientPaymentsList.tsx Outdated
Comment thread apps/ehr/src/components/PatientPaymentsList.tsx Outdated
Comment thread apps/ehr/src/components/PatientPaymentsList.tsx Outdated
cancelled = true;
};
}, [oystehrZambda, patient?.id, appointment?.id, cardOnFileRefreshCounter]);
void refetchCardOnFile();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Don't you want to be doing this when the dialog opens? It could be a long time before it is reopened, and the data you fetch here could go stale before the next open.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

may be i'm not parsing, but usually after dialog closes is because they made some sort of change... i don't think i wanna do it on open?

isFetched: cardOnFileKnown,
refetch: refetchCardOnFile,
} = useQuery({
queryKey: ['card-on-file', patient?.id, appointment?.id],
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The patient.id and the appointment.id are accessed safely in the query key, but then banged in the query fn. Should safely check for no value and just return false rather than hitting the zambda.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

updated to this:

useQuery({
    queryKey: ['card-on-file', patient?.id, appointment?.id],
    queryFn: async () => {
      if (!oystehrZambda || !patient?.id || !appointment?.id) return false;
      const result = await oystehrZambda.zambda.execute({
        id: 'payment-methods-list',
        beneficiaryPatientId: patient.id,
        appointmentId: appointment.id,
      });
      return deriveCardOnFileStatus(result.output);
    },

@rzinger rzinger requested a review from imbenham April 2, 2026 17:27
@rzinger rzinger merged commit ccd89a8 into release/1.31 Apr 2, 2026
20 checks passed
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