HTML Form Entry Multiple Numeric Observations

classic Classic list List threaded Threaded
5 messages Options
Steven Githens Steven Githens
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

HTML Form Entry Multiple Numeric Observations

Hello OpenMRS Dev,

I'm trying to implement part of a paper form that has a "circle all"
type of area that binds to a numeric concept, and haven't found the
right HTML Form Entry tag yet for that.

Essentially, I want:

<obs conceptId="9876" answers="1,2,3" answerLabels="1,2,3"
style="checkbox" />

So that multiple observations can be recorded for it, but it doesn't
look like we accept style="checkbox" yet for numeric obs?

I played with:

<obs conceptId="9876" answers="1" answerLabels="1" style="radio" />
<obs conceptId="9876" answers="2" answerLabels="2" style="radio" />
<obs conceptId="9876" answers="3" answerLabels="3" style="radio" />

Which sort of works, but they should really be checkboxes.

Cheers,
Steve

_________________________________________

To unsubscribe from OpenMRS Developers' mailing list, send an e-mail to [hidden email] with "SIGNOFF openmrs-devel-l" in the  body (not the subject) of your e-mail.

[mailto:[hidden email]?body=SIGNOFF%20openmrs-devel-l]
Darius Jazayeri-3 Darius Jazayeri-3
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: HTML Form Entry Multiple Numeric Observations

Hi Steve,

How about
<obs conceptId="9876" answerConceptId="1" style="checkbox" />
<obs conceptId="9876" answerConceptId="2" style="checkbox" />
<obs conceptId="9876" answerConceptId="3" style="checkbox" />

-Darius

On Tue, May 15, 2012 at 1:04 PM, Steven Githens <[hidden email]> wrote:
Hello OpenMRS Dev,

I'm trying to implement part of a paper form that has a "circle all" type of area that binds to a numeric concept, and haven't found the right HTML Form Entry tag yet for that.

Essentially, I want:

<obs conceptId="9876" answers="1,2,3" answerLabels="1,2,3" style="checkbox" />

So that multiple observations can be recorded for it, but it doesn't look like we accept style="checkbox" yet for numeric obs?

I played with:

<obs conceptId="9876" answers="1" answerLabels="1" style="radio" />
<obs conceptId="9876" answers="2" answerLabels="2" style="radio" />
<obs conceptId="9876" answers="3" answerLabels="3" style="radio" />

Which sort of works, but they should really be checkboxes.

Cheers,
Steve

_________________________________________

To unsubscribe from OpenMRS Developers' mailing list, send an e-mail to [hidden email] with "SIGNOFF openmrs-devel-l" in the  body (not the subject) of your e-mail.

[mailto:[hidden email]?body=SIGNOFF%20openmrs-devel-l]


[hidden email] from OpenMRS Developers' mailing list
Steven Githens Steven Githens
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: HTML Form Entry Multiple Numeric Observations

Hello!

The below doesn't work because it tries to use the answerConceptId too look up a concept rather than use the raw number as an answer.

I did try something simalar and from fiddling with it, and having taken a quick grep through the code, I don't *think* we support style=checkbox for numeric types at all.  If you use checkbox, it switches back to the default single selection combo box.

There are 2 images attached.  The one with CD4 combos is produced from:

<obs conceptId="5497" labelText="CD4" answers="100" answerLabels="100" style="checkbox"/>
<obs conceptId="5497" labelText="CD4" answers="500" answerLabels="500" style="checkbox"/>
<obs conceptId="5497" labelText="CD4" answers="1400" answerLabels="1400" style="checkbox"/>

Also, one interesting thing I've found from trying to use a number of seperate <obs/> tags with type radio, is that it get's a bit confused when it renders the screen to go back and view or edit an existing encounter. The observations are being recorded correctly in the database from the original form submission, but on the rerender, it correctly populates the smallest number in the recorded obs, but adds a decimal to the others and creates extra widgets for them.

For example, given the following markup and submitting a form with 1, 3, and 4 selected:

          <repeat>
            <template>
              <obs conceptId="7481" labelText="" answers="{num}.0" answerLabels="{num}" style="radio" />
            </template>
            <render num="1" /><render num="2" /><render num="3" /><render num="4" /><render num="5" /><render num="6" />
          </repeat>

Results in the other attached image where the 1 radio is refilled, but new entries are created for 3.0 and 4.0 rather than just using 3 and 4.

-Steve




On 05/15/2012 04:43 PM, Darius Jazayeri wrote:
Hi Steve,

How about
<obs conceptId="9876" answerConceptId="1" style="checkbox" />
<obs conceptId="9876" answerConceptId="2" style="checkbox" />
<obs conceptId="9876" answerConceptId="3" style="checkbox" />

-Darius

On Tue, May 15, 2012 at 1:04 PM, Steven Githens <[hidden email]> wrote:
Hello OpenMRS Dev,

I'm trying to implement part of a paper form that has a "circle all" type of area that binds to a numeric concept, and haven't found the right HTML Form Entry tag yet for that.

Essentially, I want:

<obs conceptId="9876" answers="1,2,3" answerLabels="1,2,3" style="checkbox" />

So that multiple observations can be recorded for it, but it doesn't look like we accept style="checkbox" yet for numeric obs?

I played with:

<obs conceptId="9876" answers="1" answerLabels="1" style="radio" />
<obs conceptId="9876" answers="2" answerLabels="2" style="radio" />
<obs conceptId="9876" answers="3" answerLabels="3" style="radio" />

Which sort of works, but they should really be checkboxes.

Cheers,
Steve

_________________________________________

To unsubscribe from OpenMRS Developers' mailing list, send an e-mail to [hidden email] with "SIGNOFF openmrs-devel-l" in the  body (not the subject) of your e-mail.

[mailto:[hidden email]?body=SIGNOFF%20openmrs-devel-l]


[hidden email] from OpenMRS Developers' mailing list


[hidden email] from OpenMRS Developers' mailing list

htmlformentry-radiobuttons.png (3K) Download Attachment
htmlformentry-radio-rounding.png (3K) Download Attachment
Darius Jazayeri-3 Darius Jazayeri-3
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: HTML Form Entry Multiple Numeric Observations

Oh, sorry, I'd misunderstood.

I think you're right that HFE doesn't support having a checkbox for a numeric value.

To me, what you're trying to do sounds like the wrong approach. If you've got distinct values that can be checked, those really should be coded concepts (I'm assuming that 1, 2, 3, 4, 5 are codes in a list...) and not numeric...

-Darius

On Wed, May 16, 2012 at 7:40 AM, Steven Githens <[hidden email]> wrote:
Hello!

The below doesn't work because it tries to use the answerConceptId too look up a concept rather than use the raw number as an answer.

I did try something simalar and from fiddling with it, and having taken a quick grep through the code, I don't *think* we support style=checkbox for numeric types at all.  If you use checkbox, it switches back to the default single selection combo box.

There are 2 images attached.  The one with CD4 combos is produced from:

<obs conceptId="5497" labelText="CD4" answers="100" answerLabels="100" style="checkbox"/>
<obs conceptId="5497" labelText="CD4" answers="500" answerLabels="500" style="checkbox"/>
<obs conceptId="5497" labelText="CD4" answers="1400" answerLabels="1400" style="checkbox"/>

Also, one interesting thing I've found from trying to use a number of seperate <obs/> tags with type radio, is that it get's a bit confused when it renders the screen to go back and view or edit an existing encounter. The observations are being recorded correctly in the database from the original form submission, but on the rerender, it correctly populates the smallest number in the recorded obs, but adds a decimal to the others and creates extra widgets for them.

For example, given the following markup and submitting a form with 1, 3, and 4 selected:

          <repeat>
            <template>
              <obs conceptId="7481" labelText="" answers="{num}.0" answerLabels="{num}" style="radio" />
            </template>
            <render num="1" /><render num="2" /><render num="3" /><render num="4" /><render num="5" /><render num="6" />
          </repeat>

Results in the other attached image where the 1 radio is refilled, but new entries are created for 3.0 and 4.0 rather than just using 3 and 4.

-Steve





On 05/15/2012 04:43 PM, Darius Jazayeri wrote:
Hi Steve,

How about
<obs conceptId="9876" answerConceptId="1" style="checkbox" />
<obs conceptId="9876" answerConceptId="2" style="checkbox" />
<obs conceptId="9876" answerConceptId="3" style="checkbox" />

-Darius

On Tue, May 15, 2012 at 1:04 PM, Steven Githens <[hidden email]> wrote:
Hello OpenMRS Dev,

I'm trying to implement part of a paper form that has a "circle all" type of area that binds to a numeric concept, and haven't found the right HTML Form Entry tag yet for that.

Essentially, I want:

<obs conceptId="9876" answers="1,2,3" answerLabels="1,2,3" style="checkbox" />

So that multiple observations can be recorded for it, but it doesn't look like we accept style="checkbox" yet for numeric obs?

I played with:

<obs conceptId="9876" answers="1" answerLabels="1" style="radio" />
<obs conceptId="9876" answers="2" answerLabels="2" style="radio" />
<obs conceptId="9876" answers="3" answerLabels="3" style="radio" />

Which sort of works, but they should really be checkboxes.

Cheers,
Steve

_________________________________________

To unsubscribe from OpenMRS Developers' mailing list, send an e-mail to [hidden email] with "SIGNOFF openmrs-devel-l" in the  body (not the subject) of your e-mail.

[mailto:[hidden email]?body=SIGNOFF%20openmrs-devel-l]


[hidden email] from OpenMRS Developers' mailing list


[hidden email] from OpenMRS Developers' mailing list


[hidden email] from OpenMRS Developers' mailing list
Mark Goodrich-2 Mark Goodrich-2
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: HTML Form Entry Multiple Numeric Observations

Steven—

 

 

Looks like a typo in our documentation.  Under Obs->Numeric it should read “You can also specify a constrained list of answers, as radio button or a dropdown (Since 1.6.1)”  I corrected this.

 

The radio set issue is a bug… it probably is doing a string comparison when repopulating the radio sets when it really should do a numeric comparison so that 3.0 = 3.  Can you enter a ticket for this?  Go ahead and attach the code snippet and the image to the ticket…

 

Thanks,

Mark

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Darius Jazayeri
Sent: Wednesday, May 16, 2012 11:18 AM
To: [hidden email]
Subject: Re: [OPENMRS-DEV] HTML Form Entry Multiple Numeric Observations

 

Oh, sorry, I'd misunderstood.

 

I think you're right that HFE doesn't support having a checkbox for a numeric value.

 

To me, what you're trying to do sounds like the wrong approach. If you've got distinct values that can be checked, those really should be coded concepts (I'm assuming that 1, 2, 3, 4, 5 are codes in a list...) and not numeric...

 

-Darius

 

On Wed, May 16, 2012 at 7:40 AM, Steven Githens <[hidden email]> wrote:

Hello!

The below doesn't work because it tries to use the answerConceptId too look up a concept rather than use the raw number as an answer.

I did try something simalar and from fiddling with it, and having taken a quick grep through the code, I don't *think* we support style=checkbox for numeric types at all.  If you use checkbox, it switches back to the default single selection combo box.

There are 2 images attached.  The one with CD4 combos is produced from:

<obs conceptId="5497" labelText="CD4" answers="100" answerLabels="100" style="checkbox"/>
<obs conceptId="5497" labelText="CD4" answers="500" answerLabels="500" style="checkbox"/>
<obs conceptId="5497" labelText="CD4" answers="1400" answerLabels="1400" style="checkbox"/>

Also, one interesting thing I've found from trying to use a number of seperate <obs/> tags with type radio, is that it get's a bit confused when it renders the screen to go back and view or edit an existing encounter. The observations are being recorded correctly in the database from the original form submission, but on the rerender, it correctly populates the smallest number in the recorded obs, but adds a decimal to the others and creates extra widgets for them.

For example, given the following markup and submitting a form with 1, 3, and 4 selected:

          <repeat>
            <template>
              <obs conceptId="7481" labelText="" answers="{num}.0" answerLabels="{num}" style="radio" />
            </template>
            <render num="1" /><render num="2" /><render num="3" /><render num="4" /><render num="5" /><render num="6" />
          </repeat>

Results in the other attached image where the 1 radio is refilled, but new entries are created for 3.0 and 4.0 rather than just using 3 and 4.

-Steve






On 05/15/2012 04:43 PM, Darius Jazayeri wrote:

Hi Steve,

 

How about

<obs conceptId="9876" answerConceptId="1" style="checkbox" />

<obs conceptId="9876" answerConceptId="2" style="checkbox" />

<obs conceptId="9876" answerConceptId="3" style="checkbox" />

 

-Darius

On Tue, May 15, 2012 at 1:04 PM, Steven Githens <[hidden email]> wrote:

Hello OpenMRS Dev,

I'm trying to implement part of a paper form that has a "circle all" type of area that binds to a numeric concept, and haven't found the right HTML Form Entry tag yet for that.

Essentially, I want:

<obs conceptId="9876" answers="1,2,3" answerLabels="1,2,3" style="checkbox" />

So that multiple observations can be recorded for it, but it doesn't look like we accept style="checkbox" yet for numeric obs?

I played with:

<obs conceptId="9876" answers="1" answerLabels="1" style="radio" />
<obs conceptId="9876" answers="2" answerLabels="2" style="radio" />
<obs conceptId="9876" answers="3" answerLabels="3" style="radio" />

Which sort of works, but they should really be checkboxes.

Cheers,
Steve

_________________________________________

To unsubscribe from OpenMRS Developers' mailing list, send an e-mail to [hidden email] with "SIGNOFF openmrs-devel-l" in the  body (not the subject) of your e-mail.

[mailto:[hidden email]?body=SIGNOFF%20openmrs-devel-l]

 


[hidden email] from OpenMRS Developers' mailing list

 


[hidden email] from OpenMRS Developers' mailing list

 


[hidden email] from OpenMRS Developers' mailing list


[hidden email] from OpenMRS Developers' mailing list
Loading...