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



    • New Feature
    • Status: Closed
    • Should
    • Resolution: Fixed
    • None
    • None
    • Medium
    • Form Entry Q3 2013 Iteration 1


      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 (lstanisic) 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


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



              dkayiwa Daniel Kayiwa
              ayeung Ada Yeung
              2 Vote for this issue
              9 Start watching this issue



                Time Tracking

                  Original Estimate - 1 week
                  Remaining Estimate - 1 week
                  Time Spent - Not Specified
                  Not Specified