Update Amounts and Units for better sorting and filtering behavior#6994
Merged
Update Amounts and Units for better sorting and filtering behavior#6994
Conversation
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.
Rationale
Our original implementation for the StoredAmount and Units columns added display columns over the user-provided data so the application grid displays used consistent units, but left the values as provided by users. Since we accept values in different, compatible units, this results in sorting and filtering on these columns not behaving as one would expect (e.g, samples with amounts of 2 mL and 2 L will be sorted next to each other, though displayed as 2 mL and 2000 mL in the grid).
This work update our handling of
StoredAmountandUnitsso they always store values in the base units for sample types that have display units. This provides us with a valid basis for sorting and filtering.We also are updating the processing of data to always require that the user provides both StoredAmount and Units when either of these values is provided.
Related Pull Requests
Changes
Measurementclass in favor ofQuantityandUnitsclassesSampleTypeAmountDisplayColumnandSampleTyepUnitDisplayColumnto display amount and units using chosen display units