/** * Requests a context change to the specified participant. * * @param participant The participant. */ public static void changeParticipant(Participant participant) { try { getParticipantContext().requestContextChange(participant); } catch (Exception e) { log.error("Error during request context change.", e); } }
/** * Returns the current participant from the shared context. * * @return Current participant. */ public static Participant getActiveParticipant() { return getParticipantContext().getContextObject(false); }
/** * Returns the current participant from the shared context if it is a practitioner. * * @return Current practitioner. */ public static Participant getActivePractitioner() { Participant participant = getParticipantContext().getContextObject(false); return participant == null ? null : participant.getIndividual().getResource() instanceof Practitioner ? participant : null; }