-
Notifications
You must be signed in to change notification settings - Fork 13
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
Result calculations #9
Comments
@keeganskeate You need help on any of these issues? Don't want to hop on anything that is already in progress |
Actually yes @colman-hartinger, help on some of these issues would be awesome. Some of the issues, such as this one, can be approached piecemeal and utilized later on through the API / user interface. The functionality needed here is to apply a user-defined formula to measurements recorded for each sample. For example, given the following sample measurements, sample results need to be calculated. Example measurement data points: # measurement
measurement = {
'measurement_id': 'xyz',
'sample_id': 'abc',
'mass': 0.5,
'dilution_factor': 200,
'metrics': [
{'analyte': 'thca', 'measurement': 100, 'formula': ''},
{'analyte': 'cbda', 'measurement': 30, 'formula': ''},
.
.
.
]
} Possible usage: results = cannlytics.lims.calculations.apply_calculation(measurement) Desired results: # results
results = {
'result_id': 'mnop',
'measurement_id': 'xyz',
'sample_id': 'abc',
'mass': 0.5,
'dilution_factor': 200,
'metrics': [
{'analyte': 'thca', 'measurement': 100, 'formula': '', 'result': 15, 'units': 'percent'},
{'analyte': 'cbda', 'measurement': 30, 'formula': '', 'result': 3, 'units': 'percent'},
.
.
.
]
} Where the formula calculates the result. In most cases, the formula will be: (measurement x dilution_factor x 10000) / mass It would be nice (not necessary) for the formula to be customizable by the user. For example, the formula for total_thc = thc + 0.877 * thca Finally, you can designate result status as
Thank you for starting your contributions and definitely let me know where you end up diving in. |
User-defined logic for result calculations is needed.
status='Pass'
) or fails (status='Fail'
) screening. If any analyte in a analyses fails, thenstatus
is set toFail
in the sample results. Each failing analyte is recorded with the analyte's results in ametrics
field in a sample's results model.The text was updated successfully, but these errors were encountered: