From 58e849c90824c86904f371f342cb03e8c6043898 Mon Sep 17 00:00:00 2001 From: Marty Pradere Date: Tue, 22 Sep 2026 15:24:02 -0600 Subject: [PATCH 1/3] Lock the case Id once a saved case is loaded The Edit button re-enabled every field on the case panel, including the animal Id. It now stays disabled for a case that already exists, across the Clinical/Behavioral Cases and Clinical/Behavioral Rounds forms. --- nirc_ehr/resources/web/nirc_ehr/field/EditCase.js | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/nirc_ehr/resources/web/nirc_ehr/field/EditCase.js b/nirc_ehr/resources/web/nirc_ehr/field/EditCase.js index ca82a78e..dff6631f 100644 --- a/nirc_ehr/resources/web/nirc_ehr/field/EditCase.js +++ b/nirc_ehr/resources/web/nirc_ehr/field/EditCase.js @@ -74,10 +74,14 @@ Ext4.define('NIRC_EHR.form.EditCases', { fieldEnableChange: function(disable){ var panel = this.up('panel'); panel.items.each(function(item){ - if (item.name != 'objectid'){ - this.disableItem(item, disable); - this.disabledDisplay(item, disable); - } + if (item.name === 'objectid') + return; + + // A saved case stays bound to its animal, so Edit must never reopen the Id. + var itemDisable = disable || (this.editing && item.name === 'Id'); + + this.disableItem(item, itemDisable); + this.disabledDisplay(item, itemDisable); }, this); }, @@ -93,11 +97,11 @@ Ext4.define('NIRC_EHR.form.EditCases', { }, onCaseSelect: function(){ + this.editing = true; this.fieldEnableChange(true); if (this.readonly) { return; } - this.editing = true; this.disabled = true; this.editBtn.show(); }, From 9f0a6e6f219bb18a42525eded5e7648ed9ea7f07 Mon Sep 17 00:00:00 2001 From: Marty Pradere Date: Tue, 22 Sep 2026 15:30:18 -0600 Subject: [PATCH 2/3] Allow the necropsy tasks default view to be overridden --- nirc_ehr/resources/queries/nirc_ehr/necropsyTasks/.qview.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nirc_ehr/resources/queries/nirc_ehr/necropsyTasks/.qview.xml b/nirc_ehr/resources/queries/nirc_ehr/necropsyTasks/.qview.xml index 908527e7..ef613fe0 100644 --- a/nirc_ehr/resources/queries/nirc_ehr/necropsyTasks/.qview.xml +++ b/nirc_ehr/resources/queries/nirc_ehr/necropsyTasks/.qview.xml @@ -1,4 +1,4 @@ - + From fa4cf00607e842048ff7204853e9512823f3c8dc Mon Sep 17 00:00:00 2001 From: Marty Pradere Date: Tue, 22 Sep 2026 16:34:43 -0600 Subject: [PATCH 3/3] Surface the arrival attachment file at the end of the grids The attachment file column is no longer hidden on study.arrival. It sorts last and renders wider in both the Arrivals and Rearrivals grids; the birth date column is wider too. --- .../resources/queries/study/arrival.query.xml | 1 - .../web/nirc_ehr/model/sources/Arrival.js | 10 +++++++++- .../web/nirc_ehr/model/sources/Rearrival.js | 5 +++++ .../section/NIRCArrivalFormSection.java | 4 ++++ .../section/NIRCRearrivalFormSection.java | 16 ++++++++++++++++ 5 files changed, 34 insertions(+), 2 deletions(-) diff --git a/nirc_ehr/resources/queries/study/arrival.query.xml b/nirc_ehr/resources/queries/study/arrival.query.xml index 3b8933b1..5054e517 100644 --- a/nirc_ehr/resources/queries/study/arrival.query.xml +++ b/nirc_ehr/resources/queries/study/arrival.query.xml @@ -30,7 +30,6 @@ - true 80 diff --git a/nirc_ehr/resources/web/nirc_ehr/model/sources/Arrival.js b/nirc_ehr/resources/web/nirc_ehr/model/sources/Arrival.js index 25e29fc9..f6f4b367 100644 --- a/nirc_ehr/resources/web/nirc_ehr/model/sources/Arrival.js +++ b/nirc_ehr/resources/web/nirc_ehr/model/sources/Arrival.js @@ -39,7 +39,10 @@ EHR.model.DataModelManager.registerMetadata('Arrival', { allowBlank: false }, 'Id/demographics/birth': { - allowBlank: false + allowBlank: false, + columnConfig: { + width: 150 + } }, 'Id/demographics/gender': { allowBlank: false @@ -107,6 +110,11 @@ EHR.model.DataModelManager.registerMetadata('Arrival', { allowBlank: true, hidden: true, showInGrid: false + }, + attachmentFile: { + columnConfig: { + width: 150 + } } } } diff --git a/nirc_ehr/resources/web/nirc_ehr/model/sources/Rearrival.js b/nirc_ehr/resources/web/nirc_ehr/model/sources/Rearrival.js index 94ae9c4c..6e50ab81 100644 --- a/nirc_ehr/resources/web/nirc_ehr/model/sources/Rearrival.js +++ b/nirc_ehr/resources/web/nirc_ehr/model/sources/Rearrival.js @@ -80,6 +80,11 @@ EHR.model.DataModelManager.registerMetadata('Rearrival', { columns: 'protocol,title' }, }, + attachmentFile: { + columnConfig: { + width: 150 + } + }, } } }); diff --git a/nirc_ehr/src/org/labkey/nirc_ehr/dataentry/section/NIRCArrivalFormSection.java b/nirc_ehr/src/org/labkey/nirc_ehr/dataentry/section/NIRCArrivalFormSection.java index 73107cc6..088e6cd0 100644 --- a/nirc_ehr/src/org/labkey/nirc_ehr/dataentry/section/NIRCArrivalFormSection.java +++ b/nirc_ehr/src/org/labkey/nirc_ehr/dataentry/section/NIRCArrivalFormSection.java @@ -49,6 +49,10 @@ protected List getFieldKeys(TableInfo ti) keys.add(10, FieldKey.fromString("Id/demographics/gender")); keys.add(12, FieldKey.fromString("Id/demographics/geographic_origin")); + FieldKey attachmentFile = FieldKey.fromString("attachmentFile"); + if (keys.remove(attachmentFile)) + keys.add(attachmentFile); + return keys; } } diff --git a/nirc_ehr/src/org/labkey/nirc_ehr/dataentry/section/NIRCRearrivalFormSection.java b/nirc_ehr/src/org/labkey/nirc_ehr/dataentry/section/NIRCRearrivalFormSection.java index fd5728bf..9c66170f 100644 --- a/nirc_ehr/src/org/labkey/nirc_ehr/dataentry/section/NIRCRearrivalFormSection.java +++ b/nirc_ehr/src/org/labkey/nirc_ehr/dataentry/section/NIRCRearrivalFormSection.java @@ -16,7 +16,11 @@ package org.labkey.nirc_ehr.dataentry.section; import org.json.JSONObject; +import org.labkey.api.data.TableInfo; import org.labkey.api.ehr.dataentry.DataEntryFormContext; +import org.labkey.api.query.FieldKey; + +import java.util.List; public class NIRCRearrivalFormSection extends BaseFormSection { @@ -32,4 +36,16 @@ public JSONObject toJSON(DataEntryFormContext ctx, boolean includeFormElements) json.put("dataDependentCollapseHeader", true); return json; } + + @Override + protected List getFieldKeys(TableInfo ti) + { + List keys = super.getFieldKeys(ti); + + FieldKey attachmentFile = FieldKey.fromString("attachmentFile"); + if (keys.remove(attachmentFile)) + keys.add(attachmentFile); + + return keys; + } }