diff --git a/cypress/e2e/facility_spec/facility_creation.cy.ts b/cypress/e2e/facility_spec/facility_creation.cy.ts index d2d0351c414..fd4c3f97c50 100644 --- a/cypress/e2e/facility_spec/facility_creation.cy.ts +++ b/cypress/e2e/facility_spec/facility_creation.cy.ts @@ -11,11 +11,14 @@ describe("Facility Management", () => { const facilityPage = new FacilityCreation(); const facilityType = "Primary Health Centre"; + before(() => { + cy.loginByApi("nurse"); + }); + beforeEach(() => { - // Set larger viewport to ensure all elements are visible cy.viewport(1920, 1080); - cy.visit("/login"); cy.loginByApi("nurse"); + cy.visit("/"); }); it("Create a new facility using the admin role and verify validation errors", () => { diff --git a/cypress/e2e/patient_spec/patient_creation.cy.ts b/cypress/e2e/patient_spec/patient_creation.cy.ts index cbeb15a241d..8a5a741b729 100644 --- a/cypress/e2e/patient_spec/patient_creation.cy.ts +++ b/cypress/e2e/patient_spec/patient_creation.cy.ts @@ -4,7 +4,10 @@ import { generatePhoneNumber, } from "utils/commonUtils"; -import { patientCreation } from "@/pageObject/Patients/PatientCreation"; +import { + PatientFormData, + patientCreation, +} from "@/pageObject/Patients/PatientCreation"; import { patientDashboard } from "@/pageObject/Patients/PatientDashboard"; import { patientVerify } from "@/pageObject/Patients/PatientVerify"; import { FacilityCreation } from "@/pageObject/facility/FacilityCreation"; @@ -22,49 +25,119 @@ describe("Patient Management", () => { phone: TEST_PHONE, }; - const testPatientData = { - name: generateName(), - phoneNumber: generatePhoneNumber(), - gender: "male", - bloodGroup: "B+", - dateOfBirth: "01-01-1990", - address: generateAddress(), + const basePatientData: Partial = { pincode: "682001", + state: "Kerala", + district: "Ernakulam", localBody: "Aluva", ward: "4", + sameAsPermanentAddress: true, + hasEmergencyContact: false, }; - beforeEach(() => { - cy.visit("/login"); + const patientTestCases: Array<{ + description: string; + data: PatientFormData; + }> = [ + { + description: "non-binary patient | O+ blood group | multi-line address", + data: { + ...basePatientData, + name: generateName(), + phoneNumber: generatePhoneNumber(), + hasEmergencyContact: false, + gender: "non_binary", + bloodGroup: "O+", + age: "25", + address: generateAddress(true), + } as PatientFormData, + }, + { + description: + "transgender patient | AB+ blood group | with emergency contact", + data: { + ...basePatientData, + name: generateName(), + phoneNumber: generatePhoneNumber(), + hasEmergencyContact: false, + gender: "transgender", + bloodGroup: "AB+", + age: "30", + address: generateAddress(), + } as PatientFormData, + }, + { + description: "female patient | different addresses | same phone number", + data: { + ...basePatientData, + name: generateName(), + phoneNumber: generatePhoneNumber(), + hasEmergencyContact: false, + gender: "female", + bloodGroup: "Unknown", + age: "25", + sameAsPermanentAddress: false, + address: generateAddress(), + permanentAddress: generateAddress(), + } as PatientFormData, + }, + { + description: + "standard male patient | same address | different emergency contact", + data: { + ...basePatientData, + name: generateName(), + phoneNumber: generatePhoneNumber(), + hasEmergencyContact: true, + emergencyPhoneNumber: generatePhoneNumber(), + gender: "male", + bloodGroup: "B+", + dateOfBirth: "01-01-1990", + address: generateAddress(), + } as PatientFormData, + }, + // ... other test cases ... + ]; + + before(() => { + cy.loginByApi("doctor"); }); - it("create a new patient and verify details", () => { + beforeEach(() => { cy.loginByApi("doctor"); - facilityCreation.selectFacility("GHC Trikaripur"); - patientCreation - .clickSearchPatients() - .clickCreateNewPatient() - .fillPatientDetails(testPatientData) - .submitPatientForm() - .assertPatientRegistrationSuccess(); - patientVerify - .verifyPatientName(testPatientData.name) - .verifyCreateEncounterButton() - .clickCreateEncounter() - .selectEncounterType(ENCOUNTER_TYPE) - .selectEncounterStatus(ENCOUNTER_STATUS) - .selectEncounterPriority(ENCOUNTER_PRIORITY) - .clickSubmitEncounter() - .assertEncounterCreationSuccess(); - patientDashboard.verifyEncounterPatientInfo([ - ENCOUNTER_TYPE, - ENCOUNTER_STATUS, - ENCOUNTER_PRIORITY, - ]); + cy.visit("/"); + }); + + patientTestCases.forEach(({ description, data }) => { + it(`creates a new ${description} and verifies registration`, () => { + facilityCreation.selectFacility("GHC Trikaripur"); + patientCreation + .clickSearchPatients() + .clickCreateNewPatient() + .fillPatientDetails(data) + .submitPatientForm() + .assertPatientRegistrationSuccess(); + + // Verify encounter creation + patientVerify + .verifyPatientName(data.name) + .verifyCreateEncounterButton() + .clickCreateEncounter() + .selectEncounterType(ENCOUNTER_TYPE) + .selectEncounterStatus(ENCOUNTER_STATUS) + .selectEncounterPriority(ENCOUNTER_PRIORITY) + .clickSubmitEncounter() + .assertEncounterCreationSuccess(); + + patientDashboard.verifyEncounterPatientInfo([ + ENCOUNTER_TYPE, + ENCOUNTER_STATUS, + ENCOUNTER_PRIORITY, + ]); + }); }); it("search patient with phone number and verifies details", () => { - cy.loginByApi("staff"); facilityCreation.selectFacility("GHC Trikaripur"); patientCreation .clickSearchPatients() diff --git a/cypress/e2e/patient_spec/patient_encounter.cy.ts b/cypress/e2e/patient_spec/patient_encounter.cy.ts index ac13650585d..59071a5c213 100644 --- a/cypress/e2e/patient_spec/patient_encounter.cy.ts +++ b/cypress/e2e/patient_spec/patient_encounter.cy.ts @@ -5,9 +5,13 @@ const facilityCreation = new FacilityCreation(); const patientEncounter = new PatientEncounter(); describe("Patient Encounter Questionnaire", () => { + before(() => { + cy.loginByApi("devnurse"); + }); + beforeEach(() => { - // Login and set up any necessary test state - cy.visit("/login"); + cy.loginByApi("devnurse"); + cy.visit("/"); }); it("Create a new ABG questionnaire and verify the values", () => { @@ -15,7 +19,6 @@ describe("Patient Encounter Questionnaire", () => { pco2: "120", po2: "80", }; - cy.loginByApi("devnurse"); facilityCreation.selectFacility("GHC Trikaripur"); // Chain the methods instead of multiple separate calls diff --git a/cypress/e2e/users_spec/user_creation.cy.ts b/cypress/e2e/users_spec/user_creation.cy.ts index c43eae3d02f..c85902c764c 100644 --- a/cypress/e2e/users_spec/user_creation.cy.ts +++ b/cypress/e2e/users_spec/user_creation.cy.ts @@ -11,9 +11,13 @@ describe("User Creation", () => { const userCreation = new UserCreation(); const userRole = "Doctor"; + before(() => { + cy.loginByApi("admin"); + }); + beforeEach(() => { - cy.visit("/login"); cy.loginByApi("admin"); + cy.visit("/"); }); it("should create a new user successfully", () => { diff --git a/cypress/pageObject/Patients/PatientCreation.ts b/cypress/pageObject/Patients/PatientCreation.ts index b9bb144f411..ee310189e3d 100644 --- a/cypress/pageObject/Patients/PatientCreation.ts +++ b/cypress/pageObject/Patients/PatientCreation.ts @@ -1,13 +1,30 @@ -interface PatientFormData { +export interface PatientFormData { name: string; phoneNumber: string; - dateOfBirth: string; - gender: string; - bloodGroup: string; + gender: "male" | "female" | "transgender" | "non_binary"; + bloodGroup: + | "Unknown" + | "A+" + | "A-" + | "B+" + | "B-" + | "AB+" + | "AB-" + | "O+" + | "O-" + | "Unknown"; + dateOfBirth?: string; + age?: string; address: string; + sameAsPermanentAddress?: boolean; // true by default + permanentAddress?: string; + hasEmergencyContact?: boolean; // false by default + emergencyPhoneNumber?: string; pincode: string; localBody: string; ward: string; + state: string; + district: string; } export class PatientCreation { @@ -16,9 +33,27 @@ export class PatientCreation { patientsButton: '[data-cy="patients-button"]', searchInput: "#patient-search", patientCard: "#patient-search-results", - patientName: '[data-cy="patient-name"]', - patientDetails: "#patient-search-results", createNewPatientButton: '[data-cy="create-new-patient-button"]', + nameInput: '[data-cy="patient-name-input"]', + phoneInput: '[data-cy="patient-phone-input"]', + dobDayInput: '[data-cy="dob-day-input"]', + dobMonthInput: '[data-cy="dob-month-input"]', + dobYearInput: '[data-cy="dob-year-input"]', + ageInput: '[data-cy="age-input"]', + genderRadio: '[data-cy="gender-radio-{value}"]', + bloodGroupSelect: '[data-cy="blood-group-select"]', + addressInput: '[data-cy="current-address-input"]', + sameAddressCheckbox: '[data-cy="same-address-checkbox"]', + permanentAddressInput: '[data-cy="permanent-address-input"]', + emergencyContactCheckbox: '[data-cy="same-phone-number-checkbox"]', + emergencyPhoneInput: '[data-cy="patient-emergency-phone-input"]', + pincodeInput: '[data-cy="pincode-input"]', + localBodySelect: '[data-cy="select-local_body"]', + wardSelect: '[data-cy="select-ward"]', + submitButton: '[data-cy="submit-button"]', + samePhoneNumberCheckbox: '[data-cy="same-phone-number-checkbox"]', + stateSelect: '[data-cy="select-state"]', + districtSelect: '[data-cy="select-district"]', }; // Actions @@ -43,7 +78,7 @@ export class PatientCreation { }) { // Convert object values to an array of strings const detailsArray = Object.values(patientDetails); - cy.verifyContentPresence(this.selectors.patientDetails, detailsArray); + cy.verifyContentPresence(this.selectors.patientCard, detailsArray); } clickSearchPatients() { @@ -52,12 +87,12 @@ export class PatientCreation { } enterName(name: string) { - cy.typeIntoField('[data-cy="patient-name-input"]', name); + cy.get(this.selectors.nameInput).type(name); return this; } enterPhoneNumber(phoneNumber: string) { - cy.typeIntoField('[data-cy="patient-phone-input"]', phoneNumber, { + cy.typeIntoField(this.selectors.phoneInput, phoneNumber, { skipVerification: true, }); return this; @@ -67,54 +102,85 @@ export class PatientCreation { // Split the date string (expected format: "DD-MM-YYYY") const [day, month, year] = dateString.split("-"); - cy.get('[data-cy="dob-day-input"]').type(day); - cy.get('[data-cy="dob-month-input"]').type(month); - cy.get('[data-cy="dob-year-input"]').type(year); + cy.get(this.selectors.dobDayInput).type(day); + cy.get(this.selectors.dobMonthInput).type(month); + cy.get(this.selectors.dobYearInput).type(year); return this; } selectGender(gender: string) { const lowercaseGender = gender.toLowerCase(); - cy.get(`[data-cy="gender-radio-${lowercaseGender}"]`).click(); + cy.get( + this.selectors.genderRadio.replace("{value}", lowercaseGender), + ).click(); return this; } selectBloodGroup(bloodGroup: string) { - cy.clickAndSelectOption('[data-cy="blood-group-select"]', bloodGroup); + cy.clickAndSelectOption(this.selectors.bloodGroupSelect, bloodGroup); return this; } enterAddress(address: string) { - cy.typeIntoField('[data-cy="current-address-input"]', address); + cy.typeIntoField(this.selectors.addressInput, address); return this; } enterPincode(pincode: string) { - cy.typeIntoField('[data-cy="pincode-input"]', pincode); + cy.typeIntoField(this.selectors.pincodeInput, pincode); return this; } - fillPatientDetails(patient: PatientFormData) { - return this.enterName(patient.name) - .enterPhoneNumber(patient.phoneNumber) - .clickSamePhoneNumberCheckbox() - .selectGender(patient.gender) - .selectBloodGroup(patient.bloodGroup) - .enterDateOfBirth(patient.dateOfBirth) - .enterAddress(patient.address) - .enterPincode(patient.pincode) - .selectLocalBody(patient.localBody) - .selectWard(patient.ward); + fillPatientDetails(data: PatientFormData) { + this.enterName(data.name) + .enterPhoneNumber(data.phoneNumber) + .selectGender(data.gender) + .selectBloodGroup(data.bloodGroup); + + // Handle DOB or Age + if (data.dateOfBirth) { + this.enterDateOfBirth(data.dateOfBirth); + } else if (data.age) { + cy.get('[data-cy="age-tab"]').click(); + cy.get(this.selectors.ageInput).type(data.age); + } + + // Handle permanent address + if (data.sameAsPermanentAddress === false) { + cy.get(this.selectors.sameAddressCheckbox).click(); + this.enterPermanentAddress(data.permanentAddress!); + } + + this.enterAddress(data.address); + + // Handle emergency contact - Fixed logic + if (data.hasEmergencyContact) { + // If hasEmergencyContact is true, just enter the emergency phone number + if (data.emergencyPhoneNumber) { + this.enterEmergencyPhone(data.emergencyPhoneNumber); + } + } else { + // If hasEmergencyContact is false, click the checkbox to disable emergency contact + cy.get(this.selectors.emergencyContactCheckbox).click(); + } + + this.enterPincode(data.pincode) + .selectState(data.state) + .selectDistrict(data.district) + .selectLocalBody(data.localBody) + .selectWard(data.ward); + + return this; } selectLocalBody(localBody: string) { - cy.typeAndSelectOption('[data-cy="select-local_body"]', localBody, false); + cy.typeAndSelectOption(this.selectors.localBodySelect, localBody, false); return this; } selectWard(ward: string) { - cy.typeAndSelectOption('[data-cy="select-ward"]', ward); + cy.typeAndSelectOption(this.selectors.wardSelect, ward); return this; } @@ -132,6 +198,36 @@ export class PatientCreation { cy.verifyNotification("Patient Registered Successfully"); return this; } + + enterPermanentAddress(address: string) { + cy.typeIntoField(this.selectors.permanentAddressInput, address); + return this; + } + + enterEmergencyPhone(phoneNumber: string) { + cy.typeIntoField(this.selectors.emergencyPhoneInput, phoneNumber, { + skipVerification: true, + }); + return this; + } + + selectState(state: string) { + cy.get(this.selectors.stateSelect).then(($el) => { + if ($el.val() !== state) { + cy.typeAndSelectOption(this.selectors.stateSelect, state); + } + }); + return this; + } + + selectDistrict(district: string) { + cy.get(this.selectors.districtSelect).then(($el) => { + if ($el.val() !== district) { + cy.typeAndSelectOption(this.selectors.districtSelect, district); + } + }); + return this; + } } export const patientCreation = new PatientCreation(); diff --git a/cypress/support/commands.ts b/cypress/support/commands.ts index 6b5ac7d593a..21250e1a6f9 100644 --- a/cypress/support/commands.ts +++ b/cypress/support/commands.ts @@ -1,87 +1,26 @@ import "cypress-localstorage-commands"; -const LOCAL_STORAGE_MEMORY = {}; - Cypress.Commands.add("loginByApi", (role: string) => { - const token = LOCAL_STORAGE_MEMORY["care_token"]; + const sessionName = `login-${role}`; - if (!token) { + return cy.session(sessionName, () => { + cy.visit("/login"); cy.fixture("users").then((users) => { const user = users[role]; - if (!user) { throw new Error(`User role "${role}" not found in users fixture`); } - // First do UI login to get tokens cy.get('[data-cy="username"]').type(user.username); cy.get('[data-cy="password"]').type(user.password); cy.get('[data-cy="submit"]').click(); - // Verify successful login by checking we're not on login page + // Wait for successful login cy.url().should("not.include", "/login"); - - // Save session after successful login - Object.keys(localStorage).forEach((key) => { - LOCAL_STORAGE_MEMORY[key] = localStorage[key]; - }); - }); - } else { - // If token exists, just restore the session - Object.keys(LOCAL_STORAGE_MEMORY).forEach((key) => { - localStorage.setItem(key, LOCAL_STORAGE_MEMORY[key]); }); - } -}); - -Cypress.on("uncaught:exception", () => { - // returning false here prevents Cypress from - // failing the test - return false; -}); - -/** - * getAttached(selector) - * getAttached(selectorFn) - * - * Waits until the selector finds an attached element, then yields it (wrapped). - * selectorFn, if provided, is passed $(document). Don't use cy methods inside selectorFn. - */ -Cypress.Commands.add("getAttached", (selector: string) => { - const getElement = - typeof selector === "function" - ? selector - : ($d: JQuery) => - $d.find(selector) as unknown as JQuery; - - let $el: JQuery | null = null; - - return cy - .document() - .should(($d: Document) => { - $el = getElement(Cypress.$($d)); - // Ensure $el is an HTMLElement before checking if it is detached - if ($el.length && $el[0] instanceof HTMLElement) { - // eslint-disable-next-line @typescript-eslint/no-unused-expressions - expect(Cypress.dom.isDetached($el[0])).to.be.false; // Access the first HTMLElement - } else { - throw new Error("Element is not an HTMLElement or is detached."); - } - }) - .then(() => cy.wrap($el)); + }); }); -Cypress.Commands.add( - "awaitUrl", - (url: string, disableLoginVerification = false) => { - cy.intercept(/getcurrentuser/).as("currentuser"); - cy.visit(url); - disableLoginVerification - ? cy.wait("@currentuser") - : cy.wait("@currentuser").its("response.statusCode").should("eq", 200); - }, -); - Cypress.Commands.add("verifyNotification", (text: string) => { return cy .get("li[data-sonner-toast] div[data-title]") @@ -93,10 +32,6 @@ Cypress.Commands.add("verifyNotification", (text: string) => { }); }); -Cypress.Commands.add("clearAllFilters", () => { - return cy.get("#clear-all-filters").click(); -}); - Cypress.Commands.add("clickSubmitButton", (buttonText = "Submit") => { cy.get("button[type='submit']").contains(buttonText).scrollIntoView(); cy.get("button[type='submit']").contains(buttonText).click(); diff --git a/cypress/support/index.ts b/cypress/support/index.ts index cdab9462722..fd36e3d58aa 100644 --- a/cypress/support/index.ts +++ b/cypress/support/index.ts @@ -6,12 +6,7 @@ declare global { interface Chainable { loginByApi(role: string): Chainable; verifyNotification(msg: string): Chainable; - awaitUrl( - url: string, - disableLoginVerification?: boolean, - ): Chainable; getAttached(selector: string): Chainable; - clearAllFilters(): Chainable; clickSubmitButton(buttonText?: string): Chainable; clickCancelButton(buttonText?: string): Chainable; typeAndSelectOption( diff --git a/cypress/utils/commonUtils.ts b/cypress/utils/commonUtils.ts index b87b66b7317..1f295cad248 100644 --- a/cypress/utils/commonUtils.ts +++ b/cypress/utils/commonUtils.ts @@ -46,8 +46,9 @@ export function generatePhoneNumber(): string { return `${firstDigit}${remainingDigitsStr}`; } -export function generateAddress(): string { +export function generateAddress(multiLine: boolean = false): string { const houseNumbers = ["123", "45A", "67B", "89", "234"]; + const apartments = ["Apt 4B", "Unit 12", "Flat 3A", "Suite 7", "#15"]; const streets = [ "Main Street", "Park Avenue", @@ -64,10 +65,13 @@ export function generateAddress(): string { ]; const randomHouse = houseNumbers[getRandomIndex(houseNumbers.length)]; + const randomApt = apartments[getRandomIndex(apartments.length)]; const randomStreet = streets[getRandomIndex(streets.length)]; const randomArea = areas[getRandomIndex(areas.length)]; - return `${randomHouse}, ${randomStreet}, ${randomArea}`; + return multiLine + ? `${randomHouse} ${randomStreet}\n${randomApt}\n${randomArea}` + : `${randomHouse}, ${randomStreet}, ${randomArea}`; } export function generateUsername(firstName: string): string { diff --git a/index.html b/index.html index 166c2d3bda7..1a7a6c5abe5 100644 --- a/index.html +++ b/index.html @@ -21,7 +21,6 @@ - - - - - - - - - diff --git a/public/images/empty_avatar.jpg b/public/images/empty_avatar.jpg deleted file mode 100644 index 3b8196b075b..00000000000 Binary files a/public/images/empty_avatar.jpg and /dev/null differ diff --git a/public/images/icons/apple-touch-icon-180x180.png b/public/images/icons/apple-touch-icon-180x180.png index d1b549d6934..f0ad70efbc8 100644 Binary files a/public/images/icons/apple-touch-icon-180x180.png and b/public/images/icons/apple-touch-icon-180x180.png differ diff --git a/public/images/icons/logo.svg b/public/images/icons/logo.svg index fa189323144..e9f577e0f45 100644 --- a/public/images/icons/logo.svg +++ b/public/images/icons/logo.svg @@ -1,4 +1 @@ - - - - \ No newline at end of file + \ No newline at end of file diff --git a/public/images/icons/maskable-icon-512x512.png b/public/images/icons/maskable-icon-512x512.png index f59fbfd315f..79f02637bea 100644 Binary files a/public/images/icons/maskable-icon-512x512.png and b/public/images/icons/maskable-icon-512x512.png differ diff --git a/public/images/icons/pwa-192x192.png b/public/images/icons/pwa-192x192.png index 54c10858e12..878b2fb7912 100644 Binary files a/public/images/icons/pwa-192x192.png and b/public/images/icons/pwa-192x192.png differ diff --git a/public/images/icons/pwa-512x512.png b/public/images/icons/pwa-512x512.png index bb55e099d32..e7703a04cc9 100644 Binary files a/public/images/icons/pwa-512x512.png and b/public/images/icons/pwa-512x512.png differ diff --git a/public/images/icons/pwa-64x64.png b/public/images/icons/pwa-64x64.png index 091c36a7da7..35056e6d871 100644 Binary files a/public/images/icons/pwa-64x64.png and b/public/images/icons/pwa-64x64.png differ diff --git a/public/images/logo_collapsed.svg b/public/images/logo_collapsed.svg deleted file mode 100644 index 47ca35b9ffc..00000000000 --- a/public/images/logo_collapsed.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - \ No newline at end of file diff --git a/public/images/no_skills.svg b/public/images/no_skills.svg deleted file mode 100644 index ab1a3f9a4a6..00000000000 --- a/public/images/no_skills.svg +++ /dev/null @@ -1,148 +0,0 @@ - -Created with Fabric.js 3.5.0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/public/images/vitals_graph.png b/public/images/vitals_graph.png deleted file mode 100644 index 62de6a67d57..00000000000 Binary files a/public/images/vitals_graph.png and /dev/null differ diff --git a/public/images/wave_long.png b/public/images/wave_long.png deleted file mode 100644 index c66d78b7a7e..00000000000 Binary files a/public/images/wave_long.png and /dev/null differ diff --git a/public/images/wave_long_2.png b/public/images/wave_long_2.png deleted file mode 100644 index 3397cba051d..00000000000 Binary files a/public/images/wave_long_2.png and /dev/null differ diff --git a/src/Routers/AppRouter.tsx b/src/Routers/AppRouter.tsx index eefb1adab57..179cded03e1 100644 --- a/src/Routers/AppRouter.tsx +++ b/src/Routers/AppRouter.tsx @@ -24,7 +24,6 @@ import { PlugConfigEdit } from "@/pages/Apps/PlugConfigEdit"; import { PlugConfigList } from "@/pages/Apps/PlugConfigList"; import UserDashboard from "@/pages/UserDashboard"; -import LocationRoutes from "./routes/LocationRoutes"; import OrganizationRoutes from "./routes/OrganizationRoutes"; import QuestionnaireRoutes from "./routes/questionnaireRoutes"; @@ -57,7 +56,6 @@ const Routes: AppRoutes = { ...UserRoutes, ...OrganizationRoutes, ...QuestionnaireRoutes, - ...LocationRoutes, "/session-expired": () => , "/not-found": () => , diff --git a/src/Routers/routes/LocationRoutes.tsx b/src/Routers/routes/LocationRoutes.tsx deleted file mode 100644 index 45b1230a268..00000000000 --- a/src/Routers/routes/LocationRoutes.tsx +++ /dev/null @@ -1,14 +0,0 @@ -import { AppRoutes } from "@/Routers/AppRouter"; -import LocationList from "@/pages/Location/LocationList"; -import LocationView from "@/pages/Location/LocationView"; - -const LocationRoutes: AppRoutes = { - "/facility/:facilityId/location": ({ facilityId }) => ( - - ), - "/facility/:facilityId/location/:id": ({ facilityId, id }) => ( - - ), -}; - -export default LocationRoutes; diff --git a/src/components/Encounter/CreateEncounterForm.tsx b/src/components/Encounter/CreateEncounterForm.tsx index 0bbb85cd8a4..ea4e71a53ed 100644 --- a/src/components/Encounter/CreateEncounterForm.tsx +++ b/src/components/Encounter/CreateEncounterForm.tsx @@ -42,7 +42,7 @@ import { import routes from "@/Utils/request/api"; import mutate from "@/Utils/request/mutate"; -import FacilityOrganizationSelector from "@/pages/FacilityOrganization/components/FacilityOrganizationSelector"; +import FacilityOrganizationSelector from "@/pages/Facility/settings/organizations/components/FacilityOrganizationSelector"; import { Encounter, EncounterClass, diff --git a/src/components/Patient/ManageEncounterOrganizations.tsx b/src/components/Patient/ManageEncounterOrganizations.tsx index 9c2b8c169ca..e284180d8b9 100644 --- a/src/components/Patient/ManageEncounterOrganizations.tsx +++ b/src/components/Patient/ManageEncounterOrganizations.tsx @@ -16,7 +16,7 @@ import { import routes from "@/Utils/request/api"; import mutate from "@/Utils/request/mutate"; -import FacilityOrganizationSelector from "@/pages/FacilityOrganization/components/FacilityOrganizationSelector"; +import FacilityOrganizationSelector from "@/pages/Facility/settings/organizations/components/FacilityOrganizationSelector"; import { Encounter } from "@/types/emr/encounter"; interface Props { diff --git a/src/components/Patient/PatientRegistration.tsx b/src/components/Patient/PatientRegistration.tsx index 35b4615db69..6471b8d4205 100644 --- a/src/components/Patient/PatientRegistration.tsx +++ b/src/components/Patient/PatientRegistration.tsx @@ -513,8 +513,12 @@ export default function PatientRegistration( }} > - {t("date_of_birth")} - {t("age")} + + {t("date_of_birth")} + + + {t("age")} + -

{t("facility.settings.general")}

-
{facilityId}
- {/* Add general settings form here */} - - ); + return ; } diff --git a/src/pages/Facility/settings/layout.tsx b/src/pages/Facility/settings/layout.tsx index 72c53cb1574..4ab54c1d9d2 100644 --- a/src/pages/Facility/settings/layout.tsx +++ b/src/pages/Facility/settings/layout.tsx @@ -4,13 +4,12 @@ import { useTranslation } from "react-i18next"; import { Tabs, TabsList, TabsTrigger } from "@/components/ui/tabs"; -import FacilityOrganizationIndex from "@/pages/FacilityOrganization/FacilityOrganizationIndex"; -import FacilityOrganizationUsers from "@/pages/FacilityOrganization/FacilityOrganizationUsers"; -import FacilityOrganizationView from "@/pages/FacilityOrganization/FacilityOrganizationView"; -import LocationList from "@/pages/Location/LocationList"; -import LocationView from "@/pages/Location/LocationView"; - import { GeneralSettings } from "./general/general"; +import LocationList from "./locations/LocationList"; +import LocationView from "./locations/LocationView"; +import FacilityOrganizationIndex from "./organizations/FacilityOrganizationIndex"; +import FacilityOrganizationUsers from "./organizations/FacilityOrganizationUsers"; +import FacilityOrganizationView from "./organizations/FacilityOrganizationView"; interface SettingsLayoutProps { facilityId: string; diff --git a/src/pages/Location/components/LocationForm.tsx b/src/pages/Facility/settings/locations/LocationForm.tsx similarity index 100% rename from src/pages/Location/components/LocationForm.tsx rename to src/pages/Facility/settings/locations/LocationForm.tsx diff --git a/src/pages/Location/LocationList.tsx b/src/pages/Facility/settings/locations/LocationList.tsx similarity index 99% rename from src/pages/Location/LocationList.tsx rename to src/pages/Facility/settings/locations/LocationList.tsx index d9ba92b249a..41430c65ca4 100644 --- a/src/pages/Location/LocationList.tsx +++ b/src/pages/Facility/settings/locations/LocationList.tsx @@ -17,7 +17,7 @@ import query from "@/Utils/request/query"; import { LocationList as LocationListType } from "@/types/location/location"; import locationApi from "@/types/location/locationApi"; -import LocationSheet from "./components/LocationSheet"; +import LocationSheet from "./LocationSheet"; interface Props { facilityId: string; diff --git a/src/pages/Location/components/LocationSheet.tsx b/src/pages/Facility/settings/locations/LocationSheet.tsx similarity index 100% rename from src/pages/Location/components/LocationSheet.tsx rename to src/pages/Facility/settings/locations/LocationSheet.tsx diff --git a/src/pages/Location/LocationView.tsx b/src/pages/Facility/settings/locations/LocationView.tsx similarity index 99% rename from src/pages/Location/LocationView.tsx rename to src/pages/Facility/settings/locations/LocationView.tsx index 4f1b14d8ea4..b8003173383 100644 --- a/src/pages/Location/LocationView.tsx +++ b/src/pages/Facility/settings/locations/LocationView.tsx @@ -18,7 +18,7 @@ import query from "@/Utils/request/query"; import { LocationList } from "@/types/location/location"; import locationApi from "@/types/location/locationApi"; -import LocationSheet from "./components/LocationSheet"; +import LocationSheet from "./LocationSheet"; interface Props { id: string; diff --git a/src/pages/FacilityOrganization/FacilityOrganizationIndex.tsx b/src/pages/Facility/settings/organizations/FacilityOrganizationIndex.tsx similarity index 100% rename from src/pages/FacilityOrganization/FacilityOrganizationIndex.tsx rename to src/pages/Facility/settings/organizations/FacilityOrganizationIndex.tsx diff --git a/src/pages/FacilityOrganization/FacilityOrganizationUsers.tsx b/src/pages/Facility/settings/organizations/FacilityOrganizationUsers.tsx similarity index 100% rename from src/pages/FacilityOrganization/FacilityOrganizationUsers.tsx rename to src/pages/Facility/settings/organizations/FacilityOrganizationUsers.tsx diff --git a/src/pages/FacilityOrganization/FacilityOrganizationView.tsx b/src/pages/Facility/settings/organizations/FacilityOrganizationView.tsx similarity index 100% rename from src/pages/FacilityOrganization/FacilityOrganizationView.tsx rename to src/pages/Facility/settings/organizations/FacilityOrganizationView.tsx diff --git a/src/pages/FacilityOrganization/components/CreateFacilityOrganizationSheet.tsx b/src/pages/Facility/settings/organizations/components/CreateFacilityOrganizationSheet.tsx similarity index 93% rename from src/pages/FacilityOrganization/components/CreateFacilityOrganizationSheet.tsx rename to src/pages/Facility/settings/organizations/components/CreateFacilityOrganizationSheet.tsx index 6350a613622..0726a6d44fe 100644 --- a/src/pages/FacilityOrganization/components/CreateFacilityOrganizationSheet.tsx +++ b/src/pages/Facility/settings/organizations/components/CreateFacilityOrganizationSheet.tsx @@ -95,14 +95,14 @@ export default function CreateFacilityOrganizationSheet({ - Create Organization + Create Department/Team - Create a new organization in this facility. + Create a new department/team in this facility.
@@ -111,7 +111,7 @@ export default function CreateFacilityOrganizationSheet({ setName(e.target.value)} - placeholder="Enter organization name" + placeholder="Enter department/team name" />
@@ -139,7 +139,7 @@ export default function CreateFacilityOrganizationSheet({