1515
1616package de .symeda .sormas .ui .caze ;
1717
18+ import java .util .Arrays ;
19+ import java .util .Collections ;
1820import java .util .EnumSet ;
19- import java .util .List ;
21+ import java .util .HashSet ;
22+ import java .util .Set ;
2023
2124import com .vaadin .navigator .ViewChangeListener .ViewChangeEvent ;
2225import com .vaadin .ui .UI ;
@@ -61,6 +64,27 @@ public abstract class AbstractCaseView extends AbstractEditAllowedDetailView<Cas
6164
6265 public static final String ROOT_VIEW_NAME = CasesView .VIEW_NAME ;
6366
67+ public static final Set <Disease > CLINICAL_COURSE_DISABLED_DISEASES = Collections .unmodifiableSet (
68+ new HashSet <>(
69+ Arrays .asList (
70+ Disease .MEASLES ,
71+ Disease .INVASIVE_MENINGOCOCCAL_INFECTION ,
72+ Disease .INVASIVE_PNEUMOCOCCAL_INFECTION ,
73+ Disease .GIARDIASIS ,
74+ Disease .CRYPTOSPORIDIOSIS )));
75+
76+ public static final Set <Disease > THERAPY_DISABLED_DISEASES = Collections .unmodifiableSet (
77+ new HashSet <>(
78+ Arrays .asList (
79+ Disease .MEASLES ,
80+ Disease .GIARDIASIS ,
81+ Disease .CRYPTOSPORIDIOSIS ,
82+ Disease .INVASIVE_MENINGOCOCCAL_INFECTION ,
83+ Disease .INVASIVE_PNEUMOCOCCAL_INFECTION )));
84+
85+ public static final Set <Disease > SYMPTOMS_DISABLED_DISEASES =
86+ Collections .unmodifiableSet (new HashSet <>(Arrays .asList (Disease .INFLUENZA , Disease .LATENT_TUBERCULOSIS )));
87+
6488 private Boolean hasOutbreak ;
6589 private boolean caseFollowupEnabled ;
6690
@@ -177,7 +201,7 @@ public void refreshMenu(SubMenu menu, String params) {
177201 I18nProperties .getPrefixCaption (CaseDataDto .I18N_PREFIX , CaseDataDto .PORT_HEALTH_INFO ),
178202 params );
179203 }
180- if (UiUtil .enabled (FeatureType .VIEW_TAB_CASES_SYMPTOMS ) && !List . of ( Disease . LATENT_TUBERCULOSIS ) .contains (caze .getDisease ())) {
204+ if (UiUtil .enabled (FeatureType .VIEW_TAB_CASES_SYMPTOMS ) && !SYMPTOMS_DISABLED_DISEASES .contains (caze .getDisease ())) {
181205 menu .addView (CaseSymptomsView .VIEW_NAME , I18nProperties .getPrefixCaption (CaseDataDto .I18N_PREFIX , CaseDataDto .SYMPTOMS ), params );
182206 }
183207 if (UiUtil .enabled (FeatureType .VIEW_TAB_CASES_EPIDEMIOLOGICAL_DATA ) && caze .getDisease () != Disease .CONGENITAL_RUBELLA ) {
@@ -187,9 +211,11 @@ public void refreshMenu(SubMenu menu, String params) {
187211 && !caze .checkIsUnreferredPortHealthCase ()
188212 && UiUtil .enabled (FeatureType .CLINICAL_MANAGEMENT )
189213 && (!(FacadeProvider .getConfigFacade ().isConfiguredCountry (CountryHelper .COUNTRY_CODE_LUXEMBOURG )
190- && List .of (Disease .MEASLES ).contains (caze .getDisease ())))
191- && !List .of (Disease .GIARDIASIS , Disease .CRYPTOSPORIDIOSIS ).contains (caze .getDisease ())) {
192- // Therapy view is not available for Luxembourg for Measles cases and for all Gradiastis & Cryptosporidiosis cases.
214+ && THERAPY_DISABLED_DISEASES .contains (caze .getDisease ())))
215+ && Disease .INFLUENZA != caze .getDisease ()) {
216+ // Therapy view is not available for Luxembourg for Measles, IMI, IPI, Gradiastis & Cryptosporidiosis cases.
217+ // But for other countries, it should be available for the above diseases
218+ // Therapy view is not available for all countries Influenza cases. #13708
193219 menu .addView (TherapyView .VIEW_NAME , I18nProperties .getPrefixCaption (CaseDataDto .I18N_PREFIX , CaseDataDto .THERAPY ), params );
194220 }
195221 }
@@ -205,17 +231,11 @@ public void refreshMenu(SubMenu menu, String params) {
205231 EnumSet .of (FeatureType .VIEW_TAB_CASES_FOLLOW_UP , FeatureType .VIEW_TAB_CASES_CLINICAL_COURSE , FeatureType .CLINICAL_MANAGEMENT ),
206232 UserRight .CLINICAL_COURSE_VIEW )
207233 && !caze .checkIsUnreferredPortHealthCase ()
208- && !List
209- .of (
210- Disease .INVASIVE_MENINGOCOCCAL_INFECTION ,
211- Disease .INVASIVE_PNEUMOCOCCAL_INFECTION ,
212- Disease .GIARDIASIS ,
213- Disease .CRYPTOSPORIDIOSIS )
214- .contains (caze .getDisease ())
215234 && !(FacadeProvider .getConfigFacade ().isConfiguredCountry (CountryHelper .COUNTRY_CODE_LUXEMBOURG )
216- && List .of (Disease .MEASLES ).contains (caze .getDisease ()))) {
217- // clinical course view is not available for Luxembourg for Measles cases,
218- // and for all other countries GIARDIASIS, Cryptosporidiosis, IMI & IPI cases.
235+ && CLINICAL_COURSE_DISABLED_DISEASES .contains (caze .getDisease ()))
236+ && Disease .INFLUENZA != caze .getDisease ()) {
237+ // clinical course view is not available for Luxembourg for Measles, IMI, IPI, GIARDIASIS, Cryptosporidiosis cases,
238+ // and for all other countries Influenza cases. 13708
219239 menu .addView (
220240 ClinicalCourseView .VIEW_NAME ,
221241 I18nProperties .getPrefixCaption (CaseDataDto .I18N_PREFIX , CaseDataDto .CLINICAL_COURSE ),
0 commit comments