Skip to content

Weights and species reports - #13

Merged
labkey-martyp merged 5 commits into
release26.7-SNAPSHOTfrom
26.7_fb_weight_species_ranges
Aug 3, 2026
Merged

Weights and species reports#13
labkey-martyp merged 5 commits into
release26.7-SNAPSHOTfrom
26.7_fb_weight_species_ranges

Conversation

@labkey-martyp

Copy link
Copy Markdown
Contributor

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.

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.
<column columnName="taskid">
<isHidden>true</isHidden>
</column>
<!-- Re-declared from ehr/queries/study/assignment.query.xml; this file

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@labkey-martyp
labkey-martyp merged commit 3250f62 into release26.7-SNAPSHOT Aug 3, 2026
2 checks passed
@labkey-martyp
labkey-martyp deleted the 26.7_fb_weight_species_ranges branch August 3, 2026 03:35
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.

2 participants