Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Log Update" Consistency #8283

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/Common/constants.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -646,12 +646,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
Original file line number Diff line number Diff line change
Expand Up @@ -661,7 +661,7 @@ export const ConsultationUpdatesTab = (props: ConsultationTabProps) => {
</span>
</div>
}
tab1="Daily Rounds"
tab1="Log Updates"
onClickTab1={() => setShowEvents(false)}
onClickTab2={() => setShowEvents(true)}
isTab2Active={showEvents}
Expand Down
86 changes: 44 additions & 42 deletions src/Components/Facility/ConsultationDetails/Events/EventsList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,51 +44,53 @@ export default function EventsList() {
<LoadingLogUpdateCard />
</PaginatedList.WhenLoading>
<PaginatedList.Items<EventGeneric> className="flex grow flex-col gap-3">
{(item, items) => (
<TimelineNode
name={
t(item.event_type.name.toLowerCase()).replaceAll(
/_/g,
" ",
) + " Event"
}
event={{
type: item.change_type.replace(/_/g, " ").toLowerCase(),
timestamp: item.created_date?.toString() ?? "",
by: item.caused_by,
icon: getEventIcon(item.event_type.name),
}}
isLast={items.indexOf(item) == items.length - 1}
>
{(() => {
const entries = Object.entries(item.value).filter(
([_, value]) => value != null && value !== "",
);

if (entries.length === 0) {
return (
<div className="flex w-full flex-col items-center gap-2 md:flex-row">
<span className="text-xs uppercase text-secondary-700">
{t("no_changes")}
</span>
</div>
);
{(item, items) => {
return (
<TimelineNode
name={
t(item.event_type.name.toLowerCase()).replaceAll(
/_/g,
" ",
) + " Event"
}
event={{
type: item.change_type.replace(/_/g, " ").toLowerCase(),
timestamp: item.created_date?.toString() ?? "",
by: item.caused_by,
icon: getEventIcon(item.event_type.name),
}}
isLast={items.indexOf(item) == items.length - 1}
>
{(() => {
const entries = Object.entries(item.value).filter(
([_, value]) => value != null && value !== "",
);

const values = Object.fromEntries(entries);
if (entries.length === 0) {
return (
<div className="flex w-full flex-col items-center gap-2 md:flex-row">
<span className="text-xs uppercase text-secondary-700">
{t("no_changes")}
</span>
</div>
);
}

switch (item.event_type.name) {
case "INTERNAL_TRANSFER":
case "CLINICAL":
case "DIAGNOSIS":
case "ENCOUNTER_SUMMARY":
case "HEALTH":
default:
return <GenericEvent values={values} />;
}
})()}
</TimelineNode>
)}
const values = Object.fromEntries(entries);

switch (item.event_type.name) {
case "INTERNAL_TRANSFER":
case "CLINICAL":
case "DIAGNOSIS":
case "ENCOUNTER_SUMMARY":
case "HEALTH":
default:
return <GenericEvent values={values} />;
}
})()}
</TimelineNode>
);
}}
</PaginatedList.Items>
<div className="flex w-full items-center justify-center">
<PaginatedList.Paginator hideIfSinglePage />
Expand Down
4 changes: 2 additions & 2 deletions src/Components/Patient/DailyRoundListDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ export const DailyRoundListDetails = (props: any) => {

return (
<Page
title={`Consultation Update #${id}`}
backUrl={`/facility/${facilityId}/patient/${patientId}/consultation/${consultationId}/daily-rounds`}
title={`Log Update #${id}`}
backUrl={`/facility/${facilityId}/patient/${patientId}/consultation/${consultationId}/log-update`}
>
<div
className="mt-4 h-full rounded-lg border bg-white p-4 text-black shadow hover:border-primary-500"
Expand Down
2 changes: 1 addition & 1 deletion src/Components/Patient/DailyRounds.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,7 @@ export const DailyRounds = (props: any) => {
}}
backUrl={
id
? `/facility/${facilityId}/patient/${patientId}/consultation/${consultationId}/daily-rounds`
? `/facility/${facilityId}/patient/${patientId}/consultation/${consultationId}/log-update`
: `/facility/${facilityId}/patient/${patientId}/consultation/${consultationId}`
}
className="mx-auto max-w-4xl"
Expand Down
4 changes: 2 additions & 2 deletions src/Routers/routes/ConsultationRoutes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export default {
consultationId={id}
/>
),
"/facility/:facilityId/patient/:patientId/consultation/:consultationId/daily-rounds/:id/update":
"/facility/:facilityId/patient/:patientId/consultation/:consultationId/log-update/:id/update":
({ facilityId, patientId, consultationId, id }: any) => (
<DailyRounds
facilityId={facilityId}
Expand All @@ -92,7 +92,7 @@ export default {
id={id}
/>
),
"/facility/:facilityId/patient/:patientId/consultation/:consultationId/daily-rounds/:id":
"/facility/:facilityId/patient/:patientId/consultation/:consultationId/log-update/:id":
({ facilityId, patientId, consultationId, id }: any) => (
<DailyRoundListDetails
facilityId={facilityId}
Expand Down
Loading