Package com.krminc.phr.domain

Examples of com.krminc.phr.domain.UserPreferences


                session.setAttribute("needsreset", "false");
                if (req.isUserInRole(UserConfig.ROLE_PATIENT) || req.isUserInRole(UserConfig.ROLE_CARETAKER)) {
                    if (hrid != null) {
                        session.setAttribute("healthRecordId", hrid);
                        if (req.isUserInRole(UserConfig.ROLE_PATIENT)) {
                            UserPreferences pref = user.getPrimaryHealthRecord().getPreferences();
                            boolean showCN;
                            if (pref != null) {
                                showCN = (pref.getShowCarenotebook() == true) ? true : false;
                            } else {
                                showCN = false;
                            }
                            session.setAttribute("showCareNotebook", showCN);
                        }
View Full Code Here


        PersistenceService persistenceSvc = PersistenceService.getInstance();
        try {
            persistenceSvc.beginTx();
            EntityManager em = persistenceSvc.getEntityManager();
            HealthRecord hr = em.find(HealthRecord.class, healthRecordId);
            UserPreferences preferences = hr.getPreferences();
           
            String username = req.getRemoteUser();
            boolean updateHRisRequired = false;
           
            if (preferences == null) {
                preferences = new UserPreferences(username);
                preferences.setShowCarenotebook(careNotebookVal);
                hr.setPreferences(preferences);
                updateHRisRequired = true;
            } else {
                preferences.setLastUpdatedUser(username);
                preferences.setShowCarenotebook(careNotebookVal);
            }

            if (updateHRisRequired) em.merge(hr);
            em.merge(preferences);
            persistenceSvc.commitTx();
View Full Code Here

TOP

Related Classes of com.krminc.phr.domain.UserPreferences

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.