diff --git a/onprc_ehr/resources/etls/AvailableBlood.xml b/onprc_ehr/resources/etls/AvailableBlood.xml
index 7b7445389..3f31cab19 100644
--- a/onprc_ehr/resources/etls/AvailableBlood.xml
+++ b/onprc_ehr/resources/etls/AvailableBlood.xml
@@ -10,6 +10,6 @@
-
+
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/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/resources/web/onprc_ehr/model/sources/ASB_Services.js b/onprc_ehr/resources/web/onprc_ehr/model/sources/ASB_Services.js
index a89c3edfd..45ff89712 100644
--- a/onprc_ehr/resources/web/onprc_ehr/model/sources/ASB_Services.js
+++ b/onprc_ehr/resources/web/onprc_ehr/model/sources/ASB_Services.js
@@ -54,8 +54,9 @@ EHR.model.DataModelManager.registerMetadata('ASB_Services', {
schemaName: 'onprc_ehr',
queryName: 'ASB_SpecialInstructions',
displayColumn: 'value',
- // columns: 'value'
- keyColumn: 'value'
+ keyColumn: 'value',
+ filterArray: [
+ LABKEY.Filter.create('dateDisabled', null, LABKEY.Filter.Types.ISBLANK)]
},
columnConfig: {
width: 300
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/notification/AvailableBloodVolumeNotification.java b/onprc_ehr/src/org/labkey/onprc_ehr/notification/AvailableBloodVolumeNotification.java
index b2b1625cb..0623164f9 100644
--- a/onprc_ehr/src/org/labkey/onprc_ehr/notification/AvailableBloodVolumeNotification.java
+++ b/onprc_ehr/src/org/labkey/onprc_ehr/notification/AvailableBloodVolumeNotification.java
@@ -11,6 +11,7 @@
import org.labkey.api.query.QueryService;
import org.labkey.api.security.User;
+import java.util.Calendar;
import java.util.Date;
@@ -32,9 +33,14 @@ public String getEmailSubject(Container c)
{
return "Available Blood Volume Alert: " + getDateTimeFormat(c).format(new Date());
}
- /* From Hugh Crank:
+
+ /* Mathematica push:
* Server mkt7: Runs at :55 from 4:55am to 7:55pm
* Server mkt8: Runs at :25 from 4:25am to 7:25pm
+ *
+ * ABV ETL:
+ * :05 and :35 after the hour for hours between 05:00 and 20:00
+ * 0 1,31 5-20 ? * * *
*/
@Override
public String getCronString()
@@ -45,44 +51,52 @@ public String getCronString()
@Override
public String getScheduleDescription()
{
- return "15 minutes after every hour between 06:15 and 19:15.";
+ return "15 min past every hour from 06:15 to 19:15.";
}
@Override
public String getDescription()
{
- return "Sends an alert on status of Available Blood Volume data from Mathematica.";
+ return "Sends status of available blood volume data from Mathematica.";
}
@Override
public String getMessageBodyHTML(Container c, User u)
{
StringBuilder msg = new StringBuilder();
-
- AvailableBloodCheck(c, u, msg);
-
+ availableBloodCheck(c, u, msg);
return msg.toString();
}
- /* jonesga 5/8/2024 labkeyPublic.labkeyPublic.ValidateAvailableBloodProcess
- */
- protected void AvailableBloodCheck(final Container c, User u, final StringBuilder msg)
+
+ protected void availableBloodCheck(final Container c, User u, final StringBuilder msg)
{
- SimpleFilter filter = new SimpleFilter(FieldKey.fromString("date"), new Date(), CompareType.DATE_GTE);
- TableInfo ti = QueryService.get().getUserSchema(u, c, "onprc_ehr").getTable("ValidateAvailableBloodProcess", ContainerFilter.Type.AllFolders.create(c, u));
-// ((ContainerFilterable) ti).setContainerFilter(ContainerFilter.Type.AllFolders.create(u);
- TableSelector ts = new TableSelector(ti, null, null);
+ Calendar cal = Calendar.getInstance();
+ cal.add(Calendar.HOUR, -1);
+ Date staleTime = cal.getTime();
+
+ TableInfo ti = QueryService.get().getUserSchema(u, c, "onprc_ehr").getTable("AvailableBloodVolume", ContainerFilter.Type.AllFolders.create(c, u));
+ if (ti == null)
+ {
+ msg.append("ERROR: Unable to access onprc_ehr.AvailableBloodVolume table.
\n");
+ return;
+ }
+
+ SimpleFilter filter = new SimpleFilter(FieldKey.fromString("datecreated"), staleTime, CompareType.LTE);
+ TableSelector ts = new TableSelector(ti, filter, null);
long count = ts.getRowCount();
+
if (count > 0)
{
- msg.append("The available blood volume data from Mathematica is stale.
\n");
- msg.append("Click here to view labkeyPublic.AvailableBloodVolume.
\n\n");
- msg.append("
");
+ msg.append("WARNING: The available blood volume data from Mathematica is stale (last updated more than 1 hour ago).
\n");
+ msg.append("View onprc_ehr.AvailableBloodVolume.
\n");
+ msg.append("
");
}
else
{
- msg.append("The available blood volume data from Mathematica is current.
");
- msg.append("Click here to view labkeyPublic.AvailableBloodVolume.
\n\n");
- msg.append("
");
+ msg.append("OK: The available blood volume data from Mathematica is current (updated within the last hour).
\n");
+ msg.append("View onprc_ehr.AvailableBloodVolume.
\n");
+ msg.append("
");
}
- }}
+ }
+}
\ No newline at end of file
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