-
Notifications
You must be signed in to change notification settings - Fork 306
Add custom callback for autocomplete #2764
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Add custom callback for autocomplete #2764
Conversation
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
callbacks = mapOf(Pair(CustomCallbackType.AUTO_COMPLETE, AutoCompleteCallback( | ||
callback = { query -> | ||
run { | ||
listOf(AutoCompleteViewAnswerOption("a", "Type 2 Diabetes Mellitus"), | ||
AutoCompleteViewAnswerOption("b", "Test") | ||
) | ||
} | ||
} | ||
))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
on line 51, other than the query, I think we also need the value set resolver url to be passed in the API.
the url will be provided by the questionnaire item, what it does that it can point to a terminology server to retrieve the option lists, then the query will filter that lists so we can have less options to process
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think what fikri meant is tha tthe url should be passed as another parameter besides the query string itself. otherwise how do we distinguish different valueset searches?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah good point. I will make this change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @dilys-l! A couple of questions below.
callbacks = mapOf(Pair(CustomCallbackType.AUTO_COMPLETE, AutoCompleteCallback( | ||
callback = { query -> | ||
run { | ||
listOf(AutoCompleteViewAnswerOption("a", "Type 2 Diabetes Mellitus"), | ||
AutoCompleteViewAnswerOption("b", "Test") | ||
) | ||
} | ||
} | ||
))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think what fikri meant is tha tthe url should be passed as another parameter besides the query string itself. otherwise how do we distinguish different valueset searches?
datacapture/src/main/java/com/google/android/fhir/datacapture/QuestionnaireEditAdapter.kt
Outdated
Show resolved
Hide resolved
catalog/src/main/java/com/google/android/fhir/catalog/CatalogApplication.kt
Outdated
Show resolved
Hide resolved
datacapture/src/main/java/com/google/android/fhir/datacapture/QuestionnaireEditAdapter.kt
Outdated
Show resolved
Hide resolved
datacapture/src/main/java/com/google/android/fhir/datacapture/DataCaptureConfig.kt
Outdated
Show resolved
Hide resolved
datacapture/src/main/java/com/google/android/fhir/datacapture/DataCaptureConfig.kt
Outdated
Show resolved
Hide resolved
...in/java/com/google/android/fhir/datacapture/views/factories/AutoCompleteViewHolderFactory.kt
Outdated
Show resolved
Hide resolved
- Combined functionality with the ExternalAnswerValueSetResolver - Renamed various functions and arguments for improved clarity - Moved filter handling out of the adapter and into the textChangedListener - Moved resolver to the viewmodel
bdaff86
to
1adc09e
Compare
e69ecaa
to
2c14713
Compare
IMPORTANT: All PRs must be linked to an issue (except for extremely trivial and straightforward changes).
Fixes #2738
Description
Adds the ability for the client to pass a custom callback to AutoComplete for dynamic AutoComplete answer resolution
Alternative(s) considered
NA
Type
Feature
Screenshots (if applicable)
Checklist
./gradlew spotlessApply
and./gradlew spotlessCheck
to check my code follows the style guide of this project../gradlew check
and./gradlew connectedCheck
to test my changes locally.