-
Notifications
You must be signed in to change notification settings - Fork 336
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
add DenominationValidator to validate dosage fields in Prescription model #1716
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #1716 +/- ##
==========================================
- Coverage 60.75% 60.48% -0.28%
==========================================
Files 210 210
Lines 11533 11498 -35
Branches 1644 1636 -8
==========================================
- Hits 7007 6954 -53
- Misses 4285 4310 +25
+ Partials 241 234 -7 ☔ View full report in Codecov by Sentry. |
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.
Maybe we could have made it more generic as DenominationValidator
and wherever dosage is there we could initialize the validator with:
dosage_validator = DenominationValidator(
min=0.0001,
max=5000,
allowed_units={"mg", "g", "ml", "drop(s)", "ampule(s)", "tsp"},
)
Proposed Changes
Associated Issue
Merge Checklist
/docs
Only PR's with test cases included and passing lint and test pipelines will be reviewed
@coronasafe/care-backend-maintainers @coronasafe/care-backend-admins