-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
import api: validate incorrect observation codes (#5303)
# Why Our OpenAPI schema validator is not flexible enough to capture some edge cases for observation resources–namely, it is possible to pass in a blood pressure observation, with the systolic or diastolic code specified twice. This will cause a failure at the database constraint level. We instead validate this at the time of a request so that the user is immediately informed of this error, and the request is not propagated any further. # The fix We add new validations in our Imports API validator class. Any observation resource must satisfy either one of these conditions: * It contains a single component that is a valid Blood Sugar measurement LOINC code. * It contains two components, one of which is a valid systolic BP measurement and the other is a valid diastolic BP measurement.
- Loading branch information
1 parent
80a065f
commit 8b60577
Showing
3 changed files
with
125 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters