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

(feat) O3-2972: Validate number fields whose concepts don't allow decimal values #805

Merged
merged 2 commits into from
Apr 19, 2024

Conversation

denniskigen
Copy link
Member

@denniskigen denniskigen commented Apr 19, 2024

This PR adds validation to the Laboratory Test Results form that ensures fields of type number whose backing concepts don't allow decimal values show an error when decimals are typed in. For example, the backing concept for Platelets does not allow decimal values:

323766319-4f8adbca-0a73-43ea-9e0a-d77d5b705912

This validation logic was recently introduced to the Angular form engine here.

Video of the validation in practice

323767858-c0cd18ca-20f4-4dcb-8184-b04d5ba74d7d.mp4

This change solves this error shown when submitting the form after filling in values that lie within the related reference ranges for the backing concepts but without taking into account whether the fields support decimal values or not:

323768777-bca7dcfe-a046-482b-97ba-9f37b094def9

Related issue

https://openmrs.atlassian.net/browse/O3-2972

Other

I don't know what the versioning scheme in use here is. I've elected to increment the version by 1. More details about the issue are pointed out in this PR.

@denniskigen
Copy link
Member Author

denniskigen commented Apr 19, 2024

Also, @gracepotma, do you know why the Amylase (IU/L) question is included twice on the Chemistry page? Should I remove the second occurrence?

@ibacher
Copy link
Member

ibacher commented Apr 19, 2024

We can probably get rid of the second copy of the Amylase question. Form versioning is weird. Technically, the requirements are: the first character must be a number and each version should be unique, but since this changes things enough, bumping it to 3 seems called for.

@denniskigen denniskigen merged commit 37522da into main Apr 19, 2024
7 checks passed
@denniskigen denniskigen deleted the O3-2972 branch April 19, 2024 20:00
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.

2 participants