@RequestMapping(value = "/module/htmlformentry/encounter.json", method = RequestMethod.GET) @ResponseBody public JsonNode encounterSchemaAsJson(@RequestParam(value="encounter") Encounter encounter, HttpSession httpSession) throws Exception { // TODO error handling-- no form? ObjectMapper jackson = new ObjectMapper(); HtmlForm form = Context.getService(HtmlFormEntryService.class).getHtmlFormByForm(encounter.getForm()); HtmlFormSchema schema = generateSchema(form.getXmlData(), httpSession, encounter); return buildSchemaAsJsonNode(schema, jackson); }
HtmlForm htmlForm = HtmlFormEntryUtil.getService().getHtmlFormByForm(encForm); if(htmlForm != null && htmlForm.getId().equals(formId) && dateToCheck.compareTo(enc.getEncounterDatetime()) == 0)
/** * Creates a new HTML Form Entry session (in "Enter" mode) for the specified patient and using * the HTML Form associated with the specified Form * * @param patient * @param form * @param httpSession * @throws Exception */ public FormEntrySession(Patient patient, Form form, HttpSession httpSession) throws Exception { this(patient, Mode.ENTER, null, httpSession); this.form = form; velocityContext.put("form", form); submissionController = new FormSubmissionController(); HtmlForm temp = HtmlFormEntryUtil.getService().getHtmlFormByForm(form); this.formModifiedTimestamp = (temp.getDateChanged() == null ? temp.getDateCreated() : temp.getDateChanged()) .getTime(); xmlDefinition = temp.getXmlData(); }
htmlForm = HtmlFormEntryUtil.getService().getHtmlFormByForm(form); if (htmlForm == null) throw new IllegalArgumentException("No HtmlForm associated with formId " + formId); } else { form = encounter.getForm(); htmlForm = HtmlFormEntryUtil.getService().getHtmlFormByForm(encounter.getForm()); if (htmlForm == null) throw new IllegalArgumentException("The form for the specified encounter (" + encounter.getForm() + ") does not have an HtmlForm associated with it"); } else if (formId != null) { form = Context.getFormService().getForm(formId); htmlForm = HtmlFormEntryUtil.getService().getHtmlFormByForm(form);
HtmlForm htmlForm = Context.getService(HtmlFormEntryService.class).getHtmlFormByForm(form); if (htmlForm != null){ dependencies.add(htmlForm);