Package org.openmrs.logic

Examples of org.openmrs.logic.LogicService


     * @throws org.openmrs.module.htmlformentry.BadFormDesignException
     * @should return a correct boolean value for logic test string
     */
    protected boolean processLogicIncludeLogic(FormEntrySession session, String testStr) throws BadFormDesignException {

        LogicService ls = Context.getLogicService();
        LogicCriteria logicCriteria = null;
        try {
            logicCriteria = ls.parse(testStr);
        } catch (Exception ex) {
            throw new BadFormDesignException(ex.getMessage());
        }

        if (logicCriteria != null) {
            if ("testing-html-form-entry".equals(session.getPatient().getUuid()))
                return false;
            else {
                try {
                    return ls.eval(session.getPatient(), logicCriteria).toBoolean();
                } catch (Exception ex) {
                    throw new BadFormDesignException(ex.getMessage());
                }
            }
        } else {
View Full Code Here

TOP

Related Classes of org.openmrs.logic.LogicService

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.