From 7a8241629a93ecad57a75d87e5f1b8c06b8db8a6 Mon Sep 17 00:00:00 2001 From: Nithin Date: Sat, 21 Sep 2024 10:10:00 +0530 Subject: [PATCH] Removed hacks for loading investigations in Consultation Form, updated type definitions (#8416) --------- Co-authored-by: rithviknishad --- src/Components/Facility/ConsultationForm.tsx | 4 +--- .../DailyRounds/LogUpdateCardAttribute.tsx | 2 +- src/Components/Facility/models.tsx | 3 --- src/Components/Patient/DailyRoundListDetails.tsx | 10 +++------- src/Components/Patient/models.tsx | 1 - 5 files changed, 5 insertions(+), 15 deletions(-) diff --git a/src/Components/Facility/ConsultationForm.tsx b/src/Components/Facility/ConsultationForm.tsx index 2cfe9c8f4df..06b50d69912 100644 --- a/src/Components/Facility/ConsultationForm.tsx +++ b/src/Components/Facility/ConsultationForm.tsx @@ -404,9 +404,7 @@ export const ConsultationForm = ({ facilityId, patientId, id }: Props) => { cause_of_death: data?.discharge_notes || "", death_datetime: data?.death_datetime || "", death_confirmed_doctor: data?.death_confirmed_doctor || "", - InvestigationAdvice: Array.isArray(data.investigation) - ? data.investigation - : [], + InvestigationAdvice: data.investigation ?? [], diagnoses: data.diagnoses?.sort( (a: ConsultationDiagnosis, b: ConsultationDiagnosis) => ConditionVerificationStatuses.indexOf(a.verification_status) - diff --git a/src/Components/Facility/Consultations/DailyRounds/LogUpdateCardAttribute.tsx b/src/Components/Facility/Consultations/DailyRounds/LogUpdateCardAttribute.tsx index c1b5fec3c8c..7e58f96069c 100644 --- a/src/Components/Facility/Consultations/DailyRounds/LogUpdateCardAttribute.tsx +++ b/src/Components/Facility/Consultations/DailyRounds/LogUpdateCardAttribute.tsx @@ -66,7 +66,7 @@ const LogUpdateCardAttribute = ({
- {t(attributeValue)} + {t(attributeValue as string)}
); diff --git a/src/Components/Facility/models.tsx b/src/Components/Facility/models.tsx index a5455cb29bd..723f0af1946 100644 --- a/src/Components/Facility/models.tsx +++ b/src/Components/Facility/models.tsx @@ -11,7 +11,6 @@ import { RouteToFacility } from "../Common/RouteToFacilitySelect"; import { InvestigationType } from "../Common/prescription-builder/InvestigationBuilder"; import { ProcedureType } from "../Common/prescription-builder/ProcedureBuilder"; import { ConsultationDiagnosis, CreateDiagnosis } from "../Diagnosis/types"; -import { NormalPrescription, PRNPrescription } from "../Medicine/models"; import { AssignedToObjectModel, BloodPressure, @@ -133,8 +132,6 @@ export interface ConsultationModel { created_date?: string; discharge_date?: string; new_discharge_reason?: (typeof DISCHARGE_REASONS)[number]["id"]; - discharge_prescription?: NormalPrescription; - discharge_prn_prescription?: PRNPrescription; discharge_notes?: string; examination_details?: string; history_of_present_illness?: string; diff --git a/src/Components/Patient/DailyRoundListDetails.tsx b/src/Components/Patient/DailyRoundListDetails.tsx index fbf001427dd..eb7eda62064 100644 --- a/src/Components/Patient/DailyRoundListDetails.tsx +++ b/src/Components/Patient/DailyRoundListDetails.tsx @@ -16,13 +16,9 @@ export const DailyRoundListDetails = (props: any) => { const { loading: isLoading } = useQuery(routes.getDailyReport, { pathParams: { consultationId, id }, - onResponse: ({ res, data }) => { - if (res && data) { - const tdata: DailyRoundsModel = { - ...data, - medication_given: data.medication_given ?? [], - }; - setDailyRoundListDetails(tdata); + onResponse: ({ data }) => { + if (data) { + setDailyRoundListDetails(data); } }, }); diff --git a/src/Components/Patient/models.tsx b/src/Components/Patient/models.tsx index 48b01eeed3f..cf35680de11 100644 --- a/src/Components/Patient/models.tsx +++ b/src/Components/Patient/models.tsx @@ -310,7 +310,6 @@ export interface DailyRoundsModel { physical_examination_info?: string; other_details?: string; consultation?: number; - medication_given?: Array; action?: string; review_interval?: number; id?: string;