From 0a39eb2472401c6d0497797fadbcf91cee63d460 Mon Sep 17 00:00:00 2001 From: Mohammed Nihal <57055998+nihal467@users.noreply.github.com> Date: Tue, 5 Nov 2024 23:49:10 +0530 Subject: [PATCH] part of HCX workflow --- .env | 3 +- cypress/e2e/hcx_spec/HcxClaims.cy.ts | 64 +++++++++++++++++++ cypress/pageobject/Hcx/HcxClaims.ts | 9 +++ .../pageobject/Patient/PatientConsultation.ts | 16 +++++ cypress/pageobject/Patient/PatientCreation.ts | 4 ++ .../pageobject/Patient/PatientInsurance.ts | 4 ++ src/components/HCX/PolicyEligibilityCheck.tsx | 2 + src/components/Patient/PatientHome.tsx | 1 + 8 files changed, 102 insertions(+), 1 deletion(-) create mode 100644 cypress/e2e/hcx_spec/HcxClaims.cy.ts create mode 100644 cypress/pageobject/Hcx/HcxClaims.ts diff --git a/.env b/.env index ebc0ebd5be3..9e76793dcdb 100644 --- a/.env +++ b/.env @@ -14,4 +14,5 @@ ESLINT_NO_DEV_ERRORS=true CARE_CDN_URL="https://egov-s3-facility-10bedicu.s3.amazonaws.com https://egov-s3-patient-data-10bedicu.s3.amazonaws.com http://localhost:4566" REACT_ALLOWED_LOCALES="en,hi,ta,ml,mr,kn" -REACT_ENABLED_APPS="ohcnetwork/care_livekit_fe@main" +REACT_ENABLED_APPS="ohcnetwork/care_livekit_fe@main,ohcnetwork/care_hcx_fe@main" +REACT_ENABLE_HCX=true \ No newline at end of file diff --git a/cypress/e2e/hcx_spec/HcxClaims.cy.ts b/cypress/e2e/hcx_spec/HcxClaims.cy.ts new file mode 100644 index 00000000000..67535f8d6f6 --- /dev/null +++ b/cypress/e2e/hcx_spec/HcxClaims.cy.ts @@ -0,0 +1,64 @@ +import { PatientConsultationPage } from "pageobject/Patient/PatientConsultation"; +import LoginPage from "../../pageobject/Login/LoginPage"; +import { PatientPage } from "../../pageobject/Patient/PatientCreation"; +import PatientInsurance from "pageobject/Patient/PatientInsurance"; +import { HcxClaims } from "pageobject/Hcx/HcxClaims"; + +describe("HCX Claims configuration and approval workflow", () => { + const loginPage = new LoginPage(); + const patientPage = new PatientPage(); + const patientConsultationPage = new PatientConsultationPage(); + const patientInsurance = new PatientInsurance(); + const hcxClaims = new HcxClaims(); + const hcxPatientName = "Dummy Patient 14"; + const firstInsuranceIdentifier = "insurance-details-0"; + const patientMemberId = "001"; + const patientPolicyId = "100"; + const patientInsurerName = "Demo Payor"; + + before(() => { + loginPage.loginAsDisctrictAdmin(); + cy.saveLocalStorage(); + }); + + beforeEach(() => { + cy.restoreLocalStorage(); + cy.clearLocalStorage(/filters--.+/); + cy.awaitUrl("/patients"); + }); + + it("Verify the HCX Workflow for a patient", () => { + // Modify the insurance for a facility + patientPage.visitPatient(hcxPatientName); + patientConsultationPage.clickPatientDetails(); + patientPage.clickPatientUpdateDetails(); + patientInsurance.clickAddInsruanceDetails(); + patientInsurance.typePatientInsuranceDetail( + firstInsuranceIdentifier, + "subscriber_id", + patientMemberId, + ); + patientInsurance.typePatientInsuranceDetail( + firstInsuranceIdentifier, + "policy_id", + patientPolicyId, + ); + patientInsurance.selectHcxInsurer(patientInsurerName); + cy.submitButton("Save Details"); + cy.verifyNotification("Patient updated successfully"); + patientConsultationPage.clickViewConsultationButton(); + // Raise a HCX Pre-auth + patientConsultationPage.clickManagePatientButton(); + patientConsultationPage.clickClaimsButton(); + hcxClaims.selectEligiblePolicy(patientInsurerName); + hcxClaims.verifyPolicyEligibity(); + cy.verifyNotification("Checking Policy Eligibility"); + cy.closeNotification(); + // Raise a HCX Claim + // Approve the HCX from there website + }); + + afterEach(() => { + cy.saveLocalStorage(); + }); +}); diff --git a/cypress/pageobject/Hcx/HcxClaims.ts b/cypress/pageobject/Hcx/HcxClaims.ts new file mode 100644 index 00000000000..93e62c639a2 --- /dev/null +++ b/cypress/pageobject/Hcx/HcxClaims.ts @@ -0,0 +1,9 @@ +export class HcxClaims { + selectEligiblePolicy(policy: string) { + cy.clickAndSelectOption("#select-insurance-policy", policy); + } + + verifyPolicyEligibity() { + cy.verifyAndClickElement("#check-eligibity", "Check Eligibility"); + } +} diff --git a/cypress/pageobject/Patient/PatientConsultation.ts b/cypress/pageobject/Patient/PatientConsultation.ts index e0b51b9265e..60f36ad289b 100644 --- a/cypress/pageobject/Patient/PatientConsultation.ts +++ b/cypress/pageobject/Patient/PatientConsultation.ts @@ -13,6 +13,7 @@ export class PatientConsultationPage { selectSymptomsDate(date: string) { cy.clickAndTypeDate("#symptoms_onset_date", date); } + clickAddSymptom() { cy.get("#add-symptom").click(); } @@ -111,4 +112,19 @@ export class PatientConsultationPage { ); cy.wait(3000); } + + clickViewConsultationButton() { + cy.verifyAndClickElement( + "#view_consulation_updates", + "View Consultation / Consultation Updates", + ); + } + + clickManagePatientButton() { + cy.verifyAndClickElement("#show-more", "Manage Patient"); + } + + clickClaimsButton() { + cy.verifyAndClickElement("#consultation-buttons", "Claims"); + } } diff --git a/cypress/pageobject/Patient/PatientCreation.ts b/cypress/pageobject/Patient/PatientCreation.ts index 41b3c02977d..8c9dd4a1c1b 100644 --- a/cypress/pageobject/Patient/PatientCreation.ts +++ b/cypress/pageobject/Patient/PatientCreation.ts @@ -220,6 +220,10 @@ export class PatientPage { cy.visit(patient_url + "/update"); } + clickPatientUpdateDetails() { + cy.verifyAndClickElement("#update-patient-details", "Patient Details"); + } + interceptFacilities() { cy.intercept("GET", "**/facility/*/patient/**").as("getFacilities"); } diff --git a/cypress/pageobject/Patient/PatientInsurance.ts b/cypress/pageobject/Patient/PatientInsurance.ts index 1b91d27b629..c7daada2cc2 100644 --- a/cypress/pageobject/Patient/PatientInsurance.ts +++ b/cypress/pageobject/Patient/PatientInsurance.ts @@ -63,6 +63,10 @@ class PatientInsurance { } }); } + + selectHcxInsurer(insurer: string) { + cy.typeAndSelectOption("#insurer", insurer); + } } export default PatientInsurance; diff --git a/src/components/HCX/PolicyEligibilityCheck.tsx b/src/components/HCX/PolicyEligibilityCheck.tsx index fa02baaea30..1569ea42981 100644 --- a/src/components/HCX/PolicyEligibilityCheck.tsx +++ b/src/components/HCX/PolicyEligibilityCheck.tsx @@ -69,6 +69,7 @@ export default function HCXPolicyEligibilityCheck({
{ )}