Skip to content

Commit

Permalink
Fix: Display Modify date and i18n Localization in Patient Encounter P…
Browse files Browse the repository at this point in the history
…age (#9696)
  • Loading branch information
Rishith25 authored Jan 3, 2025
1 parent ed05fc0 commit b36f39f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 32 deletions.
1 change: 1 addition & 0 deletions public/locale/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -762,6 +762,7 @@
"emergency_contact_volunteer": "Emergency Contact (Volunteer)",
"emergency_phone_number": "Emergency Phone Number",
"empty_date_time": "--:-- --; --/--/----",
"encounter": "Encounter",
"encounter_admit_sources__born": "Born in hospital",
"encounter_admit_sources__emd": "From accident/emergency department",
"encounter_admit_sources__gp": "General Practitioner referral",
Expand Down
39 changes: 8 additions & 31 deletions src/pages/Encounters/EncounterShow.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { useQuery } from "@tanstack/react-query";
import { Link, navigate } from "raviger";
import { useState } from "react";
import { Link } from "raviger";
import { useTranslation } from "react-i18next";

import Loading from "@/components/Common/Loading";
Expand All @@ -14,7 +13,7 @@ import { useCareAppConsultationTabs } from "@/hooks/useCareApps";

import routes from "@/Utils/request/api";
import query from "@/Utils/request/query";
import { keysOf } from "@/Utils/utils";
import { formatDateTime, keysOf } from "@/Utils/utils";
import { EncounterFilesTab } from "@/pages/Encounters/tabs/EncounterFilesTab";
import { EncounterMedicinesTab } from "@/pages/Encounters/tabs/EncounterMedicinesTab";
import { EncounterPlotsTab } from "@/pages/Encounters/tabs/EncounterPlotsTab";
Expand Down Expand Up @@ -77,7 +76,6 @@ export const EncounterShow = (props: Props) => {
// return "None";
// }
// };
const [showPatientNotesPopup, setShowPatientNotesPopup] = useState(false);

// const authUser = useAuthUser();

Expand Down Expand Up @@ -184,7 +182,7 @@ export const EncounterShow = (props: Props) => {
>
<nav className="relative flex flex-wrap items-start justify-between">
<PageTitle
title="Encounter"
title={t("encounter")}
crumbsReplacements={{
[encounterId]: { name: encounterData.patient.name },
consultation: {
Expand Down Expand Up @@ -236,21 +234,8 @@ export const EncounterShow = (props: Props) => {
className="btn btn-primary m-1 w-full hover:text-white"
id="patient-details"
>
Patient Details
{t("patient_details")}
</Link>
<a
id="patient_discussion_notes"
onClick={() =>
showPatientNotesPopup
? navigate(
`/facility/${facilityId}/patient/${encounterData.patient.id}/notes`,
)
: setShowPatientNotesPopup(true)
}
className="btn btn-primary m-1 w-full hover:text-white"
>
Discussion Notes
</a>
</div>
</nav>
<div className="mt-4 w-full border-b-2 border-secondary-200">
Expand Down Expand Up @@ -297,21 +282,13 @@ export const EncounterShow = (props: Props) => {
)}
</div> */}
<div className="flex flex-col justify-between gap-2 px-4 py-1 md:flex-row">
<div className="font-base flex flex-col text-xs leading-relaxed text-secondary-700">
<div className="flex items-center">
<span className="text-secondary-900">Created: </span>&nbsp;
{/* <RelativeDateUserMention
actionDate={encounterData.created_date}
user={encounterData.created_by}
tooltipPosition="right"
withoutSuffix={true}
/> */}
</div>
</div>
<div className="font-base flex flex-col text-xs leading-relaxed text-secondary-700 md:text-right">
<div className="flex items-center">
<span className="text-secondary-900">Last Modified: </span>
<span className="text-secondary-900">
{t("last_modified")}:{" "}
</span>
&nbsp;
{formatDateTime(encounterData.modified_date)}
{/* <RelativeDateUserMention
actionDate={consultationData.modified_date}
user={consultationData.last_edited_by}
Expand Down
2 changes: 1 addition & 1 deletion src/types/emr/encounter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ export interface Encounter {
created_by: UserBase;
updated_by: UserBase;
created_date: string;
updated_date: string;
modified_date: string;
encounter_class_history: EncounterClassHistory;
status_history: StatusHistory;
organizations: FacilityOrganization[];
Expand Down

0 comments on commit b36f39f

Please sign in to comment.