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

Vitals Form with metric display setting does not show correct values from saved input due to imprecise precision saving #5473

Closed
adunsulag opened this issue Jun 13, 2022 · 2 comments · Fixed by #5494

Comments

@adunsulag
Copy link
Sponsor Member

On the vitals form if you have your Global settings of Locale->Units for Visit Forms set to Show metric only, and you put in a vitals observation value that has an Imperial (United States customary units) conversion with more than two digits of precision, it will not display as the same value when you go back to edit the form.

This occurs because we store all OpenEMR vital observation values as imperial units in the database even though we display them as metric. For example if you put in a value of 177 cm for the height observation, save the value and come back and edit the vitals form again, you will see the height value is now 177.01 cm. In the database the value is saved as 69.69 inches when it should be saved as 69.685 inches for a correct conversion. A celsius temperature of 38, when edited again shows, 37.99.

We either need to store more precision values in the database or store the actual metric value in the database to avoid these kinds of errors.

@adunsulag
Copy link
Sponsor Member Author

@bradymiller Any thoughts on changing the precision to save as 3 or even 4 digit values in the database here? Any ramifications that I should be aware of for making this change?

In our ONC tests we are fine due to the blessing of rounding, but when I go to visually show this as part of our b1 tests, this is going to be a problem.

@bradymiller
Copy link
Sponsor Member

@adunsulag , agree with more precision (more digits the better :) ). Wouldn't expect anything to break with this change.

adunsulag added a commit to DiscoverAndChange/openemr that referenced this issue Jun 15, 2022
Increased the decimal precision from 2 digit to 6 digits in the database
for form_vitals.  Our metric conversion was not giving back the same
values to the user as what they were entering in.  Much of this was due
to the conversion precision of just 2 digits.

Also MySQL is deprecating the float(X,N) data type and so we changed to
the decimal format to make this work.  Note that upgrades will need to
be done in off hours here as we are dropping the database columns to
handle the conversion.

Changed up the vitals conversion javascript so we could have a hidden
input that contains the 6 digit precision for metric / us conversion
purposes but only shows the two digit value to the user to keep the
interface clean and less confusing.

precision to users
adunsulag added a commit that referenced this issue Jun 16, 2022
Increased the decimal precision from 2 digit to 6 digits in the database
for form_vitals.  Our metric conversion was not giving back the same
values to the user as what they were entering in.  Much of this was due
to the conversion precision of just 2 digits.

Also MySQL is deprecating the float(X,N) data type and so we changed to
the decimal format to make this work.  Note that upgrades will need to
be done in off hours here as we are dropping the database columns to
handle the conversion.

Changed up the vitals conversion javascript so we could have a hidden
input that contains the 6 digit precision for metric / us conversion
purposes but only shows the two digit value to the user to keep the
interface clean and less confusing.

precision to users
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 a pull request may close this issue.

2 participants