-
Notifications
You must be signed in to change notification settings - Fork 0
[Bug] Fix Patient Search when patients have the same name #1396
[Bug] Fix Patient Search when patients have the same name #1396
Conversation
- Refactor `ComboBoxOption` to use the full option value instead of just the label - Default `defaultValue` and `defaultSearchTerm` for `ComboBoxField` - Remove unused imports
🦋 Changeset detectedLatest commit: c161b56 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
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.
makes sense
@Stephen-Tsen this may want to go into CTW repo instead! |
const option = e as ComboxboxFieldOption; | ||
setSearchTerm(option.label); | ||
setInputValue(option.value); | ||
onCustomSelectChange?.(option); |
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.
Call the callback with the entire option object for backwards compatibility.
The plan is to apply this same fix to the next app/monorepo, and in there I will change this line to call the callback with just the option's value.
I'll apply a slightly modified version of this to the monorepo |
Jira Ticket Number: CTW-1620
This PR fixes a bug in patient search when there are multiple patients with the same name. Previously the
ComboBoxOption
's value was the label, which comprised the patient's full name. When an option was selected, theComboBoxField
would use the label to look up the first occurrence in the results, so if there are 2 or more patients with the same full name, it would always return the first patient.Now the
ComboBoxOption
's value is the entire option so we can just return the option's value, which is theComboxboxFieldOption
object, to theonCustomSelectChange
callback.How did you test it?
Manually tested in the demo app.
Manually tested with relative dependancies in standalone.
How will you know that this is working after deployment?
Manually test in all environments