From e6e99677aad85da89b52399f4712159f49b73bdb Mon Sep 17 00:00:00 2001 From: AdityaJ2305 Date: Thu, 30 Jan 2025 15:12:48 +0530 Subject: [PATCH] diag and symp add func --- src/components/Questionnaire/QuestionTypes/DiagnosisQuestion.tsx | 1 + src/components/Questionnaire/QuestionTypes/SymptomQuestion.tsx | 1 + 2 files changed, 2 insertions(+) diff --git a/src/components/Questionnaire/QuestionTypes/DiagnosisQuestion.tsx b/src/components/Questionnaire/QuestionTypes/DiagnosisQuestion.tsx index b4aab2c07c4..6f92369e59d 100644 --- a/src/components/Questionnaire/QuestionTypes/DiagnosisQuestion.tsx +++ b/src/components/Questionnaire/QuestionTypes/DiagnosisQuestion.tsx @@ -116,6 +116,7 @@ export function DiagnosisQuestion({ }, [patientDiagnoses]); const handleAddDiagnosis = (code: Code) => { + if (diagnoses.some((d) => d.code.code === code.code)) return; const newDiagnoses = [ ...diagnoses, { ...DIAGNOSIS_INITIAL_VALUE, code }, diff --git a/src/components/Questionnaire/QuestionTypes/SymptomQuestion.tsx b/src/components/Questionnaire/QuestionTypes/SymptomQuestion.tsx index 94eba927251..b5bac4280c3 100644 --- a/src/components/Questionnaire/QuestionTypes/SymptomQuestion.tsx +++ b/src/components/Questionnaire/QuestionTypes/SymptomQuestion.tsx @@ -310,6 +310,7 @@ export function SymptomQuestion({ }, [patientSymptoms]); const handleAddSymptom = (code: Code) => { + if (symptoms.some((s) => s.code.code === code.code)) return; const newSymptoms = [ ...symptoms, { ...SYMPTOM_INITIAL_VALUE, code },