Skip to content

Commit

Permalink
Refactor Consultation Details (ohcnetwork#6258)
Browse files Browse the repository at this point in the history
  • Loading branch information
thtauhid authored Sep 11, 2023
1 parent fb4e7be commit ca51ef1
Show file tree
Hide file tree
Showing 15 changed files with 1,443 additions and 1,324 deletions.
1,324 changes: 0 additions & 1,324 deletions src/Components/Facility/ConsultationDetails.tsx

This file was deleted.

22 changes: 22 additions & 0 deletions src/Components/Facility/ConsultationDetails/ConsultationABGTab.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { lazy } from "react";
import { ConsultationTabProps } from "./index";
import { ABGPlots } from "../Consultations/ABGPlots";

const PageTitle = lazy(() => import("../../Common/PageTitle"));

export const ConsultationABGTab = (props: ConsultationTabProps) => {
return (
<div>
<PageTitle
title="ABG Analysis Plot"
hideBack={true}
breadcrumbs={false}
/>
<ABGPlots
facilityId={props.facilityId}
patientId={props.patientId}
consultationId={props.consultationId}
></ABGPlots>
</div>
);
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { lazy } from "react";
import { ConsultationTabProps } from "./index";
import { DialysisPlots } from "../Consultations/DialysisPlots";

const PageTitle = lazy(() => import("../../Common/PageTitle"));

export const ConsultationDialysisTab = (props: ConsultationTabProps) => {
return (
<div>
<PageTitle title="Dialysis Plots" hideBack={true} breadcrumbs={false} />
<DialysisPlots consultationId={props.consultationId}></DialysisPlots>
</div>
);
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { lazy } from "react";
import { Feed } from "../Consultations/Feed";
import { ConsultationTabProps } from "./index";

const PageTitle = lazy(() => import("../../Common/PageTitle"));

export const ConsultationFeedTab = (props: ConsultationTabProps) => {
return (
<div>
<PageTitle
title="Camera Feed"
breadcrumbs={false}
hideBack={true}
focusOnLoad={true}
/>
<Feed
facilityId={props.facilityId}
consultationId={props.consultationId}
/>
</div>
);
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { ConsultationTabProps } from "./index";
import { FileUpload } from "../../Patient/FileUpload";

export const ConsultationFilesTab = (props: ConsultationTabProps) => {
return (
<div>
<FileUpload
facilityId={props.facilityId}
patientId={props.patientId}
consultationId={props.consultationId}
type="CONSULTATION"
hideBack={true}
audio={true}
unspecified={true}
/>
</div>
);
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import { lazy } from "react";
import { ConsultationTabProps } from "./index";
import { NonReadOnlyUsers } from "../../../Utils/AuthorizeFor";
import ButtonV2 from "../../Common/components/ButtonV2";
import { navigate } from "raviger";
import CareIcon from "../../../CAREUI/icons/CareIcon";
import InvestigationTab from "../Investigations/investigationsTab";
import { t } from "i18next";

const PageTitle = lazy(() => import("../../Common/PageTitle"));
export const ConsultationInvestigationsTab = (props: ConsultationTabProps) => {
return (
<div>
<div className="justify-between sm:flex">
<PageTitle title="Investigations" hideBack={true} breadcrumbs={false} />
<div className="pt-6">
<ButtonV2
authorizeFor={NonReadOnlyUsers}
disabled={!props.patientData.is_active}
onClick={() =>
navigate(
`/facility/${props.facilityId}/patient/${props.patientId}/consultation/${props.consultationId}/investigation/`
)
}
>
<CareIcon className="care-l-plus" />
<span>{t("log_lab_results")}</span>
</ButtonV2>
</div>
</div>
<InvestigationTab
consultationId={props.consultationId}
facilityId={props.facilityId}
patientId={props.patientId}
patientData={props.patientData}
/>
</div>
);
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { ConsultationTabProps } from "./index";
import PrescriptionAdministrationsTable from "../../Medicine/PrescriptionAdministrationsTable";

export const ConsultationMedicinesTab = (props: ConsultationTabProps) => {
return (
<div className="my-4 flex flex-col gap-16">
<PrescriptionAdministrationsTable
consultation_id={props.consultationId}
readonly={!!props.consultationData.discharge_date}
prn={false}
/>
<PrescriptionAdministrationsTable
consultation_id={props.consultationId}
prn={true}
readonly={!!props.consultationData.discharge_date}
/>
</div>
);
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { lazy } from "react";
import { NeurologicalTable } from "../Consultations/NeurologicalTables";
import { ConsultationTabProps } from "./index";

const PageTitle = lazy(() => import("../../Common/PageTitle"));

export const ConsultationNeurologicalMonitoringTab = (
props: ConsultationTabProps
) => {
return (
<div>
<PageTitle
title="Neurological Monitoring"
hideBack={true}
breadcrumbs={false}
/>
<NeurologicalTable
facilityId={props.facilityId}
patientId={props.patientId}
consultationId={props.consultationId}
></NeurologicalTable>
</div>
);
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { lazy } from "react";
import { ConsultationTabProps } from "./index";
import { NutritionPlots } from "../Consultations/NutritionPlots";

const PageTitle = lazy(() => import("../../Common/PageTitle"));

export const ConsultationNeutritionTab = (props: ConsultationTabProps) => {
return (
<div>
<PageTitle title="Nutrition" hideBack={true} breadcrumbs={false} />
<NutritionPlots
facilityId={props.facilityId}
patientId={props.patientId}
consultationId={props.consultationId}
></NutritionPlots>
</div>
);
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { lazy } from "react";
import { ConsultationTabProps } from "./index";
import { NursingPlot } from "../Consultations/NursingPlot";

const PageTitle = lazy(() => import("../../Common/PageTitle"));

export const ConsultationNursingTab = (props: ConsultationTabProps) => {
return (
<div>
<PageTitle title="Nursing Analysis" hideBack={true} breadcrumbs={false} />
<NursingPlot
facilityId={props.facilityId}
patientId={props.patientId}
consultationId={props.consultationId}
></NursingPlot>
</div>
);
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { lazy } from "react";
import { ConsultationTabProps } from "./index";
import { PressureSoreDiagrams } from "../Consultations/PressureSoreDiagrams";

const PageTitle = lazy(() => import("../../Common/PageTitle"));

export const ConsultationPressureSoreTab = (props: ConsultationTabProps) => {
return (
<div className="mt-4">
<PageTitle title="Pressure Sore" hideBack={true} breadcrumbs={false} />
<PressureSoreDiagrams consultationId={props.consultationId} />
</div>
);
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { lazy } from "react";
import { ConsultationTabProps } from "./index";
import { PrimaryParametersPlot } from "../Consultations/PrimaryParametersPlot";

const PageTitle = lazy(() => import("../../Common/PageTitle"));

export const ConsultationSummaryTab = (props: ConsultationTabProps) => {
return (
<div className="mt-4">
<PageTitle
title="Primary Parameters Plot"
hideBack={true}
breadcrumbs={false}
/>
<PrimaryParametersPlot
facilityId={props.facilityId}
patientId={props.patientId}
consultationId={props.consultationId}
></PrimaryParametersPlot>
</div>
);
};
Loading

0 comments on commit ca51ef1

Please sign in to comment.