Examples of ObsSubmissionElement


Examples of org.openmrs.module.htmlformentry.element.ObsSubmissionElement

        }
        if (thenDisplay != null && !thenDisplay.startsWith("#") && !thenDisplay.startsWith(".")) {
            throw new IllegalArgumentException("'" + THEN_DISPLAY + "' attribute must be a DOM #id or .class");
        }

        ObsSubmissionElement obs = session.getContext().getHighestOnStack(ObsSubmissionElement.class);

        // for now we only implement the case where value is a concept id/uuid/code
        Concept concept = HtmlFormEntryUtil.getConcept(value);
        if (thenDisplay != null) {
            obs.whenValueThenDisplaySection(concept, thenDisplay);
        }
        if (thenJavaScript != null) {
            obs.whenValueThenJavaScript(concept, thenJavaScript);
        }
        if (elseJavaScript != null) {
            obs.whenValueElseJavaScript(concept, elseJavaScript);
        }
        return "";
    }
View Full Code Here

Examples of org.openmrs.module.htmlformentry.element.ObsSubmissionElement


    @Override
    public boolean doStartTag(FormEntrySession session, PrintWriter out, Node parent, Node node) throws BadFormDesignException {
        FormEntryContext context = session.getContext();
        ObsSubmissionElement element = new ObsSubmissionElement(context, getAttributes(node));
        session.getSubmissionController().addAction(element);
        out.print(element.generateHtml(context));

        context.pushToStack(element);
        return true;
    }
View Full Code Here

Examples of org.openmrs.module.htmlformentry.element.ObsSubmissionElement

        Object popped = session.getContext().popFromStack();
        if (!(popped instanceof ObsSubmissionElement)) {
            throw new IllegalStateException("Popped an element from the stack but it wasn't an ObsSubmissionElement!");
        }

        ObsSubmissionElement element = (ObsSubmissionElement) popped;
        if (session.getContext().getMode() != FormEntryContext.Mode.VIEW && element.hasWhenValueThen()) {
            if (element.getId() == null) {
                throw new IllegalStateException("<obs> must have an id attribute to define when-then actions");
            }
            out.println("<script type=\"text/javascript\">");
            out.println("jQuery(function() { htmlForm.setupWhenThen('" + element.getId() + "', "
                    + simplifyWhenThen(element.getWhenValueThenDisplaySection()) + ", "
                    + simplifyWhenThen(element.getWhenValueThenJavascript()) + ", "
                    + simplifyWhenThen(element.getWhenValueElseJavascript())
                    + "); });");
            out.println("</script>");
        }
    }
View Full Code Here

Examples of org.openmrs.module.htmlformentry.element.ObsSubmissionElement

      List<FormSubmissionControllerAction> actions = session.getSubmissionController().getActions();
      Set<Obs> matchedObs = new HashSet<Obs>();
      Set<Order> matchedOrders = new HashSet<Order>();
      for (FormSubmissionControllerAction lfca : actions) {
        if (lfca instanceof ObsSubmissionElement) {
          ObsSubmissionElement ose = (ObsSubmissionElement) lfca;
          if (ose.getExistingObs() != null) {
            matchedObs.add(ose.getExistingObs());
          }
        }
        if (lfca instanceof ObsGroupAction) {
          ObsGroupAction oga = (ObsGroupAction) lfca;
          if (oga.getExistingGroup() != null) {
View Full Code Here

Examples of org.openmrs.module.htmlformentry.element.ObsSubmissionElement

            session.getHtmlToDisplay();
            FormSubmissionController  fsa = session.getSubmissionController();
            List<FormSubmissionControllerAction> actions = fsa.getActions();
            for (FormSubmissionControllerAction fsca : actions){
                if (fsca instanceof ObsSubmissionElement){
                    ObsSubmissionElement ose = (ObsSubmissionElement) fsca;
                    sb = appendObsToRow(ose, sb, extraCols, locale);  
                } else {
                    //TODO: add programs, orders, logic, etc...
                    // just make sure these are in the headers too...
                }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.