Skip to content

Commit

Permalink
reuse existing types
Browse files Browse the repository at this point in the history
  • Loading branch information
khavinshankar committed Sep 3, 2024
1 parent b514aa3 commit d238869
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/Components/Facility/TreatmentSummary.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ import useQuery from "../../Utils/request/useQuery";
import CareIcon from "../../CAREUI/icons/CareIcon";
import { ConsultationModel } from "./models";
import { useMemo } from "react";
import { ConsultationDiagnosis } from "../Diagnosis/types";
import {
ActiveConditionVerificationStatuses,
ConsultationDiagnosis,
} from "../Diagnosis/types";
import PageHeadTitle from "../Common/PageHeadTitle";
import { useTranslation } from "react-i18next";
import { PatientModel } from "../Patient/models";
Expand Down Expand Up @@ -213,11 +216,8 @@ interface IDiagnosisSection {
}

type DiagnosisType =
| "principal"
| "confirmed"
| "provisional"
| "unconfirmed"
| "differential";
| (typeof ActiveConditionVerificationStatuses)[number]
| "principal";

function DiagnosisSection({ consultationData }: IDiagnosisSection) {
const { t } = useTranslation();
Expand All @@ -228,8 +228,8 @@ function DiagnosisSection({ consultationData }: IDiagnosisSection) {
if (curr.is_principal) {
acc.principal.push(curr);
} else if (
["confirmed", "provisional", "unconfirmed", "differential"].includes(
curr.verification_status,
ActiveConditionVerificationStatuses.includes(
curr.verification_status as (typeof ActiveConditionVerificationStatuses)[number],
)
) {
acc[curr.verification_status as keyof typeof acc].push(curr);
Expand Down

0 comments on commit d238869

Please sign in to comment.