msupply-foundation / unified-codes

Provides a curated, searchable list of pharmaceutical products, each with an immutable code. A GraphQL API, a REST API and website are available for interaction with the database.
https://codes.msupply.foundation
2 stars 0 forks source link

Warning function for correct formatting for Standard units when adding units #598

Open louisaw123 opened 7 months ago

louisaw123 commented 7 months ago

Currently is easy to get formatting incorrect for strength (e.g., entering 1mg/ml instead of 1mg per mL)

Expected Behaviour

would be helpful to maybe have a suggested feature if standard formatting does not appear to follow the correct formatting abbreviation or otherwise a warning about the formatting for example if someone has typed in 10mg/ml ... "Did you mean 10mg per mL"

lache-melvin commented 7 months ago

Would it be better to have an error show up if the user inputs the strength with an unknown format, or just have a dropdown of standard unit type options?

for ref: these were in the original SOP:

cm
g
g per L
g per mL
IU
IU per L
IU per mL
kg
L
mcg
mcg per mL
mEq
mEq per mL
mg
mg per mL
mg per min
mL
mm
mmol
mmol per L
mmol per mL
ng
ng per L
ng per mL
vp per mL
louisaw123 commented 7 months ago

dropdown could be nice to prevent errors like if we could select the dropdown option and then fill the numbers in. maybe have the default to something like

1mg per ml
1g per L 1IU per mL

in the dropdown with the first number filled in as 1 and then it would be enough to prompt them to know what the formatting is?

lache-melvin commented 7 months ago

Yeah definitely - I think it could be a number input field, and then a dropdown next to it with the units