/** * Return the application name from the context. * * @return The application name. */ public static String getAppName() { return (String) getAttribute("applicationName"); }
/** * Returns true if the default layout scope is shared. * * @return True if the default layout scope is shared. */ public static boolean defaultIsShared() { return FrameworkUtil.getAttribute(ATTR_DEFAULT_SCOPE) != null; }
/** * Return the application name from the context. * * @return The application name. */ public static String getAppName() { return (String) getAttribute("applicationName"); }
/** * Returns the patient list passed from the caller. * * @return Patient list. */ @SuppressWarnings("unchecked") public List<Patient> getResults() { return (List<Patient>) FrameworkUtil.getAttribute(Constants.RESULT_ATTRIB); }
/** * Returns the current patient selector. If one has not already been created, it is created from * the factory. * * @return The patient selector. */ private static IPatientSelector getSelector() { IPatientSelector selector = (IPatientSelector) FrameworkUtil.getAttribute(Constants.SELECTOR_ATTRIB); if (selector == null) { IPatientSelectorFactory factory = getFactory(); selector = factory == null ? null : factory.create(); FrameworkUtil.setAttribute(Constants.SELECTOR_ATTRIB, selector); } return selector; }
/** * Returns true if drill down icons are enabled. * * @return True if drill down icons are enabled. */ public static boolean showIcons() { Boolean result = (Boolean) FrameworkUtil.getAttribute(Constants.PROPERTY_ID_DRILLDOWN); if (result == null) { try { String value = PropertyUtil.getValue(Constants.PROPERTY_ID_DRILLDOWN); result = BooleanUtils.toBoolean(value); } catch (Exception e) { result = true; } FrameworkUtil.setAttribute(Constants.PROPERTY_ID_DRILLDOWN, result); } return result; }
/** * Returns true if drill down icons are enabled. * * @return True if drill down icons are enabled. */ public static boolean showIcons() { Boolean result = (Boolean) FrameworkUtil.getAttribute(Constants.PROPERTY_ID_DRILLDOWN); if (result == null) { try { String value = PropertyUtil.getValue(Constants.PROPERTY_ID_DRILLDOWN); result = BooleanUtils.toBoolean(value); } catch (Exception e) { result = true; } FrameworkUtil.setAttribute(Constants.PROPERTY_ID_DRILLDOWN, result); } return result; }
/** * Displays the encounter selection dialog. * * @param flags The encounter flags. */ public static void execute(EncounterFlag... flags) { String resource = Constants.RESOURCE_PREFIX + "encounterSelection.zul"; Window dlg = (Window) FrameworkUtil.getAttribute(resource); if (dlg == null || dlg.getPage() == null) { dlg = PopupDialog.popup(resource, true, true, false); FrameworkUtil.setAttribute(resource, dlg); } try { EncounterSelection sel = ZKUtil.findChild(dlg, EncounterSelection.class); sel.setEncounterFlags(EncounterFlag.flags(flags)); dlg.doModal(); } catch (Exception e) { throw new RuntimeException(e); } }
/** * Displays the encounter selection dialog. * * @param flags The encounter flags. */ public static void execute(EncounterFlag... flags) { try { Window dlg = (Window) FrameworkUtil.getAttribute(SELECTION_DIALOG); if (dlg == null || dlg.getPage() == null) { dlg = PopupDialog.popup(SELECTION_DIALOG, true, true, false); FrameworkUtil.setAttribute(SELECTION_DIALOG, dlg); } MainController sel = (MainController) getController(dlg); sel.setEncounterFlags(EncounterFlag.flags(flags)); if (sel.needsInit) { sel.init(); } dlg.doModal(); } catch (Exception e) { FrameworkUtil.setAttribute(SELECTION_DIALOG, null); throw MiscUtil.toUnchecked(e); } }