diff --git a/src/data/repositories/AppConfigurationD2Repository.ts b/src/data/repositories/AppConfigurationD2Repository.ts index b797c510..35d934f0 100644 --- a/src/data/repositories/AppConfigurationD2Repository.ts +++ b/src/data/repositories/AppConfigurationD2Repository.ts @@ -9,6 +9,7 @@ import { getHazardTypeByCode } from "./consts/DiseaseOutbreakConstants"; import { Future } from "../../domain/entities/generic/Future"; import { AppConfigurations } from "../../domain/entities/AppConfigurations"; import { RiskAssessmentGrading } from "../../domain/entities/risk-assessment/RiskAssessmentGrading"; + const MAIN_SYNDROME_OPTION_SET_CODE = "AGENTS"; export const SUSPECTED_DISEASE_OPTION_SET_CODE = "RTSL_ZEB_OS_DISEASE"; export const NOTIFICATION_SOURCE_OPTION_SET_CODE = "RTSL_ZEB_OS_SOURCE"; @@ -16,7 +17,7 @@ const optionSetCode = { dataSources: "RTSL_ZEB_OS_DATA_SOURCE", hazardTypes: "RTSL_ZEB_OS_HAZARD_TYPE", hazardTypesByCode: "RTSL_ZEB_OS_HAZARD_TYPE", - mainSyndromes: "AGENTS", + mainSyndromes: MAIN_SYNDROME_OPTION_SET_CODE, suspectedDiseases: SUSPECTED_DISEASE_OPTION_SET_CODE, notificationSources: NOTIFICATION_SOURCE_OPTION_SET_CODE, incidentStatus: "RTSL_ZEB_OS_INCIDENT_STATUS", diff --git a/src/domain/entities/disease-outbreak-event/DiseaseOutbreakEvent.ts b/src/domain/entities/disease-outbreak-event/DiseaseOutbreakEvent.ts index 75f937c3..5e5983a8 100644 --- a/src/domain/entities/disease-outbreak-event/DiseaseOutbreakEvent.ts +++ b/src/domain/entities/disease-outbreak-event/DiseaseOutbreakEvent.ts @@ -3,7 +3,7 @@ import { IncidentActionPlan } from "../incident-action-plan/IncidentActionPlan"; import { IncidentManagementTeam } from "../incident-management-team/IncidentManagementTeam"; import { TeamMember } from "../incident-management-team/TeamMember"; import { OrgUnit } from "../OrgUnit"; -import { Code, Id, NamedRef, Option } from "../Ref"; +import { Code, Id, NamedRef } from "../Ref"; import { RiskAssessment } from "../risk-assessment/RiskAssessment"; import { Maybe } from "../../../utils/ts-utils"; import { ValidationError } from "../ValidationError"; @@ -87,9 +87,6 @@ export type DiseaseOutbreakEventAttrs = DiseaseOutbreakEventBaseAttrs & { incidentManagementTeam: Maybe; }; - - - /** * Note: DiseaseOutbreakEvent represents Event in the Figma. * Not using event as it is a keyword and can also be confused with dhis event diff --git a/src/webapp/pages/form-page/useForm.ts b/src/webapp/pages/form-page/useForm.ts index 38a7e77a..2d5b66cc 100644 --- a/src/webapp/pages/form-page/useForm.ts +++ b/src/webapp/pages/form-page/useForm.ts @@ -9,11 +9,7 @@ import { mapFormStateToEntityData } from "./mapFormStateToEntityData"; import { updateAndValidateFormState } from "./disease-outbreak-event/utils/updateDiseaseOutbreakEventFormState"; import { FormFieldState } from "../../components/form/FormFieldsState"; import { FormType } from "./FormPage"; -import { - ConfigurableForm, - DiseaseOutbreakEventFormData, - FormLables, -} from "../../../domain/entities/ConfigurableForm"; +import { ConfigurableForm, FormLables } from "../../../domain/entities/ConfigurableForm"; import { mapEntityToFormState } from "./mapEntityToFormState"; import { useCurrentEventTracker } from "../../contexts/current-event-tracker-context"; import { @@ -99,6 +95,7 @@ export function useForm(formType: FormType, id?: Id): State { id, currentEventTracker, appConfiguration.eventTrackerConfigurations, + appConfiguration, ]); const handleAddNew = useCallback(() => { diff --git a/src/webapp/pages/incident-action-plan/useIncidentActionPlan.ts b/src/webapp/pages/incident-action-plan/useIncidentActionPlan.ts index 106b60d8..5d251825 100644 --- a/src/webapp/pages/incident-action-plan/useIncidentActionPlan.ts +++ b/src/webapp/pages/incident-action-plan/useIncidentActionPlan.ts @@ -110,7 +110,7 @@ export function useIncidentActionPlan(id: Id) { setGlobalMessage(`Event tracker with id: ${id} does not exist`); } ); - }, [compositionRoot, id, changeCurrentEventTracker, getCurrentEventTracker]); + }, [compositionRoot, id, changeCurrentEventTracker, getCurrentEventTracker, appConfiguration]); return { incidentActionExists: incidentActionExists,