Search in sources :

Example 1 with PageMenuItem

use of de.symeda.sormas.app.component.menu.PageMenuItem in project SORMAS-Project by hzi-braunschweig.

the class BaseReportActivity method updateSubHeadingTitle.

@Override
public void updateSubHeadingTitle() {
    String subHeadingTitle = "";
    if (activeFragment != null) {
        PageMenuItem activeMenu = getActivePage();
        subHeadingTitle = (activeMenu == null) ? activeFragment.getSubHeadingTitle() : activeMenu.getTitle();
    }
    setSubHeadingTitle(subHeadingTitle);
}
Also used : PageMenuItem(de.symeda.sormas.app.component.menu.PageMenuItem)

Example 2 with PageMenuItem

use of de.symeda.sormas.app.component.menu.PageMenuItem in project SORMAS-Project by hzi-braunschweig.

the class BaseReadActivity method updateSubHeadingTitle.

@Override
public void updateSubHeadingTitle() {
    String subHeadingTitle = "";
    if (activeFragment != null) {
        PageMenuItem activeMenu = getActivePage();
        subHeadingTitle = (activeMenu == null) ? activeFragment.getSubHeadingTitle() : activeMenu.getTitle();
    }
    setSubHeadingTitle(subHeadingTitle);
}
Also used : PageMenuItem(de.symeda.sormas.app.component.menu.PageMenuItem)

Example 3 with PageMenuItem

use of de.symeda.sormas.app.component.menu.PageMenuItem in project SORMAS-Project by hzi-braunschweig.

the class CaseEditActivity method getPageMenuData.

@Override
public List<PageMenuItem> getPageMenuData() {
    List<PageMenuItem> menuItems = PageMenuItem.fromEnum(CaseSection.values(), getContext());
    Case caze = getStoredRootEntity();
    // Sections must be removed in reverse order
    if (DatabaseHelper.getFeatureConfigurationDao().isFeatureDisabled(FeatureType.TASK_MANAGEMENT)) {
        menuItems.set(CaseSection.TASKS.ordinal(), null);
    }
    if (!ConfigProvider.hasUserRight(UserRight.CLINICAL_COURSE_VIEW) || DatabaseHelper.getFeatureConfigurationDao().isFeatureDisabled(FeatureType.VIEW_TAB_CASES_CLINICAL_COURSE) || (caze != null && caze.isUnreferredPortHealthCase()) || (caze != null && caze.getClinicalCourse() == null) || DatabaseHelper.getFeatureConfigurationDao().isFeatureDisabled(FeatureType.CLINICAL_MANAGEMENT)) {
        menuItems.set(CaseSection.CLINICAL_VISITS.ordinal(), null);
        menuItems.set(CaseSection.HEALTH_CONDITIONS.ordinal(), null);
    }
    if (!ConfigProvider.hasUserRight(UserRight.THERAPY_VIEW) || DatabaseHelper.getFeatureConfigurationDao().isFeatureDisabled(FeatureType.VIEW_TAB_CASES_THERAPY) || (caze != null && caze.isUnreferredPortHealthCase()) || (caze != null && caze.getTherapy() == null) || DatabaseHelper.getFeatureConfigurationDao().isFeatureDisabled(FeatureType.CLINICAL_MANAGEMENT)) {
        menuItems.set(CaseSection.TREATMENTS.ordinal(), null);
        menuItems.set(CaseSection.PRESCRIPTIONS.ordinal(), null);
    }
    if (caze != null && caze.isUnreferredPortHealthCase()) {
        menuItems.set(CaseSection.SAMPLES.ordinal(), null);
    }
    if (!ConfigProvider.hasUserRight(UserRight.IMMUNIZATION_VIEW) || DatabaseHelper.getFeatureConfigurationDao().isPropertyValueTrue(FeatureType.IMMUNIZATION_MANAGEMENT, FeatureTypeProperty.REDUCED)) {
        menuItems.set(CaseSection.IMMUNIZATIONS.ordinal(), null);
    }
    if (!ConfigProvider.hasUserRight(UserRight.IMMUNIZATION_VIEW) || !DatabaseHelper.getFeatureConfigurationDao().isPropertyValueTrue(FeatureType.IMMUNIZATION_MANAGEMENT, FeatureTypeProperty.REDUCED)) {
        menuItems.set(CaseSection.VACCINATIONS.ordinal(), null);
    }
    if (!ConfigProvider.hasUserRight(UserRight.CONTACT_VIEW) || (caze != null && caze.isUnreferredPortHealthCase()) || (caze != null && !DiseaseConfigurationCache.getInstance().hasFollowUp(caze.getDisease()))) {
        menuItems.set(CaseSection.CONTACTS.ordinal(), null);
    }
    if (caze != null && caze.getDisease() == Disease.CONGENITAL_RUBELLA || DatabaseHelper.getFeatureConfigurationDao().isFeatureDisabled(FeatureType.VIEW_TAB_CASES_EPIDEMIOLOGICAL_DATA)) {
        menuItems.set(CaseSection.EPIDEMIOLOGICAL_DATA.ordinal(), null);
    }
    if (caze != null && (caze.getCaseOrigin() != CaseOrigin.POINT_OF_ENTRY || !ConfigProvider.hasUserRight(UserRight.PORT_HEALTH_INFO_VIEW))) {
        menuItems.set(CaseSection.PORT_HEALTH_INFO.ordinal(), null);
    }
    if (caze != null && (caze.isUnreferredPortHealthCase() || UserRole.isPortHealthUser(ConfigProvider.getUser().getUserRoles()) || DatabaseHelper.getFeatureConfigurationDao().isFeatureDisabled(FeatureType.VIEW_TAB_CASES_HOSPITALIZATION))) {
        menuItems.set(CaseSection.HOSPITALIZATION.ordinal(), null);
    }
    if (caze != null && caze.getDisease() != Disease.CONGENITAL_RUBELLA) {
        menuItems.set(CaseSection.MATERNAL_HISTORY.ordinal(), null);
    }
    if (DatabaseHelper.getFeatureConfigurationDao().isFeatureDisabled(FeatureType.VIEW_TAB_CASES_SYMPTOMS)) {
        menuItems.set(CaseSection.SYMPTOMS.ordinal(), null);
    }
    return menuItems;
}
Also used : PageMenuItem(de.symeda.sormas.app.component.menu.PageMenuItem) Case(de.symeda.sormas.app.backend.caze.Case)

Example 4 with PageMenuItem

use of de.symeda.sormas.app.component.menu.PageMenuItem in project SORMAS-Project by hzi-braunschweig.

the class SampleReadActivity method getPageMenuData.

@Override
public List<PageMenuItem> getPageMenuData() {
    List<PageMenuItem> menuItems = PageMenuItem.fromEnum(SampleSection.values(), getContext());
    Sample sample = getStoredRootEntity();
    // }
    return menuItems;
}
Also used : PageMenuItem(de.symeda.sormas.app.component.menu.PageMenuItem) Sample(de.symeda.sormas.app.backend.sample.Sample)

Example 5 with PageMenuItem

use of de.symeda.sormas.app.component.menu.PageMenuItem in project SORMAS-Project by hzi-braunschweig.

the class EventParticipantEditActivity method getPageMenuData.

@Override
public List<PageMenuItem> getPageMenuData() {
    List<PageMenuItem> menuItems = PageMenuItem.fromEnum(EventParticipantSection.values(), getContext());
    Event event = DatabaseHelper.getEventDao().queryUuid(eventUuid);
    if (!ConfigProvider.hasUserRight(UserRight.IMMUNIZATION_VIEW) || DatabaseHelper.getFeatureConfigurationDao().isPropertyValueTrue(FeatureType.IMMUNIZATION_MANAGEMENT, FeatureTypeProperty.REDUCED)) {
        menuItems.set(EventParticipantSection.IMMUNIZATIONS.ordinal(), null);
    }
    if (!ConfigProvider.hasUserRight(UserRight.IMMUNIZATION_VIEW) || !DatabaseHelper.getFeatureConfigurationDao().isPropertyValueTrue(FeatureType.IMMUNIZATION_MANAGEMENT, FeatureTypeProperty.REDUCED) || event.getDisease() == null) {
        menuItems.set(EventParticipantSection.VACCINATIONS.ordinal(), null);
    }
    return menuItems;
}
Also used : PageMenuItem(de.symeda.sormas.app.component.menu.PageMenuItem) Event(de.symeda.sormas.app.backend.event.Event)

Aggregations

PageMenuItem (de.symeda.sormas.app.component.menu.PageMenuItem)11 Case (de.symeda.sormas.app.backend.caze.Case)2 Event (de.symeda.sormas.app.backend.event.Event)2 Sample (de.symeda.sormas.app.backend.sample.Sample)2 Context (android.content.Context)1 AsyncTask (android.os.AsyncTask)1 Disease (de.symeda.sormas.api.Disease)1 MeansOfImmunization (de.symeda.sormas.api.immunization.MeansOfImmunization)1 DataHelper (de.symeda.sormas.api.utils.DataHelper)1 ValidationException (de.symeda.sormas.api.utils.ValidationException)1 BaseActivity (de.symeda.sormas.app.BaseActivity)1 BaseEditActivity (de.symeda.sormas.app.BaseEditActivity)1 BaseEditFragment (de.symeda.sormas.app.BaseEditFragment)1 R (de.symeda.sormas.app.R)1 DaoException (de.symeda.sormas.app.backend.common.DaoException)1 DatabaseHelper (de.symeda.sormas.app.backend.common.DatabaseHelper)1 Immunization (de.symeda.sormas.app.backend.immunization.Immunization)1 ImmunizationCriteria (de.symeda.sormas.app.backend.immunization.ImmunizationCriteria)1 ImmunizationEditAuthorization (de.symeda.sormas.app.backend.immunization.ImmunizationEditAuthorization)1 ImmunizationSimilarityCriteria (de.symeda.sormas.app.backend.immunization.ImmunizationSimilarityCriteria)1