From cfff484e10220e3cc484ea4d04790e19407f09ff Mon Sep 17 00:00:00 2001 From: Jacob John Jeevan Date: Tue, 28 Jan 2025 21:02:50 +0530 Subject: [PATCH 1/4] patient age and facility form --- src/Utils/utils.ts | 1 - src/components/Facility/FacilityForm.tsx | 4 ++-- src/components/Patient/PatientRegistration.tsx | 2 +- 3 files changed, 3 insertions(+), 4 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/PatientRegistration.tsx b/src/components/Patient/PatientRegistration.tsx index e5a89632ef3..521dd7920f9 100644 --- a/src/components/Patient/PatientRegistration.tsx +++ b/src/components/Patient/PatientRegistration.tsx @@ -284,7 +284,7 @@ export default function PatientRegistration( 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 + ? new Date().getFullYear() - patientQuery.data.year_of_birth! : undefined, date_of_birth: patientQuery.data.date_of_birth ? patientQuery.data.date_of_birth From f0b2539dedacf7801bbc82bafd4ef2141f95f798 Mon Sep 17 00:00:00 2001 From: Jacob John Jeevan Date: Tue, 28 Jan 2025 21:08:16 +0530 Subject: [PATCH 2/4] rm age from patientmodel --- src/types/emr/patient.ts | 1 - 1 file changed, 1 deletion(-) 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 2ac33667bf934bda1570815a5db5fa59194f2b7c Mon Sep 17 00:00:00 2001 From: Jacob John Jeevan Date: Tue, 28 Jan 2025 21:22:29 +0530 Subject: [PATCH 3/4] coderabbit suggestion --- src/components/Patient/PatientRegistration.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/components/Patient/PatientRegistration.tsx b/src/components/Patient/PatientRegistration.tsx index 521dd7920f9..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 - ? new Date().getFullYear() - patientQuery.data.year_of_birth! - : 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, From 74d5441381eaaf8d5de5dfad175fd40726c75564 Mon Sep 17 00:00:00 2001 From: Jacob John Jeevan Date: Tue, 28 Jan 2025 22:29:49 +0530 Subject: [PATCH 4/4] rm button --- .../Patient/PatientDetailsTab/Demography.tsx | 16 ---------------- 1 file changed, 16 deletions(-) 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: "-" },