Skip to content

Commit

Permalink
Removed duplicate ResponseValue type
Browse files Browse the repository at this point in the history
  • Loading branch information
amjithtitus09 committed Feb 6, 2025
1 parent bc23521 commit e96f204
Showing 1 changed file with 4 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,53 +17,27 @@ import { RESULTS_PER_PAGE_LIMIT } from "@/common/constants";
import routes from "@/Utils/request/api";
import query from "@/Utils/request/query";
import { formatDateTime, properCase } from "@/Utils/utils";
import { AllergyIntoleranceRequest } from "@/types/emr/allergyIntolerance/allergyIntolerance";
import { DiagnosisRequest } from "@/types/emr/diagnosis/diagnosis";
import { Encounter } from "@/types/emr/encounter";
import { MedicationRequest } from "@/types/emr/medicationRequest";
import { MedicationStatementRequest } from "@/types/emr/medicationStatement";
import { SymptomRequest } from "@/types/emr/symptom/symptom";
import { LocationAssociationQuestion } from "@/types/location/association";
import { ResponseValue } from "@/types/questionnaire/form";
import { Question } from "@/types/questionnaire/question";
import { QuestionnaireResponse } from "@/types/questionnaire/questionnaireResponse";
import { CreateAppointmentQuestion } from "@/types/scheduling/schedule";

interface Props {
encounter?: Encounter;
patientId: string;
}

// TODO: Ensure that this type is not defined elsewhere.
type ResponseValueType = {
value?:
| string
| number
| boolean
| Date
| Encounter
| AllergyIntoleranceRequest[]
| MedicationRequest[]
| MedicationStatementRequest[]
| SymptomRequest[]
| DiagnosisRequest[]
| CreateAppointmentQuestion[]
| LocationAssociationQuestion[];
value_quantity?: {
value: number;
};
};

interface QuestionResponseProps {
question: Question;
response?: {
values: ResponseValueType[];
values: ResponseValue[];
note?: string;
question_id: string;
};
}

export function formatValue(
value: ResponseValueType["value"],
value: ResponseValue["value"],
type: string,
): string {
if (!value) return "";
Expand Down Expand Up @@ -123,7 +97,7 @@ function QuestionGroup({
}: {
group: Question;
responses: {
values: ResponseValueType[];
values: ResponseValue[];
note?: string;
question_id: string;
}[];
Expand Down

0 comments on commit e96f204

Please sign in to comment.