Examples of HtmlFormSchema


Examples of org.openmrs.module.htmlformentry.schema.HtmlFormSchema

    Patient p = HtmlFormEntryUtil.getFakePerson();
    HtmlForm fakeForm = new HtmlForm();
    fakeForm.setXmlData(xml);
        FormEntrySession fes = new FormEntrySession(p, null, Mode.ENTER, fakeForm, httpSession);
        fes.getHtmlToDisplay();
        HtmlFormSchema schema = fes.getContext().getSchema();
        model.addAttribute("schema", schema);
        model.addAttribute("message", message);
    }
View Full Code Here

Examples of org.openmrs.module.htmlformentry.schema.HtmlFormSchema

    private CapturingPrintWriter out;
    private SectionTagHandler handler;

    @Before
    public void before() throws Exception {
        htmlFormSchema = new HtmlFormSchema();

        formEntryContext = mock(FormEntryContext.class);
        when(formEntryContext.getSchema()).thenReturn(htmlFormSchema);

        formEntrySession = mock(FormEntrySession.class);
View Full Code Here

Examples of org.openmrs.module.htmlformentry.schema.HtmlFormSchema

    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();
    String ret = "";
    int count = 0;
    for (HtmlFormSection fes : hfs.getSections()) {
      ret += "section " + count + " (";
      for (HtmlFormField hff : fes.getFields()) {
        ret = shouldReturnObsGroupSchemaCorrectlyHelper(hff, count, ret);
      }
      ret += ") ";
View Full Code Here

Examples of org.openmrs.module.htmlformentry.schema.HtmlFormSchema

    private FormEntryContext context;
    private Map<String, String> params;

    @Before
    public void setUp() throws Exception {
        HtmlFormSchema schema = new HtmlFormSchema();
        Translator translator = new Translator() {
            @Override
            public String translate(String localeStr, String key) {
                return key;
            }
View Full Code Here

Examples of org.openmrs.module.htmlformentry.schema.HtmlFormSchema

     * @throws Exception
     */
    public static String generateColumnHeadersFromHtmlForm(HtmlForm form, List<String> extraCols, StringBuffer sb, List<PatientIdentifierType> pitList) throws Exception {
        FormEntrySession session = new FormEntrySession(HtmlFormEntryUtil.getFakePerson(), form, null); // session gets a null HttpSession
        session.getHtmlToDisplay();
        HtmlFormSchema hfs = session.getContext().getSchema();
       
        sb.
        append(DEFAULT_QUOTE).append("ENCOUNTER_ID").append(DEFAULT_QUOTE).append(DEFAULT_COLUMN_SEPARATOR).
        append(DEFAULT_QUOTE).append("ENCOUNTER_DATE").append(DEFAULT_QUOTE).append(DEFAULT_COLUMN_SEPARATOR).
        append(DEFAULT_QUOTE).append("ENCOUNTER_LOCATION").append(DEFAULT_QUOTE).append(DEFAULT_COLUMN_SEPARATOR).
        append(DEFAULT_QUOTE).append("ENCOUNTER_PROVIDER").append(DEFAULT_QUOTE).append(DEFAULT_COLUMN_SEPARATOR).
        append(DEFAULT_QUOTE).append("INTERNAL_PATIENT_ID").append(DEFAULT_QUOTE).append(DEFAULT_COLUMN_SEPARATOR);
        int index = 1;
        for (PatientIdentifierType pit :  pitList){
            sb.append(DEFAULT_QUOTE).append(pit.getName()).append(DEFAULT_QUOTE);
            if (index < pitList.size())
                sb.append(DEFAULT_COLUMN_SEPARATOR);
            index ++;
        }   
       
        for (HtmlFormField hfsec : hfs.getAllFields())
                sb = generateColumnHeadersFromHtmlFormHelper(hfsec, extraCols, sb);

        session = null;
        sb.append(DEFAULT_LINE_SEPARATOR);
        return sb.toString();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.