Skip to content

Insurance otr 1373#5255

Merged
saewitz merged 5 commits intodevelopfrom
insurance-otr-1373
Dec 4, 2025
Merged

Insurance otr 1373#5255
saewitz merged 5 commits intodevelopfrom
insurance-otr-1373

Conversation

@saewitz
Copy link
Contributor

@saewitz saewitz commented Nov 25, 2025

No description provided.

@alexwillingham alexwillingham changed the base branch from release/1.22 to develop November 26, 2025 14:51
copay = parseObjectsToCopayBenefits(benefitList).filter(
(benefit) => benefit.coverageCode === 'A' || benefit.coverageCode === 'B'
);
deductible = parseObjectsToCopayBenefits(benefitList).filter((benefit) => benefit.coverageCode === 'C');
Copy link
Contributor

Choose a reason for hiding this comment

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

We can use a const to calculate parseObjectsToCopayBenefits(benefitList) once, and use an IIFE or reduce to filter data within one iteration.

(copay) =>
copay.code === '30' && copay.coverageCode === 'C' && copay.levelCode === 'IND' && copay.periodCode === '29'
)?.amountInUSD;

Copy link
Contributor

Choose a reason for hiding this comment

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

Let's move this to a helper function. It can use useGetPatientAccount and useGetPatientCoverages under the hood to provide a useful abstraction and to avoid using low-level logic in high-level components.

saewitz and others added 4 commits December 1, 2025 21:30
Signed-off-by: Jonathan Saewitz <48358905+saewitz@users.noreply.github.com>
Signed-off-by: Jonathan Saewitz <48358905+saewitz@users.noreply.github.com>
export interface InsuranceCheckStatusWithDate {
status: InsuranceEligibilityCheckStatus;
dateISO: string;
copay?: PatientPaymentBenefit[];
Copy link
Contributor

Choose a reason for hiding this comment

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

Don't you have stronger types you can use here? There is a "CopayBenefit" in the union type "PatientPaymentBenefit", and likewise with "DeductibleBenefit", but then the "copay" and "deductible" fields can both include their titular type, plus any others in the union. If there is a good reason for this it would be nice to have a comment because this was all reading very clearly to me until i got to this last interface.

@saewitz saewitz merged commit ef1f387 into develop Dec 4, 2025
12 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.

5 participants