-
-
Notifications
You must be signed in to change notification settings - Fork 152
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
Dynamic Analysis Specifications #1492
Merged
Merged
Conversation
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
Great functionality, this will make analysis specifications much easier to configure, manage and generally work with Kudos |
Match all columns of the dynamic analysis specification correctly
xispa
approved these changes
Jan 28, 2020
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.
Good stuff
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of the issue/feature this PR addresses
This PR adds the ability to link dynamic analysis specifications to the standard analysis specifications.
It is primarily meant to provide the basis for this requested functionality:
https://community.senaite.org/t/age-and-gender-based-specifications-in-senaite-health/102
Current behavior before PR
Analysis Specifications (Result Ranges) can be defined per Sample Type.
If different ranges are needed for Methods, Sample Points, Sample Conditions etc., different Analysis Specifications need to be created.
Desired behavior after PR is merged
An Excel file can be uploaded to a "Dynamic Analysis Specification" object.
This object can be linked to a common Analysis Specification for a given Sample Type.
In the Excel file the columns are used to match the values per row against the values of the Analysis or the Analysis Request. If all values match, the given result range will be used.
Example
Given is an Excel with the following minimal set of columns:
This Excel is uploaded to an Dynamic Analysis Specification object, which is linked to an Analysis Specification for the Sample Type "Water".
A new "Water" Sample is created with an containing
H2O
sample to be tested withMethod-2
.The results range selected will be
[3;4]
Supported Results Range columns
The following column names have to be chosen to define a valid results range:
warn_min, min, min_operator, warn_max, max, max_operator, error
Defining a custom Dynamic Results Range Adapter
Sometimes it is needed to define more complex matches, e.g. to match the Gender or Age of a Patient to find a specification. In that case, it is supported to define a custom Adapter like this:
Contents of
dynamicresultsrange.py
:--
I confirm I have tested this PR thoroughly and coded it according to PEP8
and Plone's Python styleguide standards.