/** * 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(); }
public FormEntrySession(Patient patient, HtmlForm htmlForm, Mode mode, Location defaultLocation, HttpSession httpSession, boolean automaticClientSideValidation, boolean clientSideValidationHints) throws Exception { this(patient, mode, defaultLocation, httpSession); this.context.setAutomaticClientSideValidation(automaticClientSideValidation); this.context.setClientSideValidationHints(clientSideValidationHints); this.htmlForm = htmlForm; this.formModifiedTimestamp = (htmlForm.getDateChanged() == null ? htmlForm.getDateCreated() : htmlForm .getDateChanged()).getTime(); form = htmlForm.getForm(); velocityContext.put("form", form); submissionController = new FormSubmissionController(); // avoid lazy initialization exceptions later if (form.getEncounterType() != null) form.getEncounterType().getName(); xmlDefinition = htmlForm.getXmlData(); }
@Override public HtmlForm saveHtmlForm(HtmlForm htmlForm) { if (htmlForm.getCreator() == null) htmlForm.setCreator(Context.getAuthenticatedUser()); if (htmlForm.getDateCreated() == null) htmlForm.setDateCreated(new Date()); if (htmlForm.getId() != null) { htmlForm.setChangedBy(Context.getAuthenticatedUser()); htmlForm.setDateChanged(new Date()); } Context.getFormService().saveForm(htmlForm.getForm()); return dao.saveHtmlForm(htmlForm); }
if (htmlForm != null) { if (htmlForm.getId() != null) this.formModifiedTimestamp = (htmlForm.getDateChanged() == null ? htmlForm.getDateCreated() : htmlForm .getDateChanged()).getTime(); form = htmlForm.getForm();
private HtmlForm copyOf(HtmlForm form) { HtmlForm copy = new HtmlForm(); copy.setChangedBy(form.getChangedBy()); copy.setCreator(form.getCreator()); copy.setDateChanged(form.getDateChanged()); copy.setDateCreated(form.getDateCreated()); copy.setDateRetired(form.getDateRetired()); copy.setForm(form.getForm()); copy.setId(form.getId()); copy.setRetired(form.getRetired()); copy.setRetiredBy(form.getRetiredBy()); copy.setRetireReason(form.getRetireReason()); copy.setUuid(form.getUuid()); copy.setXmlData(form.getXmlData()); return copy; }