From dbdcf1941ec3680a045c6823990dc508886ffd7c Mon Sep 17 00:00:00 2001
From: Ohsudev <76500320+Ohsudev@users.noreply.github.com>
Date: Tue, 7 Oct 2025 10:58:16 -0700
Subject: [PATCH 1/5] Created a new set of BSU Bulk Editing interface. (#1481)
* Created a new set of BSU Bulk Editing interface.
* Modified Pairing Bulk editing software tool to include the "category" reporting column.
* Modified Pairing Bulk editing software tool to include the "category" reporting column.
* Modified Pairing Bulk editing software tool to include the "category" reporting column.
* Modified Pairing Bulk editing software tool to include the "category" reporting column.
* Modified Pairing Bulk editing software tool to include the "category" reporting column.
---
onprc_ehr/resources/views/BSU_BulkEdit.html | 42 +++++++++++++++++++
.../resources/views/BSU_BulkEdit.view.xml | 5 +++
.../AbstractGenericONPRC_EHRTest.java | 1 +
.../test/tests/onprc_ehr/ONPRC_EHRTest2.java | 3 ++
4 files changed, 51 insertions(+)
create mode 100644 onprc_ehr/resources/views/BSU_BulkEdit.html
create mode 100644 onprc_ehr/resources/views/BSU_BulkEdit.view.xml
diff --git a/onprc_ehr/resources/views/BSU_BulkEdit.html b/onprc_ehr/resources/views/BSU_BulkEdit.html
new file mode 100644
index 000000000..37c9f1ad3
--- /dev/null
+++ b/onprc_ehr/resources/views/BSU_BulkEdit.html
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
+
+
diff --git a/onprc_ehr/resources/views/BSU_BulkEdit.view.xml b/onprc_ehr/resources/views/BSU_BulkEdit.view.xml
new file mode 100644
index 000000000..ef18febee
--- /dev/null
+++ b/onprc_ehr/resources/views/BSU_BulkEdit.view.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/onprc_ehr/test/src/org/labkey/test/tests/onprc_ehr/AbstractGenericONPRC_EHRTest.java b/onprc_ehr/test/src/org/labkey/test/tests/onprc_ehr/AbstractGenericONPRC_EHRTest.java
index f7ab9afe7..171787cc7 100644
--- a/onprc_ehr/test/src/org/labkey/test/tests/onprc_ehr/AbstractGenericONPRC_EHRTest.java
+++ b/onprc_ehr/test/src/org/labkey/test/tests/onprc_ehr/AbstractGenericONPRC_EHRTest.java
@@ -80,6 +80,7 @@ public abstract class AbstractGenericONPRC_EHRTest extends AbstractGenericEHRTes
protected static String[] ROOMS = {"Room1", "Room2", "Room3"};
protected static String[] CAGES = {"A1", "B2", "A3"};
protected static String[] CATEGORY = {"Divider Change", "Event", "STP_Beh"};
+ protected static String[] TINFANT = {"35160", "24456", "36451"};
@Override
public List getAssociatedModules()
diff --git a/onprc_ehr/test/src/org/labkey/test/tests/onprc_ehr/ONPRC_EHRTest2.java b/onprc_ehr/test/src/org/labkey/test/tests/onprc_ehr/ONPRC_EHRTest2.java
index 88f982ca3..5aab368ec 100644
--- a/onprc_ehr/test/src/org/labkey/test/tests/onprc_ehr/ONPRC_EHRTest2.java
+++ b/onprc_ehr/test/src/org/labkey/test/tests/onprc_ehr/ONPRC_EHRTest2.java
@@ -818,6 +818,7 @@ public void testPairingObservations() throws Exception
grid.setGridCell(1, "cage", "A1");
grid.setGridCellJS(1, "date", TIME_FORMAT.format(today));
grid.setGridCell(1, "category", CATEGORY[0]);
+ grid.setGridCell(1, "other_infant", TINFANT[0]);
_helper.addRecordToGrid(grid);
sleep(200);
@@ -827,6 +828,7 @@ public void testPairingObservations() throws Exception
grid.setGridCell(2, "cage", "A1");
grid.setGridCellJS(2, "date", TIME_FORMAT.format(today));
grid.setGridCell(2, "category", CATEGORY[0]);
+ grid.setGridCell(2, "other_infant", TINFANT[0]);
Assert.assertEquals(grid.getFieldValue(1, "pairid"), grid.getFieldValue(2, "pairid"));
@@ -843,6 +845,7 @@ public void testPairingObservations() throws Exception
grid.setGridCell(3, "cage", "A2");
grid.setGridCellJS(3, "date", TIME_FORMAT.format(today));
grid.setGridCell(3, "category", CATEGORY[0]);
+ grid.setGridCell(3, "other_infant", TINFANT[0]);
grid.setGridCell(3, "lowestcage", "A1");
sleep(100);
From cc37ed4a0fb83c13a493537c0dd7b68cba047bf5 Mon Sep 17 00:00:00 2001
From: Ohsudev <76500320+Ohsudev@users.noreply.github.com>
Date: Wed, 8 Oct 2025 19:56:05 -0700
Subject: [PATCH 2/5] 25.7 fb geographic origin bugfix (#1496)
* Removed program that automatically updates Birth's
geographic orgin that was based on demogrphic's
origin record updates
* Removed program that automatically updates Birth's
geographic orgin that was based on demogrphic's
origin record updates
* Removed program that automatically updates Birth's
geographic orgin that was based on demogrphic's
origin record updates
---
.../sqlserver/onprc_ehr-24.013-24.014.sql | 74 +++++++++++++++++++
.../scripts/onprc_ehr/onprc_triggers.js | 6 --
.../org/labkey/onprc_ehr/ONPRC_EHRModule.java | 2 +-
.../query/ONPRC_EHRTriggerHelper.java | 48 ------------
4 files changed, 75 insertions(+), 55 deletions(-)
create mode 100644 onprc_ehr/resources/schemas/dbscripts/sqlserver/onprc_ehr-24.013-24.014.sql
diff --git a/onprc_ehr/resources/schemas/dbscripts/sqlserver/onprc_ehr-24.013-24.014.sql b/onprc_ehr/resources/schemas/dbscripts/sqlserver/onprc_ehr-24.013-24.014.sql
new file mode 100644
index 000000000..cb3c9c4a9
--- /dev/null
+++ b/onprc_ehr/resources/schemas/dbscripts/sqlserver/onprc_ehr-24.013-24.014.sql
@@ -0,0 +1,74 @@
+
+
+/*
+**
+** Created by
+** Blasa 10/8/2025 Process to update birth record;s geogrphic origin data. The "Genetic Ancestry"
+** geographic_origin information must override the birth's geographic origin values.
+**
+
+**
+**
+**
+**
+*/
+
+CREATE Procedure onprc_ehr.p_BirthGeographicOriginUpdates
+
+ as
+
+
+BEGIN
+
+ ----- Process data
+
+ IF exists (select * From studydataset.c6d202_birth bir, studydataset.c6d512_geneticancestry b where bir.participantid = b.participantid
+ And b.enddate is null
+ and bir.qcstate = 18
+ and b.qcstate = 18
+ And bir.geographic_origin <> b.result
+ And b.result is not null
+ )
+
+
+
+ BEGIN
+
+ ---- Update birth geographic origin
+
+ Update bir
+ set bir.geographic_origin = b.result,
+ bir.modified = getdate(),
+ bir.modifiedby = b.modifiedby ---- ancestry staff
+
+ From studydataset.c6d202_birth bir, studydataset.c6d512_geneticancestry b
+ where bir.participantid = b.participantid
+ And b.enddate is null
+ And bir.qcstate = 18
+ And b.qcstate = 18
+ And bir.geographic_origin <> b.result
+ And b.result is not null
+
+
+ If @@Error <> 0
+ GoTo Err_Proc
+
+END ---- if
+
+
+
+
+
+RETURN 0
+
+
+ Err_Proc:
+ -------Error Generated, process stopped
+ RETURN 1
+
+
+END
+
+GO
+
+
diff --git a/onprc_ehr/resources/scripts/onprc_ehr/onprc_triggers.js b/onprc_ehr/resources/scripts/onprc_ehr/onprc_triggers.js
index a9bf2573a..ff0d25cfe 100644
--- a/onprc_ehr/resources/scripts/onprc_ehr/onprc_triggers.js
+++ b/onprc_ehr/resources/scripts/onprc_ehr/onprc_triggers.js
@@ -1348,12 +1348,6 @@ exports.init = function(EHR){
}
});
});
- EHR.Server.TriggerManager.registerHandlerForQuery(EHR.Server.TriggerManager.Events.BEFORE_UPSERT, 'study', 'demographics', function (helper, scriptErrors, row, oldRow) {
- if (row.Id && row.geographic_origin) {
- //update birth records
- triggerHelper.updateBirthGeographics(row.Id, row.geographic_origin);
- }
- });
//Added: 10-4-2022 R.Blasa
EHR.Server.TriggerManager.registerHandler(EHR.Server.TriggerManager.Events.COMPLETE, function(event, errors, helper){
diff --git a/onprc_ehr/src/org/labkey/onprc_ehr/ONPRC_EHRModule.java b/onprc_ehr/src/org/labkey/onprc_ehr/ONPRC_EHRModule.java
index ef99b9f4c..87ec2d89b 100644
--- a/onprc_ehr/src/org/labkey/onprc_ehr/ONPRC_EHRModule.java
+++ b/onprc_ehr/src/org/labkey/onprc_ehr/ONPRC_EHRModule.java
@@ -129,7 +129,7 @@ public String getName()
@Override
public @Nullable Double getSchemaVersion()
{
- return 24.013;
+ return 24.014;
}
@Override
diff --git a/onprc_ehr/src/org/labkey/onprc_ehr/query/ONPRC_EHRTriggerHelper.java b/onprc_ehr/src/org/labkey/onprc_ehr/query/ONPRC_EHRTriggerHelper.java
index 3a89b057c..b7d72a105 100644
--- a/onprc_ehr/src/org/labkey/onprc_ehr/query/ONPRC_EHRTriggerHelper.java
+++ b/onprc_ehr/src/org/labkey/onprc_ehr/query/ONPRC_EHRTriggerHelper.java
@@ -2634,54 +2634,6 @@ public void exec(ResultSet object) throws SQLException
}
- public void updateBirthGeographics(String id, String geographic_origin) throws Exception
- {
- TableInfo ti = getTableInfo("study", "birth");
- if (ti == null)
- {
- return;
- }
-
- Set keys = new HashSet<>();
- keys.add(FieldKey.fromString("Id"));
- keys.add(FieldKey.fromString("geographic_origin"));
- keys.add(FieldKey.fromString("lsid"));
- final Map colMap = QueryService.get().getColumns(ti, keys);
-
-
- final List