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 6bb3fc82f37..c7a7cd9aba4 100644 --- a/cypress/e2e/patient_spec/patient_prescription.cy.ts +++ b/cypress/e2e/patient_spec/patient_prescription.cy.ts @@ -26,6 +26,43 @@ 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(); 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 50f072f1d9b..8e006465e08 100644 --- a/cypress/pageobject/Patient/PatientPrescription.ts +++ b/cypress/pageobject/Patient/PatientPrescription.ts @@ -52,6 +52,8 @@ 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 }); } @@ -59,6 +61,11 @@ export class PatientPrescription { cy.get("#indicator").type(indicator); } + enterDiscontinueReason(reason: string) { + cy.wait(2000); + cy.get("#discontinuedReason").type(reason); + } + enterAdministerDosage(dosage: string) { cy.get("#dosage").type(dosage); } 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/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/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/Facility/Consultations/Beds.tsx b/src/Components/Facility/Consultations/Beds.tsx index f4363411ef9..c86e32cc560 100644 --- a/src/Components/Facility/Consultations/Beds.tsx +++ b/src/Components/Facility/Consultations/Beds.tsx @@ -234,7 +234,7 @@ const Beds = (props: BedsProps) => {
- Move to bed + Update
diff --git a/src/Components/Facility/Consultations/DailyRounds/LogUpdateCardAttribute.tsx b/src/Components/Facility/Consultations/DailyRounds/LogUpdateCardAttribute.tsx index 5d407a09fea..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,11 +70,7 @@ const LogUpdateCardAttribute = ({
- {(attributeValue as string) === "VENTILATOR" - ? "CRITICAL CARE" - : (attributeValue as string) === "DOCTORS_LOG" - ? "PROGRESS NOTE" - : (attributeValue as string)} + {t(attributeValue)}
); diff --git a/src/Components/Facility/Consultations/DailyRoundsFilter.tsx b/src/Components/Facility/Consultations/DailyRoundsFilter.tsx index 430154d6689..829c085a840 100644 --- a/src/Components/Facility/Consultations/DailyRoundsFilter.tsx +++ b/src/Components/Facility/Consultations/DailyRoundsFilter.tsx @@ -73,9 +73,7 @@ export default function DailyRoundsFilter(props: Props) { label={t("Round Type")} options={DailyRoundTypes} placeholder={t("show_all")} - optionLabel={(o) => - o === "DOCTORS_LOG" ? "Progress Note" : t(o) - } + optionLabel={(o) => t(o)} optionValue={(o) => o} /> { {!!discontinuedCount && ( { if (obj) { dispatch({ type: "set_form", form: initForm }); Notification.Success({ - msg: `${obj.rounds_type === "DOCTORS_LOG" ? "Progress Notes" : (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", "DOCTORS_LOG"].includes( @@ -366,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`, ); @@ -436,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/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",