HTML Form Entry Module
  1. HTML Form Entry Module
  2. HTML-348

Allow checkbox styles for numeric observations.

    Details

    • Type: New Feature New Feature
    • Status: Closed
    • Priority: Could Could
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: HTML Form Entry 2.0.1
    • Labels:
      None
    • Complexity:
      Undetermined

      Description

      Currently for numeric observations we allow a text box, single drop-down combo, or radio buttons. For the case where we want to capture multiple observations (and not use a text box), it would be nice to have style="checkbox" option.

        Gliffy Diagrams

          Issue Links

            Activity

            Hide
            Mark Goodrich added a comment -

            Thanks Ishara--

            I think for this ticket we will want to create support for the follow tag format:

            <obs conceptId="1234" answer="8" answerLabel="Eight" style="checkbox" />

            This would render a single checkbox with the label "Eight". If this checkbox is checked a obs will be created with conceptId="1234" and valueNumeric="8".

            Concept 1234 needs to be of type numeric or an exception should be thrown when attempting to render the form. (Theortically, we also could also text concepts and value_text to be entered here, but I think we should not allow this because this would be bad practice... answers should be always be coded if possible)

            You will want to work on the block in ObsSubmissionElement for handling numeric concepts that starts on line 276. At first glance, we probably want to create a new section that handles the case where style=checkbox and parameters.get("answer") != null. (Note that we will use "answer" here instead of "answers, which is used for dropdowns and radio sets)

            Also see my notes above about matching existing obs when reloading a form.

            Show
            Mark Goodrich added a comment - Thanks Ishara-- I think for this ticket we will want to create support for the follow tag format: <obs conceptId="1234" answer="8" answerLabel="Eight" style="checkbox" /> This would render a single checkbox with the label "Eight". If this checkbox is checked a obs will be created with conceptId="1234" and valueNumeric="8". Concept 1234 needs to be of type numeric or an exception should be thrown when attempting to render the form. (Theortically, we also could also text concepts and value_text to be entered here, but I think we should not allow this because this would be bad practice... answers should be always be coded if possible) You will want to work on the block in ObsSubmissionElement for handling numeric concepts that starts on line 276. At first glance, we probably want to create a new section that handles the case where style=checkbox and parameters.get("answer") != null. (Note that we will use "answer" here instead of "answers, which is used for dropdowns and radio sets) Also see my notes above about matching existing obs when reloading a form.
            Hide
            Ishara Premadasa added a comment -

            Hi Mark,

            This is the initial commit.

            https://github.com/ishara-p/openmrs-module-htmlformentry/commit/07808aac98d1dbcad9ffb1b8cf1f22b12ae47c52

            However at the moment it is possible to check more than one value from the group of checkboxes with an observation. Please let me know it it needs to be avoided plus if there any concerns to handle which i may haven't noticed at the moment.

            Thanks!
            Ishara

            Show
            Ishara Premadasa added a comment - Hi Mark, This is the initial commit. https://github.com/ishara-p/openmrs-module-htmlformentry/commit/07808aac98d1dbcad9ffb1b8cf1f22b12ae47c52 However at the moment it is possible to check more than one value from the group of checkboxes with an observation. Please let me know it it needs to be avoided plus if there any concerns to handle which i may haven't noticed at the moment. Thanks! Ishara
            Hide
            Mark Goodrich added a comment -

            Thanks Ishara... I'm a little backlogged right now, but should be able to look at this before the end of the week.

            Show
            Mark Goodrich added a comment - Thanks Ishara... I'm a little backlogged right now, but should be able to look at this before the end of the week.
            Hide
            Ishara Premadasa added a comment -

            Hi all,

            This is the second commit (unmerged) with the changed suggested by Mark.
            https://github.com/ishara-p/openmrs-module-htmlformentry/commit/2f47391d5f10e4dd620df61e369036cbf5449b94

            And here is the final commit with merging to the latest upstream. Pls verify and let me know if there are any concerns.
            https://github.com/ishara-p/openmrs-module-htmlformentry/commit/49f5fe2edc452a51c2c6a4950f476d33c5ba24d4

            Thanks!

            Show
            Ishara Premadasa added a comment - Hi all, This is the second commit (unmerged) with the changed suggested by Mark. https://github.com/ishara-p/openmrs-module-htmlformentry/commit/2f47391d5f10e4dd620df61e369036cbf5449b94 And here is the final commit with merging to the latest upstream. Pls verify and let me know if there are any concerns. https://github.com/ishara-p/openmrs-module-htmlformentry/commit/49f5fe2edc452a51c2c6a4950f476d33c5ba24d4 Thanks!
            Hide
            Mark Goodrich added a comment -

            Thanks Ishara!

            Show
            Mark Goodrich added a comment - Thanks Ishara!

              People

              • Assignee:
                Ishara Premadasa
                Reporter:
                Steven Githens
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Development