From c16c1243caa18e0fcd45e91a0819ca280c95dab0 Mon Sep 17 00:00:00 2001 From: Ankur Juneja Date: Wed, 12 Feb 2025 10:02:08 -0800 Subject: [PATCH 1/2] fix flags inline on click js handler in reports (#888) --- ehr/resources/web/ehr/panel/SnapshotPanel.js | 38 ++++++++++---------- 1 file changed, 18 insertions(+), 20 deletions(-) diff --git a/ehr/resources/web/ehr/panel/SnapshotPanel.js b/ehr/resources/web/ehr/panel/SnapshotPanel.js index 10719b30e..9f435158f 100644 --- a/ehr/resources/web/ehr/panel/SnapshotPanel.js +++ b/ehr/resources/web/ehr/panel/SnapshotPanel.js @@ -39,24 +39,6 @@ Ext4.define('EHR.panel.SnapshotPanel', { this.setLoading(true); this.loadData(); } - - this.on('afterrender', function() { - - var displayField = this.down('#flags'); - if (displayField && displayField.getEl()) { - - var anchor = displayField.getEl('flagsLink'); - - if (anchor) { - Ext4.get(anchor).on('click', function(e) { - e.preventDefault(); - if (anmId) { - EHR.Utils.showFlagPopup(anmId, this); - } - }); - } - } - }, this); }, getBaseItems: function(){ @@ -145,7 +127,23 @@ Ext4.define('EHR.panel.SnapshotPanel', { xtype: 'displayfield', fieldLabel: 'Flags', name: 'flags', - itemId: 'flags' + itemId: 'flags', + listeners: { + change: function(field, newValue, oldValue){ + let anchor = field.getEl('flagsLink'); + if (this?.up('panel')?.up('panel')) { + let anmId = this.up('panel').up('panel').subjectId; + if (anchor) { + Ext4.get(anchor).on('click', function(e) { + e.preventDefault(); + if (anmId) { + EHR.Utils.showFlagPopup(anmId, this); + } + }); + } + } + } + } },{ xtype: 'displayfield', fieldLabel: 'Last TB Date', @@ -723,7 +721,7 @@ Ext4.define('EHR.panel.SnapshotPanel', { } } - toSet['flags'] = values.length ? '' + values.join('
') + '' : null; + toSet['flags'] = values.length ? '
' + values.join('
') + '' : null; }, getFlagDisplayValue: function(row) { From d0b7aca256a322ca16137f5b0094674b9e8068b1 Mon Sep 17 00:00:00 2001 From: Marty Pradere Date: Thu, 13 Feb 2025 10:27:49 -0800 Subject: [PATCH 2/2] Caseid on tasks (#889) - Upgrade scripts and schema xml update to add caseid to ehr.tasks - Fix for units check in lab results --- .../schemas/dbscripts/postgresql/ehr-25.000-25.001.sql | 1 + .../schemas/dbscripts/sqlserver/ehr-25.000-25.001.sql | 1 + ehr/resources/schemas/ehr.xml | 3 +++ ehr/resources/web/ehr/DataEntryUtils.js | 2 +- ehr/src/org/labkey/ehr/EHRModule.java | 2 +- 5 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 ehr/resources/schemas/dbscripts/postgresql/ehr-25.000-25.001.sql create mode 100644 ehr/resources/schemas/dbscripts/sqlserver/ehr-25.000-25.001.sql diff --git a/ehr/resources/schemas/dbscripts/postgresql/ehr-25.000-25.001.sql b/ehr/resources/schemas/dbscripts/postgresql/ehr-25.000-25.001.sql new file mode 100644 index 000000000..7b2ed3190 --- /dev/null +++ b/ehr/resources/schemas/dbscripts/postgresql/ehr-25.000-25.001.sql @@ -0,0 +1 @@ +ALTER TABLE ehr.tasks ADD caseid ENTITYID null; \ No newline at end of file diff --git a/ehr/resources/schemas/dbscripts/sqlserver/ehr-25.000-25.001.sql b/ehr/resources/schemas/dbscripts/sqlserver/ehr-25.000-25.001.sql new file mode 100644 index 000000000..7b2ed3190 --- /dev/null +++ b/ehr/resources/schemas/dbscripts/sqlserver/ehr-25.000-25.001.sql @@ -0,0 +1 @@ +ALTER TABLE ehr.tasks ADD caseid ENTITYID null; \ No newline at end of file diff --git a/ehr/resources/schemas/ehr.xml b/ehr/resources/schemas/ehr.xml index 1f5971573..6f0d07262 100644 --- a/ehr/resources/schemas/ehr.xml +++ b/ehr/resources/schemas/ehr.xml @@ -212,6 +212,9 @@ true + + true + diff --git a/ehr/resources/web/ehr/DataEntryUtils.js b/ehr/resources/web/ehr/DataEntryUtils.js index 7c323b203..99ff5eea7 100644 --- a/ehr/resources/web/ehr/DataEntryUtils.js +++ b/ehr/resources/web/ehr/DataEntryUtils.js @@ -885,7 +885,7 @@ EHR.DataEntryUtils = new function(){ var vol; if (!fixedAmount){ if (valMap.concentration && valMap.dosage && valMap.weight){ - if (valMap.dosage_units === 'ml/kg') { + if (valMap.dosage_units?.toLowerCase() === 'ml/kg') { // Some drugs are in ml/kg instead of mg/kg. In those cases, concentration is irrelevant. vol = valMap.dosage * valMap.weight; diff --git a/ehr/src/org/labkey/ehr/EHRModule.java b/ehr/src/org/labkey/ehr/EHRModule.java index 9bbb864f2..9c6b00561 100644 --- a/ehr/src/org/labkey/ehr/EHRModule.java +++ b/ehr/src/org/labkey/ehr/EHRModule.java @@ -133,7 +133,7 @@ public String getName() @Override public @Nullable Double getSchemaVersion() { - return 25.000; + return 25.001; } @Override