From 25cdaf68712d45b9182c2c63c5e04f8c389cf64a Mon Sep 17 00:00:00 2001 From: Jacob John Jeevan <40040905+Jacobjeevan@users.noreply.github.com> Date: Wed, 29 Jan 2025 05:48:09 +0530 Subject: [PATCH 01/62] Patient Age and Facility Location Edits (#10260) --- src/Utils/utils.ts | 1 - src/components/Facility/FacilityForm.tsx | 4 ++-- .../Patient/PatientDetailsTab/Demography.tsx | 16 ---------------- src/components/Patient/PatientRegistration.tsx | 7 ++++--- src/types/emr/patient.ts | 1 - 5 files changed, 6 insertions(+), 23 deletions(-) diff --git a/src/Utils/utils.ts b/src/Utils/utils.ts index a0694146ba1..64d8aeca38b 100644 --- a/src/Utils/utils.ts +++ b/src/Utils/utils.ts @@ -135,7 +135,6 @@ export const formatPatientAge = ( obj: PatientModel | Patient, abbreviated = false, ) => { - if (obj.age != null) return `${obj.age} Y`; const suffixes = getRelativeDateSuffix(abbreviated); const start = dayjs( obj.date_of_birth diff --git a/src/components/Facility/FacilityForm.tsx b/src/components/Facility/FacilityForm.tsx index bac5b022fdc..a748d408944 100644 --- a/src/components/Facility/FacilityForm.tsx +++ b/src/components/Facility/FacilityForm.tsx @@ -211,8 +211,8 @@ export default function FacilityForm(props: FacilityProps) { )?.id, address: facilityData.address, phone_number: facilityData.phone_number, - latitude: facilityData.latitude, - longitude: facilityData.longitude, + latitude: Number(facilityData.latitude), + longitude: Number(facilityData.longitude), is_public: facilityData.is_public, }); } diff --git a/src/components/Patient/PatientDetailsTab/Demography.tsx b/src/components/Patient/PatientDetailsTab/Demography.tsx index a246d8d464c..c88cd4f27dd 100644 --- a/src/components/Patient/PatientDetailsTab/Demography.tsx +++ b/src/components/Patient/PatientDetailsTab/Demography.tsx @@ -265,22 +265,6 @@ export const Demography = (props: PatientProps) => {
-
-
- -
-
{/*
{[ { label: t("abha_number"), value: "-" }, diff --git a/src/components/Patient/PatientRegistration.tsx b/src/components/Patient/PatientRegistration.tsx index e5a89632ef3..858054e3356 100644 --- a/src/components/Patient/PatientRegistration.tsx +++ b/src/components/Patient/PatientRegistration.tsx @@ -283,9 +283,10 @@ export default function PatientRegistration( same_address: patientQuery.data.address === patientQuery.data.permanent_address, age_or_dob: patientQuery.data.date_of_birth ? "dob" : "age", - age: !patientQuery.data.date_of_birth - ? patientQuery.data.age - : undefined, + age: + !patientQuery.data.date_of_birth && patientQuery.data.year_of_birth + ? new Date().getFullYear() - patientQuery.data.year_of_birth + : undefined, date_of_birth: patientQuery.data.date_of_birth ? patientQuery.data.date_of_birth : undefined, diff --git a/src/types/emr/patient.ts b/src/types/emr/patient.ts index 98ba1f582f4..eebe4b9e305 100644 --- a/src/types/emr/patient.ts +++ b/src/types/emr/patient.ts @@ -87,7 +87,6 @@ export interface PatientModel { assigned_to?: number | null; assigned_to_object?: AssignedToObjectModel; meta_info?: PatientMeta; - age?: string; } export const validatePatient = (patient: PatientModel, useDob: boolean) => { From 5cd4b17d9bf4b9a2c93a9ee9d9e773631e2e34a3 Mon Sep 17 00:00:00 2001 From: Mohamed amaan <121436543+modamaan@users.noreply.github.com> Date: Wed, 29 Jan 2025 07:04:26 +0530 Subject: [PATCH 02/62] Fix Layout Overflow on Appointment and Patient Details Pages for Mobile Screens (#10267) --- src/components/Resource/ResourceDetails.tsx | 8 ++++++-- src/components/ui/phone-input.tsx | 2 +- src/pages/Appointments/AppointmentDetail.tsx | 2 +- src/pages/Appointments/AppointmentsPage.tsx | 1 + 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/components/Resource/ResourceDetails.tsx b/src/components/Resource/ResourceDetails.tsx index ec4c617d532..8308935f197 100644 --- a/src/components/Resource/ResourceDetails.tsx +++ b/src/components/Resource/ResourceDetails.tsx @@ -228,13 +228,17 @@ export default function ResourceDetails(props: { id: string }) {
{/* Action Buttons */}
-
- + {facilityId && ( + + )} } > @@ -99,10 +106,14 @@ export const PatientHome = (props: { role="navigation" >
- {patientTabs.map((tab) => ( + {tabs.map((tab) => ( Date: Wed, 29 Jan 2025 18:05:38 +0530 Subject: [PATCH 12/62] Replaced all TextAreaForm component with Textarea shadcn ui component (#10277) --- public/locale/en.json | 1 + .../Form/FormFields/TextAreaFormField.tsx | 56 ------------------- .../Resource/ResourceCommentSection.tsx | 14 ++--- .../Resource/ResourceDetailsUpdate.tsx | 21 +++++-- 4 files changed, 23 insertions(+), 69 deletions(-) delete mode 100644 src/components/Form/FormFields/TextAreaFormField.tsx diff --git a/public/locale/en.json b/public/locale/en.json index 19132126140..4baaa151214 100644 --- a/public/locale/en.json +++ b/public/locale/en.json @@ -1308,6 +1308,7 @@ "no_beds_available": "No beds available", "no_changes": "No changes", "no_changes_made": "No changes made", + "no_comments_available": "No comments available", "no_consultation_filed": "No consultation filed", "no_consultation_history": "No consultation history available", "no_consultation_updates": "No consultation updates", diff --git a/src/components/Form/FormFields/TextAreaFormField.tsx b/src/components/Form/FormFields/TextAreaFormField.tsx deleted file mode 100644 index 70b0000a0b5..00000000000 --- a/src/components/Form/FormFields/TextAreaFormField.tsx +++ /dev/null @@ -1,56 +0,0 @@ -import { forwardRef } from "react"; - -import FormField from "@/components/Form/FormFields/FormField"; -import { - FormFieldBaseProps, - useFormFieldPropsResolver, -} from "@/components/Form/FormFields/Utils"; - -import { classNames } from "@/Utils/utils"; - -export type TextAreaFormFieldProps = FormFieldBaseProps & { - placeholder?: string; - value?: string | number; - rows?: number; - // prefixIcon?: React.ReactNode; - // suffixIcon?: React.ReactNode; - innerClassName?: string; - onFocus?: (event: React.FocusEvent) => void; - onBlur?: (event: React.FocusEvent) => void; -}; - -/** - * @deprecated use shadcn/ui's textarea instead - */ -const TextAreaFormField = forwardRef( - ( - { rows = 3, ...props }: TextAreaFormFieldProps, - ref?: React.Ref, - ) => { - const field = useFormFieldPropsResolver(props); - return ( - -