google / android-fhir

The Android FHIR SDK is a set of Kotlin libraries for building offline-capable, mobile-first healthcare applications using the HL7® FHIR® standard on Android.
https://google.github.io/android-fhir/
Apache License 2.0
485 stars 286 forks source link

White space in Questionnaire form in data capture gallery app #967

Open anita-vadverao opened 2 years ago

anita-vadverao commented 2 years ago

Describe the bug White space in Questionnaire form in data capture gallery app

Component SDC gallery app

To Reproduce Steps to reproduce the behavior:

  1. Go to 'Data Capture gallery'
  2. Click on 'MyPAIN' form
  3. Scroll down to 'About My Treatments' section
  4. Observe white space

Expected behavior Large White space should not be there between question and answer

Screenshots Screenshot_2021-12-14-12-01-31-109 Screenshot_2021-12-14-12-01-25-983 Screenshot_2021-12-14-12-01-21-513

Smartphone (please complete the following information):

jingtang10 commented 2 years ago

this is the question in the questionnaire:

...
          "linkId": "8.1",
          "text": "Did it work?",
          "prefix": "Opioid medications (such as hydrocodone, oxycodone, codeine, morphine and fentanyl)",
...

The prefix is very long in this question. This has caused the prefix text view to take up the entire horizontal space, leaving no room to render the actual text which is quite short. This has caused the UI to misbehave.

However, reading the FHIR spec for this field: http://www.hl7.org/fhir/questionnaire-definitions.html#Questionnaire.item.prefix

The definition of prefix is: A short label for a particular group, question or set of display text within the questionnaire used for reference by the individual completing the questionnaire.

So this is clearly a misuse of the prefix field.

This is not blocking release. But we should figure out if we should do something about this. For example limit the horizontal space the prefix can take up. Or more aggressively, we could thrown an exception for prefixes that are too long (not in favour of this). Or we could do nothing (but some developers might be confused by the behavior).

jingtang10 commented 1 year ago

another possible solution is to make prefix and the label flow inline. so that a long perfix wouldn't squeeze the main question into a narrow column.