Skip to content

Commit

Permalink
Removed hacks for loading investigations in Consultation Form, update…
Browse files Browse the repository at this point in the history
…d type definitions (#8416)



---------

Co-authored-by: rithviknishad <[email protected]>
  • Loading branch information
Nithin9585 and rithviknishad authored Sep 21, 2024
1 parent 7163746 commit 7a82416
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 15 deletions.
4 changes: 1 addition & 3 deletions src/Components/Facility/ConsultationForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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) -
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ const LogUpdateCardAttribute = <T extends keyof DailyRoundsModel>({
<div className="flex flex-col items-center gap-2 md:flex-row">
<AttributeLabel attributeKey={attributeKey} />
<span className="text-sm font-semibold text-secondary-700">
{t(attributeValue)}
{t(attributeValue as string)}
</span>
</div>
);
Expand Down
3 changes: 0 additions & 3 deletions src/Components/Facility/models.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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;
Expand Down
10 changes: 3 additions & 7 deletions src/Components/Patient/DailyRoundListDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
},
});
Expand Down
1 change: 0 additions & 1 deletion src/Components/Patient/models.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,6 @@ export interface DailyRoundsModel {
physical_examination_info?: string;
other_details?: string;
consultation?: number;
medication_given?: Array<any>;
action?: string;
review_interval?: number;
id?: string;
Expand Down

0 comments on commit 7a82416

Please sign in to comment.