Package org.openmrs

Examples of org.openmrs.Form


    }
   
    @Test
    @Verifies(value = "should return form schema", method = "generateColumnHeadersFromHtmlForm(HtmlForm htmlform, String[] extraCols, StringBuffer, List<PatientIdenitifierType> pitList)")
    public void generateColumnHeadersFromHtmlForm_shouldReturnSchemaCorrectly() throws Exception {
        Form form = new Form();
        HtmlForm htmlform = new HtmlForm();
        htmlform.setForm(form);
        form.setEncounterType(new EncounterType());
        htmlform.setDateChanged(new Date());
        htmlform.setXmlData(new TestUtil().loadXmlFromFile(XML_DATASET_PATH + "returnSectionsAndConceptsInSectionsTestFormWithGroups.xml"));
        List<String> extraCols = new ArrayList<String>();
        extraCols.add("valueModifier");
        extraCols.add("accessionNumber");
View Full Code Here


    }   
   
    @Test
    @Verifies(value = "should return encounter rows", method = "generateColumnDataFromHtmlForm(List<Encounter> encounters, HtmlForm form, List<String> extraCols, StringBuffer sb, Locale locale),List<PatientIdentifierType> pitList")
    public void generateColumnDataFromHtmlForm_shouldReturnRowsCorrectly() throws Exception {
        Form form = new Form();
        HtmlForm htmlform = new HtmlForm();
        htmlform.setForm(form);
        form.setEncounterType(new EncounterType());
        htmlform.setDateChanged(new Date());
        htmlform.setXmlData(new TestUtil().loadXmlFromFile(XML_DATASET_PATH + "obsGroupDataExportTest.xml"));
        List<String> extraCols = new ArrayList<String>();
        extraCols.add("valueModifier");
        extraCols.add("accessionNumber");
View Full Code Here

    }
   
    @Test
    @Verifies(value = "should handle multiple identifier types correctly", method = "buildHtmlFormExport(List<Encounter> encounters, HtmlForm htmlForm, List<String> extraCols, StringBuffer sb, Locale locale,List<PatientIdentifierType> pitList)")
    public void generateColumnDataFromHtmlForm_shouldReturnRowsCorrectlyWithMultipleIDTypes() throws Exception {
        Form form = new Form();
        HtmlForm htmlform = new HtmlForm();
        htmlform.setForm(form);
        form.setEncounterType(new EncounterType());
        htmlform.setDateChanged(new Date());
        htmlform.setXmlData(new TestUtil().loadXmlFromFile(XML_DATASET_PATH + "obsGroupDataExportTest.xml"));
        List<String> extraCols = new ArrayList<String>();
        extraCols.add("valueModifier");
        extraCols.add("accessionNumber");
View Full Code Here

   
   
    @Test
    @Verifies(value = "should render timestamps and datetimes correctly", method = "getObsValueAsString")
    public void getObsValueAsString_shouldRenderCorrectly() throws Exception {
        Form form = new Form();
        HtmlForm htmlform = new HtmlForm();
        htmlform.setForm(form);
        form.setEncounterType(new EncounterType());
        htmlform.setDateChanged(new Date());
        htmlform.setXmlData(new TestUtil().loadXmlFromFile(XML_DATASET_PATH + "datatypeRenderingTest.xml"));
        List<String> extraCols = new ArrayList<String>();
        extraCols.add("valueModifier");
        extraCols.add("accessionNumber");
View Full Code Here

    /**
   * @return a new VelocityFunctions instance for the given patientId
   */
  private VelocityFunctions setupFunctionsForPatient(Integer patientId) throws Exception {
    HtmlForm htmlform = new HtmlForm();
    Form form = new Form();
    form.setEncounterType(new EncounterType(1));
        htmlform.setForm(form);
        htmlform.setDateChanged(new Date());
        htmlform.setXmlData("<htmlform></htmlform>");

        Patient p = new Patient(patientId);
View Full Code Here

     * @throws Exception
     */
    @Test
    @Verifies(value = "should test labels generation for concept selects on dropdown options", method = "")
    public void getSectionNodes_shouldReturnDropdownForConceptSelects() throws Exception {
        Form form = new Form();
        HtmlForm htmlform = new HtmlForm();
        htmlform.setForm(form);
        form.setEncounterType(new EncounterType());
        htmlform.setDateChanged(new Date());
        htmlform.setXmlData(new TestUtil().loadXmlFromFile(XML_DATASET_PATH + "obsGroupDataExportTest.xml"));
        FormEntrySession session = new FormEntrySession(HtmlFormEntryUtil.getFakePerson(), htmlform, null);
        String xml = session.createForm(htmlform.getXmlData());
//        System.out.println(xml);
View Full Code Here

   * 'b': the 'ret' variable is a string representation of the schema where sections are enclosed
   * by parentheses (), and obsGroup members are enclosed by brackets [].
   */
  @Test
  public void shouldReturnObsGroupSchemaCorrectly() throws Exception {
    Form form = new Form();
    HtmlForm htmlform = new HtmlForm();
    htmlform.setForm(form);
    form.setEncounterType(new EncounterType());
    htmlform.setDateChanged(new Date());
    htmlform.setXmlData(new TestUtil().loadXmlFromFile(XML_DATASET_PATH + "obsGroupSchemaTest.xml"));
    FormEntrySession session = new FormEntrySession(HtmlFormEntryUtil.getFakePerson(), htmlform, null);
        session.getHtmlToDisplay();
    HtmlFormSchema hfs = session.getContext().getSchema();
View Full Code Here

  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));
    FormEntrySession session = new FormEntrySession(patient, null, FormEntryContext.Mode.ENTER, fakeForm, new MockHttpSession());
        session.setAttributes(getFormEntrySessionAttributes());
        session.getHtmlToDisplay();
    return session;
  }
View Full Code Here

  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));
    FormEntrySession session = new FormEntrySession(patient, encounter, FormEntryContext.Mode.VIEW, fakeForm, new MockHttpSession());
        session.setAttributes(getFormEntrySessionAttributes());
        session.getHtmlToDisplay();
    return session;
  }
View Full Code Here

  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));
    FormEntrySession session = new FormEntrySession(patient, encounter, FormEntryContext.Mode.EDIT, fakeForm, new MockHttpSession());
        session.setAttributes(getFormEntrySessionAttributes());
        session.getHtmlToDisplay();
    return session;
  }
View Full Code Here

TOP

Related Classes of org.openmrs.Form

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.