Package org.openmrs

Examples of org.openmrs.EncounterType


    htmlForm.setName("testForm");
    htmlForm.setXmlData(xml);
   
    Form form = Context.getFormService().getForm(1);
    //set the encounter type on the form for testing purposes
    EncounterType encType = Context.getEncounterService().getEncounterType(1);
    Assert.assertNotNull(encType);
    form.setEncounterType(encType);
    htmlForm.setForm(form);
   
    Errors errors = new BindException(htmlForm, "htmlForm");
View Full Code Here


    @Verifies(value = "should recognize and return section tags in xml", method = "getSectionNodes(HtmlForm)")
    public void getSectionNodes_shouldReturnSectionNodesCorrectly() 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 + "returnSectionsAndConceptsInSectionsTestForm.xml"));
        Map<Integer, String> map = HtmlFormEntryExportUtil.getSectionIndex(htmlform);
        String st = "";
        for (Map.Entry<Integer, String> e : map.entrySet()){
View Full Code Here

    @Verifies(value = "should return section as a new htmlform", method = "getSectionAsForm(HtmlForm)")
    public void getSectionAsForm_shouldReturnStringCorrectly() 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 + "returnSectionsAndConceptsInSectionsTestForm.xml"));
        String newXml = HtmlFormEntryExportUtil.getSectionAsFormXml(htmlform, 1);
        //System.out.println(newXML);
        htmlform.setXmlData(newXml);
View Full Code Here

    @Verifies(value = "should return trimmed encounter", method = "trimEncounterToMatchForm(Encounter e, HtmlForm htmlform)")
    public void trimEncounterToMatchForm_shouldReturnEncounterCorrectly() 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"));
        String newXml = HtmlFormEntryExportUtil.getSectionAsFormXml(htmlform, 0);
        htmlform.setXmlData(newXml);
       
View Full Code Here

    @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

    @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

    @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

    @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

    @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

   * @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

TOP

Related Classes of org.openmrs.EncounterType

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.