diff --git a/ONPRC_EHR_ComplianceDB/resources/views/employeeDetailsPublic.html b/ONPRC_EHR_ComplianceDB/resources/views/employeeDetailsPublic.html
new file mode 100644
index 000000000..fd1dbddf8
--- /dev/null
+++ b/ONPRC_EHR_ComplianceDB/resources/views/employeeDetailsPublic.html
@@ -0,0 +1,16 @@
+
\ No newline at end of file
diff --git a/ONPRC_EHR_ComplianceDB/resources/views/employeeDetailsPublic.view.xml b/ONPRC_EHR_ComplianceDB/resources/views/employeeDetailsPublic.view.xml
new file mode 100644
index 000000000..2d2c973a7
--- /dev/null
+++ b/ONPRC_EHR_ComplianceDB/resources/views/employeeDetailsPublic.view.xml
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/onprc_ehr/resources/queries/ehr_lookups/cageReview.sql b/onprc_ehr/resources/queries/ehr_lookups/cageReview.sql
index ab21a94d5..38007587f 100644
--- a/onprc_ehr/resources/queries/ehr_lookups/cageReview.sql
+++ b/onprc_ehr/resources/queries/ehr_lookups/cageReview.sql
@@ -42,6 +42,7 @@ SELECT
t.totalWeightExempt,
t.totalHeightExempt
+
FROM (
SELECT
@@ -68,6 +69,8 @@ SELECT
sum(CASE WHEN t0.weightExemption IS NULL THEN 0 ELSE 1 END) as totalWeightExempt,
count(t0.heightExemption) as totalHeightExempt
+
+
FROM (
SELECT
@@ -82,11 +85,14 @@ SELECT
group_concat(c1.height) as heights,
f.heightExemption,
CASE
+ WHEN hf.Id is not null AND c1.height >= pc.cage_type.height THEN 'ERROR: According to the monkeys weight-- it needs a height step taller than required.'
+ WHEN hf.Id is not null AND c1.height < pc.cage_type.height THEN 'NOTE: According to the monkeys weight-- it needs a height step taller than required.'
WHEN (pc.cage_type.height < c1.height AND f.heightExemption IS NULL) THEN ('ERROR: Insufficient height, ' || h.id ||' needs at least: ' || cast(c1.height AS varchar(50)))
WHEN (pc.cage_type.height < c1.height AND f.heightExemption IS NOT NULL) THEN cast(('NOTE: Height Exemption: ' || h.Id) as varchar(500))
ELSE null
END as heightStatus,
- wf.weightExemption
+ wf.weightExemption,
+ hf.height_error
FROM ehr_lookups.connectedCages pc
@@ -98,17 +104,27 @@ LEFT JOIN (
f.id,
min(f.flag.value) as heightExemption
FROM study.flags f
- WHERE f.isActive = true AND f.flag.category = 'Caging Note' and f.flag.description like '%exempt%'
+ WHERE f.isActive = true AND f.flag.category = 'Caging Note' and (f.flag.description like '%height-exempt%' or f.flag.description like '%Medical-exempt%')
GROUP BY f.Id
) f on (f.Id = h.Id)
---weight flags
+ --height flags
+LEFT JOIN (
+ SELECT
+ f.id,
+ min(f.flag.value) as height_error
+ FROM study.flags f
+ WHERE f.isActive = true AND f.flag.category = 'Caging Note' and (f.flag.description like '%height-error%')
+ GROUP BY f.Id
+) hf on (hf.Id = h.Id)
+
+---weight flags
LEFT JOIN (
SELECT
f.id,
min(f.flag.value) as weightExemption
FROM study.flags f
- WHERE f.isActive = true AND f.flag.category = 'Caging Note' and f.flag.description like '%exempt%'
+ WHERE f.isActive = true AND f.flag.category = 'Caging Note' and (f.flag.description like '%weight-exempt%' or f.flag.description like '%Medical-exempt%')
GROUP BY f.Id
) wf on (wf.Id = h.Id)
diff --git a/onprc_ehr/resources/scripts/onprc_ehr/onprc_triggers.js b/onprc_ehr/resources/scripts/onprc_ehr/onprc_triggers.js
index d382b863b..30a298a30 100644
--- a/onprc_ehr/resources/scripts/onprc_ehr/onprc_triggers.js
+++ b/onprc_ehr/resources/scripts/onprc_ehr/onprc_triggers.js
@@ -1256,85 +1256,118 @@ exports.init = function(EHR){
}
}
});
+
+ //Added by Kollil, April 2026
+ function toDateOnly(val) {
+ if (!val)
+ return null;
+
+ // row.date object
+ if (typeof val === 'object' && val.time) {
+ var d = new Date(val.time);
+ return new Date(d.getFullYear(), d.getMonth(), d.getDate());
+ }
+
+ // date strings like "2026-04-20 00:00:00.000"
+ var s = String(val).split(' ')[0]; // keep only YYYY-MM-DD
+ var parts = s.split('-');
+ if (parts.length !== 3)
+ return null;
+
+ return new Date(Number(parts[0]), Number(parts[1]) - 1, Number(parts[2]));
+ }
+
// Added 10-17-2025 R. Blasa
EHR.Server.TriggerManager.unregisterAllHandlersForQueryNameAndEvent('study', 'assignment', EHR.Server.TriggerManager.Events.BEFORE_UPSERT);
- EHR.Server.TriggerManager.registerHandlerForQuery(EHR.Server.TriggerManager.Events.BEFORE_UPSERT, 'study', 'assignment', function(helper, scriptErrors, row, oldRow){
- if (!helper.isETL()){
+ EHR.Server.TriggerManager.registerHandlerForQuery(EHR.Server.TriggerManager.Events.BEFORE_UPSERT, 'study', 'assignment', function(helper, scriptErrors, row, oldRow) {
+ if (!helper.isETL()) {
//note: the the date field is handled above by removeTimeFromDate
EHR.Server.Utils.removeTimeFromDate(row, scriptErrors, 'enddate');
EHR.Server.Utils.removeTimeFromDate(row, scriptErrors, 'projectedRelease');
}
-
//check number of allowed animals at assign/approve time
if (!helper.isETL() && !helper.isQuickValidation() && helper.doStandardProtocolCountValidation() &&
//this is designed to always perform the check on imports, but also updates where the Id was changed
- !(oldRow && oldRow.Id && oldRow.Id==row.Id) &&
+ !(oldRow && oldRow.Id && oldRow.Id == row.Id) &&
row.Id && row.project && row.date
- ){
+ ) {
var assignmentsInTransaction = helper.getProperty('assignmentsInTransaction');
assignmentsInTransaction = assignmentsInTransaction || [];
var msgs = helper.getJavaHelper().verifyProtocolCounts(row.Id, row.project, assignmentsInTransaction);
- if (msgs){
+ if (msgs) {
msgs = msgs.split("<>");
- for (var i=0;i row.enddatefinalized.getTime()){
- row.enddatefinalized = row.enddate;
- }
+ // we want to record the date a record was marked endded, in addition to the actual end itself
+ // NOTE: we only do this when both enddate and releaseType are entered
+ if (!row.enddatefinalized && row.enddate && row.releaseCondition && EHR.Server.Security.getQCStateByLabel(row.QCStateLabel).PublicData) {
+ //note: if ended in the future, defer to that date
+ row.enddatefinalized = new Date();
+ if (row.enddate.getTime() > row.enddatefinalized.getTime()) {
+ row.enddatefinalized = row.enddate;
}
+ }
- //check for condition downgrade for assign condition
- if (!helper.isETL() && row.Id && row.assignCondition){
- var msg = triggerHelper.checkForConditionDowngrade(row.Id, row.date, row.assignCondition);
- if (msg){
- EHR.Server.Utils.addError(scriptErrors, 'assignCondition', msg, 'INFO');
- }
+ //check for condition downgrade for assign condition
+ if (!helper.isETL() && row.Id && row.assignCondition) {
+ var msg = triggerHelper.checkForConditionDowngrade(row.Id, row.date, row.assignCondition);
+ if (msg) {
+ EHR.Server.Utils.addError(scriptErrors, 'assignCondition', msg, 'INFO');
}
+ }
- //check for condition downgrade for assign condition
- if (!helper.isETL() && row.Id && row.date && row.assignCondition){
- var msg = triggerHelper.checkForConditionDowngrade(row.Id, row.date, row.assignCondition);
- if (msg){
- EHR.Server.Utils.addError(scriptErrors, 'assignCondition', msg, 'INFO');
- }
+ //check for condition downgrade for assign condition
+ if (!helper.isETL() && row.Id && row.date && row.assignCondition) {
+ var msg = triggerHelper.checkForConditionDowngrade(row.Id, row.date, row.assignCondition);
+ if (msg) {
+ EHR.Server.Utils.addError(scriptErrors, 'assignCondition', msg, 'INFO');
}
+ }
+
+ //Added by Kollil, April 2026. Refer to ticket # 13807
+ if (row.project && row.date) {
+ var projectEndDate = triggerHelper.getProjectEndDate(row.project); //helper.getJavaHelper().getProjectEndDate(row.project);
+ var assignmentDate = toDateOnly(row.date);
+ var endDate = toDateOnly(projectEndDate);
+
+ if (assignmentDate && endDate && assignmentDate.getTime() > endDate.getTime()) {
+ // console.log('4.5 DEBUG assignmentDate=' + assignmentDate);
+ EHR.Server.Utils.addError(scriptErrors, 'project', 'The assignment start date occurs after the end date of the selected center project. Please review the assignment date and confirm!', 'WARN');
+
+ }
+ }
+
});
//Added 10-5-2022 R.Blasa
diff --git a/onprc_ehr/resources/views/printRoom.html b/onprc_ehr/resources/views/printRoom.html
index 55f2aa8a8..01211fcf8 100644
--- a/onprc_ehr/resources/views/printRoom.html
+++ b/onprc_ehr/resources/views/printRoom.html
@@ -50,6 +50,7 @@
foundCages = true;
Ext4.create('Ext.panel.Panel', {
border: false,
+ width: 1450,
defaults: {
border: false
},
@@ -63,7 +64,7 @@
}
else {
// Hack to improve printing in Chrome
- if (Ext4.isChrome) { Ext4.get(webpart.wrapperDivId).setStyle({zoom: '150%'}); };
+ if (Ext4.isChrome) { Ext4.get(webpart.wrapperDivId).setStyle({zoom: '110%'}); };
}
}, this);
diff --git a/onprc_ehr/resources/web/onprc_ehr/model/sources/BehaviorDefaults.js b/onprc_ehr/resources/web/onprc_ehr/model/sources/BehaviorDefaults.js
index 5207f3b7b..eada6c102 100644
--- a/onprc_ehr/resources/web/onprc_ehr/model/sources/BehaviorDefaults.js
+++ b/onprc_ehr/resources/web/onprc_ehr/model/sources/BehaviorDefaults.js
@@ -117,7 +117,8 @@ EHR.model.DataModelManager.registerMetadata('BehaviorDefaults', {
},
category: {
lookup: {
- filterArray: [LABKEY.Filter.create('category', 'Behavior')]
+ filterArray: [LABKEY.Filter.create('category', 'Behavior'),
+ LABKEY.Filter.create('value', 'Behaviors',LABKEY.Filter.Types.NEQ)]
}
}
}
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 d9b85865e..a8a9dac6a 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
@@ -2020,6 +2020,33 @@ public boolean requiresAssistingStaff(Integer procedureId)
return "Surgery".equals(category);
}
+ //Added by Kollil
+ //Date: Apr 2026
+ public Date getProjectEndDate(Object projectId)
+ {
+ if (projectId == null)
+ return null;
+
+ int pid;
+ if (projectId instanceof Number)
+ pid = ((Number) projectId).intValue();
+ else
+ pid = Integer.parseInt(projectId.toString());
+
+ UserSchema ehrSchema = QueryService.get().getUserSchema(_user, _container, "ehr");
+ if (ehrSchema == null)
+ return null;
+
+ TableInfo ti = ehrSchema.getTable("project");
+ if (ti == null)
+ return null;
+
+ SimpleFilter filter = new SimpleFilter(FieldKey.fromString("project"), pid);
+ TableSelector ts = new TableSelector(ti, Collections.singleton("enddate"), filter, null);
+
+ return ts.getObject(Date.class);
+ }
+
public String getSpeciesForDam(String dam)
{
return new TableSelector(getTableInfo("study", "demographics"), PageFlowUtil.set("species"), new SimpleFilter(FieldKey.fromString("Id"), dam), null).getObject(String.class);