Skip to content

Commit

Permalink
Cleanup daily round type text mapping (#8067)
Browse files Browse the repository at this point in the history
  • Loading branch information
khavinshankar authored Jun 20, 2024
1 parent 1151903 commit a69c0b0
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 37 deletions.
12 changes: 6 additions & 6 deletions cypress/e2e/patient_spec/patient_logupdate.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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", () => {
Expand All @@ -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();
Expand All @@ -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", [
Expand Down Expand Up @@ -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]);
Expand All @@ -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
Expand All @@ -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", ["-"]);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ let make = (~id, ~facilityId, ~patientId, ~consultationId, ~dailyRound) => {
href={`/facility/${facilityId}/patient/${patientId}/consultation/${consultationId}`}>
<button
onClick={_ =>
Notifications.success({msg: "Critical care log updates are filed successfully"})}
Notifications.success({msg: "Detailed Update filed successfully"})}
className="btn btn-primary w-full mt-6">
{str("Complete")}
</button>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { useTranslation } from "react-i18next";
import PatientCategoryBadge from "../../../Common/PatientCategoryBadge";
import {
BloodPressure,
Expand All @@ -15,6 +16,8 @@ const LogUpdateCardAttribute = <T extends keyof DailyRoundsModel>({
attributeKey,
attributeValue,
}: Props<T>) => {
const { t } = useTranslation();

switch (attributeKey) {
// case "id":
// case "external_id":
Expand Down Expand Up @@ -67,11 +70,7 @@ const LogUpdateCardAttribute = <T extends keyof DailyRoundsModel>({
<div className="flex flex-col items-center gap-2 md:flex-row">
<AttributeLabel attributeKey={attributeKey} />
<span className="text-sm font-semibold text-gray-700">
{(attributeValue as string) === "VENTILATOR"
? "CRITICAL CARE"
: (attributeValue as string) === "DOCTORS_LOG"
? "PROGRESS NOTE"
: (attributeValue as string)}
{t(attributeValue)}
</span>
</div>
);
Expand Down
4 changes: 1 addition & 3 deletions src/Components/Facility/Consultations/DailyRoundsFilter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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}
/>
<TextFormField
Expand Down
34 changes: 14 additions & 20 deletions src/Components/Patient/DailyRounds.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import useAppHistory from "../../Common/hooks/useAppHistory";
import { DraftSection, useAutoSaveReducer } from "../../Utils/AutoSave";
import * as Notification from "../../Utils/Notifications";
import { formatDateTime } from "../../Utils/utils";
import { capitalize } from "lodash-es";
import BloodPressureFormField, {
BloodPressureValidator,
} from "../Common/BloodPressureFormField";
Expand Down Expand Up @@ -342,7 +341,7 @@ export const DailyRounds = (props: any) => {
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(
Expand All @@ -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`,
);
Expand Down Expand Up @@ -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") {
Expand Down
5 changes: 3 additions & 2 deletions src/Locale/en/Consultation.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit a69c0b0

Please sign in to comment.