diff --git a/src/components/Questionnaire/QuestionTypes/AllergyQuestion.tsx b/src/components/Questionnaire/QuestionTypes/AllergyQuestion.tsx index 8270ae98c71..c1266f4d2e6 100644 --- a/src/components/Questionnaire/QuestionTypes/AllergyQuestion.tsx +++ b/src/components/Questionnaire/QuestionTypes/AllergyQuestion.tsx @@ -146,6 +146,7 @@ export function AllergyQuestion({ }, [patientAllergies]); const handleAddAllergy = (code: Code) => { + if (allergies.some((a) => a.code.code === code.code)) return; const newAllergies = [ ...allergies, { ...ALLERGY_INITIAL_VALUE, code }, 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 },