From b916329462950e3c37f446006e664433462ce471 Mon Sep 17 00:00:00 2001 From: Zeeshan <95434634+Zeshanxviii@users.noreply.github.com> Date: Thu, 29 Aug 2024 23:29:20 +0530 Subject: [PATCH 01/20] Updated TreatmentSummary component by integrating it with PrintPreview component --- src/Components/Facility/TreatmentSummary.tsx | 568 ++++++++++--------- src/style/index.css | 37 +- 2 files changed, 338 insertions(+), 267 deletions(-) diff --git a/src/Components/Facility/TreatmentSummary.tsx b/src/Components/Facility/TreatmentSummary.tsx index e75eec5b80a..7c34a627110 100644 --- a/src/Components/Facility/TreatmentSummary.tsx +++ b/src/Components/Facility/TreatmentSummary.tsx @@ -8,6 +8,7 @@ import useSlug from "../../Common/hooks/useSlug"; import useAppHistory from "../../Common/hooks/useAppHistory"; import routes from "../../Redux/api"; import useQuery from "../../Utils/request/useQuery"; +import PrintPreview from "../../CAREUI/misc/PrintPreview"; // Import the PrintPreview component import CareIcon from "../../CAREUI/icons/CareIcon"; const TreatmentSummary = (props: any) => { @@ -33,308 +34,343 @@ const TreatmentSummary = (props: any) => { }); return ( -
Disease | +Details | +||
---|---|---|---|
+ {obj["disease"]} + | ++ {obj["details"] ? obj["details"] : "---"} + | +||
Disease | -Details | ++ --- + | ++ --- + |
- {obj["disease"]} - | -- {obj["details"] ? obj["details"] : "---"} - | -||
- --- - | -- --- - | -
+ Date + | ++ Name + | ++ Result + | ++ Ideal value + | ++ values range + | ++ unit + | +||||||
---|---|---|---|---|---|---|---|---|---|---|---|
+ {formatDate( + value["session_object"]["session_created_date"], + )} + | ++ {value["investigation_object"]["name"]} + | ++ {value["notes"] || value["value"]} + | ++ {value["ideal_value"]} + | ++ {value["range"]} + | ++ {value["unit"]} + | +||||||
- Date - | -- Name - | -- Result - | -- Ideal value - | -- values range - | -- unit - | ++ --- + | ++ --- + | ++ --- + | ++ --- + | ++ --- + | ++ --- + |
- {formatDate( - value["session_object"][ - "session_created_date" - ], - )} - | -- {value["investigation_object"]["name"]} - | -- {value["notes"] || value["value"]} - | -- {value["investigation_object"]["ideal_value"] || - "-"} - | -- {value["investigation_object"]["min_value"]} -{" "} - {value["investigation_object"]["max_value"]} - | -- {value["investigation_object"]["unit"] || "-"} - | -||||||
- --- - | -- --- - | -- --- - | -- --- - | -- --- - | -- --- - | -
{consultationData.treatment_plan}
- ) : ( ----
- )} - Treatment summary/Treament Plan : +{consultationData.treatment_plan}
+ ) : ( +---
+ )} + Treatment summary/Treament Plan : -Date | +Spo2 | +Temperature | +|||
---|---|---|---|---|---|
Date | -Spo2 | -- Temperature - | ++ {formatDateTime( + consultationData.last_daily_round.modified_date, + )} + | ++ {consultationData.last_daily_round.ventilator_spo2 || + "-"} + | ++ {consultationData.last_daily_round.temperature || "-"} + |
- {formatDateTime( - consultationData.last_daily_round.modified_date, - )} - | -- {consultationData.last_daily_round.ventilator_spo2 || - "-"} - | -- {consultationData.last_daily_round.temperature || "-"} - | -|||
- --- - | -- --- - | -- --- - | -
{heading} | @@ -143,7 +141,7 @@ export const InvestigationTable = ({ )}|
---|---|
No tests taken |
- {heading} - | - ), - )} -
---|
No tests taken | -
+ {heading} + | + ))} +
---|
No tests taken | +
+ Sign of the Consulting Doctor +
++ Generated on: {formatDateTime(new Date())} +
++ This is a computer generated prescription. It shall be issued to the + patient only after the concerned doctor has verified the content and + authorized the same by affixing signature. +
++ Sign of the Consulting Doctor +
++ Generated on: {formatDateTime(new Date())} +
++ This is a computer generated prescription. It shall be issued to the + patient only after the concerned doctor has verified the content and + authorized the same by affixing signature. +
+Generated on: {formatDateTime(new Date())}
@@ -216,8 +210,7 @@ export default function ShowInvestigation(props: any) { authorized the same by affixing signature.Sign of the Consulting Doctor
-Generated on: {formatDateTime(new Date())}
@@ -543,6 +543,3 @@ function InstructionsSection({ consultationData }: IInstructionsSection) { -// Things that i added - - diff --git a/src/Components/Medicine/PrintPreview.tsx b/src/Components/Medicine/PrintPreview.tsx index 3c81eccb431..49055a8d641 100644 --- a/src/Components/Medicine/PrintPreview.tsx +++ b/src/Components/Medicine/PrintPreview.tsx @@ -13,7 +13,7 @@ import MedicineRoutes from "./routes"; import { Prescription } from "./models"; import useConfig from "../../Common/hooks/useConfig"; import { ReactNode } from "react"; -import { PatientDetail } from "../Common/components/PatientDetail"; +import KeyValueDetail from "../Common/components/KeyValueDetail"; export default function PrescriptionsPrintPreview() { const { main_logo } = useConfig(); const { t } = useTranslation(); @@ -51,7 +51,7 @@ export default function PrescriptionsPrintPreview() {Sign of the Consulting Doctor
-Generated on: {formatDateTime(new Date())}
From c680b389f443e4154d4cf9bad2dcdad250f2476f Mon Sep 17 00:00:00 2001 From: Zeeshan- Sign of the Consulting Doctor -
-- Generated on: {formatDateTime(new Date())} -
-- This is a computer generated prescription. It shall be issued to the - patient only after the concerned doctor has verified the content and - authorized the same by affixing signature. -
-- Sign of the Consulting Doctor -
-- Generated on: {formatDateTime(new Date())} -
-- This is a computer generated prescription. It shall be issued to the - patient only after the concerned doctor has verified the content and - authorized the same by affixing signature. -
-- {heading} - | - ))} -
---|
No tests taken | -
+ {heading} + | + ), + )} +
---|
No tests taken | +