Skip to content
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

Feature/doseunitautoselector #60

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

DereckGeorge
Copy link
Collaborator

@DereckGeorge DereckGeorge commented Jan 18, 2025

Members
Dereck George Tano 2022-04-12872
Ashiraf B Issa 2022-04-02746
Megan Bwire 2022-04-00977
Yasinter Sylvester mayalla 2022-04-06747
Irene Donatus Gadiye 2022-04-01997

Key Changes:
Dosing Unit Selection Logic:

When a drug is selected, the drug name is analyzed to determine the appropriate dosing unit (e.g., "mg", "Capsules", "tablets", "ml").

The dosing unit is prioritized based on a predefined order: ["mg", "Capsules", "tablets", "ml"].

The selected dosing unit is then passed to the unit-field component to update the dropdown.

Integration with unit-field Component:

The unit-field component now accepts a selectedValue input, which is used to set the initial value of the dropdown.

The dropdown is populated with the available dosing units, and the selected unit is highlighted based on the drug name.

Form Updates:

The formValues object is updated to include the selected dosing unit, ensuring that the form reflects the correct unit when the drug is selected.

How Dosing Units are Pulled:
The dosing units are fetched from the dosingUnits$ observable, which provides a list of available units (e.g., answers or setMembers from the API response).

The drug name is matched against the available dosing units to determine the most appropriate unit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant