Weights and species reports - #13
Merged
labkey-martyp merged 5 commits intoAug 3, 2026
Merged
Conversation
Module query metadata is not merged: only the first matching file is used and dependent modules sort first, so nbri_ehr's study metadata replaced ehr's outright and dropped percentChange, relChange, CoAssignments, TotalRoommates and refRange. TotalRoommates uses lsid rather than ehr's objectid, which names a column study.housingTotalRoommates does not expose and leaves the join silently unresolved.
weight_ranges.tsv listed the display names Cynomolgus and Rhesus, which verifyWeightRange never matches against demographics.species; it now uses CMO, MCY, MMU and MNE with per-species bounds. The new ehr_lookups/weight_ranges.query.xml adds the species_codes lookup, and lookupsManifest.tsv loads species and species_codes.
ehr_lookups.weight_ranges is now keyed on species codes, so the test subjects and the expected out-of-range message have to use codes too.
The reference demographics carried integer placeholders for species and gender, which match no lookup entry. Convert them to species_codes and gender_codes values, assigning sex by parental role where the data records one, and move TEST3804589 to CMO so its weights sit inside the range now keyed to its species.
labkey-bpatel
approved these changes
Aug 3, 2026
| <column columnName="taskid"> | ||
| <isHidden>true</isHidden> | ||
| </column> | ||
| <!-- Re-declared from ehr/queries/study/assignment.query.xml; this file |
There was a problem hiding this comment.
what is re-declared, the "CoAssignments" column?
"this file" as in assignment.query.xml?
there are more such comments in .query.xml files below - wondering if they are necessary.
Contributor
Author
There was a problem hiding this comment.
yeah I actually trimmed down those comments a lot. They were a lot longer. It's just redeclaring since this overrides the EHR version of this .query.xml. I'll shorten them further.
This file contains hidden or 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
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
This PR sets up NBRI weight and species reporting. Weight validation never fired, because the weight ranges lookup was keyed on species common names while demographics records hold species codes, so no animal ever matched a range. NBRI's query metadata files also replace the ehr module's rather than merging with them, so several wrapped lookup columns that the ehr-supplied views depend on had silently disappeared from NBRI tables.
Related Pull Requests
None.
Changes
Key the weight ranges on species codes, and load the species lookups those codes resolve against.
Re-declare the wrapped lookup columns that NBRI's query metadata was dropping so the ehr-supplied views resolve again, and correct a metadata file that named the wrong table.
Convert the test subjects and the reference sample data from placeholder species and sex values to real lookup codes, and update the weight validation expectation to match the new ranges.