diff --git a/.gitignore b/.gitignore
index d02d753ca3d..d8e2615c727 100644
--- a/.gitignore
+++ b/.gitignore
@@ -32,7 +32,7 @@ public/build-meta.json
!.vscode/launch.json
src/supportedBrowsers.ts
-# Reason React
+# Reason React
/lib/bs/**
.merlin
*.bs.js
diff --git a/README.md b/README.md
index fd5328150f2..9fed52b00c0 100644
--- a/README.md
+++ b/README.md
@@ -35,6 +35,12 @@
```sh
npm install
```
+#### Run the following command to generate the `supportedBrowsers.ts` file:
+
+```bash
+npm run supported-browsers
+```
+This script just generates regex expression for matching the list of compatible browsers, so that we can show a warning notification for unsupported browsers.
#### ЁЯПГ Run the app in development mode
diff --git a/crowdin.yml b/crowdin.yml
index 3bb120df6fc..0ab1a042711 100644
--- a/crowdin.yml
+++ b/crowdin.yml
@@ -1,3 +1,5 @@
files:
- source: /src/Locale/en/*.json
translation: /src/Locale/%two_letters_code%/%original_file_name%
+bundles:
+ - 2
diff --git a/cypress/e2e/assets_spec/asset_homepage.cy.ts b/cypress/e2e/assets_spec/AssetHomepage.cy.ts
similarity index 100%
rename from cypress/e2e/assets_spec/asset_homepage.cy.ts
rename to cypress/e2e/assets_spec/AssetHomepage.cy.ts
diff --git a/cypress/e2e/assets_spec/assets_creation.cy.ts b/cypress/e2e/assets_spec/AssetsCreation.cy.ts
similarity index 100%
rename from cypress/e2e/assets_spec/assets_creation.cy.ts
rename to cypress/e2e/assets_spec/AssetsCreation.cy.ts
diff --git a/cypress/e2e/assets_spec/assets_manage.cy.ts b/cypress/e2e/assets_spec/AssetsManage.cy.ts
similarity index 100%
rename from cypress/e2e/assets_spec/assets_manage.cy.ts
rename to cypress/e2e/assets_spec/AssetsManage.cy.ts
diff --git a/cypress/e2e/auth_spec/forget_password.cy.ts b/cypress/e2e/auth_spec/ForgotPassword.cy.ts
similarity index 100%
rename from cypress/e2e/auth_spec/forget_password.cy.ts
rename to cypress/e2e/auth_spec/ForgotPassword.cy.ts
diff --git a/cypress/e2e/external_results_spec/filter.cy.ts b/cypress/e2e/external_results_spec/ExternalResultsAdvanceFilters.ts
similarity index 100%
rename from cypress/e2e/external_results_spec/filter.cy.ts
rename to cypress/e2e/external_results_spec/ExternalResultsAdvanceFilters.ts
diff --git a/cypress/e2e/external_results_spec/external_result.cy.ts b/cypress/e2e/external_results_spec/ExternalResultsHomepage.cy.ts
similarity index 95%
rename from cypress/e2e/external_results_spec/external_result.cy.ts
rename to cypress/e2e/external_results_spec/ExternalResultsHomepage.cy.ts
index d0d78e5f5f6..6a37d8fb2d0 100644
--- a/cypress/e2e/external_results_spec/external_result.cy.ts
+++ b/cypress/e2e/external_results_spec/ExternalResultsHomepage.cy.ts
@@ -33,7 +33,9 @@ describe("Edit Profile Testing", () => {
cy.get("div").contains("Import/Export").click();
cy.get("div").contains("Import Results").click();
cy.get("[data-testid=import-file]")
- .selectFile("cypress/fixtures/externalresultsample.csv", { force: true })
+ .selectFile("cypress/fixtures/external-result-sample.csv", {
+ force: true,
+ })
.wait(100);
cy.submitButton("Import");
cy.wait("@import").then((interception) => {
diff --git a/cypress/e2e/facility_spec/facility_creation.cy.ts b/cypress/e2e/facility_spec/FacilityCreation.cy.ts
similarity index 100%
rename from cypress/e2e/facility_spec/facility_creation.cy.ts
rename to cypress/e2e/facility_spec/FacilityCreation.cy.ts
diff --git a/cypress/e2e/facility_spec/facility_homepage.cy.ts b/cypress/e2e/facility_spec/FacilityHomepage.cy.ts
similarity index 100%
rename from cypress/e2e/facility_spec/facility_homepage.cy.ts
rename to cypress/e2e/facility_spec/FacilityHomepage.cy.ts
diff --git a/cypress/e2e/facility_spec/inventory.cy.ts b/cypress/e2e/facility_spec/FacilityInventory.cy.ts
similarity index 100%
rename from cypress/e2e/facility_spec/inventory.cy.ts
rename to cypress/e2e/facility_spec/FacilityInventory.cy.ts
diff --git a/cypress/e2e/facility_spec/locations.cy.ts b/cypress/e2e/facility_spec/FacilityLocation.cy.ts
similarity index 100%
rename from cypress/e2e/facility_spec/locations.cy.ts
rename to cypress/e2e/facility_spec/FacilityLocation.cy.ts
diff --git a/cypress/e2e/facility_spec/facility_manage.cy.ts b/cypress/e2e/facility_spec/FacilityManage.cy.ts
similarity index 99%
rename from cypress/e2e/facility_spec/facility_manage.cy.ts
rename to cypress/e2e/facility_spec/FacilityManage.cy.ts
index 868a26de022..e4f4ba40ff1 100644
--- a/cypress/e2e/facility_spec/facility_manage.cy.ts
+++ b/cypress/e2e/facility_spec/FacilityManage.cy.ts
@@ -44,7 +44,7 @@ describe("Facility Manage Functions", () => {
// It's only button functionality because we can't access S3 bucket in local
facilityManage.clickCoverImage();
facilityManage.verifyUploadButtonVisible();
- facilityManage.uploadCoverImage("facilitycoverimage.jpg");
+ facilityManage.uploadCoverImage("facility-cover-image.jpg");
facilityManage.clickSaveCoverImage();
});
diff --git a/cypress/e2e/patient_spec/patient_consultation.cy.ts b/cypress/e2e/patient_spec/PatientConsultationCreation.cy.ts
similarity index 100%
rename from cypress/e2e/patient_spec/patient_consultation.cy.ts
rename to cypress/e2e/patient_spec/PatientConsultationCreation.cy.ts
diff --git a/cypress/e2e/patient_spec/patient_discharge.cy.ts b/cypress/e2e/patient_spec/PatientConsultationDischarge.cy.ts
similarity index 100%
rename from cypress/e2e/patient_spec/patient_discharge.cy.ts
rename to cypress/e2e/patient_spec/PatientConsultationDischarge.cy.ts
diff --git a/cypress/e2e/patient_spec/patient_fileupload.cy.ts b/cypress/e2e/patient_spec/PatientFileUpload.ts
similarity index 100%
rename from cypress/e2e/patient_spec/patient_fileupload.cy.ts
rename to cypress/e2e/patient_spec/PatientFileUpload.ts
diff --git a/cypress/e2e/patient_spec/patient_logupdate.cy.ts b/cypress/e2e/patient_spec/PatientLogUpdate.cy.ts
similarity index 100%
rename from cypress/e2e/patient_spec/patient_logupdate.cy.ts
rename to cypress/e2e/patient_spec/PatientLogUpdate.cy.ts
diff --git a/cypress/e2e/patient_spec/patient_manage.cy.ts b/cypress/e2e/patient_spec/PatientManage.cy.ts
similarity index 100%
rename from cypress/e2e/patient_spec/patient_manage.cy.ts
rename to cypress/e2e/patient_spec/PatientManage.cy.ts
diff --git a/cypress/e2e/patient_spec/patient_prescription.cy.ts b/cypress/e2e/patient_spec/PatientPrescription.cy.ts
similarity index 100%
rename from cypress/e2e/patient_spec/patient_prescription.cy.ts
rename to cypress/e2e/patient_spec/PatientPrescription.cy.ts
diff --git a/cypress/e2e/patient_spec/patient_registration.cy.ts b/cypress/e2e/patient_spec/PatientRegistration.cy.ts
similarity index 100%
rename from cypress/e2e/patient_spec/patient_registration.cy.ts
rename to cypress/e2e/patient_spec/PatientRegistration.cy.ts
diff --git a/cypress/e2e/resource_spec/filter.cy.ts b/cypress/e2e/resource_spec/ResourcesAdvanceFilters.cy.ts
similarity index 100%
rename from cypress/e2e/resource_spec/filter.cy.ts
rename to cypress/e2e/resource_spec/ResourcesAdvanceFilters.cy.ts
diff --git a/cypress/e2e/resource_spec/resources.cy.ts b/cypress/e2e/resource_spec/ResourcesHomepage.cy.ts
similarity index 100%
rename from cypress/e2e/resource_spec/resources.cy.ts
rename to cypress/e2e/resource_spec/ResourcesHomepage.cy.ts
diff --git a/cypress/e2e/sample_test_spec/filter.cy.ts b/cypress/e2e/sample_test_spec/SampleTestAdvanceFilters.cy.ts
similarity index 100%
rename from cypress/e2e/sample_test_spec/filter.cy.ts
rename to cypress/e2e/sample_test_spec/SampleTestAdvanceFilters.cy.ts
diff --git a/cypress/e2e/sample_test_spec/sample_test.cy.ts b/cypress/e2e/sample_test_spec/SampleTestHomepage.cy.ts
similarity index 100%
rename from cypress/e2e/sample_test_spec/sample_test.cy.ts
rename to cypress/e2e/sample_test_spec/SampleTestHomepage.cy.ts
diff --git a/cypress/e2e/shifting_spec/filter.cy.ts b/cypress/e2e/shifting_spec/ShiftingAdvanceFilters.cy.ts
similarity index 100%
rename from cypress/e2e/shifting_spec/filter.cy.ts
rename to cypress/e2e/shifting_spec/ShiftingAdvanceFilters.cy.ts
diff --git a/cypress/e2e/shifting_spec/shifting.cy.ts b/cypress/e2e/shifting_spec/ShiftingHomepage.cy.ts
similarity index 100%
rename from cypress/e2e/shifting_spec/shifting.cy.ts
rename to cypress/e2e/shifting_spec/ShiftingHomepage.cy.ts
diff --git a/cypress/e2e/users_spec/user_creation.cy.ts b/cypress/e2e/users_spec/UsersCreation.cy.ts
similarity index 100%
rename from cypress/e2e/users_spec/user_creation.cy.ts
rename to cypress/e2e/users_spec/UsersCreation.cy.ts
diff --git a/cypress/e2e/users_spec/user_homepage.cy.ts b/cypress/e2e/users_spec/UsersHomepage.cy.ts
similarity index 100%
rename from cypress/e2e/users_spec/user_homepage.cy.ts
rename to cypress/e2e/users_spec/UsersHomepage.cy.ts
diff --git a/cypress/e2e/users_spec/UsersManage.cy.ts b/cypress/e2e/users_spec/UsersManage.cy.ts
new file mode 100644
index 00000000000..9c339f4b8e3
--- /dev/null
+++ b/cypress/e2e/users_spec/UsersManage.cy.ts
@@ -0,0 +1,151 @@
+import LoginPage from "../../pageobject/Login/LoginPage";
+import { UserPage } from "../../pageobject/Users/UserSearch";
+import ManageUserPage from "../../pageobject/Users/ManageUserPage";
+import { UserCreationPage } from "../../pageobject/Users/UserCreation";
+
+describe("Manage User", () => {
+ const loginPage = new LoginPage();
+ const userPage = new UserPage();
+ const manageUserPage = new ManageUserPage();
+ const usernametolinkfacilitydoc1 = "dummydoctor4";
+ const usernametolinkfacilitydoc2 = "dummydoctor5";
+ const usernametolinkfacilitydoc3 = "dummydoctor6";
+ const usernametolinkskill = "devdoctor";
+ const userCreationPage = new UserCreationPage();
+ const usernameforworkinghour = "devdistrictadmin";
+ const usernamerealname = "Dummy Doctor";
+ const facilitytolinkusername = "Dummy Shifting Center";
+ const facilitytolinkskill = "Dummy Facility 40";
+ const workinghour = "23";
+ const linkedskill = "General Medicine";
+
+ before(() => {
+ loginPage.loginAsDisctrictAdmin();
+ cy.saveLocalStorage();
+ });
+
+ beforeEach(() => {
+ cy.restoreLocalStorage();
+ console.log(localStorage);
+ cy.clearLocalStorage(/filters--.+/);
+ console.log(localStorage);
+ cy.awaitUrl("/users");
+ });
+
+ it("linking skills for users and verify its reflection in profile", () => {
+ // select the district user and select one skill link and verify its profile reflection
+ userPage.typeInSearchInput(usernameforworkinghour);
+ userPage.checkUsernameText(usernameforworkinghour);
+ manageUserPage.clicklinkedskillbutton();
+ manageUserPage.selectSkillFromDropdown(linkedskill);
+ manageUserPage.clickAddSkillButton();
+ manageUserPage.clickCloseSlideOver();
+ cy.wait(5000);
+ manageUserPage.clicklinkedskillbutton();
+ manageUserPage.assertSkillInAddedUserSkills(linkedskill);
+ manageUserPage.clickCloseSlideOver();
+ cy.wait(5000);
+ manageUserPage.navigateToProfile();
+ userCreationPage.verifyElementContainsText(
+ "username-profile-details",
+ usernameforworkinghour,
+ );
+ manageUserPage.assertSkillInAlreadyLinkedSkills(linkedskill);
+ });
+
+ it("linking skills for a doctor users and verify its reflection in doctor connect", () => {
+ // select a doctor user and link and unlink same skill twice and verify the badge is only shown once in doctor connect
+ userPage.typeInSearchInput(usernametolinkskill);
+ userPage.checkUsernameText(usernametolinkskill);
+ manageUserPage.clicklinkedskillbutton();
+ manageUserPage.selectSkillFromDropdown(linkedskill);
+ manageUserPage.clickAddSkillButton();
+ manageUserPage.clickCloseSlideOver();
+ cy.wait(5000); // temporary hack to fix the failure
+ manageUserPage.clicklinkedskillbutton();
+ manageUserPage.assertSkillInAddedUserSkills(linkedskill);
+ manageUserPage.clickUnlinkSkill();
+ manageUserPage.clickSubmit();
+ manageUserPage.selectSkillFromDropdown(linkedskill);
+ manageUserPage.clickAddSkillButton();
+ manageUserPage.clickCloseSlideOver();
+ // verifying the doctor connect
+ manageUserPage.navigateToFacility();
+ manageUserPage.typeFacilitySearch(facilitytolinkskill);
+ manageUserPage.assertFacilityInCard(facilitytolinkskill);
+ manageUserPage.clickFacilityPatients();
+ manageUserPage.clickDoctorConnectButton();
+ manageUserPage.assertSkillIndoctorconnect(linkedskill);
+ });
+
+ it("add working hour for a user and verify its reflection in card and user profile", () => {
+ // verify mandatory field error and select working hour for a user
+ userPage.typeInSearchInput(usernameforworkinghour);
+ userPage.checkUsernameText(usernameforworkinghour);
+ manageUserPage.clicksetaveragehourbutton();
+ manageUserPage.clearweeklyhourfield();
+ manageUserPage.clickSubmit();
+ manageUserPage.verifyErrorText("Value should be between 0 and 168");
+ // verify the data is reflected in user card and profile page
+ manageUserPage.typeInWeeklyWorkingHours(workinghour);
+ manageUserPage.clickSubmit();
+ manageUserPage.verifyWorkingHours(workinghour);
+ manageUserPage.navigateToProfile();
+ manageUserPage.verifyProfileWorkingHours(workinghour);
+ });
+
+ it("linking and unlinking facility for multiple users, and confirm reflection in user cards and doctor connect", () => {
+ // verify the user doesn't have any home facility
+ userPage.typeInSearchInput(usernametolinkfacilitydoc1);
+ userPage.checkUsernameText(usernametolinkfacilitydoc1);
+ manageUserPage.assertHomeFacility("No Home Facility");
+ // Link a new facility and ensure it is under linked facility - doctor username (1)
+ manageUserPage.clickFacilitiesTab();
+ manageUserPage.selectFacilityFromDropdown(facilitytolinkusername);
+ manageUserPage.clickLinkFacility();
+ manageUserPage.assertLinkedFacility(facilitytolinkusername);
+ // Verify in the already linked facility are not present in droplist
+ manageUserPage.assertFacilityNotInDropdown(facilitytolinkusername);
+ manageUserPage.clickCloseSlideOver();
+ // Link a new facility and ensure it is under home facility - doctor username (2)
+ userPage.clearSearchInput();
+ userPage.typeInSearchInput(usernametolinkfacilitydoc2);
+ userPage.checkUsernameText(usernametolinkfacilitydoc2);
+ manageUserPage.clickFacilitiesTab();
+ manageUserPage.selectFacilityFromDropdown(facilitytolinkusername);
+ manageUserPage.clickLinkFacility();
+ manageUserPage.clickHomeFacilityIcon();
+ manageUserPage.assertnotLinkedFacility(facilitytolinkusername);
+ manageUserPage.assertHomeFacilitylink(facilitytolinkusername);
+ manageUserPage.clickCloseSlideOver();
+ // verify the home facility doctor id have reflection in user card
+ userPage.clearSearchInput();
+ userPage.typeInSearchInput(usernametolinkfacilitydoc2);
+ userPage.checkUsernameText(usernametolinkfacilitydoc2);
+ manageUserPage.assertHomeFacility(facilitytolinkusername);
+ // Link a new facility and unlink the facility from the doctor username (3)
+ userPage.clearSearchInput();
+ userPage.typeInSearchInput(usernametolinkfacilitydoc3);
+ userPage.checkUsernameText(usernametolinkfacilitydoc3);
+ manageUserPage.clickFacilitiesTab();
+ manageUserPage.selectFacilityFromDropdown(facilitytolinkusername);
+ manageUserPage.clickLinkFacility();
+ manageUserPage.clickUnlinkFacilityButton();
+ manageUserPage.clickSubmit();
+ manageUserPage.assertnotLinkedFacility;
+ manageUserPage.linkedfacilitylistnotvisible();
+ manageUserPage.clickCloseSlideOver();
+ // Go to particular facility doctor connect and all user-id are reflected based on there access
+ // Path will be facility page to patient page then doctor connect button
+ manageUserPage.navigateToFacility();
+ manageUserPage.typeFacilitySearch(facilitytolinkusername);
+ manageUserPage.assertFacilityInCard(facilitytolinkusername);
+ manageUserPage.clickFacilityPatients();
+ manageUserPage.clickDoctorConnectButton();
+ manageUserPage.assertDoctorConnectVisibility(usernamerealname);
+ });
+
+ afterEach(() => {
+ cy.saveLocalStorage();
+ });
+});
diff --git a/cypress/e2e/users_spec/UsersProfile.cy.ts b/cypress/e2e/users_spec/UsersProfile.cy.ts
new file mode 100644
index 00000000000..2672cccad7e
--- /dev/null
+++ b/cypress/e2e/users_spec/UsersProfile.cy.ts
@@ -0,0 +1,84 @@
+import LoginPage from "../../pageobject/Login/LoginPage";
+import UserProfilePage from "../../pageobject/Users/UserProfilePage";
+import ManageUserPage from "../../pageobject/Users/ManageUserPage";
+
+describe("Manage User Profile", () => {
+ const loginPage = new LoginPage();
+ const userProfilePage = new UserProfilePage();
+ const manageUserPage = new ManageUserPage();
+
+ const date_of_birth = "01011999";
+ const gender = "Male";
+ const email = "test@example.com";
+ const phone = "+918899887788";
+ const workinghours = "8";
+ const doctorQualification = "MBBS";
+ const doctorYoE = "10";
+ const medicalCouncilRegistration = "1234567890";
+
+ const facilitySearch = "Dummy Facility 40";
+
+ before(() => {
+ loginPage.loginAsDevDoctor();
+ cy.saveLocalStorage();
+ });
+
+ beforeEach(() => {
+ cy.restoreLocalStorage();
+ console.log(localStorage);
+ cy.clearLocalStorage(/filters--.+/);
+ console.log(localStorage);
+ cy.awaitUrl("/user/profile");
+ });
+
+ it("Set Dob, Gender, Email, Phone and Working Hours for a user and verify its reflection in user profile", () => {
+ userProfilePage.clickEditProfileButton();
+
+ userProfilePage.typedate_of_birth(date_of_birth);
+ userProfilePage.selectGender(gender);
+ userProfilePage.typeEmail(email);
+ userProfilePage.typePhone(phone);
+ userProfilePage.typeWhatsApp(phone);
+ userProfilePage.typeWorkingHours(workinghours);
+ userProfilePage.typeDoctorQualification(doctorQualification);
+ userProfilePage.typeDoctorYoE(doctorYoE);
+ userProfilePage.typeMedicalCouncilRegistration(medicalCouncilRegistration);
+
+ userProfilePage.clickUpdateButton();
+
+ cy.verifyNotification("Details updated successfully");
+
+ userProfilePage.assertdate_of_birth("01/01/1999");
+ userProfilePage.assertGender(gender);
+ userProfilePage.assertEmail(email);
+ userProfilePage.assertPhone(phone);
+ userProfilePage.assertWhatsApp(phone);
+ userProfilePage.assertWorkingHours(workinghours);
+ });
+
+ it("Adding video connect link for a user and verify its reflection in user profile and doctor connect", () => {
+ // verify the user doesn't have any video connect link
+ userProfilePage.assertVideoConnectLink("-");
+ // Link a new video connect link and ensure it is under video connect link
+ userProfilePage.clickEditProfileButton();
+ userProfilePage.typeVideoConnectLink("https://www.example.com");
+ userProfilePage.clickUpdateButton();
+ userProfilePage.assertVideoConnectLink("https://www.example.com");
+ // Edit the video connect link and ensure it is updated
+ userProfilePage.clickEditProfileButton();
+ userProfilePage.typeVideoConnectLink("https://www.test.com");
+ userProfilePage.clickUpdateButton();
+ userProfilePage.assertVideoConnectLink("https://www.test.com");
+ // Go to particular facility doctor connect and verify the video connect link is present
+ manageUserPage.navigateToFacility();
+ manageUserPage.typeFacilitySearch(facilitySearch);
+ manageUserPage.assertFacilityInCard(facilitySearch);
+ manageUserPage.clickFacilityPatients();
+ manageUserPage.clickDoctorConnectButton();
+ manageUserPage.assertVideoConnectLink("Dev Doctor", "https://www.test.com");
+ });
+
+ afterEach(() => {
+ cy.saveLocalStorage();
+ });
+});
diff --git a/cypress/e2e/users_spec/user_manage.cy.ts b/cypress/e2e/users_spec/user_manage.cy.ts
index 9c339f4b8e3..c2116954354 100644
--- a/cypress/e2e/users_spec/user_manage.cy.ts
+++ b/cypress/e2e/users_spec/user_manage.cy.ts
@@ -26,9 +26,7 @@ describe("Manage User", () => {
beforeEach(() => {
cy.restoreLocalStorage();
- console.log(localStorage);
cy.clearLocalStorage(/filters--.+/);
- console.log(localStorage);
cy.awaitUrl("/users");
});
diff --git a/cypress/e2e/users_spec/user_profile.cy.ts b/cypress/e2e/users_spec/user_profile.cy.ts
index 2672cccad7e..40880d95edb 100644
--- a/cypress/e2e/users_spec/user_profile.cy.ts
+++ b/cypress/e2e/users_spec/user_profile.cy.ts
@@ -25,9 +25,7 @@ describe("Manage User Profile", () => {
beforeEach(() => {
cy.restoreLocalStorage();
- console.log(localStorage);
cy.clearLocalStorage(/filters--.+/);
- console.log(localStorage);
cy.awaitUrl("/user/profile");
});
diff --git a/cypress/fixtures/example.json b/cypress/fixtures/example.json
deleted file mode 100644
index 02e4254378e..00000000000
--- a/cypress/fixtures/example.json
+++ /dev/null
@@ -1,5 +0,0 @@
-{
- "name": "Using fixtures to represent data",
- "email": "hello@cypress.io",
- "body": "Fixtures are a great way to mock data for responses to routes"
-}
diff --git a/cypress/fixtures/externalresultsample.csv b/cypress/fixtures/external-result-sample.csv
similarity index 100%
rename from cypress/fixtures/externalresultsample.csv
rename to cypress/fixtures/external-result-sample.csv
diff --git a/cypress/fixtures/facilitycoverimage.jpg b/cypress/fixtures/facility-cover-image.jpg
similarity index 100%
rename from cypress/fixtures/facilitycoverimage.jpg
rename to cypress/fixtures/facility-cover-image.jpg
diff --git a/cypress/fixtures/sampleAsset.xlsx b/cypress/fixtures/sample-asset.xlsx
similarity index 100%
rename from cypress/fixtures/sampleAsset.xlsx
rename to cypress/fixtures/sample-asset.xlsx
diff --git a/cypress/pageobject/Asset/AssetCreation.ts b/cypress/pageobject/Asset/AssetCreation.ts
index 2de13561a0b..41d3c4ca8d0 100644
--- a/cypress/pageobject/Asset/AssetCreation.ts
+++ b/cypress/pageobject/Asset/AssetCreation.ts
@@ -246,7 +246,7 @@ export class AssetPage {
importAssetFile() {
cy.get("[data-testid=import-file]")
- .selectFile("cypress/fixtures/sampleAsset.xlsx", { force: true })
+ .selectFile("cypress/fixtures/sample-asset.xlsx", { force: true })
.wait(100);
}
diff --git a/cypress/pageobject/Patient/PatientFileupload.ts b/cypress/pageobject/Patient/PatientFileupload.ts
index 3f353cb8807..0616a19729c 100644
--- a/cypress/pageobject/Patient/PatientFileupload.ts
+++ b/cypress/pageobject/Patient/PatientFileupload.ts
@@ -40,7 +40,7 @@ export class PatientFileUpload {
uploadFile() {
cy.get("#file_upload_patient").selectFile(
- "cypress/fixtures/sampleAsset.xlsx",
+ "cypress/fixtures/sample-asset.xlsx",
{ force: true },
);
}
diff --git a/src/Components/ABDM/ABHAProfileModal.tsx b/src/Components/ABDM/ABHAProfileModal.tsx
index 4853626f1ef..99b888cc1ef 100644
--- a/src/Components/ABDM/ABHAProfileModal.tsx
+++ b/src/Components/ABDM/ABHAProfileModal.tsx
@@ -1,6 +1,5 @@
import * as Notify from "../../Utils/Notifications";
-import { AbhaObject } from "../Patient/models";
import CareIcon from "../../CAREUI/icons/CareIcon";
import DialogModal from "../Common/Dialog";
import QRCode from "qrcode.react";
@@ -8,10 +7,11 @@ import { formatDateTime } from "../../Utils/utils";
import { useRef } from "react";
import request from "../../Utils/request/request";
import routes from "../../Redux/api";
+import { AbhaNumberModel } from "./types/abha";
interface IProps {
patientId?: string;
- abha?: AbhaObject;
+ abha?: AbhaNumberModel;
show: boolean;
onClose: () => void;
}
diff --git a/src/Components/ABDM/FetchRecordsModal.tsx b/src/Components/ABDM/FetchRecordsModal.tsx
index b457ccc453a..cc7c72474d1 100644
--- a/src/Components/ABDM/FetchRecordsModal.tsx
+++ b/src/Components/ABDM/FetchRecordsModal.tsx
@@ -2,7 +2,6 @@ import * as Notification from "../../Utils/Notifications.js";
import ButtonV2 from "../Common/components/ButtonV2";
import DialogModal from "../Common/Dialog";
-import { PatientModel } from "../Patient/models";
import TextFormField from "../Form/FormFields/TextFormField";
import { useState } from "react";
import {
@@ -20,6 +19,7 @@ import { useMessageListener } from "../../Common/hooks/useMessageListener.js";
import CircularProgress from "../Common/components/CircularProgress.js";
import CareIcon from "../../CAREUI/icons/CareIcon.js";
import { classNames } from "../../Utils/utils.js";
+import { AbhaNumberModel } from "./types/abha.js";
import { ConsentHIType, ConsentPurpose } from "./types/consent.js";
import useNotificationSubscriptionState from "../../Common/hooks/useNotificationSubscriptionState.js";
@@ -27,12 +27,12 @@ const getDate = (value: any) =>
value && dayjs(value).isValid() && dayjs(value).toDate();
interface IProps {
- patient: PatientModel;
+ abha?: AbhaNumberModel;
show: boolean;
onClose: () => void;
}
-export default function FetchRecordsModal({ patient, show, onClose }: IProps) {
+export default function FetchRecordsModal({ abha, show, onClose }: IProps) {
const [idVerificationStatus, setIdVerificationStatus] = useState<
"pending" | "in-progress" | "verified" | "failed"
>("pending");
@@ -53,9 +53,7 @@ export default function FetchRecordsModal({ patient, show, onClose }: IProps) {
useMessageListener((data) => {
if (data.type === "MESSAGE" && data.from === "patients/on_find") {
- if (
- data.message?.patient?.id === patient?.abha_number_object?.health_id
- ) {
+ if (data.message?.patient?.id === abha?.health_id) {
setIdVerificationStatus("verified");
setErrors({
...errors,
@@ -85,7 +83,7 @@ export default function FetchRecordsModal({ patient, show, onClose }: IProps) {
null}
disabled
label="Patient Identifier"
@@ -98,7 +96,7 @@ export default function FetchRecordsModal({ patient, show, onClose }: IProps) {
onClick={async () => {
const { res } = await request(routes.abha.findPatient, {
body: {
- id: patient?.abha_number_object?.health_id,
+ id: abha?.health_id,
},
reattempts: 0,
});
@@ -214,7 +212,7 @@ export default function FetchRecordsModal({ patient, show, onClose }: IProps) {
setIsMakingConsentRequest(true);
const { res } = await request(routes.abha.createConsent, {
body: {
- patient_abha: patient?.abha_number_object?.health_id as string,
+ patient_abha: abha?.health_id as string,
hi_types: hiTypes,
purpose,
from_time: fromDate,
@@ -229,8 +227,8 @@ export default function FetchRecordsModal({ patient, show, onClose }: IProps) {
});
navigate(
- `/facility/${patient.facility}/abdm` ??
- `/facility/${patient.facility}/patient/${patient.id}/consultation/${patient.last_consultation?.id}/abdm`,
+ `/facility/${abha?.patient_object?.facility}/abdm` ??
+ `/facility/${abha?.patient_object?.facility}/patient/${abha?.patient_object?.id}/consultation/${abha?.patient_object?.last_consultation?.id}/abdm`,
);
} else {
Notification.Error({
diff --git a/src/Components/ABDM/LinkABHANumberModal.tsx b/src/Components/ABDM/LinkABHANumberModal.tsx
index ea996ddd1da..8d6365387cd 100644
--- a/src/Components/ABDM/LinkABHANumberModal.tsx
+++ b/src/Components/ABDM/LinkABHANumberModal.tsx
@@ -202,7 +202,7 @@ const ScanABHAQRSection = ({
dob: abha?.dob.replace(/\//g, "-"),
address: abha?.address,
"dist name": abha?.["dist name"] ?? abha?.district_name,
- "state name": abha?.["state name"],
+ "state name": abha?.["state name"] ?? abha?.state_name,
},
});
diff --git a/src/Components/ABDM/LinkCareContextModal.tsx b/src/Components/ABDM/LinkCareContextModal.tsx
index b22189c9f2f..9ec9885bbca 100644
--- a/src/Components/ABDM/LinkCareContextModal.tsx
+++ b/src/Components/ABDM/LinkCareContextModal.tsx
@@ -3,22 +3,22 @@ import * as Notification from "../../Utils/Notifications.js";
import ButtonV2 from "../Common/components/ButtonV2";
import DateFormField from "../Form/FormFields/DateFormField";
import DialogModal from "../Common/Dialog";
-import { PatientModel } from "../Patient/models";
import TextFormField from "../Form/FormFields/TextFormField";
import { useState } from "react";
import routes from "../../Redux/api.js";
import request from "../../Utils/request/request.js";
+import { AbhaNumberModel } from "./types/abha.js";
interface IProps {
consultationId: string;
- patient: PatientModel;
+ abha?: AbhaNumberModel;
show: boolean;
onClose: () => void;
}
const LinkCareContextModal = ({
consultationId,
- patient,
+ abha,
show,
onClose,
}: IProps) => {
@@ -33,7 +33,7 @@ const LinkCareContextModal = ({
>
null}
disabled
label="Name"
@@ -41,7 +41,7 @@ const LinkCareContextModal = ({
error=""
/>
null}
disabled
label="Gender"
@@ -52,11 +52,7 @@ const LinkCareContextModal = ({
null}
disabled
required
@@ -84,9 +80,9 @@ const LinkCareContextModal = ({
const { res } = await request(routes.abha.linkCareContext, {
body: {
consultation: consultationId,
- name: patient?.abha_number_object?.name,
- gender: patient?.abha_number_object?.gender,
- dob: patient?.abha_number_object?.date_of_birth,
+ name: abha?.name,
+ gender: abha?.gender,
+ dob: abha?.date_of_birth,
},
reattempts: 0,
});
@@ -94,10 +90,6 @@ const LinkCareContextModal = ({
Notification.Success({
msg: "Care Context sucessfully linked!",
});
- } else {
- Notification.Error({
- msg: "Error in linking Care Context!",
- });
}
setIsLinkingCareContext(false);
onClose();
diff --git a/src/Components/ABDM/models.ts b/src/Components/ABDM/models.ts
index 9dc362f5cac..899ec948777 100644
--- a/src/Components/ABDM/models.ts
+++ b/src/Components/ABDM/models.ts
@@ -124,6 +124,7 @@ export interface ABHAQRContent {
address: string;
distlgd: string;
district_name?: string;
+ state_name?: string;
dob: string;
gender: "M" | "F" | "O";
hid?: string;
@@ -132,6 +133,6 @@ export interface ABHAQRContent {
hidn: string;
mobile: string;
name: string;
- "state name": string;
+ "state name"?: string;
statelgd: string;
}
diff --git a/src/Components/ABDM/types/abha.ts b/src/Components/ABDM/types/abha.ts
index d45986e8f8f..fd03b30cdc4 100644
--- a/src/Components/ABDM/types/abha.ts
+++ b/src/Components/ABDM/types/abha.ts
@@ -1,3 +1,5 @@
+import { PatientModel } from "../../Patient/models";
+
export type AbhaNumberModel = {
id: number;
external_id: string;
@@ -18,4 +20,6 @@ export type AbhaNumberModel = {
email: string | null;
profile_photo: string | null;
new: boolean;
+ patient: string | null;
+ patient_object: PatientModel | null;
};
diff --git a/src/Components/Facility/ConsultationDetails/index.tsx b/src/Components/Facility/ConsultationDetails/index.tsx
index adb18e804c9..f2c2644afda 100644
--- a/src/Components/Facility/ConsultationDetails/index.tsx
+++ b/src/Components/Facility/ConsultationDetails/index.tsx
@@ -39,6 +39,9 @@ import { AssetBedModel } from "../../Assets/AssetTypes";
import PatientInfoCard from "../../Patient/PatientInfoCard";
import RelativeDateUserMention from "../../Common/RelativeDateUserMention";
import DiagnosesListAccordion from "../../Diagnosis/DiagnosesListAccordion";
+import { AbhaNumberModel } from "../../ABDM/types/abha";
+import routes from "../../../Redux/api";
+import request from "../../../Utils/request/request";
import { CameraFeedPermittedUserTypes } from "../../../Utils/permissions";
import Error404 from "../../ErrorPages/404";
@@ -85,6 +88,7 @@ export const ConsultationDetails = (props: any) => {
{} as ConsultationModel,
);
const [patientData, setPatientData] = useState({});
+ const [abhaNumberData, setAbhaNumberData] = useState();
const [activeShiftingData, setActiveShiftingData] = useState>([]);
const [isCameraAttached, setIsCameraAttached] = useState(false);
@@ -137,6 +141,8 @@ export const ConsultationDetails = (props: any) => {
})
: false;
setIsCameraAttached(isCameraAttachedRes);
+
+ // Get patient data
const id = res.data.patient;
const patientRes = await dispatch(getPatient({ id }));
if (patientRes?.data) {
@@ -159,6 +165,16 @@ export const ConsultationDetails = (props: any) => {
setPatientData(data);
}
+ // Get abha number data
+ const { data: abhaNumberData } = await request(
+ routes.abha.getAbhaNumber,
+ {
+ pathParams: { abhaNumberId: id ?? "" },
+ silent: true,
+ },
+ );
+ setAbhaNumberData(abhaNumberData);
+
// Get shifting data
const shiftingRes = await dispatch(
listShiftRequests({ patient: id }, "shift-list-call"),
@@ -290,6 +306,7 @@ export const ConsultationDetails = (props: any) => {
{
return null; // Hide feed tab
}
- if (p.text === "ABDM" && !patientData.abha_number) {
+ if (p.text === "ABDM" && !abhaNumberData?.abha_number) {
return null;
}
diff --git a/src/Components/Facility/Consultations/LiveFeed.tsx b/src/Components/Facility/Consultations/LiveFeed.tsx
index 55f22a5d3d9..e4f6a49bbfd 100644
--- a/src/Components/Facility/Consultations/LiveFeed.tsx
+++ b/src/Components/Facility/Consultations/LiveFeed.tsx
@@ -258,7 +258,6 @@ const LiveFeed = (props: any) => {
updatePreset: (option) => {
getCameraStatus({
onSuccess: async (data) => {
- console.log({ currentPreset, data });
if (currentPreset?.asset_object?.id && data?.position) {
setLoading(option.loadingLabel);
console.log("Updating Preset");
diff --git a/src/Components/Facility/Consultations/NeurologicalTables.tsx b/src/Components/Facility/Consultations/NeurologicalTables.tsx
index c5c05f0dd17..5a1abe3e189 100644
--- a/src/Components/Facility/Consultations/NeurologicalTables.tsx
+++ b/src/Components/Facility/Consultations/NeurologicalTables.tsx
@@ -60,7 +60,6 @@ const DataTable = (props: any) => {
const DataDescription = (props: any) => {
const { title, data } = props;
- console.log("Data Description", title, data);
return (
diff --git a/src/Components/Facility/Consultations/VentilatorPlot.tsx b/src/Components/Facility/Consultations/VentilatorPlot.tsx
index 5502c4c5bb2..aa07b639f88 100644
--- a/src/Components/Facility/Consultations/VentilatorPlot.tsx
+++ b/src/Components/Facility/Consultations/VentilatorPlot.tsx
@@ -92,10 +92,6 @@ export const VentilatorPlot = (props: any) => {
})
.filter((p) => p.value !== null);
- useEffect(() => {
- console.log(bilateral);
- }, [bilateral]);
-
return (
diff --git a/src/Components/Facility/FacilityCreate.tsx b/src/Components/Facility/FacilityCreate.tsx
index a2ef08b7679..2f14bcc26bf 100644
--- a/src/Components/Facility/FacilityCreate.tsx
+++ b/src/Components/Facility/FacilityCreate.tsx
@@ -454,7 +454,6 @@ export const FacilityCreate = (props: FacilityProps) => {
const handleSubmit = async (e: any) => {
e.preventDefault();
const validated = validateForm();
- console.log(state.form);
if (validated) {
setIsLoading(true);
const data: FacilityRequest = {
diff --git a/src/Components/Facility/FacilityHome.tsx b/src/Components/Facility/FacilityHome.tsx
index a0dcf06026f..f1322e4d20e 100644
--- a/src/Components/Facility/FacilityHome.tsx
+++ b/src/Components/Facility/FacilityHome.tsx
@@ -18,7 +18,6 @@ import RecordMeta from "../../CAREUI/display/RecordMeta";
import Table from "../Common/components/Table";
import { navigate } from "raviger";
-import { useMessageListener } from "../../Common/hooks/useMessageListener";
import { useTranslation } from "react-i18next";
import useAuthUser from "../../Common/hooks/useAuthUser.js";
import request from "../../Utils/request/request.js";
@@ -61,8 +60,6 @@ export const FacilityHome = ({ facilityId }: Props) => {
const [coverImageEdited, setCoverImageEdited] = useState(false);
const authUser = useAuthUser();
- useMessageListener((data) => console.log(data));
-
const {
data: facilityData,
loading: isLoading,
diff --git a/src/Components/Facility/Investigations/InvestigationSuggestions.tsx b/src/Components/Facility/Investigations/InvestigationSuggestions.tsx
index 52416cc1e4a..4a5882678c4 100644
--- a/src/Components/Facility/Investigations/InvestigationSuggestions.tsx
+++ b/src/Components/Facility/Investigations/InvestigationSuggestions.tsx
@@ -29,8 +29,6 @@ export default function ViewInvestigationSuggestions(props: {
return
;
}
- console.log("Investigations: ", investigations);
-
return (
{t("investigations_suggested")}
@@ -110,11 +108,6 @@ export default function ViewInvestigationSuggestions(props: {
const investigationMissed =
nextInvestigationTime &&
dayjs().isAfter(nextInvestigationTime);
- console.log(
- type,
- nextFurthestInvestigation,
- nextInvestigationTime,
- );
return (
{
selectedInvestigations,
} = state as InitialState;
- console.log("state", state);
-
const fetchInvestigationsData = useCallback(
async (
onSuccess: (
diff --git a/src/Components/HCX/CreateClaimCard.tsx b/src/Components/HCX/CreateClaimCard.tsx
index 2ce866d261d..46a02cf7f86 100644
--- a/src/Components/HCX/CreateClaimCard.tsx
+++ b/src/Components/HCX/CreateClaimCard.tsx
@@ -37,8 +37,6 @@ export default function CreateClaimCard({
const [createdClaim, setCreatedClaim] = useState();
const [use_, setUse_] = useState(use);
- console.log(items);
-
useEffect(() => {
async function autoFill() {
const latestApprovedPreAuthsRes = await dispatch(
diff --git a/src/Components/Patient/PatientInfoCard.tsx b/src/Components/Patient/PatientInfoCard.tsx
index f301db6333e..300c2190a60 100644
--- a/src/Components/Patient/PatientInfoCard.tsx
+++ b/src/Components/Patient/PatientInfoCard.tsx
@@ -40,6 +40,7 @@ import DischargeModal from "../Facility/DischargeModal.js";
import { useTranslation } from "react-i18next";
import useQuery from "../../Utils/request/useQuery.js";
import FetchRecordsModal from "../ABDM/FetchRecordsModal.js";
+import { AbhaNumberModel } from "../ABDM/types/abha.js";
import { SkillModel } from "../Users/models.js";
import { AuthorizedForConsultationRelatedActions } from "../../CAREUI/misc/AuthorizedChild.js";
import careConfig from "@careConfig";
@@ -57,6 +58,7 @@ const formatSkills = (arr: SkillModel[]) => {
export default function PatientInfoCard(props: {
patient: PatientModel;
consultation?: ConsultationModel;
+ abhaNumber?: AbhaNumberModel;
fetchPatientData?: (state: { aborted: boolean }) => void;
activeShiftingData: any;
consultationId: string;
@@ -734,7 +736,7 @@ export default function PatientInfoCard(props: {
{careConfig.abdm.enabled &&
- (patient.abha_number ? (
+ (props.abhaNumber ? (
<>