Uploaded image for project: 'XForms Module'
  1. XForms Module
  2. XFRM-72

Non-Javascript solution to apply validations between answers of two or more questions

    XMLWordPrintable

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Should
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Complexity:
      Medium
    • Sprint:
      Form Entry Q3 2013 Iteration 1

      Description

      AMPATH creates some of the concepts in non-traditional method. For example, instead of creating 10 questions of asking whether patients have any of those 10 symptoms, we would create two main questions of "presence of symptoms" and "absence of symptoms" since those 10 symptoms already exist in our data dictionary and we can use those 10 existing symptoms as coded answers for those two questions.

      The main reason of using this non-tradition method on creating concepts is to reduce the number of concepts created. However, it means we need to add conditional formatting to ensure that when coded symptom one from "presence of symptoms" is ticked, the same coded symptom one from "absence of symptoms" is disabled and vice versa.

      Currently, only javascript can help to apply such conditional formatting. We would need to have a non-javascript solution in xforms since this is one of the most frequent validations AMPATH use.


      I'm (Lauren Stanisic) adding some more information here. What we would like is the ability to apply validation between answers of different questions. Please see the attached example. What you see on the UI of the form is a series of yes/no questions. But, at the dictionary level, we actually only have two questions being asked here, 1) "Review of Medical History" & 2) "Negative Review of Medical History". I have attached these concepts, for your reference.

      The "yes" responses are actually responses to the first question, and the "no" responses are actually responses to the second question. While it appears that we have set these up as a series of 4 yes/no questions in our dictionary, we have actually set up as 2 multi-select questions. We preferred this approach to creating many yes/no questions in our dictionary.

      What we would like is for the answers to be validated against one another. So, for example, if "yes" is selected for "do you have a cough?", then the corresponding answer for the "no" response is disabled, and vice versa.

        Gliffy Diagrams

          Attachments

          1. concepts.docx
            18 kB
            Lauren Stanisic
          2. example.png
            13 kB
            Lauren Stanisic
          3. example.png
            5 kB
            Lauren Stanisic
          4. setting up validation.png
            167 kB
            Lauren Stanisic
          5. xforms-4.2.1.7.omod
            3.47 MB
            Daniel Kayiwa
          6. XForms-Test.xml
            364 kB
            Lauren Stanisic

            Activity

              People

              Assignee:
              dkayiwa Daniel Kayiwa
              Reporter:
              ayeung Ada Yeung
              Votes:
              2 Vote for this issue
              Watchers:
              9 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - 1 week
                  1w
                  Remaining:
                  Remaining Estimate - 1 week
                  1w
                  Logged:
                  Time Spent - Not Specified
                  Not Specified