Form is not showing in openMRS UI

Tags: #<Tag:0x00007fe6dce43f20> #<Tag:0x00007fe6dce43db8>

Hi There I have created a form using HTML FORM ENTRY module for openMRS, below is the code and picture of Form. Now the problem is that i want to know that where this form will be shown.

<style type="text/css">
    #who-when-where {
        margin-bottom: 6px;
        border-bottom: 1px solid #ccc;
    }

    #who-when-where p {
        display: inline-block;
        padding-right: 20px;
    }

    #where > input[type=text] {
        display: inline-block;
    }

    .field-error {
        color: #ff6666;
        font-size: 1.1em;
        display: block;
    }

    <ifMode mode="VIEW" include="false">
        #data-collection {
            display: inline-block;
            width: 58%;
            vertical-align: top;
        }

        #encounter-diagnoses-target {
            display: inline-block;
            width: 40%;
            vertical-align: top;
        }

        #encounter-diagnoses-app {
            margin-bottom: 20px;
        }
    </ifMode>
</style>

<ifMode mode="VIEW" include="false">
    <h2>Lab Test</h2>

    <div id="who-when-where">
        <p id="who">
            <label><uimessage code="coreapps.patientDashBoard.provider"/></label>
            <span><encounterProvider default="currentUser" required="true"  /></span>
        </p>
        <p id="when">
            <label><uimessage code="coreapps.patientDashBoard.location"/></label>
            <span><encounterLocation default="SessionAttribute:emrContext.sessionLocationId"/></span>
        </p>
        <p id="where">
            <label><uimessage code="coreapps.patientDashBoard.date"/></label>
            <span><encounterDate id="encounterDate" default="now" /></span>
        </p>
    </div>
</ifMode>

<div id="data-collection">

  

    <p>
       <label>Enter Lab Test Codes</label>
        <obs conceptId="CIEL:162169" style="textarea" rows="1"/>
    </p>

</div>

<div id="encounter-diagnoses-target">
</div>

<ifMode mode="VIEW" include="false">
    <div id="buttons">
        <submit submitClass="confirm right" submitCode="general.save"/>
        <button type="button" class="cancel"><uimessage code="general.cancel"/></button>
    </div>
</ifMode>

I want my form to be shown somewhere here! like there is s form of visit note. @reagan

@meullah the htmlformentryui module along with the UI framework will help you show your html form in the openmrs UI

1 Like

Hello @meullah I see you have made good progress already…After creating your form it will automatically appear in the legacy ui which you can test out by following the following steps.

  1. Go to the legacy ui and search for any patient and select them
  2. Select the tab labelled FORM ENTRY and you should be able to see the form which u can then use I have provided an example here with a new form I created called Vitals2

However we have moved away from using legacy to the more elegant ui provided in version 2.x which am guessing you would love to use too. Now this takes alittle bit of configuration and the steps are as follows after creating the form

  1. on the homepage Go to configure metadata
  2. Then manage Forms
  3. You can then add your file by clicking Add which will redirect you to configure some variables and in your case you may want to select Current Visit Actions in the UI Location as shown below… You should be able to see your form now in the current visit actions now

With that being said you can do more customisation of the form by checking out managing Forms and conditional display of apps

Happy Coding…

2 Likes

OMG!!! it worked Thanks @reagan :grinning:, i will also check out other links you have provided.

1 Like