Skip to content

Commit

Permalink
Merge branch 'develop' into issues/6503/displayCNSon4k
Browse files Browse the repository at this point in the history
  • Loading branch information
i0am0arunava authored Nov 18, 2024
2 parents ea9e1ff + 2eaf15e commit 21a5bd9
Show file tree
Hide file tree
Showing 23 changed files with 69 additions and 133 deletions.
24 changes: 12 additions & 12 deletions cypress/e2e/patient_spec/PatientLogUpdate.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,9 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => {
cy.verifyNotification("Progress Note Log Update filed successfully");
cy.closeNotification();
// Verify the data reflection
cy.contains("button", "Daily Rounds").click();
cy.contains("button", "Log Updates").click();
patientLogupdate.clickLogUpdateViewDetails(
"#dailyround-entry",
"#logupdate-entry",
patientCategory,
);
cy.verifyContentPresence("#consultation-preview", [
Expand Down Expand Up @@ -180,9 +180,9 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => {
cy.submitButton("Complete");
cy.verifyNotification("Detailed Log Update filed successfully");
cy.closeNotification();
cy.contains("button", "Daily Rounds").click();
cy.contains("button", "Log Updates").click();
patientLogupdate.clickLogUpdateViewDetails(
"#dailyround-entry",
"#logupdate-entry",
patientCategory,
);
cy.verifyContentPresence("#respiratory-support", [
Expand All @@ -195,9 +195,9 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => {
]);
// Go back and edit the data on a third section
patientLogupdate.clickGoBackConsultation();
cy.contains("button", "Daily Rounds").click();
cy.contains("button", "Log Updates").click();
patientLogupdate.clickLogUpdateUpdateLog(
"#dailyround-entry",
"#logupdate-entry",
patientCategory,
);
patientLogupdate.selectCriticalCareSection("Dialysis");
Expand All @@ -210,9 +210,9 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => {
cy.verifyNotification("Detailed Log Update filed successfully");
cy.closeNotification();
//Reverify the editted and newly added data
cy.contains("button", "Daily Rounds").click();
cy.contains("button", "Log Updates").click();
patientLogupdate.clickLogUpdateViewDetails(
"#dailyround-entry",
"#logupdate-entry",
patientCategory,
);
cy.verifyContentPresence("#respiratory-support", [
Expand Down Expand Up @@ -285,9 +285,9 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => {
cy.verifyNotification("Brief Update created successfully");
cy.closeNotification();
// edit the card and verify the data.
cy.contains("button", "Daily Rounds").click();
cy.contains("button", "Log Updates").click();
patientLogupdate.clickLogUpdateViewDetails(
"#dailyround-entry",
"#logupdate-entry",
patientCategory,
);
cy.verifyContentPresence("#consultation-preview", [
Expand All @@ -309,9 +309,9 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => {
patientLogupdate.typeDiastolic(patientModifiedDiastolic);
cy.submitButton("Continue");
cy.verifyNotification("Brief Update updated successfully");
cy.contains("button", "Daily Rounds").click();
cy.contains("button", "Log Updates").click();
patientLogupdate.clickLogUpdateViewDetails(
"#dailyround-entry",
"#logupdate-entry",
patientCategory,
);
cy.verifyContentPresence("#consultation-preview", [
Expand Down
4 changes: 2 additions & 2 deletions cypress/pageobject/Patient/PatientConsultation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,8 @@ export class PatientConsultationPage {

clickViewConsultationButton() {
cy.verifyAndClickElement(
"#view_consultation_updates",
"View Consultation / Consultation Updates",
"#view_consultation_and_log_updates",
"View Consultation / Log Updates",
);
}

Expand Down
4 changes: 4 additions & 0 deletions public/locale/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -828,6 +828,8 @@
"location_management": "Location Management",
"log_lab_results": "Log Lab Results",
"log_report": "Log Report",
"log_update": "Log Update",
"log_updates": "Log Updates",
"login": "Login",
"longitude_invalid": "Longitude must be between -180 and 180",
"lsg": "Lsg",
Expand Down Expand Up @@ -901,6 +903,7 @@
"no_investigation_suggestions": "No Investigation Suggestions",
"no_linked_facilities": "No Linked Facilities",
"no_log_update_delta": "No changes since previous log update",
"no_log_updates": "No log updates found",
"no_notices_for_you": "No notices for you.",
"no_patients_to_show": "No patients to show.",
"no_policy_added": "No Insurance Policy Added",
Expand Down Expand Up @@ -1309,6 +1312,7 @@
"view_abdm_records": "View ABDM Records",
"view_asset": "View Assets",
"view_cns": "View CNS",
"view_consultation_and_log_updates": "View Consultation / Log Updates",
"view_details": "View Details",
"view_faciliy": "View Facility",
"view_patients": "View Patients",
Expand Down
10 changes: 5 additions & 5 deletions src/Routers/routes/ConsultationRoutes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ const consultationRoutes: AppRoutes = {
sessionId={sessionId}
/>
),
"/facility/:facilityId/patient/:patientId/consultation/:id/daily-rounds": ({
"/facility/:facilityId/patient/:patientId/consultation/:id/log_updates": ({
facilityId,
patientId,
id,
Expand All @@ -92,7 +92,7 @@ const consultationRoutes: AppRoutes = {
consultationId={id}
/>
),
"/facility/:facilityId/patient/:patientId/consultation/:consultationId/daily-rounds/:id/update":
"/facility/:facilityId/patient/:patientId/consultation/:consultationId/log_updates/:id/update":
({ facilityId, patientId, consultationId, id }) => (
<DailyRounds
facilityId={facilityId}
Expand All @@ -101,7 +101,7 @@ const consultationRoutes: AppRoutes = {
id={id}
/>
),
"/facility/:facilityId/patient/:patientId/consultation/:consultationId/daily-rounds/:id":
"/facility/:facilityId/patient/:patientId/consultation/:consultationId/log_updates/:id":
({ facilityId, patientId, consultationId, id }) => (
<DailyRoundListDetails
facilityId={facilityId}
Expand All @@ -110,7 +110,7 @@ const consultationRoutes: AppRoutes = {
id={id}
/>
),
"/facility/:facilityId/patient/:patientId/consultation/:consultationId/daily_rounds/:id":
"/facility/:facilityId/patient/:patientId/consultation/:consultationId/log_updates/:id/critical_care":
({ facilityId, patientId, consultationId, id }) => (
<CriticalCarePreview
facilityId={facilityId}
Expand All @@ -119,7 +119,7 @@ const consultationRoutes: AppRoutes = {
id={id}
/>
),
"/facility/:facilityId/patient/:patientId/consultation/:consultationId/daily_rounds/:id/update":
"/facility/:facilityId/patient/:patientId/consultation/:consultationId/log_updates/:id/critical_care/update":
({ facilityId, patientId, consultationId, id }) => (
<CriticalCareEditor
facilityId={facilityId}
Expand Down
4 changes: 2 additions & 2 deletions src/common/constants.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -653,12 +653,12 @@ export const NOTIFICATION_EVENTS: NotificationEvent[] = [
},
{
id: "PATIENT_CONSULTATION_UPDATE_CREATED",
text: "Patient Consultation Update Created",
text: "Patient Log Update Created",
icon: "l-heart",
},
{
id: "PATIENT_CONSULTATION_UPDATE_UPDATED",
text: "Patient Consultation Update Updated",
text: "Patient Log Update Updated",
icon: "l-heart-medical",
},
{
Expand Down
9 changes: 5 additions & 4 deletions src/components/Facility/ConsultationCard.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import careConfig from "@careConfig";
import { t } from "i18next";
import { navigate } from "raviger";
import { useState } from "react";

Expand Down Expand Up @@ -169,15 +170,15 @@ export const ConsultationCard = (props: ConsultationProps) => {
</div>
<div className="mt-4 flex w-full flex-col justify-between gap-1 md:flex-row">
<ButtonV2
id="view_consultation_updates"
id="view_consultation_and_log_updates"
className="h-auto whitespace-pre-wrap border border-secondary-500 bg-white text-black hover:bg-secondary-300"
onClick={() =>
navigate(
`/facility/${itemData.facility}/patient/${itemData.patient}/consultation/${itemData.id}`,
)
}
>
View Consultation / Consultation Updates
{t("view_consultation_and_log_updates")}
</ButtonV2>
<ButtonV2
className="h-auto whitespace-pre-wrap border border-secondary-500 bg-white text-black hover:bg-secondary-300"
Expand All @@ -200,14 +201,14 @@ export const ConsultationCard = (props: ConsultationProps) => {
setOpen(true);
} else {
navigate(
`/facility/${itemData.facility}/patient/${itemData.patient}/consultation/${itemData.id}/daily-rounds`,
`/facility/${itemData.facility}/patient/${itemData.patient}/consultation/${itemData.id}/log_updates/`,
);
}
}}
disabled={!!itemData.discharge_date}
authorizeFor={NonReadOnlyUsers}
>
Add Consultation Updates
{t("add") + " " + t("log_update")}
</ButtonV2>
)}
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ import ReadMore from "@/components/Common/Readmore";
import Tabs from "@/components/Common/Tabs";
import EventsList from "@/components/Facility/ConsultationDetails/Events/EventsList";
import { ConsultationTabProps } from "@/components/Facility/ConsultationDetails/index";
import DailyRoundsFilter from "@/components/Facility/Consultations/DailyRoundsFilter";
import DailyRoundsList from "@/components/Facility/Consultations/DailyRoundsList";
import LogUpdatesFilter from "@/components/Facility/Consultations/LogUpdatesFilter";
import LogUpdatesList from "@/components/Facility/Consultations/LogUpdatesList";
import { BedModel } from "@/components/Facility/models";
import PrescriptionsTable from "@/components/Medicine/PrescriptionsTable";
import EncounterSymptomsCard from "@/components/Symptoms/SymptomsCard";
Expand Down Expand Up @@ -688,7 +688,7 @@ export const ConsultationUpdatesTab = (props: ConsultationTabProps) => {
),
value: 1,
},
{ text: t("daily_rounds"), value: 0 },
{ text: t("log_updates"), value: 0 },
]}
onTabChange={(v) => setShowEvents(!!v)}
currentTab={showEvents ? 1 : 0}
Expand Down Expand Up @@ -756,7 +756,7 @@ export const ConsultationUpdatesTab = (props: ConsultationTabProps) => {
{showEvents ? (
<EventsList query={eventsQuery!} />
) : (
<DailyRoundsList
<LogUpdatesList
consultation={props.consultationData}
query={dailyRoundsQuery!}
/>
Expand All @@ -773,7 +773,7 @@ function DailyRoundsSortDropdown({
setDailyRoundsQuery: (query: QueryParams) => void;
}) {
return (
<DailyRoundsFilter
<LogUpdatesFilter
onApply={(query) => {
setDailyRoundsQuery(query);
}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import PaginatedList from "@/CAREUI/misc/PaginatedList";
import GenericEvent from "@/components/Facility/ConsultationDetails/Events/GenericEvent";
import { getEventIcon } from "@/components/Facility/ConsultationDetails/Events/iconMap";
import { EventGeneric } from "@/components/Facility/ConsultationDetails/Events/types";
import LoadingLogUpdateCard from "@/components/Facility/Consultations/DailyRounds/LoadingCard";
import LoadingLogUpdateCard from "@/components/Facility/Consultations/LogUpdates/LoadingCard";

import { useSlugs } from "@/hooks/useSlug";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { useTranslation } from "react-i18next";
import CareIcon from "@/CAREUI/icons/CareIcon";

import ButtonV2 from "@/components/Common/ButtonV2";
import LogUpdateCardAttribute from "@/components/Facility/Consultations/DailyRounds/LogUpdateCardAttribute";
import LogUpdateCardAttribute from "@/components/Facility/Consultations/LogUpdates/LogUpdateCardAttribute";
import { ConsultationModel } from "@/components/Facility/models";
import { DailyRoundsModel } from "@/components/Patient/models";

Expand All @@ -26,7 +26,7 @@ const DefaultLogUpdateCard = ({ round, ...props }: Props) => {
return (
<div
className="flex w-full flex-col gap-4 rounded-lg border border-secondary-400 p-4 @container"
id="dailyround-entry"
id="logupdate-entry"
>
<LogUpdateCardAttribute
attributeKey={"rounds_type"}
Expand Down Expand Up @@ -59,8 +59,8 @@ const DefaultLogUpdateCard = ({ round, ...props }: Props) => {
["NORMAL", "TELEMEDICINE", "DOCTORS_LOG"].includes(
round.rounds_type!,
)
? `${consultationUrl}/daily-rounds/${round.id}`
: `${consultationUrl}/daily_rounds/${round.id}`
? `${consultationUrl}/log_updates/${round.id}`
: `${consultationUrl}/log_updates/${round.id}/critical_care`
}
>
<CareIcon icon="l-eye" className="text-lg" />
Expand All @@ -81,8 +81,8 @@ const DefaultLogUpdateCard = ({ round, ...props }: Props) => {
"DOCTORS_LOG",
"COMMUNITY_NURSES_LOG",
].includes(round.rounds_type!)
? `${consultationUrl}/daily-rounds/${round.id}/update`
: `${consultationUrl}/daily_rounds/${round.id}/update`
? `${consultationUrl}/log_updates/${round.id}/update`
: `${consultationUrl}/log_updates/${round.id}/critical_care/update`
}
>
<CareIcon icon="l-pen" className="text-lg" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useTranslation } from "react-i18next";

import LogUpdateCardAttribute from "@/components/Facility/Consultations/DailyRounds/LogUpdateCardAttribute";
import LogUpdateCardAttribute from "@/components/Facility/Consultations/LogUpdates/LogUpdateCardAttribute";
import { DailyRoundsModel } from "@/components/Patient/models";

// TODO: remove this method once events module is ready
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ interface Props {
onApply: (filter: FilterState) => void;
}

export default function DailyRoundsFilter(props: Props) {
export default function LogUpdatesFilter(props: Props) {
const { t } = useTranslation();
const [filter, setFilter] = useState<FilterState>({});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import { useTranslation } from "react-i18next";
import Timeline, { TimelineNode } from "@/CAREUI/display/Timeline";
import PaginatedList from "@/CAREUI/misc/PaginatedList";

import DefaultLogUpdateCard from "@/components/Facility/Consultations/DailyRounds/DefaultLogUpdateCard";
import LoadingLogUpdateCard from "@/components/Facility/Consultations/DailyRounds/LoadingCard";
import VirtualNursingAssistantLogUpdateCard from "@/components/Facility/Consultations/DailyRounds/VirtualNursingAssistantLogUpdateCard";
import DefaultLogUpdateCard from "@/components/Facility/Consultations/LogUpdates/DefaultLogUpdateCard";
import LoadingLogUpdateCard from "@/components/Facility/Consultations/LogUpdates/LoadingCard";
import VirtualNursingAssistantLogUpdateCard from "@/components/Facility/Consultations/LogUpdates/VirtualNursingAssistantLogUpdateCard";
import { ConsultationModel } from "@/components/Facility/models";
import { DailyRoundsModel } from "@/components/Patient/models";

Expand All @@ -21,7 +21,7 @@ interface Props {
query: QueryParams;
}

export default function DailyRoundsList({ consultation, query }: Props) {
export default function LogUpdatesList({ consultation, query }: Props) {
const [consultationId] = useSlugs("consultation");
const { t } = useTranslation();

Expand All @@ -37,7 +37,7 @@ export default function DailyRoundsList({ consultation, query }: Props) {
<div className="flex flex-col gap-4 overflow-y-auto overflow-x-hidden px-3">
<PaginatedList.WhenEmpty className="flex w-full justify-center border-b border-secondary-200 bg-white p-5 text-center text-2xl font-bold text-secondary-500">
<span className="flex justify-center rounded-lg bg-white p-3 text-secondary-700">
{t("no_consultation_updates")}
{t("no_log_updates")}
</span>
</PaginatedList.WhenEmpty>
<PaginatedList.WhenLoading>
Expand Down
4 changes: 2 additions & 2 deletions src/components/LogUpdate/CriticalCareEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ export default function CriticalCareEditor(props: Props) {
ghost
className="w-full bg-primary-100/50 py-3"
border
href={`${consultationDashboardUrl}/daily-rounds/${props.id}/update`}
href={`${consultationDashboardUrl}/log_updates/${props.id}/update`}
>
<CareIcon
icon="l-info-circle"
Expand Down Expand Up @@ -178,7 +178,7 @@ type SectionEditorProps = {
};

const SectionEditor = ({ log, onComplete, section }: SectionEditorProps) => {
const [consultationId, id] = useSlugs("consultation", "daily_rounds");
const [consultationId, id] = useSlugs("consultation", "log_updates");
const [diff, setDiff] = useState<Partial<DailyRoundsModel>>({});
const [isProcessing, setIsProcessing] = useState(false);

Expand Down
2 changes: 1 addition & 1 deletion src/components/LogUpdate/CriticalCarePreview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export default function CriticalCarePreview(props: Props) {

<Card className="md:rounded-xl lg:p-8">
<h2 className="mb-3 flex flex-col gap-4 text-black md:flex-row md:items-center">
<span>Consultation Updates</span>
<span>{t("log_updates")}</span>
<div className="max-w-min whitespace-nowrap rounded-full border border-primary-300 bg-primary-100 px-2.5 py-1.5 text-sm font-semibold text-primary-500">
<span>{t(`ROUNDS_TYPE__${data.rounds_type}`)}</span>
</div>
Expand Down
4 changes: 2 additions & 2 deletions src/components/Notifications/NotificationsList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@ const NotificationTile = ({
case "PATIENT_CONSULTATION_UPDATED":
return `/facility/${data.facility}/patient/${data.patient}/consultation/${data.consultation}`;
case "PATIENT_CONSULTATION_UPDATE_CREATED":
return `/facility/${data.facility}/patient/${data.patient}/consultation/${data.consultation}/daily-rounds/${data.daily_round}`;
return `/facility/${data.facility}/patient/${data.patient}/consultation/${data.consultation}/log_updates/${data.daily_round}`;
case "PATIENT_CONSULTATION_UPDATE_UPDATED":
return `/facility/${data.facility}/patient/${data.patient}/consultation/${data.consultation}/daily-rounds/${data.daily_round}`;
return `/facility/${data.facility}/patient/${data.patient}/consultation/${data.consultation}/log_updates/${data.daily_round}`;
case "INVESTIGATION_SESSION_CREATED":
return `/facility/${data.facility}/patient/${data.patient}/consultation/${data.consultation}/investigation/${data.session}`;
case "PATIENT_NOTE_ADDED":
Expand Down
4 changes: 2 additions & 2 deletions src/components/Notifications/ShowPushNotification.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ export default function ShowPushNotification({ id }: { id: string }) {
case "PATIENT_CONSULTATION_UPDATED":
return `/facility/${caused_objects?.facility}/patient/${caused_objects?.patient}/consultation/${caused_objects?.consultation}`;
case "PATIENT_CONSULTATION_UPDATE_CREATED":
return `/facility/${caused_objects?.facility}/patient/${caused_objects?.patient}/consultation/${caused_objects?.consultation}/daily-rounds/${caused_objects?.daily_round}`;
return `/facility/${caused_objects?.facility}/patient/${caused_objects?.patient}/consultation/${caused_objects?.consultation}/log_updates/${caused_objects?.daily_round}`;
case "PATIENT_CONSULTATION_UPDATE_UPDATED":
return `/facility/${caused_objects?.facility}/patient/${caused_objects?.patient}/consultation/${caused_objects?.consultation}/daily-rounds/${caused_objects?.daily_round}`;
return `/facility/${caused_objects?.facility}/patient/${caused_objects?.patient}/consultation/${caused_objects?.consultation}/log_updates/${caused_objects?.daily_round}`;
case "INVESTIGATION_SESSION_CREATED":
return `/facility/${caused_objects?.facility}/patient/${caused_objects?.patient}/consultation/${caused_objects?.consultation}/investigation/${caused_objects?.session}`;
case "PATIENT_NOTE_ADDED":
Expand Down
Loading

0 comments on commit 21a5bd9

Please sign in to comment.