/** * Retrieves a formatted header for the current user. * * @return Formatted header. */ public String getUserInfo() { IUser user = UserContext.getActiveUser(); return user == null ? "No User Selected" : user.getFullName(); }
@Override public void onLoad(ElementPlugin plugin) { super.onLoad(plugin); setUser(UserContext.getActiveUser()); UserContext.getUserContext().addListener(userChangeListener); }
/** * Request a user context change. * * @param user New user */ public static void changeUser(IUser user) { try { getUserContext().requestContextChange(user); } catch (Exception e) { log.error("Error during user context change.", e); } }
public void changeUserContext() throws Exception { MockUser user = new MockUser(); UserContext.changeUser(user); }
/** * Returns the user in the current context. * * @return User in current context. */ public static IUser getActiveUser() { return getUserContext().getContextObject(false); }
public void changeUserContext() throws Exception { MockUser user = new MockUser(); UserContext.changeUser(user); }
/** * Retrieves a formatted header for the current user. * * @return Formatted header. */ public String getUserInfo() { IUser user = UserContext.getActiveUser(); return user == null ? "No User Selected" : user.getFullName(); }
/** * Request a user context change. * * @param user New user */ public static void changeUser(IUser user) { try { getUserContext().requestContextChange(user); } catch (Exception e) { log.error("Error during user context change.", e); } }
@Override protected void updateContext(ContextMap context) { IUser user = UserContext.getActiveUser(); if (user != null) { context.put("userId", user.getLogicalId()); } }
/** * Returns the user in the current context. * * @return User in current context. */ public static IUser getActiveUser() { return getUserContext().getContextObject(false); }
@Override protected void updateContext(ContextMap context) { IUser user = UserContext.getActiveUser(); if (user != null) { context.put("full_name", user.getFullName()); context.put("id", user.getLogicalId()); } }
@Override public void onUnload() { UserContext.getUserContext().removeListener(userChangeListener); }
/** * @see org.carewebframework.api.context.IContextEvent#committed() */ @Override public void committed() { IUser user = UserContext.getActiveUser(); if (log.isDebugEnabled()) { log.debug("user: " + user); } if (currentUser != null && currentUser.equals(user)) { return; } currentUser = user; String text = user == null ? "" : user.getFullName(); if (user != null && user.getSecurityDomain() != null) { text += "@" + user.getSecurityDomain().getName(); } HttpServletRequest request = FrameworkWebSupport.getHttpServletRequest(); String info = StringUtils.trimToEmpty((request == null ? "" : request.getLocalAddr()) + " " + dbRegion); userHeader.setValue(text + (info.isEmpty() ? "" : " (" + info + ")")); password.setVisible(SecurityUtil.getSecurityService().canChangePassword()); Clients.resize(root); }
public void onClick$btnAddNote() { String note = AddNoteController.execute(); if (note == null || note.isEmpty()) { return; } ProblemNote pn = new ProblemNote(); IUser user = UserContext.getActiveUser(); pn.setAuthor(user.getFullName()); pn.setFacility((Organization) PatientContext.getActivePatient().getManagingOrganization().getResource()); pn.setNumber("*"); pn.setNarrative(note); pn.setDateAdded(new FMDate(DateUtil.stripTime(new Date()))); changedNotes.add(pn); renderNote(pn); } }
private static void deletePatientEd(String visitIEN, String icdIEN) { Patient patient = PatientContext.getActivePatient(); IUser user = UserContext.getActiveUser(); BrokerSession broker = VistAUtil.getBrokerSession(); String s = VistAUtil.concatParams(patient.getId().getIdPart(), visitIEN);
public static String addProblem(String sICDIEN, String narrative, String onset) { BrokerSession broker = VistAUtil.getBrokerSession(); String institution = UserContext.getActiveUser().getSecurityDomain().getLogicalId(); Patient patient = PatientContext.getActivePatient(); if (onset == null) { onset = StrUtil.piece(broker.getHostTime().toString(), " "); } // ICD IEN or Code [1] ^ Narrative [2] ^ Location IEN [3] ^ Date of Onset [4] ^ Class [5] ^ // Status [6] ^ Patient IEN [7] ^ Problem IEN [8] ^ Problem # [9] String s = VistAUtil.concatParams(sICDIEN, narrative, institution, onset, null, "A", patient.getId().getIdPart(), null, null); return broker.callRPC("BGOPROB SET", s); }
@Override public void doAfterCompose(Component comp) throws Exception { super.doAfterCompose(comp); panel = comp; forced = !FrameworkUtil.isInitialized(); String title; String label; if (!forced) { user = UserContext.getActiveUser(); title = "password.change.dialog.panel.title"; label = "password.change.dialog.label"; } else { user = (IUser) arg.get("user"); title = "password.change.dialog.expired.panel.title"; label = "password.change.dialog.expired.label"; } if (user == null) { doCancel(); } else { lblTitle.setValue(StrUtil.getLabel(title) + " - " + user.getFullName()); lblInfo.setValue(StrUtil.getLabel(label, MESSAGE_PASSWORD_RULES)); } }
/** * Initialize the dialog. */ @Override public void doAfterCompose(Component comp) throws Exception { super.doAfterCompose(comp); notification = (ScheduledNotification) arg.get("notification"); for (Priority priority : Priority.values()) { Comboitem item = new Comboitem(PriorityRenderer.getDisplayName(priority), PriorityRenderer.getImage(priority)); item.setValue(priority); cboPriority.appendChild(item); } if (notification == null) { notification = new ScheduledNotification(); notification.setPriority(Priority.LOW); notification.setDeliveryDate(new FMDate()); recipients.add(new Recipient(UserContext.getActiveUser())); } else { service.getScheduledNotificationRecipients(notification, recipients); } populateForm(); }
public void refreshProviders() { Practitioner provider = getSelectedProvider(lstEncounterProviders); ListModel<Practitioner> model = new ListModelList<Practitioner>(encounterProvider.getProviders()); lstEncounterProviders.setModel((ListModel<?>) null); lstEncounterProviders.setModel(model); if (model.getSize() == 1) { lstEncounterProviders.setSelectedIndex(0); } else { selectFirstProvider(provider, UserContext.getActiveUser(), encounterProvider.getCurrentProvider(), encounterProvider.getPrimaryProvider()); } }
public void loadEncounterParticipants(Encounter encounter) { encounterParticipantsModel.clear(); encounterParticipantsModel.addAll(encounter.getParticipant()); currentParticipant = EncounterParticipantContext.getActiveParticipant(); encounterParticipantRenderer.setPrimaryParticipant(EncounterUtil.getPrimaryParticipant(encounter)); if (encounterParticipantsModel.getSize() == 1) { lstEncounterParticipants.setSelectedIndex(0); } else { selectFirstParticipant(UserContext.getActiveUser(), currentParticipant, getPrimaryParticipant()); } participantsModified = false; primaryModified = false; }