Skip to content

Commit

Permalink
cleanup daily round type text mapping | renamed critical care to deta…
Browse files Browse the repository at this point in the history
…iled update | renamed normal to brief update
  • Loading branch information
khavinshankar committed Jun 20, 2024
1 parent 5a77383 commit 63d0fa0
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 30 deletions.
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)} 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 update 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 63d0fa0

Please sign in to comment.