From 600455ca3ceda560e517ba448e46abaddf7c5669 Mon Sep 17 00:00:00 2001 From: Ashesh <3626859+Ashesh3@users.noreply.github.com> Date: Fri, 7 Apr 2023 18:36:49 +0530 Subject: [PATCH] Store prescription details on patient discharge (#5268) --- .../Facility/ConsultationDetails.tsx | 24 ++++++++++++------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/src/Components/Facility/ConsultationDetails.tsx b/src/Components/Facility/ConsultationDetails.tsx index 0327e8b8671..4e23a0a9770 100644 --- a/src/Components/Facility/ConsultationDetails.tsx +++ b/src/Components/Facility/ConsultationDetails.tsx @@ -54,7 +54,9 @@ import { FieldLabel } from "../Form/FormFields/FormField"; import PrescriptionBuilder, { PrescriptionType, } from "../Common/prescription-builder/PrescriptionBuilder"; -import PRNPrescriptionBuilder from "../Common/prescription-builder/PRNPrescriptionBuilder"; +import PRNPrescriptionBuilder, { + PRNPrescriptionType, +} from "../Common/prescription-builder/PRNPrescriptionBuilder"; import { formatDate } from "../../Utils/utils"; import CreateClaimCard from "../HCX/CreateClaimCard"; import { HCXClaimModel } from "../HCX/models"; @@ -70,6 +72,8 @@ interface PreDischargeFormInterface { discharge_date: string; death_datetime: string | null; death_confirmed_doctor: string | null; + discharge_prescription: PrescriptionType[]; + discharge_prn_prescription: PRNPrescriptionType[]; } const Loading = loadable(() => import("../Common/Loading")); @@ -107,15 +111,17 @@ export const ConsultationDetails = (props: any) => { discharge_date: "", death_datetime: null, death_confirmed_doctor: null, + discharge_prescription: [], + discharge_prn_prescription: [], }); const [showAutomatedRounds, setShowAutomatedRounds] = useState(true); - const [dischargeAdvice, setDischargeAdvice] = useState( - [] - ); const [dischargePrescription, setDischargePrescription] = useState< PrescriptionType[] >([]); + const [dischargePRNPrescription, setDischargePRNPrescription] = useState< + PRNPrescriptionType[] + >([]); const [latestClaim, setLatestClaim] = useState(); const [isCreateClaimLoading, setIsCreateClaimLoading] = useState(false); @@ -253,6 +259,8 @@ export const ConsultationDetails = (props: any) => { discharge_date: moment(preDischargeForm.discharge_date).toISOString( true ), + discharge_prescription: dischargePrescription, + discharge_prn_prescription: dischargePRNPrescription, }, { id: patientData.id } ) @@ -535,15 +543,15 @@ export const ConsultationDetails = (props: any) => { Discharge Prescription
Discharge PRN Prescription