Skip to content

PotentialDams Query Update#894

Closed
jallentxbiomed wants to merge 1 commit intorelease25.7-SNAPSHOTfrom
25.7_fb_addAnimalsWithDeparturesToPotentialDams
Closed

PotentialDams Query Update#894
jallentxbiomed wants to merge 1 commit intorelease25.7-SNAPSHOTfrom
25.7_fb_addAnimalsWithDeparturesToPotentialDams

Conversation

@jallentxbiomed
Copy link
Collaborator

Updated PotentialDams query to handle an edge case that includes animals that had an estimated conception date that landed after a disposition and before a re-acquisition but had a pregnancy confirmed in the system. New Animal Wizard was not displaying these animals in the dropdown even though they are legitimate and need to be added to the list.

  • Added SELECT DISTINCT because original query naturally had one row per animal but because conception date falls in a non overlapping acq_disp period
  • Added LEFT JOIN on study.pregnancyConfirmation to joing to a deduplicated list of animals with an active confirmed pregnancy record
  • Added checks in WHERE conditions to check if animal is on the pregnancy list but had an overlap with the new acquisition date

Validation:
Used a diagnostic query to confirm that all animals that were part of the original result set are in the new result set with no removals (7 unique animals were added to the list with the new query in dev environment)

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