private FormEntrySession setupFormViewSession(Patient patient, Encounter encounter, String filename) throws Exception { String xml = loadXmlFromFile(getXmlDatasetPath() + filename + ".xml"); HtmlForm fakeForm = new HtmlForm(); fakeForm.setXmlData(xml); fakeForm.setForm(new Form(1)); fakeForm.getForm().setEncounterType(new EncounterType(1)); FormEntrySession session = new FormEntrySession(patient, encounter, FormEntryContext.Mode.VIEW, fakeForm, new MockHttpSession()); session.setAttributes(getFormEntrySessionAttributes()); session.getHtmlToDisplay(); return session; }
private FormEntrySession setupFormEntrySession(Patient patient, String filename) throws Exception { String xml = loadXmlFromFile(getXmlDatasetPath() + filename + ".xml"); HtmlForm fakeForm = new HtmlForm(); fakeForm.setXmlData(xml); fakeForm.setForm(new Form(1)); fakeForm.getForm().setEncounterType(new EncounterType(1)); FormEntrySession session = new FormEntrySession(patient, null, FormEntryContext.Mode.ENTER, fakeForm, new MockHttpSession()); session.setAttributes(getFormEntrySessionAttributes()); session.getHtmlToDisplay(); return session; }
private FormEntrySession setupFormEditSession(Patient patient, Encounter encounter, String filename) throws Exception { String xml = loadXmlFromFile(getXmlDatasetPath() + filename + ".xml"); HtmlForm fakeForm = new HtmlForm(); fakeForm.setXmlData(xml); fakeForm.setForm(new Form(1)); fakeForm.getForm().setEncounterType(new EncounterType(1)); FormEntrySession session = new FormEntrySession(patient, encounter, FormEntryContext.Mode.EDIT, fakeForm, new MockHttpSession()); session.setAttributes(getFormEntrySessionAttributes()); session.getHtmlToDisplay(); return session; }