Skip to content

Derive observation type from its category and fix cagemate matching - #29

Open
labkey-martyp wants to merge 2 commits into
release26.7-SNAPSHOTfrom
26.7_fb_derive_observation_type
Open

Derive observation type from its category and fix cagemate matching#29
labkey-martyp wants to merge 2 commits into
release26.7-SNAPSHOTfrom
26.7_fb_derive_observation_type

Conversation

@labkey-martyp

Copy link
Copy Markdown
Contributor

Rationale

Two independent fixes, to observation entry and to cagemate matching. The Observations form let a user pick any observation type but stored every entry as Clinical, so behavior observations recorded there were filed as clinical and dropped out of the behavior views; the form cannot know the right value up front because it depends on which type the user picks for each row, so the type is now derived on save from that type's category. The behavior forms had the same mismatch from the other direction: their Daily Observations shortcut bypassed the type-filtered picker and wrote clinical-category observations labeled as behavior. Separately, the cagemates query treated a housing row with no cage as though it were a location, so every animal whose location had not resolved was reported as a cagemate of every other.

Rows already saved with a mismatched observation type need a one-time data fix; this change only affects new entries.

Related Pull Requests

None.

Changes

  • The Observations form no longer defaults an observation's type. The trigger script derives it from the selected observation type's category, while every other form continues to set the type explicitly, including scheduled entries that inherit it from their order.

  • The Daily Observations shortcut is now opt-in per form section rather than always present, so it appears only on the clinical forms.

  • Cagemate matching now keys off active housing rows with a known cage.

The Observations form offers every observation type, so it cannot set the observation's type up front and stored everything as Clinical, dropping behavior observations out of the behavior views; the trigger script now derives the type from the selected type's category. The Daily Observations shortcut becomes opt-in per form section so it appears only on the clinical forms. Rows already saved with a mismatched type need a one-time data fix.
A row with no cage never resolved to a location, so every unresolved row grouped together as each other's cagemates.
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.

1 participant