Monday, October 29, 2012

OpenMRS Html Form Entry Module new features

The HTML Form Entry module gets new features with each and every new version of release to provide more functionalities to he users. The following is a simple note on the new features i was working on HFE module last few months.

1. HTML-348 : Allow checkbox styles for numeric observations

Earlier if a user need to enter numeric observations like numbers,quantities etc. there were only text boxes, drop down lists and radio buttons used in order to do it. With the new addition you can use checkboxes also to record numerical observations as well as to capture multiple numerical observations.

An example code segment in a form would be,

<obs conceptId="5497" answer="502" answerLabel="502" style="checkbox"/>
<obs conceptId="5497" answer="503" answerLabel="503" style="checkbox"/>
<obs conceptId="5497" answer="504" answerLabel="504" style="checkbox"/>

where it would generate this kind of a form as shown below.

2. HTML-92 : Handle checkbox style (multiple select) in single obs element

At past if a user needs to add two or more checkboxes as answers for a question concept it was needed to be defined one by one per each checkbox element as shown below.

<obs conceptId="1069" answerConceptId="664" answerLabel="No Complaints" style="checkbox" />
<obs conceptId="1069" answerConceptId="832" answerLabel="Weight Loss" style="checkbox" />
<obs conceptId="1069" answerConceptId="6029" answerLabel="Night Sweats" style="checkbox" />

However this is a tedious and time wasting job for the form designed therefore this new feature is added in order to provide the ability to define all the checkbox elements in a single tag definition.

The following is the format of how the new <repeat with=""> tag should be added in the html form.

<repeat with="[664,'No Complaints'], [832,'Weight Loss'],[5544,'Weight Gain']">
<obs conceptId="1069" answerConceptId="{0}" answerLabel="{1}" style="checkbox" />

An example form with multiple checkbox elements is as follows.

1 comment:

  1. Do you know how to set a radio button to selected? =D