Skip to content

Update Amounts and Units for better sorting and filtering behavior#6994

Merged
cnathe merged 149 commits intodevelopfrom
fb_amountsAndUnits
Sep 15, 2025
Merged

Update Amounts and Units for better sorting and filtering behavior#6994
cnathe merged 149 commits intodevelopfrom
fb_amountsAndUnits

Conversation

@labkey-susanh
Copy link
Contributor

@labkey-susanh labkey-susanh commented Sep 2, 2025

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 StoredAmount and Units so 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

  • Upgrade script to convert existing amounts and units to base units, and drop any units that don't have values
  • Remove Measurement class in favor of Quantity and Units classes
  • Update detailed audit log to handle provided values that are converted before being stored
  • Update aliquot rollup logic to store values in base units
  • Remove recompute of rollup values when display unit is changed
  • Add SampleTypeAmountDisplayColumn and SampleTyepUnitDisplayColumn to display amount and units using chosen display units

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants