Dynamic Autocomplete Widget And DynamicRepeat Tag

Dynamic Autocomplete Widget And DynamicRepeat Tag

Note that this page refers to a Google Summer of Code project that has not been incorporated into the main Html Form Entry line--so this feature is not currently avaiable.  Please see the Html Form Entry reference guide to for the list of currently available tags: HTML Form Entry Module HTML Reference

For details about this project, see: 

Error rendering macro 'jira' : Unable to locate Jira server for this macro. It may be due to Application Link configuration.

(This is an enhancement to the HTML FormEntry.You would have to be a familiar with the implementation and functionality of HTML FormEntry to understand the "How did i do" section's)

What does this do?

In HTML FormEntry  you have to specify all the field's in the form in it's design phase and after it is saved it is similar to a printed paper. Consider an example of an intake form in which you need to fill out the symptoms of a patient and only a couple of text boxes are given and the symptoms are four, what do we do?? we write the extra symptoms below the text boxes.This enhancement helps you exactly in the same way by letting you write the symptoms while filling the form.If there are many form elements that need to be repeated then the second part would help duplicating them dynamically.

What are these:

As the heading of this page suggests, we are having two different tags.

(i) Dynamic Autocomplete Widget.

(ii) Dynamic Repeat Tag.

First one being enhancement to the autocomplete widget and the second is an independent tag.

Though both are providing similar functionality, they have different applications.

1.Dynamic Autocomplete Widget


You can try out the following code(go to administration->manage HTML forms->New HTML form->(give some example data) and save-> just select the whole code below and paste it in the text area provided in the page )  For Dynamic Autocomplete Functionality:

<htmlform>
    <macros>
        paperFormId = (Fill this in)
        headerColor =#009d8e
        fontOnHeaderColor = white
    </macros>

<style>

.section {
            border: 1px solid $headerColor;
            padding: 2px;
            text-align: left;
            margin-bottom: 1em;
        }
        .sectionHeader {
            background-color: $headerColor;
            color: $fontOnHeaderColor;
            display: block;
            padding: 2px;
            font-weight: bold;
       }
        table.baseline-aligned td {
            vertical-align: baseline;
        }   

    </style>

 <span style="float:right">Paper Form ID: $paperFormId</span>
    <h2>sample (v1)</h2>

    <section headerLabel="1. Encounter Details">
        <table>
            <tr>
                <td>Date:</td>
                <td><encounterDate default="today"/></td>
            </tr>
            <tr>
                <td>Location:</td>
                <td><encounterLocation/></td>
            </tr>
            <tr>
                <td>Provider:</td>
                <td><encounterProvider/></td>
            </tr>
        </table>
<fieldset>
    <legend>Symptoms:</legend>
        <obs conceptId="1272" answerClasses="Symptom,Finding" style="autocomplete" selectMulti="true"/>
</fieldset>
    </section>

    <section headerLabel="2. Demographic Information">
        <table>
            <tr>
                <td>Name:</td>
                <td><lookup expression="patient.personName"/></td>
            </tr>
            <tr>
                <td>Old Identification Number:</td>
                <td><lookup complexExpression="#foreach( $patId in $patientIdentifiers.get('Old Identification Number') ) $patId #end "/></td>
            </tr>
            <tr>
                <td>OpenMRS Identification Number:</td>
                <td><lookup complexExpression="#foreach( $patId in $patientIdentifiers.get('OpenMRS Identification Number') ) $patId #end "/></td>
            </tr>
            <tr>
                <td>Gender:</td>
                <td><lookup expression="patient.gender"/></td>
            </tr>
            <tr>
                <td>Birthdate:</td>
                <td>
                    <lookup complexExpression="#if( \$patient.birthdateEstimated ) ~#end"/> <lookup expression="patient.birthdate"/>
                    (Age: <lookup expression="patient.age"/>)
                </td>
            </tr>
        </table>
    </section>