From ab30fd711947f14503a533e1cfb9d21754b29ba2 Mon Sep 17 00:00:00 2001 From: Hitish Rao P Date: Fri, 4 Oct 2024 08:22:35 +0530 Subject: [PATCH 1/4] Death report is missing patient age --- src/Components/DeathReport/DeathReport.tsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Components/DeathReport/DeathReport.tsx b/src/Components/DeathReport/DeathReport.tsx index a3b5e0c4d1f..5bff197e57c 100644 --- a/src/Components/DeathReport/DeathReport.tsx +++ b/src/Components/DeathReport/DeathReport.tsx @@ -8,6 +8,7 @@ import DateFormField from "../Form/FormFields/DateFormField"; import PhoneNumberFormField from "../Form/FormFields/PhoneNumberFormField"; import { formatDateTime, + formatPatientAge, humanizeStrings, patientAgeInYears, } from "../../Utils/utils"; @@ -111,7 +112,10 @@ export default function PrintDeathReport(props: { id: string }) { const patientComorbidities = getPatientComorbidities(res.data); const data = { ...res.data, - age: patientAgeInYears(res.data!), + age: + patientAgeInYears(res.data!) == 0 + ? formatPatientAge(res.data!, true) + : patientAgeInYears(res.data!), gender: patientGender, address: patientAddress, comorbidities: patientComorbidities, @@ -372,7 +376,7 @@ export default function PrintDeathReport(props: { id: string }) {
From 2773f2b41ec9cf1157159679f238fa7b223652da Mon Sep 17 00:00:00 2001 From: Hitish Rao P Date: Fri, 4 Oct 2024 15:05:11 +0530 Subject: [PATCH 2/4] Added ternary type checking for the age form field --- src/Components/DeathReport/DeathReport.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Components/DeathReport/DeathReport.tsx b/src/Components/DeathReport/DeathReport.tsx index 5bff197e57c..022d7ccc250 100644 --- a/src/Components/DeathReport/DeathReport.tsx +++ b/src/Components/DeathReport/DeathReport.tsx @@ -113,7 +113,7 @@ export default function PrintDeathReport(props: { id: string }) { const data = { ...res.data, age: - patientAgeInYears(res.data!) == 0 + patientAgeInYears(res.data!) === 0 ? formatPatientAge(res.data!, true) : patientAgeInYears(res.data!), gender: patientGender, @@ -376,7 +376,7 @@ export default function PrintDeathReport(props: { id: string }) {
From e0c52a20705060289eeb2c39c49055a20f2c7520 Mon Sep 17 00:00:00 2001 From: Hitish Rao P Date: Sun, 6 Oct 2024 00:45:08 +0530 Subject: [PATCH 3/4] Death report is missing patient age --- src/Components/DeathReport/DeathReport.tsx | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/Components/DeathReport/DeathReport.tsx b/src/Components/DeathReport/DeathReport.tsx index 022d7ccc250..911ea36592c 100644 --- a/src/Components/DeathReport/DeathReport.tsx +++ b/src/Components/DeathReport/DeathReport.tsx @@ -1,6 +1,5 @@ /* eslint-disable @typescript-eslint/no-unused-vars */ -import { useEffect, useState } from "react"; -import { statusType, useAbortableEffect } from "../../Common/utils"; +import { useState } from "react"; import { GENDER_TYPES } from "../../Common/constants"; import TextFormField from "../Form/FormFields/TextFormField"; import TextAreaFormField from "../Form/FormFields/TextAreaFormField"; @@ -10,7 +9,6 @@ import { formatDateTime, formatPatientAge, humanizeStrings, - patientAgeInYears, } from "../../Utils/utils"; import Page from "../Common/components/Page"; import Form from "../Form/Form"; @@ -112,10 +110,7 @@ export default function PrintDeathReport(props: { id: string }) { const patientComorbidities = getPatientComorbidities(res.data); const data = { ...res.data, - age: - patientAgeInYears(res.data!) === 0 - ? formatPatientAge(res.data!, true) - : patientAgeInYears(res.data!), + age: formatPatientAge(res.data!, true), gender: patientGender, address: patientAddress, comorbidities: patientComorbidities, @@ -376,7 +371,7 @@ export default function PrintDeathReport(props: { id: string }) {
From 493c918abf8ccf588e954d56d750aac53c6b983d Mon Sep 17 00:00:00 2001 From: Khavin Shankar Date: Wed, 9 Oct 2024 15:58:36 +0530 Subject: [PATCH 4/4] removed eslint disable no unsued var in death report --- src/Components/DeathReport/DeathReport.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Components/DeathReport/DeathReport.tsx b/src/Components/DeathReport/DeathReport.tsx index 2b925428666..2424d46f607 100644 --- a/src/Components/DeathReport/DeathReport.tsx +++ b/src/Components/DeathReport/DeathReport.tsx @@ -1,4 +1,3 @@ -/* eslint-disable @typescript-eslint/no-unused-vars */ import { useState } from "react"; import { GENDER_TYPES } from "../../Common/constants"; import TextFormField from "../Form/FormFields/TextFormField";