Package org.openmrs.module.htmlformentry

Examples of org.openmrs.module.htmlformentry.HtmlForm


    for(Encounter enc: encounters)
    {
      if(enc.getForm() != null)
      {
        Form encForm = enc.getForm();
        HtmlForm htmlForm = HtmlFormEntryUtil.getService().getHtmlFormByForm(encForm);
        if(htmlForm != null && htmlForm.getId().equals(formId) && dateToCheck.compareTo(enc.getEncounterDatetime()) == 0)
        {
          duplicate = true;
        }
      }
    }
View Full Code Here


        if (pId != null) {
          p = Context.getPatientService().getPatient(pId);
        } else {
          p = HtmlFormEntryUtil.getFakePerson();
        }
        HtmlForm fakeForm = new HtmlForm();
        fakeForm.setXmlData(xml);
        FormEntrySession fes = new FormEntrySession(p, null, Mode.ENTER, fakeForm, request.getSession());
        String html = fes.getHtmlToDisplay();
        if (fes.getFieldAccessorJavascript() != null) {
                  html += "<script>" + fes.getFieldAccessorJavascript() + "</script>";
                }
View Full Code Here

                                      @RequestParam(value="returnUrl", required=false) String returnUrl,
                                      HttpServletRequest request) throws Exception {
        Encounter enc = Context.getEncounterService().getEncounter(encounterId);
        Integer ptId = enc.getPatientId();
        HtmlFormEntryService hfes = Context.getService(HtmlFormEntryService.class);
        HtmlForm form = hfes.getHtmlForm(htmlFormId);
        HtmlFormEntryUtil.voidEncounter(enc, form, reason);
        Context.getEncounterService().saveEncounter(enc);
        if (!StringUtils.hasText(returnUrl)) {
          returnUrl = request.getContextPath() + "/patientDashboard.form?patientId=" + ptId;
        }
View Full Code Here

    }

        Patient patient = null;
      Encounter encounter = null;
      Form form = null;
      HtmlForm htmlForm = null;

      if (StringUtils.hasText(request.getParameter("encounterId"))) {
       
        Integer encounterId = Integer.valueOf(request.getParameter("encounterId"));
        encounter = Context.getEncounterService().getEncounter(encounterId);
View Full Code Here

            log.error("An error occurred while loading the html.", e);
            message = "An error occurred while loading the html. " + e.getMessage();
          }
        }
        else if (id != null) {
          HtmlForm form = Context.getService(HtmlFormEntryService.class).getHtmlForm(id);
          xml = form.getXmlData();
        }
        else {
          message = "You must specify a file path to preview from file";
        }
       
    Patient p = HtmlFormEntryUtil.getFakePerson();
    HtmlForm fakeForm = new HtmlForm();
    fakeForm.setXmlData(xml);
        FormEntrySession fes = new FormEntrySession(p, null, Mode.ENTER, fakeForm, httpSession);
        fes.getHtmlToDisplay();
        HtmlFormSchema schema = fes.getContext().getSchema();
        model.addAttribute("schema", schema);
        model.addAttribute("message", message);
View Full Code Here

  }
 
    @ModelAttribute("htmlForm")
    HtmlForm formBackingObject(@RequestParam(value="id", required=false) Integer id) {
      if (id != null) {
            HtmlForm hf = HtmlFormEntryUtil.getService().getHtmlForm(id);
            // avoid LazyInitializationException
            hf.getForm().getFormFields().size();
            return hf;
        } else {
          HtmlForm hf = new HtmlForm();
          hf.setForm(new Form());
          return hf;
        }
    }
View Full Code Here

   */
  @RequestMapping(value="/module/htmlformentry/htmlForm", method=RequestMethod.GET)
  public void showHtmlForm(Model model,
                             HttpSession httpSession,
                           @ModelAttribute("htmlForm") HtmlForm htmlForm) {
    HtmlForm hf = (HtmlForm) model.asMap().get("htmlForm");
    if (hf.getId() == null) {
      model.addAttribute("previewHtml", "");
    } else {
      try {
                Patient demo = HtmlFormEntryUtil.getFakePerson();
                FormEntrySession fes = new FormEntrySession(demo, hf.getXmlData(), httpSession);
                String html = fes.getHtmlToDisplay();
                if (fes.getFieldAccessorJavascript() != null) {
                  html += "<script>" + fes.getFieldAccessorJavascript() + "</script>";
                }
                model.addAttribute("previewHtml", html);
View Full Code Here

TOP

Related Classes of org.openmrs.module.htmlformentry.HtmlForm

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.