diff --git a/cypress/e2e/patient_spec/patient_logupdate.cy.ts b/cypress/e2e/patient_spec/patient_logupdate.cy.ts index 562e430a9ad..cd7e30e1575 100644 --- a/cypress/e2e/patient_spec/patient_logupdate.cy.ts +++ b/cypress/e2e/patient_spec/patient_logupdate.cy.ts @@ -59,7 +59,7 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => { patientLogupdate.typeRhythm(patientRhythm); cy.get("#consciousness_level-2").click(); cy.submitButton("Save"); - cy.verifyNotification("Tele-medicine log update created successfully"); + cy.verifyNotification("Telemedicine log created successfully"); }); it("Create a new log normal update for a domicilary care patient and edit it", () => { @@ -84,7 +84,7 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => { patientLogupdate.typeRhythm(patientRhythm); cy.get("#consciousness_level-2").click(); cy.submitButton("Save"); - cy.verifyNotification("Normal log update created successfully"); + cy.verifyNotification("Brief Update log created successfully"); cy.closeNotification(); // edit the card and verify the data. cy.contains("Daily Rounds").click(); @@ -107,7 +107,7 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => { patientLogupdate.clickClearButtonInElement("#diastolic"); patientLogupdate.typeDiastolic(patientModifiedDiastolic); cy.submitButton("Continue"); - cy.verifyNotification("Normal log update details updated successfully"); + cy.verifyNotification("Brief Update log updated successfully"); cy.contains("Daily Rounds").click(); patientLogupdate.clickLogupdateCard("#dailyround-entry", patientCategory); cy.verifyContentPresence("#consultation-preview", [ @@ -140,7 +140,7 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => { cy.get("#consciousness_level-2").click(); cy.submitButton("Save"); cy.wait(2000); - cy.verifyNotification("Normal log update created successfully"); + cy.verifyNotification("Brief Update log created successfully"); // Verify the card content cy.get("#basic-information").scrollIntoView(); cy.verifyContentPresence("#encounter-symptoms", [additionalSymptoms]); @@ -163,7 +163,7 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => { patientLogupdate.typeRespiratory(patientRespiratory); cy.get("#consciousness_level-2").click(); cy.submitButton("Save"); - cy.verifyNotification("Normal log update created successfully"); + cy.verifyNotification("Brief Update log created successfully"); cy.closeNotification(); cy.verifyContentPresence("#consultation-buttons", ["9"]); // Verify the Incomplete data will give blank info @@ -173,7 +173,7 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => { patientLogupdate.typeDiastolic(patientDiastolic); patientLogupdate.typePulse(patientPulse); cy.submitButton("Save"); - cy.verifyNotification("Normal log update created successfully"); + cy.verifyNotification("Brief Update log created successfully"); cy.closeNotification(); cy.verifyContentPresence("#consultation-buttons", ["-"]); }); diff --git a/cypress/e2e/patient_spec/patient_prescription.cy.ts b/cypress/e2e/patient_spec/patient_prescription.cy.ts index d9a7bf7a080..c7a7cd9aba4 100644 --- a/cypress/e2e/patient_spec/patient_prescription.cy.ts +++ b/cypress/e2e/patient_spec/patient_prescription.cy.ts @@ -1,3 +1,4 @@ +import { afterEach, before, beforeEach, cy, describe, it } from "local-cypress"; import PatientPrescription from "../../pageobject/Patient/PatientPrescription"; import LoginPage from "../../pageobject/Login/LoginPage"; import { PatientPage } from "../../pageobject/Patient/PatientCreation"; @@ -5,11 +6,13 @@ import { PatientPage } from "../../pageobject/Patient/PatientCreation"; const patientPrescription = new PatientPrescription(); const loginPage = new LoginPage(); const patientPage = new PatientPage(); -const medicineName = "DOLO"; +const medicineNameOne = "DOLO"; +const medicineNameTwo = "FDEP PLUS"; const medicineBaseDosage = "4"; const medicineTargetDosage = "9"; const medicineFrequency = "Twice daily"; const medicineAdministerNote = "Medicine Administration Note"; +const medicineIndicator = "Test Indicator"; describe("Patient Medicine Administration", () => { before(() => { @@ -23,6 +26,77 @@ describe("Patient Medicine Administration", () => { cy.awaitUrl("/patients"); }); + it("Add a new medicine | Verify the Edit and Discontinue Medicine workflow |", () => { + patientPage.visitPatient("Dummy Patient 9"); + patientPrescription.visitMedicineTab(); + patientPrescription.visitEditPrescription(); + // Add a normal Medicine to the patient + patientPrescription.clickAddPrescription(); + patientPrescription.interceptMedibase(); + patientPrescription.selectMedicinebox(); + patientPrescription.selectMedicine(medicineNameOne); + patientPrescription.enterDosage(medicineBaseDosage); + patientPrescription.selectDosageFrequency(medicineFrequency); + cy.submitButton("Submit"); + cy.verifyNotification("Medicine prescribed"); + cy.closeNotification(); + // Edit the existing medicine & Verify they are properly moved to discontinue position + patientPrescription.clickReturnToDashboard(); + patientPrescription.visitMedicineTab(); + cy.verifyAndClickElement("#0", medicineNameOne); + cy.verifyContentPresence("#submit", ["Discontinue"]); // To verify the pop-up is open + cy.submitButton("Edit"); + patientPrescription.enterDosage(medicineTargetDosage); + cy.submitButton("Submit"); + cy.verifyNotification("Prescription edited successfully"); + cy.closeNotification(); + // Discontinue a medicine & Verify the notification + cy.verifyAndClickElement("#0", medicineNameOne); + cy.submitButton("Discontinue"); + patientPrescription.enterDiscontinueReason("Medicine is been discontinued"); + cy.submitButton("Discontinue"); + cy.verifyNotification("Prescription discontinued"); + cy.closeNotification(); + // verify the discontinue medicine view + cy.verifyContentPresence("#discontinued-medicine", [ + "discontinued prescription(s)", + ]); + }); + + it("Add a PRN Prescription medicine | Group Administrate it |", () => { + patientPage.visitPatient("Dummy Patient 6"); + patientPrescription.visitMedicineTab(); + patientPrescription.visitEditPrescription(); + // Add First Medicine + patientPrescription.clickAddPrnPrescriptionButton(); + patientPrescription.interceptMedibase(); + patientPrescription.selectMedicinebox(); + patientPrescription.selectMedicine(medicineNameOne); + patientPrescription.enterDosage(medicineBaseDosage); + patientPrescription.enterIndicator(medicineIndicator); + cy.submitButton("Submit"); + cy.verifyNotification("Medicine prescribed"); + cy.closeNotification(); + // Add Second Medicine + patientPrescription.clickAddPrnPrescriptionButton(); + patientPrescription.interceptMedibase(); + patientPrescription.selectMedicinebox(); + patientPrescription.selectMedicine(medicineNameTwo); + patientPrescription.enterDosage(medicineBaseDosage); + patientPrescription.enterIndicator(medicineIndicator); + cy.submitButton("Submit"); + cy.verifyNotification("Medicine prescribed"); + cy.closeNotification(); + patientPrescription.clickReturnToDashboard(); + // Group Administer the PRN Medicine + patientPrescription.visitMedicineTab(); + patientPrescription.clickAdministerBulkMedicine(); + patientPrescription.clickAllVisibleAdministration(); + patientPrescription.clickAdministerSelectedMedicine(); + cy.verifyNotification("Medicine(s) administered"); + cy.closeNotification(); + }); + it("Add a new titrated medicine for a patient | Individual Administeration |", () => { patientPage.visitPatient("Dummy Patient 5"); patientPrescription.visitMedicineTab(); @@ -30,7 +104,7 @@ describe("Patient Medicine Administration", () => { patientPrescription.clickAddPrescription(); patientPrescription.interceptMedibase(); patientPrescription.selectMedicinebox(); - patientPrescription.selectMedicine(medicineName); + patientPrescription.selectMedicine(medicineNameOne); patientPrescription.clickTitratedDosage(); patientPrescription.enterDosage(medicineBaseDosage); patientPrescription.enterTargetDosage(medicineTargetDosage); @@ -47,14 +121,14 @@ describe("Patient Medicine Administration", () => { cy.closeNotification(); // Verify the Reflection on the Medicine cy.verifyContentPresence("#medicine-preview", [ - medicineName, + medicineNameOne, medicineBaseDosage, medicineTargetDosage, ]); patientPrescription.clickReturnToDashboard(); // Go to medicine tab and administer it again patientPrescription.visitMedicineTab(); - cy.verifyAndClickElement("#0", medicineName); + cy.verifyAndClickElement("#0", medicineNameOne); cy.submitButton("Administer"); patientPrescription.enterAdministerDosage(medicineBaseDosage); cy.submitButton("Administer Medicine"); @@ -68,7 +142,7 @@ describe("Patient Medicine Administration", () => { patientPrescription.clickAddPrescription(); patientPrescription.interceptMedibase(); patientPrescription.selectMedicinebox(); - patientPrescription.selectMedicine(medicineName); + patientPrescription.selectMedicine(medicineNameOne); patientPrescription.enterDosage(medicineBaseDosage); patientPrescription.selectDosageFrequency(medicineFrequency); cy.submitButton("Submit"); @@ -78,7 +152,7 @@ describe("Patient Medicine Administration", () => { patientPrescription.clickAddPrescription(); patientPrescription.interceptMedibase(); patientPrescription.selectMedicinebox(); - patientPrescription.selectMedicine(medicineName); + patientPrescription.selectMedicine(medicineNameOne); patientPrescription.enterDosage(medicineBaseDosage); patientPrescription.selectDosageFrequency(medicineFrequency); cy.submitButton("Submit"); diff --git a/cypress/pageobject/Patient/PatientLogupdate.ts b/cypress/pageobject/Patient/PatientLogupdate.ts index 92ea02a1417..bc141c04984 100644 --- a/cypress/pageobject/Patient/PatientLogupdate.ts +++ b/cypress/pageobject/Patient/PatientLogupdate.ts @@ -11,7 +11,7 @@ class PatientLogupdate { selectBed(bed: string) { cy.searchAndSelectOption("input[name='bed']", bed); - cy.submitButton("Move to bed"); + cy.submitButton("Update"); cy.wait(2000); } diff --git a/cypress/pageobject/Patient/PatientPrescription.ts b/cypress/pageobject/Patient/PatientPrescription.ts index a4b92b0a5fa..8e006465e08 100644 --- a/cypress/pageobject/Patient/PatientPrescription.ts +++ b/cypress/pageobject/Patient/PatientPrescription.ts @@ -1,3 +1,4 @@ +import { cy } from "local-cypress"; export class PatientPrescription { clickAddPrescription() { cy.get("#add-prescription").scrollIntoView(); @@ -7,6 +8,10 @@ export class PatientPrescription { ); } + clickAddPrnPrescriptionButton() { + cy.contains("button", "Add PRN Prescription").click(); + } + interceptMedibase() { cy.intercept("GET", "**/api/v1/medibase/**").as("getMedibase"); } @@ -27,6 +32,15 @@ export class PatientPrescription { cy.verifyAndClickElement("#administer-medicine", "Administer"); } + clickAdministerBulkMedicine() { + cy.get("#bulk-administer").should("be.visible"); + cy.get("#bulk-administer").click(); + } + + clickAllVisibleAdministration() { + cy.get("#should_administer").should("be.visible").click(); + } + selectMedicinebox() { cy.get( "div#medicine_object input[placeholder='Select'][role='combobox']", @@ -38,9 +52,20 @@ export class PatientPrescription { } enterDosage(doseAmount: string) { + cy.get("#base_dosage").clear({ force: true }); + cy.get("#base_dosage").click({ force: true }); cy.get("#base_dosage").type(doseAmount, { force: true }); } + enterIndicator(indicator: string) { + cy.get("#indicator").type(indicator); + } + + enterDiscontinueReason(reason: string) { + cy.wait(2000); + cy.get("#discontinuedReason").type(reason); + } + enterAdministerDosage(dosage: string) { cy.get("#dosage").type(dosage); } @@ -64,14 +89,9 @@ export class PatientPrescription { ); } - discontinuePreviousPrescription() { - cy.intercept( - "POST", - "**/api/v1/consultation/*/prescriptions/*/discontinue/", - ).as("deletePrescription"); - cy.get("button").contains("Discontinue").click(); - cy.get("#submit").contains("Discontinue").click(); - cy.wait("@deletePrescription").its("response.statusCode").should("eq", 200); + clickAdministerSelectedMedicine() { + cy.get("#administer-selected-medicine").should("be.visible"); + cy.get("#administer-selected-medicine").click(); } visitMedicineTab() { diff --git a/cypress/support/commands.ts b/cypress/support/commands.ts index b710e310bfb..45a3cde3245 100644 --- a/cypress/support/commands.ts +++ b/cypress/support/commands.ts @@ -112,6 +112,7 @@ Cypress.Commands.add("clearAllFilters", () => { }); Cypress.Commands.add("submitButton", (buttonText = "Submit") => { + cy.get("button[type='submit']").contains(buttonText).scrollIntoView(); cy.get("button[type='submit']").contains(buttonText).click(); }); diff --git a/package-lock.json b/package-lock.json index 3a56259835a..b0027f9c7be 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,6 @@ "version": "2.5.4", "license": "MIT", "dependencies": { - "@date-io/date-fns": "^2.16.0", "@fontsource/inter": "^5.0.18", "@glennsl/bs-json": "^5.0.4", "@googlemaps/react-wrapper": "^1.1.35", @@ -19,7 +18,7 @@ "@pnotify/mobile": "^5.2.0", "@react-spring/web": "^9.7.3", "@rescript/react": "^0.11.0", - "@sentry/browser": "^7.114.0", + "@sentry/browser": "^8.12.0", "@yaireo/ui-range": "^2.1.15", "@yudiel/react-qr-scanner": "^2.0.0-beta.3", "axios": "^1.6.8", @@ -50,7 +49,7 @@ "react-i18next": "^13.0.1", "react-infinite-scroll-component": "^6.1.0", "react-markdown": "^8.0.7", - "react-pdf": "^7.7.1", + "react-pdf": "^9.0.0", "react-player": "^2.16.0", "react-redux": "^8.1.1", "react-transition-group": "^4.4.5", @@ -2309,27 +2308,6 @@ "ms": "^2.1.1" } }, - "node_modules/@date-io/core": { - "version": "2.17.0", - "resolved": "https://registry.npmjs.org/@date-io/core/-/core-2.17.0.tgz", - "integrity": "sha512-+EQE8xZhRM/hsY0CDTVyayMDDY5ihc4MqXCrPxooKw19yAzUIC6uUqsZeaOFNL9YKTNxYKrJP5DFgE8o5xRCOw==" - }, - "node_modules/@date-io/date-fns": { - "version": "2.17.0", - "resolved": "https://registry.npmjs.org/@date-io/date-fns/-/date-fns-2.17.0.tgz", - "integrity": "sha512-L0hWZ/mTpy3Gx/xXJ5tq5CzHo0L7ry6KEO9/w/JWiFWFLZgiNVo3ex92gOl3zmzjHqY/3Ev+5sehAr8UnGLEng==", - "dependencies": { - "@date-io/core": "^2.17.0" - }, - "peerDependencies": { - "date-fns": "^2.0.0" - }, - "peerDependenciesMeta": { - "date-fns": { - "optional": true - } - } - }, "node_modules/@dependents/detective-less": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/@dependents/detective-less/-/detective-less-4.1.0.tgz", @@ -3134,26 +3112,11 @@ "node-pre-gyp": "bin/node-pre-gyp" } }, - "node_modules/@mapbox/node-pre-gyp/node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "optional": true, - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/@mapbox/node-pre-gyp/node_modules/semver": { - "version": "7.6.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.0.tgz", - "integrity": "sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==", + "version": "7.6.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.2.tgz", + "integrity": "sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==", "optional": true, - "dependencies": { - "lru-cache": "^6.0.0" - }, "bin": { "semver": "bin/semver.js" }, @@ -3161,12 +3124,6 @@ "node": ">=10" } }, - "node_modules/@mapbox/node-pre-gyp/node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "optional": true - }, "node_modules/@mdx-js/react": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/@mdx-js/react/-/react-3.0.1.tgz", @@ -4198,236 +4155,190 @@ "win32" ] }, - "node_modules/@sentry-internal/feedback": { - "version": "7.114.0", - "resolved": "https://registry.npmjs.org/@sentry-internal/feedback/-/feedback-7.114.0.tgz", - "integrity": "sha512-kUiLRUDZuh10QE9JbSVVLgqxFoD9eDPOzT0MmzlPuas8JlTmJuV4FtSANNcqctd5mBuLt2ebNXH0MhRMwyae4A==", + "node_modules/@sentry-internal/browser-utils": { + "version": "8.12.0", + "resolved": "https://registry.npmjs.org/@sentry-internal/browser-utils/-/browser-utils-8.12.0.tgz", + "integrity": "sha512-h7HRqED15Qa+DRt8iZGna24Z331nglgjPzdFn4+u+jvnZrehUjH0vjsfuj7qhwSUNZu8Rxi1ZlUYFURjLDTKCA==", "dependencies": { - "@sentry/core": "7.114.0", - "@sentry/types": "7.114.0", - "@sentry/utils": "7.114.0" + "@sentry/core": "8.12.0", + "@sentry/types": "8.12.0", + "@sentry/utils": "8.12.0" }, "engines": { - "node": ">=12" + "node": ">=14.18" } }, - "node_modules/@sentry-internal/feedback/node_modules/@sentry/core": { - "version": "7.114.0", - "resolved": "https://registry.npmjs.org/@sentry/core/-/core-7.114.0.tgz", - "integrity": "sha512-YnanVlmulkjgZiVZ9BfY9k6I082n+C+LbZo52MTvx3FY6RE5iyiPMpaOh67oXEZRWcYQEGm+bKruRxLVP6RlbA==", + "node_modules/@sentry-internal/browser-utils/node_modules/@sentry/core": { + "version": "8.12.0", + "resolved": "https://registry.npmjs.org/@sentry/core/-/core-8.12.0.tgz", + "integrity": "sha512-y+5Hlf/E45nj2adJy4aUCNBefQbyWIX66Z9bOM6JjnVB0hxCm5H0sYqrFKldYqaeZx6/Q2cgAcGs61krUxNerQ==", "dependencies": { - "@sentry/types": "7.114.0", - "@sentry/utils": "7.114.0" + "@sentry/types": "8.12.0", + "@sentry/utils": "8.12.0" }, "engines": { - "node": ">=8" - } - }, - "node_modules/@sentry-internal/feedback/node_modules/@sentry/types": { - "version": "7.114.0", - "resolved": "https://registry.npmjs.org/@sentry/types/-/types-7.114.0.tgz", - "integrity": "sha512-tsqkkyL3eJtptmPtT0m9W/bPLkU7ILY7nvwpi1hahA5jrM7ppoU0IMaQWAgTD+U3rzFH40IdXNBFb8Gnqcva4w==", - "engines": { - "node": ">=8" + "node": ">=14.18" } }, - "node_modules/@sentry-internal/feedback/node_modules/@sentry/utils": { - "version": "7.114.0", - "resolved": "https://registry.npmjs.org/@sentry/utils/-/utils-7.114.0.tgz", - "integrity": "sha512-319N90McVpupQ6vws4+tfCy/03AdtsU0MurIE4+W5cubHME08HtiEWlfacvAxX+yuKFhvdsO4K4BB/dj54ideg==", - "dependencies": { - "@sentry/types": "7.114.0" - }, + "node_modules/@sentry-internal/browser-utils/node_modules/@sentry/types": { + "version": "8.12.0", + "resolved": "https://registry.npmjs.org/@sentry/types/-/types-8.12.0.tgz", + "integrity": "sha512-pKuW64IjgcklWAOHzPJ02Ej480hyL25TLnYCAfl2TDMrYc+N0bbbH1N7ZxqJpTSVK9IxZPY/t2TRxpQBiyPEcg==", "engines": { - "node": ">=8" + "node": ">=14.18" } }, - "node_modules/@sentry-internal/replay-canvas": { - "version": "7.114.0", - "resolved": "https://registry.npmjs.org/@sentry-internal/replay-canvas/-/replay-canvas-7.114.0.tgz", - "integrity": "sha512-6rTiqmKi/FYtesdM2TM2U+rh6BytdPjLP65KTUodtxohJ+r/3m+termj2o4BhIYPE1YYOZNmbZfwebkuQPmWeg==", + "node_modules/@sentry-internal/browser-utils/node_modules/@sentry/utils": { + "version": "8.12.0", + "resolved": "https://registry.npmjs.org/@sentry/utils/-/utils-8.12.0.tgz", + "integrity": "sha512-pwYMoOmexz3vsNSOJGPvD2qwp/fsPcr8mkFk67wMM37Y+30KQ8pF4Aq1cc+HBRIn1tKmenzFDPTczSdVPFxm3Q==", "dependencies": { - "@sentry/core": "7.114.0", - "@sentry/replay": "7.114.0", - "@sentry/types": "7.114.0", - "@sentry/utils": "7.114.0" + "@sentry/types": "8.12.0" }, "engines": { - "node": ">=12" + "node": ">=14.18" } }, - "node_modules/@sentry-internal/replay-canvas/node_modules/@sentry/core": { - "version": "7.114.0", - "resolved": "https://registry.npmjs.org/@sentry/core/-/core-7.114.0.tgz", - "integrity": "sha512-YnanVlmulkjgZiVZ9BfY9k6I082n+C+LbZo52MTvx3FY6RE5iyiPMpaOh67oXEZRWcYQEGm+bKruRxLVP6RlbA==", + "node_modules/@sentry-internal/feedback": { + "version": "8.12.0", + "resolved": "https://registry.npmjs.org/@sentry-internal/feedback/-/feedback-8.12.0.tgz", + "integrity": "sha512-PvQ14wVOPmzRdYdmXD791CqERZZC4jZa5hnyBKBuF6ZpifIQ4Uk7spPu6ZO+Ympx3GtRlpYjk4dbjHyNSfYTwA==", "dependencies": { - "@sentry/types": "7.114.0", - "@sentry/utils": "7.114.0" + "@sentry/core": "8.12.0", + "@sentry/types": "8.12.0", + "@sentry/utils": "8.12.0" }, "engines": { - "node": ">=8" - } - }, - "node_modules/@sentry-internal/replay-canvas/node_modules/@sentry/types": { - "version": "7.114.0", - "resolved": "https://registry.npmjs.org/@sentry/types/-/types-7.114.0.tgz", - "integrity": "sha512-tsqkkyL3eJtptmPtT0m9W/bPLkU7ILY7nvwpi1hahA5jrM7ppoU0IMaQWAgTD+U3rzFH40IdXNBFb8Gnqcva4w==", - "engines": { - "node": ">=8" + "node": ">=14.18" } }, - "node_modules/@sentry-internal/replay-canvas/node_modules/@sentry/utils": { - "version": "7.114.0", - "resolved": "https://registry.npmjs.org/@sentry/utils/-/utils-7.114.0.tgz", - "integrity": "sha512-319N90McVpupQ6vws4+tfCy/03AdtsU0MurIE4+W5cubHME08HtiEWlfacvAxX+yuKFhvdsO4K4BB/dj54ideg==", + "node_modules/@sentry-internal/feedback/node_modules/@sentry/core": { + "version": "8.12.0", + "resolved": "https://registry.npmjs.org/@sentry/core/-/core-8.12.0.tgz", + "integrity": "sha512-y+5Hlf/E45nj2adJy4aUCNBefQbyWIX66Z9bOM6JjnVB0hxCm5H0sYqrFKldYqaeZx6/Q2cgAcGs61krUxNerQ==", "dependencies": { - "@sentry/types": "7.114.0" + "@sentry/types": "8.12.0", + "@sentry/utils": "8.12.0" }, "engines": { - "node": ">=8" + "node": ">=14.18" } }, - "node_modules/@sentry-internal/tracing": { - "version": "7.109.0", - "resolved": "https://registry.npmjs.org/@sentry-internal/tracing/-/tracing-7.109.0.tgz", - "integrity": "sha512-PzK/joC5tCuh2R/PRh+7dp+uuZl7pTsBIjPhVZHMTtb9+ls65WkdZJ1/uKXPouyz8NOo9Xok7aEvEo9seongyw==", - "dev": true, - "dependencies": { - "@sentry/core": "7.109.0", - "@sentry/types": "7.109.0", - "@sentry/utils": "7.109.0" - }, + "node_modules/@sentry-internal/feedback/node_modules/@sentry/types": { + "version": "8.12.0", + "resolved": "https://registry.npmjs.org/@sentry/types/-/types-8.12.0.tgz", + "integrity": "sha512-pKuW64IjgcklWAOHzPJ02Ej480hyL25TLnYCAfl2TDMrYc+N0bbbH1N7ZxqJpTSVK9IxZPY/t2TRxpQBiyPEcg==", "engines": { - "node": ">=8" + "node": ">=14.18" } }, - "node_modules/@sentry/browser": { - "version": "7.114.0", - "resolved": "https://registry.npmjs.org/@sentry/browser/-/browser-7.114.0.tgz", - "integrity": "sha512-ijJ0vOEY6U9JJADVYGkUbLrAbpGSQgA4zV+KW3tcsBLX9M1jaWq4BV1PWHdzDPPDhy4OgfOjIfaMb5BSPn1U+g==", + "node_modules/@sentry-internal/feedback/node_modules/@sentry/utils": { + "version": "8.12.0", + "resolved": "https://registry.npmjs.org/@sentry/utils/-/utils-8.12.0.tgz", + "integrity": "sha512-pwYMoOmexz3vsNSOJGPvD2qwp/fsPcr8mkFk67wMM37Y+30KQ8pF4Aq1cc+HBRIn1tKmenzFDPTczSdVPFxm3Q==", "dependencies": { - "@sentry-internal/feedback": "7.114.0", - "@sentry-internal/replay-canvas": "7.114.0", - "@sentry-internal/tracing": "7.114.0", - "@sentry/core": "7.114.0", - "@sentry/integrations": "7.114.0", - "@sentry/replay": "7.114.0", - "@sentry/types": "7.114.0", - "@sentry/utils": "7.114.0" + "@sentry/types": "8.12.0" }, "engines": { - "node": ">=8" + "node": ">=14.18" } }, - "node_modules/@sentry/browser/node_modules/@sentry-internal/tracing": { - "version": "7.114.0", - "resolved": "https://registry.npmjs.org/@sentry-internal/tracing/-/tracing-7.114.0.tgz", - "integrity": "sha512-dOuvfJN7G+3YqLlUY4HIjyWHaRP8vbOgF+OsE5w2l7ZEn1rMAaUbPntAR8AF9GBA6j2zWNoSo8e7GjbJxVofSg==", + "node_modules/@sentry-internal/replay": { + "version": "8.12.0", + "resolved": "https://registry.npmjs.org/@sentry-internal/replay/-/replay-8.12.0.tgz", + "integrity": "sha512-TJceMtzRnY3SCvt3nFDu9rlT00Le7SaV2RL3D7SyDuijvJbWvIw3DRk7yutpF8c9YKO9j6FMa4NlkCJ+YAnnKQ==", "dependencies": { - "@sentry/core": "7.114.0", - "@sentry/types": "7.114.0", - "@sentry/utils": "7.114.0" + "@sentry-internal/browser-utils": "8.12.0", + "@sentry/core": "8.12.0", + "@sentry/types": "8.12.0", + "@sentry/utils": "8.12.0" }, "engines": { - "node": ">=8" + "node": ">=14.18" } }, - "node_modules/@sentry/browser/node_modules/@sentry/core": { - "version": "7.114.0", - "resolved": "https://registry.npmjs.org/@sentry/core/-/core-7.114.0.tgz", - "integrity": "sha512-YnanVlmulkjgZiVZ9BfY9k6I082n+C+LbZo52MTvx3FY6RE5iyiPMpaOh67oXEZRWcYQEGm+bKruRxLVP6RlbA==", + "node_modules/@sentry-internal/replay-canvas": { + "version": "8.12.0", + "resolved": "https://registry.npmjs.org/@sentry-internal/replay-canvas/-/replay-canvas-8.12.0.tgz", + "integrity": "sha512-0slfHZ3TD3MKeBu5NEGuKuecxStX23gts5L3mGFJd/zwsd04A31fhVmo6agIkxnZbOU4GPX/7HPWIeevkvy3ig==", "dependencies": { - "@sentry/types": "7.114.0", - "@sentry/utils": "7.114.0" + "@sentry-internal/replay": "8.12.0", + "@sentry/core": "8.12.0", + "@sentry/types": "8.12.0", + "@sentry/utils": "8.12.0" }, "engines": { - "node": ">=8" + "node": ">=14.18" } }, - "node_modules/@sentry/browser/node_modules/@sentry/types": { - "version": "7.114.0", - "resolved": "https://registry.npmjs.org/@sentry/types/-/types-7.114.0.tgz", - "integrity": "sha512-tsqkkyL3eJtptmPtT0m9W/bPLkU7ILY7nvwpi1hahA5jrM7ppoU0IMaQWAgTD+U3rzFH40IdXNBFb8Gnqcva4w==", - "engines": { - "node": ">=8" - } - }, - "node_modules/@sentry/browser/node_modules/@sentry/utils": { - "version": "7.114.0", - "resolved": "https://registry.npmjs.org/@sentry/utils/-/utils-7.114.0.tgz", - "integrity": "sha512-319N90McVpupQ6vws4+tfCy/03AdtsU0MurIE4+W5cubHME08HtiEWlfacvAxX+yuKFhvdsO4K4BB/dj54ideg==", + "node_modules/@sentry-internal/replay-canvas/node_modules/@sentry/core": { + "version": "8.12.0", + "resolved": "https://registry.npmjs.org/@sentry/core/-/core-8.12.0.tgz", + "integrity": "sha512-y+5Hlf/E45nj2adJy4aUCNBefQbyWIX66Z9bOM6JjnVB0hxCm5H0sYqrFKldYqaeZx6/Q2cgAcGs61krUxNerQ==", "dependencies": { - "@sentry/types": "7.114.0" + "@sentry/types": "8.12.0", + "@sentry/utils": "8.12.0" }, "engines": { - "node": ">=8" + "node": ">=14.18" } }, - "node_modules/@sentry/core": { - "version": "7.109.0", - "resolved": "https://registry.npmjs.org/@sentry/core/-/core-7.109.0.tgz", - "integrity": "sha512-xwD4U0IlvvlE/x/g/W1I8b4Cfb16SsCMmiEuBf6XxvAa3OfWBxKoqLifb3GyrbxMC4LbIIZCN/SvLlnGJPgszA==", - "dev": true, - "dependencies": { - "@sentry/types": "7.109.0", - "@sentry/utils": "7.109.0" - }, + "node_modules/@sentry-internal/replay-canvas/node_modules/@sentry/types": { + "version": "8.12.0", + "resolved": "https://registry.npmjs.org/@sentry/types/-/types-8.12.0.tgz", + "integrity": "sha512-pKuW64IjgcklWAOHzPJ02Ej480hyL25TLnYCAfl2TDMrYc+N0bbbH1N7ZxqJpTSVK9IxZPY/t2TRxpQBiyPEcg==", "engines": { - "node": ">=8" + "node": ">=14.18" } }, - "node_modules/@sentry/integrations": { - "version": "7.114.0", - "resolved": "https://registry.npmjs.org/@sentry/integrations/-/integrations-7.114.0.tgz", - "integrity": "sha512-BJIBWXGKeIH0ifd7goxOS29fBA8BkEgVVCahs6xIOXBjX1IRS6PmX0zYx/GP23nQTfhJiubv2XPzoYOlZZmDxg==", + "node_modules/@sentry-internal/replay-canvas/node_modules/@sentry/utils": { + "version": "8.12.0", + "resolved": "https://registry.npmjs.org/@sentry/utils/-/utils-8.12.0.tgz", + "integrity": "sha512-pwYMoOmexz3vsNSOJGPvD2qwp/fsPcr8mkFk67wMM37Y+30KQ8pF4Aq1cc+HBRIn1tKmenzFDPTczSdVPFxm3Q==", "dependencies": { - "@sentry/core": "7.114.0", - "@sentry/types": "7.114.0", - "@sentry/utils": "7.114.0", - "localforage": "^1.8.1" + "@sentry/types": "8.12.0" }, "engines": { - "node": ">=8" + "node": ">=14.18" } }, - "node_modules/@sentry/integrations/node_modules/@sentry/core": { - "version": "7.114.0", - "resolved": "https://registry.npmjs.org/@sentry/core/-/core-7.114.0.tgz", - "integrity": "sha512-YnanVlmulkjgZiVZ9BfY9k6I082n+C+LbZo52MTvx3FY6RE5iyiPMpaOh67oXEZRWcYQEGm+bKruRxLVP6RlbA==", + "node_modules/@sentry-internal/replay/node_modules/@sentry/core": { + "version": "8.12.0", + "resolved": "https://registry.npmjs.org/@sentry/core/-/core-8.12.0.tgz", + "integrity": "sha512-y+5Hlf/E45nj2adJy4aUCNBefQbyWIX66Z9bOM6JjnVB0hxCm5H0sYqrFKldYqaeZx6/Q2cgAcGs61krUxNerQ==", "dependencies": { - "@sentry/types": "7.114.0", - "@sentry/utils": "7.114.0" + "@sentry/types": "8.12.0", + "@sentry/utils": "8.12.0" }, "engines": { - "node": ">=8" + "node": ">=14.18" } }, - "node_modules/@sentry/integrations/node_modules/@sentry/types": { - "version": "7.114.0", - "resolved": "https://registry.npmjs.org/@sentry/types/-/types-7.114.0.tgz", - "integrity": "sha512-tsqkkyL3eJtptmPtT0m9W/bPLkU7ILY7nvwpi1hahA5jrM7ppoU0IMaQWAgTD+U3rzFH40IdXNBFb8Gnqcva4w==", + "node_modules/@sentry-internal/replay/node_modules/@sentry/types": { + "version": "8.12.0", + "resolved": "https://registry.npmjs.org/@sentry/types/-/types-8.12.0.tgz", + "integrity": "sha512-pKuW64IjgcklWAOHzPJ02Ej480hyL25TLnYCAfl2TDMrYc+N0bbbH1N7ZxqJpTSVK9IxZPY/t2TRxpQBiyPEcg==", "engines": { - "node": ">=8" + "node": ">=14.18" } }, - "node_modules/@sentry/integrations/node_modules/@sentry/utils": { - "version": "7.114.0", - "resolved": "https://registry.npmjs.org/@sentry/utils/-/utils-7.114.0.tgz", - "integrity": "sha512-319N90McVpupQ6vws4+tfCy/03AdtsU0MurIE4+W5cubHME08HtiEWlfacvAxX+yuKFhvdsO4K4BB/dj54ideg==", + "node_modules/@sentry-internal/replay/node_modules/@sentry/utils": { + "version": "8.12.0", + "resolved": "https://registry.npmjs.org/@sentry/utils/-/utils-8.12.0.tgz", + "integrity": "sha512-pwYMoOmexz3vsNSOJGPvD2qwp/fsPcr8mkFk67wMM37Y+30KQ8pF4Aq1cc+HBRIn1tKmenzFDPTczSdVPFxm3Q==", "dependencies": { - "@sentry/types": "7.114.0" + "@sentry/types": "8.12.0" }, "engines": { - "node": ">=8" + "node": ">=14.18" } }, - "node_modules/@sentry/node": { + "node_modules/@sentry-internal/tracing": { "version": "7.109.0", - "resolved": "https://registry.npmjs.org/@sentry/node/-/node-7.109.0.tgz", - "integrity": "sha512-tqMNAES4X/iBl1eZRCmc29p//0id01FBLEiesNo5nk6ECl6/SaGMFAEwu1gsn90h/Bjgr04slwFOS4cR45V2PQ==", + "resolved": "https://registry.npmjs.org/@sentry-internal/tracing/-/tracing-7.109.0.tgz", + "integrity": "sha512-PzK/joC5tCuh2R/PRh+7dp+uuZl7pTsBIjPhVZHMTtb9+ls65WkdZJ1/uKXPouyz8NOo9Xok7aEvEo9seongyw==", "dev": true, "dependencies": { - "@sentry-internal/tracing": "7.109.0", "@sentry/core": "7.109.0", "@sentry/types": "7.109.0", "@sentry/utils": "7.109.0" @@ -4436,59 +4347,77 @@ "node": ">=8" } }, - "node_modules/@sentry/replay": { - "version": "7.114.0", - "resolved": "https://registry.npmjs.org/@sentry/replay/-/replay-7.114.0.tgz", - "integrity": "sha512-UvEajoLIX9n2poeW3R4Ybz7D0FgCGXoFr/x/33rdUEMIdTypknxjJWxg6fJngIduzwrlrvWpvP8QiZXczYQy2Q==", + "node_modules/@sentry/browser": { + "version": "8.12.0", + "resolved": "https://registry.npmjs.org/@sentry/browser/-/browser-8.12.0.tgz", + "integrity": "sha512-H82dmr7KQWoS2DQc5dJko5wNepltcEro1EM4mBeL2YmVbNRtoZzD3HQTpbxJJuFsTvEMZevvez5HFlpUgxmIwQ==", "dependencies": { - "@sentry-internal/tracing": "7.114.0", - "@sentry/core": "7.114.0", - "@sentry/types": "7.114.0", - "@sentry/utils": "7.114.0" + "@sentry-internal/browser-utils": "8.12.0", + "@sentry-internal/feedback": "8.12.0", + "@sentry-internal/replay": "8.12.0", + "@sentry-internal/replay-canvas": "8.12.0", + "@sentry/core": "8.12.0", + "@sentry/types": "8.12.0", + "@sentry/utils": "8.12.0" }, "engines": { - "node": ">=12" + "node": ">=14.18" } }, - "node_modules/@sentry/replay/node_modules/@sentry-internal/tracing": { - "version": "7.114.0", - "resolved": "https://registry.npmjs.org/@sentry-internal/tracing/-/tracing-7.114.0.tgz", - "integrity": "sha512-dOuvfJN7G+3YqLlUY4HIjyWHaRP8vbOgF+OsE5w2l7ZEn1rMAaUbPntAR8AF9GBA6j2zWNoSo8e7GjbJxVofSg==", + "node_modules/@sentry/browser/node_modules/@sentry/core": { + "version": "8.12.0", + "resolved": "https://registry.npmjs.org/@sentry/core/-/core-8.12.0.tgz", + "integrity": "sha512-y+5Hlf/E45nj2adJy4aUCNBefQbyWIX66Z9bOM6JjnVB0hxCm5H0sYqrFKldYqaeZx6/Q2cgAcGs61krUxNerQ==", "dependencies": { - "@sentry/core": "7.114.0", - "@sentry/types": "7.114.0", - "@sentry/utils": "7.114.0" + "@sentry/types": "8.12.0", + "@sentry/utils": "8.12.0" }, "engines": { - "node": ">=8" + "node": ">=14.18" + } + }, + "node_modules/@sentry/browser/node_modules/@sentry/types": { + "version": "8.12.0", + "resolved": "https://registry.npmjs.org/@sentry/types/-/types-8.12.0.tgz", + "integrity": "sha512-pKuW64IjgcklWAOHzPJ02Ej480hyL25TLnYCAfl2TDMrYc+N0bbbH1N7ZxqJpTSVK9IxZPY/t2TRxpQBiyPEcg==", + "engines": { + "node": ">=14.18" } }, - "node_modules/@sentry/replay/node_modules/@sentry/core": { - "version": "7.114.0", - "resolved": "https://registry.npmjs.org/@sentry/core/-/core-7.114.0.tgz", - "integrity": "sha512-YnanVlmulkjgZiVZ9BfY9k6I082n+C+LbZo52MTvx3FY6RE5iyiPMpaOh67oXEZRWcYQEGm+bKruRxLVP6RlbA==", + "node_modules/@sentry/browser/node_modules/@sentry/utils": { + "version": "8.12.0", + "resolved": "https://registry.npmjs.org/@sentry/utils/-/utils-8.12.0.tgz", + "integrity": "sha512-pwYMoOmexz3vsNSOJGPvD2qwp/fsPcr8mkFk67wMM37Y+30KQ8pF4Aq1cc+HBRIn1tKmenzFDPTczSdVPFxm3Q==", "dependencies": { - "@sentry/types": "7.114.0", - "@sentry/utils": "7.114.0" + "@sentry/types": "8.12.0" }, "engines": { - "node": ">=8" + "node": ">=14.18" } }, - "node_modules/@sentry/replay/node_modules/@sentry/types": { - "version": "7.114.0", - "resolved": "https://registry.npmjs.org/@sentry/types/-/types-7.114.0.tgz", - "integrity": "sha512-tsqkkyL3eJtptmPtT0m9W/bPLkU7ILY7nvwpi1hahA5jrM7ppoU0IMaQWAgTD+U3rzFH40IdXNBFb8Gnqcva4w==", + "node_modules/@sentry/core": { + "version": "7.109.0", + "resolved": "https://registry.npmjs.org/@sentry/core/-/core-7.109.0.tgz", + "integrity": "sha512-xwD4U0IlvvlE/x/g/W1I8b4Cfb16SsCMmiEuBf6XxvAa3OfWBxKoqLifb3GyrbxMC4LbIIZCN/SvLlnGJPgszA==", + "dev": true, + "dependencies": { + "@sentry/types": "7.109.0", + "@sentry/utils": "7.109.0" + }, "engines": { "node": ">=8" } }, - "node_modules/@sentry/replay/node_modules/@sentry/utils": { - "version": "7.114.0", - "resolved": "https://registry.npmjs.org/@sentry/utils/-/utils-7.114.0.tgz", - "integrity": "sha512-319N90McVpupQ6vws4+tfCy/03AdtsU0MurIE4+W5cubHME08HtiEWlfacvAxX+yuKFhvdsO4K4BB/dj54ideg==", + "node_modules/@sentry/node": { + "version": "7.109.0", + "resolved": "https://registry.npmjs.org/@sentry/node/-/node-7.109.0.tgz", + "integrity": "sha512-tqMNAES4X/iBl1eZRCmc29p//0id01FBLEiesNo5nk6ECl6/SaGMFAEwu1gsn90h/Bjgr04slwFOS4cR45V2PQ==", + "dev": true, "dependencies": { - "@sentry/types": "7.114.0" + "@sentry-internal/tracing": "7.109.0", + "@sentry/core": "7.109.0", + "@sentry/types": "7.109.0", + "@sentry/utils": "7.109.0" }, "engines": { "node": ">=8" @@ -7660,6 +7589,7 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-2.0.0.tgz", "integrity": "sha512-Ci/qENmwHnsYo9xKIcUJN5LeDKdJ6R1Z1j9V/J5wyq8nh/mYPEpIKJbBZXtZjG04HiK7zV/p6Vs9952MrMeUIw==", + "deprecated": "This package is no longer supported.", "optional": true, "dependencies": { "delegates": "^1.0.0", @@ -13653,6 +13583,7 @@ "version": "3.0.2", "resolved": "https://registry.npmjs.org/gauge/-/gauge-3.0.2.tgz", "integrity": "sha512-+5J6MS/5XksCuXq++uFRsnUd7Ovu1XenbeuIuNRJxYWjgQbPuFhT14lAvsWfqfAmnwluf1OwMjz39HjfLPci0Q==", + "deprecated": "This package is no longer supported.", "optional": true, "dependencies": { "aproba": "^1.0.3 || ^2.0.0", @@ -14660,11 +14591,6 @@ "node": ">= 4" } }, - "node_modules/immediate": { - "version": "3.0.6", - "resolved": "https://registry.npmjs.org/immediate/-/immediate-3.0.6.tgz", - "integrity": "sha512-XXOFtyqDjNDAQxVfYxuF7g9Il/IbWmmlQg2MYKOH8ExIT1qg6xc4zyS3HaEEATgs1btfzxq15ciUiY7gjSXRGQ==" - }, "node_modules/import-fresh": { "version": "3.3.0", "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", @@ -15830,14 +15756,6 @@ "node": ">= 0.8.0" } }, - "node_modules/lie": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/lie/-/lie-3.1.1.tgz", - "integrity": "sha512-RiNhHysUjhrDQntfYSfY4MU24coXXdEOgw9WGcKHNeEwffDYbF//u87M1EWaMGzuFoSbqW0C9C6lEEhDOAswfw==", - "dependencies": { - "immediate": "~3.0.5" - } - }, "node_modules/lilconfig": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-2.1.0.tgz", @@ -16329,14 +16247,6 @@ "debug": "4.3.4" } }, - "node_modules/localforage": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/localforage/-/localforage-1.10.0.tgz", - "integrity": "sha512-14/H1aX7hzBBmmh7sGPd+AOMkkIrHM3Z1PAyGgZigA1H1p5O5ANnMyWzvpAETtG68/dC4pC0ncy3+PPGzXZHPg==", - "dependencies": { - "lie": "3.1.1" - } - }, "node_modules/locate-path": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", @@ -17469,14 +17379,14 @@ "dev": true }, "node_modules/merge-refs": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/merge-refs/-/merge-refs-1.2.2.tgz", - "integrity": "sha512-RwcT7GsQR3KbuLw1rRuodq4Nt547BKEBkliZ0qqsrpyNne9bGTFtsFIsIpx82huWhcl3kOlOlH4H0xkPk/DqVw==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/merge-refs/-/merge-refs-1.3.0.tgz", + "integrity": "sha512-nqXPXbso+1dcKDpPCXvwZyJILz+vSLqGGOnDrYHQYE+B8n9JTCekVLC65AfCpR4ggVyA/45Y0iR9LDyS2iI+zA==", "funding": { "url": "https://github.com/wojtekmaj/merge-refs?sponsor=1" }, "peerDependencies": { - "@types/react": "^16.8.0 || ^17.0.0 || ^18.0.0" + "@types/react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" }, "peerDependenciesMeta": { "@types/react": { @@ -18574,6 +18484,7 @@ "version": "5.0.1", "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-5.0.1.tgz", "integrity": "sha512-AqZtDUWOMKs1G/8lwylVjrdYgqA4d9nu8hc+0gzRxlDb1I10+FHBGMXs6aiQHFdCUUlqH99MUMuLfzWDNDtfxw==", + "deprecated": "This package is no longer supported.", "optional": true, "dependencies": { "are-we-there-yet": "^2.0.0", @@ -19182,26 +19093,14 @@ } }, "node_modules/path2d": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/path2d/-/path2d-0.1.1.tgz", - "integrity": "sha512-/+S03c8AGsDYKKBtRDqieTJv2GlkMb0bWjnqOgtF6MkjdUQ9a8ARAtxWf9NgKLGm2+WQr6+/tqJdU8HNGsIDoA==", + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/path2d/-/path2d-0.2.0.tgz", + "integrity": "sha512-KdPAykQX6kmLSOO6Jpu2KNcCED7CKjmaBNGGNuctOsG0hgYO1OdYQaan6cYXJiG0WmXOwZZPILPBimu5QAIw3A==", "optional": true, "engines": { "node": ">=6" } }, - "node_modules/path2d-polyfill": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/path2d-polyfill/-/path2d-polyfill-2.1.1.tgz", - "integrity": "sha512-4Rka5lN+rY/p0CdD8+E+BFv51lFaFvJOrlOhyQ+zjzyQrzyh3ozmxd1vVGGDdIbUFSBtIZLSnspxTgPT0iJhvA==", - "optional": true, - "dependencies": { - "path2d": "0.1.1" - }, - "engines": { - "node": ">=18" - } - }, "node_modules/pathe": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/pathe/-/pathe-1.1.2.tgz", @@ -19228,15 +19127,15 @@ } }, "node_modules/pdfjs-dist": { - "version": "3.11.174", - "resolved": "https://registry.npmjs.org/pdfjs-dist/-/pdfjs-dist-3.11.174.tgz", - "integrity": "sha512-TdTZPf1trZ8/UFu5Cx/GXB7GZM30LT+wWUNfsi6Bq8ePLnb+woNKtDymI2mxZYBpMbonNFqKmiz684DIfnd8dA==", + "version": "4.3.136", + "resolved": "https://registry.npmjs.org/pdfjs-dist/-/pdfjs-dist-4.3.136.tgz", + "integrity": "sha512-gzfnt1qc4yA+U46golPGYtU4WM2ssqP2MvFjKga8GEKOrEnzRPrA/9jogLLPYHiA3sGBPJ+p7BdAq+ytmw3jEg==", "engines": { "node": ">=18" }, "optionalDependencies": { "canvas": "^2.11.2", - "path2d-polyfill": "^2.0.1" + "path2d": "^0.2.0" } }, "node_modules/peek-stream": { @@ -20839,17 +20738,16 @@ } }, "node_modules/react-pdf": { - "version": "7.7.3", - "resolved": "https://registry.npmjs.org/react-pdf/-/react-pdf-7.7.3.tgz", - "integrity": "sha512-a2VfDl8hiGjugpqezBTUzJHYLNB7IS7a2t7GD52xMI9xHg8LdVaTMsnM9ZlNmKadnStT/tvX5IfV0yLn+JvYmw==", + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/react-pdf/-/react-pdf-9.0.0.tgz", + "integrity": "sha512-J+pza8R2p9oNEOJOHIQJI4o5rFK7ji7bBl2IvsHvz1OOyphvuzVDo5tOJwWAFAbxYauCH3Kt8jOvcMJUOpxYZQ==", "dependencies": { "clsx": "^2.0.0", "dequal": "^2.0.3", "make-cancellable-promise": "^1.3.1", "make-event-props": "^1.6.0", - "merge-refs": "^1.2.1", - "pdfjs-dist": "3.11.174", - "prop-types": "^15.6.2", + "merge-refs": "^1.3.0", + "pdfjs-dist": "4.3.136", "tiny-invariant": "^1.0.0", "warning": "^4.0.0" }, @@ -20857,9 +20755,9 @@ "url": "https://github.com/wojtekmaj/react-pdf?sponsor=1" }, "peerDependencies": { - "@types/react": "^16.8.0 || ^17.0.0 || ^18.0.0", - "react": "^16.8.0 || ^17.0.0 || ^18.0.0", - "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0" + "@types/react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0", + "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0", + "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" }, "peerDependenciesMeta": { "@types/react": { diff --git a/package.json b/package.json index 8981eca79c7..e23c97fd517 100644 --- a/package.json +++ b/package.json @@ -49,7 +49,6 @@ "build-storybook": "storybook build" }, "dependencies": { - "@date-io/date-fns": "^2.16.0", "@fontsource/inter": "^5.0.18", "@glennsl/bs-json": "^5.0.4", "@googlemaps/react-wrapper": "^1.1.35", @@ -59,7 +58,7 @@ "@pnotify/mobile": "^5.2.0", "@react-spring/web": "^9.7.3", "@rescript/react": "^0.11.0", - "@sentry/browser": "^7.114.0", + "@sentry/browser": "^8.12.0", "@yaireo/ui-range": "^2.1.15", "@yudiel/react-qr-scanner": "^2.0.0-beta.3", "axios": "^1.6.8", @@ -72,8 +71,8 @@ "echarts-for-react": "^3.0.2", "eslint-mdx": "^3.1.5", "events": "^3.3.0", - "hi-profiles": "^1.0.6", "glob": "^10.3.15", + "hi-profiles": "^1.0.6", "i18next": "^23.11.4", "i18next-browser-languagedetector": "^7.2.1", "lodash-es": "^4.17.21", @@ -90,7 +89,7 @@ "react-i18next": "^13.0.1", "react-infinite-scroll-component": "^6.1.0", "react-markdown": "^8.0.7", - "react-pdf": "^7.7.1", + "react-pdf": "^9.0.0", "react-player": "^2.16.0", "react-redux": "^8.1.1", "react-transition-group": "^4.4.5", diff --git a/src/Common/constants.tsx b/src/Common/constants.tsx index 5c09b0fd201..35790e77b16 100644 --- a/src/Common/constants.tsx +++ b/src/Common/constants.tsx @@ -313,8 +313,12 @@ export const REVIEW_AT_CHOICES: Array = [ { id: 36 * 60, text: "36 hr" }, { id: 2 * 24 * 60, text: "2 days" }, { id: 3 * 24 * 60, text: "3 days" }, + { id: 5 * 24 * 60, text: "5 days" }, { id: 7 * 24 * 60, text: "7 days" }, + { id: 10 * 24 * 60, text: "10 days" }, { id: 14 * 24 * 60, text: "2 weeks" }, + { id: 21 * 24 * 60, text: "3 weeks" }, + { id: 25 * 24 * 60, text: "25 days" }, { id: 30 * 24 * 60, text: "1 month" }, ]; diff --git a/src/Components/Common/FacilitySelect.tsx b/src/Components/Common/FacilitySelect.tsx index ac098cc2127..2b820b40d6a 100644 --- a/src/Components/Common/FacilitySelect.tsx +++ b/src/Components/Common/FacilitySelect.tsx @@ -9,7 +9,9 @@ interface FacilitySelectProps { exclude_user?: string; errors?: string | undefined; className?: string; + required?: boolean; searchAll?: boolean; + disabled?: boolean; multiple?: boolean; facilityType?: number; district?: string; @@ -25,10 +27,12 @@ export const FacilitySelect = (props: FacilitySelectProps) => { const { name, exclude_user, + required, multiple, selected, setSelected, searchAll, + disabled = false, showAll = true, showNOptions = 10, className = "", @@ -69,8 +73,10 @@ export const FacilitySelect = (props: FacilitySelectProps) => { return ( { -
{title("Symptoms")}
{Js.Array.map(id => { -
- {str(symptoms[id - 1])} -
- }, Others.additional_symptoms( - others, - ))->React.array}
{renderOptionalDescription( + let additionalSymptoms = Others.additional_symptoms(others) +
+ {title("Symptoms")} +
+ {switch additionalSymptoms { + | Some(symptomsArray) => Js.Array.map(id => { +
+ {str(symptoms[id - 1])} +
+ }, symptomsArray)->React.array + | None => React.null + }} +
+ {renderOptionalDescription( "Physical Examination Info", Others.physical_examination_info(others), - )} {renderOptionalDescription("Other Details", Others.other_details(others))}
+ )} + {renderOptionalDescription("Other Details", Others.other_details(others))} +
} diff --git a/src/Components/CriticalCareRecording/Recording/CriticalCare__Recording.res b/src/Components/CriticalCareRecording/Recording/CriticalCare__Recording.res index e8bfb91e21c..d919215071e 100644 --- a/src/Components/CriticalCareRecording/Recording/CriticalCare__Recording.res +++ b/src/Components/CriticalCareRecording/Recording/CriticalCare__Recording.res @@ -240,7 +240,7 @@ let make = (~id, ~facilityId, ~patientId, ~consultationId, ~dailyRound) => { href={`/facility/${facilityId}/patient/${patientId}/consultation/${consultationId}`}> diff --git a/src/Components/CriticalCareRecording/types/CriticalCare__Others.res b/src/Components/CriticalCareRecording/types/CriticalCare__Others.res index 93cf8508872..21b9513eb8d 100644 --- a/src/Components/CriticalCareRecording/types/CriticalCare__Others.res +++ b/src/Components/CriticalCareRecording/types/CriticalCare__Others.res @@ -2,7 +2,7 @@ type t = { bilateral_air_entry: option, etco2: option, physical_examination_info: option, - additional_symptoms: array, + additional_symptoms: option>, other_details: option, other_symptoms: option, } @@ -21,12 +21,12 @@ let make = ( ~other_symptoms, ~other_details, ) => { - bilateral_air_entry: bilateral_air_entry, - etco2: etco2, - physical_examination_info: physical_examination_info, - other_details: other_details, - additional_symptoms: additional_symptoms, - other_symptoms: other_symptoms, + bilateral_air_entry, + etco2, + physical_examination_info, + other_details, + additional_symptoms, + other_symptoms, } let makeFromJs = dailyRound => { diff --git a/src/Components/Facility/ConsultationDetails/ConsultationFeedTab.tsx b/src/Components/Facility/ConsultationDetails/ConsultationFeedTab.tsx index ad966d58a6d..378f16eb7ed 100644 --- a/src/Components/Facility/ConsultationDetails/ConsultationFeedTab.tsx +++ b/src/Components/Facility/ConsultationDetails/ConsultationFeedTab.tsx @@ -180,7 +180,7 @@ export const ConsultationFeedTab = (props: ConsultationTabProps) => { ? "Save current position to selected preset" : "Change camera position to update preset" } - tooltipClassName="translate-y-8 text-xs" + tooltipClassName="translate-x-3 translate-y-8 text-xs" onClick={() => setShowPresetSaveConfirmation(true)} > {
- Move to bed + Update
diff --git a/src/Components/Facility/Consultations/DailyRounds/LogUpdateCardAttribute.tsx b/src/Components/Facility/Consultations/DailyRounds/LogUpdateCardAttribute.tsx index 4e5b7408266..e147b2ec3a4 100644 --- a/src/Components/Facility/Consultations/DailyRounds/LogUpdateCardAttribute.tsx +++ b/src/Components/Facility/Consultations/DailyRounds/LogUpdateCardAttribute.tsx @@ -1,3 +1,4 @@ +import { useTranslation } from "react-i18next"; import PatientCategoryBadge from "../../../Common/PatientCategoryBadge"; import { BloodPressure, @@ -15,6 +16,8 @@ const LogUpdateCardAttribute = ({ attributeKey, attributeValue, }: Props) => { + const { t } = useTranslation(); + switch (attributeKey) { // case "id": // case "external_id": @@ -67,9 +70,7 @@ const LogUpdateCardAttribute = ({
- {(attributeValue as string) === "VENTILATOR" - ? "CRITICAL CARE" - : (attributeValue as string)} + {t(attributeValue)}
); diff --git a/src/Components/Facility/Consultations/DailyRoundsList.tsx b/src/Components/Facility/Consultations/DailyRoundsList.tsx index 65182c01620..fcea928620d 100644 --- a/src/Components/Facility/Consultations/DailyRoundsList.tsx +++ b/src/Components/Facility/Consultations/DailyRoundsList.tsx @@ -83,9 +83,11 @@ export default function DailyRoundsList({ consultation }: Props) { ); } - const itemUrl = ["NORMAL", "TELEMEDICINE"].includes( - item.rounds_type as string, - ) + const itemUrl = [ + "NORMAL", + "TELEMEDICINE", + "DOCTORS_LOG", + ].includes(item.rounds_type as string) ? `${consultationUrl}/daily-rounds/${item.id}` : `${consultationUrl}/daily_rounds/${item.id}`; diff --git a/src/Components/Facility/DischargeModal.tsx b/src/Components/Facility/DischargeModal.tsx index e2dd14dce79..0be7b4eabd8 100644 --- a/src/Components/Facility/DischargeModal.tsx +++ b/src/Components/Facility/DischargeModal.tsx @@ -40,9 +40,9 @@ interface IProps { show: boolean; onClose: () => void; consultationData: ConsultationModel; + referred_to?: FacilityModel | null; afterSubmit?: () => void; new_discharge_reason?: number | null; - discharge_notes?: string; discharge_date?: string; death_datetime?: string; } @@ -53,7 +53,7 @@ const DischargeModal = ({ consultationData, afterSubmit, new_discharge_reason = null, - discharge_notes = "", + referred_to = null, discharge_date = dayjs().format("YYYY-MM-DDTHH:mm"), death_datetime = dayjs().format("YYYY-MM-DDTHH:mm"), }: IProps) => { @@ -62,18 +62,40 @@ const DischargeModal = ({ const [preDischargeForm, setPreDischargeForm] = useState({ new_discharge_reason, - discharge_notes, + discharge_notes: referred_to + ? "Patient Shifted to another facility." + : "", discharge_date, death_datetime, death_confirmed_doctor: undefined, - referred_to_external: null, + referred_to_external: !referred_to?.id ? referred_to?.name : null, + referred_to: referred_to?.id ? referred_to.id : null, }); const [latestClaim, setLatestClaim] = useState(); const [isCreateClaimLoading, setIsCreateClaimLoading] = useState(false); const [isSendingDischargeApi, setIsSendingDischargeApi] = useState(false); - const [facility, setFacility] = useState(); + const [facility, setFacility] = useState(referred_to); const [errors, setErrors] = useState({}); + useEffect(() => { + setPreDischargeForm((prev) => ({ + ...prev, + new_discharge_reason, + discharge_notes: referred_to + ? "Patient Shifted to another facility." + : "", + discharge_date, + death_datetime, + referred_to_external: !referred_to?.id ? referred_to?.name : null, + referred_to: referred_to?.id ? referred_to.id : null, + })); + + setFacility(referred_to); + }, [referred_to, new_discharge_reason, discharge_date, death_datetime]); + + const discharge_reason = + new_discharge_reason ?? preDischargeForm.new_discharge_reason; + const fetchLatestClaim = useCallback(async () => { const res = await dispatch( HCXActions.claims.list({ @@ -111,7 +133,7 @@ const DischargeModal = ({ const handlePatientDischarge = async (value: boolean) => { setIsSendingDischargeApi(true); - if (!preDischargeForm.new_discharge_reason) { + if (!new_discharge_reason && !discharge_reason) { setErrors({ ...errors, new_discharge_reason: "Please select a reason for discharge", @@ -121,8 +143,7 @@ const DischargeModal = ({ } if ( - preDischargeForm.new_discharge_reason == - DISCHARGE_REASONS.find((i) => i.text == "Expired")?.id + discharge_reason == DISCHARGE_REASONS.find((i) => i.text == "Expired")?.id ) { const newErrors: Record = {}; @@ -143,6 +164,7 @@ const DischargeModal = ({ const dischargeDetails = { ...preDischargeForm, discharge: value, + referred_to: referred_to?.id ?? preDischargeForm.referred_to, discharge_date: dayjs(preDischargeForm.discharge_date).toISOString(), }; @@ -157,6 +179,7 @@ const DischargeModal = ({ { ...preDischargeForm, discharge: value, + new_discharge_reason: discharge_reason, discharge_date: dayjs(preDischargeForm.discharge_date).toISOString(), }, { id: consultationData.id }, @@ -174,7 +197,7 @@ const DischargeModal = ({ }; const handleFacilitySelect = (selected?: FacilityModel) => { - setFacility(selected); + setFacility(selected ?? null); setPreDischargeForm((prev) => ({ ...prev, referred_to: selected?.id ?? null, @@ -203,7 +226,7 @@ const DischargeModal = ({ label="Reason" name="discharge_reason" id="discharge_reason" - value={preDischargeForm.new_discharge_reason} + value={discharge_reason} disabled={!!new_discharge_reason} options={DISCHARGE_REASONS} optionValue={({ id }) => id} @@ -216,36 +239,35 @@ const DischargeModal = ({ } error={errors?.new_discharge_reason} /> - {preDischargeForm.new_discharge_reason === + {discharge_reason === DISCHARGE_REASONS.find((i) => i.text == "Referred")?.id && ( - <> -
- Referred to - - handleFacilitySelect(selected as FacilityModel | undefined) - } - selected={facility ?? null} - showAll - freeText - multiple={false} - errors={errors?.referred_to} - className="mb-4" - /> -
- +
+ Referred to + + handleFacilitySelect(selected as FacilityModel | undefined) + } + disabled={!!referred_to} + selected={facility ?? null} + showAll + freeText + multiple={false} + errors={errors?.referred_to} + className="mb-4" + /> +
)} i.text == "Expired")?.id } label={ { "3": "Cause of death", "1": "Discharged Advice", - }[preDischargeForm.new_discharge_reason ?? 0] ?? "Notes" + }[discharge_reason ?? 0] ?? "Notes" } name="discharge_notes" value={preDischargeForm.discharge_notes} @@ -259,13 +281,13 @@ const DischargeModal = ({ /> i.text == "Expired")?.id ? "death_datetime" : "discharge_date" } label={ - preDischargeForm.new_discharge_reason === + discharge_reason === DISCHARGE_REASONS.find((i) => i.text == "Expired")?.id ? "Date of Death" : "Date and Time of Discharge" @@ -273,7 +295,7 @@ const DischargeModal = ({ type="datetime-local" value={ preDischargeForm[ - preDischargeForm.new_discharge_reason === + discharge_reason === DISCHARGE_REASONS.find((i) => i.text == "Expired")?.id ? "death_datetime" : "discharge_date" @@ -293,14 +315,14 @@ const DischargeModal = ({ )} max={dayjs().format("YYYY-MM-DDTHH:mm")} error={ - preDischargeForm.new_discharge_reason === + discharge_reason === DISCHARGE_REASONS.find((i) => i.text == "Expired")?.id ? errors?.death_datetime : errors?.discharge_date } /> - {preDischargeForm.new_discharge_reason === + {discharge_reason === DISCHARGE_REASONS.find((i) => i.text == "Recovered")?.id && ( <>
@@ -313,7 +335,7 @@ const DischargeModal = ({
)} - {preDischargeForm.new_discharge_reason === + {discharge_reason === DISCHARGE_REASONS.find((i) => i.text == "Expired")?.id && ( { { )} {error && ( -
{error}
+
+ {error} +
)} diff --git a/src/Components/Form/Form.tsx b/src/Components/Form/Form.tsx index 6d6a4cbed0e..fccc579286c 100644 --- a/src/Components/Form/Form.tsx +++ b/src/Components/Form/Form.tsx @@ -49,7 +49,6 @@ const Form = ({ if (validate) { const errors = omitBy(validate(state.form), isEmpty) as FormErrors; - if (Object.keys(errors).length) { dispatch({ type: "set_errors", errors }); diff --git a/src/Components/Medicine/EditPrescriptionForm.tsx b/src/Components/Medicine/EditPrescriptionForm.tsx index 1af7a1a0356..78af7f38526 100644 --- a/src/Components/Medicine/EditPrescriptionForm.tsx +++ b/src/Components/Medicine/EditPrescriptionForm.tsx @@ -77,6 +77,9 @@ export default function EditPrescriptionForm(props: Props) { if (success) { props.onDone(true); + Notification.Success({ msg: "Prescription edited successfully" }); + } else { + Notification.Error({ msg: "Failed to edit prescription" }); } }} noPadding diff --git a/src/Components/Medicine/MedicineAdministration.tsx b/src/Components/Medicine/MedicineAdministration.tsx index d495ed162bc..650f720caa0 100644 --- a/src/Components/Medicine/MedicineAdministration.tsx +++ b/src/Components/Medicine/MedicineAdministration.tsx @@ -223,7 +223,11 @@ export default function MedicineAdministration(props: Props) { ))}
- + {t("administer_selected_medicines")}{" "} {selectedCount > 0 && `(${selectedCount})`} diff --git a/src/Components/Medicine/MedicineAdministrationSheet/BulkAdminister.tsx b/src/Components/Medicine/MedicineAdministrationSheet/BulkAdminister.tsx index abd609871c8..f4111f24eb0 100644 --- a/src/Components/Medicine/MedicineAdministrationSheet/BulkAdminister.tsx +++ b/src/Components/Medicine/MedicineAdministrationSheet/BulkAdminister.tsx @@ -18,6 +18,7 @@ export default function BulkAdminister({ prescriptions, onDone }: Props) { return ( <> setShowBulkAdminister(true)} diff --git a/src/Components/Medicine/MedicineAdministrationSheet/index.tsx b/src/Components/Medicine/MedicineAdministrationSheet/index.tsx index 59d3976d763..29431fefdf9 100644 --- a/src/Components/Medicine/MedicineAdministrationSheet/index.tsx +++ b/src/Components/Medicine/MedicineAdministrationSheet/index.tsx @@ -150,6 +150,7 @@ const MedicineAdministrationSheet = ({ readonly, is_prn }: Props) => { {!!discontinuedCount && ( { review_interval: Number(prevReviewInterval), }; - if (["NORMAL", "TELEMEDICINE"].includes(state.form.rounds_type)) { + if (!["VENTILATOR"].includes(state.form.rounds_type)) { data = { ...data, bp: state.form.bp ?? {}, @@ -342,9 +341,13 @@ export const DailyRounds = (props: any) => { if (obj) { dispatch({ type: "set_form", form: initForm }); Notification.Success({ - msg: `${obj.rounds_type === "VENTILATOR" ? "Critical Care" : capitalize(obj.rounds_type)} log update details updated successfully`, + msg: `${t(obj.rounds_type as string)} log updated successfully`, }); - if (["NORMAL", "TELEMEDICINE"].includes(state.form.rounds_type)) { + if ( + ["NORMAL", "TELEMEDICINE", "DOCTORS_LOG"].includes( + state.form.rounds_type, + ) + ) { navigate( `/facility/${facilityId}/patient/${patientId}/consultation/${consultationId}`, ); @@ -362,24 +365,19 @@ export const DailyRounds = (props: any) => { setIsLoading(false); if (obj) { dispatch({ type: "set_form", form: initForm }); - if (["NORMAL", "TELEMEDICINE"].includes(state.form.rounds_type)) { - Notification.Success({ - msg: `${state.form.rounds_type === "NORMAL" ? "Normal" : "Tele-medicine"} log update created successfully`, - }); - navigate( - `/facility/${facilityId}/patient/${patientId}/consultation/${consultationId}`, - ); - } else if (state.form.rounds_type === "DOCTORS_LOG") { - Notification.Success({ - msg: "Progress Note update created successfully", - }); + Notification.Success({ + msg: `${t(state.form.rounds_type)} log created successfully`, + }); + + if ( + ["NORMAL", "TELEMEDICINE", "DOCTORS_LOG"].includes( + state.form.rounds_type, + ) + ) { navigate( `/facility/${facilityId}/patient/${patientId}/consultation/${consultationId}`, ); } else { - Notification.Success({ - msg: "Critical Care log update created successfully", - }); navigate( `/facility/${facilityId}/patient/${patientId}/consultation/${consultationId}/daily_rounds/${obj.id}/update`, ); @@ -432,16 +430,16 @@ export const DailyRounds = (props: any) => { authUser.user_type, ) ) { - roundTypes.push({ id: "DOCTORS_LOG", text: "Progress Note" }); + roundTypes.push({ id: "DOCTORS_LOG", text: t("DOCTORS_LOG") }); } roundTypes.push( - { id: "NORMAL", text: "Normal" }, - { id: "VENTILATOR", text: "Critical Care" }, + { id: "NORMAL", text: t("NORMAL") }, + { id: "VENTILATOR", text: t("VENTILATOR") }, ); if (consultationSuggestion === "DC") { - roundTypes.push({ id: "TELEMEDICINE", text: "Telemedicine" }); + roundTypes.push({ id: "TELEMEDICINE", text: t("TELEMEDICINE") }); } const submitButtonDisabled = (() => { if (buttonText !== "Save") { diff --git a/src/Components/Shifting/ShiftDetailsUpdate.tsx b/src/Components/Shifting/ShiftDetailsUpdate.tsx index d327e402889..35e77066ef4 100644 --- a/src/Components/Shifting/ShiftDetailsUpdate.tsx +++ b/src/Components/Shifting/ShiftDetailsUpdate.tsx @@ -8,6 +8,7 @@ import { SHIFTING_CHOICES_PEACETIME, SHIFTING_CHOICES_WARTIME, SHIFTING_VEHICLE_CHOICES, + USER_TYPES, } from "../../Common/constants"; import { Cancel, Submit } from "../Common/components/ButtonV2"; @@ -39,6 +40,7 @@ import routes from "../../Redux/api.js"; import { IShift } from "./models.js"; import request from "../../Utils/request/request.js"; import { PatientModel } from "../Patient/models.js"; +import useAuthUser from "../../Common/hooks/useAuthUser.js"; const Loading = lazy(() => import("../Common/Loading")); @@ -48,6 +50,7 @@ interface patientShiftProps { export const ShiftDetailsUpdate = (props: patientShiftProps) => { const { goBack } = useAppHistory(); + const { user_type, home_facility } = useAuthUser(); const { kasp_full_string, kasp_enabled, wartime_shifting } = useConfig(); @@ -60,6 +63,7 @@ export const ShiftDetailsUpdate = (props: patientShiftProps) => { {} as ConsultationModel, ); const [showDischargeModal, setShowDischargeModal] = useState(false); + const [dischargeReason, setDischargeReason] = useState(); const { t } = useTranslation(); const initForm: any = { @@ -91,27 +95,6 @@ export const ShiftDetailsUpdate = (props: patientShiftProps) => { errors: { ...initError }, }; - let requiredFields: any = { - reason: { - errorText: t("please_enter_a_reason_for_the_shift"), - }, - }; - - if (wartime_shifting) { - requiredFields = { - ...requiredFields, - shifting_approving_facility_object: { - errorText: t("shifting_approving_facility_can_not_be_empty"), - }, - assigned_facility_type: { - errorText: t("please_select_facility_type"), - }, - preferred_vehicle_choice: { - errorText: t("please_select_preferred_vehicle_type"), - }, - }; - } - const shiftFormReducer = (state = initialState, action: any) => { switch (action.type) { case "set_form": { @@ -133,6 +116,45 @@ export const ShiftDetailsUpdate = (props: patientShiftProps) => { const [state, dispatch] = useReducer(shiftFormReducer, initialState); + let requiredFields: any = { + assigned_facility_object: { + condition: [ + "DESTINATION APPROVED", + "PATIENT TO BE PICKED UP", + "TRANSFER IN PROGRESS", + "COMPLETED", + ].includes(state.form.status), + errorText: t("please_select_a_facility"), + }, + status: { + errorText: t("please_select_status"), + }, + patient_category: { + errorText: t("please_select_patient_category"), + }, + reason: { + errorText: t("please_enter_a_reason_for_the_shift"), + }, + }; + + if (wartime_shifting) { + requiredFields = { + ...requiredFields, + shifting_approving_facility_object: { + errorText: t("shifting_approving_facility_can_not_be_empty"), + }, + assigned_facility_type: { + errorText: t("please_select_facility_type"), + }, + preferred_vehicle_choice: { + errorText: t("please_select_preferred_vehicle_type"), + }, + breathlessness_level: { + errorText: t("please_select_breathlessness_level"), + }, + }; + } + const { loading: assignedUserLoading } = useQuery(routes.userList, { query: { id: state.form.assigned_to }, prefetch: state.form.assigned_to ? true : false, @@ -145,9 +167,16 @@ export const ShiftDetailsUpdate = (props: patientShiftProps) => { const errors = { ...initError }; let isInvalidForm = false; Object.keys(requiredFields).forEach((field) => { - if (!state.form[field] || !/\S+/.test(state.form[field])) { + if ( + (!state.form[field] || !/\S+/.test(state.form[field])) && + ("condition" in requiredFields[field] + ? requiredFields[field].condition + : true) + ) { errors[field] = requiredFields[field].errorText; isInvalidForm = true; + } else { + errors[field] = ""; } }); @@ -188,6 +217,16 @@ export const ShiftDetailsUpdate = (props: patientShiftProps) => { if (validForm) { if (!discharged && state.form.status === "PATIENT EXPIRED") { + setDischargeReason( + DISCHARGE_REASONS.find((i) => i.text == "Expired")?.id, + ); + setShowDischargeModal(true); + return; + } + if (!discharged && state.form.status === "COMPLETED") { + setDischargeReason( + DISCHARGE_REASONS.find((i) => i.text == "Referred")?.id, + ); setShowDischargeModal(true); return; } @@ -282,9 +321,8 @@ export const ShiftDetailsUpdate = (props: patientShiftProps) => { show={showDischargeModal} onClose={() => setShowDischargeModal(false)} consultationData={consultationData} - new_discharge_reason={ - DISCHARGE_REASONS.find((i) => i.text == "Expired")?.id - } + referred_to={state.form.assigned_facility_object} + new_discharge_reason={dischargeReason} afterSubmit={() => { handleSubmit(true); }} @@ -303,6 +341,13 @@ export const ShiftDetailsUpdate = (props: patientShiftProps) => { value={state.form.status} optionLabel={(option) => option.text} optionValue={(option) => option.text} + optionDisabled={(option) => + // disable all options except `Destination Approved` for non-admin destination facility users + home_facility === state.form.assigned_facility_object?.id && + USER_TYPES.findIndex((type) => user_type === type) < + USER_TYPES.findIndex((type) => type === "DistrictAdmin") && + !["DESTINATION APPROVED"].includes(option.text) + } optionSelectedLabel={(option) => option.text} onChange={handleFormFieldChange} className="w-full bg-white md:col-span-1 md:leading-5" @@ -341,16 +386,31 @@ export const ShiftDetailsUpdate = (props: patientShiftProps) => { )}
- {t("what_facility_assign_the_patient_to")} + + {t("what_facility_assign_the_patient_to")} + setFacility(obj, "assigned_facility_object") } - errors={state.errors.assigned_facility} + errors={state.errors.assigned_facility_object} />
@@ -402,6 +462,7 @@ export const ShiftDetailsUpdate = (props: patientShiftProps) => { onChange={handleFormFieldChange} label="Patient Category" className="md:col-span-2" + error={state.errors.patient_category} /> {wartime_shifting && ( diff --git a/src/Components/Shifting/ShiftingBoard.tsx b/src/Components/Shifting/ShiftingBoard.tsx index 3203b5027f5..84a4ac419d3 100644 --- a/src/Components/Shifting/ShiftingBoard.tsx +++ b/src/Components/Shifting/ShiftingBoard.tsx @@ -39,17 +39,6 @@ interface boardProps { containerHeight: number; } -const reduceLoading = (action: string, current: any) => { - switch (action) { - case "MORE": - return { ...current, more: true }; - case "BOARD": - return { ...current, board: true }; - case "COMPLETE": - return { board: false, more: false }; - } -}; - const ShiftCard = ({ shift, filter }: any) => { const { wartime_shifting } = useConfig(); const [modalFor, setModalFor] = useState({ @@ -268,7 +257,8 @@ export default function ShiftingBoard({ }: boardProps) { const containerRef = useRef(null); const [offset, setOffSet] = useState(0); - const [isLoading, setIsLoading] = useState({ board: "BOARD", more: false }); + const [pages, setPages] = useState[]>([]); + const [isLoading, setIsLoading] = useState(true); const [{ isOver }, drop] = useDrop(() => ({ accept: "shift-card", drop: (item: any) => { @@ -278,23 +268,24 @@ export default function ShiftingBoard({ }, collect: (monitor) => ({ isOver: !!monitor.isOver() }), })); - const [data, setData] = useState>(); - useQuery(routes.listShiftRequests, { + const query = useQuery(routes.listShiftRequests, { query: formatFilter({ ...filterProp, status: board, }), onResponse: ({ res, data: listShiftData }) => { + setIsLoading(false); if (res?.ok && listShiftData) { - setData(listShiftData); + setPages((prev) => [...prev, listShiftData]); } - setIsLoading((loading) => reduceLoading("COMPLETE", loading)); }, }); useEffect(() => { - setIsLoading((loading) => reduceLoading("BOARD", loading)); + setPages([]); + setIsLoading(true); + query.refetch(); }, [ filterProp.facility, filterProp.origin_facility, @@ -316,7 +307,7 @@ export default function ShiftingBoard({ ]); const handlePagination = async () => { - setIsLoading((loading) => reduceLoading("MORE", loading)); + setIsLoading(true); setOffSet(offset + 14); const { res, data: newPageData } = await request(routes.listShiftRequests, { query: formatFilter({ @@ -326,18 +317,15 @@ export default function ShiftingBoard({ }), }); if (res?.ok && newPageData) { - setData((prev) => - prev - ? { ...prev, results: [...prev.results, ...newPageData.results] } - : newPageData, - ); + setPages((prev) => [...prev, newPageData]); } - setIsLoading((loading) => reduceLoading("COMPLETE", loading)); + setIsLoading(false); }; const { t } = useTranslation(); const patientFilter = (filter: string) => { - return data?.results + return pages + .flatMap((p) => p.results) .filter(({ status }) => status === filter) .map((shift: any) => ( @@ -350,7 +338,7 @@ export default function ShiftingBoard({ const { height } = container.getBoundingClientRect(); containerHeight < height && setContainerHeight(height); } - }, [containerRef.current, data?.results.length]); + }, [containerRef.current, pages.flatMap((p) => p.results).length]); return (
- {data?.count || "0"} + {pages[0] ? pages[0].count : "..."}
- {isLoading.board ? ( + {pages[0]?.count > 0 + ? patientFilter(board) + : !isLoading && ( +

{t("no_patients_to_show")}

+ )} + {isLoading ? (
@@ -395,25 +388,13 @@ export default function ShiftingBoard({
- ) : data?.count ?? 0 > 0 ? ( - patientFilter(board) ) : ( -

{t("no_patients_to_show")}

+ pages.at(-1)?.next && ( + handlePagination()} className="m-2 block"> + Load More + + ) )} - {!isLoading.board && - (data?.count ?? 0) < (data?.results.length || 0) && - (isLoading.more ? ( -
- {t("loading")} -
- ) : ( - - ))}
); diff --git a/src/Locale/en/Consultation.json b/src/Locale/en/Consultation.json index fc1b5ae5f7d..4df1a4de9a3 100644 --- a/src/Locale/en/Consultation.json +++ b/src/Locale/en/Consultation.json @@ -13,8 +13,9 @@ "download_discharge_summary": "Download discharge summary", "email_discharge_summary_description": "Enter your valid email address to receive the discharge summary", "generated_summary_caution": "This is a computer generated summary using the information captured in the CARE system.", - "NORMAL": "Normal", - "VENTILATOR": "Critical Care", + "NORMAL": "Brief Update", + "VENTILATOR": "Detailed Update", + "DOCTORS_LOG": "Progress Note", "AUTOMATED": "Automated", "TELEMEDICINE": "Telemedicine", "investigations": "Investigations", diff --git a/src/Locale/en/Shifting.json b/src/Locale/en/Shifting.json index 0fc177281d5..e1bc1916d89 100644 --- a/src/Locale/en/Shifting.json +++ b/src/Locale/en/Shifting.json @@ -76,6 +76,10 @@ "please_enter_a_reason_for_the_shift": "Please enter a reason for the shift.", "please_select_preferred_vehicle_type": "Please select Preferred Vehicle Type", "please_select_facility_type": "Please select Facility Type", + "please_select_breathlessness_level": "Please select Breathlessness Level", + "please_select_a_facility": "Please select a facility", + "please_select_status": "Please select Status", + "please_select_patient_category": "Please select Patient Category", "shifting_approving_facility_can_not_be_empty": "Shifting approving facility can not be empty.", "redirected_to_create_consultation": "Note: You will be redirected to create consultation form. Please complete the form to finish the transfer process", "mark_this_transfer_as_complete_question": "Are you sure you want to mark this transfer as complete? The Origin facility will no longer have access to this patient",