From 4dfd089c785ec0539eb2f115682513b009abc56f Mon Sep 17 00:00:00 2001 From: Shivank Kacker Date: Wed, 8 May 2024 07:13:19 +0530 Subject: [PATCH 1/2] Capitalized names --- src/Components/Facility/DischargedPatientsList.tsx | 4 +++- src/Components/Facility/DuplicatePatientDialog.tsx | 4 +++- src/Components/Patient/PatientHome.tsx | 2 +- src/Components/Patient/PatientInfoCard.tsx | 4 ++-- src/Components/Patient/PatientRegister.tsx | 5 ++++- 5 files changed, 13 insertions(+), 6 deletions(-) diff --git a/src/Components/Facility/DischargedPatientsList.tsx b/src/Components/Facility/DischargedPatientsList.tsx index bdd0a0a649e..b06e5cd1b4b 100644 --- a/src/Components/Facility/DischargedPatientsList.tsx +++ b/src/Components/Facility/DischargedPatientsList.tsx @@ -112,7 +112,9 @@ const PatientListItem = ({ patient }: { patient: PatientModel }) => {
-

{patient.name}

+

+ {patient.name} +

{GENDER_TYPES.find((g) => g.id === patient.gender)?.text} -{" "} {formatPatientAge(patient)} diff --git a/src/Components/Facility/DuplicatePatientDialog.tsx b/src/Components/Facility/DuplicatePatientDialog.tsx index 7a36beac685..56101cc9ccb 100644 --- a/src/Components/Facility/DuplicatePatientDialog.tsx +++ b/src/Components/Facility/DuplicatePatientDialog.tsx @@ -51,7 +51,9 @@ const DuplicatePatientDialog = (props: Props) => { return ( -
{patient.name}
+
+ {patient.name} +
ID : {patient.patient_id}
diff --git a/src/Components/Patient/PatientHome.tsx b/src/Components/Patient/PatientHome.tsx index 939b491f90b..d4a305d9b44 100644 --- a/src/Components/Patient/PatientHome.tsx +++ b/src/Components/Patient/PatientHome.tsx @@ -341,7 +341,7 @@ export const PatientHome = (props: any) => {
-

+

{patientData.name} - {formatPatientAge(patientData, true)}

diff --git a/src/Components/Patient/PatientInfoCard.tsx b/src/Components/Patient/PatientInfoCard.tsx index f4a59f5d6ab..b437c3186bd 100644 --- a/src/Components/Patient/PatientInfoCard.tsx +++ b/src/Components/Patient/PatientInfoCard.tsx @@ -217,7 +217,7 @@ export default function PatientInfoCard(props: {
{patient.name} @@ -262,7 +262,7 @@ export default function PatientInfoCard(props: {
{patient.name} diff --git a/src/Components/Patient/PatientRegister.tsx b/src/Components/Patient/PatientRegister.tsx index d036c3c0067..bde2bac5244 100644 --- a/src/Components/Patient/PatientRegister.tsx +++ b/src/Components/Patient/PatientRegister.tsx @@ -800,7 +800,10 @@ export const PatientRegister = (props: PatientRegisterProps) => { : null : null, test_type: formData.test_type, - name: formData.name, + name: formData.name + .split(" ") + .map((i: string) => i.charAt(0).toUpperCase() + i.slice(1)) + .join(" "), pincode: formData.pincode ? formData.pincode : undefined, gender: Number(formData.gender), nationality: formData.nationality, From 864d5e6936c8f7534338407bf6fd2d802f3389a0 Mon Sep 17 00:00:00 2001 From: Shivank Kacker Date: Sat, 11 May 2024 04:27:53 +0530 Subject: [PATCH 2/2] shifted to lodash --- src/Components/Patient/PatientRegister.tsx | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/Components/Patient/PatientRegister.tsx b/src/Components/Patient/PatientRegister.tsx index bde2bac5244..77ccd030027 100644 --- a/src/Components/Patient/PatientRegister.tsx +++ b/src/Components/Patient/PatientRegister.tsx @@ -64,6 +64,7 @@ import routes from "../../Redux/api.js"; import request from "../../Utils/request/request.js"; import SelectMenuV2 from "../Form/SelectMenuV2.js"; import Checkbox from "../Common/components/CheckBox.js"; +import _ from "lodash"; const Loading = lazy(() => import("../Common/Loading")); const PageTitle = lazy(() => import("../Common/PageTitle")); @@ -800,10 +801,7 @@ export const PatientRegister = (props: PatientRegisterProps) => { : null : null, test_type: formData.test_type, - name: formData.name - .split(" ") - .map((i: string) => i.charAt(0).toUpperCase() + i.slice(1)) - .join(" "), + name: _.startCase(_.toLower(formData.name)), pincode: formData.pincode ? formData.pincode : undefined, gender: Number(formData.gender), nationality: formData.nationality,