Add birth, arrival and conception lookups and relax entry validation - #6
Open
labkey-martyp wants to merge 10 commits into
Open
Add birth, arrival and conception lookups and relax entry validation#6labkey-martyp wants to merge 10 commits into
labkey-martyp wants to merge 10 commits into
Conversation
Adds birth condition, delivery mode and conception breeding type, recodes the source and pregnancy result lookups to alpha codes with the arrival and departure foreign keys following, and relaxes required-field validation on the arrival and birth entry forms for bulk data loads.
Project and protocol are now entered through the Project Assignment and Protocol Assignment sections rather than as fields on the birth and arrival forms, and demographics source is read from the arrival record instead of its own demographics column. Species and gender reference data is replaced with the codes NBRI uses, and group status and status code lookups are registered.
…fb_birth_arrival_updates
Breeding type describes the birth rather than the conception, so the column moves from the conception table to the birth dataset and entry form. The lookup also gains a project breeding value and switches the not-assigned code from 0 to O.
Offspring are aggregated per conception so multiple births for one conception don't duplicate rows.
The Births section gains a Start with Conception button that adds a row carrying the conception's Id, dam, sire and the dam's species. Its columns are also reordered, with Id, birth date, conception Id, species and sex now required.
testBirthForm now starts its record from the conception window and checks the copied values, column order, required conception Id and breeding type. testConceptionForm covers the Estimated flag and that breeding type moved to the birth form. Also corrects test data that no longer matched its lookup: the species code and the source facility name.
The protocol combo rendered blank items because ehr.protocol's title column is not returned by the activeProtocols query, so its display column has to be named explicitly. ehr.project's investigatorId had no lookup at all, which broke the EHR project field's query for the investigator's last name.
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
Adds the fields and lookup codes needed to bulk load historical birth, arrival and conception records into the NBRI EHR. The legacy source system keys its source, species and pregnancy-outcome lookups by short alpha codes rather than the numeric placeholders the module was seeded with, so those lookups have to be recoded before incoming values will resolve. The historical records also predate several of the required-field rules on the current entry forms.
Related Pull Requests
None.
Changes
Add birth condition, delivery mode and breeding type to the birth record, and an estimated-date flag to conception.
Recode the source, species and pregnancy outcome lookups to the alpha codes used by the source system, and point the arrival and departure lookups at them.
Surface the task and status columns on the conception grid, with the standard status highlighting, and report a conception's offspring alongside its outcome.
Add a Start with Conception action to the birth form that seeds a new birth record from an existing conception, inferring the newborn's species from the dam.
Move project and protocol entry on the arrival and birth forms into dedicated assignment sections, which relaxes animal Id validation for animals that have no demographics record yet.
Relax required-field validation on the arrival and birth entry forms so historical records can be loaded. These rules are left in place as commented-out code so they can be restored once the loads are done.
The conception estimated-date flag is added to the in-flight 26.7 schema script rather than a new one, so servers that already ran it need a bootstrap.