-
Notifications
You must be signed in to change notification settings - Fork 1
Add Bulk Deaths form and death type lookup; harden the deaths trigger #11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
labkey-martyp
merged 5 commits into
release26.7-SNAPSHOT
from
26.7_fb_bulk_death_departure
Aug 3, 2026
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
2695717
Add Bulk Deaths form and death type lookup, fix departure destination fk
labkey-martyp 1962aab
Harden the deaths trigger against duplicate and unknown-animal rows
labkey-martyp 608a1af
Remove stray quote that left study.aliases unparseable
labkey-martyp bc64ce7
Handle an optional weight in upsertWeightRecord
labkey-martyp 51ec18e
Merge remote-tracking branch 'ORIGIN/release26.7-SNAPSHOT' into 26.7_…
labkey-martyp File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| value title sort_order | ||
| A Experimental 1 | ||
| D Spontaneous/Normal 2 | ||
| F Fetal 3 | ||
| FD Fetal Death 4 | ||
| FL Fetal Live 5 | ||
| FN Fetal found at necropsy 6 | ||
| FX Fetal experimental 7 | ||
| K Cull (scheduled) 8 | ||
| M Medical cull (non-scheduled) 9 | ||
| ND Non-vaginal (C-section) dead 10 | ||
| NT Not pregnant at assessment 11 | ||
| S Cull 12 | ||
| X Experimental 13 |
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
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
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
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
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| /* | ||
| * Copyright (c) 2026 LabKey Corporation | ||
| * | ||
| * Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0 | ||
| */ | ||
| /** | ||
| * Metadata for the grid-based Bulk Deaths form. The columnConfig widths only take effect in the grid; they are ignored | ||
| * when the same fields render in a form panel. | ||
| */ | ||
| EHR.model.DataModelManager.registerMetadata('Death', { | ||
| allQueries: { | ||
| }, | ||
| byQuery: { | ||
| 'study.deaths': { | ||
| qcstate: { | ||
| hidden: true | ||
| }, | ||
| date: { | ||
| xtype: 'xdatetime', | ||
| editorConfig: { | ||
| dateFormat: 'Y-m-d', | ||
| timeFormat: 'H:i' | ||
| }, | ||
| columnConfig: { | ||
| width: 160 | ||
| } | ||
| }, | ||
| deathWeight: { | ||
| label: 'Weight (kg)', | ||
| columnConfig: { | ||
| width: 150 | ||
| } | ||
| }, | ||
| type: { | ||
| allowBlank: false, | ||
| nullable: false, | ||
| columnConfig: { | ||
| width: 160 | ||
| } | ||
| }, | ||
| reason: { | ||
| columnConfig: { | ||
| width: 160 | ||
| } | ||
| }, | ||
| remark: { | ||
| xtype: 'ehr-remarkfield', | ||
| columnConfig: { | ||
| width: 200 | ||
| } | ||
| } | ||
| } | ||
| } | ||
| }); |
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
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
66 changes: 66 additions & 0 deletions
66
nbri_ehr/src/org/labkey/nbri_ehr/dataentry/form/NBRIBulkDeathFormType.java
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,66 @@ | ||
| /* | ||
| * Copyright (c) 2026 LabKey Corporation | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
| package org.labkey.nbri_ehr.dataentry.form; | ||
|
|
||
| import org.labkey.api.ehr.EHRService; | ||
| import org.labkey.api.ehr.dataentry.DataEntryFormContext; | ||
| import org.labkey.api.ehr.dataentry.FormSection; | ||
| import org.labkey.api.ehr.security.EHRCompletedInsertPermission; | ||
| import org.labkey.api.module.Module; | ||
| import org.labkey.api.security.permissions.AdminPermission; | ||
| import org.labkey.api.view.template.ClientDependency; | ||
| import org.labkey.nbri_ehr.dataentry.section.BaseFormSection; | ||
| import org.labkey.nbri_ehr.dataentry.section.NBRIAnimalDetailsFormSection; | ||
| import org.labkey.nbri_ehr.dataentry.section.NBRITaskFormSection; | ||
|
|
||
| import java.util.Arrays; | ||
|
|
||
| /** | ||
| * Admin-only form that records deaths only, as a grid so several animals can be entered at once. | ||
| */ | ||
| public class NBRIBulkDeathFormType extends NBRIBaseTaskFormType | ||
| { | ||
| public static final String NAME = "BulkDeaths"; | ||
| public static final String LABEL = "Bulk Deaths"; | ||
|
|
||
| public NBRIBulkDeathFormType(DataEntryFormContext ctx, Module owner) | ||
| { | ||
| super(ctx, owner, NAME, LABEL, "Colony Management", Arrays.asList( | ||
| new NBRITaskFormSection(), | ||
| new NBRIAnimalDetailsFormSection(), | ||
| new BaseFormSection("study", "deaths", "Deaths", EHRService.FORM_SECTION_LOCATION.Body, true, false) | ||
| )); | ||
|
|
||
| addClientDependency(ClientDependency.supplierFromPath("nbri_ehr/model/sources/Death.js")); | ||
|
|
||
| for (FormSection s : getFormSections()) | ||
| { | ||
| s.addConfigSource("Death"); | ||
| } | ||
| } | ||
|
|
||
| @Override | ||
| public boolean isAvailable() | ||
| { | ||
| return super.isAvailable() && getCtx().getContainer().hasPermission(getCtx().getUser(), AdminPermission.class); | ||
| } | ||
|
|
||
| @Override | ||
| protected boolean canInsert() | ||
| { | ||
| return EHRService.get().hasPermission("study", "deaths", getCtx().getContainer(), getCtx().getUser(), EHRCompletedInsertPermission.class); | ||
| } | ||
| } |
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like this comment needs to be updated to match the client workflow.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will update this comment in my next PR