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
463 stars 241 forks source link

Clear all action on Questionnaire #2221

Closed ellykits closed 6 months ago

ellykits commented 8 months ago

Is your feature request related to a problem? Please describe. We'd like to reset all the answered fields in the questionnaires via a Clear all action.

Describe the solution you'd like

The "Clear all" function will remove all the answer items for the "current" QuestionnaireResponse when the questionnaire is being used actively.

Describe alternatives you've considered None

Additional context In order to filter the content of our registers (list of resources) we opted to re-use the UI rendered via Questionnaires instead of implementing custom UI to capture the content for the filter. As part of the requirement, a "Clear all" action is required to reset all the data filter fields".

See the screenshot below, the Questionnaire is the second screen in the pic.

image (1)

Would you like to work on the issue? Yes

santosh-pingle commented 7 months ago

@ellykits Can you please create separate issue to configure Submit Button text?

ellykits commented 7 months ago

@santosh-pingle Done here https://github.com/google/android-fhir/issues/2239

santosh-pingle commented 6 months ago

I will work on this issue.

fredhersch commented 6 months ago

Thanks @santosh-pingle I have assiged you.

santosh-pingle commented 6 months ago

@ellykits @jingtang10 Could you please confirm if the 'Clear All' button is associated with the application's user interface and not linked specifically to the questionnaire? We're mainly interested in ensuring we support the functionality or API required to clear the questionnaire response.

ellykits commented 6 months ago

The request is to support the API to allow clearing of Questionnaire answers. The UI shared was an illustration of how we plan to use it.

jingtang10 commented 6 months ago

@ellykits the screenshot in your issue description is about filtering and not clearing answers. can you attach the right screenshot please?

jingtang10 commented 6 months ago

i don't think it's clear to us right now if the clear all button should be in the questionnaire or outside the questionnaire. if we consider the submit button we have, we actually have one version inside the questionnaire controlled by a setting but also have the api so that if there's a button outside the questionnaire the application can still call the api... should we do the same for clear all?

jingtang10 commented 6 months ago

the only question about it being inside is that i don't know where it should be in the questionnaire... the bottom navigation is already busy with previous, next and submit buttons. so maybe we can start from building the clearAll api...

jingtang10 commented 6 months ago

@ellykits please can you comment on my above points? thx

@rowo fyi

ellykits commented 6 months ago

@jingtang10 We need the Clear All API which exposes the functionality to the implementers. No UI changes is necessary.

ellykits commented 6 months ago

In the issue description, the screenshot with the 'Clear All' button is in the middle. I provided the images for context . And as you can see, we implemented the button UI in our code.

FikriMilano commented 6 months ago

@rowo @shelaghm Any recommendations on where to put the 'clear all' button within a questionnaire screen?

For consideration: the bottom nav bar is already full with previous, next, and submit button.

ellykits commented 6 months ago

I'm currently on leave. Kindly follow up with @dubdabasoduba or Allan from Ona for any clarifications. Thanks.

FikriMilano commented 6 months ago

@dubdabasoduba @allan-on Can you clarify how are we going to trigger the exposed clearAll() API? I'm assuming it's from outside the questionnaire.

allan-on commented 6 months ago

Hi @FikriMilano @jingtang10 We already have the "Clear All" button already defined on our end (as part of our QuestionnaireActivity) The button's visibility is configurable.

filter_questionnaire

We'll make the call to the API to clear all QuestionnaireResponse items from our listener implementation (in the Activity).

Hence EllyKits' comment 👇🏾

@jingtang10 We need the Clear All API which exposes the functionality to the implementers. No UI changes is necessary.