opensrp / fhircore

FHIR Core / OpenSRP 2 is a Kotlin application for delivering offline-capable, mobile-first healthcare project implementations from local community to national and international scale using FHIR and WHO Smart Guidelines on Android.
https://smartregister.org
Apache License 2.0
50 stars 39 forks source link

Implement pre-poluation of questionnaire choice items (checkboxes) #3303

Closed Rkareko closed 3 weeks ago

Rkareko commented 4 weeks ago

Describe the feature request.

Pre-poluation of Questionnaires for edit works by specifying the type as EDIT in the QuestionnaireConfig . This works for cases where all the required information resides in the corresponding QuestionnaireResponse

There is a usecase that has a questionnaire for adding/removing conditions. These conditions are represented in the questionnaire using mulit-select checkboxes. There catch being that the conditions are recorded using different questionnaires/workflows. In such a scenario it is currently (to the best of my knowledge) not possible to pre-populate all these conditions from the various forms into the add/remove conditions questionnaire.

The enhancement would allow the implementer to define the codes for answer options to be selected in the multi-select questionnaire.

Sample answer item for multi-select choice item

      "linkId": "48842ef9-2a3e-47bf-9d2a-10356b1dbaf9",
      "text": "Diagnosis",
      "answer": [
        {
          "valueCoding": {
            "code": "flu",
            "display": "Flu",
            "system": "urn:uuid:03853086-97f5-4939-ee9e-394fb2da1994"
          }
        },
        {
          "valueCoding": {
            "code": "malaria",
            "display": "Malaria",
            "system": "urn:uuid:03853086-97f5-4939-ee9e-394fb2da1994"
          }
        }
      ]
    }

Sample answer item for single-select choice item

      "linkId": "6f9b6286-14a3-4971-f1ba-9d881b2891b7",
      "text": "Accept",
      "answer": [
        {
          "valueCoding": {
            "code": "yes",
            "display": "Yes",
            "system": "urn:uuid:1210e494-c320-479f-8c14-739b17bb3583"
          }
        }
      ]
    }

Acceptance criteria Ability to pre-populate multi-select checkbox items from resources that were created from processing different questionnaires.

Implementation plan (For Engineers)