From 26e221e54e8cc1255c44c7797c74c90e08bc5377 Mon Sep 17 00:00:00 2001 From: Matias Arriola Date: Wed, 19 Feb 2025 13:09:30 -0300 Subject: [PATCH 1/5] fix: update Prevalence Facility save validation to allow same facility in different surveys --- i18n/en.pot | 9 ++-- i18n/es.po | 8 ++-- src/data/utils/questionHelper.ts | 21 ++------- src/domain/usecases/GetSurveyUseCase.ts | 25 ++-------- src/domain/usecases/SaveFormDataUseCase.ts | 55 ++++++++++++++-------- 5 files changed, 54 insertions(+), 64 deletions(-) diff --git a/i18n/en.pot b/i18n/en.pot index ab616ee4..fa52ea4b 100644 --- a/i18n/en.pot +++ b/i18n/en.pot @@ -5,8 +5,8 @@ msgstr "" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1)\n" -"POT-Creation-Date: 2025-01-28T16:57:55.539Z\n" -"PO-Revision-Date: 2025-01-28T16:57:55.539Z\n" +"POT-Creation-Date: 2025-02-19T16:04:36.776Z\n" +"PO-Revision-Date: 2025-02-19T16:04:36.776Z\n" msgid "There was a problem with \"{{name}}\" - {{prop}} is not set" msgstr "" @@ -14,7 +14,10 @@ msgstr "" msgid "There was an error processing the form" msgstr "" -msgid "There was an error processing the form" +msgid "Survey ID expected but could not be resolved" +msgstr "" + +msgid "Prevalence Facility already exists for this Survey." msgstr "" msgid "Facilities" diff --git a/i18n/es.po b/i18n/es.po index d6845fbb..c66b96a5 100644 --- a/i18n/es.po +++ b/i18n/es.po @@ -1,21 +1,23 @@ msgid "" msgstr "" "Project-Id-Version: i18next-conv\n" -"POT-Creation-Date: 2025-01-28T16:57:55.539Z\n" +"POT-Creation-Date: 2025-02-19T16:04:36.776Z\n" "PO-Revision-Date: 2018-10-25T09:02:35.143Z\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1)\n" - msgid "There was a problem with \"{{name}}\" - {{prop}} is not set" msgstr "" msgid "There was an error processing the form" msgstr "" -msgid "There was an error processing the form" +msgid "Survey ID expected but could not be resolved" +msgstr "" + +msgid "Prevalence Facility already exists for this Survey." msgstr "" msgid "Facilities" diff --git a/src/data/utils/questionHelper.ts b/src/data/utils/questionHelper.ts index 9d466c10..282a789a 100644 --- a/src/data/utils/questionHelper.ts +++ b/src/data/utils/questionHelper.ts @@ -17,23 +17,15 @@ import { AMR_SURVEYS_MORTALITY_TEA_PAT_ID_COH2, AMR_SURVEYS_MORTALITY_TEA_PAT_ID_DF2, AMR_SURVEYS_MORTALITY_TEA_PAT_ID_FUP2, - AMR_SURVEYS_MORTALITY_TEA_SURVEY_ID_COH, - AMR_SURVEYS_MORTALITY_TEA_SURVEY_ID_DF, - AMR_SURVEYS_MORTALITY_TEA_SURVEY_ID_FUP, AMR_SURVEYS_PREVALENCE_DEA_SURVEY_ID, AMR_SURVEYS_PREVALENCE_TEA_AMRPATIENT_IDPREVALENCE, AMR_SURVEYS_PREVALENCE_TEA_PATIENT_ID, AMR_SURVEYS_PREVALENCE_TEA_PATIENT_IDA19, - AMR_SURVEYS_PREVALENCE_TEA_SURVEY_ID_CRF, - AMR_SURVEYS_PREVALENCE_TEA_SURVEY_ID_CRL, - AMR_SURVEYS_PREVALENCE_TEA_SURVEY_ID_PIS, - AMR_SURVEYS_PREVALENCE_TEA_SURVEY_ID_SRL, - AMR_SURVEYS_PREVALENCE_TEA_SURVEY_ID_SSTF, SURVEY_ID_DATAELEMENT_ID, - SURVEY_ID_FACILITY_LEVEL_DATAELEMENT_ID, SURVEY_ID_PATIENT_TEA_ID, WARD2_ID_DATAELEMENT_ID, WARD_ID_TEA_ID, + parentPrevalenceSurveyIdList, } from "../entities/D2Survey"; import _ from "../../domain/entities/generic/Collection"; import { D2TrackerEvent } from "@eyeseetea/d2-api/api/trackerEvents"; @@ -391,15 +383,8 @@ export const mapTrackedAttributesToQuestions = ( ); if ( currentQuestion && - (currentQuestion.id === SURVEY_ID_FACILITY_LEVEL_DATAELEMENT_ID || - currentQuestion?.id === AMR_SURVEYS_PREVALENCE_TEA_SURVEY_ID_SSTF || - currentQuestion.id === AMR_SURVEYS_PREVALENCE_TEA_SURVEY_ID_CRL || - currentQuestion.id === AMR_SURVEYS_PREVALENCE_TEA_SURVEY_ID_PIS || - currentQuestion.id === AMR_SURVEYS_PREVALENCE_TEA_SURVEY_ID_SRL || - currentQuestion.id === AMR_SURVEYS_PREVALENCE_TEA_SURVEY_ID_CRF || - currentQuestion.id === AMR_SURVEYS_MORTALITY_TEA_SURVEY_ID_FUP || - currentQuestion.id === AMR_SURVEYS_MORTALITY_TEA_SURVEY_ID_DF || - currentQuestion.id === AMR_SURVEYS_MORTALITY_TEA_SURVEY_ID_COH || + (parentPrevalenceSurveyIdList.includes(currentQuestion.id) || + // TODO: check if patientIdList can be used here (not all IDs overlap) currentQuestion.id === AMR_SURVEYS_PREVALENCE_TEA_PATIENT_ID || currentQuestion.id === AMR_SURVEYS_PREVALENCE_TEA_AMRPATIENT_IDPREVALENCE || currentQuestion.id === AMR_SURVEYS_PREVALENCE_TEA_PATIENT_IDA19 || diff --git a/src/domain/usecases/GetSurveyUseCase.ts b/src/domain/usecases/GetSurveyUseCase.ts index 41b87b49..528a7026 100644 --- a/src/domain/usecases/GetSurveyUseCase.ts +++ b/src/domain/usecases/GetSurveyUseCase.ts @@ -3,21 +3,13 @@ import { AMR_SURVEYS_MORTALITY_TEA_PAT_ID_COH2, AMR_SURVEYS_MORTALITY_TEA_PAT_ID_DF2, AMR_SURVEYS_MORTALITY_TEA_PAT_ID_FUP2, - AMR_SURVEYS_MORTALITY_TEA_SURVEY_ID_COH, - AMR_SURVEYS_MORTALITY_TEA_SURVEY_ID_DF, - AMR_SURVEYS_MORTALITY_TEA_SURVEY_ID_FUP, AMR_SURVEYS_PREVALENCE_TEA_AMRPATIENT_IDPREVALENCE, AMR_SURVEYS_PREVALENCE_TEA_PATIENT_ID, AMR_SURVEYS_PREVALENCE_TEA_PATIENT_IDA19, - AMR_SURVEYS_PREVALENCE_TEA_SURVEY_ID_CRF, - AMR_SURVEYS_PREVALENCE_TEA_SURVEY_ID_CRL, - AMR_SURVEYS_PREVALENCE_TEA_SURVEY_ID_PIS, - AMR_SURVEYS_PREVALENCE_TEA_SURVEY_ID_SRL, - AMR_SURVEYS_PREVALENCE_TEA_SURVEY_ID_SSTF, SURVEY_ID_DATAELEMENT_ID, - SURVEY_ID_FACILITY_LEVEL_DATAELEMENT_ID, SURVEY_ID_PATIENT_TEA_ID, WARD_ID_TEA_ID, + parentPrevalenceSurveyIdList, } from "../../data/entities/D2Survey"; import { isTrackerProgram } from "../../data/utils/surveyProgramHelper"; import { Future } from "../entities/generic/Future"; @@ -168,17 +160,10 @@ export class GetSurveyUseCase { } const updatedEntityQuestions: Question[] = questionnaire.entity.questions.map( question => { - const isSurveyIdQuestion = - question.id === SURVEY_ID_FACILITY_LEVEL_DATAELEMENT_ID || - question.id === AMR_SURVEYS_PREVALENCE_TEA_SURVEY_ID_SSTF || - question.id === AMR_SURVEYS_PREVALENCE_TEA_SURVEY_ID_CRL || - question.id === AMR_SURVEYS_PREVALENCE_TEA_SURVEY_ID_PIS || - question.id === AMR_SURVEYS_PREVALENCE_TEA_SURVEY_ID_SRL || - question.id === AMR_SURVEYS_PREVALENCE_TEA_SURVEY_ID_CRF || - question.id === AMR_SURVEYS_MORTALITY_TEA_SURVEY_ID_FUP || - question.id === AMR_SURVEYS_MORTALITY_TEA_SURVEY_ID_DF || - question.id === AMR_SURVEYS_MORTALITY_TEA_SURVEY_ID_COH; - + const isSurveyIdQuestion = parentPrevalenceSurveyIdList.includes( + question.id + ); + // TODO: check if patientIdList can be used (it includes more IDs than these) const isPatientIdQuestion = question.id === AMR_SURVEYS_PREVALENCE_TEA_PATIENT_ID || question.id === AMR_SURVEYS_PREVALENCE_TEA_AMRPATIENT_IDPREVALENCE || diff --git a/src/domain/usecases/SaveFormDataUseCase.ts b/src/domain/usecases/SaveFormDataUseCase.ts index cc89b617..6a4e9d8b 100644 --- a/src/domain/usecases/SaveFormDataUseCase.ts +++ b/src/domain/usecases/SaveFormDataUseCase.ts @@ -9,15 +9,17 @@ import { Future } from "../entities/generic/Future"; import { AMR_SURVEYS_PREVALENCE_DEA_AST_GUIDELINES, AMR_SURVEYS_PREVALENCE_DEA_CUSTOM_AST_GUIDE, + SURVEY_ID_FACILITY_LEVEL_DATAELEMENT_ID, } from "../../data/entities/D2Survey"; import { ASTGUIDELINE_TYPES } from "../entities/ASTGuidelines"; import { SelectQuestion } from "../entities/Questionnaire/QuestionnaireQuestion"; import { ASTGuidelinesRepository } from "../repositories/ASTGuidelinesRepository"; +import i18n from "../../utils/i18n"; export const GLOBAL_OU_ID = "H8RixfF8ugH"; export class SaveFormDataUseCase { constructor( - private surveyReporsitory: SurveyRepository, + private surveyRepository: SurveyRepository, private astGuidelineRepository: ASTGuidelinesRepository ) {} @@ -33,35 +35,48 @@ export class SaveFormDataUseCase { const ouId = surveyFormType === "PPSSurveyForm" && orgUnitId === "" ? GLOBAL_OU_ID : orgUnitId; - //Do not allow creation of multiple Prevalence Facility Level Forms for the same facility. - if (!eventId && surveyFormType === "PrevalenceFacilityLevelForm") { - return this.surveyReporsitory + return this.validate(surveyFormType, questionnaire, ouId, programId, eventId).flatMap(() => + this.saveFormData(surveyFormType, questionnaire, ouId, programId, eventId) + ); + } + + validate = ( + surveyFormType: SURVEY_FORM_TYPES, + questionnaire: Questionnaire, + orgUnitId: Id, + programId: Id, + eventId: string | undefined = undefined + ): FutureData => { + //Do not allow creation of multiple Prevalence Facility Level Forms for the same facility in the same survey. + const isNewPrevalenceFacilityLevelForm = + !eventId && surveyFormType === "PrevalenceFacilityLevelForm"; + if (isNewPrevalenceFacilityLevelForm) { + const surveyId = questionnaire.entity?.questions + .find(q => q.id === SURVEY_ID_FACILITY_LEVEL_DATAELEMENT_ID) + ?.value?.toString(); + if (!surveyId) { + return Future.error( + new Error(i18n.t("Survey ID expected but could not be resolved")) + ); + } + return this.surveyRepository .getSurveys({ surveyFormType: surveyFormType, programId: programId, - orgUnitId: ouId, + orgUnitId: orgUnitId, chunked: false, + parentId: surveyId, }) .flatMap(surveys => { if (surveys.length > 0) { return Future.error( - new Error( - "Prevalence Facility Level Form already exists for this facility." - ) - ); - } else - return this.saveFormData( - surveyFormType, - questionnaire, - ouId, - programId, - eventId + new Error(i18n.t("Prevalence Facility already exists for this Survey.")) ); + } else return Future.success(true); }); } - - return this.saveFormData(surveyFormType, questionnaire, ouId, programId, eventId); - } + return Future.success(true); + }; saveFormData = ( surveyFormType: SURVEY_FORM_TYPES, @@ -70,7 +85,7 @@ export class SaveFormDataUseCase { programId: string, eventId: string | undefined = undefined ): FutureData => { - return this.surveyReporsitory + return this.surveyRepository .saveFormData(questionnaire, "CREATE_AND_UPDATE", ouId, eventId, programId) .flatMap(surveyId => { return this.saveCustomASTGuidelineToDatastore( From 98ec077c62b2ccad9def04054da69fe44287b5c9 Mon Sep 17 00:00:00 2001 From: Matias Arriola Date: Thu, 20 Feb 2025 14:42:20 -0300 Subject: [PATCH 2/5] fix: update save validation to also check for PPS Hospital duplicates --- .../entities/Questionnaire/Questionnaire.ts | 8 ++++++ src/domain/usecases/SaveFormDataUseCase.ts | 26 +++++++++++-------- 2 files changed, 23 insertions(+), 11 deletions(-) diff --git a/src/domain/entities/Questionnaire/Questionnaire.ts b/src/domain/entities/Questionnaire/Questionnaire.ts index 80beec9c..b96aadbb 100644 --- a/src/domain/entities/Questionnaire/Questionnaire.ts +++ b/src/domain/entities/Questionnaire/Questionnaire.ts @@ -1,3 +1,4 @@ +import { getParentDataElementForProgram } from "../../../data/utils/surveyProgramHelper"; import { generateUid } from "../../../utils/uid"; import { SurveyRule } from "../AMRSurveyModule"; import { Id, Ref } from "../Ref"; @@ -90,6 +91,13 @@ export class Questionnaire { return [...stageQuestions, ...entityQuestions]; } + getParentSurveyId(): Id | undefined { + const dataElementId = getParentDataElementForProgram(this.id); + return this.getAllQuestions() + .find(question => question.id === dataElementId) + ?.value?.toString(); + } + public static create(data: QuestionnaireData): Questionnaire { //TO DO : Add validations if any return new Questionnaire({ diff --git a/src/domain/usecases/SaveFormDataUseCase.ts b/src/domain/usecases/SaveFormDataUseCase.ts index 6a4e9d8b..d56ed041 100644 --- a/src/domain/usecases/SaveFormDataUseCase.ts +++ b/src/domain/usecases/SaveFormDataUseCase.ts @@ -9,7 +9,6 @@ import { Future } from "../entities/generic/Future"; import { AMR_SURVEYS_PREVALENCE_DEA_AST_GUIDELINES, AMR_SURVEYS_PREVALENCE_DEA_CUSTOM_AST_GUIDE, - SURVEY_ID_FACILITY_LEVEL_DATAELEMENT_ID, } from "../../data/entities/D2Survey"; import { ASTGUIDELINE_TYPES } from "../entities/ASTGuidelines"; import { SelectQuestion } from "../entities/Questionnaire/QuestionnaireQuestion"; @@ -47,13 +46,14 @@ export class SaveFormDataUseCase { programId: Id, eventId: string | undefined = undefined ): FutureData => { - //Do not allow creation of multiple Prevalence Facility Level Forms for the same facility in the same survey. - const isNewPrevalenceFacilityLevelForm = - !eventId && surveyFormType === "PrevalenceFacilityLevelForm"; - if (isNewPrevalenceFacilityLevelForm) { - const surveyId = questionnaire.entity?.questions - .find(q => q.id === SURVEY_ID_FACILITY_LEVEL_DATAELEMENT_ID) - ?.value?.toString(); + const isNew = !eventId; + if ( + isNew && + (surveyFormType === "PrevalenceFacilityLevelForm" || + surveyFormType === "PPSHospitalForm") + ) { + // avoid duplicate orgUnit in the same parent survey (Facility Level and Hospital) + const surveyId = questionnaire.getParentSurveyId(); if (!surveyId) { return Future.error( new Error(i18n.t("Survey ID expected but could not be resolved")) @@ -69,9 +69,13 @@ export class SaveFormDataUseCase { }) .flatMap(surveys => { if (surveys.length > 0) { - return Future.error( - new Error(i18n.t("Prevalence Facility already exists for this Survey.")) - ); + const errorMessages = { + PrevalenceFacilityLevelForm: i18n.t( + "Prevalence Facility already exists for this Survey." + ), + PPSHospitalForm: i18n.t("Hospital already exists for this Survey"), + }; + return Future.error(new Error(errorMessages[surveyFormType])); } else return Future.success(true); }); } From c54347702e4e228aa4ced7c0804fa3316e51601c Mon Sep 17 00:00:00 2001 From: Matias Arriola Date: Thu, 20 Feb 2025 14:53:10 -0300 Subject: [PATCH 3/5] chore: update i18n files --- i18n/en.pot | 7 +++++-- i18n/es.po | 5 ++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/i18n/en.pot b/i18n/en.pot index fa52ea4b..8496602c 100644 --- a/i18n/en.pot +++ b/i18n/en.pot @@ -5,8 +5,8 @@ msgstr "" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1)\n" -"POT-Creation-Date: 2025-02-19T16:04:36.776Z\n" -"PO-Revision-Date: 2025-02-19T16:04:36.776Z\n" +"POT-Creation-Date: 2025-02-20T17:43:05.613Z\n" +"PO-Revision-Date: 2025-02-20T17:43:05.613Z\n" msgid "There was a problem with \"{{name}}\" - {{prop}} is not set" msgstr "" @@ -20,6 +20,9 @@ msgstr "" msgid "Prevalence Facility already exists for this Survey." msgstr "" +msgid "Hospital already exists for this Survey" +msgstr "" + msgid "Facilities" msgstr "" diff --git a/i18n/es.po b/i18n/es.po index c66b96a5..cad19a93 100644 --- a/i18n/es.po +++ b/i18n/es.po @@ -1,7 +1,7 @@ msgid "" msgstr "" "Project-Id-Version: i18next-conv\n" -"POT-Creation-Date: 2025-02-19T16:04:36.776Z\n" +"POT-Creation-Date: 2025-02-20T17:43:05.613Z\n" "PO-Revision-Date: 2018-10-25T09:02:35.143Z\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -20,6 +20,9 @@ msgstr "" msgid "Prevalence Facility already exists for this Survey." msgstr "" +msgid "Hospital already exists for this Survey" +msgstr "" + msgid "Facilities" msgstr "" From 079b18e0c1c41e698aae06e4745e78deb25ae531 Mon Sep 17 00:00:00 2001 From: Matias Arriola Date: Fri, 21 Feb 2025 10:54:54 -0300 Subject: [PATCH 4/5] fix: avoid save error snackbar showing again on form changes --- src/webapp/components/survey/SurveyForm.tsx | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/webapp/components/survey/SurveyForm.tsx b/src/webapp/components/survey/SurveyForm.tsx index 22ee3567..6ba85594 100644 --- a/src/webapp/components/survey/SurveyForm.tsx +++ b/src/webapp/components/survey/SurveyForm.tsx @@ -71,17 +71,15 @@ export const SurveyForm: React.FC = props => { ); useEffect(() => { - if (saveCompleteState && saveCompleteState.status === "success") { + if (!saveCompleteState) return; + if (saveCompleteState.status === "success") { snackbar.info(saveCompleteState.message); if (props.hideForm) props.hideForm(); - } - - if (saveCompleteState && saveCompleteState.status === "error") { + } else if (saveCompleteState.status === "error") { offlineError(saveCompleteState.message); setLoading(false); - } - - if (saveCompleteState && saveCompleteState.status === "intermediate-success") { + resetSaveActionOutcome(); + } else if (saveCompleteState.status === "intermediate-success") { snackbar.info(saveCompleteState.message); setLoading(false); resetSaveActionOutcome(); From 6404ea3c798a4b7c85be750bb1b5b63e19707985 Mon Sep 17 00:00:00 2001 From: Matias Arriola Date: Fri, 21 Feb 2025 15:06:59 -0300 Subject: [PATCH 5/5] fix: Add PPS duplicate country validation --- i18n/en.pot | 7 +++++-- i18n/es.po | 20 ++++++++++++++++---- src/domain/usecases/SaveFormDataUseCase.ts | 6 +++++- 3 files changed, 26 insertions(+), 7 deletions(-) diff --git a/i18n/en.pot b/i18n/en.pot index 1548a8e0..edb7d269 100644 --- a/i18n/en.pot +++ b/i18n/en.pot @@ -5,8 +5,8 @@ msgstr "" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1)\n" -"POT-Creation-Date: 2025-02-20T17:43:05.613Z\n" -"PO-Revision-Date: 2025-02-20T17:43:05.613Z\n" +"POT-Creation-Date: 2025-02-21T18:07:25.668Z\n" +"PO-Revision-Date: 2025-02-21T18:07:25.668Z\n" msgid "There was a problem with \"{{name}}\" - {{prop}} is not set" msgstr "" @@ -23,6 +23,9 @@ msgstr "" msgid "Hospital already exists for this Survey" msgstr "" +msgid "Country already exist for this Survey" +msgstr "" + msgid "Facilities" msgstr "" diff --git a/i18n/es.po b/i18n/es.po index cad19a93..a79317eb 100644 --- a/i18n/es.po +++ b/i18n/es.po @@ -1,7 +1,7 @@ msgid "" msgstr "" "Project-Id-Version: i18next-conv\n" -"POT-Creation-Date: 2025-02-20T17:43:05.613Z\n" +"POT-Creation-Date: 2025-02-21T18:07:25.668Z\n" "PO-Revision-Date: 2018-10-25T09:02:35.143Z\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -23,6 +23,9 @@ msgstr "" msgid "Hospital already exists for this Survey" msgstr "" +msgid "Country already exist for this Survey" +msgstr "" + msgid "Facilities" msgstr "" @@ -88,6 +91,12 @@ msgstr "" msgid "New Survey" msgstr "" +msgid "Prevalence Surveys" +msgstr "" + +msgid "Case reports" +msgstr "" + msgid "Treatment/Indication Saved!" msgstr "" @@ -111,9 +120,6 @@ msgstr "" msgid "Filter by patientcode" msgstr "" -msgid "Country" -msgstr "" - msgid "Filter by Status" msgstr "" @@ -141,6 +147,12 @@ msgstr "" msgid "HOSP" msgstr "" +msgid "Country" +msgstr "" + +msgid "Case Reports" +msgstr "" + msgid "" "This survey has other surveys associated with it.\n" " Please delete all associated surveys, before you can delete this one." diff --git a/src/domain/usecases/SaveFormDataUseCase.ts b/src/domain/usecases/SaveFormDataUseCase.ts index d56ed041..51816ccd 100644 --- a/src/domain/usecases/SaveFormDataUseCase.ts +++ b/src/domain/usecases/SaveFormDataUseCase.ts @@ -50,7 +50,8 @@ export class SaveFormDataUseCase { if ( isNew && (surveyFormType === "PrevalenceFacilityLevelForm" || - surveyFormType === "PPSHospitalForm") + surveyFormType === "PPSHospitalForm" || + surveyFormType === "PPSCountryQuestionnaire") ) { // avoid duplicate orgUnit in the same parent survey (Facility Level and Hospital) const surveyId = questionnaire.getParentSurveyId(); @@ -74,6 +75,9 @@ export class SaveFormDataUseCase { "Prevalence Facility already exists for this Survey." ), PPSHospitalForm: i18n.t("Hospital already exists for this Survey"), + PPSCountryQuestionnaire: i18n.t( + "Country already exist for this Survey" + ), }; return Future.error(new Error(errorMessages[surveyFormType])); } else return Future.success(true);